From f16fd06aa226e9f97a27858624d4ea7cf8975d25 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 07 五月 2024 17:24:38 +0800
Subject: [PATCH] 增加了萤石摄像头
---
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 294 ++++++++++++++++++++++++++++++++++------------------------
1 files changed, 170 insertions(+), 124 deletions(-)
diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index 44cf87f..09ed33d 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -11,6 +11,9 @@
namespace HDL_ON.UI
{
+ /// <summary>
+ /// 鍒嗙被鐣岄潰
+ /// </summary>
public partial class ClassificationPage : FrameLayout
{
@@ -85,14 +88,14 @@
#region top
FrameLayout topView = new FrameLayout()
{
- Height = Application.GetRealHeight(64),
+ Height = Application.GetRealHeight(74),
BackgroundColor = CSS_Color.TopViewColor,
};
bodyView.AddChidren(topView);
btnRoomTilte = new Button()
{
- Y = Application.GetRealHeight(30),
+ Y = Application.GetRealHeight(40),
Width = Application.GetRealWidth(170),
Height = Application.GetRealHeight(25),
TextAlignment = TextAlignment.CenterRight,
@@ -107,7 +110,7 @@
btnFuncTitle = new Button()
{
X = Application.GetRealWidth(209),
- Y = Application.GetRealHeight(30),
+ Y = Application.GetRealHeight(40),
Width = Application.GetRealWidth(170),
Height = Application.GetRealHeight(25),
TextAlignment = TextAlignment.CenterLeft,
@@ -121,8 +124,8 @@
contentPageView = new PageLayout()
{
- Y = Application.GetRealHeight(64),
- Height = Application.GetRealHeight(667 - 64 - 49 + 30),
+ Y = Application.GetRealHeight(74),
+ Height = Application.GetRealHeight(667 - 74 - 49 + 30),
BackgroundColor = CSS_Color.MainBackgroundColor,
IsShowPoint = false
};
@@ -358,6 +361,14 @@
//2020-12-03 淇敼鍥剧墖鍔犺浇鏂规硶
ImageUtlis.Current.LoadLocalOrNetworkImages(room.backgroundImage, roomViewbg);
+ var roomViewbgColor = new Button()
+ {
+ Height = Application.GetRealWidth(192),
+ Radius = (uint)Application.GetRealWidth(12),
+ BackgroundColor = 0x19333333,
+ };
+ roomView.AddChidren(roomViewbgColor);
+
var btnFloorAndRoomName = new Button()
{
X = Application.GetRealWidth(16),
@@ -367,7 +378,8 @@
Text = room.floorName + room.roomName,
TextAlignment = TextAlignment.CenterLeft,
TextColor = CSS_Color.MainBackgroundColor,
- TextSize = CSS_FontSize.SubheadingFontSize,
+ TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
+ IsBold = true,
};
roomView.AddChidren(btnFloorAndRoomName);
@@ -451,13 +463,6 @@
//roomView.AddChidren(environmentalView);
#endregion
- var roomViewbgColor = new Button()
- {
- Height = Application.GetRealWidth(192),
- Radius = (uint)Application.GetRealWidth(12),
- BackgroundColor = 0x19333333,
- };
- roomView.AddChidren(roomViewbgColor);
var btnAllClose = new Button()
{
@@ -479,8 +484,7 @@
// BackgroundColor = CSS_Color.MainBackgroundColor,
//};
//roomView.AddChidren(btn);
-
- roomViewbgColor.MouseUpEventHandler += (sender, e) =>
+ EventHandler <MouseEventArgs> roomRowClick = (sender, e) =>
{
Action ReloadRoomName = () =>
{
@@ -505,6 +509,10 @@
view.LoadPage();
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
};
+ roomViewbgColor.MouseUpEventHandler = roomRowClick;
+ btnFloorAndRoomName.MouseUpEventHandler = roomRowClick;
+
+
}
/// <summary>
/// 璁拌浇灏忓浘鎴块棿row
@@ -605,21 +613,35 @@
};
}
-
/// <summary>
/// 鍔犺浇鍔熻兘鍒楄〃鐣岄潰
/// </summary>
- void LoadFunctionPageView()
+ void LoadFunctionPageView ()
{
- #region
functionsPageView = new VerticalScrolViewLayout()
{
BackgroundColor = CSS_Color.BackgroundColor,
Height = Application.GetRealHeight(667 - 64 - 49 + 20),
};
contentPageView.AddChidren(functionsPageView);
+ this.RefreshFunctionView();
- FrameLayout functionContentView;
+ }
+ FrameLayout functionContentView;
+ /// <summary>
+ /// 鏄剧ず鍔熻兘鍒楄〃鐣岄潰
+ /// </summary>
+ void RefreshFunctionView()
+ {
+ #region
+ //functionsPageView = new VerticalScrolViewLayout()
+ //{
+ // BackgroundColor = CSS_Color.BackgroundColor,
+ // Height = Application.GetRealHeight(667 - 64 - 49 + 20),
+ //};
+ //contentPageView.AddChidren(functionsPageView);
+
+ //FrameLayout functionContentView;
functionContentView = new FrameLayout()
{
Y = Application.GetRealHeight(16),
@@ -655,8 +677,11 @@
int functionOnCount = 0;
switch (item)
{
+ case ShowFunction.Series:
+ functionCount = FunctionList.List.GetSeries().Count;
+ break;
case ShowFunction.IpCam:
- functionCount = FunctionList.List.GetIpCamImouList().Count;
+ //functionCount = FunctionList.List.GetIpCamImouList().Count;
break;
case ShowFunction.MechanicalArm:
functionCount = FunctionList.List.GetMechanicalArmList().Count;
@@ -692,8 +717,12 @@
break;
case ShowFunction.Electric:
#region 鐢靛櫒
+
functionCount = FunctionList.List.GetElectricals().Count;
- functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+ functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.spk!=SPK.ElectricalTvHisense&&obj.trait_on_off.curValue.ToString() == "on").Count;
+//#if DEBUG
+// functionCount = 1;
+//#endif
#endregion
break;
case ShowFunction.EnergyMonitoring:
@@ -728,13 +757,22 @@
case ShowFunction.Sensor:
functionCount = FunctionList.List.GetArmSensorList().Count;
break;
+ case ShowFunction.VideoIntercom:
+ if (FunctionList.List.videoIntercom != null && FunctionList.List.videoIntercom.Count > 0)
+ {
+ functionCount = 1;
+ }
+ break;
case ShowFunction.SecurityCenter:
functionCount = FunctionList.List.securities.Count;
- //if (DB_ResidenceData.Instance.GatewayType == 1)
- //{
- // functionCount = 1;
- //}
break;
+ case ShowFunction.Aks:
+ functionCount = FunctionList.List.GetVideoControlsList().Count;
+ functionOnCount = 1;
+ break;
+
+
+
}
if (functionCount == 0)
@@ -788,13 +826,21 @@
};
functionView.AddChidren(btnName);
- if (item != ShowFunction.Environmental && item != ShowFunction.Sensor
- && item != ShowFunction.SecurityMonitoring && item != ShowFunction.FreshAir && item != ShowFunction.Music
- && item != ShowFunction.EnergyMonitoring && item != ShowFunction.SecurityCenter
+ //涓嶉渶瑕佹樉绀鸿澶囧紑鐘舵�佹暟閲�;
+ Button btnFunctionCount=null;
+ if (item != ShowFunction.Aks
+ && item != ShowFunction.Environmental
+ && item != ShowFunction.Sensor
+ && item != ShowFunction.VideoIntercom
+ && item != ShowFunction.SecurityMonitoring
+ && item != ShowFunction.FreshAir
+ && item != ShowFunction.Music
+ && item != ShowFunction.EnergyMonitoring
+ && item != ShowFunction.SecurityCenter
&& item != ShowFunction.IpCam
&& functionCount != 0)
{
- Button btnFunctionCount = new Button()
+ btnFunctionCount = new Button()
{
X = Application.GetRealWidth(17) + Application.GetRealWidth(7 * functionCount.ToString().Length),
Y = btnName.Bottom,
@@ -805,21 +851,29 @@
TextAlignment = TextAlignment.CenterLeft,
Text = "/" + functionCount,
};
- functionView.AddChidren(btnFunctionCount);
- Button btnOpenCount = new Button()
+ if (item == ShowFunction.Series)
{
- X = Application.GetRealWidth(16),
- Y = btnName.Bottom,
- Width = Application.GetRealWidth(14 * functionCount.ToString().Length),
- Height = Application.GetRealHeight(24),
- TextColor = CSS_Color.MainColor,
- TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- TextAlignment = TextAlignment.CenterLeft,
- Text = functionOnCount.ToString(),
- Tag = item + "_onCount",
- BorderWidth = 0,
- };
- functionView.AddChidren(btnOpenCount);
+ btnFunctionCount.Text = functionCount.ToString();
+ }
+ functionView.AddChidren(btnFunctionCount);
+
+ if (item != ShowFunction.Series)
+ {
+ Button btnOpenCount = new Button()
+ {
+ X = Application.GetRealWidth(16),
+ Y = btnName.Bottom,
+ Width = Application.GetRealWidth(14 * functionCount.ToString().Length),
+ Height = Application.GetRealHeight(24),
+ TextColor = CSS_Color.MainColor,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = functionOnCount.ToString(),
+ Tag = item + "_onCount",
+ BorderWidth = 0,
+ };
+ functionView.AddChidren(btnOpenCount);
+ }
}
@@ -834,6 +888,16 @@
int functionPageTitleId = 0;
switch (item)
{
+ case ShowFunction.Series:
+ btnName.TextID = StringId.HorseRaceLamp;
+ functionPageTitleId = StringId.HorseRaceLamp;
+ btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+ var page2 = new UI2.Classification.SeriesFunctionListPage();
+ MainPage.BasePageView.AddChidren(page2);
+ page2.LoadPage();
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ };
+ break;
case ShowFunction.Light:
#region Light
btnName.TextID = StringId.Lights;
@@ -998,13 +1062,15 @@
case ShowFunction.EnergyMonitoring:
#region 鑳芥簮鐩戞祴
btnName.TextID = StringId.EnergyMonitoring;
- btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
- {
- var skipView = new EnergyMainPage();
- MainPage.BasePageView.AddChidren(skipView);
- skipView.LoadPage();
- MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
- };
+ functionPageTitleId = StringId.EnergyMonitoring;
+
+ //btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+ //{
+ // var skipView = new EnergyMainPage();
+ // MainPage.BasePageView.AddChidren(skipView);
+ // skipView.LoadPage();
+ // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ //};
#endregion
break;
case ShowFunction.Environmental:
@@ -1059,14 +1125,21 @@
break;
case ShowFunction.SecurityMonitoring:
btnName.TextID = StringId.EZVIZ;
- btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
- {
+ btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
HDLCommon.Current.Go2EZvizMonitor(bodyView);
};
break;
case ShowFunction.Sensor:
btnName.TextID = StringId.Sensor;
functionPageTitleId = StringId.Sensor;
+ break;
+ case ShowFunction.VideoIntercom://鍙瀵硅
+ btnName.TextID = StringId.VideoIntercom;
+ btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+ {
+ var videoMethod = new UI2.FuntionControlView.Video.VideoMethod();
+ videoMethod.MianView(this);
+ };
break;
case ShowFunction.SecurityCenter:
btnName.TextID = StringId.SecurityCenter;
@@ -1078,98 +1151,59 @@
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
};
break;
+ case ShowFunction.Aks:
+ btnFunctionViewBg.UnSelectedImagePath = "FunctionIcon/FunctionBg/AksFunctionBg.png";
+ //鍩冨厠鏂奖闊充腑鎺�
+ btnName.TextID = StringId.jiatingyingyuan;
+ btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+ {
+ var list = HDL_ON.UI.UI2.FuntionControlView.Aks.AksCommonMethod.Current.GetVideoControlsList();
+ var form = new HDL_ON.UI.UI2.FuntionControlView.Aks.AksListPage(() => {
+ UpdateBottomView();
+ });
+ form.AddForm(list);
+ };
+ break;
}
- //鐣岄潰璺宠浆--闊充箰璺宠浆鑷繁鐨勭晫闈�--鐜璺宠浆鑷繁鐨勭晫闈�
- if (item != ShowFunction.Music && item != ShowFunction.Environmental && item != ShowFunction.SecurityMonitoring && item != ShowFunction.DoorLock
- && ShowFunction.EnergyMonitoring != item && ShowFunction.SecurityCenter != item
- )
+ //鐣岄潰璺宠浆--闊充箰璺宠浆鑷繁鐨勭晫闈�--鐜璺宠浆鑷繁鐨勭晫闈�--(钀ょ煶瑙嗛闂ㄩ攣)璺宠浆鑷繁鐨勭晫闈�--鍩冨厠鏂奖闊充腑鎺�
+ if ( item != ShowFunction.Aks
+ && item != ShowFunction.Music
+ && item != ShowFunction.Environmental
+ && item != ShowFunction.SecurityMonitoring
+ && item != ShowFunction.DoorLock
+ //&& ShowFunction.EnergyMonitoring != item
+ && ShowFunction.VideoIntercom != item
+ && ShowFunction.SecurityCenter != item
+ && ShowFunction.Series != item)
{
btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
{
+
var skipView = new FunctionPage();
MainPage.BasePageView.AddChidren(skipView);
skipView.LoadPage(functionPageTitleId);
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ skipView.DelAction += () =>
+ {
+
+ UpdateBottomView();
+ };
};
}
index++;
}
+
s1View.Height = s2View.Height = functionContentView.Height = functionContentViewHeight + Application.GetRealWidth(40);
- #endregion
+#endregion
}
- void refreshInverterInfo(Button btnPowerTenerationToday, Button btnWorkingMode, Button btnCurrentPowerGeneration)
- {
- new System.Threading.Thread(() =>
- {
- var http = new HttpServerRequest();
- var pack = http.GetInverterStatisticsInfo();
- if (pack != null)
- {
- if(pack.Data == null)
- {
- return;
- }
- var info = JsonConvert.DeserializeObject<StatisticsInfo>(pack.Data?.ToString());
- if (info == null)
- {
- return;
- }
- try
- {
- Application.RunOnMainThread(() =>
- {
- btnPowerTenerationToday.Text = info.totalElectricityPvToday + "kW路h";// Language.StringByID(StringId.PowerTenerationToday).Replace("----", info.totalElectricityPvToday);
- string workModeString = "";
- if (Language.CurrentLanguage == "Chinese") {
- switch (info.workMode)
- {
- case "self_use":
- workModeString = "鑷彂鑷敤";
- break;
- case "peak_load_shifting":
- workModeString = "鍓婂嘲濉胺";
- break;
- case "battery_priority":
- workModeString = "鐢垫睜浼樺厛";
- break;
- }
- }
- else
- {
- switch (info.workMode)
- {
- case "self_use":
- workModeString = "Self Consume";
- break;
- case "peak_load_shifting":
- workModeString = "Peak Shift";
- break;
- case "battery_priority":
- workModeString = "Battery Priority";
- break;
- }
- }
- btnWorkingMode.Text = workModeString;// Language.StringByID(StringId.WorkingMode).Replace("----", workModeString);
- btnCurrentPowerGeneration.Text = info.powerPvNow + "w";// Language.StringByID(StringId.CurrentPowerGeneration).Replace("----", info.powerPvNow);
- //btnBatterySOC.Text = Language.StringByID(StringId.BatterySOC).Replace("--", info.batterySoc);
- });
- }
- catch (Exception ex)
- {
- MainPage.Log($"鑾峰彇瀹跺涵鍏変紡缁熻鏁版嵁寮傚父锛歿ex.Message}");
- }
- }
+
-
- })
- { IsBackground = true }.Start();
- }
#region 鍒囨崲妤煎眰
/// <summary>
@@ -1328,6 +1362,18 @@
{
}
-#endregion
+ #endregion
+
+ /// <summary>
+ /// 鏇存柊搴曢儴鐣岄潰
+ /// </summary>
+ void UpdateBottomView()
+ {
+ Application.RunOnMainThread(() =>
+ {
+ functionContentView?.RemoveFromParent();
+ this.RefreshFunctionView();
+ });
+ }
}
}
--
Gitblit v1.8.0