From b2f2494386c4629cf0e0f0a3740e7672919d53a2 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 06 一月 2021 17:09:55 +0800
Subject: [PATCH] 修改了彩灯的百分比计算
---
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs | 83 ++++++++++++++++++++++++++++++++++-------
1 files changed, 69 insertions(+), 14 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
index 5da1d10..caaab50 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
@@ -37,47 +37,95 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
- var listDevice = Common.LocalDevice.Current.GetDevicesByMac(i_deviceMac);
+ var listDevice = Common.LocalDevice.Current.GetDevicesByMac(i_deviceMac);
+ var oTADevice = Common.LocalDevice.Current.GetOTADevice(i_deviceMac);
+ if (listDevice.Count == 0)
+ {
+ //閽堝鍗曠函鍙湁涓�涓�200绔偣鐨勮澶�
+ listDevice.Add(oTADevice);
+ }
- var listView = new FrameListControl(12);
+ var listView = new VerticalListControl(12);
listView.BackgroundColor = UserCenterColor.Current.White;
- listView.Height = Application.GetRealHeight(876);
+ listView.Height = bodyFrameLayout.Height;
bodyFrameLayout.AddChidren(listView);
//璁惧鍚嶇О
+ var myInfoType = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
var rowName = new FrameRowControl(listView.rowSpace / 2);
rowName.UseClickStatu = false;
listView.AddChidren(rowName);
- rowName.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uDeviceName), 300);
- rowName.AddMostRightView(Common.LocalDevice.Current.GetDeviceObjectText(listDevice), 600);
+ rowName.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uDeviceName), 400);
+ if (Common.LocalDevice.Current.IsMiniLight(listDevice[0]) == true)
+ {
+ //mini澶滅伅
+ rowName.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uMiniNightLight), 600);
+ }
+ else
+ {
+ rowName.AddMostRightView(myInfoType.ConcreteText, 600);
+ }
rowName.AddBottomLine();
//璁惧鍨嬪彿
+ string strModel = listDevice[0].DriveCode > 0 ? Language.StringByID(R.MyInternationalizationString.uVirtualDriveDevice) : listDevice[0].ModelIdentifier;
+ if (strModel == string.Empty)
+ {
+ //鏃犳硶璇嗗埆
+ strModel = Language.StringByID(R.MyInternationalizationString.uUnDistinguish);
+ }
var rowType = new FrameRowControl(listView.rowSpace / 2);
rowType.UseClickStatu = false;
listView.AddChidren(rowType);
- rowType.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uModelIdentifier), 300);
- rowType.AddMostRightView(listDevice[0].ModelIdentifier, 600);
+ rowType.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uModelIdentifier), 400);
+ rowType.AddMostRightView(strModel, 600);
rowType.AddBottomLine();
- //鍥轰欢鐗堟湰
- var oTADevice = Common.LocalDevice.Current.GetOTADevice(listDevice[0].DeviceAddr);
+ //闀滃儚ID
+ var otaDevice = Common.LocalDevice.Current.GetOTADevice(listDevice[0].DeviceAddr);
+ if (otaDevice != null)
+ {
+ var rowImage = new FrameRowControl(listView.rowSpace / 2);
+ rowImage.UseClickStatu = false;
+ listView.AddChidren(rowImage);
+ rowImage.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uImageId), 400);
+ rowImage.AddMostRightView(otaDevice.ImgTypeId.ToString(), 400);
+ rowImage.AddBottomLine();
+ }
+
if (oTADevice != null)
{
+ //鍥轰欢鐗堟湰
var rowVersion = new FrameRowControl(listView.rowSpace / 2);
rowVersion.UseClickStatu = false;
listView.AddChidren(rowVersion);
- rowVersion.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFirmwareVersion), 300);
+ rowVersion.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFirmwareVersion), 400);
rowVersion.AddMostRightView(Common.LocalDevice.Current.AppendVersion(oTADevice.ImgVersion), 600);
rowVersion.AddBottomLine();
+
+ //纭欢鐗堟湰
+ var rowHard = new FrameRowControl(listView.rowSpace / 2);
+ rowHard.UseClickStatu = false;
+ listView.AddChidren(rowHard);
+ rowHard.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uHardwareVersion), 400);
+ rowHard.AddMostRightView(oTADevice.HwVersion.ToString(), 600);
+ rowHard.AddBottomLine();
}
//搴忓垪鍙�
var rowSerial = new FrameRowControl(listView.rowSpace / 2);
rowSerial.UseClickStatu = false;
listView.AddChidren(rowSerial);
- rowSerial.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSerialNumber), 300);
- rowSerial.AddMostRightView(listDevice[0].SerialNumber != string.Empty ? listDevice[0].SerialNumber : listDevice[0].DeviceAddr, 600);
+ rowSerial.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSerialNumber), 400);
+ if (Common.LocalDevice.Current.IsHdlDevice(listDevice[0]) == false)
+ {
+ //绗笁鏂硅澶囧浐瀹氫娇鐢∕ac
+ rowSerial.AddMostRightView(listDevice[0].DeviceAddr, 600);
+ }
+ else
+ {
+ rowSerial.AddMostRightView(listDevice[0].SerialNumber != string.Empty ? listDevice[0].SerialNumber : listDevice[0].DeviceAddr, 600);
+ }
rowSerial.AddBottomLine();
//MAC
@@ -89,11 +137,18 @@
rowMac.AddBottomLine();
//鍒堕�犲晢
+ string strProtuct = listDevice[0].ManufacturerName;
+ if (listDevice[0].DriveCode > 0 || Common.LocalDevice.Current.IsHdlDevice(listDevice[0]) == true)
+ {
+ strProtuct = "骞垮窞娌充笢绉戞妧鏈夐檺鍏徃";
+ }
var rowProtuct = new FrameRowControl(listView.rowSpace / 2);
rowProtuct.UseClickStatu = false;
listView.AddChidren(rowProtuct);
- rowProtuct.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uManufacturerName), 300);
- rowProtuct.AddMostRightView(listDevice[0].ManufacturerName, 600);
+ rowProtuct.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uManufacturerName), 600);
+ rowProtuct.AddMostRightView(strProtuct, 600);
+
+ listView.AdjustRealHeight(Application.GetRealHeight(23));
}
#endregion
--
Gitblit v1.8.0