From b562a582ac3a288193e6e4f57c5eff8a344305a4 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期五, 27 九月 2024 13:52:17 +0800
Subject: [PATCH] Update AndroidManifest.xml
---
HDL_ON/UI/UI2/FuntionControlView/Acst/WetarHeaterJinmaoHistoryPage.cs | 1304 ++++++++++++++++++++++++++++++++--------------------------
1 files changed, 715 insertions(+), 589 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/WetarHeaterJinmaoHistoryPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/WetarHeaterJinmaoHistoryPage.cs
index b1d60f1..3005623 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Acst/WetarHeaterJinmaoHistoryPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Acst/WetarHeaterJinmaoHistoryPage.cs
@@ -197,7 +197,7 @@
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);
@@ -215,40 +215,40 @@
tempEchartOption = new EchartsOption_Histogram();
tempEchartOption.xTitle = "鏃堕棿";
tempEchartOption.yTitle = "娓╁害锛堚剝锛�";
- tempEchartOption.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"
- });
- tempEchartOption.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" },
- });
- var ddd = tempEchartOption.InitOption();
- infoView1_EchartsView.ShowWithOption(ddd);
+ //tempEchartOption.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"
+ //});
+ //tempEchartOption.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" },
+ //});
+ //var ddd = tempEchartOption.InitOption();
+ //infoView1_EchartsView.ShowWithOption(ddd);
infoView1.AddChidren(new Button()
{
@@ -269,206 +269,209 @@
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()
{
@@ -476,6 +479,8 @@
});
initQueryButton();
+ getTempHistory();
+ getWaterHistory();
}
@@ -493,6 +498,7 @@
var loadPage = new Loading()
{
LodingBackgroundColor = 0x88888888,
+ BackgroundColor = 0x00FFFFFF,
};
infoView1.AddChidren(loadPage);
@@ -502,7 +508,7 @@
{
Application.RunOnMainThread(() =>
{
- loadPage.Start(Language.StringByID(StringId.PleaseWait));
+ loadPage.Start();
});
switch (tempQueryType)
@@ -511,14 +517,14 @@
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)
@@ -563,9 +569,14 @@
{
return;
}
+ if (function.attributes.Find((obj) => obj.key == WaterHeaterJinmao_AttrEnum.volume.ToString()) == null)
+ {
+ return;
+ }
var loadPage = new Loading()
{
LodingBackgroundColor = 0x88888888,
+ BackgroundColor = 0x00FFFFFF,
};
infoView2.AddChidren(loadPage);
@@ -575,7 +586,7 @@
{
Application.RunOnMainThread(() =>
{
- loadPage.Start(Language.StringByID(StringId.PleaseWait));
+ loadPage.Start();
});
switch (waterQueryType)
{
@@ -590,7 +601,7 @@
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)
@@ -633,110 +644,81 @@
{
SetTempQureyDateDialog();
};
- infoView1_DateInfo_PreClickButton.MouseUpEventHandler = (sender, e) => {
- var tempQueryDate = new DateTime(tempQueryTime_Year,tempQueryTime_Month,tempQueryTime_Day);
- if (tempQueryType == QueryType.day_hour)
- {
- tempQueryDate = tempQueryDate.AddDays(-1);
- if(tempQueryDate.Year == 2023 && tempQueryDate.Month == 1 && tempQueryDate.Day == 1)
- {
- infoView1_DateInfo_PreIconButton.Visible = false;
- infoView1_DateInfo_PreClickButton.Enable = false;
- }
- if (tempQueryDate.Year == DateTime.Now.Year && tempQueryDate.Month == DateTime.Now.Month && tempQueryDate.Day == DateTime.Now.Day - 1)
- {
- infoView1_DateInfo_NextIconButton.Visible = true;
- infoView1_DateInfo_NextClickButton.Enable = true;
- }
- }
- else if(tempQueryType == QueryType.custom_month)
- {
- tempQueryDate = tempQueryDate.AddMonths(-1);
- if (tempQueryDate.Year == 2023 && tempQueryDate.Month == 1)
- {
- infoView1_DateInfo_PreIconButton.Visible = false;
- infoView1_DateInfo_PreClickButton.Enable = false;
- }
- if (tempQueryDate.Year == DateTime.Now.Year && tempQueryDate.Month == DateTime.Now.Month - 1)
- {
- infoView1_DateInfo_NextIconButton.Visible = true;
- infoView1_DateInfo_NextClickButton.Enable = true;
- }
- }
- else if(tempQueryType == QueryType.custom_year)
- {
- tempQueryDate = tempQueryDate.AddYears(-1);
- if (tempQueryDate.Year == 2023)
- {
- infoView1_DateInfo_PreIconButton.Visible = false;
- infoView1_DateInfo_PreClickButton.Enable = false;
- }
- if (tempQueryDate.Year == DateTime.Now.Year - 1)
- {
- infoView1_DateInfo_NextIconButton.Visible = true;
- infoView1_DateInfo_NextClickButton.Enable = true;
- }
- }
- tempQueryTime_Year = tempQueryDate.Year;
- tempQueryTime_Month = tempQueryDate.Month;
- tempQueryTime_Day = tempQueryDate.Day;
- infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM-dd");
- getTempHistory();
- };
- infoView1_DateInfo_NextIconButton.Visible = false;
- infoView1_DateInfo_NextClickButton.Enable = false;
- infoView1_DateInfo_NextClickButton.MouseUpEventHandler = (sender, e) => {
+ infoView1_DateInfo_PreClickButton.MouseUpEventHandler = (sender, e) =>
+ {
var tempQueryDate = new DateTime(tempQueryTime_Year, tempQueryTime_Month, tempQueryTime_Day);
if (tempQueryType == QueryType.day_hour)
{
- tempQueryDate = tempQueryDate.AddDays(1);
- if (tempQueryDate.Year == 2023 && tempQueryDate.Month == 1 && tempQueryDate.Day == 2)
+ if (tempQueryDate.Year == 2023 && tempQueryDate.Month == 1 && tempQueryDate.Day == 1)
{
- infoView1_DateInfo_PreIconButton.Visible = true;
- infoView1_DateInfo_PreClickButton.Enable = true;
+ return;
}
- if (tempQueryDate.Year == DateTime.Now.Year && tempQueryDate.Month == DateTime.Now.Month && tempQueryDate.Day == DateTime.Now.Day)
- {
- infoView1_DateInfo_NextIconButton.Visible = false;
- infoView1_DateInfo_NextClickButton.Enable = false;
- }
+ tempQueryDate = tempQueryDate.AddDays(-1);
+ infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM-dd");
}
else if (tempQueryType == QueryType.custom_month)
{
- tempQueryDate = tempQueryDate.AddMonths(1);
- if (tempQueryDate.Year == 2023 && tempQueryDate.Month == 2)
+ if (tempQueryDate.Year == 2023 && tempQueryDate.Month == 1)
{
- infoView1_DateInfo_PreIconButton.Visible = true;
- infoView1_DateInfo_PreClickButton.Enable = true;
+ return;
}
- if (tempQueryDate.Year == DateTime.Now.Year && tempQueryDate.Month == DateTime.Now.Month )
- {
- infoView1_DateInfo_NextIconButton.Visible = false;
- infoView1_DateInfo_NextClickButton.Enable = false;
- }
+ tempQueryDate = tempQueryDate.AddMonths(-1);
+ tempQueryTime_Day = tempQueryDate.Day;
+ infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM");
}
else if (tempQueryType == QueryType.custom_year)
{
- tempQueryDate = tempQueryDate.AddYears(1);
- if (tempQueryDate.Year == 2023)
+ if (tempQueryDate.Year <= 2023)
{
- infoView1_DateInfo_PreIconButton.Visible = false;
- infoView1_DateInfo_PreClickButton.Enable = false;
+ return;
}
- if (tempQueryDate.Year == DateTime.Now.Year)
- {
- infoView1_DateInfo_NextIconButton.Visible = false;
- infoView1_DateInfo_NextClickButton.Enable = false;
- }
+ tempQueryDate = tempQueryDate.AddYears(-1);
+ infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy");
}
tempQueryTime_Year = tempQueryDate.Year;
tempQueryTime_Month = tempQueryDate.Month;
tempQueryTime_Day = tempQueryDate.Day;
- infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM-dd");
+ getTempHistory();
+ };
+ 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)
+ {
+ return;
+ }
+ tempQueryDate = tempQueryDate.AddDays(1);
+ 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)
+ {
+ return;
+ }
+ tempQueryDate = tempQueryDate.AddMonths(1);
+ tempQueryTime_Day = tempQueryDate.Day;
+ infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy-MM");
+ }
+ else if (tempQueryType == QueryType.custom_year)
+ {
+ if (tempQueryDate.Year >= DateTime.Now.Year)
+ {
+ return;
+ }
+ tempQueryDate = tempQueryDate.AddYears(1);
+ infoView1_DateInfo_DateTextButton.Text = tempQueryDate.ToString("yyyy");
+ }
+ tempQueryTime_Year = tempQueryDate.Year;
+ tempQueryTime_Month = tempQueryDate.Month;
+ tempQueryTime_Day = tempQueryDate.Day;
getTempHistory();
};
- infoView1_Date_Day.MouseUpEventHandler = (sender, e) => {
+ infoView1_Date_Day.MouseUpEventHandler = (sender, e) =>
+ {
if (infoView1_Date_Day.IsSelected)
{
return;
@@ -745,10 +727,17 @@
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;
@@ -757,10 +746,16 @@
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;
@@ -773,149 +768,136 @@
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)
- {
- waterQueryDate = waterQueryDate.AddDays(-1);
- if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1 && waterQueryDate.Day == 1)
- {
- infoView2_DateInfo_PreIconButton.Visible = false;
- infoView2_DateInfo_PreClickButton.Enable = false;
- }
- if (waterQueryDate.Year == DateTime.Now.Year && waterQueryDate.Month == DateTime.Now.Month && waterQueryDate.Day == DateTime.Now.Day - 1)
- {
- infoView2_DateInfo_NextIconButton.Visible = true;
- infoView2_DateInfo_NextClickButton.Enable = true;
- }
- }
- else if (waterQueryType == QueryType.custom_month)
- {
- waterQueryDate = waterQueryDate.AddMonths(-1);
- if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1)
- {
- infoView2_DateInfo_PreIconButton.Visible = false;
- infoView2_DateInfo_PreClickButton.Enable = false;
- }
- if (waterQueryDate.Year == DateTime.Now.Year && waterQueryDate.Month == DateTime.Now.Month - 1)
- {
- infoView2_DateInfo_NextIconButton.Visible = true;
- infoView2_DateInfo_NextClickButton.Enable = true;
- }
- }
- else if (waterQueryType == QueryType.custom_year)
- {
- waterQueryDate = waterQueryDate.AddYears(-1);
- if (waterQueryDate.Year == 2023)
- {
- infoView2_DateInfo_PreIconButton.Visible = false;
- infoView2_DateInfo_PreClickButton.Enable = false;
- }
- if (waterQueryDate.Year == DateTime.Now.Year - 1)
- {
- infoView2_DateInfo_NextIconButton.Visible = true;
- infoView2_DateInfo_NextClickButton.Enable = true;
- }
- }
- waterQueryTime_Year = waterQueryDate.Year;
- waterQueryTime_Month = waterQueryDate.Month;
- waterQueryTime_Day = waterQueryDate.Day;
- infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM-dd");
- getWaterHistory();
- };
- infoView2_DateInfo_NextIconButton.Visible = false;
- infoView2_DateInfo_NextClickButton.Enable = false;
- infoView2_DateInfo_NextClickButton.MouseUpEventHandler = (sender, e) => {
- var waterQueryDate = new DateTime(waterQueryTime_Year, waterQueryTime_Month, waterQueryTime_Day);
- if (waterQueryType == QueryType.day_hour)
- {
- waterQueryDate = waterQueryDate.AddDays(1);
- if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 1 && waterQueryDate.Day == 2)
- {
- infoView2_DateInfo_PreIconButton.Visible = true;
- infoView2_DateInfo_PreClickButton.Enable = true;
- }
- if (waterQueryDate.Year == DateTime.Now.Year && waterQueryDate.Month == DateTime.Now.Month && waterQueryDate.Day == DateTime.Now.Day)
- {
- infoView2_DateInfo_NextIconButton.Visible = false;
- infoView2_DateInfo_NextClickButton.Enable = false;
- }
- }
- else if (waterQueryType == QueryType.custom_month)
- {
- waterQueryDate = waterQueryDate.AddMonths(1);
- if (waterQueryDate.Year == 2023 && waterQueryDate.Month == 2)
- {
- infoView2_DateInfo_PreIconButton.Visible = true;
- infoView2_DateInfo_PreClickButton.Enable = true;
- }
- if (waterQueryDate.Year == DateTime.Now.Year && waterQueryDate.Month == DateTime.Now.Month)
- {
- infoView2_DateInfo_NextIconButton.Visible = false;
- infoView2_DateInfo_NextClickButton.Enable = false;
- }
- }
- else if (waterQueryType == QueryType.custom_year)
- {
- waterQueryDate = waterQueryDate.AddYears(1);
- if (waterQueryDate.Year == 2023)
- {
- infoView2_DateInfo_PreIconButton.Visible = false;
- infoView2_DateInfo_PreClickButton.Enable = false;
- }
- if (waterQueryDate.Year == DateTime.Now.Year)
- {
- infoView2_DateInfo_NextIconButton.Visible = false;
- infoView2_DateInfo_NextClickButton.Enable = false;
- }
- }
- waterQueryTime_Year = waterQueryDate.Year;
- waterQueryTime_Month = waterQueryDate.Month;
- waterQueryTime_Day = waterQueryDate.Day;
- infoView2_DateInfo_DateTextButton.Text = waterQueryDate.ToString("yyyy-MM-dd");
- 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>
@@ -936,7 +918,7 @@
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)
@@ -1031,6 +1013,19 @@
};
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),
@@ -1040,8 +1035,8 @@
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();
@@ -1056,97 +1051,118 @@
};
uIPickerView.OnSelectChangeEvent = (int1, int2, int3) =>
{
- if (pickerItems_Year[int1] != item1.ToString())
+ try
{
- int.TryParse(pickerItems_Year[int1], out item1);
- if (tempQueryType == QueryType.custom_month || tempQueryType == QueryType.day_hour)
+ if (int1 < 0)
{
- pickerItems_Month = new List<string>();
- if (item1 == 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 (item1 == DateTime.Now.Year && item2 == 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(item1, item2); i++)
- {
- pickerItems_Day.Add(i.ToString());
- }
- }
- }
+ int1 = 1;
}
- 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()));
-
- }
- if (pickerItems_Month != null)
- {
- if (pickerItems_Month[int2] != item2.ToString())
+ if (pickerItems_Year[int1] != item1.ToString())
{
- int.TryParse(pickerItems_Month[int2], out item2);
- if (tempQueryType == QueryType.day_hour)
+ int.TryParse(pickerItems_Year[int1], out item1);
+ if (tempQueryType == QueryType.custom_month || tempQueryType == QueryType.day_hour)
{
- pickerItems_Day = new List<string>();
- if (item1 == DateTime.Now.Year && item2 == DateTime.Now.Month)
+ pickerItems_Month = new List<string>();
+ if (item1 == DateTime.Now.Year)
{
- int addDay = 0;
- while (DateTime.Now.Day > addDay)
+ int addMonth = 0;
+ while (DateTime.Now.Month > addMonth)
{
- addDay++;
- pickerItems_Day.Add(addDay.ToString());
+ addMonth++;
+ pickerItems_Month.Add(addMonth.ToString());
}
}
else
{
- for (var i = 1; i <= DateTime.DaysInMonth(item1, item2); i++)
+ for (var i = 1; i < 13; i++)
{
- pickerItems_Day.Add(i.ToString());
+ pickerItems_Month.Add(i.ToString());
+ }
+ }
+ if (tempQueryType == QueryType.day_hour)
+ {
+ pickerItems_Day = new List<string>();
+ if (item1 == DateTime.Now.Year && item2 == 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(item1, item2); i++)
+ {
+ pickerItems_Day.Add(i.ToString());
+ }
}
}
}
-
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()));
+
+ }
+ if (pickerItems_Month != null)
+ {
+ if (int2 >= pickerItems_Month.Count || int2 < 0)
+ {
+ int2 = 0;
+ }
+ if (pickerItems_Month[int2] != item2.ToString())
+ {
+ int.TryParse(pickerItems_Month[int2], out item2);
+ if (tempQueryType == QueryType.day_hour)
+ {
+ pickerItems_Day = new List<string>();
+ if (item1 == DateTime.Now.Year && item2 == 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(item1, item2); i++)
+ {
+ pickerItems_Day.Add(i.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 || int3 < 0)
+ {
+ int3 = 0;
+ }
+ if (pickerItems_Day[int3] != item3.ToString())
+ {
+ int.TryParse(pickerItems_Day[int3], out item3);
+ }
}
}
- if (pickerItems_Day != null)
+ catch (Exception ex)
{
- if (int3 >= pickerItems_Day.Count)
- {
- int3 = 0;
- }
- if (pickerItems_Day[int3] != item3.ToString())
- {
- int.TryParse(pickerItems_Day[int3], out item3);
- }
+ MainPage.Log("Error", $"閲戣寕鐑按鍣ㄦ棩鏈熼�夋嫨寮傚父锛歿ex.StackTrace}");
}
};
btnConfrim.MouseUpEventHandler = (sender, e) =>
@@ -1160,7 +1176,7 @@
{
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)
@@ -1173,6 +1189,48 @@
getTempHistory();
};
+
+ if (tempQueryType == QueryType.day_hour)
+ {
+ try
+ {
+ btnToday.Visible = btnToday.Enable = true;
+ btnToday.MouseUpEventHandler = (sender, e) =>
+ {
+ item3 = tempQueryTime_Day = DateTime.Now.Day;
+ item2 = tempQueryTime_Month = DateTime.Now.Month;
+ item1 = tempQueryTime_Year = DateTime.Now.Year;
+
+ 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());
+ }
+
+ pickerItems_Month = new List<string>();
+ int addMonth = 0;
+ while (DateTime.Now.Month > addMonth)
+ {
+ addMonth++;
+ pickerItems_Month.Add(addMonth.ToString());
+ }
+ pickerItems_Day = new List<string>();
+ int addDay = 0;
+ while (DateTime.Now.Day > addDay)
+ {
+ addDay++;
+ pickerItems_Day.Add(addDay.ToString());
+ }
+
+ 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()
@@ -1311,97 +1369,112 @@
};
uIPickerView.OnSelectChangeEvent = (int1, int2, int3) =>
{
- if (pickerItems_Year[int1] != item1.ToString())
+ try
{
- int.TryParse(pickerItems_Year[int1], out item1);
- if (waterQueryType == QueryType.custom_month || waterQueryType == QueryType.day_hour)
+ if (int1 < 0)
{
- pickerItems_Month = new List<string>();
- if (item1 == 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 (item1 == DateTime.Now.Year && item2 == 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(item1, item2); i++)
- {
- pickerItems_Day.Add(i.ToString());
- }
- }
- }
+ int1 = 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()));
-
- }
- if (pickerItems_Month != null)
- {
- if (pickerItems_Month[int2] != item2.ToString())
+ if (pickerItems_Year[int1] != item1.ToString())
{
- int.TryParse(pickerItems_Month[int2], out item2);
- if (waterQueryType == QueryType.day_hour)
+ int.TryParse(pickerItems_Year[int1], out item1);
+ if (waterQueryType == QueryType.custom_month || waterQueryType == QueryType.day_hour)
{
- pickerItems_Day = new List<string>();
- if (item1 == DateTime.Now.Year && item2 == DateTime.Now.Month)
+ pickerItems_Month = new List<string>();
+ if (item1 == DateTime.Now.Year)
{
- int addDay = 0;
- while (DateTime.Now.Day > addDay)
+ int addMonth = 0;
+ while (DateTime.Now.Month > addMonth)
{
- addDay++;
- pickerItems_Day.Add(addDay.ToString());
+ addMonth++;
+ pickerItems_Month.Add(addMonth.ToString());
}
}
else
{
- for (var i = 1; i <= DateTime.DaysInMonth(item1, item2); i++)
+ for (var i = 1; i < 13; i++)
{
- pickerItems_Day.Add(i.ToString());
+ pickerItems_Month.Add(i.ToString());
+ }
+ }
+ if (waterQueryType == QueryType.day_hour)
+ {
+ pickerItems_Day = new List<string>();
+ if (item1 == DateTime.Now.Year && item2 == 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(item1, item2); i++)
+ {
+ pickerItems_Day.Add(i.ToString());
+ }
}
}
}
-
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()));
+
+ }
+ if (pickerItems_Month != null)
+ {
+ if (int2 > pickerItems_Month.Count || int2 < 0)
+ {
+ int2 = 0;
+ }
+ if (pickerItems_Month[int2] != item2.ToString())
+ {
+ int.TryParse(pickerItems_Month[int2], out item2);
+ if (waterQueryType == QueryType.day_hour)
+ {
+ pickerItems_Day = new List<string>();
+ if (item1 == DateTime.Now.Year && item2 == 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(item1, item2); i++)
+ {
+ pickerItems_Day.Add(i.ToString());
+ }
+ }
+ }
+
+ 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()));
+ }
+ }
+ if (pickerItems_Day != null)
+ {
+ if (int3 >= pickerItems_Day.Count || int3 < 0)
+ {
+ int3 = 0;
+ }
+ if (pickerItems_Day[int3] != item3.ToString())
+ {
+ int.TryParse(pickerItems_Day[int3], out item3);
+ }
}
}
- if (pickerItems_Day != null)
+ catch (Exception ex)
{
- if (int3 >= pickerItems_Day.Count)
- {
- int3 = 0;
- }
- if (pickerItems_Day[int3] != item3.ToString())
- {
- int.TryParse(pickerItems_Day[int3], out item3);
- }
+ MainPage.Log("Error", $"閲戣寕鐑按鍣ㄦ棩鏈�2閫夋嫨寮傚父锛歿ex.StackTrace}");
}
};
btnConfrim.MouseUpEventHandler = (sender, e) =>
@@ -1415,7 +1488,7 @@
{
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)
@@ -1427,6 +1500,60 @@
}
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) =>
+ {
+ item3 = waterQueryTime_Day = DateTime.Now.Day;
+ item2 = waterQueryTime_Month = DateTime.Now.Month;
+ item1 = waterQueryTime_Year = DateTime.Now.Year;
+
+ 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());
+ }
+ pickerItems_Month = new List<string>();
+ int addMonth = 0;
+ while (DateTime.Now.Month > addMonth)
+ {
+ addMonth++;
+ pickerItems_Month.Add(addMonth.ToString());
+ }
+ pickerItems_Day = new List<string>();
+ int addDay = 0;
+ while (DateTime.Now.Day > addDay)
+ {
+ addDay++;
+ pickerItems_Day.Add(addDay.ToString());
+ }
+
+ 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 { }
+ }
}
@@ -1462,5 +1589,4 @@
/// </summary>
custom_year,
}
-}
-
+}
\ No newline at end of file
--
Gitblit v1.8.0