| | |
| | | //tvoc |
| | | case SPK.SensorTVOC: |
| | | { |
| | | |
| | | ///tvoc |
| | | LogicView.FunTypeView tvocView = new LogicView.FunTypeView(); |
| | | tvocView.btnText.TextID = StringId.tvoc; |
| | |
| | | PmCo2TvocAction(this, device, "hcho", StringId.Formaldehyde, index, edit); |
| | | |
| | | }; |
| | | } |
| | | 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; |
| | | } |
| | |
| | | /// <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; |
| | |
| | | /// <param name="stateValue">编辑之前的状态值,默认为""</param> |
| | | public void PmCo2TvocAction(FrameLayout frame, Entity.Function device, string key, int title, int index, bool edit, string stateValue = "") |
| | | { |
| | | if (edit) |
| | | if (edit) |
| | | { |
| | | /// |
| | | this.function = device; |
| | |
| | | } |
| | | } |
| | | PublicInterface view = new PublicInterface(); |
| | | var listStr = view.GetViewList(key); |
| | | view.SingleSelectionShow(frame, listStr, Language.StringByID(title), view.GetString(key, stateValue) |
| | | //var listStr = view.GetViewList(key); |
| | | var listStr = view.GetSensorLevelList(device);//2022年05月25日10:01:33 产品经理君煌要求改成动态 |
| | | view.SingleSelectionShow(frame, listStr, Language.StringByID(title), view.GetSensorLevelText(device, stateValue,true) |
| | | , (text) => |
| | | { |
| | | |
| | | var value = view.GetValue(key, text); |
| | | //var value = view.GetValue(key, text); |
| | | var values = view.GetSensorLevelText(device,text,false); |
| | | selectedState = device.spk + "_" + key; |
| | | switch (device.spk) |
| | | { |
| | |
| | | } |
| | | break; |
| | | } |
| | | AddDictionary(key, value, "integer", "in"); |
| | | AddDictionary(key, values, "integer", "in"); |
| | | Save(device, index, edit); |
| | | }); |
| | | } |