| | |
| | | FrameLayout bodyView; |
| | | VerticalScrolViewLayout contentView; |
| | | Button btnOnText; |
| | | Button btnBrightnessText; |
| | | |
| | | Scene scene; |
| | | |
| | |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid); |
| | | if (sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness) != null) |
| | | { |
| | | try |
| | | { |
| | | //一端口不支持开关值与亮度值一起处理,需要将开关值移除掉 |
| | | sceneFunction.status.Remove(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff)); |
| | | } |
| | | catch { } |
| | | } |
| | | if (temp != null) |
| | | { |
| | | temp = sceneFunction; |
| | |
| | | { |
| | | DAL.Server.IMessageCommon.Current.ShowErrorInfoAlter(result); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | refreshAction(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | }; |
| | | } |
| | |
| | | { |
| | | row.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | } |
| | | Button btnBrightnessRight = new Button() |
| | | Button btnRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | row.AddChidren(btnBrightnessRight); |
| | | row.AddChidren(btnRight); |
| | | |
| | | var btnFunctionText = new Button() |
| | | { |
| | |
| | | }; |
| | | row.AddChidren(btnFunctionText); |
| | | if (sceneStatus.key == FunctionAttributeKey.OnOff) |
| | | { |
| | | btnOnText = btnFunctionText; |
| | | } |
| | | else if (sceneStatus.key == FunctionAttributeKey.Brightness) |
| | | { |
| | | btnBrightnessText = btnFunctionText; |
| | | } |
| | | |
| | | var btnFunctionName = new Button() |
| | | { |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = scene.delayText |
| | | Text = FunctionList.List.GetDelayText( sceneFunction.delay) |
| | | }; |
| | | delayRow.AddChidren(btnDelayInfo); |
| | | |
| | |
| | | |
| | | |
| | | btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => { |
| | | new PublicAssmebly().SetSceneDelayDialog(scene, btnDelayInfo); |
| | | Action<string> action = (obj) => { |
| | | sceneFunction.delay = obj; |
| | | btnDelayInfo.Text = FunctionList.List.GetDelayText(obj); |
| | | }; |
| | | new PublicAssmebly().SetSceneDelayDialog(action,sceneFunction.delay); |
| | | }; |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | |
| | | 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); |
| | | |
| | | var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); |
| | | if (temp != null) |
| | | { |
| | | if (temp.value == "0") |
| | | { |
| | | temp.value = "100"; |
| | | } |
| | | btnBrightnessText.Text = FunctionList.List.GetValueText(temp.key, temp.value); |
| | | } |
| | | }; |
| | | 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); |
| | | |
| | | var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); |
| | | if (temp != null) |
| | | { |
| | | if (temp.value != "0") |
| | | { |
| | | temp.value = "0"; |
| | | } |
| | | btnBrightnessText.Text = FunctionList.List.GetValueText(temp.key, temp.value); |
| | | } |
| | | }; |
| | | |
| | | } |
| | |
| | | /// <param name="btn"></param> |
| | | void LoadEditDialog_Temp(SceneFunctionStatus trait, Button btn) |
| | | { |
| | | double temp = 16; |
| | | double.TryParse(trait.value, out temp); |
| | | trait.value = temp.ToString(); |
| | | |
| | | List<string> pickerItems = new List<string>(); |
| | | if(trait == null) |
| | | { |
| | |
| | | uIPickerView.setNPicker(pickerItems, null, null); |
| | | optionBaseView.AddChidren(uIPickerView); |
| | | uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()), 4, 5); |
| | | string selectItem = trait.value.ToString() + FunctionList.List.GetUintString(trait.key); |
| | | |
| | | string selectItem = pickerItems[0]; |
| | | if (pickerItems.Contains(trait.value + FunctionList.List.GetUintString(trait.key))) |
| | | { |
| | | selectItem = trait.value.ToString() + FunctionList.List.GetUintString(trait.key); |
| | | } |
| | | |
| | | dialog.Show(); |
| | | |
| | |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | MaxValue = 100, |
| | | Progress = trait.value.ToString().Replace("{}", "") == "" ? 0 : Convert.ToInt32( trait.value.Replace("{}","")), |
| | | Progress = trait.value.ToString().Replace("{}", "") == "" ? 0 : Convert.ToInt32(trait.value.Replace("{}", "")), |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | }; |
| | | optionBaseView.AddChidren(controlBar); |
| | |
| | | }; |
| | | optionBaseView.AddChidren(btnPlusSgnIcon); |
| | | |
| | | btnMinusSignIcon.MouseUpEventHandler = (sender, e) => { |
| | | btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | controlBar.Progress--; |
| | | }; |
| | | btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => { |
| | | btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | controlBar.Progress++; |
| | | }; |
| | | |
| | | dialog.Show(); |
| | | pView.MouseUpEventHandler = (sender, e) => { |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => { |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | trait.value = controlBar.Progress.ToString(); |
| | | btn.Text = trait.value + FunctionList.List.GetUintString(trait.key); |
| | | if (controlBar.Progress > 0) |
| | | |
| | | var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff); |
| | | if (temp != null) |
| | | { |
| | | var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff); |
| | | if (temp != null) |
| | | if (controlBar.Progress > 0) |
| | | { |
| | | temp.value = "on"; |
| | | btnOnText.Text = FunctionList.List.GetValueText(temp.key, temp.value); |
| | | } |
| | | else |
| | | { |
| | | temp.value = "off"; |
| | | } |
| | | btnOnText.Text = FunctionList.List.GetValueText(temp.key, temp.value); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载功能属性数据选择弹窗 |
| | | /// </summary> |