| | |
| | | Tag = "Logic"; |
| | | } |
| | | /// <summary> |
| | | /// 设备延时时间 |
| | | /// </summary> |
| | | private string strdelay = "0"; |
| | | /// <summary> |
| | | /// 显示设备延时时间 |
| | | /// </summary> |
| | | private Button btnDelay =null; |
| | | /// <summary> |
| | | /// 定义一个记录选中设备状态列表; |
| | | /// </summary> |
| | | private List<Dictionary<string, string>> dicSateteList = new List<Dictionary<string, string>>(); |
| | |
| | | LogicView.FunTypeView lightSwitchView = new LogicView.FunTypeView(); |
| | | lightSwitchView.btnText.TextID = StringId.switchLogic; |
| | | fLayout.AddChidren(lightSwitchView.FLayoutView()); |
| | | |
| | | |
| | | ///设备延时iewv |
| | | DelayView(fLayout, lightSwitchView.frameLayout.Bottom); |
| | | #endregion |
| | | #region 点击事件 |
| | | ///开关点击事件 |
| | |
| | | brightnessView.frameLayout.Y = lightSwitchView.frameLayout.Bottom; |
| | | brightnessView.btnText.TextID = StringId.brightnesLogic; |
| | | fLayout.AddChidren(brightnessView.FLayoutView()); |
| | | brightnessView.btnState.Text = "5%";//产品经理晓辉要求改的 2021-11-06 |
| | | //brightnessView.btnState.Text = "5%";//产品经理晓辉要求改的 2021-11-06 |
| | | ///设备延时iewv |
| | | DelayView(fLayout, brightnessView.frameLayout.Bottom); |
| | | #endregion |
| | | #region 点击事件 |
| | | ///开关点击事件 |
| | |
| | | break; |
| | | //窗帘 |
| | | case SPK.CurtainSwitch: |
| | | case SPK.CurtainTrietex: |
| | | case SPK.CurtainRoller: |
| | | { |
| | | #region 界面 |
| | | ///开关 |
| | | LogicView.FunTypeView curtainSwitchView = new LogicView.FunTypeView(); |
| | | curtainSwitchView.btnText.TextID = StringId.switchLogic; |
| | | fLayout.AddChidren(curtainSwitchView.FLayoutView()); |
| | | DelayView(fLayout, curtainSwitchView.frameLayout.Bottom); |
| | | #endregion |
| | | #region 点击事件 |
| | | ///开关点击事件 |
| | |
| | | { |
| | | //显示编辑之前的设备状态 |
| | | GetEditState(device, index, curtainSwitchView.btnState, null, null, null); |
| | | } |
| | | #endregion |
| | | } |
| | | break; |
| | | case SPK.CurtainTrietex: |
| | | case SPK.CurtainRoller: |
| | | { |
| | | #region 界面 |
| | | ///开关 |
| | | LogicView.FunTypeView curtainSwitchView = new LogicView.FunTypeView(); |
| | | curtainSwitchView.btnText.TextID = StringId.switchLogic; |
| | | fLayout.AddChidren(curtainSwitchView.FLayoutView()); |
| | | ///百分比 |
| | | LogicView.FunTypeView crtainPercentumView = new LogicView.FunTypeView(); |
| | | crtainPercentumView.frameLayout.Y = curtainSwitchView.frameLayout.Bottom; |
| | | crtainPercentumView.btnText.TextID = StringId.percentum; |
| | | fLayout.AddChidren(crtainPercentumView.FLayoutView()); |
| | | crtainPercentumView.btnState.Text = "5%";//产品经理晓辉要求改的 2021-11-06 |
| | | ///设备延时iewv |
| | | DelayView(fLayout, crtainPercentumView.frameLayout.Bottom); |
| | | #endregion |
| | | #region 点击事件 |
| | | ///开关点击事件 |
| | | curtainSwitchView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | SwitchViewMethod(device, curtainSwitchView.btnState, 3); |
| | | }; |
| | | ///百分比点击事件 |
| | | crtainPercentumView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | BrightnessMethod(device, crtainPercentumView.btnState, crtainPercentumView.btnText.Text); |
| | | }; |
| | | if (edit) |
| | | { |
| | | //显示编辑之前的设备状态 |
| | | GetEditState(device, index, curtainSwitchView.btnState, crtainPercentumView.btnState, null, null); |
| | | } |
| | | #endregion |
| | | } |
| | |
| | | acSpeedView.frameLayout.Y = acModehView.frameLayout.Bottom; |
| | | acSpeedView.btnText.TextID = StringId.speedLogic; |
| | | fLayout.AddChidren(acSpeedView.FLayoutView()); |
| | | ///设备延时iewv |
| | | DelayView(fLayout, acModehView.frameLayout.Bottom); |
| | | #endregion |
| | | #region 点击事件 |
| | | ///开关点击事件 |
| | |
| | | floorHeatingModehView.btnText.TextID = StringId.modeLogic; |
| | | fLayout.AddChidren(floorHeatingModehView.FLayoutView()); |
| | | |
| | | |
| | | ///设备延时iewv |
| | | DelayView(fLayout, floorHeatingModehView.frameLayout.Bottom); |
| | | #endregion |
| | | #region 点击事件 |
| | | ///开关点击事件 |
| | |
| | | AirFreshSpeedView.frameLayout.Y = AirFreshSwitchVie.frameLayout.Bottom; |
| | | AirFreshSpeedView.btnText.TextID = StringId.speedLogic; |
| | | fLayout.AddChidren(AirFreshSpeedView.FLayoutView()); |
| | | |
| | | ///设备延时iewv |
| | | DelayView(fLayout, AirFreshSpeedView.frameLayout.Bottom); |
| | | #endregion |
| | | #region 点击事件 |
| | | ///开关点击事件 |
| | |
| | | Output outputDevice = new Output(); |
| | | outputDevice.target_type = "1"; |
| | | outputDevice.sid = device.sid; |
| | | outputDevice.delay= strdelay; |
| | | switch (device.spk) |
| | | { |
| | | case SPK.LightDimming: |
| | |
| | | if (edit) |
| | | { |
| | | //更新延时时间 |
| | | outputDevice.delay = Logic.currlogic.output[index].delay; |
| | | outputDevice.delay = strdelay;//Logic.currlogic.output[index].delay; |
| | | //移除旧数据 |
| | | Logic.currlogic.output.RemoveAt(index); |
| | | //新数据插入旧数据的位置; |
| | |
| | | #endregion |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 延时View |
| | | /// </summary> |
| | | /// <param name="fLayout">父控件</param> |
| | | /// <param name="bottomY">在哪个控件下面</param> |
| | | private void DelayView(FrameLayout fLayout, int bottomY) |
| | | { |
| | | LogicView.FunTypeView delayView = new LogicView.FunTypeView(); |
| | | delayView.frameLayout.Y = bottomY; |
| | | delayView.btnText.TextID = StringId.Delay; |
| | | delayView.btnState.Text = strdelay + "s"; |
| | | fLayout.AddChidren(delayView.FLayoutView()); |
| | | ///赋值对象 |
| | | this.btnDelay = delayView.btnState; |
| | | ///延时点击事件 |
| | | delayView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | InpOrOutLogicMethod inpOrOutLogicMethod = new InpOrOutLogicMethod(); |
| | | inpOrOutLogicMethod.Delayed(this, strdelay, (value) => |
| | | { |
| | | selectedState = "delay_" + strdelay; |
| | | strdelay = value.ToString(); |
| | | delayView.btnState.Text = strdelay + "s"; |
| | | }); |
| | | }; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 开关=功能下一级界面 |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 亮度/百分比=功能下一级界面 |
| | | /// </summary> |
| | | /// <param name="device"></param> |
| | | /// <param name="button"></param> |
| | | /// <param name="device">设备对象</param> |
| | | /// <param name="button">显示状态对象</param> |
| | | /// <param name="titleName">标题</param> |
| | | private void BrightnessMethod(Entity.Function device, Button button, string titleName) |
| | | { |
| | | #region 界面 |
| | |
| | | //有数据重新赋值 |
| | | dicSateteList = dicList; |
| | | } |
| | | if (this.btnDelay != null) |
| | | { |
| | | ///延时显示文本 |
| | | this.btnDelay.Text = outputs.delay + "s"; |
| | | this.strdelay = outputs.delay; |
| | | } |
| | | InpOrOutLogicMethod.EditState(device, dicList, button1, button2, button3, button4); |
| | | } |
| | | /// <summary> |