From 177a7911bef4111d64ec0dfc6184eebb84fe23ed Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 31 七月 2023 00:47:04 +0800 Subject: [PATCH] 三相备份 --- HDL-ON_iOS/Resources/Language.ini | 56 ++ HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs | 8 HDL-ON_Android/Assets/Language.ini | 56 ++ HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs | 64 ++ HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs | 664 +++++++++++++++++++++++++++++++++ HDL_ON/Common/R.cs | 45 ++ HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs | 304 ++++++++++++++ HDL_ON/HDL_ON.projitems | 1 8 files changed, 1,163 insertions(+), 35 deletions(-) diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index 51fb542..84c43d6 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -671,6 +671,18 @@ 684=Length out of range 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. 686=Total +687=A-phase electricity data +688=B-phase electricity data +689=C-phase electricity data +690=Voltage +691=Current +692=Real-time power +693=Total electricity consumption (KW路h) +694=Hourly electricity consumption in the past 24 hours +695=Daily data of the past month +694=Monthly data of the past year + + @@ -2017,6 +2029,17 @@ 684=闀垮害瓒呭嚭鑼冨洿 685=娉細鐢ㄦ埛绠$悊浠呭彲瀵瑰凡娣诲姞鐢ㄦ埛杩涜绠$悊銆傚闇�娣诲姞鏂扮敤鎴凤紝璇峰墠寰�閿佺杩涜鐩稿叧鎿嶄綔銆� 686=鎬昏 +687=A鐩稿疄鏃剁敤鐢垫暟鎹� +688=B鐩稿疄鏃剁敤鐢垫暟鎹� +689=C鐩稿疄鏃剁敤鐢垫暟鎹� +690=鐢靛帇 +691=鐢垫祦 +692=瀹炴椂鍔熺巼 +693=鎬荤敤鐢甸噺锛圞W路h锛� +694=杩囧幓24灏忔椂鐨勬瘡灏忔椂鐢ㄧ數閲� +695=杩囧幓涓�涓湀鐨勬瘡鏃ユ暟鎹� +694=杩囧幓涓�骞寸殑姣忔湀鏁版嵁 + @@ -3365,6 +3388,17 @@ 684=Length out of range 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. 686=Total +687=A-phase electricity data +688=B-phase electricity data +689=C-phase electricity data +690=Voltage +691=Current +692=Real-time power +693=Total electricity consumption (KW路h) +694=Hourly electricity consumption in the past 24 hours +695=Daily data of the past month +694=Monthly data of the past year + @@ -4706,7 +4740,16 @@ 684=Length out of range 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. 686=Total - +687=A-phase electricity data +688=B-phase electricity data +689=C-phase electricity data +690=Voltage +691=Current +692=Real-time power +693=Total electricity consumption (KW路h) +694=Hourly electricity consumption in the past 24 hours +695=Daily data of the past month +694=Monthly data of the past year @@ -6034,6 +6077,17 @@ 684=Length out of range 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. 686=Total +687=A-phase electricity data +688=B-phase electricity data +689=C-phase electricity data +690=Voltage +691=Current +692=Real-time power +693=Total electricity consumption (KW路h) +694=Hourly electricity consumption in the past 24 hours +695=Daily data of the past month +694=Monthly data of the past year + diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index 51fb542..84c43d6 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -671,6 +671,18 @@ 684=Length out of range 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. 686=Total +687=A-phase electricity data +688=B-phase electricity data +689=C-phase electricity data +690=Voltage +691=Current +692=Real-time power +693=Total electricity consumption (KW路h) +694=Hourly electricity consumption in the past 24 hours +695=Daily data of the past month +694=Monthly data of the past year + + @@ -2017,6 +2029,17 @@ 684=闀垮害瓒呭嚭鑼冨洿 685=娉細鐢ㄦ埛绠$悊浠呭彲瀵瑰凡娣诲姞鐢ㄦ埛杩涜绠$悊銆傚闇�娣诲姞鏂扮敤鎴凤紝璇峰墠寰�閿佺杩涜鐩稿叧鎿嶄綔銆� 686=鎬昏 +687=A鐩稿疄鏃剁敤鐢垫暟鎹� +688=B鐩稿疄鏃剁敤鐢垫暟鎹� +689=C鐩稿疄鏃剁敤鐢垫暟鎹� +690=鐢靛帇 +691=鐢垫祦 +692=瀹炴椂鍔熺巼 +693=鎬荤敤鐢甸噺锛圞W路h锛� +694=杩囧幓24灏忔椂鐨勬瘡灏忔椂鐢ㄧ數閲� +695=杩囧幓涓�涓湀鐨勬瘡鏃ユ暟鎹� +694=杩囧幓涓�骞寸殑姣忔湀鏁版嵁 + @@ -3365,6 +3388,17 @@ 684=Length out of range 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. 686=Total +687=A-phase electricity data +688=B-phase electricity data +689=C-phase electricity data +690=Voltage +691=Current +692=Real-time power +693=Total electricity consumption (KW路h) +694=Hourly electricity consumption in the past 24 hours +695=Daily data of the past month +694=Monthly data of the past year + @@ -4706,7 +4740,16 @@ 684=Length out of range 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. 686=Total - +687=A-phase electricity data +688=B-phase electricity data +689=C-phase electricity data +690=Voltage +691=Current +692=Real-time power +693=Total electricity consumption (KW路h) +694=Hourly electricity consumption in the past 24 hours +695=Daily data of the past month +694=Monthly data of the past year @@ -6034,6 +6077,17 @@ 684=Length out of range 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. 686=Total +687=A-phase electricity data +688=B-phase electricity data +689=C-phase electricity data +690=Voltage +691=Current +692=Real-time power +693=Total electricity consumption (KW路h) +694=Hourly electricity consumption in the past 24 hours +695=Daily data of the past month +694=Monthly data of the past year + diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index 5bad366..008a8ef 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -4,11 +4,46 @@ { public static class StringId { - - - - - + /// <summary> + /// 杩囧幓涓�骞寸殑姣忔湀鏁版嵁 + /// </summary> + public const int AirSwitchP3HistroyTip3 = 696; + /// <summary> + /// 杩囧幓涓�涓湀鐨勬瘡鏃ユ暟鎹� + /// </summary> + public const int AirSwitchP3HistroyTip2 = 695; + /// <summary> + /// 杩囧幓24灏忔椂鐨勬瘡灏忔椂鐢ㄧ數閲� + /// </summary> + public const int AirSwitchP3HistroyTip1 = 694; + /// <summary> + /// 鎬荤敤鐢甸噺锛圞W路h锛� + /// </summary> + public const int TotalPowerAndUnit = 693; + /// <summary> + /// 瀹炴椂鍔熺巼 + /// </summary> + public const int ActivePower = 692; + /// <summary> + /// 鐢垫祦 + /// </summary> + public const int Current = 691; + /// <summary> + /// 鐢靛帇 + /// </summary> + public const int Voltage = 690; + /// <summary> + /// C鐩稿疄鏃剁敤鐢垫暟鎹� + /// </summary> + public const int RealTimeElectricityConsumptionDataOfPhaseC = 689; + /// <summary> + /// B鐩稿疄鏃剁敤鐢垫暟鎹� + /// </summary> + public const int RealTimeElectricityConsumptionDataOfPhaseB = 688; + /// <summary> + /// A鐩稿疄鏃剁敤鐢垫暟鎹� + /// </summary> + public const int RealTimeElectricityConsumptionDataOfPhaseA = 687; /// <summary> /// 鎬昏 /// </summary> diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index 75e0396..f246099 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -564,6 +564,7 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\2-Classification\SeriesFunctionListPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\AirSwitchP3Page.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\AirSwitchP3EnergyPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\AirSwitchP3SubloopEnergyPage.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" /> diff --git a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs index c3ee794..2f1ba90 100644 --- a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs +++ b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs @@ -37,10 +37,10 @@ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; break; case SPK.AirSwitchP3: - //var airSwitchP3Page = new AirSwitchP3Page(function); - //MainPage.BasePageView.AddChidren(airSwitchP3Page); - //airSwitchP3Page.LoadPage(btnCollectionIcon, btnName, btnFromFloor); - //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + var airSwitchP3Page = new AirSwitchP3Page(function); + MainPage.BasePageView.AddChidren(airSwitchP3Page); + airSwitchP3Page.LoadPage(btnCollectionIcon, btnName, btnFromFloor); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; break; case SPK.LightSwitch: var relayView = new RelayPage(function); diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs index f0dfb5c..359e656 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3EnergyPage.cs @@ -15,19 +15,10 @@ static AirSwitchP3EnergyPage bodyView; /// <summary> - /// 鎬诲姛鑰�-楗煎浘 - /// </summary> - MyEchartsViewOn myEchartsView_Pie; - /// <summary> /// 鏇茬嚎鍥炬暟鎹畇tring /// </summary> EchartsOption_BrokenLine brokenLine; - - /// <summary> - /// 鎻掓煡璇㈢殑鑳芥簮鍒楄〃 - /// </summary> - List<Function> queryList = new List<Function>(); /// <summary> /// 鏌ヨ鏉′欢 /// hour銆亀eek銆乵onth @@ -35,10 +26,6 @@ string curQueryType = "hour"; - /// <summary> - /// 鑳芥簮鍒楄〃鍖哄煙 - /// </summary> - FrameLayout energyListView; /// <summary> /// 鍘嗗彶鏁版嵁鍥捐〃 /// </summary> @@ -69,6 +56,7 @@ Y = Application.GetRealHeight(64), Height = Application.GetRealHeight(667-64), BackgroundColor = 0xFFF5F7FA, + ScrollEnabled = false, }; bodyView.AddChidren(contentView); @@ -165,6 +153,12 @@ btnShowHistroyData_Total.MouseUpEventHandler = (sender, e) => { + if(curQueryType == "total") + { + return; + } + curQueryType = "total"; + (sender as Button).SelectedBackgroundColor = 0x1F5C62FE; (sender as Button).BackgroundColor = 0x1F5C62FE; (sender as Button).BorderColor = CSS_Color.MainColor; @@ -188,11 +182,16 @@ btnShowHistroyData_Day.BorderColor = CSS_Color.PromptingColor1; btnShowHistroyData_Day.BackgroundColor = 0x00000000; btnShowHistroyData_Day.SelectedBackgroundColor = 0x00000000; - }; + + }; btnShowHistroyData_Day.MouseUpEventHandler = (sender, e) => { + if(curQueryType == "hour") + { + return; + } (sender as Button).SelectedBackgroundColor = 0x1F5C62FE; (sender as Button).BackgroundColor = 0x1F5C62FE; (sender as Button).BorderColor = CSS_Color.MainColor; @@ -216,10 +215,18 @@ btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1; btnShowHistroyData_Total.BackgroundColor = 0x00000000; btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000; + + curQueryType = "hour"; + brokenLine.YvalueText = ""; + LoadMothed_GetHistoryData(); }; btnShowHistroyData_Month.MouseUpEventHandler = (sender, e) => { + if(curQueryType == "month") + { + return; + } (sender as Button).SelectedBackgroundColor = 0x1F5C62FE; (sender as Button).BackgroundColor = 0x1F5C62FE; (sender as Button).BorderColor = CSS_Color.MainColor; @@ -243,10 +250,19 @@ btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1; btnShowHistroyData_Total.BackgroundColor = 0x00000000; btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000; + + curQueryType = "month"; + brokenLine.YvalueText = ""; + LoadMothed_GetHistoryData(); }; btnShowHistroyData_Year.MouseUpEventHandler = (sender, e) => { + if(curQueryType == "year_month") + { + return; + } + (sender as Button).SelectedBackgroundColor = 0x1F5C62FE; (sender as Button).BackgroundColor = 0x1F5C62FE; (sender as Button).BorderColor = CSS_Color.MainColor; @@ -270,6 +286,11 @@ btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1; btnShowHistroyData_Total.BackgroundColor = 0x00000000; btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000; + + + curQueryType = "year_month"; + brokenLine.YvalueText = ""; + LoadMothed_GetHistoryData(); }; #endregion @@ -284,6 +305,8 @@ Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(343), Height = Application.GetRealWidth(330), + Radius = (uint)Application.GetRealWidth(16), + BackgroundColor = CSS_Color.MainBackgroundColor, }; contentView.AddChidren(historyDataView); @@ -294,9 +317,237 @@ }; historyDataView.AddChidren(myEchartsView_Line); - //EnergyRow(energy, energyListView, index); + var btnTip = new Button() + { + Y = Application.GetRealHeight(289), + Height = Application.GetRealHeight(41), + Width = Application.GetRealWidth(300), + TextAlignment = TextAlignment.Center, + Gravity = Gravity.CenterHorizontal, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextColor = CSS_Color.FirstLevelTitleColor, + TextID = StringId.AirSwitchP3HistroyTip1, + }; + historyDataView.AddChidren(btnTip); LoadMothed_GetHistoryData(); + + #region A + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(12), + }); + + var viewa = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(52), + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(12), + }; + contentView.AddChidren(viewa); + + Button btnRighta = new Button() + { + X = Application.GetRealWidth(321), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/Right.png", + }; + viewa.AddChidren(btnRighta); + + Button btnTitlea = new Button() + { + X = Application.GetRealWidth(16), + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.TextFontSize, + TextColor= 0xFF000000, + Width = Application.GetRealWidth(300), + TextID = StringId.RealTimeElectricityConsumptionDataOfPhaseA + }; + viewa.AddChidren(btnTitlea); + #endregion + + + #region B + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(12), + }); + + var viewb = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(52), + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(12), + }; + contentView.AddChidren(viewb); + + Button btnRightb = new Button() + { + X = Application.GetRealWidth(321), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/Right.png", + }; + viewb.AddChidren(btnRightb); + + Button btnTitleb = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(300), + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.TextFontSize, + TextColor = 0xFF000000, + TextID = StringId.RealTimeElectricityConsumptionDataOfPhaseB, + }; + viewb.AddChidren(btnTitleb); + #endregion + + + #region C + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(12), + }); + + var viewc = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(52), + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(12), + }; + contentView.AddChidren(viewc); + + Button btnRightc = new Button() + { + X = Application.GetRealWidth(321), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/Right.png", + }; + viewc.AddChidren(btnRightc); + + Button btnTitlec = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(300), + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.TextFontSize, + TextColor = 0xFF000000, + TextID = StringId.RealTimeElectricityConsumptionDataOfPhaseC, + }; + viewc.AddChidren(btnTitlec); + #endregion + + + btnTitlea.MouseUpEventHandler = (sender, e) => { + var skipView = new AirSwitchP3SubloopEnergyPage(device,FunctionAttributeKey.ElectricityA); + MainPage.BasePageView.AddChidren(skipView); + skipView.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + btnTitlea.MouseUpEventHandler = (sender, e) => { + var skipView = new AirSwitchP3SubloopEnergyPage(device, FunctionAttributeKey.ElectricityB); + MainPage.BasePageView.AddChidren(skipView); + skipView.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + btnTitlea.MouseUpEventHandler = (sender, e) => { + var skipView = new AirSwitchP3SubloopEnergyPage(device, FunctionAttributeKey.ElectricityC); + MainPage.BasePageView.AddChidren(skipView); + skipView.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + + + + #region 鎬荤敤鐢甸噺 + var totalElectricityView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealWidth(183), + Radius = (uint)Application.GetRealWidth(16), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + //historyDataView.AddChidren(totalElectricityView); + + var btnTotalElectricity = new Button() + { + Width = Application.GetRealWidth(300), + Height = Application.GetRealHeight(55), + X = Application.GetRealWidth(14), + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextColor = 0xFF030D1C, + TextAlignment = TextAlignment.CenterLeft, + TextID = StringId.TotalPowerAndUnit, + }; + totalElectricityView.AddChidren(btnTotalElectricity); + + var btnTotalNumber = new Button() + { + Y = Application.GetRealHeight(27), + Gravity = Gravity.CenterHorizontal, + Height = Application.GetRealHeight(167), + TextSize = 49, + TextColor = 0xFF030D1C, + TextAlignment = TextAlignment.Center, + Text = device.GetAttrState(FunctionAttributeKey.TotalElectricity), + }; + totalElectricityView.AddChidren(btnTotalNumber); + + btnShowHistroyData_Day.MouseUpEventHandler += (sender, e) => { + totalElectricityView.RemoveFromParent(); + historyDataView.AddChidren(myEchartsView_Line); + viewa.Visible = true; + viewb.Visible = true; + viewc.Visible = true; + btnTip.TextID = StringId.AirSwitchP3HistroyTip1; + historyDataView.Height = Application.GetRealHeight(330); + }; + btnShowHistroyData_Month.MouseUpEventHandler += (sender, e) => { + totalElectricityView.RemoveFromParent(); + historyDataView.AddChidren(myEchartsView_Line); + viewa.Visible = true; + viewb.Visible = true; + viewc.Visible = true; + btnTip.TextID = StringId.AirSwitchP3HistroyTip2; + historyDataView.Height = Application.GetRealHeight(330); + }; + btnShowHistroyData_Year.MouseUpEventHandler += (sender, e) => { + totalElectricityView.RemoveFromParent(); + historyDataView.AddChidren(myEchartsView_Line); + viewa.Visible = false; + viewb.Visible = false; + viewc.Visible = false; + btnTip.TextID = StringId.AirSwitchP3HistroyTip3; + historyDataView.Height = Application.GetRealHeight(330); + }; + btnShowHistroyData_Total.MouseUpEventHandler += (sender, e) => { + myEchartsView_Line.RemoveFromParent(); + historyDataView.AddChidren(totalElectricityView); + viewa.Visible = false; + viewb.Visible = false; + viewc.Visible = false; + historyDataView.Height = Application.GetRealHeight(184); + }; + + + + + + #endregion + + } @@ -337,10 +588,25 @@ "813","313","213","123", "113","213","183","133", "133","513","133","413", + "813","313","213","123", + "113","213","183","133", + "133","513","133","413", }; brokenLine.InitXdataText(vs); revertData = new List<EnvironmentalSensorHistor>() { + new EnvironmentalSensorHistor{ fieldValue = "100"}, + new EnvironmentalSensorHistor{ fieldValue = "200"}, + new EnvironmentalSensorHistor{ fieldValue = "300"}, + new EnvironmentalSensorHistor{ fieldValue = "400"}, + new EnvironmentalSensorHistor{ fieldValue = "500"}, + new EnvironmentalSensorHistor{ fieldValue = "400"}, + new EnvironmentalSensorHistor{ fieldValue = "100"}, + new EnvironmentalSensorHistor{ fieldValue = "200"}, + new EnvironmentalSensorHistor{ fieldValue = "300"}, + new EnvironmentalSensorHistor{ fieldValue = "400"}, + new EnvironmentalSensorHistor{ fieldValue = "500"}, + new EnvironmentalSensorHistor{ fieldValue = "400"}, new EnvironmentalSensorHistor{ fieldValue = "100"}, new EnvironmentalSensorHistor{ fieldValue = "200"}, new EnvironmentalSensorHistor{ fieldValue = "300"}, @@ -358,7 +624,7 @@ { device.attributes.Add(new FunctionAttributes() { key = "ydata" }); } - device.SetAttrState("ydata", brokenLine.InitYdataText(device.name, revertData, "#5C62FE") + ", "); + device.SetAttrState("ydata", brokenLine.InitYdataText2(device.name, revertData, "#5C62FE", curQueryType == "year_month") + ", "); #endif } @@ -377,18 +643,18 @@ { device.attributes.Add(new FunctionAttributes() { key = "ydata" }); } - device.SetAttrState("ydata", brokenLine.InitYdataText(device.name, revertData, "#5C62FE") + ", "); + device.SetAttrState("ydata", brokenLine.InitYdataText2(device.name, revertData, "#5C62FE", curQueryType == "year_month") + ", "); } } } - brokenLine.yTitle = Language.StringByID(StringId.EnergyConsumption) + "(kW)"; + brokenLine.yTitle = Language.StringByID(StringId.Uint) + "(KW路h)"; brokenLine.xTitle = Language.StringByID(StringId.timeMode); if (curQueryType != "hour") { brokenLine.xTitle = Language.StringByID(StringId.Date); } - var opString = brokenLine.InitOption(30); + var opString = brokenLine.InitOption(50, curQueryType == "year_month"); Application.RunOnMainThread(() => { myEchartsView_Line.ShowWithOption(opString); diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs new file mode 100644 index 0000000..130e809 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs @@ -0,0 +1,664 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.DAL.Server; +using HDL_ON.Entity; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI +{ + /// <summary> + /// 涓夌浉绌哄紑瀛愮浉鍘嗗彶鏁版嵁鐣岄潰 + /// </summary> + public class AirSwitchP3SubloopEnergyPage : FrameLayout + { + static AirSwitchP3SubloopEnergyPage bodyView; + + /// <summary> + /// 鏇茬嚎鍥炬暟鎹畇tring + /// </summary> + EchartsOption_BrokenLine brokenLine; + /// <summary> + /// 鏌ヨ鏉′欢 + /// hour銆亀eek銆乵onth + /// </summary> + string curQueryType = "hour"; + + /// <summary> + /// 鍘嗗彶鏁版嵁鍥捐〃 + /// </summary> + MyEchartsViewOn myEchartsView_Line; + + Function device; + + string key = ""; + /// <summary> + /// 涓婚〉 + /// </summary> + public AirSwitchP3SubloopEnergyPage(Function function,string searchKey) + { + bodyView = this; + this.key = searchKey; + device = function; + } + + /// <summary> + /// + /// </summary> + public void LoadPage() + { + new TopViewDiv(bodyView, Language.StringByID(StringId.EnergyMonitoring)).LoadTopView(0xFFF7F7F7); + bodyView.BackgroundColor = 0xFFF5F7FA; + + var contentView = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(667 - 64), + BackgroundColor = 0xFFF5F7FA, + ScrollEnabled = false, + }; + bodyView.AddChidren(contentView); + + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(12), + }); + + + brokenLine = new EchartsOption_BrokenLine(); + + + + #region A + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(12), + }); + + var viewa = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(52), + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(12), + }; + contentView.AddChidren(viewa); + + Button btnRighta = new Button() + { + X = Application.GetRealWidth(221), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(116), + TextAlignment = TextAlignment.CenterRight, + TextColor = 0xFF768194, + TextSize = CSS_FontSize.TextFontSize, + Text = "---V", + }; + viewa.AddChidren(btnRighta); + + Button btnTitlea = new Button() + { + X = Application.GetRealWidth(16), + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.TextFontSize, + TextColor = 0xFF000000, + Width = Application.GetRealWidth(300), + TextID = StringId.Voltage + }; + viewa.AddChidren(btnTitlea); + #endregion + + + #region B + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(12), + }); + + var viewb = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(52), + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(12), + }; + contentView.AddChidren(viewb); + + Button btnRightb = new Button() + { + X = Application.GetRealWidth(221), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(116), + TextAlignment = TextAlignment.CenterRight, + TextColor = 0xFF768194, + TextSize = CSS_FontSize.TextFontSize, + Text = "---A", + }; + viewb.AddChidren(btnRightb); + + Button btnTitleb = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(300), + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.TextFontSize, + TextColor = 0xFF000000, + TextID = StringId.Current, + }; + viewb.AddChidren(btnTitleb); + #endregion + + + #region C + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(12), + }); + + var viewc = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(52), + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(12), + }; + contentView.AddChidren(viewc); + + Button btnRightc = new Button() + { + X = Application.GetRealWidth(221), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(116), + TextAlignment = TextAlignment.CenterRight, + TextColor = 0xFF768194, + TextSize = CSS_FontSize.TextFontSize, + Text = "---W", + }; + viewc.AddChidren(btnRightc); + + Button btnTitlec = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(300), + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.TextFontSize, + TextColor = 0xFF000000, + TextID = StringId.ActivePower, + }; + viewc.AddChidren(btnTitlec); + #endregion + + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(26), + }); + + #region 閫夋嫨鏁版嵁鏃ユ湡鑼冨洿 + var showDataTypeView = new FrameLayout() + { + X = Application.GetRealWidth(143), + Y = Application.GetRealHeight(12), + Width = Application.GetRealWidth(216), + Height = Application.GetRealHeight(27), + //BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png", + }; + contentView.AddChidren(showDataTypeView); + + var btnShowHistroyData_Day = new Button() + { + Width = Application.GetRealWidth(54), + Height = Application.GetRealHeight(27), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.PromptingColor1, + SelectedTextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + IsSelected = true, + TextID = StringId.day, + SelectedBackgroundColor = 0x1F5C62FE, + BackgroundColor = 0x1F5C62FE, + BorderColor = CSS_Color.MainColor, + BorderWidth = 2, + }; + showDataTypeView.AddChidren(btnShowHistroyData_Day); + btnShowHistroyData_Day.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); + + + var btnShowHistroyData_Month = new Button() + { + X = Application.GetRealWidth(54), + Width = Application.GetRealWidth(54), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.PromptingColor1, + SelectedTextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextID = StringId.month, + SelectedBackgroundColor = 0x1F5C62FE, + BackgroundColor = 0x00000000, + IsSelected = false, + BorderWidth = 1, + BorderColor = CSS_Color.PromptingColor1, + }; + showDataTypeView.AddChidren(btnShowHistroyData_Month); + + var btnShowHistroyData_Year = new Button() + { + X = Application.GetRealWidth(54 * 2), + Width = Application.GetRealWidth(54), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.PromptingColor1, + SelectedTextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextID = StringId.Years, + SelectedBackgroundColor = 0x1F5C62FE, + BackgroundColor = 0x00000000, + IsSelected = false, + BorderWidth = 1, + BorderColor = CSS_Color.PromptingColor1, + }; + showDataTypeView.AddChidren(btnShowHistroyData_Year); + + var btnShowHistroyData_Total = new Button() + { + X = Application.GetRealWidth(54 * 3), + Width = Application.GetRealWidth(54), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.PromptingColor1, + SelectedTextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextID = StringId.Total, + SelectedBackgroundColor = 0x1F5C62FE, + BackgroundColor = 0x00000000, + IsSelected = false, + BorderWidth = 1, + BorderColor = CSS_Color.PromptingColor1, + }; + showDataTypeView.AddChidren(btnShowHistroyData_Total); + btnShowHistroyData_Total.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerBottomRight | HDLUtils.RectCornerTopRight); + + + btnShowHistroyData_Total.MouseUpEventHandler = (sender, e) => + { + if (curQueryType == "total") + { + return; + } + curQueryType = "total"; + + (sender as Button).SelectedBackgroundColor = 0x1F5C62FE; + (sender as Button).BackgroundColor = 0x1F5C62FE; + (sender as Button).BorderColor = CSS_Color.MainColor; + (sender as Button).BorderWidth = 2; + (sender as Button).IsSelected = true; + + btnShowHistroyData_Month.IsSelected = false; + btnShowHistroyData_Month.BorderWidth = 1; + btnShowHistroyData_Month.BorderColor = CSS_Color.PromptingColor1; + btnShowHistroyData_Month.BackgroundColor = 0x00000000; + btnShowHistroyData_Month.SelectedBackgroundColor = 0x00000000; + + btnShowHistroyData_Year.IsSelected = false; + btnShowHistroyData_Year.BorderWidth = 1; + btnShowHistroyData_Year.BorderColor = CSS_Color.PromptingColor1; + btnShowHistroyData_Year.BackgroundColor = 0x00000000; + btnShowHistroyData_Year.SelectedBackgroundColor = 0x00000000; + + btnShowHistroyData_Day.IsSelected = false; + btnShowHistroyData_Day.BorderWidth = 1; + btnShowHistroyData_Day.BorderColor = CSS_Color.PromptingColor1; + btnShowHistroyData_Day.BackgroundColor = 0x00000000; + btnShowHistroyData_Day.SelectedBackgroundColor = 0x00000000; + + + }; + + + btnShowHistroyData_Day.MouseUpEventHandler = (sender, e) => + { + if (curQueryType == "hour") + { + return; + } + (sender as Button).SelectedBackgroundColor = 0x1F5C62FE; + (sender as Button).BackgroundColor = 0x1F5C62FE; + (sender as Button).BorderColor = CSS_Color.MainColor; + (sender as Button).BorderWidth = 2; + (sender as Button).IsSelected = true; + + btnShowHistroyData_Month.IsSelected = false; + btnShowHistroyData_Month.BorderWidth = 1; + btnShowHistroyData_Month.BorderColor = CSS_Color.PromptingColor1; + btnShowHistroyData_Month.BackgroundColor = 0x00000000; + btnShowHistroyData_Month.SelectedBackgroundColor = 0x00000000; + + btnShowHistroyData_Year.IsSelected = false; + btnShowHistroyData_Year.BorderWidth = 1; + btnShowHistroyData_Year.BorderColor = CSS_Color.PromptingColor1; + btnShowHistroyData_Year.BackgroundColor = 0x00000000; + btnShowHistroyData_Year.SelectedBackgroundColor = 0x00000000; + + btnShowHistroyData_Total.IsSelected = false; + btnShowHistroyData_Total.BorderWidth = 1; + btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1; + btnShowHistroyData_Total.BackgroundColor = 0x00000000; + btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000; + + curQueryType = "hour"; + brokenLine.YvalueText = ""; + LoadMothed_GetHistoryData(); + }; + + btnShowHistroyData_Month.MouseUpEventHandler = (sender, e) => + { + if (curQueryType == "month") + { + return; + } + (sender as Button).SelectedBackgroundColor = 0x1F5C62FE; + (sender as Button).BackgroundColor = 0x1F5C62FE; + (sender as Button).BorderColor = CSS_Color.MainColor; + (sender as Button).BorderWidth = 2; + (sender as Button).IsSelected = true; + + btnShowHistroyData_Day.IsSelected = false; + btnShowHistroyData_Day.BorderWidth = 1; + btnShowHistroyData_Day.BorderColor = CSS_Color.PromptingColor1; + btnShowHistroyData_Day.BackgroundColor = 0x00000000; + btnShowHistroyData_Day.SelectedBackgroundColor = 0x00000000; + + btnShowHistroyData_Year.IsSelected = false; + btnShowHistroyData_Year.BorderWidth = 1; + btnShowHistroyData_Year.BorderColor = CSS_Color.PromptingColor1; + btnShowHistroyData_Year.BackgroundColor = 0x00000000; + btnShowHistroyData_Year.SelectedBackgroundColor = 0x00000000; + + btnShowHistroyData_Total.IsSelected = false; + btnShowHistroyData_Total.BorderWidth = 1; + btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1; + btnShowHistroyData_Total.BackgroundColor = 0x00000000; + btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000; + + curQueryType = "month"; + brokenLine.YvalueText = ""; + LoadMothed_GetHistoryData(); + }; + + btnShowHistroyData_Year.MouseUpEventHandler = (sender, e) => + { + if (curQueryType == "year_month") + { + return; + } + + (sender as Button).SelectedBackgroundColor = 0x1F5C62FE; + (sender as Button).BackgroundColor = 0x1F5C62FE; + (sender as Button).BorderColor = CSS_Color.MainColor; + (sender as Button).BorderWidth = 2; + (sender as Button).IsSelected = true; + + btnShowHistroyData_Month.IsSelected = false; + btnShowHistroyData_Month.BorderWidth = 1; + btnShowHistroyData_Month.BorderColor = CSS_Color.PromptingColor1; + btnShowHistroyData_Month.BackgroundColor = 0x00000000; + btnShowHistroyData_Month.SelectedBackgroundColor = 0x00000000; + + btnShowHistroyData_Day.IsSelected = false; + btnShowHistroyData_Day.BorderWidth = 1; + btnShowHistroyData_Day.BorderColor = CSS_Color.PromptingColor1; + btnShowHistroyData_Day.BackgroundColor = 0x00000000; + btnShowHistroyData_Day.SelectedBackgroundColor = 0x00000000; + + btnShowHistroyData_Total.IsSelected = false; + btnShowHistroyData_Total.BorderWidth = 1; + btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1; + btnShowHistroyData_Total.BackgroundColor = 0x00000000; + btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000; + + + curQueryType = "year_month"; + brokenLine.YvalueText = ""; + LoadMothed_GetHistoryData(); + }; + + #endregion + + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(12), + }); + + var historyDataView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealWidth(330), + Radius = (uint)Application.GetRealWidth(16), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(historyDataView); + + myEchartsView_Line = new MyEchartsViewOn() + { + Y = Application.GetRealWidth(10), + Height = Application.GetRealWidth(280), + }; + historyDataView.AddChidren(myEchartsView_Line); + + //EnergyRow(energy, energyListView, index); + + LoadMothed_GetHistoryData(); + + + + + + #region 鎬荤敤鐢甸噺 + var totalElectricityView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealWidth(183), + Radius = (uint)Application.GetRealWidth(16), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + //historyDataView.AddChidren(totalElectricityView); + + var btnTotalElectricity = new Button() + { + Width = Application.GetRealWidth(300), + Height = Application.GetRealHeight(55), + X = Application.GetRealWidth(14), + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextColor = 0xFF030D1C, + TextAlignment = TextAlignment.CenterLeft, + TextID = StringId.TotalPowerAndUnit, + }; + totalElectricityView.AddChidren(btnTotalElectricity); + + var btnTotalNumber = new Button() + { + Y = Application.GetRealHeight(27), + Gravity = Gravity.CenterHorizontal, + Height = Application.GetRealHeight(167), + TextSize = 49, + TextColor = 0xFF030D1C, + TextAlignment = TextAlignment.Center, + Text = device.GetAttrState(FunctionAttributeKey.TotalElectricity), + }; + totalElectricityView.AddChidren(btnTotalNumber); + + btnShowHistroyData_Day.MouseUpEventHandler += (sender, e) => { + totalElectricityView.RemoveFromParent(); + historyDataView.AddChidren(myEchartsView_Line); + //viewa.Visible = true; + //viewb.Visible = true; + //viewc.Visible = true; + historyDataView.Height = Application.GetRealHeight(330); + }; + btnShowHistroyData_Month.MouseUpEventHandler += (sender, e) => { + totalElectricityView.RemoveFromParent(); + historyDataView.AddChidren(myEchartsView_Line); + //viewa.Visible = true; + //viewb.Visible = true; + //viewc.Visible = true; + historyDataView.Height = Application.GetRealHeight(330); + }; + btnShowHistroyData_Year.MouseUpEventHandler += (sender, e) => { + totalElectricityView.RemoveFromParent(); + historyDataView.AddChidren(myEchartsView_Line); + //viewa.Visible = true; + //viewb.Visible = true; + //viewc.Visible = true; + historyDataView.Height = Application.GetRealHeight(330); + }; + btnShowHistroyData_Total.MouseUpEventHandler += (sender, e) => { + myEchartsView_Line.RemoveFromParent(); + historyDataView.AddChidren(totalElectricityView); + //viewa.Visible = false; + //viewb.Visible = false; + //viewc.Visible = false; + historyDataView.Height = Application.GetRealHeight(184); + }; + + + + + + #endregion + + + + + + } + + + + + /// <summary> + /// 璇诲彇鍘嗗彶鏁版嵁 + /// </summary> + void LoadMothed_GetHistoryData() + { + + var loadPage = new Loading() + { + LodingBackgroundColor = 0x88888888, + }; + bodyView.AddChidren(loadPage); + + new System.Threading.Thread(() => + { + try + { + Application.RunOnMainThread(() => + { + loadPage.Start(Language.StringByID(StringId.PleaseWait)); + }); + + var sensorType = device.spk.Split(".")[1]; + var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, device.deviceId, key); + if (revertObj != null) + { + if (revertObj.Code == StateCode.SUCCESS) + { + var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString()); + if (revertData == null || revertData.Count == 0) + { +#if DEBUG + List<string> vs = new List<string>() { + "813","313","213","123", + "113","213","183","133", + "133","513","133","413", + "813","313","213","123", + "113","213","183","133", + "133","513","133","413", + }; + brokenLine.InitXdataText(vs); + revertData = new List<EnvironmentalSensorHistor>() + { + new EnvironmentalSensorHistor{ fieldValue = "100"}, + new EnvironmentalSensorHistor{ fieldValue = "200"}, + new EnvironmentalSensorHistor{ fieldValue = "300"}, + new EnvironmentalSensorHistor{ fieldValue = "400"}, + new EnvironmentalSensorHistor{ fieldValue = "500"}, + new EnvironmentalSensorHistor{ fieldValue = "400"}, + new EnvironmentalSensorHistor{ fieldValue = "100"}, + new EnvironmentalSensorHistor{ fieldValue = "200"}, + new EnvironmentalSensorHistor{ fieldValue = "300"}, + new EnvironmentalSensorHistor{ fieldValue = "400"}, + new EnvironmentalSensorHistor{ fieldValue = "500"}, + new EnvironmentalSensorHistor{ fieldValue = "400"}, + new EnvironmentalSensorHistor{ fieldValue = "100"}, + new EnvironmentalSensorHistor{ fieldValue = "200"}, + new EnvironmentalSensorHistor{ fieldValue = "300"}, + new EnvironmentalSensorHistor{ fieldValue = "400"}, + new EnvironmentalSensorHistor{ fieldValue = "500"}, + new EnvironmentalSensorHistor{ fieldValue = "400"}, + new EnvironmentalSensorHistor{ fieldValue = "100"}, + new EnvironmentalSensorHistor{ fieldValue = "200"}, + new EnvironmentalSensorHistor{ fieldValue = "300"}, + new EnvironmentalSensorHistor{ fieldValue = "400"}, + new EnvironmentalSensorHistor{ fieldValue = "500"}, + new EnvironmentalSensorHistor{ fieldValue = "400"}, + }; + if (device.GetAttribute("ydata") == null) + { + device.attributes.Add(new FunctionAttributes() { key = "ydata" }); + } + device.SetAttrState("ydata", brokenLine.InitYdataText2(device.name, revertData, "#5C62FE", curQueryType == "year_month") + ", "); + +#endif + } + else + { + List<string> vs = new List<string>(); + if (brokenLine.YvalueText == "") + { + foreach (var data in revertData) + { + vs.Add(data.fieldName); + } + brokenLine.InitXdataText(vs); + } + if (device.GetAttribute("ydata") == null) + { + device.attributes.Add(new FunctionAttributes() { key = "ydata" }); + } + device.SetAttrState("ydata", brokenLine.InitYdataText2(device.name, revertData, "#5C62FE", curQueryType == "year_month") + ", "); + } + } + } + brokenLine.yTitle = Language.StringByID(StringId.Uint) + "(KW路h)"; + brokenLine.xTitle = Language.StringByID(StringId.timeMode); + if (curQueryType != "hour") + { + brokenLine.xTitle = Language.StringByID(StringId.Date); + } + + var opString = brokenLine.InitOption(50, curQueryType == "year_month"); + Application.RunOnMainThread(() => + { + myEchartsView_Line.ShowWithOption(opString); + }); + } + catch (Exception ex) + { + MainPage.Log($"sensor history error : {ex.Message}"); + } + finally + { + Application.RunOnMainThread(() => + { + loadPage.Hide(); + }); + } + }) + { IsBackground = true }.Start(); + } + + + } +} \ No newline at end of file diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs index 5ff7e8a..cc799c1 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs @@ -47,17 +47,25 @@ /// </summary> /// <param name="displayScale">鏄剧ず姣斾緥 0-100锛屾瘮濡傝缃簡30锛屽彧鏄剧ず30%锛屽彲浠ュ乏鍙虫嫋鍔ㄦ樉绀哄叾浠�</param> /// <returns></returns> - public string InitOption(int displayScale) + public string InitOption(int displayScale, bool isBar = false) { //缁勮Value var newstring = optionString2.Replace("{0}", XvalueText); newstring = newstring.Replace("{1}", YvalueText); newstring = newstring.Replace("{10}", xTitle); + if (isBar) + { + newstring = newstring.Replace("{11}", "true"); + } + else { + newstring = newstring.Replace("{11}", "false"); + } newstring = newstring.Replace("{20}", yTitle); newstring = newstring.Replace("{30}", displayScale.ToString()); newstring = newstring.Replace(",,", ","); return newstring; } + /// <summary> /// 缁勮x杞存枃鏈� @@ -114,6 +122,53 @@ /// 缁勮y杞存枃鏈� /// </summary> /// <param name="yData"></param> + public string InitYdataText2(string name, List<EnvironmentalSensorHistor> yData, string color, bool isBar) + { + //缁勮Value + yTitle = name; + string valueText = string.Empty; + var YvalueTextItem = @"{ + data:[{1}], + type:'{333}', + smooth:0.6, + symbol:'none', + color:'{2}'} + "; + if (isBar) + { + YvalueTextItem = YvalueTextItem.Replace("{333}", "bar"); + } + else + { + YvalueTextItem = YvalueTextItem.Replace("{333}", "line"); + } + YvalueTextItem = YvalueTextItem.Replace("{0}", name); + + foreach (var data in yData) + { + valueText += "'" + data.fieldValue + "',"; + } + YvalueTextItem = YvalueTextItem.Replace("{1}", valueText); + YvalueTextItem = YvalueTextItem.Replace("{2}", color); + + if (YvalueText == "") + { + YvalueText = YvalueTextItem; + } + else + { + YvalueText += "," + YvalueTextItem; + } + + return YvalueTextItem; + } + + + + /// <summary> + /// 缁勮y杞存枃鏈� + /// </summary> + /// <param name="yData"></param> public string InitYdataTextLinearGradient(string name, List<EnvironmentalSensorHistor> yData, string color) { //缁勮Value @@ -124,7 +179,6 @@ //string bColor = color.Substring(5, 2); var YvalueTextItem = @"{name:'{0}', data:[{1}], - type:'line', smooth:0.6, symbol:'none', color:'{2}CC', @@ -194,7 +248,7 @@ fontSize:30, }, }, - series: [ + series: [ {1} ] }"; @@ -241,7 +295,7 @@ xAxis: { name: '{10}', type: 'category', - boundaryGap: false, + boundaryGap: {11}, data: [{0}], axisLabel : { fontSize:30, @@ -277,7 +331,7 @@ }, xAxis: { type: 'category', - boundaryGap: false, + boundaryGap: {11}, data: [{0}], name: '{10}' }, -- Gitblit v1.8.0