| | |
| | | filesList = IO.FileUtils.ReadFiles ().FindAll ((obj) => { return obj.Split ('_').Length == 5; }); |
| | | } |
| | | |
| | | |
| | | public void ShowScene (Action<string> action) |
| | | { |
| | | this.BackgroundColor = SkinStyle.Current.MainColor; |
| | |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnMaxBrightness); |
| | | horizontalSeekBar.ProgressChanged += (sender, e) => { |
| | | //Console.WriteLine (DateTime.Now.ToString ()); |
| | | //Utlis.WriteLine (DateTime.Now.ToString ()); |
| | | btnMaxBrightness.Text = horizontalSeekBar.Progress + "%"; |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | if ((System.DateTime.Now - (DateTime)(horizontalSeekBar.Tag)).TotalMilliseconds < 100) { |
| | |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnMaxBrightness); |
| | | horizontalSeekBar.ProgressChanged += (sender, e) => { |
| | | //Console.WriteLine (DateTime.Now.ToString ()); |
| | | //Utlis.WriteLine (DateTime.Now.ToString ()); |
| | | btnMaxBrightness.Text = horizontalSeekBar.Progress + "%"; |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | if ((System.DateTime.Now - (DateTime)(horizontalSeekBar.Tag)).TotalMilliseconds < 100) { |
| | |
| | | btnOpenCurtain.IsSelected = false; |
| | | btnStopCurtain.IsSelected = false; |
| | | curtainmodel.Status = (CurtainStatus)2; |
| | | Control.ControlBytesSend (Command.UpdataCurtainModelStutas, curtainmodel.SubnetID, curtainmodel.DeviceID, |
| | | new byte [] { curtainmodel.LoopID, (byte)curtainmodel.Status }); |
| | | }; |
| | | btnOpenCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | btnCloseCurtain.IsSelected = false; |
| | | btnOpenCurtain.IsSelected = true; |
| | | btnStopCurtain.IsSelected = false; |
| | | curtainmodel.Status = (CurtainStatus)1; |
| | | Control.ControlBytesSend (Command.UpdataCurtainModelStutas, curtainmodel.SubnetID, curtainmodel.DeviceID, |
| | | new byte [] { curtainmodel.LoopID, (byte)curtainmodel.Status }); |
| | | }; |
| | | btnStopCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | btnCloseCurtain.IsSelected = false; |
| | | btnOpenCurtain.IsSelected = false; |
| | | btnStopCurtain.IsSelected = true; |
| | | curtainmodel.Status = (CurtainStatus)0; |
| | | Control.ControlBytesSend (Command.UpdataCurtainModelStutas, curtainmodel.SubnetID, curtainmodel.DeviceID, |
| | | new byte [] { curtainmodel.LoopID, (byte)curtainmodel.Status }); |
| | | }; |
| | | if (curtainmodel.Status == 0) { |
| | | btnStopCurtain.IsSelected = true; |
| | |
| | | Y = tempSeekBarFrame.Bottom + Application.GetRealHeight (40), |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnOpenCurtain); |
| | | btnOpenCurtain.MouseUpEventHandler += (sender, e) => { |
| | | Control.ControlBytesSend (Command.UpdataCurtainModelStutas, curtainroller.SubnetID, curtainroller.DeviceID, new byte [] { 17, 100 }); |
| | | horizontalSeekBar.Progress = 100; |
| | | btnMaxBrightness.Text = "100%"; |
| | | }; |
| | | //btnOpenCurtain.MouseUpEventHandler += (sender, e) => { |
| | | // Control.ControlBytesSend (Command.UpdataCurtainModelStutas, curtainroller.SubnetID, curtainroller.DeviceID, new byte [] { 17, 100 }); |
| | | // horizontalSeekBar.Progress = 100; |
| | | // btnMaxBrightness.Text = "100%"; |
| | | //}; |
| | | Button btnOpenLbl = new Button () { |
| | | Width = Application.GetRealWidth (124), |
| | | Height = Application.GetRealHeight (30), |
| | |
| | | SelectedImagePath = "Curtain/CurtainRollerDownOn.png", |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnCloseCurtain); |
| | | btnCloseCurtain.MouseUpEventHandler += (sender, e) => { |
| | | Control.ControlBytesSend (Command.UpdataCurtainModelStutas, curtainroller.SubnetID, curtainroller.DeviceID, new byte [] { 17, 0 }); |
| | | horizontalSeekBar.Progress = 0; |
| | | btnMaxBrightness.Text = "0%"; |
| | | }; |
| | | //btnCloseCurtain.MouseUpEventHandler += (sender, e) => { |
| | | // Control.ControlBytesSend (Command.UpdataCurtainModelStutas, curtainroller.SubnetID, curtainroller.DeviceID, new byte [] { 17, 0 }); |
| | | // horizontalSeekBar.Progress = 0; |
| | | // btnMaxBrightness.Text = "0%"; |
| | | //}; |
| | | Button btnCloseLbl = new Button () { |
| | | Width = Application.GetRealWidth (124), |
| | | Height = Application.GetRealHeight (30), |
| | |
| | | }; |
| | | dialogBodyLayout.AddChidren (btnCloseLbl); |
| | | btnCloseCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | Control.ControlBytesSend (Command.UpdataCurtainModelStutas, curtainroller.SubnetID, curtainroller.DeviceID, new byte [] { 17, 0 }); |
| | | horizontalSeekBar.Progress = 0; |
| | | btnMaxBrightness.Text = "0%"; |
| | | btnCloseCurtain.IsSelected = true; |
| | | btnOpenCurtain.IsSelected = false; |
| | | btnStopCurtain.IsSelected = false; |
| | | curtainroller.Status = (CurtainStatus)2; |
| | | |
| | | }; |
| | | btnOpenCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | Control.ControlBytesSend (Command.UpdataCurtainModelStutas, curtainroller.SubnetID, curtainroller.DeviceID, new byte [] { 17, 100 }); |
| | | horizontalSeekBar.Progress = 100; |
| | | btnMaxBrightness.Text = "100%"; |
| | | btnCloseCurtain.IsSelected = false; |
| | | btnOpenCurtain.IsSelected = true; |
| | | btnStopCurtain.IsSelected = false; |
| | | curtainroller.Status = (CurtainStatus)1; |
| | | |
| | | }; |
| | | btnStopCurtain.MouseUpEventHandler += (sender3, e3) => { |
| | | btnCloseCurtain.IsSelected = false; |
| | |
| | | }; |
| | | var commonBytes = IO.FileUtils.ReadFile (deviceFilePath); |
| | | if (commonBytes.Length == 0) { |
| | | Console.WriteLine ("length loss"); |
| | | Utlis.WriteLine ("length loss"); |
| | | continue; |
| | | } |
| | | if (commonBytes.Length == 1) { |
| | | Console.WriteLine ("length loss 1"); |
| | | Utlis.WriteLine ("length loss 1"); |
| | | continue; |
| | | } |
| | | Common commonDevice = Newtonsoft.Json.JsonConvert.DeserializeObject<Common> (System.Text.Encoding.UTF8.GetString (commonBytes)); |
| | |
| | | |
| | | if (sceneFilePath == Scene.GlobalSceneFilePath) { |
| | | foreach (var filePath in scene.DeviceFilePathList) { |
| | | System.Console.WriteLine (filePath); |
| | | Utlis.WriteLine (filePath); |
| | | if (filePath.EndsWith (deviceFilePath)) { |
| | | btnEquipment.IsSelected = true; |
| | | break; |