.vs/HDL_APP_Project/xs/sqlite3/storage.ideBinary files differ
.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shmBinary files differ
.vs/HDL_APP_Project/xs/sqlite3/storage.ide-walBinary files differ
HDL-ON_Android/Assets/.DS_StoreBinary files differ
HDL-ON_Android/Assets/Language.ini
@@ -495,6 +495,13 @@ 7059=制热 7060=自动 7061=除湿 7062=温度 7063=风速 7064=白天 7065=夜晚 7066=离开 7067=一般 7068=时间 HDL-ON_iOS/Resources/Language.ini
@@ -495,6 +495,18 @@ 7054=暂停 7055=亮度 7056=百分比 7057=模式 7058=制冷 7059=制热 7060=自动 7061=除湿 7062=温度 7063=风速 7064=白天 7065=夜晚 7066=离开 7067=一般 7068=时间 9000=请使用新的手机账号登录APP HDL-ON_iOS/Resources/Phone/.DS_StoreBinary files differ
HDL_ON/Common/HDLCommon.cs
@@ -254,6 +254,7 @@ { Shared.Application.RunOnMainThread(() => { //账号在别处登陆,被踢下线 跳转到登录页面 new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show(); //2020-12-04 待增加退出登录操作 @@ -282,6 +283,7 @@ /// </summary> public void Logout() { return; try { //未登录不用处理 HDL_ON/Common/R.cs
@@ -494,8 +494,16 @@ public const int heatingLogic = 7059; public const int autoLogic = 7060; public const int dehumidifyLogic = 7061; public const int temperatureLogic = 7062; public const int speedLogic = 7063; public const int dayMode = 7064; public const int nightMode = 7065; public const int leaveMode = 7066; public const int ordinaryMode = 7067; public const int timeMode = 7068; #region LE新增 /// <summary> HDL_ON/Entity/DB_ResidenceData.cs
@@ -269,9 +269,29 @@ #region 功能数据 static FunctionList _functionList; public static FunctionList functionList { public static FunctionList functionList { get { if (_functionList == null) { _functionList = FunctionList.List; } return _functionList; } set { _functionList = value; } } /// <summary> /// 刷新住宅里面的搜索设备状态 /// </summary> public void RefreshResidenceFunctionStatus() { new Thread(() => { if(_functionList == null) { _functionList = FunctionList.List; HDL_ON/Entity/Enumerative/MyEnum.cs
@@ -65,17 +65,17 @@ /// 色温 /// cct /// </summary> ColorTemperature = 0x0203, ColorTemperature= 0x0203, RGB = 0x0204, Curtain = 0x0301, /// <summary> /// 开合帘 /// </summary> MotorCurtain = 0x0303, MotorCurtain= 0x0303, /// <summary> /// 卷帘 /// </summary> RollingShutter = 0x0304, RollingShutter= 0x0304, AC = 0x0401, FloorHeating = 0x0402, @@ -96,18 +96,9 @@ /// RGBW /// </summary> RGBW = 0x0102, /// <summary> /// CCT灯 /// </summary> CCT = 0x0103, /// <summary> /// 开合帘 /// </summary> TrietexCurtain = 0x0104, /// <summary> /// 卷帘 /// </summary> RollerCurtain = 0x0105, } HDL_ON/Entity/FunctionList.cs
@@ -112,6 +112,11 @@ var functionDataBytes = FileUtils.ReadFile(filePath); var functionDataString = System.Text.Encoding.UTF8.GetString(functionDataBytes); var tempFunction = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(functionDataString); if (tempFunction == null) { FileUtils.DeleteFile(filePath); return; } if (tempFunction.DeleteSign) { //todo 删除云端数据 20201203--App不能删除功能数据 HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
@@ -140,26 +140,26 @@ #endregion #region 执行推送 发送通知 ///上下间隔12像素 viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12) }); ///执行推送iew LogicView.LogicTypeTitleView push = new LogicView.LogicTypeTitleView(); push.frameLayout.Height = Application.GetRealHeight(50); push.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); push.btnText.TextID = StringId.push; push.btnNextIcon.Width = Application.GetMinRealAverage(36); push.btnNextIcon.Height = Application.GetMinRealAverage(36); push.btnNextIcon.X = Application.GetRealWidth(305); push.btnNextIcon.UnSelectedImagePath = "LogicIcon/off.png"; push.btnNextIcon.SelectedImagePath = "LogicIcon/on.png"; viewLayout.AddChidren(push.FLayoutView()); ///发送通知View LogicView.LogicTypeTitleView notification = new LogicView.LogicTypeTitleView(); notification.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight); notification.btnText.TextID = StringId.notification; viewLayout.AddChidren(notification.FLayoutView()); ///上下间隔62像素 viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(62) }); /////上下间隔12像素 //viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12) }); /////执行推送iew //LogicView.LogicTypeTitleView push = new LogicView.LogicTypeTitleView(); //push.frameLayout.Height = Application.GetRealHeight(50); //push.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); //push.btnText.TextID = StringId.push; //push.btnNextIcon.Width = Application.GetMinRealAverage(36); //push.btnNextIcon.Height = Application.GetMinRealAverage(36); //push.btnNextIcon.X = Application.GetRealWidth(305); //push.btnNextIcon.UnSelectedImagePath = "LogicIcon/off.png"; //push.btnNextIcon.SelectedImagePath = "LogicIcon/on.png"; //viewLayout.AddChidren(push.FLayoutView()); /////发送通知View //LogicView.LogicTypeTitleView notification = new LogicView.LogicTypeTitleView(); //notification.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight); //notification.btnText.TextID = StringId.notification; //viewLayout.AddChidren(notification.FLayoutView()); /////上下间隔62像素 //viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(62) }); #endregion #region 保存 @@ -245,6 +245,7 @@ dateTypeView.btnLine.Width = Application.GetRealWidth(303); dateView.frameLayout.AddChidren(dateTypeView.FLayoutView()); dateTypeView.btnClick.Tag = i;//标记类型 switch (i) { case 0: @@ -506,9 +507,9 @@ { Button monTextBtn = new Button { Width = Application.GetMinRealAverage(30), Height = Application.GetMinRealAverage(30), Radius = (uint)Application.GetRealHeight(15), Width = Application.GetRealWidth(30), Height = Application.GetRealWidth(30), Radius = (uint)Application.GetRealWidth(15), Text = i.ToString(), TextSize = LogicView.TextSize.text14, TextColor = CSS.CSS_Color.textColor, HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
@@ -47,7 +47,7 @@ delayView.frameLayout.Y = sceneView.frameLayout.Bottom; delayView.btnText.TextID = StringId.delayLogic; delayView.btnIcon.UnSelectedImagePath = "LogicIcon/delayed.png"; viewLayout.AddChidren(delayView.FLayoutView()); //viewLayout.AddChidren(delayView.FLayoutView()); #endregion #region 所有点击事件 HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -46,12 +46,12 @@ case FunctionType.Dimmer: case FunctionType.RGB: case FunctionType.RGBW: case FunctionType.CCT: case FunctionType.ColorTemperature: case FunctionType.Relay: //窗帘 case FunctionType.Curtain: case FunctionType.RollerCurtain: case FunctionType.TrietexCurtain: case FunctionType.RollingShutter: case FunctionType.MotorCurtain: //空调 case FunctionType.AC: //地热 @@ -166,12 +166,12 @@ case FunctionType.Dimmer: case FunctionType.RGB: case FunctionType.RGBW: case FunctionType.CCT: case FunctionType.ColorTemperature: case FunctionType.Relay: //窗帘 case FunctionType.Curtain: case FunctionType.RollerCurtain: case FunctionType.TrietexCurtain: case FunctionType.RollingShutter: case FunctionType.MotorCurtain: //空调 case FunctionType.AC: //地热 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -67,12 +67,12 @@ case FunctionType.Dimmer: case FunctionType.RGB: case FunctionType.RGBW: case FunctionType.CCT: case FunctionType.ColorTemperature: case FunctionType.Relay: //窗帘 case FunctionType.Curtain: case FunctionType.RollerCurtain: case FunctionType.TrietexCurtain: case FunctionType.RollingShutter: case FunctionType.MotorCurtain: //空调 case FunctionType.AC: //地热 @@ -163,7 +163,7 @@ public static void OutputTarget(FrameLayout thisView, VerticalScrolViewLayout viewLayout) { for (int i = 0; i < Logic.currlogic.output.Count; i++) for (int i = 0; i < Logic.currlogic.output.Count; i++) { Output outputTarget = Logic.currlogic.output[i]; ///各种条件的View @@ -195,9 +195,9 @@ { case FunctionType.Relay: {//开关灯 foreach (var dic in dicList) { string value = dic["value"]; if (value == "on") { @@ -212,39 +212,40 @@ targetView.btnState.Text = stateStr; } break; case FunctionType.RGB: case FunctionType.RGBW: case FunctionType.ColorTemperature: case FunctionType.Dimmer: { bool _if = false; foreach (var dic in dicList) string on_off = GetKeyValue("on_off", dicList); string brightness = GetKeyValue("brightness", dicList); if (on_off != "") { if (dic["key"] == "on_off") if (on_off == "on") { string value = dic["value"]; if (value == "on") { targetView.btnState.Text = Language.StringByID(StringId.onLogic); _if = false; } else { targetView.btnState.Text = Language.StringByID(StringId.offLogic); _if = true; } stateStr = Language.StringByID(StringId.onLogic); } } foreach (var dic in dicList) { if (dic["key"] == "brightness") else { string value = dic["value"]; if (!_if) { targetView.btnState.Text += value; } stateStr = Language.StringByID(StringId.offLogic); } } if (brightness != "") { stateStr += brightness + "%"; } if (on_off != "" && on_off == "off") { targetView.btnState.Text = Language.StringByID(StringId.offLogic); } else { targetView.btnState.Text = stateStr; } } break; case FunctionType.Curtain: @@ -274,6 +275,245 @@ targetView.btnState.Text = stateStr; } break; case FunctionType.MotorCurtain: case FunctionType.RollingShutter: {//开关灯 string on_off = GetKeyValue("on_off", dicList); string brightness = GetKeyValue("brightness", dicList); if (on_off != "") { switch (on_off) { case "on": { stateStr = Language.StringByID(StringId.onLogic); } break; case "off": { stateStr = Language.StringByID(StringId.offLogic); } break; case "stop": { stateStr = Language.StringByID(StringId.stop); } break; } } if (brightness != "") { stateStr += brightness + "%"; } if (on_off != "" && on_off == "stop"|| on_off != "" && on_off == "off") { targetView.btnState.Text = Language.StringByID(StringId.stop); } else { targetView.btnState.Text = stateStr; } } break; case FunctionType.AC: { string on_off = GetKeyValue("on_off", dicList); string set_temp = GetKeyValue("set_temp", dicList); string mode = GetKeyValue("mode", dicList); string fan = GetKeyValue("fan", dicList); if (on_off != "") { switch (on_off) { case "on": { stateStr = Language.StringByID(StringId.onLogic)+";"; } break; case "off": { stateStr = Language.StringByID(StringId.offLogic) + ";"; } break; } } if (set_temp != "") { stateStr += set_temp + "℃;"; } if (mode != "") { switch (mode) { case "cool": { stateStr += Language.StringByID(StringId.coolLogic)+";"; } break; case "heat": { stateStr += Language.StringByID(StringId.heatingLogic) + ";"; } break; case "auto": { stateStr += Language.StringByID(StringId.autoLogic) + ";"; } break; case "dry": { stateStr += Language.StringByID(StringId.dehumidifyLogic) + ";"; } break; } } if (fan != "") { switch (fan) { case "high": { stateStr += Language.StringByID(StringId.HighWindSpeed)+";"; } break; case "medium": { stateStr += Language.StringByID(StringId.MiddleWindSpeed) + ";"; } break; case "low": { stateStr += Language.StringByID(StringId.LowWindSpeed) + ";"; } break; case "auto": { stateStr += Language.StringByID(StringId.Auto) + ";"; } break; } } if (on_off != "" && on_off == "off") { targetView.btnState.Text = Language.StringByID(StringId.offLogic); } else { targetView.btnState.Text = stateStr.TrimEnd(';'); } } break; case FunctionType.FloorHeating: { string on_off = GetKeyValue("on_off", dicList); string set_temp = GetKeyValue("set_temp", dicList); string mode = GetKeyValue("mode", dicList); if (on_off != "") { switch (on_off) { case "on": { stateStr = Language.StringByID(StringId.onLogic) + ";"; } break; case "off": { stateStr = Language.StringByID(StringId.offLogic) + ";"; } break; } } if (set_temp != "") { stateStr += set_temp + "℃;"; } if (mode != "") { switch (mode) { case "day": { stateStr += Language.StringByID(StringId.dayMode)+";"; } break; case "night": { stateStr += Language.StringByID(StringId.nightMode) + ";"; } break; case "away": { stateStr += Language.StringByID(StringId.leaveMode) + ";"; } break; case "normal": { stateStr += Language.StringByID(StringId.ordinaryMode) + ";"; } break; case "timer": { stateStr += Language.StringByID(StringId.timeMode) + ";"; } break; } switch (mode) { case "cool": { stateStr += Language.StringByID(StringId.coolLogic) + ";"; } break; case "heat": { stateStr += Language.StringByID(StringId.heatingLogic) + ";"; } break; case "auto": { stateStr += Language.StringByID(StringId.autoLogic) + ";"; } break; case "dry": { stateStr += Language.StringByID(StringId.dehumidifyLogic) + ";"; } break; } } if (on_off != "" && on_off == "off") { targetView.btnState.Text =Language.StringByID(StringId.offLogic); } else { targetView.btnState.Text = stateStr.TrimEnd(';'); } } break; } } break; @@ -293,7 +533,7 @@ foreach (var dic in dicList) { string value = dic["value"]; targetView.btnText.Text =value; targetView.btnText.Text = value; } } break; @@ -329,7 +569,7 @@ AddTarget addTarget = new AddTarget(); addTarget.Delayed(fLayout, edit, indexVulae); } break; } @@ -343,5 +583,26 @@ } } /// <summary> /// 获取value键值 /// </summary> /// <param name="keyValue"></param> /// <param name="dicList"></param> /// <returns></returns> private static string GetKeyValue(string keyValue, List<Dictionary<string, string>> dicList) { string valueStr = ""; foreach (var dic in dicList) { if (dic["key"] == keyValue) { valueStr = dic["value"]; break; } } return valueStr; } } } HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -22,6 +22,47 @@ { MainPage.BasePageView.RemoveViewByTag("Logic"); } /// <summary> Converts an array of bytes into a formatted string of hex digits (ex: E4 CA B2)</summary> /// <param name="data"> The array of bytes to be translated into a string of hex digits. </param> /// <returns> Returns a well formatted string of hex digits with spacing. </returns> static string byteArrayToHexString(byte[] data) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (byte b in data) { sb.Append(Convert.ToString(b, 16).PadLeft(2, '0')); } return sb.ToString().ToUpper(); } /** * int转byte[] * 该方法将一个int类型的数据转换为byte[]形式,因为int为32bit,而byte为8bit所以在进行类型转换时,知会获取低8位, * 丢弃高24位。通过位移的方式,将32bit的数据转换成4个8bit的数据。注意 &0xff,在这当中,&0xff简单理解为一把剪刀, * 将想要获取的8位数据截取出来。 * @param i 一个int数字 * @return byte[] */ public static byte[] int2ByteArray(int i) { byte[] result = new byte[4]; result[0] = (byte)((i >> 24) & 0xFF); result[1] = (byte)((i >> 16) & 0xFF); result[2] = (byte)((i >> 8) & 0xFF); result[3] = (byte)(i & 0xFF); return result; } /// <summary> /// 获取时间戳 /// </summary> /// <returns></returns> static int getTimeStamp() { TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0); return (int)ts.TotalSeconds; } /// <summary> /// 生成逻辑sid方法 /// </summary> @@ -34,38 +75,28 @@ DateTime dt = DateTime.Now; DateTime startTime = TimeZoneInfo.ConvertTimeToUtc(new DateTime(2020, 1, 1)); long m = (long)((dt - startTime).TotalMilliseconds / 10); string sTimeSpan = "00000000"; string sTimeSpan = byteArrayToHexString(int2ByteArray(getTimeStamp())); byte[] arry = new byte[4]; arry[0] = (byte)(m & 0xFF); arry[1] = (byte)((m & 0xFF00) >> 8); arry[2] = (byte)((m & 0xFF0000) >> 16); arry[3] = (byte)((m >> 24) & 0xFF); sTimeSpan = arry[0].ToString("X2") + arry[1].ToString("X2") + arry[2].ToString("X2") + arry[3].ToString("X2"); if (sTimeSpan.Length > 8) { sTimeSpan = sTimeSpan.Substring(0, 8); } else { sTimeSpan = "00000000"; } logicId = sOidBeginsWith + sTimeSpan; logicId += "0A"; logicId += "0A01"; //0A01 物模型为逻辑, 0001 表示 1 号逻辑功能 int iTopLogicId = 1; logicId += "15"; logicId += "1501"; //1501 物模型为逻辑, 0001 表示 1 号逻辑功能 int maxId = 1; Random random = new Random(); iTopLogicId = random.Next(0, 255); iTopLogicId += random.Next(0, 255); logicId += iTopLogicId.ToString("X4");//逻辑号 两个byte logicId += "1100"; for (int i = 0; i < Logic.LogicList.Count; i++) { string s = Logic.LogicList[i].sid.Substring(20, 4); int iThisSceneId = Convert.ToInt16(s, 16); if (iThisSceneId > maxId) maxId = iThisSceneId ; } logicId += (maxId+1).ToString("X4");//逻辑号 两个byte logicId += "0000"; } catch { @@ -73,53 +104,6 @@ } return logicId; } /// <summary> /// 生成逻辑sid方法 /// </summary> //public static string NewSid() //{ // String sLogicid = ""; // try // { // String sOidBeginsWith = "000101";//厂商 + 通讯方式 // //生成4个byte时间戳 // DateTime dt = DateTime.Now; // long sTimeSp = GateWay.ConvertDateTimeLong(dt); // string sTimeSpan = ""; // GateWay.ConvertIntToByteArray(sTimeSp, ref sTimeSpan); // if (sTimeSpan.Length != 8) return sLogicid; // //间隔10毫秒 错开时间戳 // HDLUDP.TimeBetwnNext(10); // sLogicid = sOidBeginsWith + sTimeSpan; // //1501 物模型为自动化, 0001 表示 1 号自动化功能 // sLogicid += "15"; // sLogicid += "1501"; // //自动化号自增 // int iTopSceneId = 1; // if (myGateway.LogicResponse != null) // { // if (myGateway.LogicResponse.objects != null) // { // for (int i = 0; i < myGateway.LogicResponse.objects.Count; i++) // { // string ccc = myGateway.LogicResponse.objects[i].sid.Substring(myGateway.LogicResponse.objects[i].sid.Length - 8, 4); // int iThisSceneId = Convert.ToInt16(myGateway.LogicResponse.objects[i].sid.Substring(myGateway.LogicResponse.objects[i].sid.Length - 8, 4), 16); // if (iThisSceneId >= iTopSceneId) // iTopSceneId = iThisSceneId + 1; // } // } // } // sLogicid += iTopSceneId.ToString("X4");//场景号 两个byte // //大类小类没有用到 固定为0 // sLogicid += "0000"; // return sLogicid; // } // catch // { // return sLogicid; // } //} /// <summary> /// 封装Dictionary对象 @@ -171,81 +155,7 @@ /// <returns></returns> public static List<HDL_ON.Entity.Function> GetGatewayDeviceList() { List<HDL_ON.Entity.Function> list = new List<Entity.Function>(); for (int i=0;i<10;i++) { HDL_ON.Entity.Function function = new Entity.Function(); switch (i) { case 0: { function.sid = "1234560001212121020182"; function.name ="灯光"; list.Add(function); } break; case 1: { function.sid = "1234560001212121030182"; function.name = "窗帘"; list.Add(function); } break; case 2: { function.sid = "1234560001212121040182"; function.name = "空调"; list.Add(function); } break; case 3: { function.sid = "1234560001212121010282"; function.name = "RGBW"; list.Add(function); } break; case 4: { function.sid = "1234560001212121010382"; function.name = "CCT灯"; list.Add(function); } break; case 5: { function.sid = "1234560001212121010482"; function.name = "开合帘"; list.Add(function); } break; case 6: { function.sid = "1234560001212121010582"; function.name = "卷帘"; list.Add(function); } break; case 7: { function.sid = "1234560001212121040282"; function.name = "地热"; list.Add(function); } break; case 8: { function.sid = "1234560001212121020282"; function.name = "调关"; list.Add(function); } break; case 9: { function.sid = "1234560001212121020482"; function.name = "RGB"; list.Add(function); } break; } } return list; //return HDL_ON.Entity.DB_ResidenceData.functionList.GetAllFunction(); return HDL_ON.Entity.DB_ResidenceData.functionList.GetAllFunction(); } /// <summary> /// 获取网关场景列表 @@ -352,15 +262,15 @@ case FunctionType.Relay: case FunctionType.RGB: case FunctionType.RGBW: case FunctionType.CCT: case FunctionType.ColorTemperature: case FunctionType.Dimmer: { strPath = "LogicIcon/lightloguc.png"; } break; case FunctionType.Curtain: case FunctionType.RollerCurtain: case FunctionType.TrietexCurtain: case FunctionType.RollingShutter: case FunctionType.MotorCurtain: { strPath = "LogicIcon/curtainlogic.png"; } @@ -388,13 +298,13 @@ { List<string> deviceStrTypeList = new List<string>(); deviceStrTypeList.Clear(); var lightjosn = deviceList.Find((device) => device.functionType == FunctionType.Relay || device.functionType == FunctionType.Dimmer|| device.functionType == FunctionType.CCT || device.functionType == FunctionType.RGB|| device.functionType == FunctionType.RGBW); var lightjosn = deviceList.Find((device) => device.functionType == FunctionType.Relay || device.functionType == FunctionType.Dimmer|| device.functionType == FunctionType.ColorTemperature || device.functionType == FunctionType.RGB|| device.functionType == FunctionType.RGBW); if (lightjosn != null) { deviceStrTypeList.Add(Language.StringByID(StringId.Lights)); } var curtainjosn = deviceList.Find((device) => device.functionType ==FunctionType.Curtain|| device.functionType == FunctionType.TrietexCurtain|| device.functionType == FunctionType.RollerCurtain); var curtainjosn = deviceList.Find((device) => device.functionType ==FunctionType.Curtain|| device.functionType == FunctionType.MotorCurtain|| device.functionType == FunctionType.RollingShutter); if (curtainjosn != null) { deviceStrTypeList.Add(Language.StringByID(StringId.Curtain)); @@ -406,7 +316,7 @@ deviceStrTypeList.Add(Language.StringByID(StringId.AC)); } var floorHeating = deviceList.Find((device) => device.functionType == FunctionType.FloorHeating); if (ac != null) if (floorHeating != null) { deviceStrTypeList.Add(Language.StringByID(StringId.FloorHeating)); } @@ -427,13 +337,13 @@ functionTypeList.Add(FunctionType.Dimmer); functionTypeList.Add(FunctionType.RGB); functionTypeList.Add(FunctionType.RGBW); functionTypeList.Add(FunctionType.CCT); functionTypeList.Add(FunctionType.ColorTemperature); } else if (deviceType == Language.StringByID(StringId.Curtain)) { functionTypeList.Add(FunctionType.Curtain); functionTypeList.Add(FunctionType.RollerCurtain); functionTypeList.Add(FunctionType.TrietexCurtain); functionTypeList.Add(FunctionType.RollingShutter); functionTypeList.Add(FunctionType.MotorCurtain); } else if (deviceType == Language.StringByID(StringId.AC)) { @@ -459,10 +369,10 @@ deviceTypeList.Add(FunctionType.RGB); deviceTypeList.Add(FunctionType.RGBW); deviceTypeList.Add(FunctionType.Dimmer); deviceTypeList.Add(FunctionType.CCT); deviceTypeList.Add(FunctionType.ColorTemperature); deviceTypeList.Add(FunctionType.Curtain); deviceTypeList.Add(FunctionType.RollerCurtain); deviceTypeList.Add(FunctionType.TrietexCurtain); deviceTypeList.Add(FunctionType.RollingShutter); deviceTypeList.Add(FunctionType.MotorCurtain); deviceTypeList.Add(FunctionType.AC); deviceTypeList.Add(FunctionType.FloorHeating); } @@ -473,10 +383,10 @@ deviceTypeList.Add(FunctionType.RGB); deviceTypeList.Add(FunctionType.RGBW); deviceTypeList.Add(FunctionType.Dimmer); deviceTypeList.Add(FunctionType.CCT); deviceTypeList.Add(FunctionType.ColorTemperature); deviceTypeList.Add(FunctionType.Curtain); deviceTypeList.Add(FunctionType.RollerCurtain); deviceTypeList.Add(FunctionType.TrietexCurtain); deviceTypeList.Add(FunctionType.RollingShutter); deviceTypeList.Add(FunctionType.MotorCurtain); deviceTypeList.Add(FunctionType.AC); deviceTypeList.Add(FunctionType.FloorHeating); } HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs
@@ -18,7 +18,7 @@ { TextSize = TextSize.text16, TextColor = CSS.CSS_Color.textColor, Width = Application.GetRealWidth(32 + 32), Width = Application.GetRealWidth(32 + 32+200), Height = Application.GetRealHeight(22), Y = Application.GetRealHeight(12), X = Application.GetRealWidth(TextSize.left16), @@ -27,7 +27,7 @@ IsBold = true, }; /// <summary> /// (如果/就执行)的方法 /// View /// </summary> /// <returns></returns> public FrameLayout FLayoutView(int flHeight,int btnY) HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs
@@ -68,8 +68,8 @@ /// </summary> public Button btnNextIcon = new Button { Width = Application.GetMinRealAverage(16), Height = Application.GetMinRealAverage(16), Width = Application.GetRealWidth(16), Height = Application.GetRealWidth(16), UnSelectedImagePath = "LogicIcon/next.png", //Y = Application.GetRealHeight(14), X = Application.GetRealWidth(315), HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/CheckView.cs
@@ -32,8 +32,8 @@ /// </summary> public Button btnCheckIcon = new Button { Width = Application.GetMinRealAverage(28), Height = Application.GetMinRealAverage(28), Width = Application.GetRealWidth(28), Height = Application.GetRealWidth(28), UnSelectedImagePath = "LogicIcon/weekoff.png", SelectedImagePath = "LogicIcon/weekon.png", X = Application.GetRealWidth(303), HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunAllAreaView.cs
@@ -17,8 +17,8 @@ /// </summary> public Button btnIcon1 = new Button { Width = Application.GetMinRealAverage(16), Height = Application.GetMinRealAverage(16), Width = Application.GetRealWidth(16), Height = Application.GetRealWidth(16), Y = Application.GetRealHeight(19), X = Application.GetRealWidth(TextSize.left16), UnSelectedImagePath = "LogicIcon/down.png", @@ -45,8 +45,8 @@ /// </summary> public Button btnIcon2 = new Button { Width = Application.GetMinRealAverage(16), Height = Application.GetMinRealAverage(16), Width = Application.GetRealWidth(16), Height = Application.GetRealWidth(16), Y = Application.GetRealHeight(19), X = Application.GetRealWidth(122), UnSelectedImagePath = "LogicIcon/down.png", HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunTypeView.cs
@@ -47,8 +47,8 @@ /// </summary> public Button btnNextIcon = new Button { Width = Application.GetMinRealAverage(16), Height = Application.GetMinRealAverage(16), Width = Application.GetRealWidth(16), Height = Application.GetRealWidth(16), UnSelectedImagePath = "LogicIcon/next.png", X = Application.GetRealWidth(339), }; HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicAddView.cs
@@ -19,8 +19,8 @@ /// </summary> public Button btnAddIcon= new Button { Width = Application.GetMinRealAverage(20), Height = Application.GetMinRealAverage(20), Width = Application.GetRealWidth(20), Height = Application.GetRealWidth(20), UnSelectedImagePath = "LogicIcon/addconditiontarget.png", Y = Application.GetRealHeight(22), X = Application.GetRealWidth(162), HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicTypeTitleView.cs
@@ -34,8 +34,8 @@ /// </summary> public Button btnNextIcon = new Button { Width = Application.GetMinRealAverage(16), Height = Application.GetMinRealAverage(16), Width = Application.GetRealWidth(16), Height = Application.GetRealWidth(16), UnSelectedImagePath = "LogicIcon/next.png", //Y = Application.GetRealHeight(14), X = Application.GetRealWidth(315), HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SaveView.cs
@@ -17,7 +17,7 @@ }; /// <summary> /// (条件或者目标)文本描述 /// 保存 /// </summary> public Button btnSave= new Button { @@ -30,7 +30,7 @@ TextColor = CSS.CSS_Color.textWhiteColor, TextAlignment = TextAlignment.Center, BackgroundColor= CSS.CSS_Color.btnSaveBackgroundColor, Radius = (uint)Application.GetRealHeight(44), Radius = (uint)Application.GetRealHeight(22), }; public Button btnClick = new Button HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs
@@ -17,8 +17,8 @@ /// </summary> public Button btnIcon = new Button { Width = Application.GetMinRealAverage(28), Height = Application.GetMinRealAverage(28), Width = Application.GetRealWidth(28), Height = Application.GetRealWidth(28), //Y = Application.GetRealHeight(8), X = Application.GetRealWidth(TextSize.left12), @@ -87,8 +87,8 @@ /// </summary> public Button btnNextIcon = new Button { Width = Application.GetMinRealAverage(16), Height = Application.GetMinRealAverage(16), Width = Application.GetRealWidth(16), Height = Application.GetRealWidth(16), UnSelectedImagePath = "LogicIcon/next.png", X = Application.GetRealWidth(339), HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs
@@ -72,8 +72,8 @@ /// </summary> public Button btnSwitchIcon = new Button { Width = Application.GetMinRealAverage(36), Height = Application.GetMinRealAverage(36), Width = Application.GetRealWidth(36), Height = Application.GetRealWidth(36), Y = Application.GetRealHeight(58), X = Application.GetRealWidth(295), UnSelectedImagePath = "LogicIcon/off.png", HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs
@@ -93,8 +93,8 @@ { X = Application.GetRealWidth(194), Y = Application.GetRealHeight(8), Width = Application.GetMinRealAverage(24), Height = Application.GetMinRealAverage(24), Width = Application.GetRealWidth(24), Height = Application.GetRealWidth(24), UnSelectedImagePath = "MusicIcon/clear.png", }; editBjView.AddChidren(clearIconBtn); @@ -265,8 +265,8 @@ { X = Application.GetRealWidth(194), Y = Application.GetRealHeight(8), Width = Application.GetMinRealAverage(24), Height = Application.GetMinRealAverage(24), Width = Application.GetRealWidth(24), Height = Application.GetRealWidth(24), UnSelectedImagePath = "MusicIcon/clear.png", }; editBjView.AddChidren(clearIconBtn); HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs
@@ -33,7 +33,7 @@ public Button backBtn = new Button { Width = Application.GetRealWidth(12), Height = Application.GetRealHeight(20), Height = Application.GetRealWidth(20), X = Application.GetRealWidth(TextSize.left16), Y = Application.GetRealHeight(32), UnSelectedImagePath = "LogicIcon/back.png", @@ -46,8 +46,8 @@ { Y = Application.GetRealHeight(28), X = Application.GetRealWidth(337), Width = Application.GetMinRealAverage(32), Height = Application.GetMinRealAverage(32), Width = Application.GetRealWidth(32), Height = Application.GetRealWidth(32), UnSelectedImagePath = "LogicIcon/set.png", Visible = false, }; @@ -65,8 +65,8 @@ public Button clickSetBtn = new Button { X = Application.GetRealWidth(337 - 37), Width = Application.GetMinRealAverage(28 + 37), Height = Application.GetMinRealAverage(28 + 7 + 29), Width = Application.GetRealWidth(28 + 37), Height = Application.GetRealWidth(28 + 7 + 29), }; /// <summary> /// 最上面的那块方法 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs
@@ -61,8 +61,8 @@ /// </summary> public Button btn_subtract = new Button { Width = Application.GetMinRealAverage(24), Height = Application.GetMinRealAverage(24), Width = Application.GetRealWidth(24), Height = Application.GetRealWidth(24), X = Application.GetRealWidth(26), Y = Application.GetRealHeight(118), UnSelectedImagePath = "LogicIcon/-.png", @@ -99,8 +99,8 @@ /// </summary> public Button btn_add = new Button { Width = Application.GetMinRealAverage(24), Height = Application.GetMinRealAverage(24), Width = Application.GetRealWidth(24), Height = Application.GetRealWidth(24), X = Application.GetRealWidth(294), Y = Application.GetRealHeight(118), UnSelectedImagePath = "LogicIcon/+.png", HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -9,23 +9,23 @@ { public class Send { ///// <summary> ///// 住宅ID ///// </summary> //public static string homeId = Entity.DB_ResidenceData.residenceData.CurReginID; ///// <summary> ///// 网关ID ///// </summary> //public static string gatewayId = DriverLayer.Control.Ins.GatewayId; /// <summary> /// 住宅ID /// </summary> public static string homeId = "1333723044544233473"; public static string homeId = Entity.DB_ResidenceData.residenceData.CurReginID; /// <summary> /// 网关ID /// </summary> public static string gatewayId = "1333723647223775233"; public static string gatewayId = DriverLayer.Control.Ins.GatewayId; ///// <summary> ///// 网关ID ///// </summary> //public static string gatewayId =Entity.DB_ResidenceData.residenceData.HomeGateway.gatewayId; ///// <summary> ///// 住宅ID ///// </summary> //public static string homeId = Entity.DB_ResidenceData.residenceData.HomeGateway.homeId; /// <summary> /// 获取逻辑ID列表 HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -49,10 +49,10 @@ case FunctionType.Dimmer: case FunctionType.RGB: case FunctionType.RGBW: case FunctionType.CCT: case FunctionType.ColorTemperature: { //2表示(开,关)功能 SwitchBrightnessView(fLayout, device, index, edit,2); SwitchBrightnessView(fLayout, device, index, edit, 2); } break; case FunctionType.Relay: @@ -68,32 +68,112 @@ SwitchView(fLayout, device, index, edit, 3); } break; case FunctionType.TrietexCurtain: case FunctionType.RollerCurtain: case FunctionType.MotorCurtain: case FunctionType.RollingShutter: { //3表示(开,关,暂停)功能 SwitchBrightnessView(fLayout, device, index, edit, 3); } break; case FunctionType.AC: { case FunctionType.AC: { #region 界面 ///开关 LogicView.FunTypeView curtainSwitchView = new LogicView.FunTypeView(); curtainSwitchView.btnText.TextID = StringId.switchLogic; fLayout.AddChidren(curtainSwitchView.FLayoutView()); LogicView.FunTypeView acSwitchVie = new LogicView.FunTypeView(); acSwitchVie.btnText.TextID = StringId.switchLogic; fLayout.AddChidren(acSwitchVie.FLayoutView()); ///温度 LogicView.FunTypeView temperatureView = new LogicView.FunTypeView(); temperatureView.frameLayout.Y = acSwitchVie.frameLayout.Bottom; temperatureView.btnText.TextID = StringId.temperatureLogic; fLayout.AddChidren(temperatureView.FLayoutView()); ///模式 LogicView.FunTypeView acModehView = new LogicView.FunTypeView(); acModehView.frameLayout.Y = curtainSwitchView.frameLayout.Bottom; acModehView.frameLayout.Y = temperatureView.frameLayout.Bottom; acModehView.btnText.TextID = StringId.modeLogic; fLayout.AddChidren(acModehView.FLayoutView()); ///风速 LogicView.FunTypeView acSpeedView = new LogicView.FunTypeView(); acSpeedView.frameLayout.Y = acModehView.frameLayout.Bottom; acSpeedView.btnText.TextID = StringId.speedLogic; fLayout.AddChidren(acSpeedView.FLayoutView()); #endregion #region 点击事件 ///开关点击事件 curtainSwitchView.btnClick.MouseUpEventHandler += (sender, e) => acSwitchVie.btnClick.MouseUpEventHandler += (sender, e) => { SwitchViewMethod(device, curtainSwitchView.btnState, 2); SwitchViewMethod(device, acSwitchVie.btnState, 2); }; ///温度点击事件 temperatureView.btnClick.MouseUpEventHandler += (sender, e) => { FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence, }; this.AddChidren(frame); LogicView.TimeView view = new LogicView.TimeView(); view.FLayoutView(frame); EventHandler<MouseEventArgs> removefLayout = (sender1, e1) => { //移除fLayout界面 frame.RemoveFromParent(); }; //取消点击事件 view.btnCancel.MouseUpEventHandler += removefLayout; //初始化列表 var temperatureList = new List<string>(); for (int i = 16; i < 32; i++) { //添加数据 temperatureList.Add(i.ToString() + "℃"); temperatureList.Add((i + 0.5).ToString() + "℃"); } //加载数据界面的设置方法(列表互不联动) view.mUIPickerView.setNPicker(temperatureList, null, null); //默认初始选中状态 view.mUIPickerView.setCurrentItems(9, 0, 0); //定义一个局部变量记录选中时间 string temperature = "25℃"; for (int i = 0; i < temperatureList.Count; i++) { if (temperatureList[i] == temperatureView.btnState.Text) { //更新状态 view.mUIPickerView.setCurrentItems(i, 0, 0); //更新状态 temperature = temperatureList[i]; break; } } //选中时间回调方法,时间变化一次回调一次 view.mUIPickerView.OnSelectChangeEvent += (index1, index2, index3) => { temperature = temperatureList[index1]; }; //确定点击事件 view.btnConfirm.MouseUpEventHandler += (sender2, e2) => { Dictionary<string, string> dic = new Dictionary<string, string>(); LogicMethod.dictionary(dic, "key", "set_temp"); string keyVlaue = "set_temp"; string set_temp_value = temperature.Replace("℃", ""); LogicMethod.dictionary(dic, "value", set_temp_value); selectedState = device.functionType + "_set_temp"; AddDictionaryData(dicSateteList, keyVlaue, dic); RemView(frame); temperatureView.btnState.Text = temperature; }; }; ///模式点击事件 acModehView.btnClick.MouseUpEventHandler += (sender, e) => { @@ -109,14 +189,15 @@ }; this.AddChidren(frame); LogicView.DateView modeView = new LogicView.DateView(); modeView.btnTitle.TextID = StringId.modeLogic; modeView.btnTitle.TextID = StringId.modeLogic; modeView.FLayoutView(frame, modeStr.Count); modeView.btnCancel.MouseUpEventHandler += (sender2, e2) => { frame.RemoveFromParent(); }; ///定义一个Btn记录选中状态 Button checkBtn = new Button{ Button checkBtn = new Button { Tag = "unknown", }; for (int i = 0; i < modeStr.Count; i++) @@ -145,16 +226,260 @@ }; } modeView.btnConfirm.MouseUpEventHandler += (sender1,e1) => { if (checkBtn.Tag.ToString()== "unknown") { modeView.btnConfirm.MouseUpEventHandler += (sender1, e1) => { if (checkBtn.Tag.ToString() == "unknown") { return; } Dictionary<string, string> dic = new Dictionary<string, string>(); LogicMethod.dictionary(dic, "key", "mode"); string keyVlaue = "mode"; LogicMethod.dictionary(dic, "value", GetModeValueString(checkBtn.Tag.ToString())); LogicMethod.dictionary(dic, "value", GetModeValueString(checkBtn.Tag.ToString(), keyVlaue)); acModehView.btnState.Text = checkBtn.Tag.ToString(); selectedState = device.functionType + "_mode"; AddDictionaryData(dicSateteList, keyVlaue, dic); RemView(frame); }; }; ///风速点击事件 acSpeedView.btnClick.MouseUpEventHandler += (sender, e) => { List<string> speedStr = new List<string> { Language.StringByID(StringId.LowWindSpeed), Language.StringByID(StringId.MiddleWindSpeed), Language.StringByID(StringId.HighWindSpeed), Language.StringByID(StringId.Auto), }; FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence, }; this.AddChidren(frame); LogicView.DateView speedView = new LogicView.DateView(); speedView.btnTitle.TextID = StringId.modeLogic; speedView.FLayoutView(frame, speedStr.Count); speedView.btnCancel.MouseUpEventHandler += (sender2, e2) => { frame.RemoveFromParent(); }; ///定义一个Btn记录选中状态 Button checkBtn = new Button { Tag = "unknown", }; for (int i = 0; i < speedStr.Count; i++) { LogicView.CheckView speedTypeView = new LogicView.CheckView(); speedTypeView.frameLayout.Y = Application.GetRealHeight(56 + 50 * i); speedView.frameLayout.AddChidren(speedTypeView.FLayoutView()); speedTypeView.btnText.Text = speedStr[i]; speedTypeView.btnClick.Tag = speedStr[i];//标记 if (acModehView.btnState.Text == speedStr[i]) { //显示之前的选中状态 checkBtn.IsSelected = false; speedTypeView.btnCheckIcon.IsSelected = true; checkBtn = speedTypeView.btnCheckIcon; checkBtn.Tag = speedTypeView.btnClick.Tag.ToString(); } //星期的点击事件 speedTypeView.btnClick.MouseUpEventHandler += (sender1, e1) => { checkBtn.IsSelected = false; speedTypeView.btnCheckIcon.IsSelected = true; checkBtn = speedTypeView.btnCheckIcon; checkBtn.Tag = speedTypeView.btnClick.Tag.ToString(); }; } speedView.btnConfirm.MouseUpEventHandler += (sender1, e1) => { if (checkBtn.Tag.ToString() == "unknown") { return; } Dictionary<string, string> dic = new Dictionary<string, string>(); LogicMethod.dictionary(dic, "key", "fan"); string keyVlaue = "fan"; LogicMethod.dictionary(dic, "value", GetModeValueString(checkBtn.Tag.ToString(), keyVlaue)); acSpeedView.btnState.Text = checkBtn.Tag.ToString(); selectedState = device.functionType + "_fan"; AddDictionaryData(dicSateteList, keyVlaue, dic); RemView(frame); }; }; if (edit) { GetEditState(device, index, acSwitchVie.btnState, temperatureView.btnState, acModehView.btnState, acSpeedView.btnState); } #endregion } break; case FunctionType.FloorHeating: { #region 界面 ///开关 LogicView.FunTypeView floorHeatingSwitchVie = new LogicView.FunTypeView(); floorHeatingSwitchVie.btnText.TextID = StringId.switchLogic; fLayout.AddChidren(floorHeatingSwitchVie.FLayoutView()); ///温度 LogicView.FunTypeView temperatureView = new LogicView.FunTypeView(); temperatureView.frameLayout.Y = floorHeatingSwitchVie.frameLayout.Bottom; temperatureView.btnText.TextID = StringId.temperatureLogic; fLayout.AddChidren(temperatureView.FLayoutView()); ///模式 LogicView.FunTypeView floorHeatingModehView = new LogicView.FunTypeView(); floorHeatingModehView.frameLayout.Y = temperatureView.frameLayout.Bottom; floorHeatingModehView.btnText.TextID = StringId.modeLogic; fLayout.AddChidren(floorHeatingModehView.FLayoutView()); #endregion #region 点击事件 ///开关点击事件 floorHeatingSwitchVie.btnClick.MouseUpEventHandler += (sender, e) => { SwitchViewMethod(device, floorHeatingSwitchVie.btnState, 2); }; ///温度点击事件 temperatureView.btnClick.MouseUpEventHandler += (sender, e) => { FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence, }; this.AddChidren(frame); LogicView.TimeView view = new LogicView.TimeView(); view.FLayoutView(frame); EventHandler<MouseEventArgs> removefLayout = (sender1, e1) => { //移除fLayout界面 frame.RemoveFromParent(); }; //取消点击事件 view.btnCancel.MouseUpEventHandler += removefLayout; //初始化列表 var temperatureList = new List<string>(); for (int i = 16; i < 32; i++) { //添加数据 temperatureList.Add(i.ToString() + "℃"); temperatureList.Add((i + 0.5).ToString() + "℃"); } //加载数据界面的设置方法(列表互不联动) view.mUIPickerView.setNPicker(temperatureList, null, null); //默认初始选中状态 view.mUIPickerView.setCurrentItems(9, 0, 0); //定义一个局部变量记录选中时间 string temperature = "25℃"; for (int i = 0; i < temperatureList.Count; i++) { if (temperatureList[i] == temperatureView.btnState.Text) { //更新状态 view.mUIPickerView.setCurrentItems(i, 0, 0); //更新状态 temperature = temperatureList[i]; break; } } //选中时间回调方法,时间变化一次回调一次 view.mUIPickerView.OnSelectChangeEvent += (index1, index2, index3) => { temperature = temperatureList[index1]; }; //确定点击事件 view.btnConfirm.MouseUpEventHandler += (sender2, e2) => { Dictionary<string, string> dic = new Dictionary<string, string>(); LogicMethod.dictionary(dic, "key", "set_temp"); string keyVlaue = "set_temp"; string set_temp_value = temperature.Replace("℃", ""); LogicMethod.dictionary(dic, "value", set_temp_value); selectedState = device.functionType + "_set_temp"; AddDictionaryData(dicSateteList, keyVlaue, dic); RemView(frame); temperatureView.btnState.Text = temperature; }; }; ///模式点击事件 floorHeatingModehView.btnClick.MouseUpEventHandler += (sender, e) => { List<string> modeStr = new List<string> { Language.StringByID(StringId.dayMode), Language.StringByID(StringId.nightMode), Language.StringByID(StringId.leaveMode), Language.StringByID(StringId.ordinaryMode), Language.StringByID(StringId.timeMode), }; FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence, }; this.AddChidren(frame); LogicView.DateView modeView = new LogicView.DateView(); modeView.btnTitle.TextID = StringId.modeLogic; modeView.FLayoutView(frame, modeStr.Count); modeView.btnCancel.MouseUpEventHandler += (sender2, e2) => { frame.RemoveFromParent(); }; ///定义一个Btn记录选中状态 Button checkBtn = new Button { Tag = "unknown", }; for (int i = 0; i < modeStr.Count; i++) { LogicView.CheckView modeTypeView = new LogicView.CheckView(); modeTypeView.frameLayout.Y = Application.GetRealHeight(56 + 50 * i); modeView.frameLayout.AddChidren(modeTypeView.FLayoutView()); modeTypeView.btnText.Text = modeStr[i]; modeTypeView.btnClick.Tag = modeStr[i];//标记 if (floorHeatingModehView.btnState.Text == modeStr[i]) { //显示之前的选中状态 checkBtn.IsSelected = false; modeTypeView.btnCheckIcon.IsSelected = true; checkBtn = modeTypeView.btnCheckIcon; checkBtn.Tag = modeTypeView.btnClick.Tag.ToString(); } //星期的点击事件 modeTypeView.btnClick.MouseUpEventHandler += (sender1, e1) => { checkBtn.IsSelected = false; modeTypeView.btnCheckIcon.IsSelected = true; checkBtn = modeTypeView.btnCheckIcon; checkBtn.Tag = modeTypeView.btnClick.Tag.ToString(); }; } modeView.btnConfirm.MouseUpEventHandler += (sender1, e1) => { if (checkBtn.Tag.ToString() == "unknown") { return; } Dictionary<string, string> dic = new Dictionary<string, string>(); LogicMethod.dictionary(dic, "key", "mode"); string keyVlaue = "mode"; LogicMethod.dictionary(dic, "value", GetModeValueString(checkBtn.Tag.ToString(), "FloorHeating")); floorHeatingModehView.btnState.Text = checkBtn.Tag.ToString(); selectedState = device.functionType + "_mode"; AddDictionaryData(dicSateteList, keyVlaue, dic); RemView(frame); @@ -162,8 +487,9 @@ }; if (edit) { GetEditState(device, index, curtainSwitchView.btnState, null, null, null); GetEditState(device, index, floorHeatingSwitchVie.btnState, temperatureView.btnState, floorHeatingModehView.btnState, null); } #endregion } break; @@ -213,23 +539,83 @@ #endregion } private string GetModeValueString(string text) /// <summary> /// 获取模式/风速键值 /// </summary> /// <param name="text"></param> /// <param name="type"></param> /// <returns></returns> private string GetModeValueString(string text, string type) { string modeStr = ""; if (text == Language.StringByID(StringId.coolLogic)) string str = ""; switch (type) { modeStr = "cool"; case "mode": { if (text == Language.StringByID(StringId.coolLogic)) { str = "cool"; } else if (text == Language.StringByID(StringId.heatingLogic)) { str = "heat"; } else if (text == Language.StringByID(StringId.autoLogic)) { str = "auto"; } else if (text == Language.StringByID(StringId.dehumidifyLogic)) { str = "dry"; } } break; case "fan": { if (text == Language.StringByID(StringId.HighWindSpeed)) { str = "high"; } else if (text == Language.StringByID(StringId.MiddleWindSpeed)) { str = "medium"; } else if (text == Language.StringByID(StringId.LowWindSpeed)) { str = "low"; } else if (text == Language.StringByID(StringId.Auto)) { str = "auto"; } } break; case "FloorHeating": { if (text == Language.StringByID(StringId.dayMode)) { str = "day"; } else if (text == Language.StringByID(StringId.nightMode)) { str = "night"; } else if (text == Language.StringByID(StringId.leaveMode)) { str = "away"; } else if (text == Language.StringByID(StringId.ordinaryMode)) { str = "normal"; } else if (text == Language.StringByID(StringId.timeMode)) { str = "timer"; } } break; } else if (text == Language.StringByID(StringId.heatingLogic)) { modeStr = "heat"; } else if (text == Language.StringByID(StringId.autoLogic)) { modeStr = "auto"; } else if (text == Language.StringByID(StringId.dehumidifyLogic)) { modeStr = "dry"; } return modeStr; return str; } /// <summary> ///开关=界面 @@ -239,7 +625,7 @@ /// <param name="index"></param> /// <param name="edit"></param> /// <param name="intView">选中View的数量</param> private void SwitchView(FrameLayout fLayout, Entity.Function device, int index, bool edit,int intView) private void SwitchView(FrameLayout fLayout, Entity.Function device, int index, bool edit, int intView) { #region 界面 ///开关 @@ -268,7 +654,7 @@ /// <param name="index"></param> /// <param name="edit"></param> /// <param name="intView">选中View的数量</param> private void SwitchBrightnessView(FrameLayout fLayout, Entity.Function device, int index, bool edit,int intView) private void SwitchBrightnessView(FrameLayout fLayout, Entity.Function device, int index, bool edit, int intView) { #region 界面 ///开关 @@ -278,9 +664,9 @@ ///亮度 LogicView.FunTypeView brightnessView = new LogicView.FunTypeView(); brightnessView.frameLayout.Y = lightSwitchView.frameLayout.Bottom; if (device.functionType == FunctionType.TrietexCurtain || device.functionType == FunctionType.RollerCurtain) if (device.functionType == FunctionType.MotorCurtain || device.functionType == FunctionType.RollingShutter) { brightnessView.btnText.TextID = StringId.percentum; } else @@ -378,7 +764,6 @@ } /// <summary> /// 亮度/百分比=功能下一级界面 /// </summary> @@ -502,7 +887,7 @@ case FunctionType.Dimmer: case FunctionType.RGB: case FunctionType.RGBW: case FunctionType.CCT: case FunctionType.ColorTemperature: { foreach (var dic in dicList) { @@ -558,8 +943,9 @@ } } break; case FunctionType.TrietexCurtain: case FunctionType.RollerCurtain: { case FunctionType.MotorCurtain: case FunctionType.RollingShutter: { foreach (var dic in dicList) { @@ -597,6 +983,175 @@ } } } break; case FunctionType.AC: { foreach (var dic in dicList) { string value = dic["value"]; switch (dic["key"]) { case "on_off": { switch (value) { case "on": { button1.Text = Language.StringByID(StringId.onLogic); } break; case "off": { button1.Text = Language.StringByID(StringId.offLogic); } break; } } break; case "set_temp": { button2.Text = value + "℃"; } break; case "mode": { switch (value) { case "cool": { button3.Text = Language.StringByID(StringId.coolLogic); } break; case "heat": { button3.Text = Language.StringByID(StringId.heatingLogic); } break; case "auto": { button3.Text = Language.StringByID(StringId.autoLogic); } break; case "dry": { button3.Text = Language.StringByID(StringId.dehumidifyLogic); } break; } } break; case "fan": { switch (value) { case "high": { button4.Text = Language.StringByID(StringId.HighWindSpeed); } break; case "medium": { button4.Text = Language.StringByID(StringId.MiddleWindSpeed); } break; case "low": { button4.Text = Language.StringByID(StringId.LowWindSpeed); } break; case "auto": { button4.Text = Language.StringByID(StringId.Auto); } break; } } break; } } } break; case FunctionType.FloorHeating: { foreach (var dic in dicList) { string value = dic["value"]; switch (dic["key"]) { case "on_off": { switch (value) { case "on": { button1.Text = Language.StringByID(StringId.onLogic); } break; case "off": { button1.Text = Language.StringByID(StringId.offLogic); } break; } } break; case "set_temp": { button2.Text = value + "℃"; } break; case "mode": { switch (value) { case "day": { button3.Text = Language.StringByID(StringId.dayMode); } break; case "night": { button3.Text = Language.StringByID(StringId.nightMode); } break; case "away": { button3.Text = Language.StringByID(StringId.leaveMode); } break; case "normal": { button3.Text = Language.StringByID(StringId.ordinaryMode); } break; case "timer": { button3.Text = Language.StringByID(StringId.timeMode); } break; } } break; } } } break; } @@ -665,6 +1220,6 @@ } } } HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
@@ -90,13 +90,13 @@ { LogicView.TimeView timePointView = new LogicView.TimeView(); timePointView.FLayoutView(fLayout); EventHandler<MouseEventArgs> RemovefLayout = (sender, e1) => EventHandler<MouseEventArgs> removefLayout = (sender, e1) => { //移除fLayout界面 fLayout.RemoveFromParent(); }; //取消点击事件 timePointView.btnCancel.MouseUpEventHandler += RemovefLayout; timePointView.btnCancel.MouseUpEventHandler += removefLayout; //加载数据界面的设置方法(列表互不联动) timePointView.mUIPickerView.setNPicker(timePointView.GethStringList(), timePointView.GetmStringList(), null); HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs
@@ -34,7 +34,7 @@ public Button backBtn = new Button { Width = Application.GetRealWidth(12), Height = Application.GetRealHeight(20), Height = Application.GetRealWidth(20), X = Application.GetRealWidth(16), Y = Application.GetRealHeight(32), UnSelectedImagePath = "MusicIcon/MusicBack.png", @@ -55,8 +55,8 @@ { Y = Application.GetRealHeight(29), X = Application.GetRealWidth(337), Width = Application.GetMinRealAverage(28), Height = Application.GetMinRealAverage(28), Width = Application.GetRealWidth(28), Height = Application.GetRealWidth(28), UnSelectedImagePath = "MusicIcon/set.png", Visible=false, }; @@ -74,8 +74,8 @@ public Button clickSetBtn = new Button { X = Application.GetRealWidth(337 - 37), Width = Application.GetMinRealAverage(28 + 37), Height = Application.GetMinRealAverage(28 + 7 + 29), Width = Application.GetRealWidth(28 + 37), Height = Application.GetRealWidth(28 + 7 + 29), }; /// <summary> /// 最上面的那块方法