| | |
| | | }; |
| | | } |
| | | break; |
| | | //门锁 |
| | | case SPK.DoorLock: |
| | | { |
| | | |
| | | LogicView.FunTypeView view = new LogicView.FunTypeView(); |
| | | view.btnText.TextID = StringId.shifoukaisuoshi; |
| | | fLayout.AddChidren(view.FLayoutView()); |
| | | view.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | DeviceView(device, view.btnState, StringId.shi, StringId.offLogic,1); |
| | | }; |
| | | if (edit) |
| | | { |
| | | GetEditState(device, index, view.btnState, null, null, null); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | #region 保存 |
| | | ///保存View |
| | |
| | | /// <param name="button">选中状态显示文本Btn控件</param> |
| | | /// <param name="btnText1">属性状态值文本1</param> |
| | | /// <param name="btnText2">属性状态值文本2</param> |
| | | private void DeviceView(Entity.Function device, Button button, int btnText1, int btnText2) |
| | | /// <param name="viewCount">view数量</param> |
| | | private void DeviceView(Entity.Function device, Button button, int btnText1, int btnText2,int viewCount=2) |
| | | { |
| | | FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence }; |
| | | this.AddChidren(frame); |
| | | LogicView.SwitchView switchView = new LogicView.SwitchView(); |
| | | switchView.FLayoutView(frame, btnText1, btnText2, button.Text, (intValue) => |
| | | switchView.FLayoutView(frame, btnText1, btnText2, button.Text, viewCount,(intValue) => |
| | | { |
| | | //设备属性值,云雀上定义好的; |
| | | string keyVlaue = "on_off"; |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.DoorLock: |
| | | { |
| | | keyVlaue = "door_status"; |
| | | } |
| | | break; |
| | | |
| | | } |
| | | switch (intValue) |
| | |
| | | } |
| | | } |
| | | break; |
| | | case StringId.shi: |
| | | case StringId.kaiqi: |
| | | { |
| | | value = "open"; |
| | |
| | | { |
| | | value = "fall"; |
| | | }; break; |
| | | |
| | | |
| | | } |
| | | //显示文本 |
| | | button.TextID = intValue; |