| | |
| | | }; |
| | | if (edit) |
| | | { |
| | | GetEditState(device, edit, index, lightSwitchView.btnState, null, null, null); |
| | | GetEditState(device, index, lightSwitchView.btnState, null, null, null); |
| | | } |
| | | |
| | | } |
| | |
| | | /// 显示编辑之前的设备状态 |
| | | /// </summary> |
| | | /// <param name="device">编辑设备</param> |
| | | /// <param name="edit">编辑状态</param> |
| | | /// <param name="index">编辑数据的索引</param> |
| | | /// <param name="button1">显示Btn</param> |
| | | /// <param name="button2">显示Btn</param> |
| | | /// <param name="button3">显示Btn</param> |
| | | /// <param name="button4">显示Btn</param> |
| | | private void GetEditState(Entity.Function device, bool edit, int index, Button button1, Button button2, Button button3, Button button4) |
| | | private void GetEditState(Entity.Function device , int index, Button button1, Button button2, Button button3, Button button4) |
| | | { |
| | | Input inputs = Logic.currlogic.input[index]; |
| | | var dicList = inputs.condition as List<Dictionary<string, string>>; |
| | | //清除之前旧数据 |
| | | dicSateteList.Clear(); |
| | | if (dicList.Count != 0) |
| | | { |
| | | //有数据重新赋值 |
| | | dicSateteList = dicList; |
| | | } |
| | | switch (device.functionType) |
| | | { |
| | | //开关灯光 light.Switch |
| | |
| | | switchView.btnOn.MouseUpEventHandler += (sender2, e2) => |
| | | { |
| | | LogicMethod.dictionary(dic, "value", "on"); |
| | | RemView(frame); |
| | | button.TextID = StringId.onLogic; |
| | | selectedState = device.functionType + "_on"; |
| | | AddDictionaryData(dicSateteList, keyVlaue, dic); |
| | | RemView(frame); |
| | | }; |
| | | switchView.btnOff.MouseUpEventHandler += (sender3, e3) => |
| | | { |
| | | LogicMethod.dictionary(dic, "value", "off"); |
| | | RemView(frame); |
| | | button.TextID = StringId.offLogic; |
| | | selectedState = device.functionType + "_off"; |
| | | AddDictionaryData(dicSateteList, keyVlaue, dic); |
| | | RemView(frame); |
| | | }; |
| | | if (button.Text != "") |
| | | { |