Merge remote-tracking branch 'origin/wjc' into Dev-Branch
| | |
| | | 7154=Arrive |
| | | 7155=Distress/Normal |
| | | 7156=Distress |
| | | 7157=whether to unlock |
| | | 7158=is |
| | | |
| | | |
| | | |
| | | |
| | |
| | | 7154=到达 |
| | | 7155=求救/正常 |
| | | 7156=求救 |
| | | 7157=是否开锁时 |
| | | 7158=是 |
| | | |
| | | |
| | | |
| | |
| | | 7154=Arrive |
| | | 7155=Distress/Normal |
| | | 7156=Distress |
| | | 7157=whether to unlock |
| | | 7158=is |
| | | |
| | | |
| | | |
| | |
| | | 7154=到达 |
| | | 7155=求救/正常 |
| | | 7156=求救 |
| | | 7157=是否开锁时 |
| | | 7158=是 |
| | | |
| | | |
| | | |
| | |
| | | endTime = DateTime.Now.AddSeconds(5); |
| | | |
| | | MainPage.Log($"读取设备信息成功"); |
| | | var deviceList = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); |
| | | MainPage.Log($"sid列表获取===="+ deviceResult.Data.ToString()); |
| | | var deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); |
| | | if (deviceList == null) |
| | | { |
| | | deviceList = new DevcieApiPack(); |
| | |
| | | /// 求救 |
| | | /// </summary> |
| | | public const int qiujiu = 7156; |
| | | /// <summary> |
| | | /// 是否开锁时 |
| | | /// </summary> |
| | | public const int shifoukaisuoshi = 7157; |
| | | /// <summary> |
| | | /// 是 |
| | | /// </summary> |
| | | public const int shi = 7158; |
| | | |
| | | |
| | | |
| | | #region LE新增 |
| | |
| | | likiadaodaView.frameLayout.Y = shiwaiView.frameLayout.Bottom; |
| | | likiadaodaView.btnText.TextID = StringId.likiadaoda; |
| | | likiadaodaView.btnIcon.UnSelectedImagePath = "LogicIcon/location.png"; |
| | | int count = 0;//输入类型个数 |
| | | if (MainView.IsGatewayType) |
| | | { |
| | | count = 4; |
| | | viewLayout.AddChidren(likiadaodaView.FLayoutView()); |
| | | } |
| | | int count = 3;//输入类型个数 |
| | | //2022年05月24日15:08:22 隐藏掉地理围栏 |
| | | //if (MainView.IsGatewayType) |
| | | //{ |
| | | // count = 4; |
| | | // viewLayout.AddChidren(likiadaodaView.FLayoutView()); |
| | | //} |
| | | ////功能 |
| | | ///产品经理君焕要求,设备功能移到这里。<2022-3-7> |
| | | new FunTpye(LogicMethod.condition_if).FunTypeView(viewLayout, likiadaodaView.frameLayout.Bottom, count); |
| | | new FunTpye(LogicMethod.condition_if).FunTypeView(viewLayout, shiwaiView.frameLayout.Bottom, count); |
| | | |
| | | #endregion |
| | | |
| | |
| | | }; |
| | | } |
| | | break; |
| | | //门锁 |
| | | case SPK.DoorLock: |
| | | { |
| | | |
| | | LogicView.FunTypeView view = new LogicView.FunTypeView(); |
| | | view.btnText.TextID = StringId.shifoukaisuoshi; |
| | | fLayout.AddChidren(view.FLayoutView()); |
| | | view.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | DeviceView(device, view.btnState, StringId.shi, StringId.offLogic,1); |
| | | }; |
| | | if (edit) |
| | | { |
| | | GetEditState(device, index, view.btnState, null, null, null); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | #region 保存 |
| | | ///保存View |
| | |
| | | /// <param name="button">选中状态显示文本Btn控件</param> |
| | | /// <param name="btnText1">属性状态值文本1</param> |
| | | /// <param name="btnText2">属性状态值文本2</param> |
| | | private void DeviceView(Entity.Function device, Button button, int btnText1, int btnText2) |
| | | /// <param name="viewCount">view数量</param> |
| | | private void DeviceView(Entity.Function device, Button button, int btnText1, int btnText2,int viewCount=2) |
| | | { |
| | | FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence }; |
| | | this.AddChidren(frame); |
| | | LogicView.SwitchView switchView = new LogicView.SwitchView(); |
| | | switchView.FLayoutView(frame, btnText1, btnText2, button.Text, (intValue) => |
| | | switchView.FLayoutView(frame, btnText1, btnText2, button.Text, viewCount,(intValue) => |
| | | { |
| | | //设备属性值,云雀上定义好的; |
| | | string keyVlaue = "on_off"; |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.DoorLock: |
| | | { |
| | | keyVlaue = "door_status"; |
| | | } |
| | | break; |
| | | |
| | | } |
| | | switch (intValue) |
| | |
| | | } |
| | | } |
| | | break; |
| | | case StringId.shi: |
| | | case StringId.kaiqi: |
| | | { |
| | | value = "open"; |
| | |
| | | { |
| | | value = "fall"; |
| | | }; break; |
| | | |
| | | |
| | | } |
| | | //显示文本 |
| | | button.TextID = intValue; |
| | |
| | | areaView.btnClick.MouseUpEventHandler += (sender, e2) => |
| | | { |
| | | fLayout.RemoveFromParent(); |
| | | funAllAreaView.btnText2.Text = areaView.btnClick.Tag.ToString(); |
| | | UserInfo.Current.logicselectedFunction = areaView.btnClick.Tag.ToString(); |
| | | string clickText = areaView.btnClick.Tag.ToString(); |
| | | funAllAreaView.btnText2.Text = clickText; |
| | | UserInfo.Current.logicselectedFunction = clickText; |
| | | ///获取设备单个大类spk列表(例如:灯光类,空调类...) |
| | | var typeFunctionList2 = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction); |
| | | var typeFunctionList2 = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(clickText); |
| | | ///获取设备单个小类列表(例如:灯光1,灯光2...) |
| | | var lists2 = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList2, functionList); |
| | | this.LoadingDeviceListView(vv, lists2); |
| | |
| | | |
| | | } |
| | | break; |
| | | case SPK.DoorLock: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | | if (value == "open") |
| | | { |
| | | inputView.btnState.Text = Language.StringByID(StringId.kaiqi); |
| | | } |
| | | |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.DoorLock: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | | if (value == "open") |
| | | { |
| | | button1.Text = Language.StringByID(StringId.shi); |
| | | } |
| | | |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | strPath = "LogicIcon/sensor.png"; |
| | | } |
| | | break; |
| | | case SPK.DoorLock: |
| | | { |
| | | strPath = "FunctionIcon/DoorLock/DoorLock.png"; |
| | | } |
| | | break; |
| | | |
| | | } |
| | | return strPath; |
| | |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.Electric)); |
| | | } |
| | | ///门锁类 |
| | | var doorlock = deviceList.Find((device) => device.spk == SPK.DoorLock); |
| | | if (doorlock != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.DoorLock)); |
| | | } |
| | | return deviceStrTypeList; |
| | | |
| | | } |
| | |
| | | functionTypeList.Add(SPK.AirSwitch); |
| | | functionTypeList.Add(SPK.PanelSocket); |
| | | functionTypeList.Add(SPK.ElectricSocket); |
| | | } |
| | | ///门锁类 |
| | | else if (deviceType == Language.StringByID(StringId.DoorLock)) |
| | | { |
| | | functionTypeList.Add(SPK.DoorLock); |
| | | } |
| | | else |
| | | { |
| | |
| | | deviceTypeList.Add(SPK.ElectricSocket); |
| | | deviceTypeList.Add(SPK.HvacCac); |
| | | deviceTypeList.Add(SPK.SensorHelp); |
| | | deviceTypeList.Add(SPK.DoorLock); |
| | | |
| | | } |
| | | break; |
| | |
| | | /// View的方法 |
| | | /// </summary> |
| | | /// <param name="frame">父控件</param> |
| | | /// <param name="i">显示选择View数量</param> |
| | | /// <param name="i">表示View数量</param> |
| | | ///<param name="stateVuale">之前的状态值</param> |
| | | /// <param name="action">返回回调</param> |
| | | /// <returns></returns> |
| | |
| | | /// View的方法 |
| | | /// </summary> |
| | | /// <param name="frame">父控件</param> |
| | | /// <param name="text1">父控件</param> |
| | | /// <param name="text2">显示选择View数量</param> |
| | | /// <param name="text1">第一个备注</param> |
| | | /// <param name="text2">第二个备注</param> |
| | | ///<param name="stateVuale">之前的状态值</param> |
| | | /// <param name="i">表示View数量</param> |
| | | /// <param name="action">返回回调</param> |
| | | /// <returns></returns> |
| | | public void FLayoutView(FrameLayout frame, int text1, int text2, string stateVuale, Action<int> action,bool tag=true) |
| | | public void FLayoutView(FrameLayout frame, int text1, int text2, string stateVuale, int i, Action<int> action,bool tag=true) |
| | | { |
| | | int i = 2; |
| | | frameLayout.Y = Application.GetRealHeight(603 - (44 * i)); |
| | | frameLayout.Height = Application.GetRealHeight(44 * i); |
| | | frame.AddChidren(frameLayout); |
| | | frame.AddChidren(btnCancel); |
| | | btnOn.TextID = text1; |
| | | btnOff.TextID = text2; |
| | | frameLayout.AddChidren(btnOn); |
| | | frameLayout.AddChidren(btnLine); |
| | | frameLayout.AddChidren(btnOff); |
| | | if (i == 1) |
| | | { |
| | | frameLayout.AddChidren(btnOn); |
| | | } |
| | | else if (i == 2) |
| | | { |
| | | frameLayout.AddChidren(btnOn); |
| | | frameLayout.AddChidren(btnLine); |
| | | frameLayout.AddChidren(btnOff); |
| | | } |
| | | //取消点击事件 |
| | | btnCancel.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | |
| | | logicIfon.Add("noticeConfig", noticeConfigJObject); |
| | | logicIfon.Add("pushConfigs", pushConfigsArray); |
| | | logicjArray.Add(logicIfon); |
| | | //string str = logicIfon.ToString(); |
| | | //string str = logicIfon.ToString(); |
| | | var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId }, { "logics", logicjArray } }; |
| | | responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Add, 5); |
| | | //如果是token过期则刷新token |
| | |
| | | ///开关点击事件 |
| | | curtainSwitchView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | SwitchViewMethod(device, curtainSwitchView.btnState, 3); |
| | | SwitchViewMethod(device, curtainSwitchView.btnState, 2); |
| | | }; |
| | | ///百分比点击事件 |
| | | crtainPercentumView.btnClick.MouseUpEventHandler += (sender, e) => |
| | |
| | | str = Language.StringByID(StringId.shebeibucunzai); |
| | | } |
| | | break; |
| | | |
| | | case "124006": |
| | | case "14006": |
| | | { |
| | | str = Language.StringByID(StringId.shebeibuzaixian); |
| | |
| | | /// <returns></returns> |
| | | public static ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 20) |
| | | { |
| | | MainPage.Log("请求数据=="+o.ToString()); |
| | | var requestJson = HttpUtil.GetSignRequestJson(o); |
| | | return HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout); |
| | | |
| | |
| | | this.picLockControl = new PicViewControl(256, 260); |
| | | picLockControl.Y = Application.GetRealHeight(129); |
| | | picLockControl.Gravity = Gravity.CenterHorizontal; |
| | | picLockControl.UnSelectedImagePath = "FunctionIcon/DoorLock/LockPictrue1.png"; |
| | | picLockControl.UnSelectedImagePath = "FunctionIcon/DoorLock/LockPictrue1.png"; |
| | | FrameWhiteCentet1.AddChidren(picLockControl); |
| | | picLockControl.ButtonClickEvent += (sender, e) => |
| | | { |
| | |
| | | |
| | | /// <summary> |
| | | /// 上一次更新的时间 |
| | | /// 记录数据反馈的时间(因为有时间网络差数据不回复,导致刷新当前播放音乐时间不正确) |
| | | /// 记录数据反馈的时间(因为有时候网络差数据不回复,导致刷新当前播放音乐时间不正确) |
| | | /// ((当前时间)DateTime.Now - (记录时间)LastDateTimeLastDateTime).TotalSeconds=误差时间(秒) |
| | | /// </summary> |
| | | public DateTime LastDateTime; |
| | |
| | | //停止播放 |
| | | playView.startTimeBtn.Text =playTime; |
| | | //playView.startTimeBtn.Text ="00:00"; |
| | | ///歌曲记录暂停时间;<LastDateTime 计算时间播放时间有用到> |
| | | ///记录歌曲暂停时间;<LastDateTime 计算播放时间有用到> |
| | | A31MusicModel.Current.LastDateTime = DateTime.Now; |
| | | } |
| | | playView.songNameTextView.Text = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name) == null ? "Unkown" : A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name); |
| | |
| | | var musicListFunction = FunctionList.List.GetMusicList(); |
| | | for (int i = 0; i < musicListFunction.Count; i++) |
| | | { |
| | | var function = musicListFunction[i]; |
| | | var function = musicListFunction[i]; |
| | | var music = A31MusicModel.A31MusicModelList.Find((obj) => |
| | | (obj.functionMusic.deviceId == function.deviceId && function.spk == "music.standard") || ( |
| | | obj.functionMusic.deviceId == function.deviceId && function.spk == "av.music") |
| | | (obj.functionMusic.deviceId == function.deviceId && function.spk == SPK.MusicStandard) || ( |
| | | obj.functionMusic.deviceId == function.deviceId && function.spk == SPK.AvMusic) |
| | | ); |
| | | if (music == null) |
| | | { |