Merge branch 'WJC' into NewFilePath
| | |
| | | 7077=时间未设置,请设置时间。 |
| | | 7078=条件或者目标为空。 |
| | | 7079=网关不在线 |
| | | 7080=日出/日落/正午 |
| | | 7081=日出 |
| | | 7082=日落 |
| | | 7083=正午 |
| | | 7084=正点 |
| | | 7085=提前 |
| | | 7086=分钟 |
| | | 7087=室外变化 |
| | | 7088=选择室外变化条件 |
| | | 7089=室外温、湿度、PM2.5变化 |
| | | 7090=天气变化(城市天气) |
| | | 7091=室外环境变化 |
| | | 7092=温度高于 |
| | | 7093=温度低于 |
| | | 7094=湿度高于 |
| | | 7095=湿度低于 |
| | | 7096=PM2.5高于 |
| | | 7097=PM2.5低于 |
| | | 7098=晴天 |
| | | 7099=多云 |
| | | 7100=下雨 |
| | | |
| | | |
| | | 9000=请使用新的手机账号登录APP |
| | | 9001=请使用新的邮箱账号登录APP |
| | |
| | | <AndroidAsset Include="Assets\Phone\Public\ListCellbg\ListCellbg1.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Public\ListCellbg\ListCellbg4.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Public\ListCellbg\ListCellbg5.png" /> |
| | | <AndroidAsset Include="Assets\Phone\LogicIcon\location.png" /> |
| | | <AndroidAsset Include="Assets\Phone\LogicIcon\changesinoutdoor.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" /> |
| | |
| | | //Bugly.Bugly.StartWithAppId("b58fb35436"); |
| | | |
| | | //取消EditText默认密码输入方式 |
| | | Shared.Application.IsEditTextContentTypePassword = false; |
| | | //Shared.Application.IsEditTextContentTypePassword = false; |
| | | //默认使用苹方字体 |
| | | Shared.Application.IsUsePingFang = true; |
| | | //保持屏幕常亮或者自动锁屏 |
| | |
| | | <BundleResource Include="Resources\Phone\Public\ListCellbg\ListCellbg1.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\ListCellbg\ListCellbg4.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\ListCellbg\ListCellbg5.png" /> |
| | | <BundleResource Include="Resources\Phone\LogicIcon\location.png" /> |
| | | <BundleResource Include="Resources\Phone\LoginIcon\changesinoutdoor.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | 7077=时间未设置,请设置时间。 |
| | | 7078=条件或者目标为空。 |
| | | 7079=网关不在线 |
| | | 7080=日出/日落/正午 |
| | | 7081=日出 |
| | | 7082=日落 |
| | | 7083=正午 |
| | | 7084=正点 |
| | | 7085=提前 |
| | | 7086=分钟 |
| | | 7087=室外变化 |
| | | 7088=选择室外变化条件 |
| | | 7089=室外温、湿度、PM2.5变化 |
| | | 7090=天气变化(城市天气) |
| | | 7091=室外环境变化 |
| | | 7092=温度高于 |
| | | 7093=温度低于 |
| | | 7094=湿度高于 |
| | | 7095=湿度低于 |
| | | 7096=PM2.5高于 |
| | | 7097=PM2.5低于 |
| | | 7098=晴天 |
| | | 7099=多云 |
| | | 7100=下雨 |
| | | |
| | | |
| | | 9000=请使用新的手机账号登录APP |
| | | 9001=请使用新的邮箱账号登录APP |
| | |
| | | public const int timeNoSet = 7077; |
| | | public const int conditioncNullOrtargetNull = 7078; |
| | | public const int gatewayNotOnline = 7079; |
| | | |
| | | |
| | | public const int timespecia = 7080; |
| | | public const int sunrise = 7081; |
| | | public const int sunset = 7082; |
| | | public const int at = 7083; |
| | | public const int punctually = 7084; |
| | | public const int advanced = 7085; |
| | | public const int minute = 7086; |
| | | public const int shiwaibainhua=7087; |
| | | public const int xuanzeshiwaibianhuatiaojian = 7088; |
| | | public const int shuwaigongneng = 7089; |
| | | public const int tianqibianhua = 7090; |
| | | public const int shiwaihuanjingbianhua = 7091; |
| | | public const int wendugaoyu = 7092; |
| | | public const int wendudiyu = 7093; |
| | | public const int shidugaoyu = 7094; |
| | | public const int shidudiyu = 7095; |
| | | public const int pmgaoyu = 7096; |
| | | public const int pmdiyu = 7097; |
| | | public const int clearday =7098; |
| | | public const int cloudy= 7099; |
| | | public const int rain = 7100; |
| | | |
| | | |
| | | #region LE新增 |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TemperatureView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\DiySelectPopupDialog.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\ListCellDialog.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\SpeciaTime.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Time3.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Weather.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\OutdoorEnvironment.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\WeatherCondition.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\" />
|
old mode 100755
new mode 100644
| | |
| | | functionView.btnText.TextID = StringId.funLogic; |
| | | functionView.btnIcon.UnSelectedImagePath = "LogicIcon/functionicon.png"; |
| | | viewLayout.AddChidren(functionView.FLayoutView()); |
| | | |
| | | //室外变化 |
| | | LogicView.SelectTypeView shiwaiView = new LogicView.SelectTypeView(); |
| | | shiwaiView.frameLayout.Y = functionView.frameLayout.Bottom; |
| | | shiwaiView.btnText.TextID = StringId.shiwaibainhua; |
| | | shiwaiView.btnIcon.UnSelectedImagePath = "LogicIcon/changesinoutdoor.png"; |
| | | viewLayout.AddChidren(shiwaiView.FLayoutView()); |
| | | #endregion |
| | | |
| | | |
| | | #region 所有点击事件 |
| | | //时间 |
| | | timeView.btnClick.MouseUpEventHandler += (sen, e) => { |
| | | TimeTpye timeTpye = new TimeTpye(); |
| | | MainPage.BasePageView.AddChidren(timeTpye); |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | }; |
| | | |
| | | //功能 |
| | | functionView.btnClick.MouseUpEventHandler += (sen, e) => { |
| | | FunTpye funTpye = new FunTpye(); |
| | | MainPage.BasePageView.AddChidren(funTpye); |
| | | funTpye.Show(LogicMethod.condition_if); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | //室外变化 |
| | | shiwaiView.btnClick.MouseUpEventHandler += (sen, e) => { |
| | | Weather weather = new Weather(); |
| | | MainPage.BasePageView.AddChidren(weather); |
| | | weather.Show(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | #endregion |
| | | |
| | | } |
| | |
| | | inputView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png"; |
| | | foreach (var dic in dicList) |
| | | { |
| | | string keyValue = dic["key"]; |
| | | string value = dic["value"]; |
| | | inputView.btnText.Text = Language.StringByID(StringId.hour) + ": " + value; |
| | | inputView.btnClick.AddTag("timepoint", value); |
| | | if (keyValue == "timepoint") |
| | | { |
| | | inputView.btnText.Text = Language.StringByID(StringId.hour) + ": " + value; |
| | | } |
| | | else |
| | | { |
| | | string strtext = ""; |
| | | string statetext = ""; |
| | | switch (keyValue) |
| | | { |
| | | case "before_sunrise": |
| | | { |
| | | strtext = Language.StringByID(StringId.sunrise); |
| | | statetext = Language.StringByID(StringId.advanced); |
| | | |
| | | } |
| | | break; |
| | | case "before_sunset": |
| | | { |
| | | |
| | | strtext = Language.StringByID(StringId.sunset); |
| | | statetext = Language.StringByID(StringId.advanced); |
| | | |
| | | } break; |
| | | case "before_noon": |
| | | { |
| | | strtext = Language.StringByID(StringId.at); |
| | | statetext = Language.StringByID(StringId.advanced); |
| | | } |
| | | break; |
| | | case "after_sunrise": |
| | | { |
| | | strtext = Language.StringByID(StringId.sunrise); |
| | | statetext = Language.StringByID(StringId.delayLogic); |
| | | } break; |
| | | case "after_sunset": |
| | | { |
| | | strtext = Language.StringByID(StringId.sunset); |
| | | statetext = Language.StringByID(StringId.delayLogic); |
| | | } break; |
| | | case "after_noon": |
| | | { |
| | | strtext = Language.StringByID(StringId.at); |
| | | statetext = Language.StringByID(StringId.delayLogic); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | if (value != "0") |
| | | { |
| | | if (value == "30") |
| | | { |
| | | statetext += value + Language.StringByID(StringId.s); |
| | | } |
| | | else |
| | | { |
| | | statetext += value + Language.StringByID(StringId.minute); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | statetext = ""; |
| | | } |
| | | |
| | | inputView.btnText.Text = strtext; |
| | | inputView.btnState.Text = statetext; |
| | | } |
| | | } |
| | | } |
| | | break; |
| | |
| | | { |
| | | string value = dic["value"]; |
| | | inputView.btnText.Text = Language.StringByID(StringId.timeHorizon) + ": " + value; |
| | | inputView.btnClick.AddTag("timeHorizon", value); |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | case "1": |
| | | { |
| | | FrameLayout fLayout = new FrameLayout |
| | | bool is_bool = false; |
| | | Input _input = Logic.currlogic.input[indexVulae]; |
| | | if (_input.condition_type == "1") |
| | | { |
| | | BackgroundColor = CSS.CSS_Color.viewTrans60lucence, |
| | | }; |
| | | thisView.AddChidren(fLayout); |
| | | TimeTpye timeTpye = new TimeTpye(); |
| | | timeTpye.TimePoint(fLayout, edit, indexVulae); |
| | | var dicLists = _input.condition as List<Dictionary<string, string>>; |
| | | foreach (var dic in dicLists) |
| | | { |
| | | string keyValue = dic["key"]; |
| | | if (keyValue != "timepoint") |
| | | { |
| | | //通过键值查找键值是否是 |
| | | //(日出/日落/正午) |
| | | is_bool = true; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | if (is_bool) |
| | | { |
| | | //跳转到(日出/日落/正午)界面 |
| | | SpeciaTime speciaTime = new SpeciaTime(); |
| | | MainPage.BasePageView.AddChidren(speciaTime); |
| | | speciaTime.Show(edit, indexVulae); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | else |
| | | { |
| | | //跳转到(时间点)界面 |
| | | FrameLayout fLayout = new FrameLayout |
| | | { |
| | | BackgroundColor = CSS.CSS_Color.viewTrans60lucence, |
| | | }; |
| | | thisView.AddChidren(fLayout); |
| | | TimeTpye timeTpye = new TimeTpye(); |
| | | timeTpye.TimePoint(fLayout, edit, indexVulae); |
| | | } |
| | | } |
| | | break; |
| | | case "2": |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | break; |
| | | |
| | | |
| | | } |
| | | }; |
| | | ///删除控件 |
old mode 100755
new mode 100644
| | |
| | | /// <summary> |
| | | /// 逻辑条件关系(与and:,或:or) |
| | | /// </summary> |
| | | public string relation = "or"; |
| | | public string relation = "and"; |
| | | /// <summary> |
| | | /// 逻辑状态(true,false) |
| | | /// </summary> |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | namespace HDL_ON.UI.UI2.Intelligence.Automation |
| | | { |
| | | public class OutdoorEnvironment : FrameLayout |
| | | { |
| | | public OutdoorEnvironment() |
| | | { |
| | | Tag = "Logic"; |
| | | } |
| | | public void Show() |
| | | { |
| | | #region 界面布局 |
| | | LogicView.TopView topView = new LogicView.TopView(); |
| | | this.AddChidren(topView.FLayoutView()); |
| | | topView.clickBackBtn.MouseUpEventHandler += (e, sen) => |
| | | { |
| | | RemoveFromParent(); |
| | | }; |
| | | topView.topNameBtn.TextID = StringId.shiwaihuanjingbianhua; |
| | | |
| | | FrameLayout viewLayout = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Width = Application.GetRealWidth(LogicView.TextSize.view375), |
| | | Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64), |
| | | BackgroundColor = CSS.CSS_Color.viewMiddle, |
| | | }; |
| | | this.AddChidren(viewLayout); |
| | | |
| | | //温度高于 |
| | | LogicView.SelectTypeView temperaturehigherView = new LogicView.SelectTypeView(); |
| | | temperaturehigherView.btnIcon.Visible = false; |
| | | temperaturehigherView.btnText.X = Application.GetRealWidth(16); |
| | | temperaturehigherView.btnLine.X = Application.GetRealWidth(16); |
| | | temperaturehigherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | temperaturehigherView.btnText.TextID = StringId.wendugaoyu; |
| | | viewLayout.AddChidren(temperaturehigherView.FLayoutView()); |
| | | //温度低于 |
| | | LogicView.SelectTypeView temperatureunderView = new LogicView.SelectTypeView(); |
| | | temperatureunderView.frameLayout.Y = temperaturehigherView.frameLayout.Bottom; |
| | | temperatureunderView.btnIcon.Visible = false; |
| | | temperatureunderView.btnText.X = Application.GetRealWidth(16); |
| | | temperatureunderView.btnLine.X = Application.GetRealWidth(16); |
| | | temperatureunderView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | temperatureunderView.btnText.TextID = StringId.wendudiyu; |
| | | viewLayout.AddChidren(temperatureunderView.FLayoutView()); |
| | | |
| | | //湿度高于 |
| | | LogicView.SelectTypeView humidityhigherView = new LogicView.SelectTypeView(); |
| | | humidityhigherView.frameLayout.Y = temperatureunderView.frameLayout.Bottom+Application.GetRealHeight(8); |
| | | humidityhigherView.btnIcon.Visible = false; |
| | | humidityhigherView.btnText.X = Application.GetRealWidth(16); |
| | | humidityhigherView.btnLine.X = Application.GetRealWidth(16); |
| | | humidityhigherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | humidityhigherView.btnText.TextID = StringId.shidugaoyu; |
| | | viewLayout.AddChidren(humidityhigherView.FLayoutView()); |
| | | //湿度低于 |
| | | LogicView.SelectTypeView humidityunderView = new LogicView.SelectTypeView(); |
| | | humidityunderView.frameLayout.Y = humidityhigherView.frameLayout.Bottom; |
| | | humidityunderView.btnIcon.Visible = false; |
| | | humidityunderView.btnText.X = Application.GetRealWidth(16); |
| | | humidityunderView.btnLine.X = Application.GetRealWidth(16); |
| | | humidityunderView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | humidityunderView.btnText.TextID = StringId.shidudiyu; |
| | | viewLayout.AddChidren(humidityunderView.FLayoutView()); |
| | | |
| | | //PM2.5高于 |
| | | LogicView.SelectTypeView pmhigherView = new LogicView.SelectTypeView(); |
| | | pmhigherView.frameLayout.Y = humidityunderView.frameLayout.Bottom + Application.GetRealHeight(8); |
| | | pmhigherView.btnIcon.Visible = false; |
| | | pmhigherView.btnText.X = Application.GetRealWidth(16); |
| | | pmhigherView.btnLine.X = Application.GetRealWidth(16); |
| | | pmhigherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | pmhigherView.btnText.TextID = StringId.pmgaoyu; |
| | | viewLayout.AddChidren(pmhigherView.FLayoutView()); |
| | | //PM2.5低于 |
| | | LogicView.SelectTypeView pmunderView = new LogicView.SelectTypeView(); |
| | | pmunderView.frameLayout.Y = pmhigherView.frameLayout.Bottom; |
| | | pmunderView.btnIcon.Visible = false; |
| | | pmunderView.btnText.X = Application.GetRealWidth(16); |
| | | pmunderView.btnLine.X = Application.GetRealWidth(16); |
| | | pmunderView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | pmunderView.btnText.TextID = StringId.pmdiyu; |
| | | viewLayout.AddChidren(pmunderView.FLayoutView()); |
| | | |
| | | #endregion |
| | | |
| | | #region 所有点击事件 |
| | | //温度高于 |
| | | temperaturehigherView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | |
| | | |
| | | }; |
| | | //温度低于 |
| | | temperatureunderView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | |
| | | }; |
| | | |
| | | //湿度高于 |
| | | humidityhigherView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | |
| | | |
| | | }; |
| | | //湿度低于 |
| | | humidityunderView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | |
| | | }; |
| | | |
| | | //PM2.5高于 |
| | | pmhigherView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | |
| | | |
| | | }; |
| | | //PM2.5低于 |
| | | pmunderView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | |
| | | }; |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | | } |
| | |
| | | }; |
| | | } |
| | | break; |
| | | case "time": |
| | | { |
| | | list = new List<string> { |
| | | "30 s", |
| | | "1 min", |
| | | "2 min", |
| | | "3 min", |
| | | "5 min", |
| | | }; |
| | | } |
| | | break; |
| | | |
| | | } |
| | | return list; |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | using System.Collections.Generic; |
| | | namespace HDL_ON.UI.UI2.Intelligence.Automation |
| | | { |
| | | public class SpeciaTime : FrameLayout |
| | | { |
| | | |
| | | public SpeciaTime() |
| | | { |
| | | Tag = "Logic"; |
| | | } |
| | | |
| | | public void Show(bool edit = false, int index = -1) |
| | | { |
| | | #region 界面布局 |
| | | LogicView.TopView topView = new LogicView.TopView(); |
| | | this.AddChidren(topView.FLayoutView()); |
| | | topView.clickBackBtn.MouseUpEventHandler += (e, sen) => |
| | | { |
| | | RemoveFromParent(); |
| | | }; |
| | | topView.topNameBtn.TextID = StringId.selectionCondition; |
| | | |
| | | FrameLayout viewLayout = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Width = Application.GetRealWidth(LogicView.TextSize.view375), |
| | | Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64), |
| | | BackgroundColor = CSS.CSS_Color.viewMiddle, |
| | | }; |
| | | this.AddChidren(viewLayout); |
| | | #endregion |
| | | |
| | | //(日出时,日落时,正午时) |
| | | string str1 = ""; |
| | | //(提前,延时) |
| | | string str2 = ""; |
| | | //(提前,延时多少分钟) |
| | | string value= ""; |
| | | if (edit) |
| | | { |
| | | GetText(index, (s1, s2, s3) => { |
| | | str1 = s1; |
| | | str2 = s2; |
| | | value = s3; |
| | | |
| | | }); |
| | | |
| | | |
| | | } |
| | | var list = new List<string> { |
| | | Language.StringByID(StringId.sunrise)+Language.StringByID(StringId.h), |
| | | Language.StringByID(StringId.sunset)+Language.StringByID(StringId.h), |
| | | Language.StringByID(StringId.at)+Language.StringByID(StringId.h), |
| | | }; |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | LogicView.SelectTypeView timeView = new LogicView.SelectTypeView(); |
| | | timeView.frameLayout.Y = Application.GetRealHeight(i * 50); |
| | | timeView.btnIcon.Visible = false; |
| | | timeView.btnText.X = Application.GetRealWidth(16); |
| | | timeView.btnLine.X = Application.GetRealWidth(16); |
| | | timeView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | timeView.btnText.Text = list[i]; |
| | | timeView.btnClick.Tag = list[i]; |
| | | if (str1 == list[i]) |
| | | { |
| | | string s = ""; |
| | | if (value != "0") |
| | | { |
| | | if (value == "30") |
| | | { |
| | | s= str2 +value+ Language.StringByID(StringId.s); |
| | | } |
| | | else |
| | | { |
| | | s = str2 + value + Language.StringByID(StringId.minute); |
| | | } |
| | | } |
| | | timeView.btnState.Visible = true; |
| | | timeView.btnState.Text = s; |
| | | } |
| | | |
| | | viewLayout.AddChidren(timeView.FLayoutView()); |
| | | |
| | | timeView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | Time3 time3 = new Time3(); |
| | | MainPage.BasePageView.AddChidren(time3); |
| | | time3.Show(timeView.btnClick.Tag.ToString(), edit, index); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 获之前状态值 |
| | | /// </summary> |
| | | /// <param name="index"></param> |
| | | /// <param name="action"></param> |
| | | public void GetText(int index, Action<string, string, string> action) { |
| | | //(日出时,日落时,正午时) |
| | | string str1 = ""; |
| | | //(提前,延时) |
| | | string str2 = ""; |
| | | //(提前,延时多少分钟) |
| | | string valuestr = ""; |
| | | Input _input = Logic.currlogic.input[index]; |
| | | if (_input.condition_type == "1") |
| | | { |
| | | var dicLists = _input.condition as List<Dictionary<string, string>>; |
| | | foreach (var dic in dicLists) |
| | | { |
| | | string keyValue = dic["key"]; |
| | | valuestr = dic["value"]; |
| | | |
| | | if (keyValue != "timepoint") |
| | | { |
| | | switch (keyValue) |
| | | { |
| | | case "before_sunrise": |
| | | { |
| | | str1 = Language.StringByID(StringId.sunrise) + Language.StringByID(StringId.h); |
| | | str2 = Language.StringByID(StringId.advanced); |
| | | |
| | | } |
| | | break; |
| | | case "before_sunset": |
| | | { |
| | | |
| | | str1 = Language.StringByID(StringId.sunset) + Language.StringByID(StringId.h); |
| | | str2 = Language.StringByID(StringId.advanced); |
| | | |
| | | } |
| | | break; |
| | | case "before_noon": |
| | | { |
| | | str1 = Language.StringByID(StringId.at) + Language.StringByID(StringId.h); |
| | | str2 = Language.StringByID(StringId.advanced); |
| | | } |
| | | break; |
| | | case "after_sunrise": |
| | | { |
| | | str1 = Language.StringByID(StringId.sunrise) + Language.StringByID(StringId.h); |
| | | str2 = Language.StringByID(StringId.delayLogic); |
| | | } |
| | | break; |
| | | case "after_sunset": |
| | | { |
| | | str1 = Language.StringByID(StringId.sunset) + Language.StringByID(StringId.h); |
| | | str2 = Language.StringByID(StringId.delayLogic); |
| | | } |
| | | break; |
| | | case "after_noon": |
| | | { |
| | | str1 = Language.StringByID(StringId.at) + Language.StringByID(StringId.h); |
| | | str2 = Language.StringByID(StringId.delayLogic); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | action(str1,str2, valuestr); |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Shared; |
| | | namespace HDL_ON.UI.UI2.Intelligence.Automation |
| | | { |
| | | public class Time3:FrameLayout |
| | | { |
| | | |
| | | public Time3() |
| | | { |
| | | Tag = "Logic"; |
| | | } |
| | | |
| | | public void Show(string titelText, bool edit, int index) |
| | | { |
| | | #region 界面布局 |
| | | LogicView.TopView topView = new LogicView.TopView(); |
| | | topView.frameLayout.Height = Application.GetRealHeight(64 + 20); |
| | | this.AddChidren(topView.FLayoutView()); |
| | | topView.topNameBtn.Text = titelText; |
| | | //获取宽度 |
| | | int widthValue = topView.topNameBtn.GetTextWidth(); |
| | | int textWidth = (Application.GetRealWidth(255) - widthValue) / 2; |
| | | Button locationBtn = new Button |
| | | { |
| | | Width = Application.GetRealWidth(18), |
| | | Height = Application.GetRealWidth(18), |
| | | X = Application.GetRealWidth(60 + 4) + textWidth + widthValue, |
| | | Y = Application.GetRealHeight(34 + 1), |
| | | UnSelectedImagePath = "LogicIcon/location.png", |
| | | |
| | | }; |
| | | topView.frameLayout.AddChidren(locationBtn); |
| | | |
| | | Button textBtn = new Button |
| | | { |
| | | Height = Application.GetRealHeight(14), |
| | | Y = Application.GetRealHeight(57), |
| | | TextSize = LogicView.TextSize.text10, |
| | | TextColor = CSS.CSS_Color.textCancelColor, |
| | | Text = "广东广州市番禺区石楼镇", |
| | | }; |
| | | topView.frameLayout.AddChidren(textBtn); |
| | | topView.clickBackBtn.MouseUpEventHandler += (e, sen) => |
| | | { |
| | | RemoveFromParent(); |
| | | }; |
| | | |
| | | FrameLayout viewLayout = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(64 + 20), |
| | | Width = Application.GetRealWidth(LogicView.TextSize.view375), |
| | | Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64 - 20), |
| | | BackgroundColor = CSS.CSS_Color.viewMiddle, |
| | | }; |
| | | this.AddChidren(viewLayout); |
| | | #endregion |
| | | |
| | | //(日出时,日落时,正午时) |
| | | string str1 = ""; |
| | | //(提前,延时) |
| | | string str2 = ""; |
| | | //(提前,延时多少分钟) |
| | | string value = ""; |
| | | if (edit) |
| | | { |
| | | new SpeciaTime().GetText(index, (s1, s2, s3) => |
| | | { |
| | | str1 = s1; |
| | | str2 = s2; |
| | | value = s3; |
| | | }); |
| | | |
| | | |
| | | } |
| | | var list = new List<string> { |
| | | Language.StringByID(StringId.punctually), |
| | | Language.StringByID(StringId.advanced), |
| | | Language.StringByID(StringId.delayLogic), |
| | | }; |
| | | |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | LogicView.SelectTypeView timeView = new LogicView.SelectTypeView(); |
| | | timeView.frameLayout.Y = Application.GetRealHeight(i * 50); |
| | | timeView.btnIcon.Visible = false; |
| | | timeView.btnText.X = Application.GetRealWidth(16); |
| | | timeView.btnLine.X = Application.GetRealWidth(16); |
| | | timeView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | timeView.btnText.Text = list[i]; |
| | | timeView.btnClick.Tag = list[i]; |
| | | if (i == 0) |
| | | { |
| | | timeView.btnNextIcon.Visible = false; |
| | | } |
| | | //判断是(日出,日落,正午) |
| | | if (str1 == titelText) |
| | | { |
| | | //判断是(提前,延时) |
| | | if (str2 == list[i]) |
| | | { |
| | | string s = ""; |
| | | if (value != "0") |
| | | { |
| | | if (value == "30") |
| | | { |
| | | s = value + Language.StringByID(StringId.s); |
| | | } |
| | | else |
| | | { |
| | | s =value + Language.StringByID(StringId.minute); |
| | | } |
| | | } |
| | | timeView.btnState.Visible = true; |
| | | timeView.btnState.Text = s; |
| | | } |
| | | |
| | | } |
| | | viewLayout.AddChidren(timeView.FLayoutView()); |
| | | timeView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | string clickText = timeView.btnClick.Tag.ToString(); |
| | | string keyValue = GetKeyValue(clickText, titelText); |
| | | if (clickText == Language.StringByID(StringId.punctually)) |
| | | { |
| | | //正点 |
| | | AddDic(keyValue, "0", edit, index); |
| | | } |
| | | else |
| | | { |
| | | //定义一个局部变量 |
| | | string stateValue = ""; |
| | | //判断是(日出,日落,正午) |
| | | if (str1 == titelText) |
| | | { |
| | | //判断是(提前,延时) |
| | | if (str2 == clickText) |
| | | { |
| | | string s = ""; |
| | | if (value != "0") |
| | | { |
| | | if (value == "30") |
| | | { |
| | | s = value + " s"; |
| | | } |
| | | else |
| | | { |
| | | s = value + " min"; |
| | | } |
| | | } |
| | | //更新值stateValue |
| | | //为了显示之前的状态 |
| | | stateValue = s; |
| | | } |
| | | |
| | | } |
| | | |
| | | PublicInterface timePublicInterface = new PublicInterface(); |
| | | var timelist = timePublicInterface.GetViewList("time"); |
| | | timePublicInterface.SingleSelectionShow(this, timelist, clickText, stateValue |
| | | , (value1) => |
| | | { |
| | | string timeValue = value1.Split(" ")[0]; |
| | | AddDic(keyValue, timeValue, edit, index); |
| | | |
| | | }); |
| | | } |
| | | |
| | | }; |
| | | } |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 获取键值 |
| | | /// </summary> |
| | | /// <param name="clickText">当前选中文本</param> |
| | | /// <param name="titelText">标题文本</param> |
| | | /// <returns></returns> |
| | | private string GetKeyValue(string clickText, string titelText) |
| | | { |
| | | |
| | | string keyValue = ""; |
| | | if (titelText == Language.StringByID(StringId.sunrise) + Language.StringByID(StringId.h)) |
| | | { |
| | | if (clickText == Language.StringByID(StringId.advanced)) |
| | | { |
| | | keyValue = "before_sunrise"; |
| | | |
| | | } |
| | | else if (clickText == Language.StringByID(StringId.delayLogic)) |
| | | { |
| | | keyValue = "after_sunrise"; |
| | | } |
| | | else |
| | | { |
| | | keyValue = "after_sunrise"; |
| | | } |
| | | } |
| | | else if (titelText == Language.StringByID(StringId.sunset) + Language.StringByID(StringId.h)) |
| | | { |
| | | |
| | | |
| | | if (clickText == Language.StringByID(StringId.advanced)) |
| | | { |
| | | keyValue = "before_sunset"; |
| | | |
| | | } |
| | | else if (clickText == Language.StringByID(StringId.delayLogic)) |
| | | { |
| | | keyValue = "after_sunset"; |
| | | } |
| | | else |
| | | { |
| | | keyValue = "after_sunset"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (clickText == Language.StringByID(StringId.advanced)) |
| | | { |
| | | keyValue = "before_noon"; |
| | | |
| | | } |
| | | else if (clickText == Language.StringByID(StringId.delayLogic)) |
| | | { |
| | | keyValue = "after_noon"; |
| | | } |
| | | else |
| | | { |
| | | keyValue = "after_noon"; |
| | | } |
| | | |
| | | } |
| | | return keyValue; |
| | | } |
| | | /// <summary> |
| | | /// 封装数据 |
| | | /// </summary> |
| | | /// <param name="keyValue"></param> |
| | | /// <param name="value"></param> |
| | | /// <param name="edit"></param> |
| | | /// <param name="index"></param> |
| | | private void AddDic(string keyValue, string value, bool edit, int index) |
| | | { |
| | | Input inputTime = new Input(); |
| | | inputTime.sid = LogicMethod.NewSid(); |
| | | inputTime.condition_type = "1"; |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | LogicMethod.dictionary(dic, "key", keyValue); |
| | | LogicMethod.dictionary(dic, "comparator", "="); |
| | | LogicMethod.dictionary(dic, "data_type", "string"); |
| | | LogicMethod.dictionary(dic, "value", value); |
| | | inputTime.condition.Add(dic); |
| | | AddCondition(inputTime, edit, index); |
| | | } |
| | | /// <summary> |
| | | /// 添加条件 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | private void AddCondition(Input input, bool edit, int index) |
| | | { |
| | | if (edit) |
| | | { |
| | | //移除旧数据 |
| | | Logic.currlogic.input.RemoveAt(index); |
| | | //新数据插入旧数据的位置 |
| | | Logic.currlogic.input.Insert(index, input); |
| | | } |
| | | else |
| | | { |
| | | //添加一个新的时间条件 |
| | | Logic.currlogic.input.Add(input); |
| | | } |
| | | LogicMethod.RemoveAllView(); |
| | | AddLogic addLogic = new AddLogic(); |
| | | MainPage.BasePageView.AddChidren(addLogic); |
| | | addLogic.Show(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | timeHorizonView.btnText.TextID = StringId.timeHorizon; |
| | | viewLayout.AddChidren(timeHorizonView.FLayoutView()); |
| | | |
| | | |
| | | //日出/日落/正午 |
| | | LogicView.SelectTypeView timeSpecialView = new LogicView.SelectTypeView(); |
| | | timeSpecialView.frameLayout.Y = timeHorizonView.frameLayout.Bottom; |
| | | timeSpecialView.btnIcon.Visible = false; |
| | | timeSpecialView.btnText.X = Application.GetRealWidth(16); |
| | | timeSpecialView.btnLine.X = Application.GetRealWidth(16); |
| | | timeSpecialView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | timeSpecialView.btnText.TextID = StringId.timespecia; |
| | | viewLayout.AddChidren(timeSpecialView.FLayoutView()); |
| | | |
| | | #endregion |
| | | |
| | | #region 时间点 时间范围点击事件 |
| | |
| | | |
| | | TimeHorizon(fLayout, false, 0); |
| | | }; |
| | | //日出/日落/正午点击事件 |
| | | timeSpecialView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | SpeciaTime speciaTime = new SpeciaTime(); |
| | | MainPage.BasePageView.AddChidren(speciaTime); |
| | | speciaTime.Show(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | }; |
| | | #endregion |
| | | } |
| | | |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | namespace HDL_ON.UI.UI2.Intelligence.Automation |
| | | { |
| | | public class Weather : FrameLayout |
| | | { |
| | | public Weather() |
| | | { |
| | | Tag = "Logic"; |
| | | } |
| | | |
| | | public void Show() |
| | | { |
| | | #region 界面布局 |
| | | LogicView.TopView topView = new LogicView.TopView(); |
| | | this.AddChidren(topView.FLayoutView()); |
| | | topView.clickBackBtn.MouseUpEventHandler += (e, sen) => |
| | | { |
| | | RemoveFromParent(); |
| | | }; |
| | | topView.topNameBtn.TextID = StringId.xuanzeshiwaibianhuatiaojian; |
| | | |
| | | FrameLayout viewLayout = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Width = Application.GetRealWidth(LogicView.TextSize.view375), |
| | | Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64), |
| | | BackgroundColor = CSS.CSS_Color.viewMiddle, |
| | | }; |
| | | this.AddChidren(viewLayout); |
| | | //室外温、湿度、PM2.5变化 |
| | | LogicView.SelectTypeView airqualityView = new LogicView.SelectTypeView(); |
| | | airqualityView.btnIcon.Visible = false; |
| | | airqualityView.btnText.X = Application.GetRealWidth(16); |
| | | airqualityView.btnLine.X = Application.GetRealWidth(16); |
| | | airqualityView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | airqualityView.btnText.TextID =StringId.shuwaigongneng; |
| | | viewLayout.AddChidren(airqualityView.FLayoutView()); |
| | | //天气变化(城市天气) |
| | | LogicView.SelectTypeView weatherView = new LogicView.SelectTypeView(); |
| | | weatherView.frameLayout.Y = airqualityView.frameLayout.Bottom; |
| | | weatherView.btnIcon.Visible = false; |
| | | weatherView.btnText.X = Application.GetRealWidth(16); |
| | | weatherView.btnLine.X = Application.GetRealWidth(16); |
| | | weatherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | weatherView.btnText.TextID = StringId.tianqibianhua; |
| | | viewLayout.AddChidren(weatherView.FLayoutView()); |
| | | |
| | | #endregion |
| | | |
| | | #region 所有点击事件 |
| | | //室外温、湿度、PM2.5变化 |
| | | airqualityView.btnClick.MouseUpEventHandler += (sen, e) => { |
| | | OutdoorEnvironment outdoorEnvironment = new OutdoorEnvironment(); |
| | | MainPage.BasePageView.AddChidren(outdoorEnvironment); |
| | | outdoorEnvironment.Show(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | }; |
| | | //天气变化(城市天气) |
| | | weatherView.btnClick.MouseUpEventHandler += (sen, e) => { |
| | | WeatherCondition weatherCondition = new WeatherCondition(); |
| | | MainPage.BasePageView.AddChidren(weatherCondition); |
| | | weatherCondition.Show(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Shared; |
| | | namespace HDL_ON.UI.UI2.Intelligence.Automation |
| | | { |
| | | public class WeatherCondition : FrameLayout |
| | | { |
| | | public WeatherCondition() |
| | | { |
| | | Tag = "Logic"; |
| | | } |
| | | public void Show(bool edit = false, int index=-1) |
| | | { |
| | | #region 界面布局 |
| | | LogicView.TopView topView = new LogicView.TopView(); |
| | | topView.frameLayout.Height = Application.GetRealHeight(64 + 20); |
| | | this.AddChidren(topView.FLayoutView()); |
| | | topView.topNameBtn.TextID = StringId.selectionCondition; |
| | | //获取宽度 |
| | | int widthValue= topView.topNameBtn.GetTextWidth(); |
| | | int textWidth =(Application.GetRealWidth(255)- widthValue) / 2; |
| | | Button locationBtn = new Button |
| | | { |
| | | Width = Application.GetRealWidth(18), |
| | | Height = Application.GetRealWidth(18), |
| | | X = Application.GetRealWidth(60+4)+ textWidth + widthValue, |
| | | Y = Application.GetRealHeight(34+1), |
| | | UnSelectedImagePath = "LogicIcon/location.png", |
| | | |
| | | }; |
| | | topView.frameLayout.AddChidren(locationBtn); |
| | | |
| | | Button textBtn = new Button |
| | | { |
| | | Height = Application.GetRealHeight(14), |
| | | Y = Application.GetRealHeight(57), |
| | | TextSize = LogicView.TextSize.text10, |
| | | TextColor = CSS.CSS_Color.textCancelColor, |
| | | Text = "广东广州市番禺区石楼镇", |
| | | }; |
| | | topView.frameLayout.AddChidren(textBtn); |
| | | topView.clickBackBtn.MouseUpEventHandler += (e, sen) => |
| | | { |
| | | RemoveFromParent(); |
| | | }; |
| | | |
| | | FrameLayout viewLayout = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(64+20), |
| | | Width = Application.GetRealWidth(LogicView.TextSize.view375), |
| | | Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64-20), |
| | | BackgroundColor = CSS.CSS_Color.viewMiddle, |
| | | }; |
| | | this.AddChidren(viewLayout); |
| | | #endregion |
| | | |
| | | var list = new List<string> { |
| | | Language.StringByID(StringId.clearday), |
| | | Language.StringByID(StringId.cloudy), |
| | | Language.StringByID(StringId.rain), |
| | | }; |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | LogicView.SelectTypeView timeView = new LogicView.SelectTypeView(); |
| | | timeView.frameLayout.Y = Application.GetRealHeight(i * 50); |
| | | timeView.btnIcon.Visible = false; |
| | | timeView.btnText.X = Application.GetRealWidth(16); |
| | | timeView.btnLine.X = Application.GetRealWidth(16); |
| | | timeView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); |
| | | timeView.btnText.Text = list[i]; |
| | | timeView.btnClick.Tag = list[i]; |
| | | viewLayout.AddChidren(timeView.FLayoutView()); |
| | | |
| | | timeView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | //string |
| | | //if () { } |
| | | //else if () { } |
| | | //else if () { } |
| | | }; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | Height = Application.GetRealWidth(177), |
| | | Progress = curtain.percent, |
| | | ProgressTextColor =0x00000000, |
| | | IsInvertedProgress = true, |
| | | //IsInvertedProgress = true, |
| | | }; |
| | | controlView.AddChidren(curtainSeekBar); |
| | | |
| | |
| | | Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealWidth(210), |
| | | Progress = curtain.percent, |
| | | IsInvertedProgress = true, |
| | | //IsInvertedProgress = true, |
| | | ProgressTextColor = 0x00000000, |
| | | }; |
| | | controlView.AddChidren(curtainSeekBar); |