| | |
| | | //LoadFunctionRow(sceneFunction.localFunction.trait_on_off); |
| | | //switch (sceneFunction.localFunction.functionType) |
| | | //{ |
| | | // case FunctionType.AC: |
| | | // case SPK.AcStandard: |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp")); |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "mode")); |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "fan")); |
| | | // break; |
| | | // case FunctionType.FloorHeating: |
| | | // case SPK.FloorHeatStandard: |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp")); |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "mode")); |
| | | // break; |
| | | // case FunctionType.Curtain: |
| | | // case SPK.CurtainSwitch: |
| | | // //无操作 |
| | | // break; |
| | | // case FunctionType.MotorCurtain: |
| | | // case FunctionType.RollingShutter: |
| | | // case SPK.CurtainTrietex: |
| | | // case SPK.CurtainRoller: |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "percent")); |
| | | // break; |
| | | // case FunctionType.Relay: |
| | | // case SPK.LightSwitch: |
| | | // //无操作 |
| | | // break; |
| | | // case FunctionType.Dimmer: |
| | | // case FunctionType.RGB: |
| | | // case SPK.LightDimming: |
| | | // case SPK.LightRGB: |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "brightness")); |
| | | // break; |
| | | //} |
| | | |
| | | //加载延时Row |
| | | LoadDelayRow(); |
| | | if (DB_ResidenceData.Instance.GatewayType != 0) |
| | | { |
| | | //加载延时Row |
| | | LoadDelayRow(); |
| | | } |
| | | |
| | | var bottomView = new FrameLayout() |
| | | { |
| | |
| | | // } |
| | | // catch { } |
| | | //} |
| | | |
| | | if (temp != null) |
| | | { |
| | | temp = sceneFunction; |
| | |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(row); |
| | | |
| | | |
| | | if (sceneStatus.key != FunctionAttributeKey.OnOff) |
| | | { |
| | | row.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | } |
| | | else |
| | | { |
| | | if(sceneStatus.value == "stop") |
| | | { |
| | | sceneStatus.value = "on"; |
| | | } |
| | | } |
| | | Button btnRight = new Button() |
| | | { |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = FunctionList.List.GetValueText(sceneStatus.key,sceneStatus.value) + FunctionList.List.GetUintString(sceneStatus.key) |
| | | Text = sceneStatus.GetValueText() + sceneStatus.GetUintString() |
| | | }; |
| | | row.AddChidren(btnFunctionText); |
| | | if (sceneStatus.key == FunctionAttributeKey.OnOff) |
| | | { |
| | | btnOnText = btnFunctionText; |
| | | } |
| | | else if (sceneStatus.key == FunctionAttributeKey.Brightness) |
| | | else if (sceneStatus.key == FunctionAttributeKey.Brightness || sceneStatus.key == FunctionAttributeKey.Percent) |
| | | { |
| | | btnBrightnessText = btnFunctionText; |
| | | } |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | Text = FunctionList.List.GetNameText(sceneStatus.key) |
| | | Text = sceneStatus.GetNameText() |
| | | }; |
| | | row.AddChidren(btnFunctionName); |
| | | btnFunctionName.MouseUpEventHandler = (sender, e) => |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = FunctionList.List.GetDelayText( sceneFunction.delay) |
| | | Text = new Scene() { delay = sceneFunction.delay }.GetDelayText() |
| | | }; |
| | | delayRow.AddChidren(btnDelayInfo); |
| | | |
| | |
| | | btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => { |
| | | Action<string> action = (obj) => { |
| | | sceneFunction.delay = obj; |
| | | btnDelayInfo.Text = FunctionList.List.GetDelayText(obj); |
| | | btnDelayInfo.Text = new Scene() { delay = sceneFunction.delay }.GetDelayText(); |
| | | }; |
| | | new PublicAssmebly().SetSceneDelayDialog(action,sceneFunction.delay); |
| | | Dictionary<string, string> items = new Dictionary<string, string>(); |
| | | items.Add("30", "30s"); |
| | | items.Add("60", "1min"); |
| | | items.Add("120", "2min"); |
| | | items.Add("300", "5min"); |
| | | new PublicAssmebly().SetSceneDelayDialog(action, sceneFunction.delay); |
| | | }; |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 属性选择弹窗 |
| | |
| | | dialog.Close(); |
| | | trait.value = "on"; |
| | | sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "on"; |
| | | btn.Text = FunctionList.List.GetValueText(trait.key, trait.value) + FunctionList.List.GetUintString(trait.key); |
| | | btn.Text = trait.GetValueText() + trait.GetUintString(); |
| | | |
| | | var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); |
| | | if (temp == null) |
| | | { |
| | | temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent); |
| | | } |
| | | if (temp != null) |
| | | { |
| | | if (temp.value == "0") |
| | | { |
| | | temp.value = "100"; |
| | | } |
| | | btnBrightnessText.Text = FunctionList.List.GetValueText(temp.key, temp.value) + "%"; |
| | | btnBrightnessText.Text = temp.GetValueText() + "%"; |
| | | } |
| | | }; |
| | | btnOff.MouseUpEventHandler = (sender,e) =>{ |
| | | dialog.Close(); |
| | | trait.value = "off"; |
| | | sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "off"; |
| | | btn.Text= FunctionList.List.GetValueText(trait.key,trait.value) + FunctionList.List.GetUintString(trait.key); |
| | | btn.Text= trait.GetValueText() + trait.GetUintString(); |
| | | |
| | | var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); |
| | | if(temp == null) |
| | | { |
| | | temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent); |
| | | } |
| | | if (temp != null) |
| | | { |
| | | if (temp.value != "0") |
| | | { |
| | | temp.value = "0"; |
| | | } |
| | | btnBrightnessText.Text = FunctionList.List.GetValueText(temp.key, temp.value) + "%"; |
| | | btnBrightnessText.Text = temp.GetValueText() + "%"; |
| | | } |
| | | }; |
| | | |
| | |
| | | }; |
| | | for (int i = 16; i <= 32; i += 1) |
| | | { |
| | | pickerItems.Add(i.ToString() + FunctionList.List.GetUintString(trait.key)); |
| | | pickerItems.Add(i.ToString() + trait.GetUintString()); |
| | | } |
| | | uIPickerView.setNPicker(pickerItems, null, null); |
| | | optionBaseView.AddChidren(uIPickerView); |
| | | uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()), 4, 5); |
| | | |
| | | string selectItem = pickerItems[0]; |
| | | if (pickerItems.Contains(trait.value + FunctionList.List.GetUintString(trait.key))) |
| | | if (pickerItems.Contains(trait.value + trait.GetUintString())) |
| | | { |
| | | selectItem = trait.value.ToString() + FunctionList.List.GetUintString(trait.key); |
| | | selectItem = trait.value.ToString() + trait.GetUintString(); |
| | | } |
| | | |
| | | dialog.Show(); |
| | |
| | | dialog.Close(); |
| | | btn.Text = selectItem; |
| | | //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.value.ToString() ; |
| | | trait.value = selectItem.Replace(FunctionList.List.GetUintString(trait.key),""); |
| | | trait.value = selectItem.Replace(trait.GetUintString(),""); |
| | | }; |
| | | |
| | | } |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextAlignment = TextAlignment.Center, |
| | | Width = Application.GetRealWidth(100), |
| | | Text = FunctionList.List.GetNameText(trait.key), |
| | | Text = trait.GetNameText(), |
| | | IsBold = true, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | |
| | | { |
| | | dialog.Close(); |
| | | trait.value = controlBar.Progress.ToString(); |
| | | btn.Text = trait.value + FunctionList.List.GetUintString(trait.key); |
| | | btn.Text = trait.value + trait.GetUintString(); |
| | | |
| | | var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff); |
| | | if (temp != null) |
| | |
| | | { |
| | | temp.value = "off"; |
| | | } |
| | | btnOnText.Text = FunctionList.List.GetValueText(temp.key, temp.value); |
| | | btnOnText.Text = temp.GetValueText(); |
| | | } |
| | | }; |
| | | } |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextAlignment = TextAlignment.Center, |
| | | Width = Application.GetRealWidth(100), |
| | | Text = FunctionList.List.GetNameText(trait.key), |
| | | Text = trait.GetNameText(), |
| | | IsBold = true, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | |
| | | { |
| | | dialog.Close(); |
| | | trait.value = controlBar.Progress.ToString(); |
| | | btn.Text = trait.value + FunctionList.List.GetUintString(trait.key); |
| | | btn.Text = trait.value + trait.GetUintString(); |
| | | }; |
| | | } |
| | | |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextAlignment = TextAlignment.Center, |
| | | Width = Application.GetRealWidth(100), |
| | | Text = FunctionList.List.GetNameText(trait.key), |
| | | Text = trait.GetNameText(), |
| | | IsBold = true, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Tag = m, |
| | | Text = FunctionList.List.GetValueText(trait.key, m) |
| | | Text = trait.GetValueText() |
| | | }; |
| | | row.AddChidren(btnPropertyTitle); |
| | | |