From bb76b9da3c856292499e2913280fa2ee43337161 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 03 八月 2022 11:48:57 +0800
Subject: [PATCH] 场景图片oss地址
---
HDL_ON/Entity/Function/Scene.cs | 158 ++++++++++++++++++++++++++++++++++++++++++++--------
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacControlPage.cs | 8 +-
2 files changed, 138 insertions(+), 28 deletions(-)
diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs
index e5abff0..a7ac909 100644
--- a/HDL_ON/Entity/Function/Scene.cs
+++ b/HDL_ON/Entity/Function/Scene.cs
@@ -14,7 +14,7 @@
{
get
{
- if(_ScenePack == null)
+ if (_ScenePack == null)
{
_ScenePack = new SceneApiPack();
}
@@ -24,7 +24,7 @@
}
- public class Scene
+ public class Scene
{
public Scene()
{
@@ -50,10 +50,6 @@
/// 缃戝叧ID
/// </summary>
public string gatewayId = "";
- /// <summary>
- /// 浜戠oss瀛樺偍鍥剧墖鐨勮矾寰�
- /// </summary>
- public string image = "";
/// <summary>
/// 鎵�灞炴埧闂村垪琛�
/// </summary>
@@ -96,6 +92,11 @@
/// </summary>
public string userId = UserInfo.Current.ID;
+ /// <summary>
+ /// 浜戠oss瀛樺偍鍥剧墖鐨勮矾寰�
+ /// </summary>
+ public string image = "";
+
///// <summary>
///// 鍦烘櫙鑳屾櫙
///// </summary>
@@ -103,21 +104,105 @@
{
get
{
- if (string.IsNullOrEmpty(image))
+ //if (string.IsNullOrEmpty(image))
+ //{
+ // return "Intelligence/Gallery/scenebg1.png";
+ //}
+ //else
+ //{
+ // return image;
+ //}
+
+ if (image.Contains("Intelligence/Gallery/scenebg"))
{
- return "Intelligence/Gallery/scenebg1.png";
+ return image;
}
else
{
- return image;
+ var sceneImageInfo = OssSceneImages.Find((obj) => obj.defaultIconName == image);
+ if (sceneImageInfo != null)
+ {
+ return sceneImageInfo.defaultIconName;
+ }
+ else
+ {
+ return "Intelligence/Gallery/scenebg1.png";
+ }
}
}
set
{
- image = value;
+ var sceneImageInfo = OssSceneImages.Find((obj) => "Intelligence/Gallery/" + obj.defaultIconName + ".png" == value);
+ if (sceneImageInfo != null)
+ {
+ image = sceneImageInfo.defaultIconUrl;
+ }
+ else
+ {
+ image = value;
+ }
}
}
-
+
+ /// <summary>
+ /// 浜戠鍦烘櫙榛樿鍥惧簱鏁版嵁
+ /// 2022-08-03 10:57:31 wxr
+ /// 閰嶅悎璞嗚眴淇敼浜戠鏁版嵁
+ /// 璋冭瘯瀹濄�乷n pro鍜屽钩鍙板搴�
+ /// </summary>
+ public List<SceneImageInfo> OssSceneImages = new List<SceneImageInfo>()
+ {
+ new SceneImageInfo
+ {
+ defaultIconName = "scenebg1",
+ defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/781c397f-611a-48a2-a3ed-2520ffb971bb.png"
+ },
+ new SceneImageInfo
+ {
+ defaultIconName = "scenebg2",
+ defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/be2a7c63-a6c0-427a-bb6d-f5c06f5b2f05.png"
+ },
+ new SceneImageInfo
+ {
+ defaultIconName = "scenebg3",
+ defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/5d801aca-03fb-4ef3-88ec-75ade3aa1c94.png"
+ },
+ new SceneImageInfo
+ {
+ defaultIconName = "scenebg4",
+ defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/a205306c-4fcd-4ea1-8e88-e84282dc0d54.png"
+ },
+ new SceneImageInfo
+ {
+ defaultIconName = "scenebg5",
+ defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/93a0acdc-14be-4776-a9fd-e0fc6f13c909.png"
+ },
+ new SceneImageInfo
+ {
+ defaultIconName = "scenebg6",
+ defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/45074923-2227-422a-be33-e37e6c3f9d23.png"
+ },
+ new SceneImageInfo
+ {
+ defaultIconName = "scenebg7",
+ defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/28b3e459-041e-4ea1-9ff9-57053c5357f4.png"
+ },
+ new SceneImageInfo
+ {
+ defaultIconName = "scenebg8",
+ defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/d470b979-cc06-4701-a2bd-7301856c9195.png"
+ },
+ new SceneImageInfo
+ {
+ defaultIconName = "scenebg9",
+ defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/1a130d03-86b2-4174-b986-6f6c312a959f.png"
+ },
+ new SceneImageInfo
+ {
+ defaultIconName = "scenebg10",
+ defaultIconUrl = "http://hdl-hz-prod.oss-cn-hangzhou.aliyuncs.com/20/2022/07/54c1c7ab-9b63-4487-a77d-d5d3dadd9801.png"
+ }
+ };
/// <summary>
/// 鍦烘櫙鍔熻兘鍒楄〃
@@ -205,7 +290,7 @@
}
roomNameList += findRoom.floorName + findRoom.roomName;
}
- if (roomNameList == "" )
+ if (roomNameList == "")
{
roomNameList = Shared.Language.StringByID(StringId.WholeZone);
}
@@ -330,7 +415,7 @@
{
//閲嶇疆鎵ц鍊掕鏃�
this.countdownTime = 0;
- if(MainPage.NoLoginMode)
+ if (MainPage.NoLoginMode)
{
var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd);
@@ -351,7 +436,7 @@
/// </summary>
public string UpdateScene()
{
- if(MainPage.NoLoginMode)
+ if (MainPage.NoLoginMode)
{
var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd);
@@ -380,8 +465,8 @@
public string GetDelayText()
{
var delayInt = 0;
- int.TryParse(delay,out delayInt);
- if(delayInt == 0)
+ int.TryParse(delay, out delayInt);
+ if (delayInt == 0)
{
return Language.StringByID(StringId.NoDelay);
}
@@ -389,7 +474,8 @@
if (delayInt > 60)
{
text = (delayInt / 60) + Language.StringByID(StringId.m) + (delayInt % 60) + Language.StringByID(StringId.s);
- }else
+ }
+ else
{
text = delayInt + Language.StringByID(StringId.s);
}
@@ -513,17 +599,17 @@
sceneFunctionInfo += perState.value + "%" + " ";
}
var cctState = status.Find((obj) => obj.key == FunctionAttributeKey.CCT);
- if(cctState != null)
+ if (cctState != null)
{
sceneFunctionInfo += cctState.value + "K" + " ";
}
var rgbState = status.Find((obj) => obj.key == FunctionAttributeKey.RGB);
- if(rgbState!=null)
+ if (rgbState != null)
{
//sceneFunctionInfo += new cctState.value + "%" + " ";
}
-
+
var perAngle = status.Find((obj) => obj.key == FunctionAttributeKey.Angle);
if (perAngle != null)
{
@@ -607,7 +693,7 @@
{
var us = "";
var swithchString = key;
- if(!string.IsNullOrEmpty(inputKey))
+ if (!string.IsNullOrEmpty(inputKey))
{
swithchString = inputKey;
}
@@ -639,7 +725,7 @@
public string GetValueText(string temp = "")
{
string catchString = value;
- if(temp!= "")
+ if (temp != "")
{
catchString = temp;
}
@@ -655,7 +741,7 @@
case FunctionAttributeKey.Percent:
case FunctionAttributeKey.Angle:
int outT = 0;
- int.TryParse(catchString,out outT);
+ int.TryParse(catchString, out outT);
if (outT < 0)
catchString = "0";
if (catchString == "")
@@ -759,4 +845,28 @@
public List<string> pushTarget = new List<string>();
}
-}
+ public class SceneImageInfoList
+ {
+ //public Dictionary<string, string> Dic_SceneImages;
+
+ //public SceneImageInfoList()
+ //{
+ // Dic_SceneImages = new Dictionary<string, string>();
+ // foreach(var sceneImage in sceneImages)
+ // {
+ // Dic_SceneImages.Add(sceneImage.defaultIconName, sceneImage.defaultIconUrl);
+ // }
+ //}
+
+
+ }
+
+ public class SceneImageInfo
+ {
+ public string defaultIconName;
+ public string defaultIconUrl;
+
+ }
+
+
+}
\ No newline at end of file
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacControlPage.cs
index 4eb1277..bf223e0 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacControlPage.cs
@@ -129,7 +129,7 @@
{
var btnHumidityIcon = new Button()
{
- X = Application.GetRealWidth(55),
+ X = Application.GetRealWidth(194),
Y = Application.GetRealHeight(101),
Width = Application.GetMinRealAverage(28),
Height = Application.GetMinRealAverage(28),
@@ -138,7 +138,7 @@
FrameWhiteCentet1.AddChidren(btnHumidityIcon);
btnHumidityValues = new TextButton()
{
- X = Application.GetRealWidth(83),
+ X = Application.GetRealWidth(222),
Y = Application.GetRealHeight(96),
Height = Application.GetRealHeight(33),
Width = Application.GetRealWidth(100),
@@ -151,7 +151,7 @@
Button btnTempIcon = new Button()
{
- X = Application.GetRealWidth(194),
+ X = Application.GetRealWidth(55),
Y = Application.GetRealHeight(101),
Width = Application.GetMinRealAverage(28),
Height = Application.GetMinRealAverage(28),
@@ -161,7 +161,7 @@
btnTempValues = new TextButton()
{
- X = Application.GetRealWidth(222),
+ X = Application.GetRealWidth(83),
Y = Application.GetRealHeight(96),
Height = Application.GetRealHeight(33),
Width = Application.GetRealWidth(100),
--
Gitblit v1.8.0