wxr
2022-12-14 a61775710f8c4466db5bfce58af58f886d58edf3
SmartHome/UI/SimpleControl/Phone/System/SystemMiddle.cs
@@ -24,7 +24,7 @@
        /// 未知版本
        /// 无需升级 2022-12-08 14:23:07
        /// </summary>
        string text_UnknownVersion = "无需升级";
        string text_UnknownVersion = "其他版本";
        /// <summary>
        /// 读取失败
        /// </summary>
@@ -52,7 +52,7 @@
                text_Upgraded = "Upgraded";
                text_Upgrading = "Upgrading";
                text_UpgradeFailed = "Upgrade failed";
                text_UnknownVersion = "No upgrade required";
                text_UnknownVersion = "Other version";
                text_readFailure = "Read failure";
                text_search = "Search and configure";
                text_reading = "Reading";
@@ -76,7 +76,7 @@
            /// 底部
            /// </summary>
            Button AddSystemEquipmentButton = new Button () {
                Y = Application.GetRealHeight (846 + 80),
                Y = Application.GetRealHeight (846 + 80 ),
                Height = Application.GetRealHeight (90),
                Text = text_search,
                TextAlignment = TextAlignment.Center,
@@ -86,7 +86,6 @@
            AddChidren (AddSystemEquipmentButton);
            AddSystemEquipmentButton.MouseUpEventHandler += (sender, e) => {
                VerticalScrolViewMiddle.RemoveAll ();
                CommonPage.FindGateway = true;
                MainPage.Loading.Start ();
                System.Threading.Tasks.Task.Run (() => {
                    try {
@@ -95,7 +94,6 @@
                        CommonPage.RandomHigh = (byte)new Random ().Next (255);
                        CommonPage.RandomLow = (byte)new Random ().Next (255);
                        CommonPage.GateWayList.Clear ();
                        CommonPage.FindGateway = true;
                        //如果两次都没有数据反馈,就不读取
                        int readCount = 2;
                        while (0 < readCount) {
@@ -120,19 +118,21 @@
                            Control control = new Control ();
                            control.Send (new Target () {
                                IPEndPoint = CommonPage.EndPoint,
                                Command = Command.ReadGateway,
                                Command = Command.ReadRemark,
                                //Command = Command.ReadGateway,
                                SubnetID = 0xFF,
                                DeviceID = 0xFF,
                                AddData = ms.ToArray ()
                                AddData = new byte [] { },
                            }, SendCount.Zero, false);
                            control.Send (new Target () {
                                IPEndPoint = new System.Net.IPEndPoint (new Net.NetWiFi ().BroadcastIpAddress, 6000),
                                Command = Command.ReadGateway,
                                SubnetID = 0xFF,
                                DeviceID = 0xFF,
                                AddData = ms.ToArray ()
                            }, SendCount.Zero, false);
                            //control.Send (new Target () {
                            //    IPEndPoint = new System.Net.IPEndPoint (new Net.NetWiFi ().BroadcastIpAddress, 6000),
                            //    Command = Command.ReadRemark,
                            //    //Command = Command.ReadGateway,
                            //    SubnetID = 0xFF,
                            //    DeviceID = 0xFF,
                            //    AddData = ms.ToArray ()
                            //}, SendCount.Zero, false);
                            System.Threading.Thread.Sleep (800);
                            //如果数量不相等,就重置次数
@@ -140,7 +140,6 @@
                                readCount = 2;
                            }
                        }
                        CommonPage.FindGateway = false;
                   
                        Application.RunOnMainThread (() => {
@@ -209,7 +208,7 @@
            Button rightButton1 = new Button () {
                X = Application.GetRealWidth (480),
                Width = Application.GetRealWidth (100),
                Width = Application.GetRealWidth (150),
                Height = Application.GetRealHeight (40),
                Gravity = Gravity.CenterVertical,
                TextAlignment = TextAlignment.CenterLeft,