| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.5.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202409051"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.6.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202409101"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <uses-permission android:name="android.permission.RECEIVE_SMS" /> |
| | | <!--程序可以读取设备外部存储空间(内置SDcard和外置SDCard)的文件,我的文件等--> |
| | |
| | | AppDomain.CurrentDomain.UnhandledException += (sender, e) => { |
| | | if(e.ExceptionObject is Exception exception) |
| | | { |
| | | MainPage.Log("error","未处理的异常:" + exception.Message); |
| | | MainPage.Log("error", "未处理的异常:" + exception.Message + "\r\nStackTrace: " + exception.StackTrace); |
| | | } |
| | | }; |
| | | |
| | | TaskScheduler.UnobservedTaskException += (sender, e) => { |
| | | if (e.Exception is Exception exception) |
| | | { |
| | | MainPage.Log("error", "未处理的异常:" + exception.Message); |
| | | MainPage.Log("error", "未处理的异常:" + exception.Message + "\r\nStackTrace: " + exception.StackTrace); |
| | | } |
| | | }; |
| | | #endregion |
| | |
| | | <key>CFBundleName</key> |
| | | <string>On Pro</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>2.5.0</string> |
| | | <string>2.6.0</string> |
| | | <key>CFBundleURLTypes</key> |
| | | <array> |
| | | <dict> |
| | |
| | | </dict> |
| | | </array> |
| | | <key>CFBundleVersion</key> |
| | | <string>2.5.0</string> |
| | | <string>2.6.0</string> |
| | | <key>LSApplicationQueriesSchemes</key> |
| | | <array> |
| | | <string>weixinULAPI</string> |
| | |
| | | AcstParentPage.UpdateAcstSubInfo(localFunction); |
| | | WaterHeaterJinmaoPage.UpdateStatus(); |
| | | break; |
| | | case SPK.InverterJinmao: |
| | | InverterJinmaoPage.UpdateStatus(localFunction); |
| | | break; |
| | | case SPK.AirSwitch: |
| | | AirSwitchPage.UpdataState(localFunction); |
| | | if (localFunction.GetAttribute(FunctionAttributeKey.Power) != null)//如果是带电量的空开也要更新能源界面 |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string APP_KEY = "HDL-HOME-APP"; |
| | | public const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC"; |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string APP_KEY = "HDL-HOME-APP"; |
| | | //public const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC"; |
| | | |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | //public const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | //public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | public const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | |
| | | //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm |
| | | //const string APP_KEY = "CPEVRLRT"; |
| | |
| | | /// 设备spk |
| | | /// </summary> |
| | | public string spk = ""; |
| | | /// <summary> |
| | | /// 扩展信息 |
| | | /// 字符串 |
| | | /// </summary> |
| | | public string extend = ""; |
| | | |
| | | private string _SpkCategory = string.Empty; |
| | | /// <summary> |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"功能数据初始化失败:{ex.Message}"); |
| | | MainPage.Log("Error",$"功能数据初始化失败:{ex.StackTrace}"); |
| | | } |
| | | } |
| | | return rooms; |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "2.5.0"; |
| | | public static string VersionString = "2.6.0"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | _RoomNotSupportFunctionList.Add(SPK.ElectricEnergy); |
| | | _RoomNotSupportFunctionList.Add(SPK.OtherCommon); |
| | | _RoomNotSupportFunctionList.Add(SPK.SensorLight); |
| | | _RoomNotSupportFunctionList.Add(SPK.AcstParent); |
| | | _RoomNotSupportFunctionList.Add(SPK.AcstSub); |
| | | _RoomNotSupportFunctionList.Add(SPK.WaterHeaterJinmao); |
| | | _RoomNotSupportFunctionList.Add(SPK.InverterJinmao); |
| | | _RoomNotSupportFunctionList.AddRange(SPK.EnvironDeviceSpkList()); |
| | | //_RoomNotSupportFunctionList.AddRange(SPK.ArmSensorSpkList()); |
| | | } |
| | |
| | | //etAccount.Text = "18402017839"; |
| | | //etAccount.Text = "18620993214"; |
| | | //etAccount.Text = "13414984501";//吴晓聪 |
| | | |
| | | etAccount.Text = "13580507523"; |
| | | etAccount.Text = "18475593023"; |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | etPassword.Text = "hdl1985."; |
| | | } |
| | | else if (etAccount.Text == "13414984501") |
| | | else if (etAccount.Text == "18475593023") |
| | | { |
| | | etPassword.Text = "a123456"; |
| | | } |
| | |
| | | { |
| | | etPassword.Text = "aa123456"; |
| | | } |
| | | else if (etAccount.Text == "dcai.assist@gmail.com") |
| | | else if (etAccount.Text == "13580507523") |
| | | { |
| | | etPassword.Text = "GraniteTileS57"; |
| | | etPassword.Text = "a123456"; |
| | | } |
| | | //etPassword.Text = "Hdl85521566"; |
| | | btnLogin.IsSelected = true; |
| | | }; |
| | | #endif |
| | |
| | | FunctionList.List.Functions.Add(new Function |
| | | { |
| | | name = "测试-金茂光伏储能", |
| | | extend = "jinmaot1rue", |
| | | spk = SPK.InverterJinmao, |
| | | collect = true, |
| | | attributes = new List<FunctionAttributes>() |
| | |
| | | new FunctionAttributes(){key = InverterJinmao_AttrEnum.load_electricity_today.ToString(),value = new List<string>(){ "0" },curValue ="100",state = "100"}, |
| | | new FunctionAttributes(){key = InverterJinmao_AttrEnum.load_electricity_month.ToString(),value = new List<string>(){ "0" },curValue ="200",state = "200"}, |
| | | new FunctionAttributes(){key = InverterJinmao_AttrEnum.load_electricity.ToString(),value = new List<string>(){ "0" },curValue ="1000",state = "1000"}, |
| | | new FunctionAttributes(){key = InverterJinmao_AttrEnum.coal.ToString(),value = new List<string>(){ "0" },curValue ="100",state = "100"}, |
| | | new FunctionAttributes(){key = InverterJinmao_AttrEnum.co2.ToString(),value = new List<string>(){ "0" },curValue ="1000",state = "1000"}, |
| | | new FunctionAttributes(){key = InverterJinmao_AttrEnum.trees.ToString(),value = new List<string>(){ "0" },curValue ="10",state = "10"}, |
| | | new FunctionAttributes(){key = InverterJinmao_AttrEnum.coal.ToString(),value = new List<string>(){ "0" },curValue ="1021210",state = "1021210"}, |
| | | new FunctionAttributes(){key = InverterJinmao_AttrEnum.co2.ToString(),value = new List<string>(){ "0" },curValue ="1031300",state = "1031300"}, |
| | | new FunctionAttributes(){key = InverterJinmao_AttrEnum.trees.ToString(),value = new List<string>(){ "0" },curValue ="121310",state = "121310"}, |
| | | } |
| | | }); |
| | | |
| | |
| | | { |
| | | name = "测试-空调科技系统总控", |
| | | spk = SPK.AcstParent, |
| | | extend = "jinmaotrue", |
| | | collect = true, |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes(){ key = FunctionAttributeKey.OnOff ,curValue = "on",state = "on" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.co2.ToString(),curValue = "52",state = "52" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.energy_electricity.ToString(),curValue = "100",state = "100" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.co2.ToString(),curValue = "522222",state = "522222" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.energy_electricity.ToString(),curValue = "144400",state = "144400" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.flow.ToString(),curValue = "2",state = "2" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.mode.ToString(),curValue = "economic",state = "economic" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.mode_free.ToString(),curValue = "true",state = "true" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.recycl_volume.ToString(),curValue = "10",state = "10" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.set_temp.ToString(),curValue = "25",state = "25" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.temp.ToString(),curValue = "23",state = "23" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.trees.ToString(),curValue = "8",state = "8" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.trees.ToString(),curValue = "11228",state = "11228" }, |
| | | new FunctionAttributes(){ key = WaterHeaterJinmao_AttrEnum.volume.ToString(),curValue = "100",state = "100" }, |
| | | |
| | | }, |
| | |
| | | { |
| | | X = Application.GetRealWidth(11), |
| | | Y = Application.GetRealWidth(10), |
| | | TextID = StringId.Acst, |
| | | Text = function.name, |
| | | //TextID = StringId.Acst, |
| | | IsBold = true, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | |
| | | Height = Application.GetRealHeight(37), |
| | | }; |
| | | view.AddChidren(btnLogo); |
| | | |
| | | try |
| | | { |
| | | if (function.extend.Contains("jinmao") && function.extend.Contains("true")) |
| | | { |
| | | btnLogo.Visible = true; |
| | | } |
| | | else |
| | | { |
| | | btnLogo.Visible = false; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂logo显示处理异常:{ex.Message}"); |
| | | } |
| | | |
| | | Button btnFunctionViewBg; |
| | | btnFunctionViewBg = new Button() |
| | |
| | | } |
| | | else if (function.spk == SPK.InverterJinmao) |
| | | { |
| | | btnName.TextID = StringId.NewEnergy; |
| | | //btnName.TextID = StringId.NewEnergy; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new InverterJinmaoPage(); |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Security.Cryptography; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | |
| | | Height = Application.GetRealWidth(57), |
| | | }; |
| | | functionView.AddChidren(btnJMLogo); |
| | | |
| | | |
| | | |
| | | if (item == ShowFunction.Acst) |
| | | { |
| | | btnName.TextID = StringId.Acst; |
| | | try |
| | | { |
| | | var acstFunction = FunctionList.List.GetAcstParentList()[0]; |
| | | btnName.Text = acstFunction.name; |
| | | if (acstFunction.extend.Contains("jinmao") && acstFunction.extend.Contains("true")) |
| | | { |
| | | btnJMLogo.Visible = true; |
| | | } |
| | | else |
| | | { |
| | | btnJMLogo.Visible = false; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"加载金茂科技系统主控名称异常:{ex.Message}"); |
| | | } |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new AcstParentPage(); |
| | |
| | | else if (item == ShowFunction.InverterJinmao) |
| | | { |
| | | btnName.TextID = StringId.NewEnergy; |
| | | try |
| | | { |
| | | var jinmaoInverterFunction = FunctionList.List.GetInverterJinmaoList()[0]; |
| | | btnName.Text = jinmaoInverterFunction.name; |
| | | if (jinmaoInverterFunction.extend.Contains("jinmao") && jinmaoInverterFunction.extend.Contains("true")) |
| | | { |
| | | btnJMLogo.Visible = true; |
| | | } |
| | | else |
| | | { |
| | | btnJMLogo.Visible = false; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"加载金茂储能名称异常:{ex.Message}"); |
| | | } |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new InverterJinmaoPage(); |
| | |
| | | { |
| | | continue; |
| | | } |
| | | #if DEBUG |
| | | //throw new ArgumentNullException(); |
| | | #endif |
| | | |
| | | functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); |
| | | |
| | |
| | | { |
| | | X = Application.GetRealWidth(18 + 7), |
| | | Y = Application.GetRealHeight(11), |
| | | Width = Application.GetRealWidth(120), |
| | | Height = Application.GetRealHeight(40), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = 0xFF1b3053, |
| | |
| | | contentView.AddChidren(btnSetTempValues); |
| | | #if __IOS__ |
| | | bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | #else |
| | | bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(5); |
| | | #endif |
| | | |
| | | |
| | |
| | | |
| | | echartOption1 = new EchartsOption_Histogram(); |
| | | echartOption1.xTitle = "时间"; |
| | | echartOption1.yTitle = "电量(kw)"; |
| | | echartOption1.yTitle = "电量(kwh)"; |
| | | //echartOption.InitXdataText(new List<string>() |
| | | //{ |
| | | // "21","22","23","24","25","26","26","27","28","29", |
| | |
| | | |
| | | echartOption2 = new EchartsOption_Histogram(); |
| | | echartOption2.xTitle = "时间"; |
| | | echartOption2.yTitle = "电量(kw)"; |
| | | echartOption2.yTitle = "电量(kwh)"; |
| | | //echartOption2.InitXdataText(new List<string>() |
| | | //{ |
| | | // "21","22","23","24","25","26","26","27","28","29", |
| | |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var ddd = echartOption2.InitOption(); |
| | | infoView2_EchartsView.ShowWithOption(echartOption2.InitOption()); |
| | | }); |
| | | } |
| | |
| | | var pvElecQueryDate = new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1); |
| | | if (queryType1 == QueryType.day_hour) |
| | | { |
| | | if (pvElecQueryDate.Year == 2023 && pvElecQueryDate.Month == 1 && pvElecQueryDate.Day == 1) |
| | | if (pvElecQueryDate.Year <= 2023 && pvElecQueryDate.Month == 1 && pvElecQueryDate.Day == 1) |
| | | { |
| | | return; |
| | | } |
| | |
| | | } |
| | | else if (queryType1 == QueryType.custom_month) |
| | | { |
| | | if (pvElecQueryDate.Year == 2023 && pvElecQueryDate.Month == 1) |
| | | if (pvElecQueryDate.Year <= 2023 && pvElecQueryDate.Month == 1) |
| | | { |
| | | return; |
| | | } |
| | | pvElecQueryDate = pvElecQueryDate.AddMonths(-1); |
| | | queryTime_Day1 = pvElecQueryDate.Day; |
| | | infoView1_DateInfo_DateTextButton.Text = pvElecQueryDate.ToString("yyyy-MM"); |
| | | } |
| | | else if (queryType1 == QueryType.custom_year) |
| | | { |
| | | if (pvElecQueryDate.Year == 2023) |
| | | if (pvElecQueryDate.Year <= 2023) |
| | | { |
| | | return; |
| | | } |
| | |
| | | }; |
| | | infoView1_DateInfo_NextClickButton.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var tempQueryDate = new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1); |
| | | var pvElecQueryDate = new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1); |
| | | if (queryType1 == QueryType.day_hour) |
| | | { |
| | | if (tempQueryDate.Year == DateTime.Now.Year && tempQueryDate.Month == DateTime.Now.Month && tempQueryDate.Day == DateTime.Now.Day) |
| | | if (pvElecQueryDate.Year == DateTime.Now.Year && pvElecQueryDate.Month == DateTime.Now.Month && pvElecQueryDate.Day == DateTime.Now.Day) |
| | | { |
| | | return; |
| | | } |
| | | tempQueryDate = tempQueryDate.AddDays(1); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM-dd"); |
| | | pvElecQueryDate = pvElecQueryDate.AddDays(1); |
| | | infoView1_DateInfo_DateTextButton.Text = pvElecQueryDate.ToString("yyyy-MM-dd"); |
| | | } |
| | | else if (queryType1 == QueryType.custom_month) |
| | | { |
| | | if (tempQueryDate.Year == DateTime.Now.Year && tempQueryDate.Month == DateTime.Now.Month) |
| | | if (pvElecQueryDate.Year == DateTime.Now.Year && pvElecQueryDate.Month == DateTime.Now.Month) |
| | | { |
| | | return; |
| | | } |
| | | tempQueryDate = tempQueryDate.AddMonths(1); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM"); |
| | | pvElecQueryDate = pvElecQueryDate.AddMonths(1); |
| | | queryTime_Day1 = pvElecQueryDate.Day; |
| | | infoView1_DateInfo_DateTextButton.Text = pvElecQueryDate.ToString("yyyy-MM"); |
| | | } |
| | | else if (queryType1 == QueryType.custom_year) |
| | | { |
| | | if (tempQueryDate.Year == 2023) |
| | | if (pvElecQueryDate.Year >= DateTime.Now.Year) |
| | | { |
| | | return; |
| | | } |
| | | if (tempQueryDate.Year == DateTime.Now.Year) |
| | | { |
| | | return; |
| | | } |
| | | tempQueryDate = tempQueryDate.AddYears(1); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy"); |
| | | pvElecQueryDate = pvElecQueryDate.AddYears(1); |
| | | infoView1_DateInfo_DateTextButton.Text = pvElecQueryDate.ToString("yyyy"); |
| | | } |
| | | queryTime_Year1 = tempQueryDate.Year; |
| | | queryTime_Month1 = tempQueryDate.Month; |
| | | queryTime_Day1 = tempQueryDate.Day; |
| | | queryTime_Year1 = pvElecQueryDate.Year; |
| | | queryTime_Month1 = pvElecQueryDate.Month; |
| | | queryTime_Day1 = pvElecQueryDate.Day; |
| | | getPvElectricityHistory(); |
| | | }; |
| | | |
| | |
| | | infoView1_Date_Month.IsSelected = false; |
| | | infoView1_Date_Year.IsSelected = false; |
| | | queryType1 = QueryType.day_hour; |
| | | if (DateTime.Now.Date < new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1)) |
| | | { |
| | | queryTime_Year1 = DateTime.Now.Year; |
| | | queryTime_Month1 = DateTime.Now.Month; |
| | | queryTime_Day1 = DateTime.Now.Day; |
| | | } |
| | | infoView1_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1).ToString("yyyy-MM-dd"); |
| | | getPvElectricityHistory(); |
| | | }; |
| | |
| | | infoView1_Date_Month.IsSelected = true; |
| | | infoView1_Date_Year.IsSelected = false; |
| | | queryType1 = QueryType.custom_month; |
| | | if (DateTime.Now.Date < new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1)) |
| | | { |
| | | queryTime_Year1 = DateTime.Now.Year; |
| | | queryTime_Month1 = DateTime.Now.Month; |
| | | } |
| | | infoView1_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1).ToString("yyyy-MM"); |
| | | getPvElectricityHistory(); |
| | | }; |
| | |
| | | var waterQueryDate = new DateTime(queryTime_Year2, queryTime_Month2, queryTime_Day2); |
| | | if (queryType2 == QueryType.day_hour) |
| | | { |
| | | if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1 && waterQueryDate.Day == 1) |
| | | if (waterQueryDate.Year <= 2023 && waterQueryDate.Month == 1 && waterQueryDate.Day == 1) |
| | | { |
| | | return; |
| | | } |
| | |
| | | } |
| | | else if (queryType2 == QueryType.custom_month) |
| | | { |
| | | if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1) |
| | | if (waterQueryDate.Year <= 2023 && waterQueryDate.Month == 1) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddMonths(-1); |
| | | queryTime_Day2 = waterQueryDate.Day; |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM"); |
| | | } |
| | | else if (queryType2 == QueryType.custom_year) |
| | | { |
| | | if (waterQueryDate.Year == 2023) |
| | | if (waterQueryDate.Year <= 2023) |
| | | { |
| | | return; |
| | | } |
| | |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddMonths(1); |
| | | queryTime_Day2 = waterQueryDate.Day; |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM"); |
| | | } |
| | | else if (queryType2 == QueryType.custom_year) |
| | | { |
| | | if (waterQueryDate.Year == 2023) |
| | | { |
| | | return; |
| | | } |
| | | if (waterQueryDate.Year == DateTime.Now.Year) |
| | | if (waterQueryDate.Year >= DateTime.Now.Year) |
| | | { |
| | | return; |
| | | } |
| | |
| | | infoView2_Date_Month.IsSelected = false; |
| | | infoView2_Date_Year.IsSelected = false; |
| | | queryType2 = QueryType.day_hour; |
| | | if (DateTime.Now.Date < new DateTime(queryTime_Year2, queryTime_Month2, queryTime_Day2)) |
| | | { |
| | | queryTime_Year2 = DateTime.Now.Year; |
| | | queryTime_Month2 = DateTime.Now.Month; |
| | | queryTime_Day2 = DateTime.Now.Day; |
| | | } |
| | | infoView2_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year2, queryTime_Month2, queryTime_Day2).ToString("yyyy-MM-dd"); |
| | | getLoadElectricityHistory(); |
| | | }; |
| | |
| | | infoView2_Date_Month.IsSelected = true; |
| | | infoView2_Date_Year.IsSelected = false; |
| | | queryType2 = QueryType.custom_month; |
| | | if (DateTime.Now.Date < new DateTime(queryTime_Year2, queryTime_Month2, queryTime_Day2)) |
| | | { |
| | | queryTime_Year2 = DateTime.Now.Year; |
| | | queryTime_Month2 = DateTime.Now.Month; |
| | | } |
| | | infoView2_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year2, queryTime_Month2, queryTime_Day2).ToString("yyyy-MM"); |
| | | getLoadElectricityHistory(); |
| | | }; |
| | |
| | | }; |
| | | topView.AddChidren(btnConfrim); |
| | | |
| | | var btnToday = new Button() |
| | | { |
| | | X = Application.GetRealWidth(160 - 32) - btnConfrim.GetTextWidth(), |
| | | Width = Application.GetRealWidth(160), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Visible = false, |
| | | Enable = false, |
| | | Text = "今日", |
| | | }; |
| | | topView.AddChidren(btnToday); |
| | | |
| | | UIPickerView uIPickerView = new UIPickerView() |
| | | { |
| | | Y = Application.GetRealHeight(40), |
| | |
| | | }; |
| | | uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => |
| | | { |
| | | if (int1 < 0) |
| | | { |
| | | int1 = 1; |
| | | } |
| | | if (pickerItems_Year[int1] != item1.ToString()) |
| | | { |
| | | int.TryParse(pickerItems_Year[int1], out item1); |
| | |
| | | } |
| | | if (pickerItems_Month != null) |
| | | { |
| | | if (int2 > pickerItems_Month.Count) |
| | | if (int2 >= pickerItems_Month.Count || int2 < 0) |
| | | { |
| | | int2 = 0; |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | uIPickerView.setNPicker(pickerItems_Year, pickerItems_Month, pickerItems_Day); |
| | | uIPickerView.setCurrentItems(pickerItems_Year.IndexOf(item1.ToString()), |
| | | pickerItems_Month == null ? 0 : pickerItems_Month.IndexOf(item2.ToString()), |
| | | pickerItems_Day == null ? 0 : pickerItems_Day.IndexOf(item3.ToString())); |
| | | try |
| | | { |
| | | uIPickerView.setNPicker(pickerItems_Year, pickerItems_Month, pickerItems_Day); |
| | | uIPickerView.setCurrentItems(pickerItems_Year.IndexOf(item1.ToString()), |
| | | pickerItems_Month == null ? 0 : pickerItems_Month.IndexOf(item2.ToString()), |
| | | pickerItems_Day == null ? 0 : pickerItems_Day.IndexOf(item3.ToString())); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂历史数据控件异常:{ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | if (pickerItems_Day != null) |
| | | { |
| | | if (int3 >= pickerItems_Day.Count) |
| | | if (int3 >= pickerItems_Day.Count || int3 < 0) |
| | | { |
| | | int3 = 0; |
| | | } |
| | |
| | | { |
| | | queryTime_Month1 = item2; |
| | | } |
| | | infoView1_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year1, queryTime_Month1, queryTime_Day1).ToString("yyyy-MM"); |
| | | infoView1_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year1, queryTime_Month1, 1).ToString("yyyy-MM"); |
| | | if (queryType1 == QueryType.day_hour) |
| | | { |
| | | if (item3 != queryTime_Day1) |
| | |
| | | getPvElectricityHistory(); |
| | | }; |
| | | |
| | | |
| | | if (queryType1 == QueryType.day_hour) |
| | | { |
| | | try |
| | | { |
| | | btnToday.Visible = btnToday.Enable = true; |
| | | btnToday.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pickerItems_Year = new List<string>(); |
| | | pickerItems_Year.Add("2023"); |
| | | while (DateTime.Now.Year > 2022 + pickerItems_Year.Count) |
| | | { |
| | | pickerItems_Year.Add((2023 + pickerItems_Year.Count).ToString()); |
| | | } |
| | | |
| | | if (queryType1 == QueryType.custom_month || queryType1 == QueryType.day_hour) |
| | | { |
| | | pickerItems_Month = new List<string>(); |
| | | if (queryTime_Year1 == DateTime.Now.Year) |
| | | { |
| | | int addMonth = 0; |
| | | while (DateTime.Now.Month > addMonth) |
| | | { |
| | | addMonth++; |
| | | pickerItems_Month.Add(addMonth.ToString()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (var i = 1; i < 13; i++) |
| | | { |
| | | pickerItems_Month.Add(i.ToString()); |
| | | } |
| | | } |
| | | if (queryType1 == QueryType.day_hour) |
| | | { |
| | | pickerItems_Day = new List<string>(); |
| | | if (queryTime_Month1 == DateTime.Now.Month) |
| | | { |
| | | int addDay = 0; |
| | | while (DateTime.Now.Day > addDay) |
| | | { |
| | | addDay++; |
| | | pickerItems_Day.Add(addDay.ToString()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (var i = 1; i <= DateTime.DaysInMonth(queryTime_Year1, queryTime_Month1); i++) |
| | | { |
| | | pickerItems_Day.Add(i.ToString()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | item3 = queryTime_Day1 = DateTime.Now.Day; |
| | | item2 = queryTime_Month1 = DateTime.Now.Month; |
| | | item1 = queryTime_Year1 = DateTime.Now.Year; |
| | | uIPickerView.setNPicker(pickerItems_Year, pickerItems_Month, pickerItems_Day); |
| | | uIPickerView.setCurrentItems(pickerItems_Year.IndexOf(queryTime_Year1.ToString()), |
| | | pickerItems_Month == null ? 0 : pickerItems_Month.IndexOf(queryTime_Month1.ToString()), |
| | | pickerItems_Day == null ? 0 : pickerItems_Day.IndexOf(queryTime_Day1.ToString())); |
| | | }; |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | |
| | | public void SetWaterQureyDateDialog() |
| | |
| | | }; |
| | | uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => |
| | | { |
| | | if (int1 < 0) |
| | | { |
| | | int1 = 0; |
| | | } |
| | | if (pickerItems_Year[int1] != item1.ToString()) |
| | | { |
| | | int.TryParse(pickerItems_Year[int1], out item1); |
| | |
| | | } |
| | | if (pickerItems_Month != null) |
| | | { |
| | | if (int2 > pickerItems_Month.Count) |
| | | if (int2 > pickerItems_Month.Count || int2 < 0) |
| | | { |
| | | int2 = 0; |
| | | } |
| | |
| | | } |
| | | if (pickerItems_Day != null) |
| | | { |
| | | if (int3 >= pickerItems_Day.Count) |
| | | if (int3 >= pickerItems_Day.Count || int3 < 0) |
| | | { |
| | | int3 = 0; |
| | | } |
| | |
| | | { |
| | | queryTime_Month2 = item2; |
| | | } |
| | | infoView2_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year2, queryTime_Month2, queryTime_Day2).ToString("yyyy-MM"); |
| | | infoView2_DateInfo_DateTextButton.Text = new DateTime(queryTime_Year2, queryTime_Month2, 1).ToString("yyyy-MM"); |
| | | if (queryType2 == QueryType.day_hour) |
| | | { |
| | | if (item3 != queryTime_Day2) |
| | |
| | | getLoadElectricityHistory(); |
| | | }; |
| | | |
| | | var btnToday = new Button() |
| | | { |
| | | X = Application.GetRealWidth(160 - 32) - btnConfrim.GetTextWidth(), |
| | | Width = Application.GetRealWidth(160), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Visible = false, |
| | | Enable = false, |
| | | Text = "今日", |
| | | }; |
| | | topView.AddChidren(btnToday); |
| | | |
| | | |
| | | if (queryType2 == QueryType.day_hour) |
| | | { |
| | | try |
| | | { |
| | | btnToday.Visible = btnToday.Enable = true; |
| | | btnToday.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pickerItems_Year = new List<string>(); |
| | | pickerItems_Year.Add("2023"); |
| | | while (DateTime.Now.Year > 2022 + pickerItems_Year.Count) |
| | | { |
| | | pickerItems_Year.Add((2023 + pickerItems_Year.Count).ToString()); |
| | | } |
| | | |
| | | if (queryType2 == QueryType.custom_month || queryType2 == QueryType.day_hour) |
| | | { |
| | | pickerItems_Month = new List<string>(); |
| | | if (queryTime_Year2 == DateTime.Now.Year) |
| | | { |
| | | int addMonth = 0; |
| | | while (DateTime.Now.Month > addMonth) |
| | | { |
| | | addMonth++; |
| | | pickerItems_Month.Add(addMonth.ToString()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (var i = 1; i < 13; i++) |
| | | { |
| | | pickerItems_Month.Add(i.ToString()); |
| | | } |
| | | } |
| | | if (queryType2 == QueryType.day_hour) |
| | | { |
| | | pickerItems_Day = new List<string>(); |
| | | if (queryTime_Month2 == DateTime.Now.Month) |
| | | { |
| | | int addDay = 0; |
| | | while (DateTime.Now.Day > addDay) |
| | | { |
| | | addDay++; |
| | | pickerItems_Day.Add(addDay.ToString()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (var i = 1; i <= DateTime.DaysInMonth(queryTime_Year2, queryTime_Month2); i++) |
| | | { |
| | | pickerItems_Day.Add(i.ToString()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | item3 = queryTime_Day2 = DateTime.Now.Day; |
| | | item2 = queryTime_Month2 = DateTime.Now.Month; |
| | | item1 = queryTime_Year2 = DateTime.Now.Year; |
| | | uIPickerView.setNPicker(pickerItems_Year, pickerItems_Month, pickerItems_Day); |
| | | uIPickerView.setCurrentItems(pickerItems_Year.IndexOf(queryTime_Year2.ToString()), |
| | | pickerItems_Month == null ? 0 : pickerItems_Month.IndexOf(queryTime_Month2.ToString()), |
| | | pickerItems_Day == null ? 0 : pickerItems_Day.IndexOf(queryTime_Day2.ToString())); |
| | | }; |
| | | } |
| | | catch { } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | public class InverterJinmaoPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | static InverterJinmaoPage bodyView; |
| | | Function function; |
| | | /// <summary> |
| | | /// 今日发电量数据按钮 |
| | |
| | | /// <summary> |
| | | /// 光伏运行状态图标按钮 |
| | | /// </summary> |
| | | Button pvRunStatus_IconButtonp; |
| | | Button pvRunStatus_IconButton; |
| | | /// <summary> |
| | | /// 光伏运行状态文本按钮 |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 光伏状态今日用电量数据按钮 |
| | | /// </summary> |
| | | Button loadElec_TodayTextButton; |
| | | Button powerUsage_TodayValuesButton; |
| | | /// <summary> |
| | | /// 光伏状态本月用电量数据按钮 |
| | | /// </summary> |
| | |
| | | |
| | | #if __IOS__ |
| | | pvGenerate_TodayValuesButton.TextAlignment = TextAlignment.TopLeft; |
| | | pvGenerate_TodayValuesButton.Width = pvGenerate_TodayValuesButton.GetTextWidth() + Application.GetRealWidth(6); |
| | | pvGenerate_TodayValuesButton.Width = pvGenerate_TodayValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | pvGenerate_TodayValuesButton.TextAlignment = TextAlignment.BottomLeft; |
| | | pvGenerate_TodayValuesButton.Y = Application.GetRealWidth(37); |
| | |
| | | { |
| | | Y = Application.GetRealWidth(43), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "kw", |
| | | Text = "kwh", |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = 12, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | pvGenerate_todayUintButton.X = pvGenerate_TodayValuesButton.Right; |
| | | pvGenerate_todayUintButton.X = pvGenerate_TodayValuesButton.Right - Application.GetRealWidth(2); |
| | | electricityGenerationView.AddChidren(pvGenerate_todayUintButton); |
| | | |
| | | pvGenerate_TotalValuesButton = new Button() |
| | |
| | | { |
| | | Y = Application.GetRealWidth(43), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "kw", |
| | | Text = "kwh", |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = 12, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | |
| | | }; |
| | | pvEleGenerationInfoView.AddChidren(pvRunStatusInfoView); |
| | | |
| | | pvRunStatus_IconButtonp = new Button() |
| | | pvRunStatus_IconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 14), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | Height = Application.GetRealWidth(12), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconRun.png", |
| | | }; |
| | | pvRunStatusInfoView.AddChidren(pvRunStatus_IconButtonp); |
| | | pvRunStatusInfoView.AddChidren(pvRunStatus_IconButton); |
| | | |
| | | pvRunStatus_TextButton = new Button() |
| | | { |
| | |
| | | try |
| | | { |
| | | int index = 1; |
| | | float pvPower = 0.00f; |
| | | while (index < 361) |
| | | { |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.pv_power.ToString()) == "0") |
| | | float.TryParse(function.GetAttrState(InverterJinmao_AttrEnum.pv_power.ToString()), out pvPower); |
| | | if (pvPower > 0.00f) |
| | | { |
| | | continue; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | powerGenerationBg.SetRotation(1f * index++); |
| | | }); |
| | | System.Threading.Thread.Sleep(50); |
| | | if (index == 361) |
| | | { |
| | | index = 1; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | powerGenerationBg.SetRotation(1f * index++); |
| | | }); |
| | | System.Threading.Thread.Sleep(50); |
| | | if (index == 361) |
| | | { |
| | | index = 1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | Y = Application.GetRealWidth(78), |
| | | //Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(25), |
| | | Text = "实时发电功率 (kwh)", |
| | | Text = "实时发电功率 (kw)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "今日发电量 (kw)", |
| | | Text = "今日发电量 (kwh)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "本月发电量 (kw)", |
| | | Text = "本月发电量 (kwh)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "本年发电量 (kw)", |
| | | Text = "本年发电量 (kwh)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | try |
| | | { |
| | | var revertObj = new HttpServerRequest().GetSensorHistory("custom_year", |
| | | function.deviceId, InverterJinmao_AttrEnum.load_electricity.ToString(), DateTime.Now.Year.ToString()); |
| | | function.deviceId, InverterJinmao_AttrEnum.pv_electricity.ToString(), DateTime.Now.Year.ToString()); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | |
| | | try |
| | | { |
| | | int index = 1; |
| | | float loadPower = 0.00f; |
| | | while (index < 361) |
| | | { |
| | | if (function.GetAttrState(InverterJinmao_AttrEnum.load_active_power.ToString()) == "0") |
| | | float.TryParse(function.GetAttrState(InverterJinmao_AttrEnum.load_active_power.ToString()), out loadPower); |
| | | if (loadPower > 0.00f) |
| | | { |
| | | continue; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | powerUsageBg.SetRotation(1f * index++); |
| | | }); |
| | | System.Threading.Thread.Sleep(50); |
| | | if (index == 361) |
| | | { |
| | | index = 1; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | powerUsageBg.SetRotation(1f * index++); |
| | | }); |
| | | System.Threading.Thread.Sleep(50); |
| | | if (index == 361) |
| | | { |
| | | index = 1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | Y = Application.GetRealWidth(78), |
| | | //Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(25), |
| | | Text = "实时用电功率 (kwh)", |
| | | Text = "实时用电功率 (kw)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | powerUsageView.AddChidren(powerUsage_TextButton); |
| | | |
| | | |
| | | var powerUsage_TodayValuesButton = new Button() |
| | | powerUsage_TodayValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(191), |
| | |
| | | }; |
| | | electricityUsageStatusView.AddChidren(powerUsage_TodayValuesButton); |
| | | |
| | | loadElec_TodayTextButton = new Button() |
| | | var loadElec_TodayTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "今日用电量 (kw)", |
| | | Text = "今日用电量 (kwh)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "本月用电量 (kw)", |
| | | Text = "本月用电量 (kwh)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | |
| | | Y = Application.GetRealWidth(220), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(17), |
| | | Text = "本年用电量 (kw)", |
| | | Text = "本年用电量 (kwh)", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | | }; |
| | | electricityUsageStatusView.AddChidren(powerUsage_YearTextButton); |
| | | |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var revertObj = new HttpServerRequest().GetSensorHistory("custom_year", |
| | | function.deviceId, InverterJinmao_AttrEnum.load_electricity.ToString(), DateTime.Now.Year.ToString()); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString()); |
| | | double totalValues = 0.0; |
| | | double values = 0.0; |
| | | foreach (var data in revertData) |
| | | { |
| | | double.TryParse(data.fieldValue, out values); |
| | | totalValues += values; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | powerUsage_YearValuesButton.Text = totalValues.ToString(); |
| | | while (true) |
| | | { |
| | | if (powerUsage_YearValuesButton.Width < powerUsage_YearValuesButton.GetTextWidth()) |
| | | { |
| | | powerUsage_YearValuesButton.TextSize--; |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", "读取金茂本年发电量数据异常:" + ex.Message); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() |
| | | if (function.attributes.Find((obj) => obj.key == InverterJinmao_AttrEnum.ess_status.ToString()) != null) |
| | | { |
| | | Height = Application.GetRealWidth(8) |
| | | }); |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(8) |
| | | }); |
| | | |
| | | #region 储能运行状态 Energy storage |
| | | var esRunStatus_TitleButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Height = Application.GetRealWidth(47), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = "储能运行状态", |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 16, |
| | | IsBold = true, |
| | | }; |
| | | contentView.AddChidren(esRunStatus_TitleButton); |
| | | #region 储能运行状态 Energy storage |
| | | var esRunStatus_TitleButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Height = Application.GetRealWidth(47), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = "储能运行状态", |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 16, |
| | | IsBold = true, |
| | | }; |
| | | contentView.AddChidren(esRunStatus_TitleButton); |
| | | |
| | | #region |
| | | var esStatusView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(194), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(esStatusView); |
| | | #region |
| | | var esStatusView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(194), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(esStatusView); |
| | | |
| | | esStatus_InfoView = new FrameLayout() |
| | | { |
| | | X = 0 - Application.GetRealWidth(14), |
| | | Y = Application.GetRealWidth(12), |
| | | Width = Application.GetRealWidth(68 + 14), |
| | | Height = Application.GetRealWidth(28), |
| | | BackgroundColor = 0x1500C22D, |
| | | Radius = (uint)Application.GetRealHeight(14), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | }; |
| | | esStatusView.AddChidren(esStatus_InfoView); |
| | | esStatus_InfoView = new FrameLayout() |
| | | { |
| | | X = 0 - Application.GetRealWidth(14), |
| | | Y = Application.GetRealWidth(12), |
| | | Width = Application.GetRealWidth(68 + 14), |
| | | Height = Application.GetRealWidth(28), |
| | | BackgroundColor = 0x1500C22D, |
| | | Radius = (uint)Application.GetRealHeight(14), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | }; |
| | | esStatusView.AddChidren(esStatus_InfoView); |
| | | |
| | | esRunStatus_Info_IconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 14), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(12), |
| | | Height = Application.GetRealWidth(12), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconCharg.png", |
| | | }; |
| | | esStatus_InfoView.AddChidren(esRunStatus_Info_IconButton); |
| | | esRunStatus_Info_IconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 14), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(12), |
| | | Height = Application.GetRealWidth(12), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconCharg.png", |
| | | }; |
| | | esStatus_InfoView.AddChidren(esRunStatus_Info_IconButton); |
| | | |
| | | esRunStatus_Info_TextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 14 + 4 + 12), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = 0xFF00C22D, |
| | | Text = "充电", |
| | | }; |
| | | esStatus_InfoView.AddChidren(esRunStatus_Info_TextButton); |
| | | esRunStatus_Info_TextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 14 + 4 + 12), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = 0xFF00C22D, |
| | | Text = "充电", |
| | | }; |
| | | esStatus_InfoView.AddChidren(esRunStatus_Info_TextButton); |
| | | |
| | | esRunStatus_BatteryValuesButton = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(18), |
| | | Height = Application.GetRealWidth(17), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | Text = function.GetAttrState(InverterJinmao_AttrEnum.battery_soc.ToString()) + "%", |
| | | TextSize = 12, |
| | | TextColor = 0xFF00C22D, |
| | | }; |
| | | esRunStatus_BatteryValuesButton.Width = esRunStatus_BatteryValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | esRunStatus_BatteryValuesButton.X = Application.GetRealWidth(343 - 12) - esRunStatus_BatteryValuesButton.Width; |
| | | esStatusView.AddChidren(esRunStatus_BatteryValuesButton); |
| | | esRunStatus_BatteryValuesButton = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(18), |
| | | Height = Application.GetRealWidth(17), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | Text = function.GetAttrState(InverterJinmao_AttrEnum.battery_soc.ToString()) + "%", |
| | | TextSize = 12, |
| | | TextColor = 0xFF00C22D, |
| | | }; |
| | | esRunStatus_BatteryValuesButton.Width = esRunStatus_BatteryValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | esRunStatus_BatteryValuesButton.X = Application.GetRealWidth(343 - 12) - esRunStatus_BatteryValuesButton.Width; |
| | | esStatusView.AddChidren(esRunStatus_BatteryValuesButton); |
| | | |
| | | esRunStatus_BatteryIconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 12 - 20) - esRunStatus_BatteryValuesButton.Width, |
| | | Y = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(20), |
| | | Height = Application.GetRealWidth(20), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconCharg.png", |
| | | SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconCharg100.png", |
| | | IsSelected = esRunStatus_BatteryValuesButton.Text == "100%" |
| | | }; |
| | | esStatusView.AddChidren(esRunStatus_BatteryIconButton); |
| | | esRunStatus_BatteryIconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 12 - 20) - esRunStatus_BatteryValuesButton.Width, |
| | | Y = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(20), |
| | | Height = Application.GetRealWidth(20), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconCharg.png", |
| | | SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconCharg100.png", |
| | | IsSelected = esRunStatus_BatteryValuesButton.Text == "100%" |
| | | }; |
| | | esStatusView.AddChidren(esRunStatus_BatteryIconButton); |
| | | |
| | | var esRunStatus_ValuesInfoView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(282), |
| | | Height = Application.GetRealWidth(153), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(40), |
| | | BackgroundImagePath = "FunctionIcon/Acst/Inverter/EnergyStorageStatusBg.png", |
| | | }; |
| | | esStatusView.AddChidren(esRunStatus_ValuesInfoView); |
| | | var esRunStatus_ValuesInfoView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(282), |
| | | Height = Application.GetRealWidth(153), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(40), |
| | | BackgroundImagePath = "FunctionIcon/Acst/Inverter/EnergyStorageStatusBg.png", |
| | | }; |
| | | esStatusView.AddChidren(esRunStatus_ValuesInfoView); |
| | | |
| | | #region 实时充电功率 |
| | | var esRunStatus_ChargeValuesView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(15), |
| | | Width = Application.GetRealWidth(128), |
| | | Height = Application.GetRealWidth(128), |
| | | }; |
| | | esRunStatus_ValuesInfoView.AddChidren(esRunStatus_ChargeValuesView); |
| | | #region 实时充电功率 |
| | | var esRunStatus_ChargeValuesView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(15), |
| | | Width = Application.GetRealWidth(128), |
| | | Height = Application.GetRealWidth(128), |
| | | }; |
| | | esRunStatus_ValuesInfoView.AddChidren(esRunStatus_ChargeValuesView); |
| | | |
| | | esRunStatus_ChargeValuesButton = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(32), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = function.GetAttrState(InverterJinmao_AttrEnum.ess_charge_power.ToString()), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 24, |
| | | IsBold = true, |
| | | }; |
| | | esRunStatus_ChargeValuesView.AddChidren(esRunStatus_ChargeValuesButton); |
| | | esRunStatus_ChargeValuesButton = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(32), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = function.GetAttrState(InverterJinmao_AttrEnum.ess_charge_power.ToString()), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 24, |
| | | IsBold = true, |
| | | }; |
| | | esRunStatus_ChargeValuesView.AddChidren(esRunStatus_ChargeValuesButton); |
| | | |
| | | var esRunStatus_ChargeTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(1), |
| | | Y = Application.GetRealWidth(76), |
| | | Height = Application.GetRealWidth(17), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = "实时充电功率(kwh)", |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | | }; |
| | | esRunStatus_ChargeValuesView.AddChidren(esRunStatus_ChargeTextButton); |
| | | #endregion |
| | | var esRunStatus_ChargeTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(1), |
| | | Y = Application.GetRealWidth(76), |
| | | Height = Application.GetRealWidth(17), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = "实时充电功率(kw)", |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | | }; |
| | | esRunStatus_ChargeValuesView.AddChidren(esRunStatus_ChargeTextButton); |
| | | #endregion |
| | | |
| | | #region 实时用电功率 |
| | | var esRunStatus_DischargeValuesView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(132+13), |
| | | Width = Application.GetRealWidth(128), |
| | | Height = Application.GetRealWidth(128), |
| | | }; |
| | | esRunStatus_ValuesInfoView.AddChidren(esRunStatus_DischargeValuesView); |
| | | #region 实时用电功率 |
| | | var esRunStatus_DischargeValuesView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(132 + 13), |
| | | Width = Application.GetRealWidth(128), |
| | | Height = Application.GetRealWidth(128), |
| | | }; |
| | | esRunStatus_ValuesInfoView.AddChidren(esRunStatus_DischargeValuesView); |
| | | |
| | | esRunStatus_DischargeValuesButton = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(32), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = function.GetAttrState(InverterJinmao_AttrEnum.ess_discharg_power.ToString()), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 24, |
| | | IsBold = true, |
| | | }; |
| | | esRunStatus_DischargeValuesView.AddChidren(esRunStatus_DischargeValuesButton); |
| | | esRunStatus_DischargeValuesButton = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(32), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = function.GetAttrState(InverterJinmao_AttrEnum.ess_discharg_power.ToString()), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 24, |
| | | IsBold = true, |
| | | }; |
| | | esRunStatus_DischargeValuesView.AddChidren(esRunStatus_DischargeValuesButton); |
| | | |
| | | var esRunStatus_DischargeTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(1), |
| | | Y = Application.GetRealWidth(76), |
| | | Height = Application.GetRealWidth(17), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = "实时放电功率(kwh)", |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | | }; |
| | | esRunStatus_DischargeValuesView.AddChidren(esRunStatus_DischargeTextButton); |
| | | #endregion |
| | | var esRunStatus_DischargeTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(1), |
| | | Y = Application.GetRealWidth(76), |
| | | Height = Application.GetRealWidth(17), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = "实时放电功率(kwh)", |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = 12, |
| | | }; |
| | | esRunStatus_DischargeValuesView.AddChidren(esRunStatus_DischargeTextButton); |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info1_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_UintButton); |
| | | |
| | | var socialContribution_Info1_TipButton = new Button() |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info2_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_UintButton); |
| | | |
| | | var socialContribution_Info2_TipButton = new Button() |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info3_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_UintButton); |
| | | |
| | | var socialContribution_Info3_TipButton = new Button() |
| | |
| | | /// 更新界面数据 |
| | | /// </summary> |
| | | /// <param name="temp"></param> |
| | | public void UpdateStatus(Function temp) |
| | | public static void UpdateStatus(Function temp) |
| | | { |
| | | if (bodyView == null) |
| | | { |
| | |
| | | try |
| | | { |
| | | /// 更新今日发电量 |
| | | upatePvGenerateTodayValues(); |
| | | bodyView.upatePvGenerateTodayValues(); |
| | | /// 更新累计发电量 |
| | | upatePvGenerateTotalValues(); |
| | | bodyView.upatePvGenerateTotalValues(); |
| | | /// 更新今日用电量 |
| | | upatePvLoadTodayValues(); |
| | | bodyView.upatePvLoadTodayValues(); |
| | | /// 更新累计用电量 |
| | | upatePvLoadTotalValues(); |
| | | bodyView.upatePvLoadTotalValues(); |
| | | /// 更新光伏运行状态 |
| | | upatePvRunStatus(); |
| | | bodyView.upatePvRunStatus(); |
| | | /// 更新光伏发电功率 |
| | | updatePvPower(); |
| | | bodyView.updatePvPower(); |
| | | /// 更新光伏本月发电量 |
| | | upatePvGenerateMonthValues(); |
| | | bodyView.upatePvGenerateMonthValues(); |
| | | /// 更新光伏用电功率 |
| | | updateLoadElec(); |
| | | bodyView.updateLoadElec(); |
| | | ///更新光伏状态本月用电量 |
| | | updateLoadElecMonthValues(); |
| | | bodyView.updateLoadElecMonthValues(); |
| | | //更新储能运行状态 |
| | | updateEsRunStates(); |
| | | bodyView.updateEsRunStates(); |
| | | //更新储能电池百分比 |
| | | updateEsBatterySoc(); |
| | | bodyView.updateEsBatterySoc(); |
| | | //更新储能实时充电状态 |
| | | updateEsCharge(); |
| | | bodyView.updateEsCharge(); |
| | | //更新储能实时放电状态 |
| | | updateEsDischarge(); |
| | | updateSocialContribution1(); |
| | | updateSocialContribution2(); |
| | | updateSocialContribution3(); |
| | | bodyView.updateEsDischarge(); |
| | | bodyView.updateSocialContribution1(); |
| | | bodyView.updateSocialContribution2(); |
| | | bodyView.updateSocialContribution3(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂光伏更新异常:{ex.Message}"); |
| | | MainPage.Log("Error", $"金茂光伏更新异常:{ex.StackTrace}"); |
| | | } |
| | | }); |
| | | } |
| | |
| | | /// </summary> |
| | | private void upatePvGenerateTotalValues() |
| | | { |
| | | pvGenerate_TodayValuesButton.Text = "累计发电量:" + function.GetAttrState(InverterJinmao_AttrEnum.pv_electricity.ToString()); |
| | | pvGenerate_TotalValuesButton.Text = "累计发电量:" + function.GetAttrState(InverterJinmao_AttrEnum.pv_electricity.ToString()); |
| | | } |
| | | /// <summary> |
| | | /// 更新今日用电量 |
| | | /// </summary> |
| | | private void upatePvLoadTodayValues() |
| | | { |
| | | pvLoad_TodayValuesButton.Text = loadElec_TodayTextButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.load_electricity_today.ToString()); |
| | | pvLoad_TodayValuesButton.Text = powerUsage_TodayValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.load_electricity_today.ToString()); |
| | | } |
| | | /// <summary> |
| | | /// 更新本月用电量 |
| | |
| | | { |
| | | case "run": |
| | | pvRunStatusInfoView.BackgroundColor = 0x154484F4; |
| | | pvRunStatus_IconButtonp.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconRun.png"; |
| | | pvRunStatus_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconRun.png"; |
| | | pvRunStatus_TextButton.Text = "运行"; |
| | | pvRunStatus_TextButton.TextColor = 0xFF4484F4; |
| | | break; |
| | | case "fault": |
| | | pvRunStatusInfoView.BackgroundColor = 0x15FF4747; |
| | | pvRunStatus_IconButtonp.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconFault.png"; |
| | | pvRunStatus_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconFault.png"; |
| | | pvRunStatus_TextButton.Text = "故障"; |
| | | pvRunStatus_TextButton.TextColor = 0xFFFF4747; |
| | | break; |
| | | case "standby": |
| | | pvRunStatusInfoView.BackgroundColor = 0x15798394; |
| | | pvRunStatus_IconButtonp.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconStandby.png"; |
| | | pvRunStatus_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/PvIconStandby.png"; |
| | | pvRunStatus_TextButton.Text = "待机"; |
| | | pvRunStatus_TextButton.TextColor = 0xFF798394; |
| | | break; |
| | |
| | | /// </summary> |
| | | private void updateEsRunStates() |
| | | { |
| | | switch (function.GetAttrState(InverterJinmao_AttrEnum.ess_status.ToString())) |
| | | if (function.attributes.Find((obj) => obj.key == InverterJinmao_AttrEnum.ess_status.ToString()) != null) |
| | | { |
| | | case "charge": |
| | | esStatus_InfoView.BackgroundColor = 0x1500C22D; |
| | | esRunStatus_BatteryValuesButton.TextColor = 0xFF00C22D; |
| | | esRunStatus_Info_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconCharg.png"; |
| | | esRunStatus_Info_TextButton.Text = "充电"; |
| | | esRunStatus_BatteryIconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconCharg.png"; |
| | | esRunStatus_BatteryIconButton.SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconCharg100.png"; |
| | | break; |
| | | case "discharge": |
| | | esStatus_InfoView.BackgroundColor = 0x15FC9C04; |
| | | esRunStatus_BatteryValuesButton.TextColor = 0xFFFC9C04; |
| | | esRunStatus_Info_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconDischarge.png"; |
| | | esRunStatus_Info_TextButton.Text = "放电"; |
| | | esRunStatus_BatteryIconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconDischarg.png"; |
| | | esRunStatus_BatteryIconButton.SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconDischarg100.png"; |
| | | break; |
| | | case "shutdown": |
| | | esStatus_InfoView.BackgroundColor = 0x15798394; |
| | | esRunStatus_BatteryValuesButton.TextColor = 0xFF798394; |
| | | esRunStatus_Info_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconShutdown.png"; |
| | | esRunStatus_Info_TextButton.Text = "停机"; |
| | | esRunStatus_BatteryIconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconShutdown.png"; |
| | | esRunStatus_BatteryIconButton.SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconShutdown100.png"; |
| | | break; |
| | | case "fault": |
| | | esStatus_InfoView.BackgroundColor = 0x15FF4747; |
| | | esRunStatus_BatteryValuesButton.TextColor = 0xFFFF4747; |
| | | esRunStatus_Info_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconFault.png"; |
| | | esRunStatus_Info_TextButton.Text = "故障"; |
| | | esRunStatus_BatteryIconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconFault.png"; |
| | | esRunStatus_BatteryIconButton.SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconFault100.png"; |
| | | break; |
| | | switch (function.GetAttrState(InverterJinmao_AttrEnum.ess_status.ToString())) |
| | | { |
| | | case "charge": |
| | | esStatus_InfoView.BackgroundColor = 0x1500C22D; |
| | | esRunStatus_Info_TextButton.TextColor = esRunStatus_BatteryValuesButton.TextColor = 0xFF00C22D; |
| | | esRunStatus_Info_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconCharg.png"; |
| | | esRunStatus_Info_TextButton.Text = "充电"; |
| | | esRunStatus_BatteryIconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconCharg.png"; |
| | | esRunStatus_BatteryIconButton.SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconCharg100.png"; |
| | | break; |
| | | case "discharge": |
| | | esStatus_InfoView.BackgroundColor = 0x15FC9C04; |
| | | esRunStatus_Info_TextButton.TextColor = esRunStatus_BatteryValuesButton.TextColor = 0xFFFC9C04; |
| | | esRunStatus_Info_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconDischarge.png"; |
| | | esRunStatus_Info_TextButton.Text = "放电"; |
| | | esRunStatus_BatteryIconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconDischarg.png"; |
| | | esRunStatus_BatteryIconButton.SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconDischarg100.png"; |
| | | break; |
| | | case "shutdown": |
| | | esStatus_InfoView.BackgroundColor = 0x15798394; |
| | | esRunStatus_Info_TextButton.TextColor = esRunStatus_BatteryValuesButton.TextColor = 0xFF798394; |
| | | esRunStatus_Info_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconShutdown.png"; |
| | | esRunStatus_Info_TextButton.Text = "停机"; |
| | | esRunStatus_BatteryIconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconShutdown.png"; |
| | | esRunStatus_BatteryIconButton.SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconShutdown100.png"; |
| | | break; |
| | | case "fault": |
| | | esStatus_InfoView.BackgroundColor = 0x15FF4747; |
| | | esRunStatus_Info_TextButton.TextColor = esRunStatus_BatteryValuesButton.TextColor = 0xFFFF4747; |
| | | esRunStatus_Info_IconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/EsIconFault.png"; |
| | | esRunStatus_Info_TextButton.Text = "故障"; |
| | | esRunStatus_BatteryIconButton.UnSelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconFault.png"; |
| | | esRunStatus_BatteryIconButton.SelectedImagePath = "FunctionIcon/Acst/Inverter/BatteryIconFault100.png"; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private void updateEsBatterySoc() |
| | | { |
| | | esRunStatus_BatteryValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.battery_soc.ToString()) + "%"; |
| | | if(esRunStatus_BatteryIconButton.Text == "100%") |
| | | if (function.attributes.Find((obj) => obj.key == InverterJinmao_AttrEnum.ess_status.ToString()) != null) |
| | | { |
| | | esRunStatus_BatteryIconButton.IsSelected = true; |
| | | esRunStatus_BatteryValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.battery_soc.ToString()) + "%"; |
| | | if (esRunStatus_BatteryIconButton.Text == "100%") |
| | | { |
| | | esRunStatus_BatteryIconButton.IsSelected = true; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private void updateEsCharge() |
| | | { |
| | | esRunStatus_ChargeValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.ess_charge_power.ToString()); |
| | | if (function.attributes.Find((obj) => obj.key == InverterJinmao_AttrEnum.ess_status.ToString()) != null) |
| | | { |
| | | esRunStatus_ChargeValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.ess_charge_power.ToString()); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 更新储能实时放电状态 |
| | | /// </summary> |
| | | private void updateEsDischarge() |
| | | { |
| | | esRunStatus_DischargeValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.ess_discharg_power.ToString()); |
| | | if (function.attributes.Find((obj) => obj.key == InverterJinmao_AttrEnum.ess_status.ToString()) != null) |
| | | { |
| | | esRunStatus_DischargeValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.ess_discharg_power.ToString()); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新社会贡献1数据UI |
| | | /// </summary> |
| | | private void updateSocialContribution1() |
| | | { |
| | | socialContribution_Info1_ValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.coal.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info1_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info1_ValuesButton.TextSize = socialContribution_Info1_ValuesButton.TextSize - 4; |
| | | socialContribution_Info1_ValuesButton.TextSize = 14; |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | socialContribution_Info1_UintButton.Height = Application.GetRealWidth(25); |
| | | } |
| | | |
| | | #if __IOS__ |
| | | socialContribution_Info1_ValuesButton.Width += Application.GetRealWidth(6); |
| | | socialContribution_Info1_UintButton.X = socialContribution_Info1_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | socialContribution_Info1_UintButton.X = socialContribution_Info1_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | | } |
| | | /// <summary> |
| | | /// 更新社会贡2献数据UI |
| | | /// </summary> |
| | | private void updateSocialContribution2() |
| | | { |
| | | socialContribution_Info2_ValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.co2.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info2_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString()); |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info2_UintButton.Width > Application.GetRealWidth(61)) |
| | | if (socialContribution_Info2_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info2_UintButton.TextSize = socialContribution_Info2_UintButton.TextSize - 4; |
| | | socialContribution_Info2_ValuesButton.TextSize = 14; |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | } |
| | | |
| | | #if __IOS__ |
| | | socialContribution_Info2_ValuesButton.Width += Application.GetRealWidth(6); |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private void updateSocialContribution3() |
| | | { |
| | | |
| | | socialContribution_Info3_ValuesButton.Text = function.GetAttrState(InverterJinmao_AttrEnum.trees.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info3_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString()); |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info3_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info3_ValuesButton.TextSize = socialContribution_Info3_ValuesButton.TextSize - 4; |
| | | socialContribution_Info3_ValuesButton.TextSize = 14; |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | socialContribution_Info3_UintButton.Height = Application.GetRealWidth(25); |
| | | } |
| | | #if __IOS__ |
| | | socialContribution_Info3_ValuesButton.Width += Application.GetRealWidth(6); |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | | } |
| | | } |
| | | } |
| | |
| | | initContentView(); |
| | | initBottomView(); |
| | | initControlEvent(); |
| | | Control.Ins.SendReadCommand(function); |
| | | |
| | | UpdateStatus(); |
| | | |
| | | Control.Ins.SendReadCommand(function); |
| | | } |
| | | /// <summary> |
| | | /// 加载内容区域 |
| | |
| | | setTempView.AddChidren(setTemp_Temp_MaxValuesTextButton); |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() |
| | | |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.flow.ToString()) != null) |
| | | { |
| | | Height = Application.GetRealWidth(12), |
| | | }); |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(12), |
| | | }); |
| | | |
| | | #region flow 热水流量 |
| | | var flowView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(186), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(flowView); |
| | | #region flow 热水流量 |
| | | var flowView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(186), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(flowView); |
| | | |
| | | flow_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(14), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealWidth(25), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 16, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = "热水流量:" + function.GetAttrState(WaterHeaterJinmao_AttrEnum.flow.ToString()) + "L/min", |
| | | IsBold = true, |
| | | }; |
| | | flowView.AddChidren(flow_ValuesButton); |
| | | flow_ValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(14), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealWidth(25), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 16, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = "热水流量:" + function.GetAttrState(WaterHeaterJinmao_AttrEnum.flow.ToString()) + "L/min", |
| | | IsBold = true, |
| | | }; |
| | | flowView.AddChidren(flow_ValuesButton); |
| | | |
| | | var flow_HotWaterVolumeTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(55), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | Text = "热水量", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | flowView.AddChidren(flow_HotWaterVolumeTextButton); |
| | | var flow_HotWaterVolumeTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(55), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | Text = "热水量", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | flowView.AddChidren(flow_HotWaterVolumeTextButton); |
| | | |
| | | string volumeString = function.GetAttrState(WaterHeaterJinmao_AttrEnum.volume.ToString()); |
| | | string recyclVolumeString = function.GetAttrState(WaterHeaterJinmao_AttrEnum.recycl_volume.ToString()); |
| | | double volume = 0; |
| | | double.TryParse(volumeString, out volume); |
| | | double recyclVolume = 0; |
| | | double.TryParse(recyclVolumeString, out recyclVolume); |
| | | int recyclVolumePercent = (int)(recyclVolume / volume * 100); |
| | | string volumeString = function.GetAttrState(WaterHeaterJinmao_AttrEnum.volume.ToString()); |
| | | string recyclVolumeString = function.GetAttrState(WaterHeaterJinmao_AttrEnum.recycl_volume.ToString()); |
| | | double volume = 0; |
| | | double.TryParse(volumeString, out volume); |
| | | double recyclVolume = 0; |
| | | double.TryParse(recyclVolumeString, out recyclVolume); |
| | | int recyclVolumePercent = (int)(recyclVolume / volume * 100); |
| | | |
| | | |
| | | flow_VolumeButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(55), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(26), |
| | | Text = volumeString + "t", |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | flowView.AddChidren(flow_VolumeButton); |
| | | flow_VolumeButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(55), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(26), |
| | | Text = volumeString + "t", |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | flowView.AddChidren(flow_VolumeButton); |
| | | |
| | | |
| | | flow_ValuesBar = new DiyImageSeekBar() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(79), |
| | | Width = Application.GetRealWidth(Application.DesignWidth - 64), |
| | | Height = Application.GetRealHeight(8), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImageHeight = Application.GetRealHeight(0), |
| | | ProgressBarColor = 0xFF42D163, |
| | | SeekBarBackgroundColor = 0xFFFFB848, |
| | | MaxValue = 100, |
| | | Progress = recyclVolumePercent, |
| | | SeekBarPadding = Application.GetRealWidth(0), |
| | | IsProgressTextShow = false, |
| | | ProgressChangeDelayTime = 0, |
| | | Enable = false, |
| | | IsClickable = false, |
| | | }; |
| | | flowView.AddChidren(flow_ValuesBar); |
| | | flow_ValuesBar = new DiyImageSeekBar() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(79), |
| | | Width = Application.GetRealWidth(Application.DesignWidth - 64), |
| | | Height = Application.GetRealHeight(8), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImageHeight = Application.GetRealHeight(0), |
| | | ProgressBarColor = 0xFF42D163, |
| | | SeekBarBackgroundColor = 0xFFFFB848, |
| | | MaxValue = 100, |
| | | Progress = recyclVolumePercent, |
| | | SeekBarPadding = Application.GetRealWidth(0), |
| | | IsProgressTextShow = false, |
| | | ProgressChangeDelayTime = 0, |
| | | Enable = false, |
| | | IsClickable = false, |
| | | }; |
| | | flowView.AddChidren(flow_ValuesBar); |
| | | |
| | | var flow_HeatRecoveryCapacitytTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(103), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = 0xFF00C22D, |
| | | Text = "热回收量" |
| | | }; |
| | | flowView.AddChidren(flow_HeatRecoveryCapacitytTextButton); |
| | | var flow_HeatRecoveryCapacitytTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(103), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = 0xFF00C22D, |
| | | Text = "热回收量" |
| | | }; |
| | | flowView.AddChidren(flow_HeatRecoveryCapacitytTextButton); |
| | | |
| | | flow_HeatRecoveryProgressButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(125), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = 0xFF00C22D, |
| | | Text = recyclVolumePercent + "%" |
| | | }; |
| | | flowView.AddChidren(flow_HeatRecoveryProgressButton); |
| | | flow_HeatRecoveryProgressButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(125), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = 0xFF00C22D, |
| | | Text = recyclVolumePercent + "%" |
| | | }; |
| | | flowView.AddChidren(flow_HeatRecoveryProgressButton); |
| | | |
| | | flow_HeatRecoverytValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(148), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = recyclVolume + "t" |
| | | }; |
| | | flowView.AddChidren(flow_HeatRecoverytValuesButton); |
| | | flow_HeatRecoverytValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(148), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = recyclVolume + "t" |
| | | }; |
| | | flowView.AddChidren(flow_HeatRecoverytValuesButton); |
| | | |
| | | var flow_ElectricDriveTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(103), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = 14, |
| | | TextColor = 0xFFFC9C04, |
| | | Text = "电直驱量", |
| | | }; |
| | | flowView.AddChidren(flow_ElectricDriveTextButton); |
| | | var flow_ElectricDriveTextButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(103), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = 14, |
| | | TextColor = 0xFFFC9C04, |
| | | Text = "电直驱量", |
| | | }; |
| | | flowView.AddChidren(flow_ElectricDriveTextButton); |
| | | |
| | | flow_ElectricDriveProgressButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(125), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = 14, |
| | | TextColor = 0xFFFC9C04, |
| | | Text = "0%" |
| | | }; |
| | | if(volume > 0) |
| | | { |
| | | flow_ElectricDriveProgressButton.Text = (100 - recyclVolumePercent) + "%"; |
| | | flow_ElectricDriveProgressButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(125), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = 14, |
| | | TextColor = 0xFFFC9C04, |
| | | Text = "0%" |
| | | }; |
| | | if (volume > 0) |
| | | { |
| | | flow_ElectricDriveProgressButton.Text = (100 - recyclVolumePercent) + "%"; |
| | | } |
| | | flowView.AddChidren(flow_ElectricDriveProgressButton); |
| | | |
| | | flow_ElectricDriveValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(148), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = 14, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = (volume - recyclVolume) + "t" |
| | | }; |
| | | flowView.AddChidren(flow_ElectricDriveValuesButton); |
| | | |
| | | #endregion |
| | | } |
| | | flowView.AddChidren(flow_ElectricDriveProgressButton); |
| | | |
| | | flow_ElectricDriveValuesButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 116), |
| | | Y = Application.GetRealWidth(148), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(22), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = 14, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = (volume - recyclVolume) + "t" |
| | | }; |
| | | flowView.AddChidren(flow_ElectricDriveValuesButton); |
| | | |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info2_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_UintButton); |
| | | |
| | | var socialContribution_Info2_TipButton = new Button() |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | }; |
| | | #if __IOS__ |
| | | socialContribution_Info3_UintButton.Y = Application.GetRealWidth(66); |
| | | #endif |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_UintButton); |
| | | |
| | | var socialContribution_Info3_TipButton = new Button() |
| | |
| | | #if __IOS__ |
| | | setTemp_ValuesButton.Width = setTemp_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | setTemp_ValuesButton.Width = setTemp_ValuesButton.GetTextWidth(); |
| | | setTemp_ValuesButton.Width = setTemp_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | setTemp_ValuesButton.Gravity = Gravity.CenterHorizontal; |
| | | |
| | | #if __IOS__ |
| | | setTemp_UintButton.X = setTemp_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | setTemp_UintButton.X = setTemp_ValuesButton.Right + Application.GetRealWidth(4); |
| | | #endif |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var dic = new Dictionary<string, string>(); |
| | |
| | | //免费热水 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | bodyView.updateFreeMode(); |
| | | bodyView.updateTemp(); |
| | | bodyView.updateModeUI(); |
| | | bodyView.updateSetTemp(); |
| | | bodyView.updateFlow(); |
| | | bodyView.updateVolume(); |
| | | bodyView.updateSocialContribution1(); |
| | | bodyView.updateSocialContribution2(); |
| | | bodyView.updateSocialContribution3(); |
| | | bodyView.updatePowerButton(); |
| | | try |
| | | { |
| | | bodyView.updateFreeMode(); |
| | | bodyView.updateTemp(); |
| | | bodyView.updateModeUI(); |
| | | bodyView.updateSetTemp(); |
| | | bodyView.updateFlow(); |
| | | bodyView.updateVolume(); |
| | | bodyView.updateSocialContribution1(); |
| | | bodyView.updateSocialContribution2(); |
| | | bodyView.updateSocialContribution3(); |
| | | bodyView.updatePowerButton(); |
| | | }catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂热水控件更新异常:{ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | btnTempValues.TextSize = 28; |
| | | } |
| | | btnTempValues.Gravity = Gravity.CenterHorizontal; |
| | | |
| | | #if __IOS__ |
| | | btnTempValuesUint.X = btnTempValues.Right - Application.GetRealWidth(4); |
| | | #else |
| | | btnTempValuesUint.X = btnTempValues.Right ; |
| | | #endif |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | #endif |
| | | setTemp_ValuesButton.Gravity = Gravity.CenterHorizontal; |
| | | |
| | | #if __IOS__ |
| | | setTemp_UintButton.X = setTemp_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | setTemp_UintButton.X = setTemp_ValuesButton.Right + Application.GetRealWidth(4); |
| | | |
| | | #endif |
| | | |
| | | double dd = 35; |
| | | double.TryParse(function.GetAttrState(WaterHeaterJinmao_AttrEnum.set_temp.ToString(), "0"), out dd); |
| | |
| | | /// </summary> |
| | | private void updateFlow() |
| | | { |
| | | flow_ValuesButton.Text = "热水流量:" + function.GetAttrState(WaterHeaterJinmao_AttrEnum.flow.ToString()) + "L/min"; |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.flow.ToString()) != null) |
| | | { |
| | | flow_ValuesButton.Text = "热水流量:" + function.GetAttrState(WaterHeaterJinmao_AttrEnum.flow.ToString()) + "L/min"; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private void updateVolume() |
| | | { |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.volume.ToString()) == null) |
| | | { |
| | | return; |
| | | } |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.recycl_volume.ToString()) == null) |
| | | { |
| | | return; |
| | | } |
| | | volumeString = function.GetAttrState(WaterHeaterJinmao_AttrEnum.volume.ToString()); |
| | | recyclVolumeString = function.GetAttrState(WaterHeaterJinmao_AttrEnum.recycl_volume.ToString()); |
| | | volume = 0; |
| | |
| | | private void updateSocialContribution1() |
| | | { |
| | | socialContribution_Info1_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.energy_electricity.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info1_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info1_ValuesButton.TextSize = 14; |
| | | #if __IOS__ |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth(); |
| | | socialContribution_Info1_UintButton.Height = Application.GetRealWidth(25); |
| | | } |
| | | #if __IOS__ |
| | | socialContribution_Info1_UintButton.X = socialContribution_Info1_ValuesButton.Right ; |
| | | socialContribution_Info1_ValuesButton.Width += Application.GetRealWidth(6); |
| | | socialContribution_Info1_UintButton.X = socialContribution_Info1_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | socialContribution_Info1_UintButton.X = socialContribution_Info1_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | |
| | | private void updateSocialContribution2() |
| | | { |
| | | socialContribution_Info2_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.co2.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info2_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info2_ValuesButton.TextSize = 14; |
| | | #if __IOS__ |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | socialContribution_Info2_UintButton.Y = socialContribution_Info2_UintButton.Y - Application.GetRealWidth(4); |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth(); |
| | | } |
| | | #if __IOS__ |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right; |
| | | socialContribution_Info2_ValuesButton.Width += Application.GetRealWidth(6); |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | socialContribution_Info2_UintButton.X = socialContribution_Info2_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | |
| | | /// </summary> |
| | | private void updateSocialContribution3() |
| | | { |
| | | |
| | | socialContribution_Info3_ValuesButton.Text = function.GetAttrState(WaterHeaterJinmao_AttrEnum.trees.ToString()); |
| | | #if __IOS__ |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | if (socialContribution_Info3_ValuesButton.Width > Application.GetRealWidth(61)) |
| | | { |
| | | socialContribution_Info3_ValuesButton.TextSize = 14; |
| | | #if __IOS__ |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | #else |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | #endif |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth(); |
| | | //socialContribution_Info3_UintButton.Height = Application.GetRealWidth(23); |
| | | } |
| | | #if __IOS__ |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right; |
| | | socialContribution_Info3_ValuesButton.Width += Application.GetRealWidth(6); |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right - Application.GetRealWidth(4); |
| | | #else |
| | | socialContribution_Info3_UintButton.X = socialContribution_Info3_ValuesButton.Right +Application.GetRealWidth(2); |
| | | #endif |
| | |
| | | |
| | | infoView1_DateInfo_NextClickButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 18 - 6 -32), |
| | | X = Application.GetRealWidth(343 - 18 - 6 - 32), |
| | | Width = Application.GetRealWidth(32 + 6), |
| | | }; |
| | | infoView1_DateInfoView.AddChidren(infoView1_DateInfo_NextClickButton); |
| | |
| | | Height = Application.GetRealWidth(16) |
| | | }); |
| | | |
| | | #region 用水量 |
| | | |
| | | infoView2 = new FrameLayout() |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.volume.ToString()) != null) |
| | | { |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(382), |
| | | Y = Application.GetRealHeight(16) + infoView1.Bottom, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(infoView2); |
| | | #region 用水量 |
| | | |
| | | #region 时间条件选择 |
| | | var infoView2_DateView = new HorizontalScrolViewLayout() |
| | | { |
| | | Width = Application.GetRealWidth(343 - 34), |
| | | Height = Application.GetRealWidth(26), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(17), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(13), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | ScrollEnabled = false, |
| | | }; |
| | | infoView2.AddChidren(infoView2_DateView); |
| | | infoView2 = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(382), |
| | | Y = Application.GetRealHeight(16) + infoView1.Bottom, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(infoView2); |
| | | |
| | | infoView2_Date_Day = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(103), |
| | | Height = Application.GetRealWidth(26), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | SelectedBackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(13), |
| | | BorderColor = CSS_Color.BackgroundColor, |
| | | BorderWidth = (uint)Application.GetRealWidth(1), |
| | | Text = "日", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsSelected = true, |
| | | }; |
| | | infoView2_DateView.AddChidren(infoView2_Date_Day); |
| | | #region 时间条件选择 |
| | | var infoView2_DateView = new HorizontalScrolViewLayout() |
| | | { |
| | | Width = Application.GetRealWidth(343 - 34), |
| | | Height = Application.GetRealWidth(26), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(17), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(13), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | ScrollEnabled = false, |
| | | }; |
| | | infoView2.AddChidren(infoView2_DateView); |
| | | |
| | | infoView2_Date_Day = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(103), |
| | | Height = Application.GetRealWidth(26), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | SelectedBackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(13), |
| | | BorderColor = CSS_Color.BackgroundColor, |
| | | BorderWidth = (uint)Application.GetRealWidth(1), |
| | | Text = "日", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsSelected = true, |
| | | }; |
| | | infoView2_DateView.AddChidren(infoView2_Date_Day); |
| | | |
| | | |
| | | infoView2_Date_Month = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(103), |
| | | Height = Application.GetRealWidth(26), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | SelectedBackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(13), |
| | | BorderColor = CSS_Color.BackgroundColor, |
| | | BorderWidth = (uint)Application.GetRealWidth(1), |
| | | Text = "月", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsSelected = false, |
| | | }; |
| | | infoView2_DateView.AddChidren(infoView2_Date_Month); |
| | | infoView2_Date_Month = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(103), |
| | | Height = Application.GetRealWidth(26), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | SelectedBackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(13), |
| | | BorderColor = CSS_Color.BackgroundColor, |
| | | BorderWidth = (uint)Application.GetRealWidth(1), |
| | | Text = "月", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsSelected = false, |
| | | }; |
| | | infoView2_DateView.AddChidren(infoView2_Date_Month); |
| | | |
| | | |
| | | infoView2_Date_Year = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(103), |
| | | Height = Application.GetRealWidth(26), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | SelectedBackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(13), |
| | | BorderColor = CSS_Color.BackgroundColor, |
| | | BorderWidth = (uint)Application.GetRealWidth(1), |
| | | Text = "年", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsSelected = false, |
| | | }; |
| | | infoView2_DateView.AddChidren(infoView2_Date_Year); |
| | | infoView2_Date_Year = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(103), |
| | | Height = Application.GetRealWidth(26), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | SelectedBackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(13), |
| | | BorderColor = CSS_Color.BackgroundColor, |
| | | BorderWidth = (uint)Application.GetRealWidth(1), |
| | | Text = "年", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsSelected = false, |
| | | }; |
| | | infoView2_DateView.AddChidren(infoView2_Date_Year); |
| | | |
| | | var infoView2_DateInfoView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealWidth(43), |
| | | Height = Application.GetRealWidth(55), |
| | | }; |
| | | infoView2.AddChidren(infoView2_DateInfoView); |
| | | var infoView2_DateInfoView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealWidth(43), |
| | | Height = Application.GetRealWidth(55), |
| | | }; |
| | | infoView2.AddChidren(infoView2_DateInfoView); |
| | | |
| | | infoView2_DateInfo_PreIconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(18), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(6), |
| | | Height = Application.GetRealWidth(10), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/WaterHeater/PreIcon.png", |
| | | }; |
| | | infoView2_DateInfoView.AddChidren(infoView2_DateInfo_PreIconButton); |
| | | infoView2_DateInfo_PreIconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(18), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(6), |
| | | Height = Application.GetRealWidth(10), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/WaterHeater/PreIcon.png", |
| | | }; |
| | | infoView2_DateInfoView.AddChidren(infoView2_DateInfo_PreIconButton); |
| | | |
| | | infoView2_DateInfo_PreClickButton = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(32 + 6), |
| | | }; |
| | | infoView2_DateInfoView.AddChidren(infoView2_DateInfo_PreClickButton); |
| | | infoView2_DateInfo_PreClickButton = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(32 + 6), |
| | | }; |
| | | infoView2_DateInfoView.AddChidren(infoView2_DateInfo_PreClickButton); |
| | | |
| | | infoView2_DateInfo_DateTextButton = new Button() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(200), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = DateTime.Now.ToString("yyyy-MM-dd"), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true, |
| | | TextSize = 16, |
| | | }; |
| | | infoView2_DateInfoView.AddChidren(infoView2_DateInfo_DateTextButton); |
| | | infoView2_DateInfo_DateTextButton = new Button() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(200), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = DateTime.Now.ToString("yyyy-MM-dd"), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true, |
| | | TextSize = 16, |
| | | }; |
| | | infoView2_DateInfoView.AddChidren(infoView2_DateInfo_DateTextButton); |
| | | |
| | | infoView2_DateInfo_NextIconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 18 - 6), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(6), |
| | | Height = Application.GetRealWidth(10), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/WaterHeater/NextIcon.png", |
| | | }; |
| | | infoView2_DateInfoView.AddChidren(infoView2_DateInfo_NextIconButton); |
| | | infoView2_DateInfo_NextIconButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 18 - 6), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(6), |
| | | Height = Application.GetRealWidth(10), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/WaterHeater/NextIcon.png", |
| | | }; |
| | | infoView2_DateInfoView.AddChidren(infoView2_DateInfo_NextIconButton); |
| | | |
| | | infoView2_DateInfo_NextClickButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 18 - 6 -32), |
| | | Width = Application.GetRealWidth(32 + 6), |
| | | }; |
| | | infoView2_DateInfoView.AddChidren(infoView2_DateInfo_NextClickButton); |
| | | infoView2_DateInfo_NextClickButton = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343 - 18 - 6 - 32), |
| | | Width = Application.GetRealWidth(32 + 6), |
| | | }; |
| | | infoView2_DateInfoView.AddChidren(infoView2_DateInfo_NextClickButton); |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 数据图表 |
| | | infoView2_EchartsView = new MyEchartsViewOn() |
| | | { |
| | | Y = Application.GetRealWidth(101), |
| | | Height = Application.GetRealWidth(246), |
| | | }; |
| | | infoView2.AddChidren(infoView2_EchartsView); |
| | | #region 数据图表 |
| | | infoView2_EchartsView = new MyEchartsViewOn() |
| | | { |
| | | Y = Application.GetRealWidth(101), |
| | | Height = Application.GetRealWidth(246), |
| | | }; |
| | | infoView2.AddChidren(infoView2_EchartsView); |
| | | |
| | | echartOption2 = new EchartsOption_Histogram(); |
| | | echartOption2.xTitle = "时间"; |
| | | echartOption2.yTitle = "用水量(t)"; |
| | | //echartOption2.InitXdataText(new List<string>() |
| | | //{ |
| | | // "21","22","23","24","25","26","26","27","28","29", |
| | | // "21","22","23","24","25","26","26","27","28","29", |
| | | // "21","22","23","24" |
| | | //}); |
| | | //echartOption2.InitYdataText(new List<EnvironmentalSensorHistor>() { |
| | | // new EnvironmentalSensorHistor{ fieldName = "1", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "2", fieldValue= "22" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "3", fieldValue= "11" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "4", fieldValue= "21" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "5", fieldValue= "41" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "6", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "7", fieldValue= "31" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "8", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "9", fieldValue= "11" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "10", fieldValue= "21" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "11", fieldValue= "24" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "12", fieldValue= "41" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "13", fieldValue= "32" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "14", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "15", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "16", fieldValue= "22" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "17", fieldValue= "11" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "18", fieldValue= "21" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "19", fieldValue= "41" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "20", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "21", fieldValue= "31" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "22", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "23", fieldValue= "11" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "24", fieldValue= "21" }, |
| | | //}); |
| | | //infoView2_EchartsView.ShowWithOption(echartOption2.InitOption()); |
| | | echartOption2 = new EchartsOption_Histogram(); |
| | | echartOption2.xTitle = "时间"; |
| | | echartOption2.yTitle = "用水量(t)"; |
| | | //echartOption2.InitXdataText(new List<string>() |
| | | //{ |
| | | // "21","22","23","24","25","26","26","27","28","29", |
| | | // "21","22","23","24","25","26","26","27","28","29", |
| | | // "21","22","23","24" |
| | | //}); |
| | | //echartOption2.InitYdataText(new List<EnvironmentalSensorHistor>() { |
| | | // new EnvironmentalSensorHistor{ fieldName = "1", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "2", fieldValue= "22" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "3", fieldValue= "11" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "4", fieldValue= "21" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "5", fieldValue= "41" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "6", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "7", fieldValue= "31" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "8", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "9", fieldValue= "11" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "10", fieldValue= "21" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "11", fieldValue= "24" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "12", fieldValue= "41" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "13", fieldValue= "32" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "14", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "15", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "16", fieldValue= "22" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "17", fieldValue= "11" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "18", fieldValue= "21" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "19", fieldValue= "41" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "20", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "21", fieldValue= "31" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "22", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "23", fieldValue= "11" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "24", fieldValue= "21" }, |
| | | //}); |
| | | //infoView2_EchartsView.ShowWithOption(echartOption2.InitOption()); |
| | | |
| | | infoView2.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(35), |
| | | Y = Application.GetRealWidth(340), |
| | | Text = "用水量", |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = 0xFFC0C7D4 |
| | | }); |
| | | infoView2.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealWidth(35), |
| | | Y = Application.GetRealWidth(340), |
| | | Text = "用水量", |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = 0xFFC0C7D4 |
| | | }); |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | |
| | | tempQueryTimeString = tempQueryTime_Year.ToString() + "/" + tempQueryTime_Month + "/" + tempQueryTime_Day; |
| | | break; |
| | | case QueryType.custom_month: |
| | | tempQueryTimeString = tempQueryTime_Year.ToString() + "/" + tempQueryTime_Month ; |
| | | tempQueryTimeString = tempQueryTime_Year.ToString() + "/" + tempQueryTime_Month; |
| | | break; |
| | | case QueryType.custom_year: |
| | | tempQueryTimeString = tempQueryTime_Year.ToString(); |
| | | break; |
| | | } |
| | | |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(tempQueryType.ToString(), function.deviceId, WaterHeaterJinmao_AttrEnum.temp.ToString(),tempQueryTimeString); |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(tempQueryType.ToString(), function.deviceId, WaterHeaterJinmao_AttrEnum.temp.ToString(), tempQueryTimeString); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | |
| | | { |
| | | return; |
| | | } |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.volume.ToString()) == null) |
| | | { |
| | | return; |
| | | } |
| | | var loadPage = new Loading() |
| | | { |
| | | LodingBackgroundColor = 0x88888888, |
| | |
| | | break; |
| | | } |
| | | |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(waterQueryType.ToString(), function.deviceId, WaterHeaterJinmao_AttrEnum.volume.ToString(),waterQueryTimeString); |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(waterQueryType.ToString(), function.deviceId, WaterHeaterJinmao_AttrEnum.volume.ToString(), waterQueryTimeString); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | |
| | | { |
| | | SetTempQureyDateDialog(); |
| | | }; |
| | | infoView1_DateInfo_PreClickButton.MouseUpEventHandler = (sender, e) => { |
| | | var tempQueryDate = new DateTime(tempQueryTime_Year,tempQueryTime_Month,tempQueryTime_Day); |
| | | infoView1_DateInfo_PreClickButton.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var tempQueryDate = new DateTime(tempQueryTime_Year, tempQueryTime_Month, tempQueryTime_Day); |
| | | if (tempQueryType == QueryType.day_hour) |
| | | { |
| | | if(tempQueryDate.Year == 2023 && tempQueryDate.Month == 1 && tempQueryDate.Day == 1) |
| | | if (tempQueryDate.Year == 2023 && tempQueryDate.Month == 1 && tempQueryDate.Day == 1) |
| | | { |
| | | return; |
| | | } |
| | | tempQueryDate = tempQueryDate.AddDays(-1); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM-dd"); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM-dd"); |
| | | } |
| | | else if(tempQueryType == QueryType.custom_month) |
| | | else if (tempQueryType == QueryType.custom_month) |
| | | { |
| | | if (tempQueryDate.Year == 2023 && tempQueryDate.Month == 1) |
| | | { |
| | | return; |
| | | } |
| | | tempQueryDate = tempQueryDate.AddMonths(-1); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM"); |
| | | tempQueryTime_Day = tempQueryDate.Day; |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM"); |
| | | } |
| | | else if(tempQueryType == QueryType.custom_year) |
| | | else if (tempQueryType == QueryType.custom_year) |
| | | { |
| | | if (tempQueryDate.Year == 2023) |
| | | if (tempQueryDate.Year <= 2023) |
| | | { |
| | | return; |
| | | } |
| | | tempQueryDate = tempQueryDate.AddYears(-1); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy"); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy"); |
| | | } |
| | | tempQueryTime_Year = tempQueryDate.Year; |
| | | tempQueryTime_Month = tempQueryDate.Month; |
| | | tempQueryTime_Day = tempQueryDate.Day; |
| | | getTempHistory(); |
| | | }; |
| | | infoView1_DateInfo_NextClickButton.MouseUpEventHandler = (sender, e) => { |
| | | infoView1_DateInfo_NextClickButton.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var tempQueryDate = new DateTime(tempQueryTime_Year, tempQueryTime_Month, tempQueryTime_Day); |
| | | if (tempQueryType == QueryType.day_hour) |
| | | { |
| | | if (tempQueryDate.Year == DateTime.Now.Year && tempQueryDate.Month == DateTime.Now.Month && tempQueryDate.Day == DateTime.Now.Day) |
| | | if (tempQueryDate.Year >= DateTime.Now.Year && tempQueryDate.Month >= DateTime.Now.Month && tempQueryDate.Day >= DateTime.Now.Day) |
| | | { |
| | | return; |
| | | } |
| | | tempQueryDate = tempQueryDate.AddDays(1); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM-dd"); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM-dd"); |
| | | } |
| | | else if (tempQueryType == QueryType.custom_month) |
| | | { |
| | | if (tempQueryDate.Year == DateTime.Now.Year && tempQueryDate.Month == DateTime.Now.Month ) |
| | | if (tempQueryDate.Year >= DateTime.Now.Year && tempQueryDate.Month >= DateTime.Now.Month) |
| | | { |
| | | return; |
| | | } |
| | | tempQueryDate = tempQueryDate.AddMonths(1); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM"); |
| | | tempQueryTime_Day = tempQueryDate.Day; |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM"); |
| | | } |
| | | else if (tempQueryType == QueryType.custom_year) |
| | | { |
| | | if (tempQueryDate.Year == DateTime.Now.Year) |
| | | if (tempQueryDate.Year >= DateTime.Now.Year) |
| | | { |
| | | return; |
| | | } |
| | | tempQueryDate = tempQueryDate.AddYears(1); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy"); |
| | | infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy"); |
| | | } |
| | | tempQueryTime_Year = tempQueryDate.Year; |
| | | tempQueryTime_Month = tempQueryDate.Month; |
| | |
| | | getTempHistory(); |
| | | }; |
| | | |
| | | infoView1_Date_Day.MouseUpEventHandler = (sender, e) => { |
| | | infoView1_Date_Day.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (infoView1_Date_Day.IsSelected) |
| | | { |
| | | return; |
| | |
| | | infoView1_Date_Month.IsSelected = false; |
| | | infoView1_Date_Year.IsSelected = false; |
| | | tempQueryType = QueryType.day_hour; |
| | | if (DateTime.Now.Date < new DateTime(tempQueryTime_Year, tempQueryTime_Month, tempQueryTime_Day)) |
| | | { |
| | | tempQueryTime_Year = DateTime.Now.Year; |
| | | tempQueryTime_Month = DateTime.Now.Month; |
| | | tempQueryTime_Day = DateTime.Now.Day; |
| | | } |
| | | infoView1_DateInfo_DateTextButton.Text = new DateTime(tempQueryTime_Year, tempQueryTime_Month, tempQueryTime_Day).ToString("yyyy-MM-dd"); |
| | | getTempHistory(); |
| | | }; |
| | | infoView1_Date_Month.MouseUpEventHandler = (sender, e) => { |
| | | infoView1_Date_Month.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (infoView1_Date_Month.IsSelected) |
| | | { |
| | | return; |
| | |
| | | infoView1_Date_Month.IsSelected = true; |
| | | infoView1_Date_Year.IsSelected = false; |
| | | tempQueryType = QueryType.custom_month; |
| | | if (DateTime.Now.Date < new DateTime(tempQueryTime_Year, tempQueryTime_Month, tempQueryTime_Day)) |
| | | { |
| | | tempQueryTime_Year = DateTime.Now.Year; |
| | | tempQueryTime_Month = DateTime.Now.Month; |
| | | } |
| | | infoView1_DateInfo_DateTextButton.Text = new DateTime(tempQueryTime_Year, tempQueryTime_Month, tempQueryTime_Day).ToString("yyyy-MM"); |
| | | getTempHistory(); |
| | | }; |
| | | infoView1_Date_Year.MouseUpEventHandler = (sender, e) => { |
| | | infoView1_Date_Year.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (infoView1_Date_Year.IsSelected) |
| | | { |
| | | return; |
| | |
| | | getTempHistory(); |
| | | }; |
| | | //-----------用水 |
| | | infoView2_DateInfo_DateTextButton.MouseUpEventHandler = (sender, e) => |
| | | if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.volume.ToString()) != null) |
| | | { |
| | | SetWaterQureyDateDialog(); |
| | | }; |
| | | infoView2_DateInfo_PreClickButton.MouseUpEventHandler = (sender, e) => { |
| | | var waterQueryDate = new DateTime(waterQueryTime_Year, waterQueryTime_Month, waterQueryTime_Day); |
| | | if (waterQueryType == QueryType.day_hour) |
| | | { |
| | | if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1 && waterQueryDate.Day == 1) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddDays(-1); |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM-dd"); |
| | | } |
| | | else if (waterQueryType == QueryType.custom_month) |
| | | { |
| | | if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddMonths(-1); |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM"); |
| | | } |
| | | else if (waterQueryType == QueryType.custom_year) |
| | | { |
| | | if (waterQueryDate.Year == 2023) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddYears(-1); |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy"); |
| | | } |
| | | waterQueryTime_Year = waterQueryDate.Year; |
| | | waterQueryTime_Month = waterQueryDate.Month; |
| | | waterQueryTime_Day = waterQueryDate.Day; |
| | | getWaterHistory(); |
| | | }; |
| | | infoView2_DateInfo_NextClickButton.MouseUpEventHandler = (sender, e) => { |
| | | var waterQueryDate = new DateTime(waterQueryTime_Year, waterQueryTime_Month, waterQueryTime_Day); |
| | | if (waterQueryType == QueryType.day_hour) |
| | | { |
| | | if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1 && waterQueryDate.Day == 2) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddDays(1); |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM-dd"); |
| | | } |
| | | else if (waterQueryType == QueryType.custom_month) |
| | | { |
| | | if (waterQueryDate.Year == DateTime.Now.Year && waterQueryDate.Month == DateTime.Now.Month) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddMonths(1); |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM"); |
| | | } |
| | | else if (waterQueryType == QueryType.custom_year) |
| | | { |
| | | if (waterQueryDate.Year == 2023) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddYears(1); |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy"); |
| | | } |
| | | waterQueryTime_Year = waterQueryDate.Year; |
| | | waterQueryTime_Month = waterQueryDate.Month; |
| | | waterQueryTime_Day = waterQueryDate.Day; |
| | | getWaterHistory(); |
| | | }; |
| | | infoView2_Date_Day.MouseDownEventHandler = (sender, e) => { |
| | | if (infoView2_Date_Day.IsSelected) |
| | | { |
| | | return; |
| | | } |
| | | infoView2_Date_Day.IsSelected = true; |
| | | infoView2_Date_Month.IsSelected = false; |
| | | infoView2_Date_Year.IsSelected = false; |
| | | waterQueryType = QueryType.day_hour; |
| | | infoView2_DateInfo_DateTextButton.Text = new DateTime(waterQueryTime_Year, waterQueryTime_Month, waterQueryTime_Day).ToString("yyyy-MM-dd"); |
| | | getWaterHistory(); |
| | | }; |
| | | infoView2_Date_Month.MouseDownEventHandler = (sender, e) => { |
| | | if (infoView2_Date_Month.IsSelected) |
| | | { |
| | | return; |
| | | } |
| | | infoView2_Date_Day.IsSelected = false; |
| | | infoView2_Date_Month.IsSelected = true; |
| | | infoView2_Date_Year.IsSelected = false; |
| | | waterQueryType = QueryType.custom_month; |
| | | infoView2_DateInfo_DateTextButton.Text = new DateTime(waterQueryTime_Year, waterQueryTime_Month, waterQueryTime_Day).ToString("yyyy-MM"); |
| | | getWaterHistory(); |
| | | }; |
| | | infoView2_Date_Year.MouseDownEventHandler = (sender, e) => { |
| | | if (infoView2_Date_Year.IsSelected) |
| | | { |
| | | return; |
| | | } |
| | | infoView2_Date_Day.IsSelected = false; |
| | | infoView2_Date_Month.IsSelected = false; |
| | | infoView2_Date_Year.IsSelected = true; |
| | | waterQueryType = QueryType.custom_year; |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryTime_Year.ToString(); |
| | | getWaterHistory(); |
| | | }; |
| | | |
| | | infoView2_DateInfo_DateTextButton.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | SetWaterQureyDateDialog(); |
| | | }; |
| | | infoView2_DateInfo_PreClickButton.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var waterQueryDate = new DateTime(waterQueryTime_Year, waterQueryTime_Month, waterQueryTime_Day); |
| | | if (waterQueryType == QueryType.day_hour) |
| | | { |
| | | if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1 && waterQueryDate.Day == 1) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddDays(-1); |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM-dd"); |
| | | } |
| | | else if (waterQueryType == QueryType.custom_month) |
| | | { |
| | | if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddMonths(-1); |
| | | waterQueryTime_Day = waterQueryDate.Day; |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM"); |
| | | } |
| | | else if (waterQueryType == QueryType.custom_year) |
| | | { |
| | | if (waterQueryDate.Year <= 2023) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddYears(-1); |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy"); |
| | | } |
| | | waterQueryTime_Year = waterQueryDate.Year; |
| | | waterQueryTime_Month = waterQueryDate.Month; |
| | | waterQueryTime_Day = waterQueryDate.Day; |
| | | getWaterHistory(); |
| | | }; |
| | | infoView2_DateInfo_NextClickButton.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var waterQueryDate = new DateTime(waterQueryTime_Year, waterQueryTime_Month, waterQueryTime_Day); |
| | | if (waterQueryType == QueryType.day_hour) |
| | | { |
| | | if (waterQueryDate.Year >= DateTime.Now.Year && waterQueryDate.Month >= DateTime.Now.Month && waterQueryDate.Day >= DateTime.Now.Day) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddDays(1); |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM-dd"); |
| | | } |
| | | else if (waterQueryType == QueryType.custom_month) |
| | | { |
| | | if (waterQueryDate.Year == DateTime.Now.Year && waterQueryDate.Month == DateTime.Now.Month) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddMonths(1); |
| | | waterQueryTime_Day = waterQueryDate.Day; |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM"); |
| | | } |
| | | else if (waterQueryType == QueryType.custom_year) |
| | | { |
| | | if (waterQueryDate.Year >= DateTime.Now.Year) |
| | | { |
| | | return; |
| | | } |
| | | waterQueryDate = waterQueryDate.AddYears(1); |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy"); |
| | | } |
| | | waterQueryTime_Year = waterQueryDate.Year; |
| | | waterQueryTime_Month = waterQueryDate.Month; |
| | | waterQueryTime_Day = waterQueryDate.Day; |
| | | getWaterHistory(); |
| | | }; |
| | | infoView2_Date_Day.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | if (infoView2_Date_Day.IsSelected) |
| | | { |
| | | return; |
| | | } |
| | | infoView2_Date_Day.IsSelected = true; |
| | | infoView2_Date_Month.IsSelected = false; |
| | | infoView2_Date_Year.IsSelected = false; |
| | | waterQueryType = QueryType.day_hour; |
| | | if (DateTime.Now.Date < new DateTime(waterQueryTime_Year, waterQueryTime_Month, waterQueryTime_Day)) |
| | | { |
| | | waterQueryTime_Year = DateTime.Now.Year; |
| | | waterQueryTime_Month = DateTime.Now.Month; |
| | | waterQueryTime_Day = DateTime.Now.Day; |
| | | } |
| | | infoView2_DateInfo_DateTextButton.Text = new DateTime(waterQueryTime_Year, waterQueryTime_Month, waterQueryTime_Day).ToString("yyyy-MM-dd"); |
| | | getWaterHistory(); |
| | | }; |
| | | infoView2_Date_Month.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | if (infoView2_Date_Month.IsSelected) |
| | | { |
| | | return; |
| | | } |
| | | infoView2_Date_Day.IsSelected = false; |
| | | infoView2_Date_Month.IsSelected = true; |
| | | infoView2_Date_Year.IsSelected = false; |
| | | waterQueryType = QueryType.custom_month; |
| | | if (DateTime.Now.Date < new DateTime(waterQueryTime_Year, waterQueryTime_Month, waterQueryTime_Day)) |
| | | { |
| | | waterQueryTime_Year = DateTime.Now.Year; |
| | | waterQueryTime_Month = DateTime.Now.Month; |
| | | } |
| | | infoView2_DateInfo_DateTextButton.Text = new DateTime(waterQueryTime_Year, waterQueryTime_Month, waterQueryTime_Day).ToString("yyyy-MM"); |
| | | getWaterHistory(); |
| | | }; |
| | | infoView2_Date_Year.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | if (infoView2_Date_Year.IsSelected) |
| | | { |
| | | return; |
| | | } |
| | | infoView2_Date_Day.IsSelected = false; |
| | | infoView2_Date_Month.IsSelected = false; |
| | | infoView2_Date_Year.IsSelected = true; |
| | | waterQueryType = QueryType.custom_year; |
| | | infoView2_DateInfo_DateTextButton.Text = waterQueryTime_Year.ToString(); |
| | | getWaterHistory(); |
| | | }; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | pickerItems_Year.Add((2023 + pickerItems_Year.Count).ToString()); |
| | | } |
| | | |
| | | if(tempQueryType == QueryType.custom_month || tempQueryType == QueryType.day_hour) |
| | | if (tempQueryType == QueryType.custom_month || tempQueryType == QueryType.day_hour) |
| | | { |
| | | pickerItems_Month = new List<string>(); |
| | | if (tempQueryTime_Year == DateTime.Now.Year) |
| | |
| | | }; |
| | | topView.AddChidren(btnConfrim); |
| | | |
| | | var btnToday = new Button() |
| | | { |
| | | X = Application.GetRealWidth(160 - 32) - btnConfrim.GetTextWidth(), |
| | | Width = Application.GetRealWidth(160), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Visible = false, |
| | | Enable = false, |
| | | Text= "今日", |
| | | }; |
| | | topView.AddChidren(btnToday); |
| | | |
| | | UIPickerView uIPickerView = new UIPickerView() |
| | | { |
| | | Y = Application.GetRealHeight(40), |
| | |
| | | optionBaseView.AddChidren(uIPickerView); |
| | | uIPickerView.setNPicker(pickerItems_Year, pickerItems_Month, pickerItems_Day); |
| | | uIPickerView.setCurrentItems(pickerItems_Year.IndexOf(tempQueryTime_Year.ToString()), |
| | | pickerItems_Month == null ? 0: pickerItems_Month.IndexOf(tempQueryTime_Month.ToString()), |
| | | pickerItems_Day == null? 0: pickerItems_Day.IndexOf(tempQueryTime_Day.ToString())); |
| | | pickerItems_Month == null ? 0 : pickerItems_Month.IndexOf(tempQueryTime_Month.ToString()), |
| | | pickerItems_Day == null ? 0 : pickerItems_Day.IndexOf(tempQueryTime_Day.ToString())); |
| | | |
| | | dialog.Show(); |
| | | |
| | |
| | | }; |
| | | uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => |
| | | { |
| | | if (int1 < 0) |
| | | { |
| | | int1 = 1; |
| | | } |
| | | if (pickerItems_Year[int1] != item1.ToString()) |
| | | { |
| | | int.TryParse(pickerItems_Year[int1], out item1); |
| | |
| | | } |
| | | if (pickerItems_Month != null) |
| | | { |
| | | if (int2 > pickerItems_Month.Count) |
| | | if (int2 >= pickerItems_Month.Count || int2 < 0) |
| | | { |
| | | int2 = 0; |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | uIPickerView.setNPicker(pickerItems_Year, pickerItems_Month, pickerItems_Day); |
| | | uIPickerView.setCurrentItems(pickerItems_Year.IndexOf(item1.ToString()), |
| | | pickerItems_Month == null ? 0 : pickerItems_Month.IndexOf(item2.ToString()), |
| | | pickerItems_Day == null ? 0 : pickerItems_Day.IndexOf(item3.ToString())); |
| | | try |
| | | { |
| | | uIPickerView.setNPicker(pickerItems_Year, pickerItems_Month, pickerItems_Day); |
| | | uIPickerView.setCurrentItems(pickerItems_Year.IndexOf(item1.ToString()), |
| | | pickerItems_Month == null ? 0 : pickerItems_Month.IndexOf(item2.ToString()), |
| | | pickerItems_Day == null ? 0 : pickerItems_Day.IndexOf(item3.ToString())); |
| | | }catch(Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂历史数据控件异常:{ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | if (pickerItems_Day != null) |
| | | { |
| | | if (int3 >= pickerItems_Day.Count) |
| | | if (int3 >= pickerItems_Day.Count || int3 < 0) |
| | | { |
| | | int3 = 0; |
| | | } |
| | |
| | | { |
| | | tempQueryTime_Month = item2; |
| | | } |
| | | infoView1_DateInfo_DateTextButton.Text = new DateTime(tempQueryTime_Year, tempQueryTime_Month, tempQueryTime_Day).ToString("yyyy-MM"); |
| | | infoView1_DateInfo_DateTextButton.Text = new DateTime(tempQueryTime_Year, tempQueryTime_Month, 1).ToString("yyyy-MM"); |
| | | if (tempQueryType == QueryType.day_hour) |
| | | { |
| | | if (item3 != tempQueryTime_Day) |
| | |
| | | getTempHistory(); |
| | | }; |
| | | |
| | | |
| | | if (tempQueryType == QueryType.day_hour) |
| | | { |
| | | try |
| | | { |
| | | btnToday.Visible = btnToday.Enable = true; |
| | | btnToday.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pickerItems_Year = new List<string>(); |
| | | pickerItems_Year.Add("2023"); |
| | | while (DateTime.Now.Year > 2022 + pickerItems_Year.Count) |
| | | { |
| | | pickerItems_Year.Add((2023 + pickerItems_Year.Count).ToString()); |
| | | } |
| | | |
| | | if (tempQueryType == QueryType.custom_month || tempQueryType == QueryType.day_hour) |
| | | { |
| | | pickerItems_Month = new List<string>(); |
| | | if (tempQueryTime_Year == DateTime.Now.Year) |
| | | { |
| | | int addMonth = 0; |
| | | while (DateTime.Now.Month > addMonth) |
| | | { |
| | | addMonth++; |
| | | pickerItems_Month.Add(addMonth.ToString()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (var i = 1; i < 13; i++) |
| | | { |
| | | pickerItems_Month.Add(i.ToString()); |
| | | } |
| | | } |
| | | if (tempQueryType == QueryType.day_hour) |
| | | { |
| | | pickerItems_Day = new List<string>(); |
| | | if (tempQueryTime_Month == DateTime.Now.Month) |
| | | { |
| | | int addDay = 0; |
| | | while (DateTime.Now.Day > addDay) |
| | | { |
| | | addDay++; |
| | | pickerItems_Day.Add(addDay.ToString()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (var i = 1; i <= DateTime.DaysInMonth(tempQueryTime_Year, tempQueryTime_Month); i++) |
| | | { |
| | | pickerItems_Day.Add(i.ToString()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | item3 = tempQueryTime_Day = DateTime.Now.Day; |
| | | item2 = tempQueryTime_Month = DateTime.Now.Month; |
| | | item1 = tempQueryTime_Year = DateTime.Now.Year; |
| | | uIPickerView.setNPicker(pickerItems_Year, pickerItems_Month, pickerItems_Day); |
| | | uIPickerView.setCurrentItems(pickerItems_Year.IndexOf(tempQueryTime_Year.ToString()), |
| | | pickerItems_Month == null ? 0 : pickerItems_Month.IndexOf(tempQueryTime_Month.ToString()), |
| | | pickerItems_Day == null ? 0 : pickerItems_Day.IndexOf(tempQueryTime_Day.ToString())); |
| | | }; |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | |
| | | public void SetWaterQureyDateDialog() |
| | |
| | | }; |
| | | uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => |
| | | { |
| | | if (int1 < 0) |
| | | { |
| | | int1 = 0; |
| | | } |
| | | if (pickerItems_Year[int1] != item1.ToString()) |
| | | { |
| | | int.TryParse(pickerItems_Year[int1], out item1); |
| | |
| | | } |
| | | if (pickerItems_Month != null) |
| | | { |
| | | if (int2 > pickerItems_Month.Count) |
| | | if (int2 > pickerItems_Month.Count || int2 < 0) |
| | | { |
| | | int2 = 0; |
| | | } |
| | |
| | | } |
| | | if (pickerItems_Day != null) |
| | | { |
| | | if (int3 >= pickerItems_Day.Count) |
| | | if (int3 >= pickerItems_Day.Count || int3 < 0) |
| | | { |
| | | int3 = 0; |
| | | } |
| | |
| | | { |
| | | waterQueryTime_Month = item2; |
| | | } |
| | | infoView2_DateInfo_DateTextButton.Text = new DateTime(waterQueryTime_Year, waterQueryTime_Month, waterQueryTime_Day).ToString("yyyy-MM"); |
| | | infoView2_DateInfo_DateTextButton.Text = new DateTime(waterQueryTime_Year, waterQueryTime_Month, 1).ToString("yyyy-MM"); |
| | | if (waterQueryType == QueryType.day_hour) |
| | | { |
| | | if (item3 != waterQueryTime_Day) |
| | |
| | | } |
| | | getWaterHistory(); |
| | | }; |
| | | |
| | | var btnToday = new Button() |
| | | { |
| | | X = Application.GetRealWidth(160 - 32) - btnConfrim.GetTextWidth(), |
| | | Width = Application.GetRealWidth(160), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Visible = false, |
| | | Enable = false, |
| | | Text = "今日", |
| | | }; |
| | | topView.AddChidren(btnToday); |
| | | |
| | | |
| | | if (waterQueryType == QueryType.day_hour) |
| | | { |
| | | try |
| | | { |
| | | btnToday.Visible = btnToday.Enable = true; |
| | | btnToday.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pickerItems_Year = new List<string>(); |
| | | pickerItems_Year.Add("2023"); |
| | | while (DateTime.Now.Year > 2022 + pickerItems_Year.Count) |
| | | { |
| | | pickerItems_Year.Add((2023 + pickerItems_Year.Count).ToString()); |
| | | } |
| | | |
| | | if (waterQueryType == QueryType.custom_month || waterQueryType == QueryType.day_hour) |
| | | { |
| | | pickerItems_Month = new List<string>(); |
| | | if (waterQueryTime_Year == DateTime.Now.Year) |
| | | { |
| | | int addMonth = 0; |
| | | while (DateTime.Now.Month > addMonth) |
| | | { |
| | | addMonth++; |
| | | pickerItems_Month.Add(addMonth.ToString()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (var i = 1; i < 13; i++) |
| | | { |
| | | pickerItems_Month.Add(i.ToString()); |
| | | } |
| | | } |
| | | if (waterQueryType == QueryType.day_hour) |
| | | { |
| | | pickerItems_Day = new List<string>(); |
| | | if (waterQueryTime_Month == DateTime.Now.Month) |
| | | { |
| | | int addDay = 0; |
| | | while (DateTime.Now.Day > addDay) |
| | | { |
| | | addDay++; |
| | | pickerItems_Day.Add(addDay.ToString()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (var i = 1; i <= DateTime.DaysInMonth(waterQueryTime_Year, waterQueryTime_Month); i++) |
| | | { |
| | | pickerItems_Day.Add(i.ToString()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | item3 = waterQueryTime_Day = DateTime.Now.Day; |
| | | item2 = waterQueryTime_Month = DateTime.Now.Month; |
| | | item1 = waterQueryTime_Year = DateTime.Now.Year; |
| | | uIPickerView.setNPicker(pickerItems_Year, pickerItems_Month, pickerItems_Day); |
| | | uIPickerView.setCurrentItems(pickerItems_Year.IndexOf(waterQueryTime_Year.ToString()), |
| | | pickerItems_Month == null ? 0 : pickerItems_Month.IndexOf(waterQueryTime_Month.ToString()), |
| | | pickerItems_Day == null ? 0 : pickerItems_Day.IndexOf(waterQueryTime_Day.ToString())); |
| | | }; |
| | | } |
| | | catch { } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | custom_year, |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | #if __ANDROID__ |
| | | public string optionString = @"{ |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | crossStyle: { |
| | | color: '#999' |
| | | } |
| | | } |
| | | }, |
| | | grid: { |
| | | top: '10%', |
| | | left: '15%', |
| | |
| | | #else |
| | | |
| | | public string optionString = @"{ |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | crossStyle: { |
| | | color: '#999' |
| | | } |
| | | } |
| | | }, |
| | | grid: { |
| | | top: '10%', |
| | | left: '10%', |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | const string APP_KEY = "HDL-HOME-APP"; |
| | | const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC"; |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //const string APP_KEY = "HDL-HOME-APP"; |
| | | //const string SECRET_KEY = "CPL345bn28gHnvi9G4tYbq3cTYkiHC"; |
| | | |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | //public const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | //public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | public const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | |
| | | //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm |
| | | //const string APP_KEY = "CPEVRLRT"; |