wei
2020-12-16 1ba40bc52716e732f53bf74a68db9eb9d75c0844
20201216-1
8个文件已修改
215 ■■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Scene.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs 132 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,10 +1,18 @@
<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs">
    <Files>
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs" Line="246" Column="57" />
      <File FileName="HDL_ON/Entity/FunctionList.cs" Line="603" Column="87" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs" Line="269" Column="55" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs" Line="266" Column="1" />
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" Line="487" Column="48" />
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs" Line="896" Column="34" />
      <File FileName="HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs" Line="115" Column="49" />
      <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="371" Column="42" />
      <File FileName="HDL_ON/Entity/Function/Scene.cs" Line="266" Column="29" />
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs" Line="367" Column="36" />
      <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="515" Column="32" />
      <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs" Line="84" Column="36" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
@@ -23,14 +31,14 @@
              <Node name="UI" expanded="True">
                <Node name="UI0-Public" expanded="True" />
                <Node name="UI2" expanded="True">
                  <Node name="1-HomePage" expanded="True" />
                  <Node name="1-HomePage" expanded="True">
                    <Node name="HomePageBLL.cs" selected="True" />
                  </Node>
                  <Node name="3-Intelligence" expanded="True">
                    <Node name="Scene" expanded="True" />
                  </Node>
                  <Node name="FuntionControlView" expanded="True">
                    <Node name="AC" expanded="True">
                      <Node name="ACPage.cs" selected="True" />
                    </Node>
                    <Node name="AC" expanded="True" />
                    <Node name="FoolHeating" expanded="True" />
                  </Node>
                </Node>
@@ -65,8 +73,8 @@
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/Function/Scene.cs" relfile="HDL_ON/Entity/Function/Scene.cs" line="285" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI0-Public/PublicAssmebly.cs" relfile="HDL_ON/UI/UI0-Public/PublicAssmebly.cs" line="630" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/Function/Scene.cs" relfile="HDL_ON/Entity/Function/Scene.cs" line="323" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" relfile="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" line="505" column="1" />
    </BreakpointStore>
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
  <MultiItemStartupConfigurations />
HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs
@@ -112,7 +112,7 @@
        {
            get
            {
                return $"/base/{Control.Ins.GatewayId}/custom/scene/execute";
                return $"/user/{Control.Ins.GatewayId}/custom/scene/execute";
            }
        }
    }
HDL_ON/DAL/DriverLayer/Control.cs
@@ -368,7 +368,7 @@
            else
            {
                Dictionary<string, string> keys = new Dictionary<string, string>();
                keys.Add("sid", scene.userSceneId);
                keys.Add("sid", scene.sid);
                var aLinkData = new AlinkReadFunctionStatusObj()
                {
                    id = Ins.msg_id.ToString(),
HDL_ON/Entity/Function/Scene.cs
@@ -256,6 +256,44 @@
                MainPage.Log($"Save Scene Data : {savePath}");
            }
        }
        /// <summary>
        /// 收藏场景
        /// </summary>
        /// <returns></returns>
        public string CollectScene()
        {
            var pm = new HttpServerRequest();
            if (this.collect)
            {
                var revPack = pm.CollectScene(this.userSceneId);
                return revPack;
            }
            else
            {
                var revPack = pm.CancelCollectScene(this.userSceneId);
                return revPack;
            }
        }
        /// <summary>
        /// 编辑场景
        /// </summary>
        public string EditScene()
        {
            var pm = new HttpServerRequest();
            var revPack = pm.EditScene(this);
            if (revPack.Code == StateCode.SUCCESS)
            {
                var scenes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(revPack.Data.ToString());
                var tempScene = scenes.Find((obj) => obj.sid == sid);
                if (tempScene != null)
                {
                    var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(tempScene));
                    Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd);
                }
            }
            return revPack.Code;
        }
        /// <summary>
        /// 修改场景
HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -908,7 +908,7 @@
                    };
                    var aep = new SceneEditPage(scene, backAction);
                    MainPage.BasePageView.AddChidren(aep);
                    aep.LoadPage(StringId.EditScene, refreshAction);
                    aep.LoadPage( refreshAction);
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                };
            }
HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
@@ -364,7 +364,7 @@
                view.AddChidren(btnCollection);
                btnCollection.MouseUpEventHandler = (sender, e) => {
                    scene.collect = btnCollection.IsSelected = !btnCollection.IsSelected;
                    scene.SaveSceneData(true);
                    scene.CollectScene();
                };
                LoadEvent_ControlScene(btnCoverd,btnName,btnZone, scene);
                btnSettingIcon.MouseUpEventHandler = (sender, e) => {
@@ -379,7 +379,7 @@
                    };
                    var aep = new SceneEditPage(scene, backAction);
                    MainPage.BasePageView.AddChidren(aep);
                    aep.LoadPage(StringId.EditScene, refreshAction);
                    aep.LoadPage(refreshAction);
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                };
            }
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
@@ -76,7 +76,6 @@
        Scene scene;
        int pageTitleId;
        /// <summary>
        /// 更新功能row
        /// </summary>
