old mode 100644
new mode 100755
| | |
| | | ///记录条件类型 |
| | | inputView.btnClick.Name = inputCondition.condition_type; |
| | | ///记录条件索引 |
| | | inputView.btnClick.Tag = i; |
| | | inputView.btnClick.Tag = inputCondition.sid; |
| | | ///条件状态数组 |
| | | List<Dictionary<string, string>> dicList = inputCondition.condition as List<Dictionary<string, string>>; |
| | | //显示条件各种类型状态 |
| | |
| | | { |
| | | case "1": |
| | | { |
| | | inputView.btnIcon.UnSelectedImagePath = "LogicIcon/timecondition.png"; |
| | | inputView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png"; |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | |
| | | break; |
| | | case "2": |
| | | { |
| | | inputView.btnIcon.UnSelectedImagePath = "LogicIcon/timecondition.png"; |
| | | inputView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png"; |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | |
| | | { |
| | | Button button = (Button)sen; |
| | | //找到当前编辑的索引 |
| | | int indexVulae = int.Parse(inputView.btnClick.Tag.ToString()); |
| | | int indexVulae = 0; |
| | | for (int index = 0; index < Logic.currlogic.input.Count; index++) |
| | | { |
| | | Input input = Logic.currlogic.input[index]; |
| | | if (input.sid == inputView.btnClick.Tag.ToString()) |
| | | { |
| | | //用户可能删除数据,使列表索引发生改变; |
| | | //通过唯一sid重新查找到索引且更新索引值 |
| | | indexVulae = index; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //标记编辑状态 |
| | | bool edit = true; |
| | | switch (button.Name) |
| | |
| | | timeTpye.TimeHorizon(fLayout, edit, indexVulae); |
| | | } |
| | | break; |
| | | |
| | | case "3": |
| | | { |
| | | //用sid找到设备; |
| | |
| | | /// <param name="viewLayout">上下滑动控件</param> |
| | | public static void OutputTarget(FrameLayout thisView, VerticalScrolViewLayout viewLayout) |
| | | { |
| | | |
| | | |
| | | for (int i = 0; i < Logic.currlogic.output.Count; i++) |
| | | { |
| | | Output outputTarget = Logic.currlogic.output[i]; |
| | |
| | | ///记录条件类型 |
| | | targetView.btnClick.Name = outputTarget.target_type; |
| | | ///记录条件索引 |
| | | targetView.btnClick.Tag = i; |
| | | targetView.btnClick.Tag = outputTarget.sid; |
| | | ///条件状态数组 |
| | | List<Dictionary<string, string>> dicList = outputTarget.status as List<Dictionary<string, string>>; |
| | | //显示条件各种类型状态 |
| | | //显示输出条件各种类型状态 |
| | | switch (outputTarget.target_type) |
| | | { |
| | | case "1": |
| | |
| | | { |
| | | string on_off = GetKeyValue("on_off", dicList); |
| | | string brightness = GetKeyValue("brightness", dicList); |
| | | if (on_off != "") |
| | | if (on_off == "on" && brightness != "") |
| | | { |
| | | if (on_off == "on") |
| | | { |
| | | stateStr = Language.StringByID(StringId.onLogic); |
| | | |
| | | } |
| | | else |
| | | { |
| | | stateStr = Language.StringByID(StringId.offLogic); |
| | | |
| | | } |
| | | stateStr = Language.StringByID(StringId.onLogic) + brightness + "%"; |
| | | } |
| | | if (brightness != "") |
| | | else if (on_off == "on") |
| | | { |
| | | stateStr += brightness + "%"; |
| | | stateStr = Language.StringByID(StringId.onLogic); |
| | | } |
| | | if (on_off != "" && on_off == "off") |
| | | else if (on_off == "off") |
| | | { |
| | | targetView.btnState.Text = Language.StringByID(StringId.offLogic); |
| | | stateStr = Language.StringByID(StringId.offLogic); |
| | | } |
| | | else |
| | | else if (brightness != "") |
| | | { |
| | | targetView.btnState.Text = stateStr; |
| | | |
| | | stateStr = brightness + "%"; |
| | | } |
| | | |
| | | targetView.btnState.Text = stateStr; |
| | | } |
| | | break; |
| | | case FunctionType.Curtain: |
| | | {//开关灯 |
| | | case FunctionType.MotorCurtain: |
| | | case FunctionType.RollingShutter: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | |
| | | } |
| | | } |
| | | targetView.btnState.Text = stateStr; |
| | | } |
| | | break; |
| | | case FunctionType.MotorCurtain: |
| | | case FunctionType.RollingShutter: |
| | | {//开关灯 |
| | | string on_off = GetKeyValue("on_off", dicList); |
| | | string brightness = GetKeyValue("brightness", dicList); |
| | | if (on_off != "") |
| | | { |
| | | switch (on_off) |
| | | { |
| | | case "on": |
| | | { |
| | | stateStr = Language.StringByID(StringId.onLogic); |
| | | |
| | | } |
| | | break; |
| | | case "off": |
| | | { |
| | | stateStr = Language.StringByID(StringId.offLogic); |
| | | |
| | | } |
| | | break; |
| | | case "stop": |
| | | { |
| | | stateStr = Language.StringByID(StringId.stop); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | if (brightness != "") |
| | | { |
| | | stateStr += brightness + "%"; |
| | | |
| | | } |
| | | |
| | | if (on_off != "" && on_off == "stop") |
| | | { |
| | | targetView.btnState.Text = Language.StringByID(StringId.stop); |
| | | } |
| | | else |
| | | { |
| | | targetView.btnState.Text = stateStr; |
| | | |
| | | } |
| | | |
| | | } |
| | | break; |
| | | case FunctionType.AC: { |
| | |
| | | { |
| | | Button button = (Button)sen; |
| | | //找到当前编辑的索引 |
| | | int indexVulae = int.Parse(targetView.btnClick.Tag.ToString()); |
| | | int indexVulae =0; |
| | | for (int index = 0; index < Logic.currlogic.output.Count; index++) |
| | | { |
| | | Output target = Logic.currlogic.output[index]; |
| | | if (target.sid == targetView.btnClick.Tag.ToString()) |
| | | { |
| | | //用户可能删除数据,使列表索引发生改变; |
| | | //通过唯一sid重新查找到索引且更新索引值 |
| | | indexVulae = index; |
| | | break; |
| | | } |
| | | } |
| | | //标记编辑状态 |
| | | bool edit = true; |
| | | switch (button.Name) |