| | |
| | | <Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Common/HDLCommon.cs"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/Common/HDLCommon.cs" Line="627" Column="38" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs" /> |
| | | <File FileName="HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs" /> |
| | | <File FileName="HDL_ON/DAL/Server/NewAPI.cs" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="27" Column="22" /> |
| | | <File FileName="HDL-ON_iOS/Info.plist" /> |
| | | <File FileName="HDL_ON/UI/MainPage.cs" Line="115" Column="62" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs" Line="167" Column="29" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="Common" expanded="True"> |
| | | <Node name="HDLCommon.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="DAL" expanded="True"> |
| | | <Node name="Server" expanded="True" /> |
| | | <Node name="ThirdPartySdk" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="1-HomePage" expanded="True" /> |
| | | <Node name="3-Intelligence" expanded="True" /> |
| | | <Node name="4-PersonalCenter" expanded="True"> |
| | | <Node name="AboutOn" expanded="True" /> |
| | | <Node name="RoomListManage" expanded="True"> |
| | | <Node name="RoomEditFunctionPage.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | <Node name="FuntionControlView" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_iOS" expanded="True" /> |
| | | </Node> |
| | | </State> |
| | | </Pad> |
| | |
| | | <String>Shared.IOS/Shared.IOS.csproj</String> |
| | | </DisabledProjects> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" /> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore> |
| | | <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/ON+/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" line="42" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" line="42" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Common/ApiUtlis.cs" relfile="HDL_ON/Common/ApiUtlis.cs" line="390" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="422" column="1" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | |
| | | //网络变化处理 |
| | | HDLCommon.Current.UpdateInternetStatus((int)internetStatus, MainPage.IsEnterBackground); |
| | | }; |
| | | //开启定位服务 |
| | | Shared.Application.StartGPSLocationService(); |
| | | }; |
| | | BaseActivity.RefreshUIAction += (activity) => |
| | | { |
| | |
| | | |
| | | 4000=Video intercom |
| | | 4001=Call record |
| | | 4002=*Cloud photos are only kept for 30 days |
| | | 4002=*Cloud records are only kept for 30 days |
| | | 4003=Door phone call |
| | | 4004=Answered |
| | | 4005=Unlocked |
| | |
| | | 6092=The device does not exist |
| | | 6093=The device is not online |
| | | 6094=The gateway device does not exist |
| | | 6095=More than 30 add buttons |
| | | |
| | | |
| | | 7108=Leak/No Leak |
| | |
| | | |
| | | 4000=可视对讲 |
| | | 4001=通话记录 |
| | | 4002=*云端照片只保留30天 |
| | | 4002=*云端记录只保留30天 |
| | | 4003=门口机呼叫 |
| | | 4004=已接听 |
| | | 4005=已开锁 |
| | |
| | | 6092=设备不存在 |
| | | 6093=设备不在线 |
| | | 6094=网关设备不存在 |
| | | |
| | | 6095=添加按钮超出30个 |
| | | |
| | | |
| | | 7000=新建自动化 |
| | |
| | | <MandroidI18n>cjk</MandroidI18n> |
| | | <AndroidEnableSGenConcurrent>false</AndroidEnableSGenConcurrent> |
| | | <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime> |
| | | <AndroidSupportedAbis>armeabi-v7a;arm64-v8a</AndroidSupportedAbis> |
| | | </PropertyGroup> |
| | | <ItemGroup> |
| | | <Reference Include="System" /> |
| | |
| | | <Reference Include="Square.OkIO"> |
| | | <HintPath>..\DLL\EZvizMonitor\Square.OkIO.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="ys"> |
| | | <HintPath>..\DLL\EZvizMonitor\ys.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="LC_SDK"> |
| | | <HintPath>..\DLL\LC\Android\LC_SDK.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="ys"> |
| | | <HintPath>..\DLL\EZvizMonitor\ys.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <Compile Include="MainActivity.cs" /> |
| | |
| | | screenshotLayout.SetOnClickListener(this); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 开锁 |
| | |
| | | private void Unlock() |
| | | { |
| | | // |
| | | CurtActivity.Unlock(); |
| | | UpdataUnlockState(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | if (v.Equals(unlockLayout)) |
| | | { |
| | | //开锁 |
| | | Unlock(); |
| | | } |
| | | else if (v.Equals(screenshotLayout)) |
| | | { |
| | | //有视频过来可调用此接口进行拍照 |
| | | // 内部储存/DCIM/Camera/.....jpg |
| | | screenImage.Selected = true; |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | string time = format.Format(new Date(SystemClock.CurrentThreadTimeMillis())); |
| | | string ss = Android.OS.Environment.ExternalStorageDirectory.Path + "/DCIM/Camera"; |
| | | string ss = Android.OS.Environment.ExternalStorageDirectory.Path + "/DCIM/HDL"; |
| | | string path = ss + "/" + time + ".jpg"; |
| | | CurtActivity.SnapShot(path); |
| | | } |
| | | } |
| | | |
| | |
| | | CurtActivity.Play(); |
| | | |
| | | CurtActivity.CloseAudio(); |
| | | |
| | | |
| | | return mView; |
| | | } |
| | | |
| | |
| | | catch { } |
| | | |
| | | }).Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 开锁 |
| | | /// </summary> |
| | | private void Unlock() |
| | | { |
| | | // |
| | | CurtActivity.Unlock(); |
| | | UpdataUnlockState(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | else if (v.Equals(screenshotImg)) |
| | | { |
| | | //有视频过来可调用此接口进行拍照 |
| | | screenshotImg.Selected = true; |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | string time = format.Format(new Date(SystemClock.CurrentThreadTimeMillis())); |
| | | string ss = Android.OS.Environment.ExternalStorageDirectory.Path + "/DCIM/Camera"; |
| | | string path = ss + "/" + time + ".jpg"; |
| | | CurtActivity.SnapShot(path); |
| | | } |
| | | else if (v.Equals(unlockImg)) |
| | | { |
| | | PostUnlock(); |
| | | CurtActivity.Unlock(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// post 截图 |
| | | /// </summary> |
| | | /// <param name="path">截图保留的路径</param> |
| | | private void PostScreenshot(string path) |
| | | { |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | string[] str = path.Split("/"); |
| | | string img_name = str.GetValue(str.Length - 1).ToString().Replace(".jpg", ""); |
| | | byte[] images = FileUtlis.Files.ReadFileForPath(path); |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("callId", VideoActivity.CallId); |
| | | d.Add("images", images); |
| | | d.Add("imagesName", img_name); |
| | | string jsonString = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | string url = "/home-wisdom/app/fl/vi/screenshot"; |
| | | ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); |
| | | Log.Info("LcVideo", "Post Screenshot Response code=" + response.Code); |
| | | } |
| | | catch { } |
| | | |
| | | }).Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | using Com.Lechange.Opensdk.Media; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON_Android.LeChengView.Form; |
| | | using Java.IO; |
| | | using Java.Lang; |
| | | |
| | | namespace HDL_ON_Android |
| | |
| | | public string PlayToken = "";//播放playToken |
| | | public string CallId = "";//呼叫Id |
| | | private int Type = 0;//0监控,1对讲 |
| | | private string DeviceName = "";// 备注 |
| | | |
| | | /// <summary> |
| | | /// 0:国内,1海外 |
| | | /// </summary> |
| | |
| | | Type = Intent.GetIntExtra("Type", 0);//0监控,1对讲//1 |
| | | Location = Intent.GetIntExtra("Location", 0);//1 |
| | | CallId = Intent.GetStringExtra("callId");//1384766990812426242 |
| | | DeviceName = Intent.GetStringExtra("DeviceName"); |
| | | |
| | | InitLCSDK(); |
| | | |
| | |
| | | ivBack = (ImageView)FindViewById(Resource.Id.videoBackImg); |
| | | tvName = (TextView)FindViewById(Resource.Id.nameText); |
| | | |
| | | tvName.SetText("DeviceName", null); |
| | | tvName.SetText(DeviceName, null); |
| | | ivBack.SetOnClickListener(this); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 开锁 |
| | | /// </summary> |
| | | public void Unlock() |
| | | { |
| | | // |
| | | Dictionary<string, object> dic = new Dictionary<string, object>(); |
| | | dic.Add("deviceId", this.DeviceId); |
| | | dic.Add("callId", this.CallId); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(dic); |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome("/home-wisdom/platform/imou/openDoorbell", requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | Toast.MakeText(this, Resources.GetString(Resource.String.unlock_success), ToastLength.Short).Show(); |
| | | } |
| | | else |
| | | { |
| | | Toast.MakeText(this, Resources.GetString(Resource.String.unlock_fail), ToastLength.Short).Show(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 截图 |
| | | /// </summary> |
| | | /// <param name="path"></param> |
| | | public void SnapShot(string path) |
| | | { |
| | | try |
| | | { |
| | | int code = mPlayWindow.SnapShot(path); |
| | | if (code == 0) |
| | | { |
| | | //Android.Provider.MediaStore.Images.Media.InsertImage(this.getContentResolver(), path, "ss", "ss"); |
| | | Toast.MakeText(this, Resources.GetString(Resource.String.screenshot_success), ToastLength.Short).Show(); |
| | | } |
| | | else |
| | | { |
| | | Toast.MakeText(this, Resources.GetString(Resource.String.screenshot_fail), ToastLength.Short).Show(); |
| | | } |
| | | } |
| | | catch (System.Exception e) |
| | | { |
| | | string error = e.Message; |
| | | } |
| | | |
| | | //运行到这,photoFile已经存在,这里需要获得这个文件的uri |
| | | //* 分两种情况,android7.0以上和以下 |
| | | // 先存入临时目录,然后再移动到相册目录中 |
| | | //File photoFile = new File(path); |
| | | //Android.Net.Uri photoUri; |
| | | |
| | | //if (Build.VERSION.SdkInt >= 24) |
| | | //if (Build.VERSION.PreviewSdkInt >= 24) |
| | | //{ |
| | | |
| | | // /** |
| | | // * FileProvider.getUriForFile(),这个方法中需要填写三个参数, |
| | | // * 第一个Context, |
| | | // * 第二个S |
| | | // * tring 任意 |
| | | // * 第三个File |
| | | // */ |
| | | // photoUri = FileProvider.GetUriForFile(this, "HDL Video SnapShot", photoFile); |
| | | |
| | | //} |
| | | //else |
| | | //{ |
| | | // photoUri = Android.Net.Uri.FromFile(photoFile); |
| | | //} |
| | | |
| | | } |
| | | |
| | | private ContentResolver getContentResolver() |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置顶部状态栏背景透明 |
| | | /// </summary> |
| | | private void SetStatusBarColor() |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202107052" android:versionName="1.2.202107052" package="com.hdl.onpro"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202107161" android:versionName="1.2.202107161" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29" /> |
| | | <!-- 乐橙可视对讲需要的权限 --> |
| | | <!--<uses-permission android:name="android.permission.INTERNET" />--> |
| | | <!--网络访问--> |
| | | <!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />--> |
| | | <!--允许程序写入外部存储,如SD卡上写文件,抓图、录制等--> |
| | | <!--<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />--> |
| | | <!--程序可以读取设备外部存储空间(内置SDcard和外置SDCard)的文件,我的文件等--> |
| | | <uses-permission android:name="android.permission.USE_CREDENTIALS" /> |
| | | <!--允许程序请求验证从AccountManager???--> |
| | | <!--<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />--> |
| | | <!--允许改变WiFi多播状态???--> |
| | | <!--<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />--> |
| | | <!--允许程序显示系统窗口,应该已经不适用了???--> |
| | | <!--<uses-permission android:name="android.permission.RECORD_AUDIO" />--> |
| | | <!--允许程序录制声音通过手机或耳机的麦克,对讲、自定义报警音等--> |
| | | <!--<uses-permission android:name="android.permission.CAMERA" />--> |
| | | <!--允许程序访问摄像头进行拍照,二维码扫描补光、拍照上传图片等--> |
| | | <uses-permission android:name="android.permission.FLASHLIGHT" /> |
| | | <!--允许访问闪光灯,二维码扫描补光--> |
| | | <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> |
| | | <!--允许程序修改声音设置信息,声波配对,自动调大音量。需求变更之后应该不需要了???--> |
| | | <!--<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />--> |
| | | <!--允许程序获取当前WiFi接入的状态以及WLAN热点的信息,设备添加何种配网流程使用--> |
| | | <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> |
| | | <!--允许程序改变WiFi状态,配网等--> |
| | | <!--<uses-feature android:name="android.hardware.camera" />--> |
| | | <!--<uses-feature android:name="android.hardware.camera.autofocus" />--> |
| | | <!-- 硬件加速对X5视频播放非常重要,建议开启 --> |
| | | <uses-permission android:name="android.permission.READ_SETTINGS" /> |
| | | <!--允许程序读取系统设置,声波配对获取当前系统音量等--> |
| | | <!-- Optional for location --> |
| | | <!--<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />--> |
| | | <!--允许一个程序访问CellID或 WiFi热点来获取粗略的位置,登陆、设备添加等--> |
| | | <!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />--> |
| | | <!--允许一个程序访问CellID或 WiFi热点来获取精确的位置,登陆、设备添加等???--> |
| | | <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> |
| | | <!--允许应用程序访问额外的位置提供命令,登陆、设备添加等???--> |
| | | <!--<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />--> |
| | | <!--允许程序改变网络状态,如是否联网,配网???--> |
| | | <!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />--> |
| | | <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> |
| | | <!--允许应用程序请求安装包。针对API大于22必须持有该许可使用ACTION_INSTALL_PACKAGE应用。应该没在用???--> |
| | | <uses-permission android:name="android.permission.VIBRATE" /> |
| | | <!-- 可视对讲权限--> |
| | | <uses-permission android:name="android.permission.CAMERA" /> |
| | | <uses-feature android:name="android.hardware.camera" /> |
| | |
| | | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> |
| | | <uses-permission android:name="android.permission.READ_LOGS" /> |
| | | <!-- 极光推送结束 --> |
| | | <application android:debuggable="false" android:allowBackup="true" android:icon="@drawable/Icon" android:networkSecurityConfig="@xml/network_security_config" android:largeHeap="true" android:label="ON+"> |
| | | <application android:allowBackup="true" android:icon="@drawable/Icon" android:networkSecurityConfig="@xml/network_security_config" android:largeHeap="true" android:label="ON+"> |
| | | <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.hdl.onpro.fileProvider" android:grantUriPermissions="true" android:exported="false"> |
| | | <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> |
| | | </provider> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <resources> |
| | | <string name="app_name">HDL_ON_Pro</string> |
| | | <string name="app_name">ON_Plus</string> |
| | | <string name="action_settings">设置</string> |
| | | <string name="video_screenshot">截图</string> |
| | | <string name="video_unlock">开锁</string> |
| | |
| | | <string name="screenshot_success">截图成功</string> |
| | | <string name="talk_open_success">对讲开始</string> |
| | | <string name="talk_open_failed">对讲打开失败</string> |
| | | <string name="unlock_fail">开锁失败</string> |
| | | <string name="screenshot_fail">截图失败</string> |
| | | </resources> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <resources> |
| | | <string name="action_settings">Setting</string> |
| | | <string name="action_settings">Setting</string> |
| | | <string name="video_screenshot">Screenshot</string> |
| | | <string name="video_unlock">Unlock</string> |
| | | <string name="video_answer">Answer</string> |
| | |
| | | <string name="on_the_phone">On the phone</string> |
| | | <string name="unlock_success">Unlock successfully</string> |
| | | <string name="screenshot_success">Screenshot successfully</string> |
| | | <string name="talk_open_success">Intercom Begin</string> |
| | | <string name="talk_open_failed">Intercom failed to open</string> |
| | | |
| | | <string name="talk_open_success">Intercom Begin</string> |
| | | <string name="talk_open_failed">Intercom failed to open</string> |
| | | <string name="unlock_fail">Fail to unlock</string> |
| | | <string name="screenshot_fail">Fail to screenshot</string> |
| | | </resources> |
| | |
| | | <string>AispeechMobile</string> |
| | | </dict> |
| | | <dict> |
| | | <key>CFBundleURLName</key> |
| | | <string>xiaoduapp</string> |
| | | </dict> |
| | | <dict> |
| | | <key>CFBundleURLSchemes</key> |
| | | <array> |
| | | <string>hdlonpro</string> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.2.202107052</string> |
| | | <string>1.2.202107161</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.2.07052</string> |
| | | <string>1.2.07161</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | |
| | | 4000=Video intercom |
| | | 4001=Call record |
| | | 4002=*Cloud photos are only kept for 30 days |
| | | 4002=*Cloud records are only kept for 30 days |
| | | 4003=Door phone call |
| | | 4004=Answered |
| | | 4005=Unlocked |
| | |
| | | 6092=The device does not exist |
| | | 6093=The device is not online |
| | | 6094=The gateway device does not exist |
| | | 6095=More than 30 add buttons |
| | | |
| | | |
| | | 7108=Leak/No Leak |
| | |
| | | |
| | | 4000=可视对讲 |
| | | 4001=通话记录 |
| | | 4002=*云端照片只保留30天 |
| | | 4002=*云端记录只保留30天 |
| | | 4003=门口机呼叫 |
| | | 4004=已接听 |
| | | 4005=已开锁 |
| | |
| | | 6092=设备不存在 |
| | | 6093=设备不在线 |
| | | 6094=网关设备不存在 |
| | | 6095=添加按钮超出30个 |
| | | |
| | | |
| | | |
| | |
| | | //处理剩下的新增功能 |
| | | foreach (var newFunction in deviceList.list) |
| | | { |
| | | MainPage.Log(newFunction.savePath); |
| | | newFunction.AssembleStatus(); |
| | | newFunction.SaveFunctionFile(); |
| | | FunctionList.List.IniFunctionList(newFunction.savePath); |
| | | } |
| | |
| | | UI.Music.A31MusicModel.ReadMusicStates(); |
| | | //搜索网关 |
| | | DriverLayer.Control.Ins.SearchLoaclGateway(); |
| | | //重新连接mqtt |
| | | DAL.Mqtt.MqttClient.DisConnectRemote("刷新数据,重连mqtt",false); |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | Utlis.WriteLine("catch: " + EX.ToString()); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 解析丰林可视对讲推送数据 |
| | | /// </summary> |
| | | /// <param name="jsonStr"></param> |
| | | /// <returns></returns> |
| | | ESVideoInfo GetESOnVideoJson(string jsonStr) |
| | | //{"code":0,"data":{"list":[{"createTime":"1625798305115","modifyTime":"1625798305115","region":"100000000000000001","id":"1413326644794294273","alarmId":"20210709103818-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709103818-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:38:17","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{"createTime":"1625798057197","modifyTime":"1625798057197","region":"100000000000000001","id":"1413325604946640898","alarmId":"20210709103413-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709103413-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:34:12","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797973320","modifyTime":"1625797973320","region":"100000000000000001","id":"1413325253141004289","alarmId":"20210709103236-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709103236-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:32:31","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797782136","modifyTime":"1625797782136","region":"100000000000000001","id":"1413324451261382658","alarmId":"20210709102937-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709102937-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:29:37","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797668771","modifyTime":"1625797668771","region":"100000000000000001","id":"1413323975769915394","alarmId":"20210709102743-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709102743-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:27:42","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797539846","modifyTime":"1625797539846","region":"100000000000000001","id":"1413323435023466498","alarmId":"20210709102534-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709102534-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:25:34","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797530627","modifyTime":"1625797530627","region":"100000000000000001","id":"1413323396351983618","alarmId":"20210709102525-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709102525-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:25:25","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625796028089","modifyTime":"1625796028089","region":"100000000000000001","id":"1413317094255034369","alarmId":"20210709100024-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709100024-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:00:23","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625795974558","modifyTime":"1625795974558","region":"100000000000000001","id":"1413316869729746946","alarmId":"20210709095931-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709095931-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T09:59:31","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625795966933","modifyTime":"1625795966933","region":"100000000000000001","id":"1413316837748178946","alarmId":"20210709095923-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709095923-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T09:59:22","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"}],"totalCount":"13","totalPage":"2","pageNo":"1","pageSize":"10"},"timestamp":"1625807415164","isSuccess":true} |
| | | //{"platform":"1","timestamp":"1625805660249","appKey":"HDL-HOME-APP-TEST","sign":"02e433c40485b30451ebdc5ca3cd959c","deviceSerial":"F41014762","homeId":"1396717478877241345"} |
| | | /// <summary> |
| | | /// 解析丰林可视对讲推送数据 |
| | | /// </summary> |
| | | /// <param name="jsonStr"></param> |
| | | /// <returns></returns> |
| | | ESVideoInfo GetESOnVideoJson(string jsonStr) |
| | | { |
| | | try |
| | | { |
| | |
| | | Android.Content.Intent intent = new Android.Content.Intent(); |
| | | var bundle = new Android.OS.Bundle(); |
| | | //传递name参数为tinyphp |
| | | bundle.PutString("Token", ezChildAccessToken.accessToken); |
| | | bundle.PutString("EzChildAccessToken", ezChildAccessToken); |
| | | bundle.PutString("HdlToken", UserInfo.Current.LoginTokenString); |
| | | bundle.PutString("Url", OnAppConfig.Instance.RequestHttpsHost); |
| | | bundle.PutString("EzvizAppKey", "1aa98a90489b4838b966b57018b4b04b"); |
| | | bundle.PutInt("Platform", 1); |
| | | bundle.PutString("HomeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | intent.PutExtras(bundle); |
| | | intent.SetComponent(new Android.Content.ComponentName(Shared.Application.Activity, "com.videogo.MainActivity")); |
| | | Shared.Application.Activity.StartActivity(intent); |
| | |
| | | public const int shebeibucunzai = 6092; |
| | | public const int shebeibuzaixian = 6093; |
| | | public const int wangguanshebeibuzaixian = 6094; |
| | | public const int anniuchaochu30 = 6095; |
| | | |
| | | |
| | | public const int newAutomation = 7000; |
| | | public const int editAutomation = 7001; |
| | |
| | | //远程通讯 |
| | | else |
| | | { |
| | | //Bug修复:一端口远程控制调光设备的调光属性时,无法控制到0,反复横跳。 |
| | | //因为On + 远程控制发送给云端使用的是link协议数据,杨涛中转给高胜处理时候逻辑上有冲突,导致无法单独控制亮度值,需要同时发送开关值与亮度值。 |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | if (commandDictionary.Count == 1) |
| | | { |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.Brightness)) |
| | | { |
| | | commandDictionary.Add(FunctionAttributeKey.OnOff, commandDictionary[FunctionAttributeKey.Brightness] == "0" ? "off" : "on"); |
| | | } |
| | | } |
| | | if(function.spk == SPK.LightCCT) |
| | | { |
| | | if (!commandDictionary.ContainsKey(FunctionAttributeKey.CCT)) |
| | | { |
| | | commandDictionary.Add(FunctionAttributeKey.CCT, function.GetAttrState(FunctionAttributeKey.CCT)); |
| | | } |
| | | } |
| | | } |
| | | DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest(); |
| | | //ALink控制、Bus控制使用同一个接口控制,由云端负责解析 |
| | | var apiControlData = function.GetApiControlData(commandDictionary); |
| | |
| | | } |
| | | |
| | | var count = 0; |
| | | var logString = open ? "打开\r\n" : "关闭\r\n"; |
| | | List<ApiAlinkControlActionObj> actionObjs = new List<ApiAlinkControlActionObj>(); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, open ? "on" : "off"); |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | foreach (var temp in functions) |
| | | //一端口全开全关需要延时发送 |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | logString += temp.spk + ":" + temp.sid + "\r\n"; |
| | | var apiControlData = temp.GetApiControlData(d); |
| | | actionObjs.Add(apiControlData); |
| | | count++; |
| | | if (count > 9) |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var result = pm.ControlDevice(actionObjs); |
| | | actionObjs = new List<ApiAlinkControlActionObj>(); |
| | | count = 0; |
| | | MainPage.Log(logString); |
| | | logString = ""; |
| | | } |
| | | foreach (var temp in functions) |
| | | { |
| | | var apiControlData = temp.GetApiControlData(d); |
| | | var result = pm.ControlDevice(new List<ApiAlinkControlActionObj>() { apiControlData }); |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | var pack = pm.ControlDevice(actionObjs); |
| | | MainPage.Log(logString); |
| | | else |
| | | { |
| | | foreach (var temp in functions) |
| | | { |
| | | var apiControlData = temp.GetApiControlData(d); |
| | | actionObjs.Add(apiControlData); |
| | | count++; |
| | | if (count > 9) |
| | | { |
| | | var result = pm.ControlDevice(actionObjs); |
| | | actionObjs = new List<ApiAlinkControlActionObj>(); |
| | | count = 0; |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | } |
| | | var pack = pm.ControlDevice(actionObjs); |
| | | } |
| | | } |
| | | |
| | | public void SendApiReadCommand(List<string> functionIds) |
| | |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.SensorEnvironment: |
| | | if (localFunction.GetAttributes().Contains(FunctionAttributeKey.Temperature)) |
| | | { |
| | | HomePage.LoadEvent_RefreshEnvirIndoorTemp(); |
| | | } |
| | | if (localFunction.GetAttributes().Contains(FunctionAttributeKey.Humidity)) |
| | | { |
| | | HomePage.LoadEvent_RefreshEnvirIndoorHumi(); |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | SocketPage.UpdataState(localFunction); |
| | | break; |
| | |
| | | switch (function.spk) |
| | | { |
| | | case SPK.LightCCT: |
| | | byte b0 = 100;//开关操作依据on_off字段,实际开关值依据brightness,当on_off为打开,brightness不能为0 |
| | | if(commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | byte b0 = 100; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | b0 = 0; |
| | | } |
| | | else |
| | | { |
| | | b0 = function.lastBrightness == 0 ? (byte)100 : Convert.ToByte(function.lastBrightness); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | b0 = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness));// == 0 ? (byte)100 : Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | b0 = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | } |
| | | var bytes0 = new byte[] { function.bus.LoopId, |
| | | b0, |
| | |
| | | ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes0, 1); |
| | | break; |
| | | case SPK.LightRGB: |
| | | byte b = 100;//开关操作依据on_off字段,实际开关值依据brightness,当on_off为打开,brightness不能为0 |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | byte b = 100; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | | b = 0; |
| | | } |
| | | else |
| | | { |
| | | byte lightBri1 = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | if (lightBri1 == 0) |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | b = 100; |
| | | b = 0; |
| | | } |
| | | else |
| | | { |
| | | b = lightBri1; |
| | | b = function.lastBrightness == 0 ? (byte)100 : Convert.ToByte(function.lastBrightness); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | b = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | } |
| | | var tempLight = new Light(); |
| | | var bytes = new byte[] { function.bus.LoopId, |
| | |
| | | break; |
| | | case SPK.LightDimming: |
| | | byte b1 = 100; |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | | b1 = 0; |
| | | } |
| | | else |
| | | { |
| | | byte lightBri = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | if (lightBri == 0) |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | b1 = 100; |
| | | b1 = 0; |
| | | } |
| | | else |
| | | { |
| | | b1 = lightBri; |
| | | b1 = function.lastBrightness == 0 ? (byte)100 : Convert.ToByte(function.lastBrightness); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | b1 = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | } |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { |
| | | function.bus.LoopId, |
| | | b1, |
| | |
| | | light.trait_on_off.curValue = receiveBytes[light.bus.LoopId] == 0 ? "off" : "on"; |
| | | if (light.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | light.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[2].ToString()); |
| | | light.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[i+1].ToString()); |
| | | light.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[2] + "%"; |
| | | } |
| | | HomePage.UpdataFunctionStates(light); |
| | |
| | | /// <summary> |
| | | /// 加密通讯KEY |
| | | /// </summary> |
| | | static string mqttEncryptKey = ""; |
| | | //static string mqttEncryptKey = ""; |
| | | static string tuyaEncryptKey = ""; |
| | | //static string checkGatewayTopicBase64 = ""; |
| | | static bool hadGateway = true; |
| | |
| | | try |
| | | { |
| | | var topic = e.ApplicationMessage.Topic; |
| | | //MainPage.Log($"收到mqtt主题:{topic}"); |
| | | MainPage.Log($"收到mqtt主题:{topic}"); |
| | | //一端口主题处理 |
| | | if (DB_ResidenceData.Instance.GatewayType == 0 && !DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) |
| | | { |
| | |
| | | } |
| | | |
| | | //一些特殊的主题处理(为了执行速度,尽可能的别加耗时的操作 true:执行了特殊处理 false:没有执行特殊处理) |
| | | Stan.HdlCloudReceiveLogic.Current.CloudOverallMsgReceiveEx(topic, e.ApplicationMessage.Payload, mqttEncryptKey, tuyaEncryptKey); |
| | | Stan.HdlCloudReceiveLogic.Current.CloudOverallMsgReceiveEx(topic, e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey, tuyaEncryptKey); |
| | | |
| | | if (topic == $"/BusGateWayToClient/{UserInfo.Current.ID}" + PushNotifySqueeze) |
| | | { |
| | |
| | | { |
| | | var pm = new HttpServerRequest(); |
| | | pm.GetHomeGatewayList(); |
| | | MainPage.Log($"网关密钥变更"); |
| | | MainPage.Log($"旧密钥:{mqttEncryptKey}"); |
| | | mqttEncryptKey = MqttInfoConfig.Current.HomeGatewayInfo.aesKey; |
| | | MainPage.Log($"新密钥:{mqttEncryptKey}"); |
| | | MainPage.Log($"网关密钥变更.新密钥:{DB_ResidenceData.Instance.HomeGateway.aesKey}"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | //bus数据解析 |
| | | var packet = new Packet(); |
| | | |
| | | if (!string.IsNullOrEmpty(mqttEncryptKey)) |
| | | if (!string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.aesKey)) |
| | | { |
| | | packet.Bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, mqttEncryptKey); |
| | | packet.Bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | mqttEncryptKey = MqttInfoConfig.Current.HomeGatewayInfo.aesKey; |
| | | //mqttEncryptKey = MqttInfoConfig.Current.HomeGatewayInfo.aesKey; |
| | | //解密密钥规则:已现有的住宅ID为基准,从右边一一获取值,最后如果不够16位,则往右补零 |
| | | string aesKey = string.Empty; |
| | | for (int i = DB_ResidenceData.Instance.CurrentRegion.id.Length - 1; i >= 0; i--) |
| | |
| | | { |
| | | case 0: |
| | | topicName = $"/ClientToBusGateWay/{MqttInfoConfig.Current.HomeGatewayInfo.gatewayId}/Common/ON"; |
| | | if (!string.IsNullOrEmpty(mqttEncryptKey)) |
| | | if (!string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.aesKey)) |
| | | { |
| | | message = Securitys.EncryptionService.AesEncryptPayload(message, mqttEncryptKey); |
| | | message = Securitys.EncryptionService.AesEncryptPayload(message, DB_ResidenceData.Instance.HomeGateway.aesKey); |
| | | } |
| | | await RemoteMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topicName, Payload = message, Retain = false, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce }); |
| | | break; |
| | |
| | | d.Add("actions", actionObjs); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | MainPage.Log($"{requestJson}"); |
| | | MainPage.Log($"api功能控制:{requestJson}"); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlDevice, requestJson); |
| | | } |
| | | /// <summary> |
| | |
| | | /// 公共域名就近解析 |
| | | /// |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) |
| | | { |
| | | intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.LeChengVideoActivity)); |
| | | } else if (interphoneType == InterphoneType.EZVIZ.ToString()) |
| | | } |
| | | else if (interphoneType == InterphoneType.EZVIZ.ToString()) |
| | | { |
| | | //萤石猫眼呼叫处理 |
| | | ((BaseActivity)Shared.Application.Activity).SetCamera(b => |
| | | { |
| | | if (b) |
| | | { |
| | | intent = new Android.Content.Intent(); |
| | | var bundle = new Android.OS.Bundle(); |
| | | //传递name参数为tinyphp |
| | | bundle.PutString("EzChildAccessToken", mESVideoInfo.Lc_AccessToken); |
| | | bundle.PutString("HdlToken", UserInfo.Current.LoginTokenString); |
| | | bundle.PutString("Url", OnAppConfig.Instance.RequestHttpsHost); |
| | | bundle.PutString("EzvizAppKey", "1aa98a90489b4838b966b57018b4b04b"); |
| | | bundle.PutInt("Platform", 1); |
| | | bundle.PutString("HomeId", mESVideoInfo.HomeId); |
| | | bundle.PutString("DeviceSerial", mESVideoInfo.DeviceSerial); |
| | | intent.PutExtras(bundle); |
| | | intent.SetComponent(new Android.Content.ComponentName(Shared.Application.Activity, "com.videogo.MainActivity")); |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | |
| | | return _trait_on_off; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 功能的属性状态列表 |
| | | /// </summary> |
| | | public List<AttributesStatus> status = new List<AttributesStatus>(); |
| | | /// <summary> |
| | | /// 通过状态列表组装属性里面的状态 |
| | | /// </summary> |
| | | public void AssembleStatus() |
| | | { |
| | | foreach (var sta in status) |
| | | { |
| | | SetAttrState(sta.key, sta.value); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 使用次数 |
| | |
| | | { |
| | | attr.curValue = "off"; |
| | | } |
| | | else |
| | | else if (attr.key == FunctionAttributeKey.Mode ) |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | attr.curValue = "0"; |
| | | } |
| | | else |
| | | { |
| | | if (SPK.AcSpkList().Contains(spk)) |
| | | { |
| | | attr.curValue = "cool"; |
| | | } |
| | | else if (SPK.FhSpkList().Contains(spk)) |
| | | { |
| | | attr.curValue = "day"; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | attr.curValue = "0"; |
| | | } |
| | |
| | | { |
| | | double vv = 16; |
| | | Double.TryParse(attr.curValue.ToString(), out vv); |
| | | if (vv == 0) |
| | | { |
| | | vv = 26; |
| | | } |
| | | sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = Convert.ToInt32(vv).ToString() }); |
| | | } |
| | | else |
| | |
| | | public List<AttributesStatus> status = new List<AttributesStatus>(); |
| | | } |
| | | /// <summary> |
| | | /// a协议控制动作数据 |
| | | /// 功能属性状态 |
| | | /// </summary> |
| | | public class AttributesStatus |
| | | { |
| | |
| | | /// </summary> |
| | | public object curValue = new object(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 功能属性键名列表 |
| | | /// </summary> |
| | |
| | | /// 空调、地热//app自加 |
| | | /// </summary> |
| | | public const string TempType = "temperature_type"; |
| | | |
| | | /// <summary> |
| | | /// 时间标记 |
| | | /// 地热//app自加 |
| | |
| | | /// 湿度 |
| | | /// </summary> |
| | | public const string Humidity = "humidity"; |
| | | /// <summary> |
| | | /// 温度 |
| | | /// </summary> |
| | | public const string Temperature = "temperature"; |
| | | /// <summary> |
| | | /// 室内温度 |
| | | /// </summary> |
| | |
| | | spkList.Add(SensorCO2); |
| | | spkList.Add(SensorTVOC); |
| | | spkList.Add(SensorHumidity); |
| | | spkList.Add(SensorEnvironment); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// 创建该场景的用户ID |
| | | /// </summary> |
| | | public string userId = ""; |
| | | public string userId = UserInfo.Current.ID; |
| | | |
| | | ///// <summary> |
| | | ///// 场景背景 |
| | |
| | | /// 获取指定属性的显示文本 |
| | | /// 中英文显示 |
| | | /// </summary> |
| | | public string GetValueText() |
| | | public string GetValueText(string temp = "") |
| | | { |
| | | string catchString = value; |
| | | if(temp!= "") |
| | | { |
| | | catchString = temp; |
| | | } |
| | | string text = ""; |
| | | switch (key) |
| | | { |
| | | case FunctionAttributeKey.OnOff: |
| | | text = value == "on" ? Language.StringByID(StringId.On) : Language.StringByID(StringId.OFF); |
| | | text = catchString == "on" ? Language.StringByID(StringId.On) : Language.StringByID(StringId.OFF); |
| | | break; |
| | | case FunctionAttributeKey.SetTemp: |
| | | case FunctionAttributeKey.RoomTemp: |
| | | case FunctionAttributeKey.Brightness: |
| | | case FunctionAttributeKey.Percent: |
| | | if (value == "") |
| | | if (catchString == "") |
| | | { |
| | | value = "0"; |
| | | catchString = "0"; |
| | | } |
| | | text = value; |
| | | text = catchString; |
| | | break; |
| | | case FunctionAttributeKey.Mode: |
| | | switch (value) |
| | | switch (catchString) |
| | | { |
| | | //----空调 |
| | | case "auto": |
| | |
| | | text = Language.StringByID(StringId.AirSupply); |
| | | break; |
| | | //-----地热 |
| | | // 1:普通,2:白天,3:夜晚,4:离开,5:时间 |
| | | case "day": |
| | | text = Language.StringByID(StringId.Day); |
| | | break; |
| | |
| | | } |
| | | break; |
| | | case FunctionAttributeKey.FanSpeed: |
| | | switch (value) |
| | | switch (catchString) |
| | | { |
| | | case "high": |
| | | text = Language.StringByID(StringId.HighWindSpeed); |
| | |
| | | var revPack = pm.AddScene(scene); |
| | | if (revPack.Code == StateCode.SUCCESS) |
| | | { |
| | | var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(revPack.Data.ToString()); |
| | | tempScene = sceneList.Find((obj) => obj.sid == scene.sid); |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(tempScene)); |
| | | FileUtlis.Files.WriteFileByBytes(scene.savePath, ssd); |
| | | result = tempScene; |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(scene)); |
| | | FileUtlis.Files.WriteFileByBytes(scene.savePath, ssd); |
| | | result = scene; |
| | | } |
| | | else |
| | | { |
| | | var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(revPack.Data.ToString()); |
| | | tempScene = sceneList.Find((obj) => obj.sid == scene.sid); |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(tempScene)); |
| | | FileUtlis.Files.WriteFileByBytes(scene.savePath, ssd); |
| | | result = tempScene; |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.2.0705"; |
| | | public static string VersionString = "1.2.0716"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | public static List<string> RoomNotSupportFunctionList = new List<string> |
| | | { |
| | | SPK.EnergyStandard, |
| | | SPK.MusicStandard, |
| | | }; |
| | | |
| | | |
| | |
| | | using System.Collections.Generic; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading; |
| | | using HDL_ON.Common; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | |
| | | { |
| | | //etAccount.Text = "tf@smarttech.com.ua";//国外账号,有住宅,登录无法显示 |
| | | //etAccount.Text = "13375012446";//测试服务器 |
| | | etAccount.Text = "13450425803"; |
| | | //etAccount.Text = "13450425803"; |
| | | //etAccount.Text = "1033326940@qq.com"; |
| | | //etAccount.Text = "18022428438";//wjc |
| | | //etAccount.Text = "13602944661";//kx |
| | |
| | | //etAccount.Text = "18316120654";//tujie |
| | | // "15622703419"lwn;// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 |
| | | etAccount.Text = "15626203746"; |
| | | //etAccount.Text = "13450425807";//黄竹溪 knx项目 |
| | | } |
| | | else |
| | | { |
| | |
| | | //etAccount.Text = "15217626103";// |
| | | //etAccount.Text = "13682244600";//波哥 |
| | | //etAccount.Text = "13168123446";//昆明金茂项目,新风问题 |
| | | etAccount.Text = "551775569@qq.com"; |
| | | etAccount.Text = "2949126848@qq.com";//陈琳cct测试 |
| | | //etAccount.Text = "2949126848@qq.com";//陈琳 |
| | | //etAccount.Text = "13168123446"; |
| | | //etAccount.Text = "13676202754";//巴林服务器 |
| | | //etAccount.Text = "13602944661";//kx |
| | | //etAccount.Text = "551775569@qq.com";//wcf |
| | | //etAccount.Text = "18666455392";//13375012446//13602944661//tzy 18778381374 |
| | | //etAccount.Text = "15971583093";// gs//tzy 274116637@qq.com//Sumant.Bhatia@havells.com 国外服务器测试 |
| | | //etAccount.Text = "15971583093";//高胜 |
| | | etAccount.Text = "15217626103";//昆明金茂项目 |
| | | } |
| | | b = !b; |
| | | etPassword.Text = "123456"; |
| | |
| | | IsBold = true, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = "Dome模式" |
| | | Text = "Demo模式" |
| | | }; |
| | | bodyView.AddChidren(btnDomeLogin); |
| | | |
| | | if(Language.CurrentLanguage!= "Chinese") |
| | | { |
| | | btnDomeLogin.Text = "Experience model"; |
| | | } |
| | | |
| | | btnDomeLogin.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | MainPage.NoLoginMode = true; |
| | | #if DEBUG |
| | | FileUtlis.Files.DeleteAllFile(); |
| | | #endif |
| | | //DB_ResidenceData.Instance.HomeGateway.gatewayType = "AGATEWAY"; |
| | | //楼层房间列表 |
| | | var floor1 = new SpatialInfo("FLOOR") { roomName = "F1", parentId = DB_ResidenceData.Instance.CurrentRegion.id }; |
| | | floor1.SaveRoomFile(); |
| | |
| | | { |
| | | sid = "light4", |
| | | deviceId = "light4", |
| | | name = Language.CurrentLanguage == "Chinese" ? "大灯" : "light 1" , |
| | | spk = SPK.LightSwitch, |
| | | roomIds = new List<string>() { "1405771024583090178"}, |
| | | name = Language.CurrentLanguage == "Chinese" ? "大灯" : "light 1", |
| | | spk = SPK.LightDimming, |
| | | roomIds = new List<string>() { "1405771024583090178" }, |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" }, |
| | | new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="100",state = "100" }, |
| | | new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | }, |
| | | }; |
| | |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" }, |
| | | new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | }, |
| | | }; |
| | |
| | | { |
| | | new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" }, |
| | | new FunctionAttributes() { key = "mode",value =new List<string>(){ "day", "night", "away", "normal", "timer" }, curValue="day",state = "day" }, |
| | | new FunctionAttributes() { key = "set_temp",value =new List<string>(){ "" }, curValue="26",state = "26" }, |
| | | new FunctionAttributes() { key = "set_temp",value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 35,min = 5 }, |
| | | new FunctionAttributes() { key = "room_temp",value =new List<string>(){ "" }, curValue="26",state = "26" }, |
| | | }, |
| | | }; |
| | |
| | | sid = "light6", |
| | | deviceId = "light6", |
| | | name = Language.CurrentLanguage == "Chinese" ? "餐厅灯1" : "Dining room light 1", |
| | | spk = SPK.LightSwitch, |
| | | spk = SPK.LightDimming, |
| | | roomIds = new List<string>() { room3.roomId }, |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" }, |
| | | new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="100",state = "100" }, |
| | | new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | }, |
| | | }; |
| | |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" }, |
| | | new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | }, |
| | | }; |
| | |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" }, |
| | | new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | }, |
| | | }; |
| | |
| | | #endregion |
| | | |
| | | var fileList = Common.FileUtlis.Files.ReadFiles(); |
| | | |
| | | //foreach (var file in fileList) |
| | | //{ |
| | | // FunctionList.List.IniFunctionList(file,true); |
| | | //} |
| | | |
| | | foreach(var file in fileList) |
| | | { |
| | | FunctionList.List.IniFunctionList(file,true); |
| | | } |
| | | Room.CurrentSpatial.InitRoomListFunctions(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | #region 环境数据 |
| | | var tempSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorTemperature); |
| | | var humiSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorHumidity); |
| | | var enviList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorEnvironment); |
| | | foreach (var enviTemp in enviList) |
| | | { |
| | | var humiAttr = enviTemp.attributes.Find((obj) => obj.key == "humidity"); |
| | | if (humiAttr != null) |
| | | { |
| | | var newTemp = new Function() |
| | | { |
| | | name = enviTemp.name, |
| | | sid = enviTemp.sid, |
| | | deviceId = enviTemp.deviceId, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = humiAttr.state, curValue = humiAttr.curValue } }, |
| | | }; |
| | | humiSensorList.Add(newTemp); |
| | | } |
| | | var tempAttr = enviTemp.attributes.Find((obj) => obj.key == "temperature"); |
| | | if (tempAttr != null) |
| | | { |
| | | var newTemp = new Function() |
| | | { |
| | | name = enviTemp.name, |
| | | sid = enviTemp.sid, |
| | | deviceId = enviTemp.deviceId, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state, curValue = tempAttr.curValue } }, |
| | | }; |
| | | tempSensorList.Add(newTemp); |
| | | } |
| | | } |
| | | |
| | | var btnEnvirValuesTitle = new Button() { |
| | | X = Application.GetRealWidth(12), |
| | |
| | | Width = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "Public/FuncInfoSetIcon_white.png", |
| | | }; |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | if (scene.userId == UserInfo.Current.ID) |
| | | { |
| | | view.AddChidren(btnSettingIcon); |
| | | } |
| | |
| | | if (bodyView != null) |
| | | { |
| | | var humiSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorHumidity); |
| | | var enviSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorEnvironment); |
| | | foreach (var enviTemp in enviSensorList) |
| | | { |
| | | var tempAttr = enviTemp.attributes.Find((obj) => obj.key == "humidity"); |
| | | if (tempAttr != null) |
| | | { |
| | | var newTemp = new Function() |
| | | { |
| | | name = enviTemp.name, |
| | | sid = enviTemp.sid, |
| | | deviceId = enviTemp.deviceId, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state, curValue = tempAttr.curValue } }, |
| | | }; |
| | | humiSensorList.Add(newTemp); |
| | | } |
| | | } |
| | | double humiTotalValues = 0; |
| | | foreach (var temp in humiSensorList) |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新室内传感器数据-晚点 |
| | | /// 更新室内传感器数据 |
| | | /// </summary> |
| | | public static void LoadEvent_RefreshEnvirIndoorTemp() |
| | | { |
| | |
| | | if (bodyView != null) |
| | | { |
| | | var tempSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorTemperature); |
| | | var enviSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorEnvironment); |
| | | foreach (var enviTemp in enviSensorList) |
| | | { |
| | | var tempAttr = enviTemp.attributes.Find((obj) => obj.key == "temperature"); |
| | | if (tempAttr != null) |
| | | { |
| | | var newTemp = new Function() |
| | | { |
| | | name = enviTemp.name, |
| | | sid = enviTemp.sid, |
| | | deviceId = enviTemp.deviceId, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state, curValue = tempAttr.curValue } }, |
| | | }; |
| | | tempSensorList.Add(newTemp); |
| | | } |
| | | } |
| | | double tempTotalValues = 0; |
| | | foreach (var temp in tempSensorList) |
| | | { |
| | |
| | | } |
| | | }); |
| | | runCount++; |
| | | System.Threading.Thread.Sleep(8); |
| | | System.Threading.Thread.Sleep(12); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | Height = Application.GetRealWidth(192 + 20),//2020-12-01 房间图片比例改回16:9 |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | Tag = room.roomId, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | roomListView.AddChidren(roomView); |
| | | |
| | |
| | | Height = Application.GetRealWidth(70 + 20), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | Tag = room.roomId, |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | roomListView.AddChidren(roomView); |
| | | LoadSmallPirtureRoomRow(roomView, room); |
| | |
| | | roomView.RemoveAll(); |
| | | roomFloorChangeView.BackgroundColor = roomListView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | roomView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | //roomView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | |
| | | var viewbg = new ImageView() |
| | | var viewbg = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(70), |
| | |
| | | |
| | | var btnAllClose = new Button() |
| | | { |
| | | X = Application.GetRealWidth(288), |
| | | Y = Application.GetRealWidth(10), |
| | | Width = Application.GetMinRealAverage(58), |
| | | Height = Application.GetMinRealAverage(58), |
| | | X = Application.GetRealWidth(278), |
| | | Y = Application.GetRealWidth(15), |
| | | Width = Application.GetMinRealAverage(50), |
| | | Height = Application.GetMinRealAverage(50), |
| | | UnSelectedImagePath = "Classification/Room/AllCloseIcon2.png", |
| | | Tag = "AllClose", |
| | | Visible = false |
| | |
| | | functionOnCount = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; |
| | | break; |
| | | case ShowFunction.Music: |
| | | //functionCount = Music.A31MusicModel.A31MusicModelList.Count; |
| | | //functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; |
| | | //if(functionCount == 0) |
| | | //{ |
| | | // functionCount = FunctionList.List.GetMusicList().Count; |
| | | //} |
| | | functionCount = 1; |
| | | functionCount = FunctionList.List.GetMusicList().Count; |
| | | break; |
| | | case ShowFunction.Panel: |
| | | break; |
| | |
| | | new LogicView.TipPopView().TipBox(StringId.tip, StringId.targetNull); |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | Loading loading = new Loading(); |
| | | this.AddChidren(loading); |
| | | HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; |
| | |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | |
| | | try |
| | | { |
| | | //发送新加逻辑命令; |
| | | responsePackNew = Send.AddLogic(Logic.currlogic); |
| | | if (!MainPage.NoLoginMode) |
| | | { |
| | | //发送新加逻辑命令; |
| | | responsePackNew = Send.AddLogic(Logic.currlogic); |
| | | } |
| | | |
| | | } |
| | | catch { } |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | if(MainPage.NoLoginMode) |
| | | { |
| | | Logic.LogicList.Add(Logic.currlogic); |
| | | LogicMethod.CurrLogicMethod.RemoveAllView(); |
| | | MainView.MainShow(); |
| | | return; |
| | | } |
| | | |
| | | if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") |
| | | { |
| | | |
| | | |
| | | //获取逻辑详细返回是一个数组(object类型转换为数组); |
| | | var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); |
| | | for (int a = 0; a < jArray.Count; a++) |
| | |
| | | { |
| | | var value = view.GetValue(key, text); |
| | | selectedState = device.spk + "_"+ key; |
| | | AddDictionary(key, value, "integer"); |
| | | AddDictionary(key, value, "integer","in"); |
| | | Save(device,index, edit); |
| | | }); |
| | | } |
| | |
| | | private void GetEditState(Entity.Function device, int index, Button button1, Button button2, Button button3, Button button4) |
| | | { |
| | | Input inputs = Logic.currlogic.input[index]; |
| | | var dicList = inputs.condition as List<Dictionary<string, string>>; |
| | | var dicList = inputs.condition; |
| | | //清除之前旧数据 |
| | | dicSateteList.Clear(); |
| | | if (dicList.Count != 0) |
| | |
| | | } |
| | | break; |
| | | } |
| | | |
| | | if (!MainView.IsGatewayType) |
| | | { |
| | | name +=Language.StringByID(StringId.push); |
| | | } |
| | | } |
| | | catch { } |
| | | return name; |
| | |
| | | /// <summary> |
| | | /// 判断网关类型(0:bus网关;1:A协议网关) |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | /// <returns>true=A协议网关;false=bus网关</returns> |
| | | public static bool IsGatewayType |
| | | { |
| | | get |
| | |
| | | { |
| | | list.Add(logic.name); |
| | | } |
| | | new LogicView.TipPopView().InputBox(StringId.editName, InpOrOutLogicMethod.GetLogicName(Logic.currlogic), StringId.nameNull, StringId.NameAlreadyExists, list, (logicName, view |
| | | ) => |
| | | new LogicView.TipPopView().InputBox(StringId.editName, InpOrOutLogicMethod.GetLogicName(Logic.currlogic), StringId.nameNull, StringId.NameAlreadyExists, list, (logicName, view) => |
| | | { |
| | | Logic.currlogic.name = logicName; |
| | | Logic.currlogic.sid = LogicMethod.CurrLogicMethod.NewSid(); |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | Logic.currlogic.userLogicId = Guid.NewGuid().ToString(); |
| | | Logic.LogicList.Add(Logic.currlogic); |
| | | LogicMethod.CurrLogicMethod.RemoveAllView(); |
| | | MainView.MainShow(); |
| | | return; |
| | | } |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | |
| | | try |
| | | { |
| | | //发送新加逻辑命令; |
| | |
| | | , (text) => |
| | | { |
| | | var value= pmView.GetValue("pm25", text); |
| | | AddDic("pm2.5", "=", value); |
| | | AddDic("pm2.5", "in", value); |
| | | }); |
| | | } |
| | | /// <summary> |
| | |
| | | IsSelected = scene.collect, |
| | | }; |
| | | view.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | //{ |
| | | // view.AddChidren(btnCollection); |
| | | //} |
| | | btnCollection.MouseUpEventHandler = (sender, e) => { |
| | | scene.collect = btnCollection.IsSelected = !btnCollection.IsSelected; |
| | | scene.CollectScene(); |
| | |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(603 - 50), |
| | | //BackgroundColor = CSS_Color.DividingLineColor, |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealWidth(12) }); |
| | |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(252), |
| | | Height = Application.GetRealWidth(188 + 24), |
| | | Height = Application.GetRealWidth(184), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | |
| | | |
| | | functionListView = new VerticalScrolViewLayout() |
| | | { |
| | | Height = 0, |
| | | Height = Application.GetRealHeight(228+48), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | ScrollEnabled = false, |
| | | }; |
| | | contentView.AddChidren(functionListView); |
| | | |
| | | LoadFunctionRow(functionListView); |
| | | |
| | | Button btnLine1 = new Button() |
| | | { |
| | | //Y = sceneDelayRow.Bottom, |
| | | Height = Application.GetRealHeight(8), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }; |
| | | contentView.AddChidren(btnLine1); |
| | | //Button btnLine1 = new Button() |
| | | //{ |
| | | // //Y = sceneDelayRow.Bottom, |
| | | // Height = Application.GetRealHeight(8), |
| | | //}; |
| | | //contentView.AddChidren(btnLine1); |
| | | |
| | | Button btnLine2 = new Button() |
| | | { |
| | | //Y = sceneDelayRow.Bottom, |
| | | Height = Application.GetRealHeight(228), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }; |
| | | contentView.AddChidren(btnLine2); |
| | | //Button btnLine2 = new Button() |
| | | //{ |
| | | // //Y = sceneDelayRow.Bottom, |
| | | // Height = Application.GetRealHeight(228), |
| | | // BackgroundColor = CSS_Color.DividingLineColor, |
| | | //}; |
| | | //contentView.AddChidren(btnLine2); |
| | | #endregion |
| | | |
| | | Button btnBottomLine = new Button() |
| | |
| | | void LoadFunctionRow(VerticalScrolViewLayout functionListView) |
| | | { |
| | | functionListView.RemoveAll(); |
| | | functionListView.Height = Application.GetRealWidth(65 * scene.functions.Count); |
| | | if (scene.functions.Count > 4) |
| | | { |
| | | functionListView.Height = Application.GetRealWidth(65 * scene.functions.Count); |
| | | } |
| | | foreach (var scenefunction in scene.functions) |
| | | { |
| | | var row = new RowLayout() |
| | |
| | | btnDelSceneFunction.MouseUpEventHandler = (sender, e) => { |
| | | scene.functions.Remove(scenefunction); |
| | | row.RemoveFromParent(); |
| | | functionListView.Height = Application.GetRealWidth(65 * scene.functions.Count); |
| | | if (scene.functions.Count > 4) |
| | | { |
| | | functionListView.Height = Application.GetRealWidth(65 * scene.functions.Count); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | functionListView = new VerticalScrolViewLayout() { |
| | | Height = 0, |
| | | ScrollEnabled = false, |
| | | BackgroundColor = 0xffff0000 |
| | | }; |
| | | contentView.AddChidren(functionListView); |
| | | |
| | |
| | | } |
| | | foreach (var function in functions) |
| | | { |
| | | if (function.Spk_Prefix != FunctionCategory.Light && |
| | | function.Spk_Prefix != FunctionCategory.AC && |
| | | function.Spk_Prefix != FunctionCategory.FloorHeat && |
| | | function.Spk_Prefix != FunctionCategory.Curtain |
| | | ) |
| | | if (!MainPage.SceneSupportFunctionList.Contains(function.spk)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp)); |
| | | break; |
| | | case FunctionAttributeKey.Mode: |
| | | |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Mode)); |
| | | break; |
| | | case FunctionAttributeKey.FanSpeed: |
| | |
| | | }; |
| | | row.AddChidren(btnRight); |
| | | |
| | | |
| | | var showCode = ""; |
| | | |
| | | if (sceneStatus.key == FunctionAttributeKey.Mode) |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | if (SPK.AcSpkList().Contains(sceneFunction.localFunction.spk)) |
| | | { |
| | | //0 制冷1制热,2通风,3自动,4除湿 |
| | | switch (sceneStatus.value) |
| | | { |
| | | case "0": |
| | | showCode = "cool"; |
| | | break; |
| | | case "1": |
| | | showCode = "heat"; |
| | | break; |
| | | case "2": |
| | | showCode = "fan"; |
| | | break; |
| | | case "3": |
| | | showCode = "auto"; |
| | | break; |
| | | case "4": |
| | | showCode = "dry"; |
| | | break; |
| | | } |
| | | } |
| | | else if (SPK.FhSpkList().Contains(sceneFunction.localFunction.spk)) |
| | | { |
| | | //1:普通,2:白天,3:夜晚,4:离开,5:时间 |
| | | switch (sceneStatus.value) |
| | | { |
| | | case "5": |
| | | showCode = "timer"; |
| | | break; |
| | | case "1": |
| | | showCode = "normal"; |
| | | break; |
| | | case "2": |
| | | showCode = "day"; |
| | | break; |
| | | case "3": |
| | | showCode = "night"; |
| | | break; |
| | | case "4": |
| | | showCode = "away"; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | var btnFunctionText = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(330), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = sceneStatus.GetValueText() + sceneStatus.GetUintString() |
| | | Text = sceneStatus.GetValueText(showCode) + sceneStatus.GetUintString() |
| | | }; |
| | | row.AddChidren(btnFunctionText); |
| | | |
| | | |
| | | |
| | | if (sceneStatus.key == FunctionAttributeKey.OnOff) |
| | | { |
| | | btnOnText = btnFunctionText; |
| | |
| | | var lastText = ""; |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | if(DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | if (SPK.AcSpkList().Contains(sceneFunction.localFunction.spk)) |
| | | { |
| | | //0 制冷1制热,2通风,3自动,4除湿 |
| | | for (int i = 0; i < statusList.Count; i++) |
| | | { |
| | | if (statusList[i] == "0") |
| | | { |
| | | statusList[i] = "cool"; |
| | | } |
| | | else if (statusList[i] == "1") |
| | | { |
| | | statusList[i] = "heat"; |
| | | } |
| | | else if (statusList[i] == "2") |
| | | { |
| | | statusList[i] = "fan"; |
| | | } |
| | | else if (statusList[i] == "3") |
| | | { |
| | | statusList[i] = "auto"; |
| | | } |
| | | else if (statusList[i] == "4") |
| | | { |
| | | statusList[i] = "dry"; |
| | | } |
| | | } |
| | | } |
| | | else if (SPK.FhSpkList().Contains(sceneFunction.localFunction.spk)) |
| | | { |
| | | //1:普通,2:白天,3:夜晚,4:离开,5:时间 |
| | | for (int i = 0; i < statusList.Count; i++) |
| | | { |
| | | if (statusList[i] == "5") |
| | | { |
| | | statusList[i] = "timer"; |
| | | } |
| | | else if (statusList[i] == "1") |
| | | { |
| | | statusList[i] = "normal"; |
| | | } |
| | | else if (statusList[i] == "2") |
| | | { |
| | | statusList[i] = "day"; |
| | | } |
| | | else if (statusList[i] == "3") |
| | | { |
| | | statusList[i] = "night"; |
| | | } |
| | | else if (statusList[i] == "4") |
| | | { |
| | | statusList[i] = "away"; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | var pView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Tag = m, |
| | | Text = trait.GetValueText() |
| | | Text = trait.GetValueText(m) |
| | | }; |
| | | row.AddChidren(btnPropertyTitle); |
| | | |
| | |
| | | bool isFrist = true; |
| | | foreach (var device in deviceList) |
| | | { |
| | | //if (!FunctionList.List.DeviceSpk.Contains(device.spk)) |
| | | //{ |
| | | // continue; |
| | | //} |
| | | FrameLayout row = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | |
| | | switch (device.spk) |
| | | { |
| | | case SPK.IrModule: |
| | | new UI2.PersonalCenter.PirDevice.PirMethod().MainView(this, device,()=> {}); |
| | | new UI2.PersonalCenter.PirDevice.PirMethod().MainView(this, device, () => |
| | | { |
| | | contentView.BeginHeaderRefreshing(); |
| | | }); |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | var smPage = new SenesorMegahealthManagerPage(); |
| | |
| | | { |
| | | Button btnExit = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(258) + personalInfoView.Bottom, |
| | | Y = Application.GetRealHeight(288) + personalInfoView.Bottom, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(60), |
| | | Width = Application.GetRealWidth(330), |
| | |
| | | { |
| | | btnSupportText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //throw new Exception("异常测试"); |
| | | |
| | | var getsupportPage = new FAQHelpPage(); |
| | | MainPage.BasePageView.AddChidren(getsupportPage); |
| | | getsupportPage.LoadPage(); |
| | |
| | | ///下一步的点击事件 |
| | | saveBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (control.status.Count > 29) |
| | | { |
| | | ///超出30个红外宝内存满了会出现异常 |
| | | new PirMethod().ErrorShow(null, "添加按钮超出30个"); |
| | | return; |
| | | } |
| | | |
| | | var texts = editText.Text.Trim(); |
| | | if (string.IsNullOrEmpty(editText.Text)) |
| | | { |
| | |
| | | |
| | | //添加数据对象 |
| | | Entity.AttributesStatus buttonObj = new Entity.AttributesStatus(); |
| | | buttonObj.key = "key" + control.status.Count.ToString(); |
| | | string keyName = GetKeyName(control.status); |
| | | buttonObj.key = keyName; |
| | | buttonObj.value = texts; |
| | | |
| | | PirSend.CodeStudy(control, buttonObj, (mqttdate) => |
| | |
| | | { |
| | | replication.RemView(); |
| | | PirMethod method = new PirMethod(); |
| | | method.ErrorShow(null,"添加失败"); |
| | | method.ErrorShow(null, "添加失败"); |
| | | } |
| | | |
| | | }); |
| | |
| | | PirMethod.RefreshView("PirMain"); |
| | | base.RemoveFromParent(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查找唯一健名值 |
| | | /// </summary> |
| | | /// <param name="listKeyName">已经存在健名列表</param> |
| | | /// <returns></returns> |
| | | private string GetKeyName(List<Entity.AttributesStatus> listKeyName) |
| | | { |
| | | //目前红外宝学习按钮最多是30个; |
| | | for (int i = 0; i < 50; i++) |
| | | { |
| | | string keyName = "key" + i.ToString(); |
| | | ///查找是否存在 |
| | | var currKeyName = listKeyName.Find((c) => c.key == keyName); |
| | | if (currKeyName == null) |
| | | { |
| | | return keyName; |
| | | } |
| | | } |
| | | |
| | | return "key" + listKeyName.Count; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | FrameLayout frameLayout = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(64 + 84), |
| | | Height = Application.GetRealHeight(667 - 64 - 84), |
| | | Height = Application.GetRealHeight(667 - 64 - 84-104), |
| | | Width = Application.GetRealWidth(TextSize.view375), |
| | | }; |
| | | this.AddChidren(frameLayout); |
| | |
| | | { |
| | | public class PirMethod |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 红外宝程序主入口 |
| | | /// </summary> |
| | |
| | | { |
| | | str = Language.StringByID(StringId.tianjiashibai); |
| | | } |
| | | else if (text== "添加按钮超出30个") { |
| | | str = Language.StringByID(StringId.anniuchaochu30); |
| | | } |
| | | else |
| | | { |
| | | if (responsePackNew != null) |
| | |
| | | { |
| | | try |
| | | { |
| | | var oldName = floor.roomName; |
| | | floor.roomName = newName; |
| | | var editResult = SpatialInfo.CurrentSpatial.UpdateFloor(floor); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (editResult == DAL.Server.StateCode.SUCCESS) |
| | | { |
| | | floor.roomName = newName; |
| | | btn.Text = newName; |
| | | } |
| | | else |
| | | { |
| | | floor.roomName = oldName; |
| | | } |
| | | }); |
| | | } |
| | | catch { } |
| | |
| | | Button btnModeIcon = new Button() |
| | | { |
| | | X = btnTitle.X, |
| | | Y = Application.GetRealHeight(41 * (modeList.IndexOf(m) + 1) + 10 + 8), |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealWidth(30), |
| | | Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | IsSelected = device.GetAttrState(FunctionAttributeKey.Swing) == m, |
| | | }; |
| | | modeChangeView.AddChidren(btnModeIcon); |
| | |
| | | }; |
| | | modeChangeView.AddChidren(btnModeText); |
| | | |
| | | btnModeIcon.UnSelectedImagePath = acFunction.GetSwingIconPath(m, false); |
| | | btnModeIcon.SelectedImagePath = acFunction.GetSwingIconPath(m); |
| | | btnModeText.Text = acFunction.GetSwingAttrText(m); |
| | | |
| | | if (modeList.IndexOf(m) < modeList.Count - 1) |
| | | { |
| | | modeChangeView.AddChidren(new Button() |
| | |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }); |
| | | } |
| | | |
| | | btnModeIcon.UnSelectedImagePath = acFunction.GetSwingIconPath(m, false); |
| | | btnModeIcon.SelectedImagePath = acFunction.GetSwingIconPath(m); |
| | | btnModeText.Text = acFunction.GetSwingAttrText(m); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | |
| | | |
| | | //添加数据对象 |
| | | AttributesStatus buttonObj = new AttributesStatus(); |
| | | |
| | | //防止key不唯一 |
| | | var attrCount = control.attributes.Count; |
| | | var keyString = "key" + attrCount; |
| | | while (true) |
| | | { |
| | | if (control.attributes.Find((obj) => obj.key == keyString) == null) |
| | | { |
| | | break; |
| | | } |
| | | keyString = "key" + (++attrCount); |
| | | } |
| | | buttonObj.key = "key" + control.attributes.Count.ToString(); |
| | | buttonObj.value = texts; |
| | | |
| | |
| | | int index = 0; |
| | | foreach (var sensor in FunctionList.List.GetEnvirSensorsList()) |
| | | { |
| | | LoadSensorDiv(sensor, index); |
| | | index++; |
| | | if(sensor.spk == SPK.SensorEnvironment) |
| | | { |
| | | foreach (var seTemp in sensor.attributes) |
| | | { |
| | | var newTemp = new Function() |
| | | { |
| | | name = sensor.name, |
| | | sid = sensor.sid, |
| | | deviceId = sensor.deviceId, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state, curValue = seTemp.curValue } }, |
| | | }; |
| | | switch (seTemp.key) |
| | | { |
| | | case "co2": |
| | | newTemp.spk = SPK.SensorCO2; |
| | | break; |
| | | case "pm25": |
| | | newTemp.spk = SPK.SensorPm25; |
| | | break; |
| | | case "humidity": |
| | | newTemp.spk = SPK.SensorHumidity; |
| | | break; |
| | | case "temperature": |
| | | newTemp.spk = SPK.SensorTemperature; |
| | | break; |
| | | case "tvoc": |
| | | newTemp.spk = SPK.SensorTVOC; |
| | | break; |
| | | } |
| | | LoadSensorDiv(newTemp, index); |
| | | index++; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | #if DEBUG |
| | | continue; |
| | | #endif |
| | | LoadSensorDiv(sensor, index); |
| | | index++; |
| | | } |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Control.Ins.SendReadCommand(sensor); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | var levelColorList = sensorTemp.GetLevelColorList(sensor.spk); |
| | | var levelTextList = sensorTemp.GetLevelTextList(sensor.spk); |
| | | |
| | | if (room.roomId == "" || sensor.roomIds.Contains(room.roomId)) |
| | | { |
| | | var sensorTag = sensor.sid; |
| | | var sensorTag = sensor.spk + sensor.sid + sensor.deviceId; |
| | | FrameLayout sensorView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(7), |
| | |
| | | #endregion |
| | | }; |
| | | |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Control.Ins.SendReadCommand(sensor); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | if (updateTemp.spk == SPK.SensorEnvironment) |
| | | { |
| | | foreach (var seTemp in updateTemp.attributes) |
| | | { |
| | | var newTemp = new Function() |
| | | { |
| | | name = updateTemp.name, |
| | | sid = updateTemp.sid, |
| | | deviceId = updateTemp.deviceId, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state ,curValue = seTemp.curValue} }, |
| | | }; |
| | | switch (seTemp.key) |
| | | { |
| | | case "co2": |
| | | newTemp.spk = SPK.SensorCO2; |
| | | break; |
| | | case "pm25": |
| | | newTemp.spk = SPK.SensorPm25; |
| | | break; |
| | | case "humidity": |
| | | newTemp.spk = SPK.SensorHumidity; |
| | | break; |
| | | case "temperature": |
| | | newTemp.spk = SPK.SensorTemperature; |
| | | break; |
| | | case "tvoc": |
| | | newTemp.spk = SPK.SensorTVOC; |
| | | break; |
| | | } |
| | | if(!string.IsNullOrEmpty(newTemp.spk)) |
| | | { |
| | | LoadEvent_UpdataStatus(newTemp); |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++) |
| | | { |
| | | var sensorTag = updateTemp.sid; |
| | | var sensorTag = updateTemp.spk + updateTemp.sid + updateTemp.deviceId; |
| | | var view = bodyView.sensorListView.GetChildren(i); |
| | | if (view.GetType() == typeof(FrameLayout)) |
| | | { |
| | |
| | | } |
| | | |
| | | var temp = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | if (temp < Convert.ToInt32(function.GetAttribute(FunctionAttributeKey.SetTemp).min)) |
| | | if (temp <= Convert.ToInt32(function.GetAttribute(FunctionAttributeKey.SetTemp).min)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | return; |
| | | } |
| | | var temp =(int) Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | if (temp > Convert.ToDouble(function.GetAttribute(FunctionAttributeKey.SetTemp).max)) |
| | | if (temp >= Convert.ToDouble(function.GetAttribute(FunctionAttributeKey.SetTemp).max)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | { |
| | | var utcTime = Convert.ToDateTime(str); |
| | | var dateTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, TimeZoneInfo.Local); |
| | | return dateTime.ToString("HH") + ":" + dateTime.ToString("mm"); |
| | | return dateTime.ToString("MM-dd HH:mm"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取呼叫状态文本 |
| | | /// </summary> |
| | |
| | | //2020-12-07 增加版本检测更新方法 |
| | | HDLCommon.Current.CheckIfNeedForceUpdate(); |
| | | |
| | | #if __Android__ |
| | | //开启定位服务 |
| | | Shared.Application.StartGPSLocationService(); |
| | | #endif |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | }; |
| | | navigationView.AddChidren(NavigationSubView); |
| | | |
| | | #region 收藏区域 |
| | | #region 收藏区域 |
| | | collectionView = new FrameLayout() { |
| | | Width = Application.GetRealWidth(94), |
| | | }; |
| | |
| | | IsSelected = true, |
| | | }; |
| | | collectionView.AddChidren(btnCollectionText); |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 分类区域 |
| | | #region 分类区域 |
| | | classificationView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(94), |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | classificationView.AddChidren(btnClassificationText); |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 智能区域 |
| | | #region 智能区域 |
| | | intellectualizationView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(94), |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | intellectualizationView.AddChidren(btnIntellectualizationText); |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 个人中心 |
| | | #region 个人中心 |
| | | personalCenterView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(94), |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | personalCenterView.AddChidren(btnPersonalCenterText); |
| | | #endregion |
| | | #endregion |
| | | |
| | | var homePage = new HomePage(); |
| | | ContextView.AddChidren(homePage); |
| | |
| | | btnClassificationText.IsSelected = false; |
| | | btnIntellectualizationText.IsSelected = false; |
| | | btnPersonalCenterText.IsSelected = false; |
| | | #region 移动动画 |
| | | #region 移动动画 |
| | | //移动距离 |
| | | var distance = navigationSelectionView.X - collectionView.X + Application.GetRealWidth(94*3); |
| | | int total = 10; |
| | |
| | | btnNavigationSelectionIcon.SetRotation(0f); |
| | | }); |
| | | }) { IsBackground = true ,Priority = System.Threading.ThreadPriority.Highest}.Start(); |
| | | #endregion |
| | | #endregion |
| | | ContextView.RemoveAll(); |
| | | var homePage = new HomePage(); |
| | | ContextView.AddChidren(homePage); |
| | |
| | | btnClassificationText.IsSelected = false; |
| | | btnIntellectualizationText.IsSelected = false; |
| | | btnPersonalCenterText.IsSelected = false; |
| | | #region 移动动画 |
| | | #region 移动动画 |
| | | var distance = navigationSelectionView.X - classificationView.X + Application.GetRealWidth(94 * 3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | |
| | | }); |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Highest }.Start(); |
| | | #endregion |
| | | #endregion |
| | | ContextView.RemoveAll(); |
| | | var classificaitionView = new ClassificationPage(); |
| | | ContextView.AddChidren(classificaitionView); |
| | |
| | | btnCollectionIcon.IsSelected = false; |
| | | btnClassificationIcon.IsSelected = false; |
| | | btnPersonalCenterIcon.IsSelected = false; |
| | | #region 移动动画 |
| | | #region 移动动画 |
| | | var distance = navigationSelectionView.X - intellectualizationView.X + Application.GetRealWidth(94 * 3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | |
| | | }); |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Highest }.Start(); |
| | | #endregion |
| | | #endregion |
| | | ContextView.RemoveAll(); |
| | | var intelligenceView = new IntelligencePage(); |
| | | ContextView.AddChidren(intelligenceView); |
| | |
| | | btnCollectionIcon.IsSelected = false; |
| | | btnClassificationIcon.IsSelected = false; |
| | | btnIntellectualizationIcon.IsSelected = false; |
| | | #region 移动动画 |
| | | #region 移动动画 |
| | | var distance = navigationSelectionView.X - personalCenterView.X + Application.GetRealWidth(94 * 3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | |
| | | }); |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Highest }.Start(); |
| | | #endregion |
| | | #endregion |
| | | |
| | | ContextView.RemoveAll(); |
| | | var personalCenterPage = new UI.PersonalCenterPage(); |