@@ -97,17 +96,9 @@
            };
        }
        public void LoadPage(int titleId,Action backRefresh)
        public void LoadPage(Action backRefresh)
        {
            pageTitleId = titleId;
            new TopViewDiv(bodyView, Language.StringByID(pageTitleId)).LoadTopView(backRefresh);
            initPage();
        }
        public void LoadPage(int titleId)
        {
            pageTitleId = titleId;
            new TopViewDiv(bodyView, Language.StringByID(pageTitleId)).LoadTopView();
            new TopViewDiv(bodyView, Language.StringByID(StringId.EditScene)).LoadTopView(backRefresh);
            initPage();
        }
@@ -291,6 +282,7 @@
                    Action<string> action = (obj) => {
                        scene.delay = obj;
                        btnSceneDelayInfo.Text = FunctionList.List.GetDelayText(obj);
                        scene.EditScene();
                    };
                    new PublicAssmebly().SetSceneDelayDialog(action,scene.delay);
                };
@@ -369,9 +361,9 @@
                Y = Application.GetRealHeight(667 - 50),
                Height = Application.GetRealHeight(50),
                TextAlignment = TextAlignment.Center,
                TextColor = pageTitleId == StringId.NewScene ? CSS_Color.MainColor : CSS_Color.WarningColor,
                TextColor =  CSS_Color.WarningColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = pageTitleId == StringId.NewScene ? StringId.Complete : StringId.Del,
                TextID =   StringId.Del,
                BackgroundColor = CSS_Color.MainBackgroundColor,
                //IsBold = true
            };
@@ -523,13 +515,11 @@
                row.AddRightView(btnDelSceneFunction);
                btnDelSceneFunction.MouseUpEventHandler = (sender, e) => {
                    scene.functions.Remove(scenefunction);
                    scene.SaveSceneData(true);
                    scene.EditScene();
                    row.RemoveFromParent();
                    functionListView.Height = Application.GetRealWidth(65 * scene.functions.Count);
                    //LoadFunctionRow(functionListView);
                };
            }
        }
@@ -549,7 +539,7 @@
                }
            }
            if (sceneFunction.status.Count == 0)
            if (sceneFunction.status.Count == 1)
            {
                return sceneFunctionInfo += Language.StringByID(StringId.Open);
            }
@@ -580,61 +570,6 @@
            {
                sceneFunctionInfo += Language.StringByID(StringId.Open) + " " + perState.value + "%";
            }
            //FunctionAttributes perTrait;
            //switch (sceneFunction.localFunction.functionType)
            //{
            //    case FunctionType.AC:
            //        sceneFunctionInfo += sceneFunction.localFunction.attributes.Find((obj) => obj.key == "mode").GetCurValueText();
            //        sceneFunctionInfo += " " + sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp").curValue.ToString() +
            //             sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp").uintString;
            //        sceneFunctionInfo += sceneFunction.localFunction.attributes.Find((obj) => obj.key == "fan").GetCurValueText();
            //        break;
            //    case FunctionType.FloorHeating:
            //        sceneFunctionInfo += sceneFunction.localFunction.attributes.Find((obj) => obj.key == "mode").GetCurValueText();
            //        sceneFunctionInfo += " " + sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp").curValue.ToString() +
            //             sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp").uintString;
            //        break;
            //    case FunctionType.Dimmer:
            //        perTrait = sceneFunction.localFunction.attributes.Find((obj) => obj.key == "brightness");
            //        if (perTrait != null)
            //        {
            //            sceneFunctionInfo += Language.StringByID(StringId.Open) + " " + sceneFunction.localFunction.attributes.Find((obj) => obj.key == "brightness").curValue.ToString() + "%";
            //        }
            //        else
            //        {
            //            sceneFunctionInfo += Language.StringByID(StringId.Open);
            //        }
            //        break;
            //    case FunctionType.Relay:
            //        sceneFunctionInfo += Language.StringByID(StringId.Open);
            //        break;
            //    case FunctionType.RGB:
            //        perTrait = sceneFunction.localFunction.attributes.Find((obj) => obj.key == "percent");
            //        if (perTrait != null)
            //        {
            //            sceneFunctionInfo += Language.StringByID(StringId.Open) + " " + sceneFunction.localFunction.attributes.Find((obj) => obj.key == "brightness").curValue.ToString() + "%";
            //        }
            //        else
            //        {
            //            sceneFunctionInfo += Language.StringByID(StringId.Open);
            //        }
            //        break;
            //    case FunctionType.Curtain:
            //        sceneFunctionInfo += Language.StringByID(StringId.Open);
            //        break;
            //    case FunctionType.MotorCurtain:
            //        perTrait = sceneFunction.localFunction.attributes.Find((obj) => obj.key == "percent");
            //        if (perTrait != null)
            //        {
            //            sceneFunctionInfo += Language.StringByID(StringId.Open) + " " + sceneFunction.localFunction.attributes.Find((obj) => obj.key == "percent").curValue.ToString() + "%";
            //        }
            //        else
            //        {
            //            sceneFunctionInfo += Language.StringByID(StringId.Open);
            //        }
            //        break;
            //}
            return sceneFunctionInfo;
        }
