| | |
| | | <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/Entity/Device/DeviceModule.cs"> |
| | | <Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.220222E9-B9CA-4834-9318-2BC22465F050" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="856" Column="58" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control_TcpServer.cs" Line="102" Column="56" /> |
| | | <File FileName="HDL_ON/Entity/Device/DeviceModule.cs" Line="49" Column="21" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="20" Column="57" /> |
| | | <File FileName="HDL_ON/UI/MainPage.cs" Line="28" Column="55" /> |
| | | <File FileName="HDL-ON_iOS/Info.plist" /> |
| | | <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="759" Column="32" /> |
| | | <File FileName="HDL_ON/Common/HDLCommon.cs" Line="395" Column="23" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="758" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs" Line="643" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI0-Public/TopViewDiv.cs" Line="166" Column="46" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionPage.cs" Line="45" Column="53" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs" Line="32" Column="16" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="DAL" expanded="True"> |
| | | <Node name="DriverLayer" expanded="True" /> |
| | | <Node name="Mqtt" expanded="True" /> |
| | | <Node name="Server" expanded="True" /> |
| | | </Node> |
| | | <Node name="Entity" expanded="True"> |
| | | <Node name="Device" expanded="True"> |
| | | <Node name="DeviceModule.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="ResponseEntity" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="BindingResidence" expanded="True" /> |
| | | <Node name="UI0-Public" expanded="True" /> |
| | | <Node name="UI0-Public" expanded="True"> |
| | | <Node name="Widget" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="3-Intelligence" expanded="True"> |
| | | <Node name="Automation" expanded="True" /> |
| | | </Node> |
| | | <Node name="4-PersonalCenter" expanded="True"> |
| | | <Node name="PirDevice" expanded="True" /> |
| | | <Node name="1-HomePage" expanded="True" /> |
| | | <Node name="2-Classification" expanded="True" /> |
| | | <Node name="4-PersonalCenter" expanded="True" /> |
| | | <Node name="FuntionControlView" expanded="True"> |
| | | <Node name="Energy" expanded="True" /> |
| | | <Node name="EnvironmentalScience" expanded="True" /> |
| | | <Node name="Light" expanded="True"> |
| | | <Node name="LightScene" expanded="True"> |
| | | <Node name="AddLightScene.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_iOS" expanded="True" /> |
| | | </Node> |
| | | </State> |
| | | </Pad> |
| | |
| | | <String>Shared.IOS.TBL/Shared.IOS.TBL.csproj</String> |
| | | <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> |
| | | <String>Shared.IOS/Shared.IOS.csproj</String> |
| | | <String>../Linphone/HDLLinphoneSDK_IOS/Shared.IOS.HDLLinphoneSDK/Shared.IOS.HDLLinphoneSDK/Shared.IOS.HDLLinphoneSDK.csproj</String> |
| | | </DisabledProjects> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android AndroidDesignerPreferredDevice="Nexus 4" PreferredExecutionTarget="Android.Android_Accelerated_Oreo" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.364c4b3158493098" /> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore /> |
| | | <BreakpointStore> |
| | | <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/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="431" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" line="758" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs" line="106" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" line="168" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="481" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="541" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="315" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/FunctionList.cs" relfile="HDL_ON/Entity/FunctionList.cs" line="475" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/FunctionList.cs" relfile="HDL_ON/Entity/FunctionList.cs" line="474" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" relfile="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" line="153" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/Function/Scene.cs" relfile="HDL_ON/Entity/Function/Scene.cs" line="338" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs" line="244" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs" line="148" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" line="865" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2689" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2685" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs" line="524" column="1" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | | </Properties> |
| | |
| | | BaseActivity.OnResumeAction += (activity) => |
| | | { |
| | | checkSomeInfo(); |
| | | |
| | | |
| | | }; |
| | | BaseActivity.OnDestroyAction += (activity) => |
| | | { |
| | |
| | | //BusSocket.Stop(); |
| | | //UserInfo.Current.unlockTime = DateTime.Now; |
| | | }; |
| | | |
| | | |
| | | |
| | | HDLUtils.SetAuthoritiesName("com.hdl.onpro.fileProvider"); |
| | |
| | | } |
| | | MainPage.Log($"经纬度:::{lon}:{lat}"); |
| | | }; |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="activity"></param> |
| | | void GetJPushRegistrationID(BaseActivity activity) |
| | | { |
| | | |
| | | try |
| | | { |
| | | |
| | | //保存获取的极光服务器上的注册ID到本地文件 |
| | | var tokenID = JPushInterface.GetRegistrationID(activity); |
| | | Console.WriteLine("RegistrationID: " + tokenID); |
| | |
| | | { |
| | | //手机名称 Android.OS.Build.Manufacturer; |
| | | //OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer; |
| | | //#if DEBUG |
| | | //#if DEBUG |
| | | //CN.Jpush.Android.Api.JPushInterface.SetDebugMode(true); |
| | | //#endif |
| | | //#endif |
| | | CN.Jpush.Android.Api.JPushInterface.Init(this); |
| | | |
| | | } |
| | |
| | | base.Dispose(disposing); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查询通知权限,并提示 |
| | | /// </summary> |
| | | public void QueryNotificationPermission() |
| | | { |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | 508=Formaldehyde |
| | | 509=Please enter security name. |
| | | 510=Please select the deployment target. |
| | | 511=Combined dimming |
| | | 512=Message push is not enabled, please go to settings. |
| | | |
| | | |
| | | 1000=Room Humidity |
| | |
| | | 508=甲醛 |
| | | 509=请输入安防名称。 |
| | | 510=请选择布防目标。 |
| | | |
| | | 511=组合调光 |
| | | 512=消息推送未开启,请前往设置。 |
| | | |
| | | |
| | | 1000=室内湿度 |
New file |
| | |
| | | { |
| | | "agcgw_all":{ |
| | | "CN":"connect-drcn.hispace.hicloud.com", |
| | | "CN_back":"connect-drcn.dbankcloud.cn", |
| | | "DE":"connect-dre.hispace.hicloud.com", |
| | | "DE_back":"connect-dre.dbankcloud.cn", |
| | | "RU":"connect-drru.hispace.hicloud.com", |
| | | "RU_back":"connect-drru.dbankcloud.cn", |
| | | "SG":"connect-dra.hispace.hicloud.com", |
| | | "SG_back":"connect-dra.dbankcloud.cn" |
| | | }, |
| | | "client":{ |
| | | "cp_id":"2850086000428177029", |
| | | "product_id":"736430079245970940", |
| | | "client_id":"703480846752957504", |
| | | "client_secret":"6E796F2ED36C43A87C4F7BB68680F29A15CBD7635F1D55ED004A17F2D2070D17", |
| | | "project_id":"736430079245970940", |
| | | "app_id":"104676079", |
| | | "api_key":"CwEAAAAAzCMOmemAwFVmnLqO8YeBY1StA3YLbXD5k/jRfW8xIga0hN85Ka9PQ4R9hj7dn0WtjVkoW9rTgusFrJhAxUE4tMGV514=", |
| | | "package_name":"com.hdl.onpro" |
| | | }, |
| | | "oauth_client":{ |
| | | "client_id":"104676079", |
| | | "client_type":1 |
| | | }, |
| | | "app_info":{ |
| | | "app_id":"104676079", |
| | | "package_name":"com.hdl.onpro" |
| | | }, |
| | | "configuration_version":"3.0", |
| | | "appInfos":[ |
| | | { |
| | | "package_name":"com.hdl.onpro", |
| | | "client":{ |
| | | "app_id":"104676079" |
| | | }, |
| | | "app_info":{ |
| | | "package_name":"com.hdl.onpro", |
| | | "app_id":"104676079" |
| | | }, |
| | | "oauth_client":{ |
| | | "client_type":1, |
| | | "client_id":"104676079" |
| | | } |
| | | } |
| | | ] |
| | | } |
| | |
| | | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
| | | <DebugSymbols>True</DebugSymbols> |
| | | <DebugType>portable</DebugType> |
| | | <Optimize>False</Optimize> |
| | | <Optimize>false</Optimize> |
| | | <OutputPath>bin\Debug\</OutputPath> |
| | | <DefineConstants>DEBUG;TRACE;__Android__</DefineConstants> |
| | | <ErrorReport>prompt</ErrorReport> |
| | |
| | | <MandroidI18n>cjk</MandroidI18n> |
| | | <AndroidDexTool>d8</AndroidDexTool> |
| | | <AndroidEnableSGenConcurrent>false</AndroidEnableSGenConcurrent> |
| | | <AndroidSigningKeyStore>/Users/kaede/Desktop/HDL_APP_Project/on_plus.keystore</AndroidSigningKeyStore> |
| | | <AndroidSigningStorePass>85521566</AndroidSigningStorePass> |
| | | <AndroidSigningKeyPass>85521566</AndroidSigningKeyPass> |
| | | <AndroidSigningKeyAlias>on_plus</AndroidSigningKeyAlias> |
| | | <AotAssemblies>false</AotAssemblies> |
| | | <EnableLLVM>false</EnableLLVM> |
| | | <AndroidEnableProfiledAot>false</AndroidEnableProfiledAot> |
| | | <BundleAssemblies>false</BundleAssemblies> |
| | | <AndroidEnableMultiDex>false</AndroidEnableMultiDex> |
| | | <AndroidUseAapt2>true</AndroidUseAapt2> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
| | | <DebugSymbols>True</DebugSymbols> |
| | |
| | | <MandroidI18n>cjk</MandroidI18n> |
| | | <AndroidEnableSGenConcurrent>false</AndroidEnableSGenConcurrent> |
| | | <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime> |
| | | <AndroidKeyStore>True</AndroidKeyStore> |
| | | <AndroidSigningKeyStore>/Users/kaede/Desktop/HDL_APP_Project/on_plus.keystore</AndroidSigningKeyStore> |
| | | <AndroidSigningStorePass>85521566</AndroidSigningStorePass> |
| | | <AndroidSigningKeyPass>85521566</AndroidSigningKeyPass> |
| | | <AndroidSigningKeyAlias>on_plus</AndroidSigningKeyAlias> |
| | | </PropertyGroup> |
| | | <ItemGroup> |
| | | <Reference Include="Shared.Droid.JPush"> |
| | | <HintPath>..\DLL\Shared.Droid.JPush.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="System" /> |
| | | <Reference Include="System.Xml" /> |
| | | <Reference Include="System.Core" /> |
| | |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <Compile Include="MainActivity.cs" /> |
| | | <Compile Include="Other\JPush\JPushFirmBroadcast.cs" /> |
| | | <Compile Include="Other\JPush\JPushOpenClickActivity.cs" /> |
| | | <Compile Include="Resources\Resource.designer.cs" /> |
| | | <Compile Include="Properties\AssemblyInfo.cs" /> |
| | | <Compile Include="Application.cs" /> |
| | | <Compile Include="Scan.cs" /> |
| | | <Compile Include="SplashActivity.cs" /> |
| | | <Compile Include="ZXingCustomScanView.cs" /> |
| | | <Compile Include="ZXingOverlayView.cs" /> |
| | | <Compile Include="Other\JLCountrycode.cs" /> |
| | |
| | | <Compile Include="Other\HDLONUtils.cs" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidAsset Include="Assets\agconnect-services.json" /> |
| | | <None Include="Resources\AboutResources.txt" /> |
| | | <None Include="Properties\AndroidManifest.xml" /> |
| | | <None Include="Assets\AboutAssets.txt" /> |
| | |
| | | </Generator> |
| | | </AndroidResource> |
| | | <AndroidResource Include="Resources\drawable\launchImage.xml"> |
| | | <SubType></SubType> |
| | | <Generator></Generator> |
| | | <SubType> |
| | | </SubType> |
| | | <Generator> |
| | | </Generator> |
| | | </AndroidResource> |
| | | <AndroidResource Include="Resources\mipmap-xhdpi\Loading.png"> |
| | | <SubType></SubType> |
| | | <Generator></Generator> |
| | | <SubType> |
| | | </SubType> |
| | | <Generator> |
| | | </Generator> |
| | | </AndroidResource> |
| | | <AndroidResource Include="Resources\mipmap-hdpi\Loading.png"> |
| | | <SubType></SubType> |
| | | <Generator></Generator> |
| | | <SubType> |
| | | </SubType> |
| | | <Generator> |
| | | </Generator> |
| | | </AndroidResource> |
| | | <AndroidResource Include="Resources\mipmap-mdpi\Loading.png"> |
| | | <SubType></SubType> |
| | | <Generator></Generator> |
| | | <SubType> |
| | | </SubType> |
| | | <Generator> |
| | | </Generator> |
| | | </AndroidResource> |
| | | <AndroidResource Include="Resources\mipmap-xxhdpi\Loading.png"> |
| | | <SubType></SubType> |
| | | <Generator></Generator> |
| | | <SubType> |
| | | </SubType> |
| | | <Generator> |
| | | </Generator> |
| | | </AndroidResource> |
| | | <AndroidResource Include="Resources\mipmap-xxxhdpi\Loading.png"> |
| | | <SubType></SubType> |
| | | <Generator></Generator> |
| | | <SubType> |
| | | </SubType> |
| | | <Generator> |
| | | </Generator> |
| | | </AndroidResource> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_blue.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_white.png" /> |
| | | <AndroidAsset Include="Assets\Phone\LogicIcon\security.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Public\HookIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\MesCenter\Property.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\MesCenter\PropertyOn.png" /> |
| | | </ItemGroup> |
| | |
| | | </PackageReference> |
| | | <PackageReference Include="RestSharp"> |
| | | <Version>106.11.7</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="XamarinLibrary.Xamarin.Android.Manual.JPush"> |
| | | <Version>3.7.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Xamarin.Android.Support.Constraint.Layout"> |
| | | <Version>1.1.0</Version> |
| | |
| | | <ItemGroup> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\DoorLock.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <Folder Include="Assets\Phone\FunctionIcon\IrFan\" /> |
| | | <Folder Include="Assets\Phone\PersonalCenter\FacePassage\" /> |
| | | <Folder Include="Assets\Phone\FunctionIcon\Light\LightScene\" /> |
| | | <Folder Include="Assets\Phone\FunctionIcon\Electrical\AirSwitch\" /> |
| | | </ItemGroup> |
| | | <ItemGroup /> |
| | | <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" /> |
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> |
| | | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
New file |
| | |
| | | |
| | | using Android.Content; |
| | | |
| | | using System; |
| | | |
| | | using CN.Jpush.Android.Api; |
| | | |
| | | namespace HDL_ON_Android |
| | | { |
| | | |
| | | [BroadcastReceiver(Enabled = true, Exported = false, Name = "com.hdl.onpro.JPushFirmBroadcast")] |
| | | [Android.App.IntentFilter(new string[] |
| | | { |
| | | "com.hdl.onpro.jpush.firm.NOTIFICATION_OPENED" |
| | | }, |
| | | Categories = new string[] |
| | | { |
| | | Intent.CategoryDefault |
| | | })] |
| | | class JPushFirmBroadcast : BroadcastReceiver |
| | | { |
| | | |
| | | |
| | | public override void OnReceive(Context context, Intent intent) |
| | | { |
| | | |
| | | /* 用来接收厂商点击通知消息,需要打开MainActivity 需要自行调用 |
| | | cn.jpush.android.EXTRA,cn.jpush.android.MSG_ID, |
| | | cn.jpush.android.TYPE_PLATFORM, |
| | | cn.jpush.android.TITLE, |
| | | cn.jpush.android.MESSAGE*/ |
| | | |
| | | try |
| | | { |
| | | NotificationMessage notificationMessage = new NotificationMessage(); |
| | | String extra = intent.GetStringExtra(JPushInterface.ExtraExtra); |
| | | String msgId = intent.GetStringExtra(JPushInterface.ExtraMsgId); |
| | | |
| | | String message = intent.GetStringExtra(JPushInterface.ExtraMessage); |
| | | String title = intent.GetStringExtra(JPushInterface.ExtraTitle); |
| | | // String typePlatform = intent.GetStringExtra(JPushInterface.ExtraTypePlatform); |
| | | |
| | | notificationMessage.NotificationTitle = title; |
| | | notificationMessage.NotificationContent = message; |
| | | notificationMessage.NotificationExtras = extra; |
| | | |
| | | JPushReceiver.OpenNotification(context, notificationMessage); |
| | | |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using Android.App; |
| | | using Android.Content; |
| | | using Android.OS; |
| | | |
| | | using Com.Hdl.ON.Jpush.Androidjpush; |
| | | |
| | | using Android.Views; |
| | | |
| | | namespace HDL_ON_Android |
| | | { |
| | | [Activity( |
| | | Exported = true, Enabled = true, Name = "com.hdl.onpro.JPushOpenClickActivity" |
| | | , Theme = "@android:style/Theme.Translucent.NoTitleBar")] |
| | | [IntentFilter(new string[] { "com.hdl.onpro.JPushOpenClickActivity", Intent.ActionView }, |
| | | Categories = new string[] |
| | | { |
| | | "com.hdl.onpro",Intent.CategoryDefault |
| | | }) |
| | | ] |
| | | public class JPushOpenClickActivity : Activity |
| | | { |
| | | |
| | | |
| | | protected override void OnCreate(Bundle savedInstanceState) |
| | | { |
| | | base.OnCreate(savedInstanceState); |
| | | View v = new View(this); |
| | | SetContentView(v); |
| | | HandleOpenClick(Intent); |
| | | |
| | | } |
| | | |
| | | protected void HandleOpenClick(Intent intent) |
| | | { |
| | | Intent broadcastIntent = new Intent(); |
| | | broadcastIntent.SetAction("com.hdl.onpro.jpush.firm.NOTIFICATION_OPENED"); |
| | | ComponentName componentName = new ComponentName(PackageName, "com.hdl.onpro.JPushFirmBroadcast"); |
| | | |
| | | if (Build.VERSION.SdkInt >= BuildVersionCodes.O) |
| | | { |
| | | broadcastIntent.SetComponent(componentName); |
| | | } |
| | | FirmOpenClickHelper.Instance.HandleOpenClick(this, intent, broadcastIntent); |
| | | Finish(); |
| | | |
| | | } |
| | | |
| | | protected override void OnNewIntent(Intent intent) |
| | | { |
| | | base.OnNewIntent(intent); |
| | | HandleOpenClick(intent); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using HDL_ON; |
| | | using HDL_ON.DAL.Server; |
| | | using Shared; |
| | | using Android.OS; |
| | | |
| | | namespace HDL_ON_Android |
| | | { |
| | | |
| | | {
|
| | |
|
| | | [BroadcastReceiver(Enabled = true, Exported = false)] |
| | | [Android.App.IntentFilter(new string[] |
| | | { |
| | | "cn.jpush.android.intent.RECEIVE_MESSAGE" |
| | | }, |
| | | Categories=new string[] |
| | | Categories = new string[]
|
| | | { |
| | | "com.hdl.onpro" |
| | | })] |
| | | public class JPushReceiver : JPushMessageReceiver |
| | | { |
| | | |
| | | {
|
| | |
|
| | |
|
| | | private static string TAG = "JPushReceiver"; |
| | | /// <summary> |
| | | /// 用户点击打开了通知 |
| | |
| | | Utlis.WriteLine("PushMes title : " + pushMes.Title); |
| | | Utlis.WriteLine("PushMes message : " + pushMes.Content); |
| | | Utlis.WriteLine("PushMes extras : " + pushMes.Extras); |
| | | Utlis.WriteLine("PushMes HomeId : " + pushMes.HomeId); |
| | | Utlis.WriteLine("PushMes HomeId : " + pushMes.HomeId);
|
| | |
|
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | HDLCommon.Current.AdjustPushMessage(pushMes); |
| | | }); |
| | | |
| | | } |
| | | |
| | | }
|
| | |
|
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="pushMes"></param> |
| | | /// <returns></returns> |
| | | ExpandData GetJPushExpandData(JPushMessageInfo pushMes) |
| | | static ExpandData GetJPushExpandData(JPushMessageInfo pushMes) |
| | | { |
| | | try |
| | | { |
| | |
| | | /// </summary> |
| | | /// <param name="context"></param> |
| | | /// <param name="notificationMessage"></param> |
| | | private void OpenNotification(Context context, NotificationMessage notificationMessage) |
| | | { |
| | | public static void OpenNotification(Context context, NotificationMessage notificationMessage) |
| | | {
|
| | |
|
| | | try |
| | | { |
| | | var pushMes = new JPushMessageInfo() |
| | |
| | | Utlis.WriteLine("PushMes title : " + pushMes.Title); |
| | | Utlis.WriteLine("PushMes message : " + pushMes.Content); |
| | | Utlis.WriteLine("PushMes extras : " + pushMes.Extras); |
| | | Utlis.WriteLine("PushMes HomeId : " + pushMes.HomeId); |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | Intent i = new Intent(context, typeof(BaseActivity));//Intent intent=new Intent( 起始组件对象 , 目标 Service.class); |
| | | i.SetFlags(ActivityFlags.NewTask); |
| | | context.StartActivity(i); |
| | | |
| | | HDLCommon.Current.AdjustPushMessage(pushMes); |
| | | }); |
| | | |
| | | //Shared.Application.RunOnMainThread(() => |
| | | //{ |
| | | // if (Shared.Application.Activity == null) |
| | | // { |
| | | // var tempIntent = new Intent(context, typeof(Shared.BaseActivity));//Intent intent=new Intent( 起始组件对象 , 目标 Service.class); |
| | | // tempIntent.SetFlags(ActivityFlags.BroughtToFront); |
| | | // context.StartActivity(tempIntent); |
| | | |
| | | // HDLCommon.Current.AdjustPushMessage(pushMes); |
| | | // } |
| | | // else |
| | | // { |
| | | |
| | | // (Shared.Application.Activity as BaseActivity).MoveToFront(); |
| | | // HDLCommon.Current.AdjustPushMessage(pushMes); |
| | | // } |
| | | //}); |
| | | Utlis.WriteLine("PushMes HomeId : " + pushMes.HomeId);
|
| | |
|
| | |
|
| | | Intent i = new Intent(context, typeof(BaseActivity));//Intent intent=new Intent( 起始组件对象 , 目标 Service.class);
|
| | | i.SetFlags(ActivityFlags.NewTask);
|
| | | context.StartActivity(i);
|
| | | //解析msg
|
| | | AdjustPushMessage(pushMes);
|
| | |
|
| | | //Shared.Application.RunOnMainThread(() =>
|
| | | //{
|
| | | // if (Shared.Application.Activity == null)
|
| | | // {
|
| | | // var tempIntent = new Intent(context, typeof(Shared.BaseActivity));//Intent intent=new Intent( 起始组件对象 , 目标 Service.class);
|
| | | // tempIntent.SetFlags(ActivityFlags.BroughtToFront);
|
| | | // context.StartActivity(tempIntent);
|
| | |
|
| | | // HDLCommon.Current.AdjustPushMessage(pushMes);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | |
|
| | | // (Shared.Application.Activity as BaseActivity).MoveToFront();
|
| | | // HDLCommon.Current.AdjustPushMessage(pushMes);
|
| | | // }
|
| | | //});
|
| | | } |
| | | catch |
| | | { |
| | |
| | | // Utlis.WriteLine(ex.ToString()); |
| | | //} |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public static void AdjustPushMessage(JPushMessageInfo pushMes)
|
| | | {
|
| | |
|
| | | new System.Threading.Thread(new System.Threading.ThreadStart(() =>
|
| | | {
|
| | | while (MainPage.BasePageView == null)
|
| | | {
|
| | | System.Threading.Thread.Sleep(300);
|
| | | }
|
| | | Shared.Application.RunOnMainThread(() =>
|
| | | {
|
| | | HDLCommon.Current.AdjustPushMessage(pushMes);
|
| | | });
|
| | | })).Start();
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | } |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202109021" android:versionName="1.2.202109021" package="com.hdl.onpro"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202109261" android:versionName="1.2.202109261" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" /> |
| | | <!-- 乐橙可视对讲需要的权限 --> |
| | | <!--<uses-permission android:name="android.permission.INTERNET" />--> |
| | |
| | | <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> |
| | | </provider> |
| | | <!--极光推送--> |
| | | <provider android:name="Shared.Droid.JPush.HmsContentProvider" android:authorities="${applicationId}.hmspushprovider" android:exported="false"></provider> |
| | | <!-- Required SDK 核心功能--> |
| | | <!-- 可配置 android:process 参数将 PushService 放在其他进程中 --> |
| | | <service android:name="cn.jpush.android.service.PushService" android:enabled="true" android:exported="false"> |
| | |
| | | <meta-data android:name="JPUSH_CHANNEL" android:value="developer-default" /> |
| | | <!-- Required. AppKey copied from Portal --> |
| | | <meta-data android:name="JPUSH_APPKEY" android:value="cbd90743ac45cbca06c8118b" /> |
| | | <meta-data android:name="XIAOMI_APPKEY" android:value="MI-5871892343860" /> |
| | | <meta-data android:name="XIAOMI_APPID" android:value="MI-2882303761518923860" /> |
| | | <meta-data android:name="OPPO_APPKEY" android:value="OP-e942dafe77cf4b9f868d5421d701655a" /> |
| | | <meta-data android:name="OPPO_APPID" android:value="OP-30619979" /> |
| | | <meta-data android:name="OPPO_APPSECRET" android:value="OP-11d511c42f654cafac99588322681003" /> |
| | | <!-- 极光推送结束 --> |
| | | </application> |
| | | </manifest> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <resources> |
| | | <resources > |
| | | <!-- 其中parent可以为 android:Theme 或 android:Theme.NoTitleBar; android:windowBackground可以为背景图 --> |
| | | <style name="MyTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen"> |
| | | <item name="android:windowBackground">@drawable/launchimage</item> |
| | |
| | | <!-- 隐藏标题栏 --> |
| | | <item name="android:windowNoTitle">true</item> |
| | | <item name="android:windowTranslucentStatus">true</item> |
| | | |
| | | </style> |
| | | <style name="SplashTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen"> |
| | | <item name="android:windowBackground">@drawable/launchimage</item> |
| | | <!-- 隐藏状态栏 --> |
| | | <item name="android:windowFullscreen">true</item> |
| | | <!-- 隐藏标题栏 --> |
| | | <item name="android:windowNoTitle">true</item> |
| | | </style> |
| | | |
| | | |
| | | |
| | | <style name="MyDialogStyle"> |
| | | <item name="android:windowBackground">@android:color/transparent</item> |
| | | <item name="android:windowFrame">@null</item> |
New file |
| | |
| | | using Android.App; |
| | | using Android.Content; |
| | | using Android.OS; |
| | | using Com.Hdl.ON.Jpush.Androidjpush; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON_Android |
| | | { |
| | | [Activity(Theme = "@style/SplashTheme", MainLauncher = true, Name = "com.hdl.onpro.SplashActivity")] |
| | | [IntentFilter(new string[] { "com.hdl.onpro.SplashActivity", Intent.ActionView })] |
| | | public class SplashActivity : Activity |
| | | { |
| | | protected override void OnCreate(Bundle savedInstanceState) |
| | | { |
| | | base.OnCreate(savedInstanceState); |
| | | |
| | | |
| | | //打开baseActivity |
| | | Intent i = new Intent(this, typeof(BaseActivity));//Intent intent=new Intent( 起始组件对象 , 目标 Service.class); |
| | | StartActivity(i); |
| | | |
| | | OverridePendingTransition(0, 0); |
| | | Finish(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | <MtouchLink>SdkOnly</MtouchLink> |
| | | <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs> |
| | | <MtouchEnableSGenConc>false</MtouchEnableSGenConc> |
| | | <CodesignProvision>On+Dev-20210616-1</CodesignProvision> |
| | | <CodesignProvision>On+Dev-20210913-1</CodesignProvision> |
| | | <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> |
| | |
| | | </PackageReference> |
| | | <PackageReference Include="Xamarin.Essentials"> |
| | | <Version>1.7.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Xamarin.Swift"> |
| | | <Version>1.0.8</Version> |
| | | </PackageReference> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_blue.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_white.png" /> |
| | | <BundleResource Include="Resources\Phone\LogicIcon\security.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\HookIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\MesCenter\Property.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\MesCenter\PropertyOn.png" /> |
| | | </ItemGroup> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.2.202100921</string> |
| | | <string>1.2.202109261</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.2.09021</string> |
| | | <string>1.2.09261</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | 508=Formaldehyde |
| | | 509=Please enter security name. |
| | | 510=Please select the deployment target. |
| | | 511=Combined dimming |
| | | 512=Message push is not enabled, please go to settings. |
| | | |
| | | |
| | | 1000=Room Humidity |
| | |
| | | 508=甲醛 |
| | | 509=请输入安防名称。 |
| | | 510=请选择布防目标。 |
| | | |
| | | 511=组合调光 |
| | | 512=消息推送未开启,请前往设置。 |
| | | |
| | | |
| | | 1000=室内湿度 |
| | |
| | |
|
| | | Microsoft Visual Studio Solution File, Format Version 12.00
|
| | | # Visual Studio 15
|
| | | # Visual Studio Version 16
|
| | | VisualStudioVersion = 16.0.31613.86
|
| | | MinimumVisualStudioVersion = 10.0.40219.1
|
| | | Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "HDL_ON", "HDL_ON\HDL_ON.shproj", "{A5C296B4-CF9A-4205-ACF0-3A6FEA786F12}"
|
| | | EndProject
|
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HDL-ON_Android", "HDL-ON_Android\HDL-ON_Android.csproj", "{09712674-2A38-407B-B1E2-560B2C352F9A}"
|
| | |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blufi", "HdlBluWi\Blufi.csproj", "{2DDF4C3C-6998-432E-9F43-6786D82F0630}"
|
| | | EndProject
|
| | | Global
|
| | | GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
| | | HDL_ON\HDL_ON.projitems*{09712674-2a38-407b-b1e2-560b2c352f9a}*SharedItemsImports = 4
|
| | | HDL_ON\HDL_ON.projitems*{a5c296b4-cf9a-4205-acf0-3a6fea786f12}*SharedItemsImports = 13
|
| | | HDL_ON\HDL_ON.projitems*{d998e133-f0dd-4760-be3c-461632f54da4}*SharedItemsImports = 4
|
| | | EndGlobalSection
|
| | | GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
| | | Debug|Any CPU = Debug|Any CPU
|
| | | Release|Any CPU = Release|Any CPU
|
| | | Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
| | | Release|iPhoneSimulator = Release|iPhoneSimulator
|
| | | Debug|iPhone = Debug|iPhone
|
| | | Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
| | | Release|Any CPU = Release|Any CPU
|
| | | Release|iPhone = Release|iPhone
|
| | | Release|iPhoneSimulator = Release|iPhoneSimulator
|
| | | EndGlobalSection
|
| | | GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Release|Any CPU.Build.0 = Release|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Debug|iPhone.Build.0 = Debug|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Debug|iPhone.Deploy.0 = Debug|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Release|Any CPU.Build.0 = Release|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Release|iPhone.ActiveCfg = Release|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Release|iPhone.Build.0 = Release|Any CPU
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
| | | {09712674-2A38-407B-B1E2-560B2C352F9A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|Any CPU.ActiveCfg = Debug|iPhone
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|iPhone.Build.0 = Debug|iPhone
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|iPhone.ActiveCfg = Release|iPhone
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|iPhone.Build.0 = Release|iPhone
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
| | | {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|Any CPU.Build.0 = Debug|iPhone
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|Any CPU.Build.0 = Release|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|iPhone.Build.0 = Debug|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|Any CPU.Build.0 = Release|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhone.ActiveCfg = Release|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhone.Build.0 = Release|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
| | | {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
| | | EndGlobalSection
|
| | | GlobalSection(SolutionProperties) = preSolution
|
| | | HideSolutionNode = FALSE
|
| | | EndGlobalSection
|
| | | GlobalSection(ExtensibilityGlobals) = postSolution
|
| | | SolutionGuid = {42CB9D67-2370-4213-A935-8706935256AA}
|
| | | EndGlobalSection
|
| | | EndGlobal
|
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 下载数据完成标记 |
| | | /// </summary> |
| | | public bool DownloadDataComplete = true; |
| | | /// <summary> |
| | | /// 下载数据 |
| | |
| | | for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;) |
| | | { |
| | | var localFunction = FunctionList.List.GetDeviceFunctionList()[i]; |
| | | if (localFunction.Spk_Prefix == FunctionCategory.Music || string.IsNullOrEmpty(localFunction.Spk_Prefix)) |
| | | if (SPK.MusicSpkList().Contains(localFunction.spk)) |
| | | { |
| | | i++; |
| | | continue; |
| | |
| | | //测试账号,不挤下线 |
| | | switch (UserInfo.Current.AccountString) |
| | | { |
| | | case "13415629083": |
| | | case "18316120654": |
| | | case "15622703419": |
| | | case "18824864143": |
| | | case "464027401@qq.com": |
| | | case "2791308028@qq.com": |
| | | case "13697499568": |
| | | case "18666455392": |
| | | case "13375012446": |
| | | case "13602944661": |
| | | case "18778381374": |
| | | case "18316672920": |
| | | case "15626203746": |
| | | case "551775569@qq.com": |
| | | return; |
| | | } |
| | | |
| | |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 安卓消息推送提示 |
| | | /// </summary> |
| | | public const int Android_MessagePushTip = 512; |
| | | //public const int SaveAs |
| | | /// <summary> |
| | | /// 组合调光 |
| | | /// </summary> |
| | | public const int CombinedDimming = 511; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public const int PleaseSelectTheDeploymentTarget = 510; |
| | |
| | | switch (function.spk) |
| | | { |
| | | case SPK.ElectricTuyaAirCleaner: |
| | | case SPK.ElectricTuyaAirCleaner2: |
| | | case SPK.ElectricTuyaFan: |
| | | case SPK.ElectricTuyaFan2: |
| | | case SPK.ElectricTuyaWaterValve: |
| | | case SPK.ElectricTuyaWeepRobot: |
| | | case SPK.ElectricTuyaWeepRobot2: |
| | | useRemote = true; |
| | | break; |
| | | } |
| | |
| | | } |
| | | |
| | | //更新界面状态 |
| | | Function localObj = null; |
| | | switch (localFunction.spk) |
| | | { |
| | | case SPK.AirSwitch: |
| | |
| | | DimmerPage.UpdataStates(localFunction); |
| | | break; |
| | | case SPK.ElectricFan: |
| | | case SPK.HvacFan: |
| | | localFunction.lastState = Language.StringByID(StringId.Level) + " : " + |
| | | localFunction.GetAttrState(FunctionAttributeKey.OpenLevel); |
| | | FanPage.UpdataState(localFunction); |
| | |
| | | ACPage.UpdataStates(localFunction); |
| | | } |
| | | break; |
| | | case SPK.HvacFloorHeat: |
| | | case SPK.FloorHeatStandard: |
| | | localFunction.lastState = ""; |
| | | switch (localFunction.GetAttrState(FunctionAttributeKey.Mode)) |
| | |
| | | HomePage.LoadEvent_RefreshEnvirIndoorHumi(); |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(localFunction); |
| | | A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(localFunction); |
| | | //A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.SensorEnvironment: |
| | | case SPK.SensorEnvironment2: |
| | |
| | | HomePage.LoadEvent_RefreshEnvirIndoorHumi(); |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(localFunction); |
| | | A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(localFunction); |
| | | //A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | SocketPage.UpdataState(localFunction); |
| | | break; |
| | | case SPK.ElectricTV: |
| | | break; |
| | | case SPK.ElectricTuyaAirCleaner: |
| | | case SPK.ElectricTuyaAirCleaner2: |
| | | case SPK.ElectricTuyaFan: |
| | | case SPK.ElectricTuyaFan2: |
| | | case SPK.ElectricTuyaWeepRobot: |
| | | case SPK.ElectricTuyaWeepRobot2: |
| | | case SPK.ElectricTuyaWaterValve: |
| | | case SPK.ElectricTuyaWaterValve2: |
| | | case SPK.SensorPir: |
| | | case SPK.SensorDoorWindow: |
| | | case SPK.SensorSmoke: |
| | |
| | | case SPK.ClothesHanger: |
| | | case SPK.AcIr: |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | //设备状态推送 |
| | | //状态更新 |
| | | Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status); |
| | |
| | | SubnetID = subnetID, |
| | | DeviceID = deviceID, |
| | | AddData = gatewayBytes, |
| | | }, 3, true); |
| | | //}, sendCount, reSend); |
| | | //}, 3, true); |
| | | }, sendCount, reSend); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | break; |
| | | } |
| | | ControlBytesSend(Command.SetCurtainModelStutas, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, |
| | | new byte[] { f.localFunction.bus.LoopId, curtainState }); |
| | | new byte[] { f.localFunction.bus.LoopId, curtainState },0); |
| | | break; |
| | | } |
| | | } |
| | |
| | | break; |
| | | case SPK.LightRGB: |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.HvacFloorHeat:case SPK.FloorHeatStandard: |
| | | if (f.status.Find((obj)=>obj.key ==FunctionAttributeKey.Mode) == null) |
| | | { |
| | | foreach (var dic in f.status) |
| | |
| | | } |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | foreach (var attr in f.status) |
| | | { |
| | | if (attr.key == FunctionAttributeKey.OnOff) |
| | |
| | | /// </summary> |
| | | /// <param name="commandString"></param> |
| | | /// <returns></returns> |
| | | public void WriteBusData(Function function, Dictionary<string, string> commandDictionary,bool reSend = false) |
| | | public void WriteBusData(Function function, Dictionary<string, string> commandDictionary, bool reSend = false) |
| | | { |
| | | try |
| | | { |
| | |
| | | var deviceId = function.bus.DeviceID; |
| | | var loopId = function.bus.LoopId; |
| | | |
| | | switch (function.Spk_Prefix) |
| | | switch (function.spk) |
| | | { |
| | | case FunctionCategory.Light: |
| | | switch (function.spk) |
| | | case SPK.LightCCT: |
| | | #region cct light |
| | | byte b0 = 100; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | | case SPK.LightCCT: |
| | | 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)); |
| | | } |
| | | var bytes0 = new byte[] { function.bus.LoopId, |
| | | 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)); |
| | | } |
| | | var bytes0 = new byte[] { function.bus.LoopId, |
| | | b0, |
| | | 254, 0,Convert.ToByte(function.GetAttrState(FunctionAttributeKey.FadeTime)) ,2, |
| | | (byte)(Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.CCT))/256), |
| | | (byte)(Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.CCT))%256), |
| | | 0, |
| | | 0,0}; |
| | | ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes0, 1); |
| | | break; |
| | | case SPK.LightRGB: |
| | | byte b = 100; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | b = 0; |
| | | } |
| | | else |
| | | { |
| | | 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, |
| | | ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes0, 1); |
| | | #endregion |
| | | break; |
| | | case SPK.LightRGB: |
| | | #region rgb light |
| | | byte b = 100; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | b = 0; |
| | | } |
| | | else |
| | | { |
| | | 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, |
| | | b, |
| | | 254, 0,Convert.ToByte(function.GetAttrState(FunctionAttributeKey.FadeTime)) ,3, |
| | | (byte)tempLight.GetColor(0,function), |
| | | (byte)tempLight.GetColor(1,function), |
| | | (byte)tempLight.GetColor(2,function), |
| | | 0,0}; |
| | | ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes, 1); |
| | | break; |
| | | case SPK.LightDimming: |
| | | byte b1 = 100; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | b1 = 0; |
| | | } |
| | | else |
| | | { |
| | | 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[] { |
| | | ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes, 1); |
| | | #endregion |
| | | break; |
| | | case SPK.LightDimming: |
| | | #region dimming light |
| | | byte b1 = 100; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | b1 = 0; |
| | | } |
| | | else |
| | | { |
| | | 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, |
| | | 0, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.FadeTime)) }); |
| | | break; |
| | | case SPK.LightSwitch: |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 }); |
| | | break; |
| | | } |
| | | #endregion |
| | | break; |
| | | case FunctionCategory.Curtain: |
| | | switch (function.spk) |
| | | case SPK.LightSwitch: |
| | | #region LightSwitch |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 }); |
| | | #endregion |
| | | break; |
| | | case SPK.CurtainSwitch: |
| | | #region switch curtain |
| | | byte switchCurtain = 0; |
| | | if (function.trait_on_off.curValue.ToString() == "stop") |
| | | { |
| | | case SPK.CurtainSwitch: |
| | | byte b1 = 0; |
| | | if (function.trait_on_off.curValue.ToString() == "stop") |
| | | { |
| | | b1 = 0; |
| | | } |
| | | else if (function.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | b1 = 1; |
| | | } |
| | | else |
| | | { |
| | | b1 = 2; |
| | | } |
| | | ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { function.bus.LoopId, b1 }); |
| | | break; |
| | | case SPK.CurtainTrietex: |
| | | case SPK.CurtainRoller: |
| | | if (function.trait_on_off.curValue.ToString() == "stop") |
| | | { |
| | | ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { function.bus.LoopId, 0 }); |
| | | } |
| | | else |
| | | { |
| | | ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { 17, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Percent)) }); |
| | | switchCurtain = 0; |
| | | } |
| | | else if (function.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | switchCurtain = 1; |
| | | } |
| | | else |
| | | { |
| | | switchCurtain = 2; |
| | | } |
| | | ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { function.bus.LoopId, switchCurtain }); |
| | | #endregion |
| | | break; |
| | | case SPK.CurtainTrietex: |
| | | case SPK.CurtainRoller: |
| | | if (function.trait_on_off.curValue.ToString() == "stop") |
| | | { |
| | | ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { function.bus.LoopId, 0 }); |
| | | } |
| | | else |
| | | { |
| | | ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { 17, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Percent)) }); |
| | | |
| | | } |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.AC: |
| | | switch (function.spk) |
| | | case SPK.AcStandard: |
| | | var ac = new AC(); |
| | | foreach (var dic in commandDictionary) |
| | | { |
| | | case SPK.AcStandard: |
| | | var ac = new AC(); |
| | | //ControlBytesSend(Command.SetACMode, subnetId, deviceId, new byte[] { function.bus.LoopId, 0, 32, 32, 32, 32, 32, 0, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, |
| | | // ac.GetModeIndex(function), |
| | | // ac.GetFanIndex(function), Convert.ToByte(function.GetAttrState(FunctionAttributeKey.SetTemp)), 0 }); |
| | | switch (dic.Key) |
| | | { |
| | | case FunctionAttributeKey.OnOff: |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 3, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId }); |
| | | break; |
| | | case "mode": |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 6, ac.GetModeIndex(function), function.bus.LoopId }); |
| | | break; |
| | | case "fan": |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 5, ac.GetFanIndex(function), function.bus.LoopId }); |
| | | break; |
| | | case FunctionAttributeKey.SetTemp: |
| | | byte modeKey = 4; |
| | | switch (ac.GetModeIndex(function)) |
| | | { |
| | | case 3: |
| | | modeKey = 8; |
| | | break; |
| | | case 0: |
| | | modeKey = 4; |
| | | break; |
| | | case 1: |
| | | modeKey = 7; |
| | | break; |
| | | case 4: |
| | | modeKey = 19; |
| | | break; |
| | | case 2: |
| | | modeKey = 2; |
| | | break; |
| | | } |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { |
| | | modeKey, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.SetTemp)), function.bus.LoopId }); |
| | | break; |
| | | default: |
| | | MainPage.Log($"功能未支持 : {dic.Key}"); |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.HvacFloorHeat:case SPK.FloorHeatStandard: |
| | | var fhTemp = new FloorHeating(); |
| | | if (function.Fh_Mode_Temp.Count == 4) |
| | | { |
| | | if (function.GetAttribute(FunctionAttributeKey.Mode) == null) |
| | | { |
| | | foreach (var dic in commandDictionary) |
| | | { |
| | | switch (dic.Key) |
| | | { |
| | | case FunctionAttributeKey.OnOff: |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 3, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 20, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId }); |
| | | break; |
| | | case "mode": |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 6, ac.GetModeIndex(function), function.bus.LoopId }); |
| | | break; |
| | | case "fan": |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 5, ac.GetFanIndex(function), function.bus.LoopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 21, fhTemp.GetModeIndex(function), function.bus.LoopId }); |
| | | break; |
| | | case FunctionAttributeKey.SetTemp: |
| | | byte modeKey = 4; |
| | | switch (ac.GetModeIndex(function)) |
| | | byte modeKey = 25; |
| | | switch (fhTemp.GetModeIndex(function)) |
| | | { |
| | | case 3: |
| | | modeKey = 8; |
| | | break; |
| | | case 0: |
| | | modeKey = 4; |
| | | break; |
| | | case 1: |
| | | modeKey = 7; |
| | | break; |
| | | case 4: |
| | | modeKey = 19; |
| | | modeKey = 25; |
| | | break; |
| | | case 2: |
| | | modeKey = 2; |
| | | modeKey = 26; |
| | | break; |
| | | case 3: |
| | | modeKey = 27; |
| | | break; |
| | | case 4: |
| | | modeKey = 28; |
| | | break; |
| | | } |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.FloorHeat: |
| | | var fhTemp = new FloorHeating(); |
| | | switch (function.spk) |
| | | { |
| | | case SPK.FloorHeatStandard: |
| | | if (function.Fh_Mode_Temp.Count == 4) |
| | | } |
| | | else |
| | | { |
| | | var onoffString = function.trait_on_off.curValue.ToString(); |
| | | byte b12 = 1; |
| | | if (onoffString == "off") |
| | | { |
| | | if (function.GetAttribute(FunctionAttributeKey.Mode) == null) |
| | | b12 = 0; |
| | | } |
| | | var wm = fhTemp.GetWorkModeIndex(function); |
| | | if (wm > 0) |
| | | { |
| | | b12 += (byte)(16 + wm); |
| | | } |
| | | if (commandDictionary.ContainsKey("set_temp")) |
| | | { |
| | | var dicTempString = ""; |
| | | commandDictionary.TryGetValue("set_temp", out dicTempString); |
| | | var dicTemp = Convert.ToByte(dicTempString); |
| | | var mode = function.GetAttrState(FunctionAttributeKey.Mode); |
| | | switch (mode) |
| | | { |
| | | foreach (var dic in commandDictionary) |
| | | { |
| | | switch (dic.Key) |
| | | { |
| | | case FunctionAttributeKey.OnOff: |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 20, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId }); |
| | | break; |
| | | case "mode": |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 21, fhTemp.GetModeIndex(function), function.bus.LoopId }); |
| | | break; |
| | | case FunctionAttributeKey.SetTemp: |
| | | byte modeKey = 25; |
| | | switch (fhTemp.GetModeIndex(function)) |
| | | { |
| | | case 1: |
| | | modeKey = 25; |
| | | break; |
| | | case 2: |
| | | modeKey = 26; |
| | | break; |
| | | case 3: |
| | | modeKey = 27; |
| | | break; |
| | | case 4: |
| | | modeKey = 28; |
| | | break; |
| | | } |
| | | ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { |
| | | modeKey, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.SetTemp)), function.bus.LoopId }); |
| | | break; |
| | | default: |
| | | MainPage.Log($"功能未支持 : {dic.Key}"); |
| | | break; |
| | | } |
| | | } |
| | | case "day": |
| | | function.Fh_Mode_Temp["day"] = dicTemp; |
| | | break; |
| | | case "night": |
| | | function.Fh_Mode_Temp["night"] = dicTemp; |
| | | break; |
| | | case "away": |
| | | function.Fh_Mode_Temp["away"] = dicTemp; |
| | | break; |
| | | case "normal": |
| | | function.Fh_Mode_Temp["normal"] = dicTemp; |
| | | break; |
| | | } |
| | | else |
| | | { |
| | | var onoffString = function.trait_on_off.curValue.ToString(); |
| | | byte b1 = 1; |
| | | if (onoffString == "off") |
| | | { |
| | | b1 = 0; |
| | | } |
| | | var wm = fhTemp.GetWorkModeIndex(function); |
| | | if (wm > 0) |
| | | { |
| | | b1 += (byte)(16 + wm); |
| | | } |
| | | if (commandDictionary.ContainsKey("set_temp")) |
| | | { |
| | | var dicTempString = ""; |
| | | commandDictionary.TryGetValue("set_temp", out dicTempString); |
| | | var dicTemp = Convert.ToByte(dicTempString); |
| | | var mode = function.GetAttrState(FunctionAttributeKey.Mode); |
| | | switch (mode) |
| | | { |
| | | case "day": |
| | | function.Fh_Mode_Temp["day"] = dicTemp; |
| | | break; |
| | | case "night": |
| | | function.Fh_Mode_Temp["night"] = dicTemp; |
| | | break; |
| | | case "away": |
| | | function.Fh_Mode_Temp["away"] = dicTemp; |
| | | break; |
| | | case "normal": |
| | | function.Fh_Mode_Temp["normal"] = dicTemp; |
| | | break; |
| | | } |
| | | } |
| | | var tt = fhTemp.GetTempUintIndex(function); |
| | | ControlBytesSend(Command.SetFloorHeat, subnetId, deviceId, new byte[] { function.bus.LoopId, b1, |
| | | } |
| | | var tt = fhTemp.GetTempUintIndex(function); |
| | | ControlBytesSend(Command.SetFloorHeat, subnetId, deviceId, new byte[] { function.bus.LoopId, b12, |
| | | (byte)tt,fhTemp.GetModeIndex(function), function.Fh_Mode_Temp["normal"], function.Fh_Mode_Temp["day"], function.Fh_Mode_Temp["night"], function.Fh_Mode_Temp["away"], 0, 0 }); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case FunctionCategory.Electric: |
| | | switch (function.spk) |
| | | case SPK.HvacFan: |
| | | case SPK.ElectricFan: |
| | | #region ElectricFan |
| | | if (function.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | case SPK.ElectricFan: |
| | | if (function.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.OpenLevel)) }); |
| | | } |
| | | { |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, 0 }); |
| | | } |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0 }); |
| | | break; |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.OpenLevel)) }); |
| | | } |
| | | break; |
| | | case FunctionCategory.AirFresh: |
| | | switch(function.spk) |
| | | { |
| | | case SPK.AirFreshJinmao: |
| | | //1 新风编号 1~200 |
| | | //2 类型 第三方类型 0:金茂新风 |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, 0 }); |
| | | } |
| | | #endregion |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0 }); |
| | | break; |
| | | case SPK.AirFreshJinmao:case SPK.HvacAirFreshJinmao: |
| | | #region AirFresh |
| | | //1 新风编号 1~200 |
| | | //2 类型 第三方类型 0:金茂新风 |
| | | |
| | | //3 开关 0 - 关机,1 - 开机 |
| | | byte switchValue = 0; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff) == true |
| | | && commandDictionary[FunctionAttributeKey.OnOff] == "on") |
| | | { |
| | | switchValue = 1; |
| | | } |
| | | //3 开关 0 - 关机,1 - 开机 |
| | | byte switchValue = 0; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff) == true |
| | | && commandDictionary[FunctionAttributeKey.OnOff] == "on") |
| | | { |
| | | switchValue = 1; |
| | | } |
| | | |
| | | //4 运行模式 1 - 通风,2 - 加湿 |
| | | byte airFreshMode = 1; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.Mode) == true |
| | | && commandDictionary[FunctionAttributeKey.Mode] == "humidification") |
| | | { |
| | | airFreshMode = 2; |
| | | } |
| | | //5 节能舒适选择 1 - 舒适,2 - 节能 |
| | | byte airFreshEnergy = 1; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.Energy) == true |
| | | && commandDictionary[FunctionAttributeKey.Energy] == "true") |
| | | { |
| | | airFreshEnergy = 2; |
| | | } |
| | | //6 风速档位 0 - 自动,1 - 1档,2 - 2档,3 - 3档 |
| | | byte airFreshFan = 0; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.FanSpeed) == true) |
| | | { |
| | | switch (commandDictionary[FunctionAttributeKey.FanSpeed]) |
| | | { |
| | | case "auto": |
| | | airFreshFan = 0; |
| | | break; |
| | | case "level_1": |
| | | airFreshFan = 1; |
| | | break; |
| | | case "level_2": |
| | | airFreshFan = 2; |
| | | break; |
| | | case "level_3": |
| | | airFreshFan = 3; |
| | | break; |
| | | } |
| | | } |
| | | //7 湿度设定 % |
| | | //8 室内温度值 ℃ |
| | | byte indoorTemp_airFrsh = 0; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.IndoorTemp) == true) |
| | | { |
| | | indoorTemp_airFrsh= Convert.ToByte(commandDictionary[FunctionAttributeKey.IndoorTemp]); |
| | | } |
| | | byte indoorHumidity_airFrsh = 0; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.IndoorHumidity) == true) |
| | | { |
| | | indoorHumidity_airFrsh = Convert.ToByte(commandDictionary[FunctionAttributeKey.IndoorHumidity]); |
| | | } |
| | | //9 室内湿度值 ℃ |
| | | //10 过滤网剩余 % |
| | | //11 过滤网使用超时 1 超时 0 无 |
| | | ControlBytesSend(Command.FreshAirControl_JinMao, subnetId, deviceId, new byte[] { |
| | | //4 运行模式 1 - 通风,2 - 加湿 |
| | | byte airFreshMode = 1; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.Mode) == true |
| | | && commandDictionary[FunctionAttributeKey.Mode] == "humidification") |
| | | { |
| | | airFreshMode = 2; |
| | | } |
| | | //5 节能舒适选择 1 - 舒适,2 - 节能 |
| | | byte airFreshEnergy = 1; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.Energy) == true |
| | | && commandDictionary[FunctionAttributeKey.Energy] == "true") |
| | | { |
| | | airFreshEnergy = 2; |
| | | } |
| | | //6 风速档位 0 - 自动,1 - 1档,2 - 2档,3 - 3档 |
| | | byte airFreshFan = 0; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.FanSpeed) == true) |
| | | { |
| | | switch (commandDictionary[FunctionAttributeKey.FanSpeed]) |
| | | { |
| | | case "auto": |
| | | airFreshFan = 0; |
| | | break; |
| | | case "level_1": |
| | | airFreshFan = 1; |
| | | break; |
| | | case "level_2": |
| | | airFreshFan = 2; |
| | | break; |
| | | case "level_3": |
| | | airFreshFan = 3; |
| | | break; |
| | | } |
| | | } |
| | | //7 湿度设定 % |
| | | //8 室内温度值 ℃ |
| | | byte indoorTemp_airFrsh = 0; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.IndoorTemp) == true) |
| | | { |
| | | indoorTemp_airFrsh = Convert.ToByte(commandDictionary[FunctionAttributeKey.IndoorTemp]); |
| | | } |
| | | byte indoorHumidity_airFrsh = 0; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.IndoorHumidity) == true) |
| | | { |
| | | indoorHumidity_airFrsh = Convert.ToByte(commandDictionary[FunctionAttributeKey.IndoorHumidity]); |
| | | } |
| | | //9 室内湿度值 ℃ |
| | | //10 过滤网剩余 % |
| | | //11 过滤网使用超时 1 超时 0 无 |
| | | ControlBytesSend(Command.FreshAirControl_JinMao, subnetId, deviceId, new byte[] { |
| | | function.bus.LoopId,0, switchValue , |
| | | airFreshMode,airFreshEnergy, |
| | | airFreshFan, |
| | |
| | | //function.GetAttrState(FunctionAttributeKey.FilterTimeout) =="true"?1:0, |
| | | 0,0 |
| | | }); |
| | | break; |
| | | } |
| | | #endregion |
| | | break; |
| | | } |
| | | #region 发送命令立即更新UI |
| | |
| | | var deviceId = function.bus.DeviceID; |
| | | var loopId = function.bus.LoopId; |
| | | |
| | | switch (function.Spk_Prefix) |
| | | switch (function.spk) |
| | | { |
| | | case FunctionCategory.Light: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.LightSwitch: |
| | | case SPK.LightDimming: |
| | | ControlBytesSend(Command.ReadLightAllLoopBrightness, subnetId, deviceId, new byte[] { }); |
| | | break; |
| | | case SPK.LightRGB: |
| | | ControlBytesSend(Command.ReadLogicLoopColor, subnetId, deviceId, new byte[] { function.bus.LoopId}); |
| | | break; |
| | | case SPK.LightCCT: |
| | | ControlBytesSend(Command.ReadLogicLoopColor, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | case SPK.LightSwitch: |
| | | case SPK.LightDimming: |
| | | ControlBytesSend(Command.ReadLightAllLoopBrightness, subnetId, deviceId, new byte[] { }); |
| | | break; |
| | | case FunctionCategory.Curtain: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.CurtainSwitch: |
| | | case SPK.CurtainTrietex: |
| | | case SPK.CurtainRoller: |
| | | ControlBytesSend(Command.ReadCurtainStatus, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | case SPK.LightRGB: |
| | | ControlBytesSend(Command.ReadLogicLoopColor, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | case FunctionCategory.AC: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.AcStandard: |
| | | ControlBytesSend(Command.ReadACMode, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | case SPK.LightCCT: |
| | | ControlBytesSend(Command.ReadLogicLoopColor, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | case FunctionCategory.FloorHeat: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.FloorHeatStandard: |
| | | ControlBytesSend(Command.ReadFloorHeat, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | case SPK.CurtainSwitch: |
| | | case SPK.CurtainTrietex: |
| | | case SPK.CurtainRoller: |
| | | ControlBytesSend(Command.ReadCurtainStatus, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | case FunctionCategory.Electric: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.ElectricFan: |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | case SPK.AcStandard: |
| | | ControlBytesSend(Command.ReadACMode, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | case FunctionCategory.Sensor: |
| | | byte sensorType = 0; |
| | | switch (function.spk) |
| | | { |
| | | case SPK.SensorTemperature: |
| | | sensorType = 2; |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | sensorType = 3; |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | sensorType = 5; |
| | | break; |
| | | case SPK.SensorPm25: |
| | | sensorType = 6; |
| | | break; |
| | | case SPK.SensorCO2: |
| | | sensorType = 7; |
| | | break; |
| | | } |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, sensorType, function.bus.LoopId }); |
| | | case SPK.HvacFloorHeat:case SPK.FloorHeatStandard: |
| | | ControlBytesSend(Command.ReadFloorHeat, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | case FunctionCategory.AirFresh: |
| | | switch(function.spk) |
| | | { |
| | | case SPK.AirFreshJinmao: |
| | | ControlBytesSend(Command.FreshAirRead_JinMao, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | case SPK.HvacFan: |
| | | case SPK.ElectricFan: |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | case SPK.SensorTemperature: |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, 2, function.bus.LoopId }); |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, 3, function.bus.LoopId }); |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, 5, function.bus.LoopId }); |
| | | break; |
| | | case SPK.SensorPm25: |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, 6, function.bus.LoopId }); |
| | | break; |
| | | case SPK.SensorCO2: |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, 7, function.bus.LoopId }); |
| | | break; |
| | | case SPK.AirFreshJinmao: |
| | | case SPK.HvacAirFreshJinmao: |
| | | ControlBytesSend(Command.FreshAirRead_JinMao, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | } |
| | |
| | | { |
| | | if (updataObj.spk != SPK.LightRGB) |
| | | { |
| | | updataObj.trait_on_off.curValue = receiveBytes[2] > 0 ? "on" : "off"; |
| | | updataObj.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[2] > 0 ? "on" : "off"); |
| | | if (updataObj.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | switch (updataObj.spk) |
| | | { |
| | | case SPK.HvacFan: |
| | | case SPK.ElectricFan: |
| | | updataObj.SetAttrState(FunctionAttributeKey.OpenLevel, receiveBytes[2].ToString()); |
| | | updataObj.lastState = Language.StringByID(StringId.Level) + " : " + receiveBytes[2]; |
| | |
| | | case SPK.LightDimming: |
| | | DimmerPage.UpdataStates(updataObj); |
| | | break; |
| | | case SPK.HvacFan: |
| | | case SPK.ElectricFan: |
| | | FanPage.UpdataState(updataObj); |
| | | break; |
| | |
| | | { |
| | | if (light.spk != SPK.LightRGB) |
| | | { |
| | | light.trait_on_off.curValue = receiveBytes[light.bus.LoopId] == 0 ? "off" : "on"; |
| | | light.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[light.bus.LoopId] == 0 ? "off" : "on"); |
| | | if (light.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | light.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[i+1].ToString()); |
| | |
| | | switch (function.spk) |
| | | { |
| | | case SPK.ElectricFan: |
| | | case SPK.HvacFan: |
| | | FanPage.UpdataState(function); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | SocketPage.UpdataState(function); |
| | | break; |
| | | } |
| | |
| | | { |
| | | if (lightTeme.spk == SPK.LightRGB) |
| | | { |
| | | lightTeme.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off"; |
| | | lightTeme.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[1] > 0 ? "on" : "off"); |
| | | if (receiveBytes[1] > 0) |
| | | { |
| | | lightTeme.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString()); |
| | |
| | | RGBPage.UpdataStates(lightTeme); |
| | | }else if(lightTeme.spk == SPK.LightCCT) |
| | | { |
| | | lightTeme.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off"; |
| | | lightTeme.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[1] > 0 ? "on" : "off"); |
| | | if (receiveBytes[1] > 0) |
| | | { |
| | | lightTeme.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString()); |
| | |
| | | { |
| | | if (receiveBytes[1] > 1) |
| | | { |
| | | curtain.trait_on_off.curValue = "on"; |
| | | curtain.SetAttrState(FunctionAttributeKey.OnOff, "on"); |
| | | } |
| | | else |
| | | { |
| | | curtain.trait_on_off.curValue = "off"; |
| | | curtain.SetAttrState(FunctionAttributeKey.OnOff, "off"); |
| | | } |
| | | curtain.SetAttrState(FunctionAttributeKey.Percent, receiveBytes[1].ToString()); |
| | | curtain.lastState = Language.StringByID(StringId.Open) + curtain.GetAttrState(FunctionAttributeKey.Percent) + "%"; |
| | |
| | | switch (receiveBytes[1]) |
| | | { |
| | | case 0: |
| | | curtain.trait_on_off.curValue = "stop"; |
| | | break; |
| | | curtain.SetAttrState(FunctionAttributeKey.OnOff, "stop"); |
| | | return; |
| | | case 1: |
| | | curtain.trait_on_off.curValue = "on"; |
| | | curtain.SetAttrState(FunctionAttributeKey.OnOff, "on"); |
| | | //curtain. |
| | | curtain.lastState = Language.StringByID(StringId.Open); |
| | | break; |
| | | case 2: |
| | | curtain.trait_on_off.curValue = "off"; |
| | | curtain.SetAttrState(FunctionAttributeKey.OnOff, "off"); |
| | | curtain.lastState = Language.StringByID(StringId.Close); |
| | | break; |
| | | } |
| | |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.TempType, receiveBytes[1].ToString()); |
| | | function.SetAttrState(FunctionAttributeKey.RoomTemp, receiveBytes[2].ToString()); |
| | | function.trait_on_off.curValue = receiveBytes[8] == 1 ? "on" : "off"; |
| | | function.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[8] == 1 ? "on" : "off"); |
| | | acFunction.SetMode(receiveBytes[9],function); |
| | | acFunction.SetFan(receiveBytes[10],function); |
| | | function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[11].ToString()); |
| | |
| | | if (function.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.TempType, receiveBytes[2]); |
| | | function.trait_on_off.curValue = receiveBytes[1] % 2 == 0 ? "off" : "on"; |
| | | function.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[1] % 2 == 0 ? "off" : "on"); |
| | | new FloorHeating().SetModeIndex(receiveBytes[3],function); |
| | | |
| | | if (function.Fh_Mode_Temp.ContainsKey("normal")) |
| | |
| | | break; |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(sensor); |
| | | A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(sensor); |
| | | //A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(sensor); |
| | | } |
| | | } |
| | | } |
| | |
| | | break; |
| | | } |
| | | |
| | | A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(sensor); |
| | | //A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(sensor); |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(sensor); |
| | | } |
| | | } |
| | |
| | | switch (receiveBytes[0]) |
| | | { |
| | | case 3:// |
| | | function.trait_on_off.curValue = receiveBytes[1] == 1 ? "on" : "off"; |
| | | function.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[1] == 1 ? "on" : "off"); |
| | | break; |
| | | case 4: |
| | | case 7: |
| | |
| | | for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;) |
| | | { |
| | | var localFunction = FunctionList.List.GetDeviceFunctionList()[i]; |
| | | if (localFunction.Spk_Prefix == FunctionCategory.Music || string.IsNullOrEmpty(localFunction.Spk_Prefix)) |
| | | if (SPK.MusicSpkList().Contains(localFunction.spk)) |
| | | { |
| | | i++; |
| | | continue; |
| | |
| | | //测试账号,不挤下线 |
| | | switch (UserInfo.Current.userMobileInfo) |
| | | { |
| | | case "13415629083": |
| | | case "18316120654": |
| | | case "15622703419": |
| | | case "18824864143": |
| | | case "464027401@qq.com": |
| | | case "2791308028@qq.com": |
| | | case "13697499568": |
| | | case "18666455392": |
| | | case "13375012446": |
| | | case "13602944661": |
| | | case "18778381374": |
| | | case "18316672920": |
| | | case "15971583093": |
| | | case "15626203746": |
| | | case "551775569@qq.com": |
| | | case "464027401@qq.com": |
| | | return; |
| | | } |
| | | |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </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> |
| | |
| | | /// 截图成功 |
| | | /// </summary> |
| | | /// <param name="image"></param> |
| | | public override void OnScreenshotSuccessfulAction(UIImage image) |
| | | { |
| | | //public override void OnScreenshotSuccessfulAction(UIImage image) |
| | | //{ |
| | | ////NSData imageData = UIImagePNGRepresentation(image); UIImage |
| | | //NSData imageData = image.AsPNG(); |
| | | //byte[] dataBytes = new byte[imageData.Length]; |
| | | //System.Runtime.InteropServices.Marshal.Copy(imageData.Bytes, dataBytes, 0, Convert.ToInt32(imageData.Length)); |
| | | ////image.g |
| | | ////hdlLinphone.ScreenshotSuccessfulAction(dataBytes); |
| | | } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 开锁成功 |
| | |
| | | ShowFunction.Sensor,ShowFunction.VideoIntercom, |
| | | ShowFunction.SecurityCenter |
| | | }); |
| | | instance.SupportFacePass = false; |
| | | instance.SaveResidenceData(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 上一次提示的时间 |
| | | /// </summary> |
| | | public DateTime LastTipTime = DateTime.MinValue; |
| | | /// <summary> |
| | | /// 是否需要提示 |
| | | /// </summary> |
| | | public bool NeedTip |
| | | { |
| | | get |
| | | { |
| | | return (DateTime.Now - LastTipTime).TotalDays > 2; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// 是否主网关 |
| | | /// </summary> |
| | | public bool master; |
| | | public string master; |
| | | /// <summary> |
| | | /// 是否开启了本地加密 |
| | | /// 2021-09-23 注意:为了兼容控制以前不加密网关要用这个新的字段,不能用local_encrypt,因为发现以前部分固件已经有这个标记并且回复true,但实际上通信还没加密的 |
| | |
| | | { |
| | | get |
| | | { |
| | | return spk.Replace(".",""); |
| | | string iconPath = spk.Replace(".", ""); |
| | | switch (spk) |
| | | { |
| | | case SPK.PanelSocket: |
| | | iconPath = "electricalsocket"; |
| | | break; |
| | | case SPK.SenesorMegahealth2: |
| | | iconPath = "sensormegahealth"; |
| | | break; |
| | | case SPK.SensorEnvironmentHailin: |
| | | iconPath = "sensorenvironment"; |
| | | break; |
| | | case SPK.HvacAirFresh: |
| | | iconPath = "airFreshstandard"; |
| | | break; |
| | | case SPK.HvacAirFreshJinmao: |
| | | iconPath = "airFreshjinmao"; |
| | | break; |
| | | case SPK.HvacAC: |
| | | iconPath = "acstandard"; |
| | | break; |
| | | case SPK.HvacFan: |
| | | iconPath = "electricalfan"; |
| | | break; |
| | | case SPK.ElectricTuyaFan2: |
| | | iconPath = "electricaltyqborgovyzytytz"; |
| | | break; |
| | | case SPK.ElectricTuyaAirCleaner2: |
| | | iconPath = "electricalQ1RsefNf91tIXyyQ"; |
| | | break; |
| | | case SPK.ElectricTuyaWaterValve2: |
| | | iconPath = "electricalkoiGhMKwLf2ZP81g"; |
| | | break; |
| | | case SPK.ElectricTuyaWeepRobot2: |
| | | iconPath = "electricalai6HtccKFIw3dxo3"; |
| | | break; |
| | | case SPK.AvMusic: |
| | | iconPath = "musicstandard"; |
| | | break; |
| | | |
| | | } |
| | | return iconPath; |
| | | } |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public string spk = ""; |
| | | |
| | | string spk_Prefix; |
| | | private string _SpkCategory = string.Empty; |
| | | /// <summary> |
| | | /// spk前缀 |
| | | /// 大类 |
| | | /// 功能类别 |
| | | /// 如:空调类、灯光类、窗帘类 |
| | | /// spk 产品的品类 |
| | | /// </summary> |
| | | public string Spk_Prefix |
| | | public string SpkCategory |
| | | { |
| | | get |
| | | { |
| | | if (string.IsNullOrEmpty(spk_Prefix)) |
| | | if (string.IsNullOrEmpty(_SpkCategory)) |
| | | { |
| | | spk_Prefix = spk.Split(".")[0]; |
| | | var arr = spk.Split("."); |
| | | if (arr.Length > 0) |
| | | { |
| | | _SpkCategory = arr[0]; |
| | | } |
| | | } |
| | | return spk_Prefix; |
| | | return _SpkCategory; |
| | | } |
| | | } |
| | | |
| | | private string _SpkClassification = string.Empty; |
| | | /// <summary> |
| | | /// spk 产品品类下的分类 |
| | | /// </summary> |
| | | public string SpkClassification |
| | | { |
| | | get |
| | | { |
| | | if (string.IsNullOrEmpty(_SpkClassification)) |
| | | { |
| | | var arr = spk.Split("."); |
| | | if (arr.Length > 1) |
| | | { |
| | | _SpkClassification = arr[1]; |
| | | } |
| | | } |
| | | return _SpkClassification; |
| | | } |
| | | } |
| | | |
| | | string _SpkManufacturer = string.Empty; |
| | | /// <summary> |
| | | /// spk 产品的厂商 |
| | | /// </summary> |
| | | public string SpkManufacturer |
| | | { |
| | | get |
| | | { |
| | | if (string.IsNullOrEmpty(_SpkManufacturer)) |
| | | { |
| | | var arr = spk.Split("."); |
| | | if (arr.Length > 2) |
| | | { |
| | | _SpkManufacturer = arr[2]; |
| | | } |
| | | } |
| | | return _SpkManufacturer; |
| | | } |
| | | } |
| | | |
| | | |
| | | //string spk_Prefix; |
| | | ///// <summary> |
| | | ///// spk前缀 |
| | | ///// 大类 |
| | | ///// 功能类别 |
| | | ///// 如:空调类、灯光类、窗帘类 |
| | | ///// </summary> |
| | | //public string Spk_Prefix |
| | | //{ |
| | | // get |
| | | // { |
| | | // if (string.IsNullOrEmpty(spk_Prefix)) |
| | | // { |
| | | // spk_Prefix = spk.Split(".")[0]; |
| | | // } |
| | | // return spk_Prefix; |
| | | // } |
| | | //} |
| | | |
| | | |
| | | /// <summary> |
| | | /// A协议功能的特性 |
| | | /// 如:是AC功能:特性:on_off,mode,fan,temperature |
| | |
| | | /// 功能属性 |
| | | /// 属性字段解析:attri :属性内容,value 属性的值,max 最大值 min 最小值 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | [Serializable] |
| | | public class FunctionAttributes |
| | | { |
| | | /// <summary> |
| | |
| | | /// (红外空调) |
| | | /// </summary> |
| | | public const string AcIr= "ir.ac"; |
| | | /// <summary> |
| | | /// 空调 |
| | | /// </summary> |
| | | public const string HvacAC = "hvac.ac"; |
| | | |
| | | /// <summary> |
| | | /// 空调spk列表 |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(AcStandard); |
| | | spkList.Add(HvacAC); |
| | | spkList.Add(AcIr); |
| | | return spkList; |
| | | } |
| | |
| | | /// (地热) |
| | | /// </summary> |
| | | public const string FloorHeatStandard = "floorHeat.standard"; |
| | | /// <summary> |
| | | /// 地暖 |
| | | /// </summary> |
| | | public const string HvacFloorHeat = "hvac.floorHeat"; |
| | | |
| | | /// <summary> |
| | | /// 地热spk列表 |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(FloorHeatStandard); |
| | | spkList.Add(HvacFloorHeat); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | /// </summary> |
| | | public const string AirFreshStandard = "airFresh.standard"; |
| | | /// <summary> |
| | | /// 新风 |
| | | /// </summary> |
| | | public const string HvacAirFresh = "hvac.airFresh"; |
| | | /// <summary> |
| | | /// 新风 ——金茂定制 |
| | | /// </summary> |
| | | public const string AirFreshJinmao = "airFresh.jinmao"; |
| | | /// <summary> |
| | | /// 新风 ——金茂定制 |
| | | /// </summary> |
| | | public const string HvacAirFreshJinmao = "hvac.airFresh.jinmao"; |
| | | |
| | | /// <summary> |
| | | /// 新风spk列表 |
| | |
| | | var spkList = new List<string>(); |
| | | spkList.Add(AirFreshStandard); |
| | | spkList.Add(AirFreshJinmao); |
| | | spkList.Add(HvacAirFresh); |
| | | spkList.Add(HvacAirFreshJinmao); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | /// (音乐) |
| | | /// </summary> |
| | | public const string MusicStandard = "music.standard"; |
| | | /// <summary> |
| | | /// 音乐 |
| | | /// </summary> |
| | | public const string AvMusic = "av.music"; |
| | | |
| | | /// <summary> |
| | | /// 音乐spk列表 |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(MusicStandard); |
| | | spkList.Add(AvMusic); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | | |
| | | #region 传感器 |
| | | |
| | | #region 安防传感器 |
| | | /// <summary> |
| | | /// (亮度传感器) |
| | |
| | | /// 毫米波传感器 |
| | | /// </summary> |
| | | public const string SenesorMegahealth = "sensor.megahealth"; |
| | | public const string SenesorMegahealth2 = "sensor.megahealth.zg"; |
| | | /// <summary> |
| | | /// 安防传感器spk列表 |
| | | /// </summary> |
| | |
| | | //spkList.Add(SensorShanLan); |
| | | //spkList.Add(SensorDuiShe); |
| | | //spkList.Add(SensoruUtrasonic); |
| | | //spkList.Add(SensorDryContact); |
| | | spkList.Add(SensorDryContact); |
| | | spkList.Add(SenesorMegahealth); |
| | | spkList.Add(SenesorMegahealth2); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | /// 青萍环境传感器 |
| | | /// </summary> |
| | | public const string SensorEnvironment3 = "sensor.environment3"; |
| | | public const string SensorEnvironmentHailin = "sensor.environment.hailin"; |
| | | /// <summary> |
| | | /// 甲醛 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public const string ElectricSocket = "electrical.socket"; |
| | | /// <summary> |
| | | /// 面板、插座、面板 |
| | | /// </summary> |
| | | public const string PanelSocket = "panel.socket"; |
| | | /// <summary> |
| | | /// 家电、电视 |
| | | /// </summary> |
| | | public const string ElectricTV = "electrical.tv"; |
| | |
| | | /// 家电、风扇 |
| | | /// </summary> |
| | | public const string ElectricFan = "electrical.fan"; |
| | | public const string HvacFan = "hvac.fan"; |
| | | /// <summary> |
| | | /// 凉霸 |
| | | /// </summary> |
| | |
| | | /// 家电、涂鸦空气净化器 |
| | | /// </summary> |
| | | public const string ElectricTuyaAirCleaner = "electrical.Q1RsefNf91tIXyyQ"; |
| | | public const string ElectricTuyaAirCleaner2 = "hvac.air.tuya_epi345"; |
| | | /// <summary> |
| | | /// 家电、涂鸦电风扇 |
| | | /// </summary> |
| | | public const string ElectricTuyaFan = "electrical.tyqborgovyzytytz"; |
| | | public const string ElectricTuyaFan2 = "hvac.fan.tuya_ef101"; |
| | | /// <summary> |
| | | /// 家电、涂鸦扫地机器人 |
| | | /// </summary> |
| | | public const string ElectricTuyaWeepRobot = "electrical.ai6HtccKFIw3dxo3"; |
| | | public const string ElectricTuyaWeepRobot2 = "electrical.sweep.tuya"; |
| | | /// <summary> |
| | | /// 家电、涂鸦水阀 |
| | | /// </summary> |
| | | public const string ElectricTuyaWaterValve = "electrical.koiGhMKwLf2ZP81g"; |
| | | public const string ElectricTuyaWaterValve2 = "electrical.watervalve.tuya_aw713"; |
| | | #endregion |
| | | |
| | | |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(ElectricSocket); |
| | | spkList.Add(PanelSocket); |
| | | spkList.Add(ElectricTV); |
| | | spkList.Add(TvIr); |
| | | spkList.Add(TvXmIr); |
| | | spkList.Add(ElectricFan); |
| | | spkList.Add(HvacFan); |
| | | spkList.Add(FanIr); |
| | | spkList.Add(ClothesHanger); |
| | | spkList.Add(IrLearn); |
| | | spkList.Add(PjtIr); |
| | | spkList.Add(StbIr); |
| | | spkList.Add(ElectricTuyaAirCleaner); |
| | | spkList.Add(ElectricTuyaAirCleaner2); |
| | | spkList.Add(ElectricTuyaFan); |
| | | spkList.Add(ElectricTuyaFan2); |
| | | spkList.Add(ElectricTuyaWeepRobot); |
| | | spkList.Add(ElectricTuyaWeepRobot2); |
| | | spkList.Add(ElectricTuyaWaterValve); |
| | | spkList.Add(ElectricTuyaWaterValve2); |
| | | spkList.Add(AirSwitch); |
| | | return spkList; |
| | | } |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(ElectricTuyaAirCleaner); |
| | | spkList.Add(ElectricTuyaAirCleaner2); |
| | | spkList.Add(ElectricTuyaFan); |
| | | spkList.Add(ElectricTuyaFan2); |
| | | spkList.Add(ElectricTuyaWaterValve); |
| | | spkList.Add(ElectricTuyaWaterValve2); |
| | | spkList.Add(ElectricTuyaWeepRobot); |
| | | spkList.Add(ElectricTuyaWeepRobot2); |
| | | spkList.Add(SenesorMegahealth); |
| | | spkList.Add(SenesorMegahealth2); |
| | | return spkList; |
| | | } |
| | | /// <summary> |
| | |
| | | list.Add(ElectricTuyaFan); |
| | | list.Add(ElectricTuyaWaterValve); |
| | | list.Add(ElectricTuyaWeepRobot); |
| | | list.Add(ElectricTuyaAirCleaner2); |
| | | list.Add(ElectricTuyaFan2); |
| | | list.Add(ElectricTuyaWaterValve2); |
| | | list.Add(ElectricTuyaWeepRobot2); |
| | | break; |
| | | case BrandType.All3tyBrand: |
| | | list.Add(SenesorMegahealth);//兆观 |
| | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 功能类别 |
| | | /// </summary> |
| | | public static class FunctionCategory |
| | | { |
| | | /// <summary> |
| | | ///(灯) |
| | | /// </summary> |
| | | public const string Light = "light"; |
| | | /// <summary> |
| | | /// (窗帘) |
| | | /// </summary> |
| | | public const string Curtain = "curtain"; |
| | | /// <summary> |
| | | /// (空调) |
| | | /// </summary> |
| | | public const string AC = "ac"; |
| | | /// <summary> |
| | | /// (地热) |
| | | /// </summary> |
| | | public const string FloorHeat = "floorHeat"; |
| | | /// <summary> |
| | | /// (新风) |
| | | /// </summary> |
| | | public const string AirFresh = "airFresh"; |
| | | /// <summary> |
| | | /// (音乐) |
| | | /// </summary> |
| | | public const string Music = "music"; |
| | | /// <summary> |
| | | /// (传感器) |
| | | /// </summary> |
| | | public const string Sensor = "sensor"; |
| | | /// <summary> |
| | | /// (干接点) |
| | | /// </summary> |
| | | public const string DryContact = "dryContact"; |
| | | /// <summary> |
| | | /// 家电 |
| | | /// </summary> |
| | | public const string Electric = "electrical"; |
| | | /// <summary> |
| | | /// 红外设备 |
| | | /// </summary> |
| | | public const string IR = "ir"; |
| | | ///// <summary> |
| | | ///// 功能类别 |
| | | ///// </summary> |
| | | //public static class FunctionCategory |
| | | //{ |
| | | // /// <summary> |
| | | // ///(灯) |
| | | // /// </summary> |
| | | // public const string Light = "light"; |
| | | // /// <summary> |
| | | // /// (窗帘) |
| | | // /// </summary> |
| | | // public const string Curtain = "curtain"; |
| | | // /// <summary> |
| | | // /// (空调) |
| | | // /// </summary> |
| | | // public const string AC = "ac"; |
| | | // /// <summary> |
| | | // /// (地热) |
| | | // /// </summary> |
| | | // public const string FloorHeat = "floorHeat"; |
| | | // /// <summary> |
| | | // /// (新风) |
| | | // /// </summary> |
| | | // public const string AirFresh = "airFresh"; |
| | | // /// <summary> |
| | | // /// (音乐) |
| | | // /// </summary> |
| | | // public const string Music = "music"; |
| | | // /// <summary> |
| | | // /// (传感器) |
| | | // /// </summary> |
| | | // public const string Sensor = "sensor"; |
| | | // /// <summary> |
| | | // /// (干接点) |
| | | // /// </summary> |
| | | // public const string DryContact = "dryContact"; |
| | | // /// <summary> |
| | | // /// 家电 |
| | | // /// </summary> |
| | | // public const string Electric = "electrical"; |
| | | // /// <summary> |
| | | // /// 红外设备 |
| | | // /// </summary> |
| | | // public const string IR = "ir"; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //} |
| | | |
| | | |
| | | public class VersionInfo |
| | |
| | | /// 获取rgb颜色 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public int GetRGBcolor(Function function ) |
| | | public int GetRGBcolor(Function function ,string rgbString ="") |
| | | { |
| | | var color = function.GetAttrState(FunctionAttributeKey.RGB).Split(","); |
| | | |
| | | if(!string.IsNullOrEmpty(rgbString)) |
| | | { |
| | | color = rgbString.Split(","); |
| | | } |
| | | if(color.Length!= 3) |
| | | { |
| | | color = new string[] {"100", "100", "100" }; |
| | |
| | | { |
| | | foreach (var function in GetDeviceFunctionList(SPK.BrandType.Hdl)) |
| | | { |
| | | switch (function.Spk_Prefix) |
| | | { |
| | | case FunctionCategory.Music: |
| | | case FunctionCategory.DryContact: |
| | | continue; |
| | | } |
| | | DriverLayer.Control.Ins.SendReadCommand(function); |
| | | //switch (function.Spk_Prefix) |
| | | //{ |
| | | // case FunctionCategory.Light: |
| | | // case FunctionCategory.Electric: |
| | | // case FunctionCategory.Curtain: |
| | | // case FunctionCategory.AC: |
| | | // case FunctionCategory.FloorHeat: |
| | | // case FunctionCategory.Sensor: |
| | | // DriverLayer.Control.Ins.SendReadCommand(function); |
| | | // break; |
| | | //} |
| | | Control.Ins.SendReadCommand(function); |
| | | } |
| | | if(DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | /// 设备绑定方式 WIFI、QRSCAN、ZIG_BEE、ETHERNET |
| | | /// </summary> |
| | | public string bindType; |
| | | |
| | | /// <summary> |
| | | /// icon文件名称 |
| | | /// </summary> |
| | | public string IconName |
| | | { |
| | | get |
| | | { |
| | | return spk.Replace(".", ""); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.2.0901"; |
| | | public static string VersionString = "1.2.0926"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | SPK.LightCCT,SPK.LightDimming,SPK.LightSwitch,SPK.LightRGB, |
| | | SPK.CurtainRoller,SPK.CurtainSwitch,SPK.CurtainTrietex, |
| | | SPK.AcIr,SPK.AcStandard, |
| | | SPK.FloorHeatStandard, |
| | | SPK.AirFreshStandard, |
| | | SPK.FloorHeatStandard,SPK.HvacFloorHeat, |
| | | SPK.AirFreshStandard,SPK.HvacAirFresh, |
| | | SPK.AirSwitch, |
| | | }; |
| | | |
| | | |
| | | static List<string> _RoomNotSupportFunctionList = null; |
| | | /// <summary> |
| | | /// 房间功能列表不加载的功能列表 |
| | | /// </summary> |
| | | public static List<string> RoomNotSupportFunctionList = new List<string> |
| | | public static List<string> RoomNotSupportFunctionList |
| | | { |
| | | SPK.EnergyStandard, |
| | | SPK.MusicStandard, |
| | | SPK.AirSwitch, |
| | | SPK.ElectricEnergy, |
| | | }; |
| | | get { |
| | | if(_RoomNotSupportFunctionList == null) |
| | | { |
| | | _RoomNotSupportFunctionList = new List<string>(); |
| | | _RoomNotSupportFunctionList.Add(SPK.EnergyStandard); |
| | | _RoomNotSupportFunctionList.Add(SPK.MusicStandard); |
| | | _RoomNotSupportFunctionList.Add(SPK.AvMusic); |
| | | _RoomNotSupportFunctionList.Add(SPK.AirSwitch); |
| | | _RoomNotSupportFunctionList.Add(SPK.ElectricEnergy); |
| | | _RoomNotSupportFunctionList.AddRange(SPK.EnvironDeviceSpkList()); |
| | | _RoomNotSupportFunctionList.AddRange(SPK.ArmSensorSpkList()); |
| | | } |
| | | return _RoomNotSupportFunctionList; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.HvacFloorHeat: |
| | | var fhView = new FloorHeatingPage(function); |
| | | MainPage.BasePageView.AddChidren(fhView); |
| | | fhView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.ElectricFan: |
| | | case SPK.HvacFan: |
| | | var fanView = new FanPage(function); |
| | | MainPage.BasePageView.AddChidren(fanView); |
| | | fanView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | var sView = new SocketPage(function); |
| | | MainPage.BasePageView.AddChidren(sView); |
| | | sView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
| | | break;
|
| | | case SPK.ElectricTuyaAirCleaner: |
| | | case SPK.ElectricTuyaAirCleaner2: |
| | | var airCleaner = new TuyaAirCleanerPage(); |
| | | airCleaner.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break;
|
| | | case SPK.ElectricTuyaFan: |
| | | case SPK.ElectricTuyaFan2: |
| | | var tuyaFan = new TuyaFanPage(); |
| | | tuyaFan.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.ElectricTuyaWaterValve:
|
| | | case SPK.ElectricTuyaWaterValve2:
|
| | | var tyWaterValve = new TuyaWaterValvePage();
|
| | | tyWaterValve.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
|
| | | break;
|
| | | case SPK.ElectricTuyaWeepRobot: |
| | | case SPK.ElectricTuyaWeepRobot2: |
| | | var weepRobot = new TuyaWeepRobotPage(); |
| | | weepRobot.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.MusicStandard: |
| | | case SPK.AvMusic: |
| | | Music.A31MusicModel.Current = (function as Music.A31MusicModel);//当前播放器 |
| | | var a31PlayMusicPage = new Music.A31PlayMusicPage(); |
| | | MainPage.BasePageView.AddChidren(a31PlayMusicPage); |
| | |
| | | doorwindowPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | var smPage = new SenesorMegahealthPage(); |
| | | smPage.ShowColltionButton = false; |
| | | smPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | |
| | | irLearinPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break;
|
| | | case SPK.AirFreshJinmao: |
| | | case SPK.HvacAirFreshJinmao: |
| | | var airFresh1 = new AirFreshControlPage(); |
| | | airFresh1.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | var airFresh2 = new AirFreshRelayControlPage(); |
| | | airFresh2.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 灯光功能列表界面 |
| | | /// 带组合调光编辑 |
| | | /// </summary> |
| | | /// <param name="backAction"></param> |
| | | /// <param name="editAction"></param> |
| | | public void LoadTopView_LightFunction( Action editAction) |
| | | { |
| | | LoadTopView(); |
| | | |
| | | var btnSetting = new Button() |
| | | { |
| | | X = Application.GetRealWidth(337), |
| | | Y = Application.GetRealHeight(29), |
| | | Width = Application.GetMinRealAverage(28), |
| | | Height = Application.GetMinRealAverage(28), |
| | | UnSelectedImagePath = "FunctionIcon/Light/LightScene/SetLightSceneIcon.png", |
| | | }; |
| | | |
| | | contentView.AddChidren(btnSetting); |
| | | btnSetting.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | editAction(); |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 向framelayout添加顶部区域,拥有配置图标按钮 |
| | | /// </summary> |
| | | /// <param name="frame"></param> |
| | |
| | | /// <summary> |
| | | /// 初始化Dialog |
| | | /// </summary> |
| | | /// <param name="titleStr"></param> |
| | | /// <param name="msgStr"></param> |
| | | /// <param name="titleStr">标题</param> |
| | | /// <param name="msgStr">提示信息</param> |
| | | /// <param name="okAction"></param> |
| | | /// <param name="cancelAction"></param> |
| | | /// <param name="cancelID"></param> |
| | |
| | | { |
| | | //etAccount.Text = "tf@smarttech.com.ua";//国外账号,有住宅,登录无法显示 |
| | | //etAccount.Text = "13375012446";//测试服务器 |
| | | //etAccount.Text = "13450425803"; |
| | | //etAccount.Text = "1033326940@qq.com"; |
| | | //etAccount.Text = "18022428438";//wjc |
| | | //etAccount.Text = "13602944661";//kx |
| | | etAccount.Text = "13226233133";//豆豆 |
| | | etAccount.Text = "18316672920"; |
| | | //etAccount.Text = "18316672920"; |
| | | //etAccount.Text = "18316120654";//tujie |
| | | //etAccount.Text = "15626203746"; |
| | | //etAccount.Text = "13450425807";//黄竹溪 knx项目 |
| | | etAccount.Text = "15626203746"; |
| | | etAccount.Text = "13450425807";//黄竹溪 knx项目 |
| | | } |
| | | else |
| | | { |
| | |
| | | //etAccount.Text = "15217626103";//昆明金茂项目 |
| | | //etAccount.Text = "18598273624"; |
| | | etAccount.Text = "tf@smarttech.com.ua"; |
| | | etAccount.Text = "18814122445";//董泽斌 天河办公室 |
| | | //etAccount.Text = "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 |
| | | } |
| | | b = !b; |
| | |
| | | IsBold = true, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = "Demo模式" |
| | | Text = "游客体验" |
| | | }; |
| | | bodyView.AddChidren(btnDomeLogin); |
| | | |
| | | if(Language.CurrentLanguage!= "Chinese") |
| | | { |
| | | btnDomeLogin.Text = "Experience model"; |
| | | btnDomeLogin.Text = "Tourist experience"; |
| | | } |
| | | |
| | | btnDomeLogin.MouseUpEventHandler = (sender, e) => { |
| | |
| | | this.EndHeaderRefreshing(); |
| | | Common.ApiUtlis.Ins.DownloadData(); |
| | | LoadContentView(); |
| | | if(!CurShowTypeIsFunction) |
| | | { |
| | | contentView.PageIndex = 1; |
| | | } |
| | | }; |
| | | |
| | | #region topView |
| | |
| | | |
| | | FunctionList.List.Functions.Add(new Function() |
| | | { |
| | | spk = SPK.SensorDryContact, |
| | | name = "干接点", |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes(){ key = "status",curValue= "on",state = "on" }, |
| | | }, |
| | | }); |
| | | |
| | | FunctionList.List.Functions.Add(new Function() |
| | | { |
| | | spk = SPK.AirSwitch, |
| | | name = "智能空开", |
| | | attributes = new List<FunctionAttributes>() |
| | |
| | | sceneFunctionView = new VerticalScrolViewLayout(); |
| | | contentView.AddChidren(sceneFunctionView); |
| | | LoadSceneFunctionControlZone(); |
| | | contentView.PageIndex = 0; |
| | | |
| | | if (CurShowTypeIsFunction) |
| | | { |
| | | contentView.PageIndex = 0; |
| | | }else |
| | | { |
| | | contentView.PageIndex = 1; |
| | | } |
| | | |
| | | LoadEvent_ChangeShowedFunctionType(); |
| | | |
| | |
| | | sceneFunctionView = new VerticalScrolViewLayout(); |
| | | contentView.AddChidren(sceneFunctionView); |
| | | LoadSceneFunctionControlZone(); |
| | | contentView.PageIndex = 0; |
| | | |
| | | if (CurShowTypeIsFunction) |
| | | { |
| | | contentView.PageIndex = 0; |
| | | } |
| | | else |
| | | { |
| | | contentView.PageIndex = 1; |
| | | } |
| | | |
| | | |
| | | LoadEvent_ChangeShowedFunctionType(); |
| | |
| | | foreach (var function in list) |
| | | { |
| | | //音乐模块有主从关系,需要特殊处理 |
| | | if (function.Spk_Prefix == FunctionCategory.Music) |
| | | if (SPK.MusicSpkList().Contains( function.spk)) |
| | | { |
| | | //var music = function as Music.A31MusicModel; |
| | | var music = Music.A31MusicModel.A31MusicModelList.Find((obj) => obj.sid == function.sid); |
| | |
| | | LoadEvent_ControlTV(function, btnPower); |
| | | } |
| | | |
| | | else if (function.spk == SPK.MusicStandard) |
| | | else if (function.spk == SPK.MusicStandard || function.spk == SPK.AvMusic) |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Music/MusicIcon.png"; |
| | | btnIcon.SelectedImagePath = "FunctionIcon/Music/MusicOnIcon.png"; |
| | |
| | | //取消收藏事件 |
| | | Action cannelCollect = () => { |
| | | function.collect = false; |
| | | if (function.Spk_Prefix == FunctionCategory.Music)//处理音乐主从关系 |
| | | if (SPK.MusicSpkList().Contains(function.spk))//处理音乐主从关系 |
| | | { |
| | | if ((function as Music.A31MusicModel).ServerClientType == 1) |
| | | { |
| | |
| | | btn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | function.collect = false; |
| | | if (function.Spk_Prefix == FunctionCategory.Music)//处理音乐主从关系 |
| | | if (SPK.MusicSpkList().Contains(function.spk))//处理音乐主从关系 |
| | | { |
| | | if ((function as Music.A31MusicModel).ServerClientType == 1) |
| | | { |
| | |
| | | btnChangeScene.IsBold = false; |
| | | CurShowTypeIsFunction = true; |
| | | contentView.PageIndex = 0; |
| | | |
| | | }; |
| | | |
| | | //var client = new BlufiClient(); |
| | |
| | | btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; |
| | | btnChangeScene.IsSelected = false; |
| | | btnChangeScene.IsBold = false; |
| | | CurShowTypeIsFunction = true; |
| | | } |
| | | else |
| | | { |
| | |
| | | btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; |
| | | btnChangeFunction.IsSelected = false; |
| | | btnChangeFunction.IsBold = false; |
| | | CurShowTypeIsFunction = false; |
| | | } |
| | | }; |
| | | } |
| | |
| | | if (function.spk == SPK.CurtainRoller || function.spk == SPK.CurtainShades || function.spk == SPK.CurtainTrietex || |
| | | function.spk == SPK.CurtainSwitch)//窗帘设备根据百分比判断开关状态 |
| | | { |
| | | state = function.GetAttrState(FunctionAttributeKey.Percent) != "0"; |
| | | if (function.GetAttribute(FunctionAttributeKey.Percent) != null) |
| | | { |
| | | state = function.GetAttrState(FunctionAttributeKey.Percent) != "0"; |
| | | }else |
| | | { |
| | | if (function.GetAttrState(FunctionAttributeKey.OnOff) == "stop") |
| | | return; |
| | | state = function.trait_on_off.curValue.ToString() == "on"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | btn.IsSelected = state; |
| | | if (btn.Tag != null && btn.Tag.ToString() == "state") |
| | | { |
| | | if (function.Spk_Prefix == FunctionCategory.Music) |
| | | if (SPK.MusicSpkList().Contains(function.spk)) |
| | | { |
| | | btn.Text = (function as Music.A31MusicModel).A31PlayStatus.Title; |
| | | } |
| | |
| | | if (fcView.GetChildren(j).Tag == null) |
| | | continue; |
| | | var cTag = fcView.GetChildren(j).Tag.ToString(); |
| | | switch (updataFunction.Spk_Prefix) |
| | | if (SPK.LightSpkList().Contains(updataFunction.spk) || |
| | | SPK.AcSpkList().Contains(updataFunction.spk) || |
| | | SPK.FhSpkList().Contains(updataFunction.spk) || |
| | | SPK.ElectricalSpkList().Contains(updataFunction.spk) || |
| | | SPK.AirFreshSpkList().Contains(updataFunction.spk)) |
| | | { |
| | | case FunctionCategory.Light: |
| | | case FunctionCategory.AC: |
| | | case FunctionCategory.FloorHeat: |
| | | case FunctionCategory.Electric: |
| | | case FunctionCategory.AirFresh: |
| | | #region 按钮状态更新 |
| | | if (cTag == updataFunction.sid + "_Switch") |
| | | #region 按钮状态更新 |
| | | if (cTag == updataFunction.sid + "_Switch") |
| | | { |
| | | try |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.curValue.ToString() == "on"; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{this.GetType()} error 0 : {ex.Message}"); |
| | | } |
| | | (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.curValue.ToString() == "on"; |
| | | } |
| | | #endregion |
| | | #region 调光状态进度更新 |
| | | else if (cTag == updataFunction.sid + "_DimmerBar") |
| | | catch (Exception ex) |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as DiyImageSeekBar).Progress = Convert.ToInt32(updataFunction.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | if (updataFunction.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | (fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1; |
| | | } |
| | | else |
| | | { |
| | | (fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.PromptingColor2; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{this.GetType()} error 1 : {ex.Message}"); |
| | | } |
| | | MainPage.Log($"{this.GetType()} error 0 : {ex.Message}"); |
| | | } |
| | | #endregion |
| | | #region 功能状态信息更新 |
| | | else if (cTag == updataFunction.spk + "_laststates_" + updataFunction.sid) |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.curValue.ToString() == "on"; |
| | | (fcView.GetChildren(j) as Button).Text = updataFunction.lastState; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{this.GetType()} error 2 : {ex.Message}"); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | #endregion |
| | | case FunctionCategory.Curtain: |
| | | #region 窗帘更新 |
| | | var onoffString = updataFunction.GetAttrState(FunctionAttributeKey.OnOff); |
| | | if (onoffString == "stop") |
| | | #region 调光状态进度更新 |
| | | else if (cTag == updataFunction.sid + "_DimmerBar") |
| | | { |
| | | try |
| | | { |
| | | return; |
| | | } |
| | | var percent = onoffString == "off" ? 0 : 100; |
| | | if(updataFunction.GetAttributes().Contains(FunctionAttributeKey.Percent)) |
| | | { |
| | | string percentString = updataFunction.GetAttrState(FunctionAttributeKey.Percent); |
| | | int.TryParse(percentString, out percent); |
| | | } |
| | | if (percent == 0) |
| | | { |
| | | if (cTag == updataFunction.sid + "_off") |
| | | (fcView.GetChildren(j) as DiyImageSeekBar).Progress = Convert.ToInt32(updataFunction.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | if (updataFunction.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = true; |
| | | } |
| | | catch { } |
| | | (fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1; |
| | | } |
| | | else |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = false; |
| | | (fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.PromptingColor2; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{this.GetType()} error 1 : {ex.Message}"); |
| | | } |
| | | } |
| | | #endregion |
| | | #region 功能状态信息更新 |
| | | else if (cTag == updataFunction.spk + "_laststates_" + updataFunction.sid) |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.curValue.ToString() == "on"; |
| | | (fcView.GetChildren(j) as Button).Text = updataFunction.lastState; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{this.GetType()} error 2 : {ex.Message}"); |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | else if (SPK.CurtainSpkList().Contains(updataFunction.spk)) |
| | | { |
| | | #region 窗帘更新 |
| | | var onoffString = updataFunction.GetAttrState(FunctionAttributeKey.OnOff); |
| | | if (onoffString == "stop") |
| | | { |
| | | return; |
| | | } |
| | | var percent = onoffString == "off" ? 0 : 100; |
| | | if (updataFunction.GetAttributes().Contains(FunctionAttributeKey.Percent)) |
| | | { |
| | | string percentString = updataFunction.GetAttrState(FunctionAttributeKey.Percent); |
| | | int.TryParse(percentString, out percent); |
| | | } |
| | | if (percent == 0) |
| | | { |
| | | if (cTag == updataFunction.sid + "_off") |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = true; |
| | | } |
| | | catch { } |
| | | } |
| | | else |
| | | { |
| | | if (cTag == updataFunction.sid + "_on") |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = true; |
| | | } |
| | | catch { } |
| | | } |
| | | else |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = false; |
| | | } |
| | | (fcView.GetChildren(j) as Button).IsSelected = false; |
| | | } |
| | | #endregion |
| | | break; |
| | | case FunctionCategory.Music: |
| | | #region 音乐更新 |
| | | var uMusic = updataFunction as Music.A31MusicModel; |
| | | if (cTag == updataFunction.spk + "_State_" + updataFunction.sid) |
| | | } |
| | | else |
| | | { |
| | | if (cTag == updataFunction.sid + "_on") |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = uMusic.A31PlayStatus.status == "play"; |
| | | (fcView.GetChildren(j) as Button).IsSelected = true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{this.GetType()} error 3 : {ex.Message}"); |
| | | } |
| | | catch { } |
| | | } |
| | | #endregion |
| | | break; |
| | | else |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = false; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | else if (SPK.MusicSpkList().Contains(updataFunction.spk)) |
| | | { |
| | | #region 音乐更新 |
| | | var uMusic = updataFunction as Music.A31MusicModel; |
| | | if (cTag == updataFunction.spk + "_State_" + updataFunction.sid) |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = uMusic.A31PlayStatus.status == "play"; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{this.GetType()} error 3 : {ex.Message}"); |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | | } |
| | |
| | | btnName.TextID = StringId.EnvironmentalData; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //var skipView = new EnvironmentalPage();// EnvironmentalSciencePage(); |
| | | var skipView = new A_EnvironmentalDataCenter();// EnvironmentalSciencePage(); |
| | | var skipView = new EnvironmentalPage();// EnvironmentalSciencePage(); |
| | | //var skipView = new A_EnvironmentalDataCenter();// EnvironmentalSciencePage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | try |
| | | { |
| | | ShowFunction vv = ShowFunction.Light; |
| | | switch (function.spk) |
| | | if (SPK.ElectricalSpkList().Contains(function.spk)) |
| | | { |
| | | case SPK.FloorHeatStandard: |
| | | vv = ShowFunction.FloorHeating; |
| | | break; |
| | | case SPK.AcStandard: |
| | | vv = ShowFunction.AC; |
| | | break; |
| | | case SPK.CurtainRoller: |
| | | case SPK.CurtainShades: |
| | | case SPK.CurtainSwitch: |
| | | case SPK.CurtainTrietex: |
| | | vv = ShowFunction.Curtain; |
| | | break; |
| | | case SPK.LightCCT: |
| | | case SPK.LightDimming: |
| | | case SPK.LightRGB: |
| | | case SPK.LightSwitch: |
| | | vv = ShowFunction.Light; |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.ElectricTuyaAirCleaner: |
| | | case SPK.ElectricTuyaFan: |
| | | case SPK.ElectricTuyaWaterValve: |
| | | case SPK.ElectricTuyaWeepRobot: |
| | | case SPK.ClothesHanger: |
| | | case SPK.AirSwitch: |
| | | vv = ShowFunction.Electric; |
| | | break; |
| | | case SPK.AirFreshJinmao: |
| | | case SPK.AirFreshStandard: |
| | | vv = ShowFunction.FreshAir; |
| | | break; |
| | | vv = ShowFunction.Electric; |
| | | } |
| | | else if (SPK.FhSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.FloorHeating; |
| | | } |
| | | else if (SPK.AcSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.AC; |
| | | } |
| | | else if (SPK.CurtainSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.Curtain; |
| | | } |
| | | else if (SPK.LightSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.Light; |
| | | } |
| | | else if (SPK.AirFreshSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.FreshAir; |
| | | } |
| | | UpdataFunctionOnCount(vv, function.spk); |
| | | UpdataCloseAllButton(function); |
| | |
| | | |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; |
| | | |
| | | if (function.Spk_Prefix == FunctionCategory.Curtain//窗帘没有开关按钮 |
| | | || function.Spk_Prefix == FunctionCategory.Music//音乐没有开关按钮 |
| | | || function.Spk_Prefix == FunctionCategory.Sensor//传感器没有开关按钮 |
| | | ) |
| | | if (SPK.CurtainSpkList().Contains(function.spk)) |
| | | {//窗帘没有开关按钮 |
| | | CurtainFragment(); |
| | | } |
| | | else if (SPK.MusicSpkList().Contains(function.spk)) |
| | | {//音乐没有开关按钮 |
| | | MusicFragment(); |
| | | } |
| | | else if (SPK.EvironmentSensorList().Contains(function.spk) || SPK.ArmSensorSpkList().Contains(function.spk)) //传感器没有开关按钮) |
| | | { |
| | | switch (function.Spk_Prefix) |
| | | var powerLowTipAttr = function.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); |
| | | if (powerLowTipAttr != null) |
| | | { |
| | | case FunctionCategory.Curtain: |
| | | CurtainFragment(); |
| | | break; |
| | | case FunctionCategory.Sensor: |
| | | var powerLowTipAttr = function.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); |
| | | if (powerLowTipAttr != null) |
| | | if (powerLowTipAttr.state.ToLower() == "low") |
| | | { |
| | | Button btnTipPowerLow = new Button() |
| | | { |
| | | if (powerLowTipAttr.state.ToLower() == "low") |
| | | { |
| | | Button btnTipPowerLow = new Button() |
| | | { |
| | | X = Application.GetRealWidth(307), |
| | | Y = Application.GetRealHeight(25), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", |
| | | SelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", |
| | | }; |
| | | this.AddChidren(btnTipPowerLow); |
| | | } |
| | | } |
| | | |
| | | break; |
| | | case FunctionCategory.Music: |
| | | MusicFragment(); |
| | | break; |
| | | |
| | | X = Application.GetRealWidth(307), |
| | | Y = Application.GetRealHeight(25), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", |
| | | SelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png", |
| | | }; |
| | | this.AddChidren(btnTipPowerLow); |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | LoadEvent_SwitchFunction(btnSwitch); |
| | | } |
| | | |
| | | switch (function.Spk_Prefix) |
| | | if (SPK.AcSpkList().Contains(function.spk) || |
| | | SPK.FhSpkList().Contains(function.spk)) |
| | | { |
| | | case FunctionCategory.AC: |
| | | LoadLastStatesButton(); |
| | | break; |
| | | case FunctionCategory.IR: |
| | | LoadLastStatesButton(); |
| | | break; |
| | | case FunctionCategory.FloorHeat: |
| | | LoadLastStatesButton(); |
| | | break; |
| | | case FunctionCategory.Light: |
| | | btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on"; |
| | | LoadLightControl(); |
| | | break; |
| | | case FunctionCategory.Electric: |
| | | btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on"; |
| | | break; |
| | | LoadLastStatesButton(); |
| | | } |
| | | else if (SPK.LightSpkList().Contains(function.spk)) |
| | | { |
| | | btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on"; |
| | | LoadLightControl(); |
| | | } |
| | | else if (SPK.ElectricalSpkList().Contains(function.spk)) |
| | | { |
| | | btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on"; |
| | | } |
| | | #endregion |
| | | } |
| | |
| | | }; |
| | | //bodyDiv.AddChidren(btnCollectionIcon); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if ( function.Spk_Prefix != FunctionCategory.Sensor)//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare && |
| | | if ( !SPK.ArmSensorSpkList().Contains(function.spk) || !SPK.EnvironDeviceSpkList().Contains( function.spk))//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare && |
| | | { |
| | | bodyDiv.AddChidren(btnCollectionIcon); |
| | | } |
| | |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (function.Spk_Prefix == FunctionCategory.Light) |
| | | if (SPK.LightSpkList().Contains( function.spk)) |
| | | { |
| | | function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | public void LoadPage(int titleId) |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView(); |
| | | |
| | | if (titleId == StringId.Lights) |
| | | { |
| | | Action action = () => |
| | | { |
| | | var skipView = new AddLightScene(new List<Function>(), new Scene() { sceneType = SceneType.LightScene }); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView_LightFunction(action); |
| | | } |
| | | else |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView(); |
| | | } |
| | | /// <summary> |
| | | /// 房间内容显示区域 |
| | | /// </summary> |
| | |
| | | functionListView.RemoveAll(); |
| | | foreach (var function in showList) |
| | | { |
| | | |
| | | if(function.spk == SPK.SensorDryContact) |
| | | { |
| | | continue; |
| | | } |
| | | if (function.spk == SPK.LightRGB || function.spk == SPK.LightDimming) |
| | | { |
| | | var functionDiv = new FunctionControlZone(function) |
| | |
| | | |
| | | foreach (var function in room.GetRoomFunctions(false)) |
| | | { |
| | | if (function.Spk_Prefix == FunctionCategory.Sensor || function.spk == SPK.ElectricEnergy) |
| | | if (MainPage.RoomNotSupportFunctionList.Contains( function.spk)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | Tag = "Logic"; |
| | | } |
| | | /// <summary> |
| | | /// 当前选中的功能 |
| | | /// </summary> |
| | | private Entity.Function function = null; |
| | | /// <summary> |
| | | /// 定义一个记录选中设备状态列表; |
| | | /// </summary> |
| | | private List<Dictionary<string, string>> dicSateteList = new List<Dictionary<string, string>>(); |
| | |
| | | |
| | | public void Show(Entity.Function device, int index, bool edit) |
| | | { |
| | | this.function = device; |
| | | #region 界面布局 |
| | | this.BackgroundColor = CSS.CSS_Color.viewMiddle; |
| | | LogicView.TopView topView = new LogicView.TopView(); |
| | |
| | | case SPK.AcStandard: |
| | | //地热 |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.HvacFloorHeat: |
| | | //新风 |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | { |
| | | |
| | | LogicView.FunTypeView view = new LogicView.FunTypeView(); |
| | |
| | | break; |
| | | //毫米波传感器 |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | { |
| | | LogicView.FunTypeView view = new LogicView.FunTypeView(); |
| | | view.btnText.TextID = StringId.mubiaozhuangtai;//目标状态 |
| | |
| | | switch (device.spk) |
| | | { |
| | | //传感器 |
| | | case SPK.SensorGas: |
| | | case SPK.SensorWater: |
| | | case SPK.SensorSmoke: |
| | | case SPK.SensorGas: |
| | | case SPK.SensorDryContact: |
| | | case SPK.SensorShanLan: |
| | | case SPK.SensorDuiShe: |
| | | case SPK.SensorPir: |
| | | { |
| | | keyVlaue = "status"; |
| | | if (!Is_SpkAttribute(keyVlaue)) { |
| | | keyVlaue = "alarm_status"; |
| | | } |
| | | }; |
| | | break; |
| | | case SPK.SensorDoorWindow: |
| | | case SPK.SensorDryContact: |
| | | { |
| | | keyVlaue = "status"; |
| | | if (!Is_SpkAttribute(keyVlaue)) |
| | | { |
| | | keyVlaue = "contact_status"; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.SensorDuiShe: |
| | | case SPK.SensorShanLan: |
| | | case SPK.SensorPir: |
| | | case SPK.SensorUtrasonic: |
| | | { |
| | | keyVlaue = "status"; |
| | | if (!Is_SpkAttribute(keyVlaue)) |
| | | { |
| | | keyVlaue = "people_status"; |
| | | } |
| | | |
| | | } |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | { |
| | | keyVlaue = "action_state"; |
| | | if (!Is_SpkAttribute(keyVlaue)) |
| | | { |
| | | keyVlaue = "megahealth_state"; |
| | | } |
| | | } |
| | | break; |
| | | |
| | |
| | | break; |
| | | case StringId.wuren: |
| | | { |
| | | if (device.spk == SPK.SenesorMegahealth) |
| | | if (device.spk == SPK.SenesorMegahealth || device.spk == SPK.SenesorMegahealth2) |
| | | { |
| | | value = "uninhabited"; |
| | | } |
| | |
| | | case SPK.SensorTVOC: |
| | | case SPK.SensorHcho: |
| | | { |
| | | ///公司传感器key的健值是“value”; |
| | | key = "value"; |
| | | if (!Is_SpkAttribute(key)) |
| | | { |
| | | key = "value"; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 识别使用功能是否存在属性 |
| | | /// </summary> |
| | | /// <param name="key">设备属性,云雀上定义好的</param> |
| | | /// <returns></returns> |
| | | private bool Is_SpkAttribute(string key) { |
| | | ///修改新属性 |
| | | ///识别使用功能是否存在属性 |
| | | var job = this.function.GetAttribute(key); |
| | | if (job != null) |
| | | { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | //空调 |
| | | case SPK.AcStandard: |
| | | //地热 |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.HvacFloorHeat:case SPK.FloorHeatStandard: |
| | | //新风 |
| | | case SPK.AirFreshStandard: |
| | | {//开关灯 |
| | | case SPK.HvacAirFresh: |
| | | {//开关灯 |
| | | foreach (var dic in dicList) |
| | | { |
| | | |
| | |
| | | switch (dic["key"]) |
| | | { |
| | | case "status": |
| | | case "people_status": |
| | | { |
| | | if (value == "true") |
| | | { |
| | |
| | | } |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | |
| | | |
| | | } |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: |
| | | { |
| | | string on_off = GetKeyValue("on_off", dicList); |
| | | string set_temp = GetKeyValue("set_temp", dicList); |
| | |
| | | } |
| | | break; |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | { |
| | | string on_off = GetKeyValue("on_off", dicList); |
| | | string fan = GetKeyValue("fan", dicList); |
| | |
| | | |
| | | } |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: |
| | | { |
| | | |
| | | foreach (var dic in dicList) |
| | |
| | | } |
| | | break; |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | { |
| | | |
| | | foreach (var dic in dicList) |
| | |
| | | } |
| | | } |
| | | break; |
| | | |
| | | case "fan": |
| | | |
| | | case "fan": |
| | | { |
| | | if (button2 == null) |
| | | { |
| | |
| | | switch (dic["key"]) |
| | | { |
| | | case "status": |
| | | case "people_status": |
| | | { |
| | | if (value == "true") |
| | | { |
| | |
| | | } |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | |
| | | } |
| | | break; |
| | | case SPK.AcStandard: |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | |
| | | strPath = "LogicIcon/airconditionerlogic.png"; |
| | | } |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: |
| | | { |
| | | strPath = "LogicIcon/heatlogic.png"; |
| | | } |
| | | break; |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | { |
| | | strPath = "LogicIcon/heatlogic.png"; |
| | | } |
| | |
| | | case SPK.SensorDoorWindow: |
| | | case SPK.SensorUtrasonic: |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | case SPK.SensorEnvironment: |
| | | case SPK.SensorEnvironment2: |
| | | case SPK.SensorEnvironment3: |
| | |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.AC)); |
| | | } |
| | | var floorHeating = deviceList.Find((device) => device.spk == SPK.FloorHeatStandard); |
| | | var floorHeating = deviceList.Find((device) => device.spk == SPK.FloorHeatStandard || device.spk == SPK.HvacFloorHeat); |
| | | if (floorHeating != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.FloorHeating)); |
| | | } |
| | | var airFresh = deviceList.Find((device) => device.spk == SPK.AirFreshStandard); |
| | | var airFresh = deviceList.Find((device) => device.spk == SPK.AirFreshStandard || device.spk == SPK.HvacAirFresh); |
| | | if (airFresh != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.AirFresh)); |
| | |
| | | || device.spk == SPK.SensorDoorWindow |
| | | || device.spk == SPK.SensorUtrasonic |
| | | || device.spk == SPK.SenesorMegahealth |
| | | || device.spk == SPK.SenesorMegahealth2 |
| | | || device.spk == SPK.SensorEnvironment |
| | | || device.spk == SPK.SensorEnvironment2 |
| | | || device.spk == SPK.SensorEnvironment3 |
| | |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.FloorHeating)) |
| | | { |
| | | functionTypeList.Add(SPK.FloorHeatStandard); |
| | | functionTypeList.Add(SPK.FloorHeatStandard);functionTypeList.Add(SPK.HvacFloorHeat); |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.AirFresh)) |
| | | { |
| | | functionTypeList.Add(SPK.AirFreshStandard); |
| | | functionTypeList.Add(SPK.AirFreshStandard); functionTypeList.Add(SPK.HvacAirFresh); |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.Sensor)) |
| | | { |
| | |
| | | functionTypeList.Add(SPK.SensorDoorWindow); |
| | | functionTypeList.Add(SPK.SensorUtrasonic); |
| | | functionTypeList.Add(SPK.SenesorMegahealth); |
| | | functionTypeList.Add(SPK.SenesorMegahealth2); |
| | | functionTypeList.Add(SPK.SensorEnvironment); |
| | | functionTypeList.Add(SPK.SensorEnvironment2); |
| | | functionTypeList.Add(SPK.SensorEnvironment3); |
| | |
| | | deviceTypeList.Add(SPK.CurtainSwitch); |
| | | deviceTypeList.Add(SPK.CurtainRoller); |
| | | deviceTypeList.Add(SPK.CurtainTrietex); |
| | | deviceTypeList.Add(SPK.AcStandard); |
| | | deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAirFresh); |
| | | deviceTypeList.Add(SPK.AirFreshStandard); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); deviceTypeList.Add(SPK.HvacFloorHeat); |
| | | deviceTypeList.Add(SPK.SensorSmoke); |
| | | deviceTypeList.Add(SPK.SensorWater); |
| | | deviceTypeList.Add(SPK.SensorGas); |
| | |
| | | deviceTypeList.Add(SPK.SensorDoorWindow); |
| | | deviceTypeList.Add(SPK.SensorUtrasonic); |
| | | deviceTypeList.Add(SPK.SenesorMegahealth); |
| | | deviceTypeList.Add(SPK.SenesorMegahealth2); |
| | | deviceTypeList.Add(SPK.SensorEnvironment); |
| | | deviceTypeList.Add(SPK.SensorEnvironment2); |
| | | deviceTypeList.Add(SPK.SensorEnvironment3); |
| | |
| | | deviceTypeList.Add(SPK.CurtainSwitch); |
| | | deviceTypeList.Add(SPK.CurtainRoller); |
| | | deviceTypeList.Add(SPK.CurtainTrietex); |
| | | deviceTypeList.Add(SPK.AcStandard); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); |
| | | deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAirFresh); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); deviceTypeList.Add(SPK.HvacFloorHeat); |
| | | deviceTypeList.Add(SPK.AirFreshStandard); |
| | | } |
| | | break; |
| | |
| | | #endregion |
| | | } |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: |
| | | { |
| | | #region 界面 |
| | | ///开关 |
| | |
| | | } |
| | | break; |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | { |
| | | #region 界面 |
| | | ///开关 |
| | |
| | | break; |
| | | } |
| | | case SPK.AcStandard: |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: |
| | | { |
| | | //做了一个特殊处理; |
| | | bool _bool = false; |
| | |
| | | /// </summary> |
| | | public Action<Function> AddDeviceEvent = null; |
| | | |
| | | public IntegratedBrandDevice device; |
| | | #endregion |
| | | |
| | | #region ■ 初始化_____________________________ |
| | |
| | | /// </summary> |
| | | public void ShowForm(IntegratedBrandDevice device) |
| | | { |
| | | this.device = device; |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | //设置头部信息 |
| | |
| | | try |
| | | { |
| | | var pm = new HttpServerRequest(); |
| | | var pack = pm.IndependentRegister3TyDevcie(SPK.SenesorMegahealth, snCode,Language.StringByID(StringId.SenesorMillimeterWave)); |
| | | var pack = pm.IndependentRegister3TyDevcie(device.spk, snCode,Language.StringByID(StringId.SenesorMillimeterWave)); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | //var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrandDevice>>(pack.Data.ToString()); |
| | |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | UnSelectedImagePath = $"FunctionIcon/Icon/{device.spk.Replace(".","")}.png", |
| | | UnSelectedImagePath = $"FunctionIcon/Icon/{device.IconName}.png", |
| | | }; |
| | | row.AddChidren(btnIcon); |
| | | Button btnRight = new Button() |
| | |
| | | }; |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | var form1 = new AddSenesorMegahealthDirection1Page(); |
| | | form1.AddForm(device); |
| | | form1.AddDeviceEvent = (functionObj) => { |
| | |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | UnSelectedImagePath = $"FunctionIcon/Icon/{device.spk.Replace(".", "")}.png", |
| | | UnSelectedImagePath = $"FunctionIcon/Icon/{device.IconName}.png", |
| | | }; |
| | | row.AddChidren(btnIcon); |
| | | Button btnRight = new Button() |
| | |
| | | }); |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | var smPage = new SenesorMegahealthManagerPage(); |
| | | smPage.AddForm(device); |
| | | smPage.DelDeviceEvent = () => |
| | |
| | | { |
| | | LoadPictureOptionView(); |
| | | }; |
| | | |
| | | //抹掉数据 |
| | | btnEraseData = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(481), |
| | |
| | | }; |
| | | if(Language.CurrentLanguage =="Chinese") |
| | | { |
| | | btnExit.Text = "退出体验模式"; |
| | | btnExit.Text = "退出"; |
| | | } |
| | | else |
| | | { |
| | | btnExit.Text = "Exit dome"; |
| | | btnExit.Text = "Exit"; |
| | | } |
| | | btnExit.MouseUpEventHandler = (sender, e) => |
| | | { |
| | |
| | | //banbenshengjiFL.frameLayout.Y = editNameFLayout.frameLayout.Bottom; |
| | | //viewLayout.AddChidren(banbenshengjiFL.FLayoutView()); |
| | | |
| | | var versions = Pir.currPir.versions.Find((c)=>c.module== "fw_version"); |
| | | |
| | | var versions = Pir.currPir.versions.Find((c) => c.module == "FW"); |
| | | if (versions == null) |
| | | { |
| | | versions = new Entity.VersionInfo(); |
| | |
| | | ///版本号:v1.3.5 |
| | | FrameLayout50 banbenhaoFLayout = new FrameLayout50(); |
| | | banbenhaoFLayout.btnNextIcon.Visible = false; |
| | | banbenhaoFLayout.btnText.Text = Language.StringByID(StringId.banbenhao) + ":"+ versions.version; |
| | | banbenhaoFLayout.btnText.Text = Language.StringByID(StringId.banbenhao) + ":";// + versions.version; |
| | | banbenhaoFLayout.btnEditText.Text = versions.version; |
| | | banbenhaoFLayout.btnEditText.TextAlignment = TextAlignment.CenterRight; |
| | | banbenhaoFLayout.btnEditText.X = Application.GetRealWidth(357 - 200 - 16); |
| | | banbenhaoFLayout.btnEditText.Width = Application.GetRealWidth(200); |
| | | banbenhaoFLayout.btnText.Width = Application.GetRealWidth(280); |
| | | banbenhaoFLayout.frameLayout.Y = editNameFLayout.frameLayout.Bottom;// banbenshengjiFL.frameLayout.Bottom; |
| | | viewLayout.AddChidren(banbenhaoFLayout.FLayoutView()); |
| | | |
| | | //删除 |
| | | FrameLayout frameLayout = new FrameLayout |
| | | { |
| | |
| | | { |
| | | btnTemp.Text = Convert.ToDouble( device.GetAttrState(FunctionAttributeKey.SetTemp)).ToString(); |
| | | btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C"; |
| | | btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); |
| | | btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing)); |
| | | btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed)); |
| | | btnMode.SelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); |
| | | btnSwing.SelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing)); |
| | | btnWindSpeed.SelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed)); |
| | | btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode),false); |
| | | btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing),false); |
| | | btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed),false); |
| | | arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp))); |
| | | if (device.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | btnMode.IsSelected = btnSwing.IsSelected = btnWindSpeed.IsSelected = true; |
| | | arcBar.IsOffline = false; |
| | | btnSwitch.IsSelected = true; |
| | | arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; |
| | |
| | | } |
| | | else |
| | | { |
| | | btnMode.IsSelected = btnSwing.IsSelected = btnWindSpeed.IsSelected = false; |
| | | arcBar.IsOffline = true; |
| | | btnSwitch.IsSelected = false; |
| | | arcBar.IsClickable = false; |
| | |
| | | UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)) |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnMode); |
| | | |
| | | btnMode.MouseUpEventHandler = (sender, e) => |
| | | if (device.GetAttribute(FunctionAttributeKey.Mode).value.Count > 1) |
| | | { |
| | | LoadDiv_ChangeModeView(); |
| | | }; |
| | | btnMode.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadDiv_ChangeModeView(); |
| | | }; |
| | | } |
| | | } |
| | | |
| | | btnSwitch = new Button() |
| | |
| | | //读取状态 |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (device.spk == SPK.SenesorMegahealth) |
| | | if (device.spk == SPK.SenesorMegahealth|| device.spk == SPK.SenesorMegahealth2) |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(device, true); |
| | | } |
| | |
| | | //读取状态 |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (device.spk == SPK.SenesorMegahealth) |
| | | if (device.spk == SPK.SenesorMegahealth|| device.spk == SPK.SenesorMegahealth2) |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(device, true); |
| | | } |
| | |
| | | /// 窗帘动态控件 |
| | | /// </summary> |
| | | CurtainSeekBarOn curtainSeekBar; |
| | | /// <summary> |
| | | /// 进度值 |
| | | /// </summary> |
| | | Button btnProgress; |
| | | |
| | | |
| | | ///// <summary> |
| | | ///// 窗帘进度减少按钮 |
| | | ///// </summary> |
| | |
| | | // controlView.AddChidren(btnCollection); |
| | | //} |
| | | |
| | | |
| | | btnProgress = new Button() { |
| | | Y = Application.GetRealHeight(80), |
| | | Height = Application.GetRealHeight(50), |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = curtainTemp.GetPercent(function).ToString() + "%", |
| | | }; |
| | | controlView.AddChidren(btnProgress); |
| | | |
| | | |
| | | curtainSeekBar = new CurtainSeekBarOn() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | //运行方向 打开(加进度):关闭(减进度) |
| | | bool runningDirection = progress > curtainSeekBar.Progress; |
| | | int curBarProgress = curtainSeekBar.Progress; |
| | | btnProgress.Text = progress + "%"; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | //}; |
| | | |
| | | //curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | //{ |
| | | curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | // controlBar.Progress = curtainSeekBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | }; |
| | | curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | //controlBar.Progress = curtainSeekBar.Progress; |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | /// 窗帘动态控件 |
| | | /// </summary> |
| | | CurtainRollSeekBarOn curtainSeekBar; |
| | | /// <summary> |
| | | /// 窗帘进度减少按钮 |
| | | /// </summary> |
| | | Button btnMinusSignIcon; |
| | | /// <summary> |
| | | /// 窗帘进度增加按钮 |
| | | /// </summary> |
| | | Button btnPlusSgnIcon; |
| | | /// <summary> |
| | | /// 窗帘滑动控制 |
| | | /// </summary> |
| | | DiyImageSeekBar controlBar; |
| | | ///// <summary> |
| | | ///// 窗帘进度减少按钮 |
| | | ///// </summary> |
| | | //Button btnMinusSignIcon; |
| | | ///// <summary> |
| | | ///// 窗帘进度增加按钮 |
| | | ///// </summary> |
| | | //Button btnPlusSgnIcon; |
| | | ///// <summary> |
| | | ///// 窗帘滑动控制 |
| | | ///// </summary> |
| | | //DiyImageSeekBar controlBar; |
| | | /// <summary> |
| | | /// 窗帘关闭按钮 |
| | | /// </summary> |
| | |
| | | /// 窗帘打开按钮 |
| | | /// </summary> |
| | | Button btnCurtainOpen; |
| | | /// <summary> |
| | | /// 进度值 |
| | | /// </summary> |
| | | Button btnProgress; |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | |
| | | // controlView.AddChidren(btnCollection); |
| | | //} |
| | | |
| | | |
| | | btnProgress = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(80), |
| | | Height = Application.GetRealHeight(50), |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = curtainTemp.GetPercent(function).ToString() + "%", |
| | | }; |
| | | controlView.AddChidren(btnProgress); |
| | | |
| | | curtainSeekBar = new CurtainRollSeekBarOn() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | }; |
| | | controlView.AddChidren(curtainSeekBar); |
| | | |
| | | btnMinusSignIcon = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(406), |
| | | Width = Application.GetRealWidth(52), |
| | | Height = Application.GetMinRealAverage(24), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextID = StringId.PullOpen, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Visible = false, |
| | | Enable = false, |
| | | }; |
| | | controlView.AddChidren(btnMinusSignIcon); |
| | | //btnMinusSignIcon = new Button() |
| | | //{ |
| | | // Y = Application.GetRealHeight(406), |
| | | // Width = Application.GetRealWidth(52), |
| | | // Height = Application.GetMinRealAverage(24), |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // TextID = StringId.PullOpen, |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // Visible = false, |
| | | // Enable = false, |
| | | //}; |
| | | //controlView.AddChidren(btnMinusSignIcon); |
| | | |
| | | controlBar = new DiyImageSeekBar() |
| | | { |
| | | X = btnMinusSignIcon.Right, |
| | | Y = Application.GetRealHeight(391),//414,设计数据 |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealHeight(54), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImagePath = "Public/ThumbImage.png", |
| | | ThumbImageHeight = Application.GetRealHeight(54), |
| | | ProgressBarColor = CSS_Color.MainColor, |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = 0x00000000, |
| | | MaxValue = 100, |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | Progress = curtainTemp.GetPercent(function), |
| | | Visible = false, |
| | | Enable = false, |
| | | }; |
| | | controlView.AddChidren(controlBar); |
| | | //controlBar = new DiyImageSeekBar() |
| | | //{ |
| | | // X = btnMinusSignIcon.Right, |
| | | // Y = Application.GetRealHeight(391),//414,设计数据 |
| | | // Width = Application.GetRealWidth(220), |
| | | // Height = Application.GetRealHeight(54), |
| | | // SeekBarViewHeight = Application.GetRealHeight(8), |
| | | // ThumbImagePath = "Public/ThumbImage.png", |
| | | // ThumbImageHeight = Application.GetRealHeight(54), |
| | | // ProgressBarColor = CSS_Color.MainColor, |
| | | // ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | // ProgressTextSize = 0x00000000, |
| | | // MaxValue = 100, |
| | | // SeekBarPadding = Application.GetRealWidth(20), |
| | | // Progress = curtainTemp.GetPercent(function), |
| | | // Visible = false, |
| | | // Enable = false, |
| | | //}; |
| | | //controlView.AddChidren(controlBar); |
| | | |
| | | btnPlusSgnIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(286), |
| | | Y = Application.GetRealHeight(406), |
| | | Width = Application.GetRealWidth(62), |
| | | Height = Application.GetRealWidth(24), |
| | | TextID = StringId.Shut, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Visible = false, |
| | | Enable = false, |
| | | }; |
| | | controlView.AddChidren(btnPlusSgnIcon); |
| | | //btnPlusSgnIcon = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(286), |
| | | // Y = Application.GetRealHeight(406), |
| | | // Width = Application.GetRealWidth(62), |
| | | // Height = Application.GetRealWidth(24), |
| | | // TextID = StringId.Shut, |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // Visible = false, |
| | | // Enable = false, |
| | | //}; |
| | | //controlView.AddChidren(btnPlusSgnIcon); |
| | | |
| | | btnCurtainClose = new Button() |
| | | { |
| | |
| | | //运行方向 打开(加进度):关闭(减进度) |
| | | bool runningDirection = progress > curtainSeekBar.Progress; |
| | | int curBarProgress = curtainSeekBar.Progress; |
| | | btnProgress.Text = progress + "%"; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | |
| | | CurtainAnimation(100); |
| | | }; |
| | | |
| | | btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | controlBar.Progress -= 1; |
| | | function.SetAttrState(FunctionAttributeKey.Percent, controlBar.Progress); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Percent, controlBar.Progress.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | }; |
| | | //btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // controlBar.Progress -= 1; |
| | | // function.SetAttrState(FunctionAttributeKey.Percent, controlBar.Progress); |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.Percent, controlBar.Progress.ToString()); |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | //}; |
| | | |
| | | btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | controlBar.Progress += 1; |
| | | function.SetAttrState(FunctionAttributeKey.Percent, controlBar.Progress); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Percent, controlBar.Progress.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | }; |
| | | //btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // controlBar.Progress += 1; |
| | | // function.SetAttrState(FunctionAttributeKey.Percent, controlBar.Progress); |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.Percent, controlBar.Progress.ToString()); |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | //}; |
| | | |
| | | |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | |
| | | //}; |
| | | curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | controlBar.Progress = curtainSeekBar.Progress; |
| | | //controlBar.Progress = curtainSeekBar.Progress; |
| | | btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.Percent, e); |
| | |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | //controlBar.OnProgressChangedEvent = (sender, e) => |
| | | curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300) |
| | | // { |
| | | // function.percent = e; |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", function.percent.ToString()); |
| | | // Control.SendWriteCommand(function, d); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | //controlBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | //{ |
| | | // curtainSeekBar.Progress = controlBar.Progress; |
| | | // btnProgress.Text = curtainSeekBar.Progress + "%"; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300) |
| | | // { |
| | | // function.percent = e; |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", function.percent.ToString()); |
| | | // Control.SendWriteCommand(function, d); |
| | | // } |
| | | // function.SetAttrState(FunctionAttributeKey.Percent, e); |
| | | // function.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", e.ToString()); |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | |
| | | controlBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | curtainSeekBar.Progress = controlBar.Progress; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.Percent, e); |
| | | function.refreshTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", e.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | } |
| | | } |
| | |
| | | /// 开关按钮 |
| | | /// </summary> |
| | | Button btnSwitch; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 运行状态-动态加载 |
| | | /// </summary> |
| | | Button btnRunStatus; |
| | | |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | |
| | | btnFromFloor_Out = btnFromFloorOut; |
| | | } |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), function); |
| | | |
| | | controlView = new FrameLayout() |
| | | { |
| | |
| | | }; |
| | | controlView.AddChidren(btnSwitchIcon); |
| | | |
| | | //运行状态 |
| | | if(function.GetAttribute("run_status")!= null) |
| | | { |
| | | |
| | | btnRunStatus = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(300), |
| | | Height = Application.GetRealHeight(58), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | controlView.AddChidren(btnRunStatus); |
| | | UpdataRunStatus(); |
| | | } |
| | | |
| | | if (function.GetAttribute("power")!= null) |
| | | { |
| | | Button btnEnergyIcon = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(377), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/AirSwitch/EnergyIcon.png" |
| | | }; |
| | | controlView.AddChidren(btnEnergyIcon); |
| | | |
| | | |
| | | Button btnEnergyText = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(400), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealWidth(47), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.EnergyMonitoring, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | controlView.AddChidren(btnEnergyText); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | var skipView = new EnergyMainPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnEnergyIcon.MouseUpEventHandler = eventHandler; |
| | | btnEnergyText.MouseUpEventHandler = eventHandler; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | btnSwitch = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | }; |
| | | controlView.AddChidren(btnSwitch); |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Electric)).LoadTopView_FunctionTop(function, actionRefresh); |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Electric)).LoadTopView_FunctionTop(function, actionRefresh,false); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(function); |
| | |
| | | { |
| | | bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on"; |
| | | } |
| | | if(updataTemp.GetAttribute("run_status")!=null) |
| | | { |
| | | bodyView.UpdataRunStatus(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | }); |
| | | } |
| | | /// <summary> |
| | | /// 更新运行状态 |
| | | /// </summary> |
| | | void UpdataRunStatus() |
| | | { |
| | | if (btnRunStatus == null) |
| | | return; |
| | | var runStatus = function.GetAttrState("run_status"); |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | switch (runStatus) |
| | | { |
| | | //* RUN:正常工作中 |
| | | case "RUN": |
| | | btnRunStatus.Text = "工作中"; |
| | | btnRunStatus.TextColor = CSS_Color.MainColor; |
| | | break; |
| | | //* HV:过压预警 |
| | | case "HV": |
| | | btnRunStatus.Text = "过压预警"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* LV:欠压预警 |
| | | case "LV": |
| | | btnRunStatus.Text = "欠压预警"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* HC:过流预警 |
| | | case "HC": |
| | | btnRunStatus.Text = "过流预警"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* HT:过温预警 |
| | | case "HT": |
| | | btnRunStatus.Text = "过温预警"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* LEAK:漏电预警 |
| | | case "LEAK": |
| | | btnRunStatus.Text = "漏电预警"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* ERR_HV:过压报警 |
| | | case "ERR_HV": |
| | | btnRunStatus.Text = "过压报警"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_LV:欠压报警 |
| | | case "ERR_LV": |
| | | btnRunStatus.Text = "欠压报警"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_HC:过流报警 |
| | | case "ERR_HC": |
| | | btnRunStatus.Text = "过流报警"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_HT:过温报警 |
| | | case "ERR_HT": |
| | | btnRunStatus.Text = "过温报警"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_LEAK:漏电报警 |
| | | case "ERR_LEAK": |
| | | btnRunStatus.Text = "漏电报警"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | switch (runStatus) |
| | | { |
| | | //* RUN:正常工作中 |
| | | case "RUN": |
| | | btnRunStatus.Text = "At work"; |
| | | btnRunStatus.TextColor = CSS_Color.MainColor; |
| | | break; |
| | | //* HV:过压预警 |
| | | case "HV": |
| | | btnRunStatus.Text = "Overvoltage warning"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* LV:欠压预警 |
| | | case "LV": |
| | | btnRunStatus.Text = "Undervoltage warning"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* HC:过流预警 |
| | | case "HC": |
| | | btnRunStatus.Text = "Overcurrent warning"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* HT:过温预警 |
| | | case "HT": |
| | | btnRunStatus.Text = "Overtemperature warning"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* LEAK:漏电预警 |
| | | case "LEAK": |
| | | btnRunStatus.Text = "Leakage warning"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* ERR_HV:过压报警 |
| | | case "ERR_HV": |
| | | btnRunStatus.Text = "Overvoltage alarm"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_LV:欠压报警 |
| | | case "ERR_LV": |
| | | btnRunStatus.Text = "Undervoltage alarm"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_HC:过流报警 |
| | | case "ERR_HC": |
| | | btnRunStatus.Text = "Overcurrent alarm"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_HT:过温报警 |
| | | case "ERR_HT": |
| | | btnRunStatus.Text = "Overtemperature alarm"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_LEAK:漏电报警 |
| | | case "ERR_LEAK": |
| | | btnRunStatus.Text = "Leakage alarm"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载事件列表 |
| | | /// </summary> |
| | | void LoadEventList() |
| | |
| | | public EnergyMainPage() |
| | | { |
| | | bodyView = this; |
| | | energyList = FunctionList.List.GetEnergyList(); |
| | | energyList = FunctionList.List.GetEnergyList(); |
| | | var breaker = FunctionList.List.Functions.FindAll((obj) => obj.spk == SPK.AirSwitch); |
| | | var energyBreker = breaker.FindAll((obj) => obj.GetAttribute("power") != null); |
| | | energyList.AddRange(energyBreker); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | grid = new EchartGrid |
| | | { |
| | | left = "5%", |
| | | right = "5%", |
| | | right = "8%", |
| | | bottom = "5%", |
| | | top = "5%", |
| | | containLabel = true |
| | |
| | | }, |
| | | grid: { |
| | | top: '10%', |
| | | left: '10%', |
| | | left: '13%', |
| | | right: '10%', |
| | | bottom: '15%', |
| | | }, |
| | |
| | | deviceId = sensor.deviceId, |
| | | roomIds = sensor.roomIds, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state, curValue = seTemp.curValue } |
| | | ,new FunctionAttributes { key = "spk"} } |
| | | , new FunctionAttributes {key = "spk",state = seTemp.key,curValue = seTemp.key } |
| | | //,new FunctionAttributes { key = "spk"} |
| | | } |
| | | }; |
| | | switch (seTemp.key) |
| | | { |
| | |
| | | |
| | | var sensorType = sr.spk.Split(".")[1]; |
| | | var queryType = sr.GetAttrState("spk").ToString(); |
| | | if(queryType == "0") |
| | | { |
| | | queryType = "value"; |
| | | } |
| | | |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId, queryType); |
| | | if (revertObj != null) |
| | |
| | | var outinTemp = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp))); |
| | | bodyView.btnTemp.Text = outinTemp.ToString(); |
| | | bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C"; |
| | | bodyView.btnMode.UnSelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode)); |
| | | bodyView.btnMode.SelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode)); |
| | | bodyView.btnMode.UnSelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode),false); |
| | | bodyView.arcBar.Progress = outinTemp; |
| | | //if (updateTemp.trait_on_off.curValue.ToString() == "on") |
| | | //{ |
| | |
| | | |
| | | if (updateTemp.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | bodyView.btnMode.IsSelected = true; |
| | | bodyView.arcBar.IsOffline = false; |
| | | bodyView.btnSwitch.IsSelected = true; |
| | | bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; |
| | |
| | | } |
| | | else |
| | | { |
| | | bodyView.btnMode.IsSelected = false; |
| | | bodyView.arcBar.IsOffline = true; |
| | | bodyView.btnSwitch.IsSelected = false; |
| | | bodyView.arcBar.IsClickable = false; |
| | |
| | | { |
| | | btnLocationInfoRight.MouseUpEventHandler = eventHandler; |
| | | } |
| | | btnLocationValues.MouseUpEventHandler = eventHandler; |
| | | if (btnLocationValues != null) |
| | | { |
| | | btnLocationValues.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <summary>
|
| | | /// 色温的滑动控件
|
| | | /// </summary>
|
| | | SeekBarControl barColorTemplatrue;
|
| | | CCTSeekBarControl barColorTemplatrue;
|
| | | /// <summary>
|
| | | /// 开关按钮
|
| | | /// </summary>
|
| | |
| | | btnColorTemplatrueBack.UnSelectedImagePath = "FunctionIcon/Light/ColorTemperatureBar.png";
|
| | | controlView.AddChidren(btnColorTemplatrueBack);
|
| | | //滑动条控件
|
| | | barColorTemplatrue = new SeekBarControl();
|
| | | barColorTemplatrue = new CCTSeekBarControl();
|
| | | barColorTemplatrue.X = btnTempClolorMin.Right;
|
| | | barColorTemplatrue.Y = Application.GetRealHeight(340);
|
| | | barColorTemplatrue.MinValue = 27;
|
| | |
| | | btnReadIcon.IsSelected = true; |
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 左右滑动的进度条控件
|
| | | /// </summary>
|
| | | private class SeekBarControl : DiyImageSeekBar
|
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 左右滑动的进度条控件
|
| | | /// </summary>
|
| | | public class CCTSeekBarControl : DiyImageSeekBar
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | |
| | | /// 左右滑动的进度条控件
|
| | | /// </summary>
|
| | | /// <param name="i_width">宽度,非真实值</param>
|
| | | public SeekBarControl(int i_width = 210)
|
| | | public CCTSeekBarControl(int i_width = 210)
|
| | | {
|
| | | this.Width = Application.GetRealWidth(i_width);
|
| | | this.Height = Application.GetRealHeight(54);
|
| | |
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | static VerticalScrolViewLayout functionListView; |
| | | #endregion |
| | | |
| | | List<Function> functionList; |
| | | |
| | | public AddLightScene() |
| | | List<Function> sceneLishtList; |
| | | Scene lightScene; |
| | | public AddLightScene(List<Function> functions,Scene scene) |
| | | { |
| | | bodyView = this; |
| | | functionList = new List<Function>(); |
| | | sceneLishtList = functions; |
| | | lightScene = scene; |
| | | } |
| | | |
| | | public void LoadPage(int titleId) |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView(); |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView(); |
| | | |
| | | /// <summary> |
| | | /// 房间内容显示区域 |
| | |
| | | }; |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | functionList.AddRange(FunctionList.List.GetLightList()); |
| | | var lightList = FunctionList.List.GetLightList(); |
| | | |
| | | foreach (var function in lightList) |
| | | { |
| | | var functionDiv = new LightRow(function) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(62), |
| | | Radius = (uint)Application.GetMinRealAverage(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 1, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Tag = function.spk + function.sid |
| | | }; |
| | | functionDiv.LoadDiv(sceneLishtList); |
| | | functionListView.AddChidren(functionDiv); |
| | | |
| | | functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); |
| | | } |
| | | |
| | | |
| | | #region 底部view |
| | | var bottomView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(591), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | this.AddChidren(bottomView); |
| | | |
| | | var btnConfrim = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(12), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealHeight(44), |
| | | Radius = (uint)Application.GetRealHeight(22), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Confirm, |
| | | }; |
| | | bottomView.AddChidren(btnConfrim); |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => { |
| | | var lightSceneDialog = new LightSceneEditDialog(sceneLishtList,lightScene); |
| | | lightSceneDialog.ShowDialog(); |
| | | }; |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public class LightRow : FrameLayout |
| | | { |
| | | #region 区域控件 |
| | | static FrameLayout bodyDiv; |
| | | /// <summary> |
| | | /// 功能/场景icon |
| | | /// </summary> |
| | | Button btnIcon; |
| | | /// <summary> |
| | | /// 功能名称/场景名称 |
| | | /// </summary> |
| | | Button btnName; |
| | | /// <summary> |
| | | /// 楼层信息显示按钮 |
| | | /// </summary> |
| | | Button btnFromFloor; |
| | | /// <summary> |
| | | /// 选中按钮 |
| | | /// </summary> |
| | | Button btnSelect; |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | | Function function; |
| | | #endregion |
| | | public LightRow(Function func) |
| | | { |
| | | bodyDiv = this; |
| | | bodyDiv.Tag = func.sid; |
| | | function = func; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载控制卡片区域 |
| | | /// </summary> |
| | | public void LoadDiv(List<Function> functions) |
| | | { |
| | | btnIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(15), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png" |
| | | }; |
| | | bodyDiv.AddChidren(btnIcon); |
| | | |
| | | btnName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 10 + 32), |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(24), |
| | | Text = function.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | bodyDiv.AddChidren(btnName); |
| | | |
| | | btnFromFloor = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 10 + 32), |
| | | Y = Application.GetRealHeight(10 + 24), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(18), |
| | | Text = function.GetRoomListName(), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | bodyDiv.AddChidren(btnFromFloor); |
| | | |
| | | btnSelect = new Button() |
| | | { |
| | | X = Application.GetRealWidth(303), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Light/LightScene/CheckIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Light/LightScene/CheckOnIcon.png", |
| | | IsSelected = functions.Find((obj) => obj.deviceId == function.deviceId) != null |
| | | }; |
| | | bodyDiv.AddChidren(btnSelect); |
| | | |
| | | btnSelect.MouseUpEventHandler = (sender, e) => { |
| | | btnSelect.IsSelected = !btnSelect.IsSelected; |
| | | if(btnSelect.IsSelected) |
| | | { |
| | | var addTemp = functions.Find((obj) => obj.deviceId == function.deviceId); |
| | | if (addTemp == null) |
| | | { |
| | | functions.Add(function); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var removeTemp = functions.Find((obj) => obj.deviceId == function.deviceId); |
| | | if (removeTemp != null) |
| | | { |
| | | functions.Remove(removeTemp); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 灯光场景编辑弹窗 |
| | | /// </summary> |
| | | public class LightSceneEditDialog :Dialog |
| | | { |
| | | List<Function> lights; |
| | | |
| | | Scene editScene; |
| | | |
| | | public LightSceneEditDialog(List<Function> functions,Scene scene) |
| | | { |
| | | lights = functions; |
| | | editScene = scene; |
| | | } |
| | | |
| | | |
| | | public void ShowDialog() |
| | | { |
| | | var hadDimming = lights.Find((obj) => obj.spk == SPK.LightDimming) != null; |
| | | var hadCCT = lights.Find((obj) => obj.spk == SPK.LightCCT) != null; |
| | | var hadRGB = lights.Find((obj) => obj.spk == SPK.LightRGB) != null; |
| | | |
| | | var bodyView = new FrameLayout(); |
| | | this.AddChidren(bodyView); |
| | | bodyView.MouseUpEventHandler = (sender, e) => { |
| | | this.Close(); |
| | | }; |
| | | |
| | | var contentView = new FrameLayout() { |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Width = Application.GetRealWidth(343), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | #region 标题区 |
| | | bool inEdit = false;//是否在编辑标题 |
| | | var titleView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(52), |
| | | }; |
| | | contentView.AddChidren(titleView); |
| | | |
| | | var btnTitle = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(52), |
| | | Gravity = Gravity.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextID = StringId.CombinedDimming, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | if (btnTitle.GetTextWidth() > Application.GetRealWidth(197))//247 |
| | | { |
| | | btnTitle.Width = Application.GetRealWidth(197); |
| | | btnTitle.IsMoreLines = true; |
| | | } |
| | | else |
| | | { |
| | | btnTitle.Width = btnTitle.GetTextWidth()+ Application.GetRealWidth(10); |
| | | btnTitle.IsMoreLines = false; |
| | | } |
| | | titleView.AddChidren(btnTitle); |
| | | |
| | | var btnEditIcon = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | X = Application.GetRealWidth(12) + btnTitle.Right, |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "Public/Edit.png", |
| | | SelectedImagePath = "Public/HookIcon.png" |
| | | }; |
| | | titleView.AddChidren(btnEditIcon); |
| | | |
| | | EventHandler<MouseEventArgs> dd = (sender, e) => |
| | | { |
| | | inEdit = !inEdit; |
| | | btnEditIcon.IsSelected = inEdit; |
| | | |
| | | if (inEdit) |
| | | { |
| | | btnTitle.Width = btnTitle.GetTextWidth(); |
| | | } |
| | | else |
| | | { |
| | | if (btnTitle.GetTextWidth() > Application.GetRealWidth(197))//247 |
| | | { |
| | | btnTitle.Width = Application.GetRealWidth(197); |
| | | } |
| | | else |
| | | { |
| | | btnTitle.Width = btnTitle.GetTextWidth(); |
| | | } |
| | | editScene.name = btnTitle.Text.Trim(); |
| | | } |
| | | }; |
| | | btnTitle.MouseUpEventHandler = dd; |
| | | btnEditIcon.MouseUpEventHandler = dd; |
| | | |
| | | titleView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor, Y = Application.GetRealHeight(51) }); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | var dimmingLight = editScene.functions.Find((obj) => obj.localFunction.spk == SPK.LightDimming); |
| | | var cctLight = editScene.functions.Find((obj) => obj.localFunction.spk == SPK.LightCCT); |
| | | var rgbLight = editScene.functions.Find((obj) => obj.localFunction.spk == SPK.LightRGB); |
| | | var brightnessValue = 0; |
| | | var cctValue = 27; |
| | | if (cctLight != null) |
| | | { |
| | | int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness).value, out brightnessValue); |
| | | int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.CCT).value, out cctValue); |
| | | } |
| | | |
| | | |
| | | //属性设置区域 |
| | | var attrView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(52), |
| | | Width = Application.GetRealWidth(343), |
| | | }; |
| | | //属性设置区域高度 |
| | | int attrViewHight = Application.GetRealHeight(27 + 22); |
| | | attrView.AddChidren(new Button() { Height = Application.GetRealHeight(27) }); |
| | | |
| | | if (hadDimming) |
| | | { |
| | | attrViewHight += Application.GetRealHeight(54 + 11); |
| | | var dimmingView = new FrameLayout(); |
| | | attrView.AddChidren(dimmingView); |
| | | |
| | | |
| | | #region 亮度调节 |
| | | var btnBrightnessText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(1), |
| | | Width = Application.GetRealWidth(224), |
| | | Height = Application.GetRealHeight(21), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.Brightness, |
| | | BackgroundColor = 0xFFFF0000 |
| | | }; |
| | | dimmingView.AddChidren(btnBrightnessText); |
| | | |
| | | var btnMinValuesText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = btnBrightnessText.Bottom, |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "0%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | dimmingView.AddChidren(btnMinValuesText); |
| | | |
| | | var dimmerBar = new DiyImageSeekBar() |
| | | { |
| | | X = Application.GetRealWidth(35 + 22), |
| | | Y = Application.GetRealHeight(11), |
| | | Width = Application.GetRealWidth(210), |
| | | Height = Application.GetRealHeight(54), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImagePath = "Public/ThumbImage.png", |
| | | ThumbImageHeight = Application.GetRealHeight(54), |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | ProgressBarColor = CSS_Color.AuxiliaryColor1, |
| | | MaxValue = 100, |
| | | Progress = brightnessValue, |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | }; |
| | | //dimmingView.AddChidren(dimmerBar); |
| | | |
| | | var btnMaxValuesText = new Button() |
| | | { |
| | | X = dimmerBar.Right, |
| | | Y = btnBrightnessText.Bottom, |
| | | Width = Application.GetRealWidth(45), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "100%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | dimmingView.AddChidren(btnMaxValuesText); |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| | | attrView.Height = attrViewHight; |
| | | contentView.AddChidren(attrView); |
| | | contentView.Height = Application.GetRealHeight(52 + 44) + attrViewHight; |
| | | contentView.Gravity = Gravity.Center; |
| | | |
| | | |
| | | |
| | | |
| | | #region bottom View |
| | | var bottomView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(52) + attrViewHight, |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | contentView.AddChidren(bottomView); |
| | | |
| | | var btnSave = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(172), |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextID = StringId.Save, |
| | | }; |
| | | bottomView.AddChidren(btnSave); |
| | | |
| | | var btnComplete = new Button() |
| | | { |
| | | X = Application.GetRealWidth(172), |
| | | Width = Application.GetRealWidth(172), |
| | | Height = Application.GetRealHeight(46), |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.Complete |
| | | }; |
| | | bottomView.AddChidren(btnComplete); |
| | | |
| | | //例:右下圆角 大小为50 |
| | | int mRectCornerID = HDLUtils.RectCornerBottomRight; |
| | | btnComplete.SetCornerWithSameRadius((uint)Application.GetMinRealAverage(12), mRectCornerID); |
| | | |
| | | bottomView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | |
| | | btnSave.MouseUpEventHandler = (sender, e) => { |
| | | this.Close(); |
| | | |
| | | |
| | | }; |
| | | |
| | | btnComplete.MouseUpEventHandler = (sender, e) => { |
| | | this.Close(); |
| | | |
| | | }; |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | this.Show(); |
| | | return; |
| | | //只有调光器 |
| | | if (!hadDimming&&!hadCCT&&!hadRGB) |
| | | { |
| | | contentView.Height = Application.GetRealHeight(520); |
| | | contentView.Width = Application.GetRealWidth(343); |
| | | contentView.Gravity = Gravity.Center; |
| | | contentView.Radius = (uint)Application.GetRealWidth(12); |
| | | contentView.AddChidren(titleView); |
| | | } |
| | | else if (hadCCT && hadRGB)// |
| | | { |
| | | contentView.Height = Application.GetRealHeight(520); |
| | | contentView.Width = Application.GetRealWidth(343); |
| | | contentView.Gravity = Gravity.Center; |
| | | contentView.Radius = (uint)Application.GetRealWidth(12); |
| | | contentView.AddChidren(titleView); |
| | | #region 亮度调节 |
| | | var btnBrightnessText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(82), |
| | | Width = Application.GetRealWidth(224), |
| | | Height = Application.GetRealHeight(21), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.Brightness, |
| | | }; |
| | | contentView.AddChidren(btnBrightnessText); |
| | | |
| | | var btnMinValuesText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = btnBrightnessText.Bottom, |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "0%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | contentView.AddChidren(btnMinValuesText); |
| | | |
| | | var dimmerBar = new DiyImageSeekBar() |
| | | { |
| | | X = Application.GetRealWidth(35 + 22), |
| | | Y = Application.GetRealHeight(312), |
| | | Width = Application.GetRealWidth(210), |
| | | Height = Application.GetRealHeight(54), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImagePath = "Public/ThumbImage.png", |
| | | ThumbImageHeight = Application.GetRealHeight(54), |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | ProgressBarColor = CSS_Color.AuxiliaryColor1 , |
| | | MaxValue = 100, |
| | | Progress = brightnessValue, |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | }; |
| | | contentView.AddChidren(dimmerBar); |
| | | |
| | | var btnMaxValuesText = new Button() |
| | | { |
| | | X = dimmerBar.Right, |
| | | Y = btnBrightnessText.Bottom, |
| | | Width = Application.GetRealWidth(45), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "100%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | contentView.AddChidren(btnMaxValuesText); |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region 色温 |
| | | //色温 |
| | | var btnTempClolor = new Button(); |
| | | btnTempClolor.X = Application.GetRealWidth(35); |
| | | btnTempClolor.Y = Application.GetRealHeight(159); |
| | | btnTempClolor.Width = Application.GetRealWidth(224); |
| | | btnTempClolor.Height = Application.GetRealHeight(21); |
| | | btnTempClolor.TextAlignment = TextAlignment.CenterLeft; |
| | | btnTempClolor.TextColor = CSS_Color.FirstLevelTitleColor; |
| | | btnTempClolor.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; |
| | | btnTempClolor.TextID = StringId.ColorTemperature; |
| | | contentView.AddChidren(btnTempClolor); |
| | | |
| | | //2700K |
| | | var btnTempClolorMin = new Button(); |
| | | btnTempClolorMin.Y = btnTempClolor.Bottom + Application.GetRealHeight(9); |
| | | btnTempClolorMin.Width = Application.GetRealWidth(54); |
| | | btnTempClolorMin.Height = Application.GetRealHeight(21); |
| | | btnTempClolorMin.Text = "2700K"; |
| | | btnTempClolorMin.TextAlignment = TextAlignment.CenterRight; |
| | | btnTempClolorMin.TextColor = CSS_Color.PromptingColor1; |
| | | btnTempClolorMin.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; |
| | | contentView.AddChidren(btnTempClolorMin); |
| | | |
| | | //滑动条的背景图片 |
| | | var btnColorTemplatrueBack = new Button(); |
| | | //需要减掉滑动条的左右间距 |
| | | btnColorTemplatrueBack.Width = Application.GetRealWidth(210 - 20 * 2); |
| | | btnColorTemplatrueBack.Height = Application.GetRealHeight(8); |
| | | btnColorTemplatrueBack.Gravity = Gravity.CenterHorizontal; |
| | | btnColorTemplatrueBack.UnSelectedImagePath = "FunctionIcon/Light/ColorTemperatureBar.png"; |
| | | contentView.AddChidren(btnColorTemplatrueBack); |
| | | //滑动条控件 |
| | | var barColorTemplatrue = new CCTSeekBarControl(); |
| | | barColorTemplatrue.X = btnTempClolorMin.Right; |
| | | barColorTemplatrue.Y = Application.GetRealHeight(340); |
| | | barColorTemplatrue.MinValue = 27; |
| | | barColorTemplatrue.MaxValue = 65; |
| | | barColorTemplatrue.ProgressBarColor = 0x00000000;//全部透明 |
| | | barColorTemplatrue.ProgressBarUnEnableColor = 0x00000000; |
| | | barColorTemplatrue.SeekBarBackgroundColor = 0x00000000; |
| | | contentView.AddChidren(barColorTemplatrue); |
| | | barColorTemplatrue.Y = btnTempClolorMin.Y - (barColorTemplatrue.Height - btnTempClolorMin.Height) / 2; |
| | | //显示上方的Txt |
| | | barColorTemplatrue.ShowCustomTextView(Application.GetRealWidth(50), CSS_FontSize.PromptFontSize_FirstLevel, CSS_Color.FirstLevelTitleColor); |
| | | var cct = 27; |
| | | int.TryParse(cctLight.status.Find((obj)=>obj.key == FunctionAttributeKey.CCT).value, out cct); |
| | | barColorTemplatrue.Progress = cct; |
| | | //设置初始值 |
| | | barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K"); |
| | | |
| | | //变更背景图的Y轴坐标 |
| | | btnColorTemplatrueBack.Y = barColorTemplatrue.Y + (barColorTemplatrue.Height - btnColorTemplatrueBack.Height) / 2; |
| | | |
| | | //6500K |
| | | var btnTempClolorMax = new Button(); |
| | | btnTempClolorMax.Y = btnTempClolorMin.Y; |
| | | btnTempClolorMax.X = barColorTemplatrue.Right; |
| | | btnTempClolorMax.Width = Application.GetRealWidth(54); |
| | | btnTempClolorMax.Height = Application.GetRealHeight(21); |
| | | btnTempClolorMax.Text = "6500K"; |
| | | btnTempClolorMax.TextAlignment = TextAlignment.CenterLeft; |
| | | btnTempClolorMax.TextColor = CSS_Color.PromptingColor1; |
| | | btnTempClolorMax.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; |
| | | contentView.AddChidren(btnTempClolorMax); |
| | | |
| | | #endregion |
| | | |
| | | #region RGB |
| | | |
| | | var btnCurColor = new Button() |
| | | { |
| | | X = Application.GetRealWidth(24), |
| | | Y = Application.GetRealHeight(241), |
| | | Width = Application.GetMinRealAverage(24), |
| | | Height = Application.GetMinRealAverage(24), |
| | | Radius = (uint)Application.GetMinRealAverage(8), |
| | | BorderColor = CSS_Color.PromptingColor2, |
| | | BorderWidth = 1, |
| | | BackgroundColor = (uint)(0xFF000000 + new Light().GetRGBcolor(new Function(),rgbLight.status.Find((obj) => obj.key == FunctionAttributeKey.RGB).value)) |
| | | }; |
| | | contentView.AddChidren(btnCurColor); |
| | | |
| | | //色盘的桌布控件(限制那个白色滑动球使用) |
| | | var framePickerBack = new FrameLayout(); |
| | | framePickerBack.Gravity = Gravity.CenterHorizontal; |
| | | framePickerBack.Y = Application.GetRealHeight(249); |
| | | framePickerBack.Width = Application.GetMinRealAverage(198); |
| | | framePickerBack.Height = Application.GetMinRealAverage(198); |
| | | contentView.AddChidren(framePickerBack); |
| | | |
| | | var colorPicker = new ColorPicker() |
| | | { |
| | | ColorImagePath = "FunctionIcon/Light/ColorWheel.png", |
| | | }; |
| | | framePickerBack.AddChidren(colorPicker); |
| | | #endregion |
| | | } |
| | | else if (hadDimming && !hadCCT && !hadRGB) |
| | | { |
| | | contentView.Height = Application.GetRealHeight(211); |
| | | contentView.Width = Application.GetRealWidth(343); |
| | | contentView.Gravity = Gravity.Center; |
| | | contentView.Radius = (uint)Application.GetRealWidth(12); |
| | | contentView.AddChidren(titleView); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | #if __Android__ |
| | | //开启定位服务 |
| | | Shared.Application.StartGPSLocationService(); |
| | | |
| | | if (DB_ResidenceData.Instance.NeedTip) { |
| | | DB_ResidenceData.Instance.LastTipTime = DateTime.Now; |
| | | if (CN.Jpush.Android.Api.JPushInterface.IsNotificationEnabled(Shared.Application.Activity) != 1) |
| | | { |
| | | Action action = () => |
| | | { |
| | | CN.Jpush.Android.Api.JPushInterface.GoToAppNotificationSettings(Shared.Application.Activity); |
| | | }; |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | new HDL_ON.UI.ConfirmDialog().ShowDialog(StringId.Tip, StringId.Android_MessagePushTip, action); |
| | | }); |
| | | } |
| | | } |
| | | #endif |
| | | |
| | | } |