|
|
using System;
|
using System.Collections.Generic;
|
using HDL_ON.Entity;
|
using HDL_ON.UI.CSS;
|
using Shared;
|
namespace HDL_ON.UI
|
{
|
public class InverterJinmaoHistroyPage : FrameLayout
|
{
|
InverterJinmaoHistroyPage bodyView;
|
Function device;
|
|
|
/// <summary>
|
/// echart容器
|
/// </summary>
|
MyEchartsViewOn tempEchartsView;
|
|
public InverterJinmaoHistroyPage(Function function)
|
{
|
bodyView = this;
|
device = function;
|
}
|
|
public void LoadPage()
|
{
|
var topView = new TopViewDiv(bodyView, "能源分析");
|
topView.maginY = 10;
|
topView.LoadTopView();
|
|
var contentView = new VerticalScrolViewLayout()
|
{
|
Y = Application.GetRealHeight(74 + 16),
|
Height = Application.GetRealHeight(Application.DesignHeight - 74),
|
};
|
bodyView.AddChidren(contentView);
|
|
#region 发电量
|
var infoView1 = new FrameLayout()
|
{
|
Width = Application.GetRealWidth(343),
|
Height = Application.GetRealWidth(382),
|
Gravity = Gravity.CenterHorizontal,
|
BackgroundColor = CSS_Color.MainBackgroundColor,
|
Radius = (uint)Application.GetRealWidth(12),
|
BorderColor = 0x00FFFFFF,
|
BorderWidth = 0,
|
};
|
contentView.AddChidren(infoView1);
|
|
#region 时间条件选择
|
var infoView1_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,
|
};
|
infoView1.AddChidren(infoView1_DateView);
|
|
var infoView1_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,
|
};
|
infoView1_DateView.AddChidren(infoView1_Date_Day);
|
|
|
var infoView1_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,
|
};
|
infoView1_DateView.AddChidren(infoView1_Date_Month);
|
|
|
var infoView1_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,
|
};
|
infoView1_DateView.AddChidren(infoView1_Date_Year);
|
|
var infoView1_DateInfoView = new FrameLayout()
|
{
|
Y = Application.GetRealWidth(43),
|
Height = Application.GetRealWidth(55),
|
};
|
infoView1.AddChidren(infoView1_DateInfoView);
|
|
var infoView1_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",
|
};
|
infoView1_DateInfoView.AddChidren(infoView1_DateInfo_PreIconButton);
|
|
var infoView1_DateInfo_PreClickButton = new Button()
|
{
|
Width = Application.GetRealWidth(32 + 6),
|
};
|
infoView1_DateInfoView.AddChidren(infoView1_DateInfo_PreClickButton);
|
|
var infoView1_DateInfo_DateTextButton = new Button()
|
{
|
Gravity = Gravity.Center,
|
Width = Application.GetRealWidth(200),
|
TextAlignment = TextAlignment.Center,
|
Text = "2024-8-12",
|
TextColor = CSS_Color.FirstLevelTitleColor,
|
IsBold = true,
|
TextSize = 16,
|
};
|
infoView1_DateInfoView.AddChidren(infoView1_DateInfo_DateTextButton);
|
|
|
var infoView1_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",
|
};
|
infoView1_DateInfoView.AddChidren(infoView1_DateInfo_NextIconButton);
|
|
var infoView1_DateInfo_NextClickButton = new Button()
|
{
|
Width = Application.GetRealWidth(32 + 6),
|
};
|
infoView1_DateInfoView.AddChidren(infoView1_DateInfo_NextClickButton);
|
|
#endregion
|
|
#region 数据图表
|
MyEchartsViewOn infoView1_EchartsView = new MyEchartsViewOn()
|
{
|
Y = Application.GetRealWidth(101),
|
Height = Application.GetRealWidth(246),
|
};
|
infoView1.AddChidren(infoView1_EchartsView);
|
|
var echartOption = new EchartsOption_Histogram();
|
echartOption.xTitle = "时间";
|
echartOption.yTitle = "温度(℃)";
|
echartOption.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"
|
});
|
echartOption.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 = echartOption.InitOption();
|
infoView1_EchartsView.ShowWithOption(ddd);
|
|
infoView1.AddChidren(new Button()
|
{
|
Height = Application.GetRealWidth(35),
|
Y = Application.GetRealWidth(340),
|
Text = "发电量",
|
TextSize = 14,
|
TextAlignment = TextAlignment.Center,
|
TextColor = 0xFFC0C7D4
|
});
|
|
#endregion
|
|
#endregion
|
|
contentView.AddChidren(new Button()
|
{
|
Height = Application.GetRealWidth(16)
|
});
|
|
#region 用电量
|
var 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);
|
|
#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);
|
|
var 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);
|
|
|
var 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);
|
|
|
var 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_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);
|
|
var infoView2_DateInfo_PreClickButton = new Button()
|
{
|
Width = Application.GetRealWidth(32 + 6),
|
};
|
infoView2_DateInfoView.AddChidren(infoView2_DateInfo_PreClickButton);
|
|
var infoView2_DateInfo_DateTextButton = new Button()
|
{
|
Gravity = Gravity.Center,
|
Width = Application.GetRealWidth(200),
|
TextAlignment = TextAlignment.Center,
|
Text = "2024-8-12",
|
TextColor = CSS_Color.FirstLevelTitleColor,
|
IsBold = true,
|
TextSize = 16,
|
};
|
infoView2_DateInfoView.AddChidren(infoView2_DateInfo_DateTextButton);
|
|
|
var 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);
|
|
var infoView2_DateInfo_NextClickButton = new Button()
|
{
|
Width = Application.GetRealWidth(32 + 6),
|
};
|
infoView2_DateInfoView.AddChidren(infoView2_DateInfo_NextClickButton);
|
|
#endregion
|
|
#region 数据图表
|
MyEchartsViewOn infoView2_EchartsView = new MyEchartsViewOn()
|
{
|
Y = Application.GetRealWidth(101),
|
Height = Application.GetRealWidth(246),
|
};
|
infoView2.AddChidren(infoView2_EchartsView);
|
|
var echartOption2 = new EchartsOption_Histogram();
|
echartOption2.xTitle = "时间";
|
echartOption2.yTitle = "温度(℃)";
|
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
|
});
|
|
#endregion
|
|
|
#endregion
|
|
|
contentView.AddChidren(new Button()
|
{
|
Height = Application.GetRealWidth(26)
|
});
|
}
|
|
}
|
}
|