@@ -747,7 +682,14 @@
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                Action backAction = () => {
                    btnZoneName.Text = scene.GetRoomListName();
                    var result = scene.EditScene();
                    if (result == StateCode.SUCCESS)
                    {
                        btnZoneName.Text = scene.GetRoomListName();
                    }else
                    {
                        IMessageCommon.Current.ShowErrorInfoAlter(result);
                    }
                };
                var ssl = new SetSceneLocationPage(scene, backAction);
                MainPage.BasePageView.AddChidren(ssl);
@@ -808,30 +750,12 @@
            {
                btnTakePicture.IsSelected = false;
                //var pid = Guid.NewGuid();
                //CropImage.TakePicture((imagePath) =>
                //{
                //    if (imagePath != null)
                //    {
                //        addSceneImageView.ImagePath = imagePath.ToString();
                //        scene.ImagePath = addSceneImageView.ImagePath;
                //        MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath);
                //    }
                //}, pid.ToString(), 4, 3);
                var imageName = Guid.NewGuid().ToString();
                //var imageName = scene.sid;
                CropImage.TakePicture((imagePath) =>
                {
                    CropImageCallBack(imagePath);
                }, imageName, 4, 3);
                //if (pageTitleId == StringId.EditScene)
                //{
                //    scene.SaveFunctionData();
                //}
                pictureOptionView.Parent.RemoveFromParent();
            };
            btnAlbum.MouseDownEventHandler = (sender, e) => {
@@ -861,10 +785,6 @@
                }, imageName, 4, 3);
                //if (pageTitleId == StringId.EditScene)
                //{
                //    scene.SaveFunctionData();
                //}
                pictureOptionView.Parent.RemoveFromParent();
            };
@@ -873,10 +793,7 @@
                Action<string> action = (obj) => {
                    scene.ImagePath = obj;
                    addSceneImageView.ImagePath = scene.ImagePath;
                    if (pageTitleId == StringId.EditScene)
                    {
                        scene.SaveSceneData(true);
                    }
                    scene.EditScene();
                };
                var galleryPage = new GalleryPage(scene.ImagePath,action);
@@ -902,12 +819,9 @@
            //上传成功到回调
            Action<string> uploadSuccessAction = (imageUrl) =>
            {
                    //2020-12-03 需要讲最新的图片路径同步到云端
                    scene.ImagePath = imageUrl;
                if (pageTitleId == StringId.EditScene)
                {
                    scene.SaveSceneData(true);
                }
                //2020-12-03 需要讲最新的图片路径同步到云端
                scene.ImagePath = imageUrl;
                scene.EditScene();
            };
            //上传图片到云端
            UploadImage(selectImagePath, addSceneImageView, scene, uploadSuccessAction);
@@ -940,7 +854,7 @@
                            return;
                        }
                    }
                    scene.SaveSceneData(true);
                    scene.EditScene();
                    FunctionList.List.scenes.Add(scene);
                    backAction();
                    this.RemoveFromParent();
@@ -977,11 +891,11 @@
                    }.Show(bodyView);
                    return;
                }
                btnSceneName.Text = str;
                scene.name = str;
                if (pageTitleId == StringId.EditScene)
                var result = scene.EditScene();
                if (result == StateCode.SUCCESS)
                {
                    scene.SaveSceneData(true);
                    btnSceneName.Text = str;
                }
            };
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
@@ -407,6 +407,10 @@
        /// <param name="btn"></param>
        void LoadEditDialog_Temp(SceneFunctionStatus trait, Button btn)
        {
            double temp = 16;
            double.TryParse(trait.value, out temp);
            trait.value = temp.ToString();
            List<string> pickerItems = new List<string>();
            if(trait == null)
            {
@@ -479,7 +483,12 @@
            uIPickerView.setNPicker(pickerItems, null, null);
            optionBaseView.AddChidren(uIPickerView);
            uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()), 4, 5);
            string selectItem = trait.value.ToString() + FunctionList.List.GetUintString(trait.key);
            string selectItem = pickerItems[0];
            if (pickerItems.Contains(trait.value + FunctionList.List.GetUintString(trait.key)))
            {
                selectItem = trait.value.ToString() + FunctionList.List.GetUintString(trait.key);
            }
            dialog.Show();