| | |
| | | ;方悦新风小模块
|
| | | MFA01-ZB.10 = 2310 / 方悦新风小模块 / 方悦新风小模块 / 2300 / 继电器 / 新风模块
|
| | | ;国标3路10A继电器小模块
|
| | | MLR0310-ZB.20= 2311 / 国标3路10A继电器小模块 / 国标3路10A继电器小模块 / 2300 / 继电器 / 开关模块
|
| | | MLR0310-ZB.20= 2301 / 国标3路10A继电器小模块 / 国标3路10A继电器小模块 / 2300 / 继电器 / 开关模块
|
| | | ;欧标2路5A继电器小模块
|
| | | MLR0205-ZB.18= 2312 / 欧标2路5A继电器小模块 / 欧标2路5A继电器小模块 / 2300 / 继电器 / 开关模块
|
| | | ;欧标14路干接点小模块
|
| | | MLDRY14-ZB.18= 2313 / 欧标14路干接点小模块 / 欧标14路干接点小模块 / 2300 / 继电器 / 干接点模块
|
| | | MLR0205-ZB.18= 2315 / 欧标2路5A继电器小模块 / 欧标2路5A继电器小模块 / 2300 / 继电器 / 开关模块
|
| | | ;7路干接点输入输出模块
|
| | | MLDRY7-ZB.18= 2320 / 7路干接点输入输出模块 / 7路干接点输入输出模块 / 2300 / 继电器 / 干接点模块
|
| | |
|
| | | ;***************************************************************
|
| | | ; 调光器设备
|
| | |
| | | 13609=自定义 |
| | | 13610=项目名 |
| | | 13611=请填写项目名称 |
| | | 13612=楼号 |
| | | 13612=楼 |
| | | 13613=1-100之间 |
| | | 13614=单元号 |
| | | 13615=户号 |
| | | 13614=单元 |
| | | 13615=户 |
| | | 13616=层号加房号,例如0201 |
| | | 13617=举例:成都金堂金茂府项目-2栋-3单元-0201户 |
| | | 13618=选择创建方式 |
| | |
| | | <AndroidTlsProvider>btls</AndroidTlsProvider>
|
| | | <AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
|
| | | <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
| | | <AndroidSupportedAbis>armeabi-v7a</AndroidSupportedAbis>
|
| | | <AndroidDexTool>d8</AndroidDexTool>
|
| | | <AotAssemblies>false</AotAssemblies>
|
| | | <EnableLLVM>false</EnableLLVM>
|
| | | <AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
|
| | | <BundleAssemblies>false</BundleAssemblies>
|
| | | <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
| | | </PropertyGroup>
|
| | | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
| | |
| | | <MandroidI18n>cjk</MandroidI18n>
|
| | | <DefineConstants>Android,Release</DefineConstants>
|
| | | <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
| | | <AotAssemblies>false</AotAssemblies>
|
| | | <EnableLLVM>false</EnableLLVM>
|
| | | <AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
|
| | | <BundleAssemblies>false</BundleAssemblies>
|
| | | <AndroidDexTool>d8</AndroidDexTool>
|
| | | <AndroidUseAapt2>false</AndroidUseAapt2>
|
| | | </PropertyGroup>
|
| | |
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Item\TransferOfResidenceIcon.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Gateway\GatewayIcon16.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\SmartSound\Sibici.png" />
|
| | | </ItemGroup>
|
| | | <Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" />
|
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
| | | <Import Project="..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" />
|
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.evoyo.home" android:versionCode="0120092101" android:installLocation="auto" android:versionName="1.1.0120092101"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.evoyo.home" android:versionCode="0120101001" android:installLocation="auto" android:versionName="1.1.0120101001"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" /> |
| | | <permission android:name="com.evoyo.home.permission.JPUSH_MESSAGE" android:protectionLevel="signature" /> |
| | | <uses-permission android:name="android.permission.WAKE_LOCK" /> |
| | |
| | | </receiver> |
| | | <receiver android:name="cn.jpush.android.service.AlarmReceiver" android:exported="false" /> |
| | | <!-- User defined. For test only 用户自定义的广播接收器--> |
| | | |
| | | <!-- Required . Enable it you can get statistics data with channel --> |
| | | <meta-data android:name="JPUSH_CHANNEL" android:value="developer-default" /> |
| | | <meta-data android:name="JPUSH_APPKEY" android:value="07cfd3177490173e7c072f49" /> |
| | |
| | | <MtouchArch>x86_64</MtouchArch> |
| | | <CodesignKey>iPhone Developer</CodesignKey> |
| | | <ConsolePause>true</ConsolePause> |
| | | <MtouchInterpreter> |
| | | </MtouchInterpreter> |
| | | <IpaMetadata> |
| | | </IpaMetadata> |
| | | <MtouchInterpreter></MtouchInterpreter> |
| | | <IpaMetadata></IpaMetadata> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' "> |
| | | <DebugSymbols>true</DebugSymbols> |
| | |
| | | <MtouchI18n>cjk</MtouchI18n> |
| | | <CodesignProvision>ComEvoyoHomeDevelopment20200806</CodesignProvision> |
| | | <MtouchHttpClientHandler>CFNetworkHandler</MtouchHttpClientHandler> |
| | | <OnDemandResourcesInitialInstallTags> |
| | | </OnDemandResourcesInitialInstallTags> |
| | | <OnDemandResourcesInitialInstallTags> |
| | | </OnDemandResourcesInitialInstallTags> |
| | | <OnDemandResourcesPrefetchOrder> |
| | | </OnDemandResourcesPrefetchOrder> |
| | | <OnDemandResourcesInitialInstallTags></OnDemandResourcesInitialInstallTags> |
| | | <OnDemandResourcesInitialInstallTags></OnDemandResourcesInitialInstallTags> |
| | | <OnDemandResourcesPrefetchOrder></OnDemandResourcesPrefetchOrder> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> |
| | | <DebugType>none</DebugType> |
| | |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <Folder Include="Resources\" /> |
| | | <Folder Include="Resources\Phone\RoomIcon\" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <InterfaceDefinition Include="LaunchScreen.storyboard" /> |
| | |
| | | </ProjectReference> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\Contents.json"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1920_1080.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\3840_2160.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1242_2688.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\828_1792.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2688_1242.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1792_828.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1125_2436.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2436_1125.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1242_2208.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\750_1334.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2208_1242.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_2732.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_960.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_1136.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768_1024.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536_2048.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024_768.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_1536.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\320_480.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_960-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_1136-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768_1004.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536_2008.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768_1024-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536_2048-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024_748.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_1496.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024_768-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_1536-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1920_1080-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\3840_2160-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\40_40.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\60_60.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\58_58.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\87_87.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\80_80.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\120_120.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\120_120-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\180_180.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\20_20.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\40_40-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\29_29.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\58_58-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\40_40-2.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\80_80-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\76_76.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\152_152.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\167_167.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\1024_1024.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\120_120-2.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\180_180-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\58_58-2.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\87_87-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\80_80-2.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\1024_1024-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\512_512.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\512_512-1.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\1024_1024-2.png"> |
| | | <Visible>false</Visible> |
| | | </ImageAsset> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\Contents.json" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1920_1080.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\3840_2160.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1242_2688.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\828_1792.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2688_1242.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1792_828.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1125_2436.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2436_1125.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1242_2208.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\750_1334.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2208_1242.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_2732.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_960.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_1136.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768_1024.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536_2048.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024_768.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_1536.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\320_480.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_960-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_1136-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768_1004.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536_2008.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768_1024-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536_2048-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024_748.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_1496.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024_768-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_1536-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1920_1080-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\3840_2160-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\40_40.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\60_60.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\58_58.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\87_87.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\80_80.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\120_120.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\120_120-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\180_180.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\20_20.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\40_40-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\29_29.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\58_58-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\40_40-2.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\80_80-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\76_76.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\152_152.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\167_167.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\1024_1024.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\120_120-2.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\180_180-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\58_58-2.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\87_87-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\80_80-2.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\1024_1024-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\512_512.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\512_512-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\1024_1024-2.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <BundleResource Include="Resources\Language.ini" /> |
| | |
| | | <BundleResource Include="Resources\Phone\Navigation\SettingSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\SmartSound\PullDown.png" /> |
| | | <BundleResource Include="Resources\Phone\SmartSound\Xiaodu.png" /> |
| | | <BundleResource Include="Resources\Phone\SmartSound\Sibici.png" /> |
| | | <BundleResource Include="Resources\Phone\SmartSound\Xiaoai.png" /> |
| | | <BundleResource Include="Resources\Phone\SmartSound\Nickname.png" /> |
| | | <BundleResource Include="Resources\Phone\SmartSound\SoundIcon.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\Floor\SelectFloor_Left_1.png" /> |
| | | <BundleResource Include="Resources\Phone\Floor\SelectFloor_Right_3.png" /> |
| | | <BundleResource Include="Resources\Phone\Floor\Floor.png" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\8.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\9.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\14.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\15.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\17.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\16.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\12.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\13.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\11.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\10.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\21.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\20.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\18.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\19.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\4.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\5.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\7.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\6.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\2.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\3.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\1.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\0.jpg" /> |
| | | <BundleResource Include="Resources\Phone\Account\Logo_WhiteHome.png" /> |
| | | <BundleResource Include="Resources\Phone\Account\Code.png" /> |
| | | <BundleResource Include="Resources\Phone\Account\Cancle.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\Gateway\WirelessApDirection.png" /> |
| | | <BundleResource Include="Resources\Phone\Gateway\GatewayIcon11.png" /> |
| | | <BundleResource Include="Resources\Phone\Gateway\GatewayIcon1.png" /> |
| | | <BundleResource Include="Resources\Phone\Gateway\GatewayIcon16.png" /> |
| | | <BundleResource Include="Resources\Phone\Gateway\WirelessApGatewaySearching.png" /> |
| | | <BundleResource Include="Resources\Phone\Gateway\RealGateway11.png" /> |
| | | <BundleResource Include="Resources\Phone\Gateway\GatewayIcon6.png" /> |
| | | <BundleResource Include="Resources\Phone\Gateway\WiredGateway.png" /> |
| | | <BundleResource Include="Resources\Phone\Gateway\WirelessGateway.png" /> |
| | | <BundleResource Include="Resources\Phone\Gateway\AddGatewaySuccess.png" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\0.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\1.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\2.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\3.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\4.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\5.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\6.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\7.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\8.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\9.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\10.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\11.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\12.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\13.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\14.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\15.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\16.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\17.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\18.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\19.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\20.jpg" /> |
| | | <BundleResource Include="Resources\Phone\RoomIcon\21.jpg" /> |
| | | </ItemGroup> |
| | | <Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" /> |
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> |
| | |
| | | <key>CFBundleURLTypes</key> |
| | | <array> |
| | | <dict> |
| | | <key>CFBundleURLSchemes</key> |
| | | <array> |
| | | <string>evoyoHome</string> |
| | | </array> |
| | | <key>CFBundleTypeRole</key> |
| | | <string>Editor</string> |
| | | </dict> |
| | | <dict> |
| | | <key>CFBundleURLName</key> |
| | | <string>xiaoduapp</string> |
| | | </dict> |
| | | <dict> |
| | | <key>CFBundleURLName</key> |
| | | <string>AispeechMobile</string> |
| | | </dict> |
| | | <dict> |
| | | <key>CFBundleURLName</key> |
| | |
| | | <key>LSApplicationQueriesSchemes</key> |
| | | <array> |
| | | <string>xiaoduapp</string> |
| | | <string>AispeechMobile</string> |
| | | <string>weixin</string> |
| | | <string>weixinULAPI</string> |
| | | </array> |
| | |
| | | ;方悦新风小模块
|
| | | MFA01-ZB.10 = 2310 / 方悦新风小模块 / 方悦新风小模块 / 2300 / 继电器 / 新风模块
|
| | | ;国标3路10A继电器小模块
|
| | | MLR0310-ZB.20= 2311 / 国标3路10A继电器小模块 / 国标3路10A继电器小模块 / 2300 / 继电器 / 开关模块
|
| | | MLR0310-ZB.20= 2301 / 国标3路10A继电器小模块 / 国标3路10A继电器小模块 / 2300 / 继电器 / 开关模块
|
| | | ;欧标2路5A继电器小模块
|
| | | MLR0205-ZB.18= 2312 / 欧标2路5A继电器小模块 / 欧标2路5A继电器小模块 / 2300 / 继电器 / 开关模块
|
| | | ;欧标14路干接点小模块
|
| | | MLDRY14-ZB.18= 2313 / 欧标14路干接点小模块 / 欧标14路干接点小模块 / 2300 / 继电器 / 干接点模块
|
| | | MLR0205-ZB.18= 2315 / 欧标2路5A继电器小模块 / 欧标2路5A继电器小模块 / 2300 / 继电器 / 开关模块
|
| | | ;7路干接点输入输出模块
|
| | | MLDRY7-ZB.18= 2320 / 7路干接点输入输出模块 / 7路干接点输入输出模块 / 2300 / 继电器 / 干接点模块
|
| | |
|
| | | ;***************************************************************
|
| | | ; 调光器设备
|
| | |
| | | 13609=自定义 |
| | | 13610=项目名 |
| | | 13611=请填写项目名称 |
| | | 13612=楼号 |
| | | 13612=楼 |
| | | 13613=1-100之间 |
| | | 13614=单元号 |
| | | 13615=户号 |
| | | 13614=单元 |
| | | 13615=户 |
| | | 13616=层号加房号,例如0201 |
| | | 13617=举例:成都金堂金茂府项目-2栋-3单元-0201户 |
| | | 13618=选择创建方式 |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string CodeIDString = "1.1.0120092301"; |
| | | public static string CodeIDString = "1.1.0120101001"; |
| | | /// <summary> |
| | | /// 注册来源(0:HDL On 1:Zigbee) |
| | | /// </summary> |
| | |
| | | {
|
| | | continue;
|
| | | }
|
| | | var device = this.NewDeviceObjectByDeviceId((DeviceType)itemValue);
|
| | | var device = this.NewDeviceObjectByDeviceId((DeviceType)itemValue, 1);
|
| | | string strMsg = string.Empty;
|
| | | if (device == null)
|
| | | {
|
| | |
| | | /// <para>将指定网关的设备存入缓存中(从新获取镜像)</para>
|
| | | /// <para>-1:异常 1:正常 2:设备信息缺损</para>
|
| | | /// </summary>
|
| | | /// <param name="zbGateway">网关对象</param>
|
| | | /// <param name="gatewayId">网关Id</param>
|
| | | /// <param name="useLocalConnect">是否强制使用本地连接发送</param>
|
| | | public int SetDeviceToMemmoryByGateway(ZbGateway zbGateway, bool useLocalConnect)
|
| | | public int SetDeviceToMemmoryByGateway(string gatewayId, bool useLocalConnect)
|
| | | {
|
| | | //从网关获取全部的设备
|
| | | int statu = 0;
|
| | | List<CommonDevice> listDevice = new List<CommonDevice>();
|
| | | List<CommonDevice> list = this.GetDeviceListFromGateway(zbGateway, ref statu, useLocalConnect);
|
| | | List<CommonDevice> list = this.GetDeviceListFromGateway(gatewayId, ref statu, useLocalConnect);
|
| | | if (list == null)
|
| | | {
|
| | | return -1;
|
| | |
| | | listDevice.AddRange(list);
|
| | |
|
| | | //获取这个网关的本地所有设备
|
| | | string gwID = zbGateway.GwId;
|
| | | List<CommonDevice> listLocalDevices = this.GetDeviceByGatewayID(gwID);
|
| | | List<CommonDevice> listLocalDevices = this.GetDeviceByGatewayID(gatewayId);
|
| | | //获取ota设备
|
| | | foreach (var ota in this.dicOTADevice.Values)
|
| | | {
|
| | | if (ota.CurrentGateWayId == gwID)
|
| | | if (ota.CurrentGateWayId == gatewayId)
|
| | | {
|
| | | listLocalDevices.Add(ota);
|
| | | }
|
| | |
| | | #region ■ 获取设备信息_______________________
|
| | |
|
| | | /// <summary>
|
| | | /// 读取单个端点回路设备信息
|
| | | /// 从网关读取单个端点回路设备信息
|
| | | /// </summary>
|
| | | /// <param name="device">设备对象</param>
|
| | | /// <returns></returns>
|
| | |
| | | }
|
| | | var info = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceInfoData>(result.ReceiptData);
|
| | | return info;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 从网关读取指定Mac下的设备列表(返回的是网关回复的设备Json,调用ConvertJObjectToDevice方法转为Device对象)
|
| | | /// </summary>
|
| | | /// <param name="realGateway">真实网关对象</param>
|
| | | /// <param name="i_deviceMac">设备Mac</param>
|
| | | /// <param name="useLocalConnect">是否使用本地连接发送</param>
|
| | | /// <param name="listFucDevice">需要变更功能类型的回路</param>
|
| | | /// <param name="statu">状态-> -1:异常,会返回null, 1:没有异常, 2:数据接收不全</param>
|
| | | /// <returns></returns>
|
| | | public List<Newtonsoft.Json.Linq.JObject> ReadDeviceListByMacFromGateway(string gatewayId, string i_deviceMac, bool useLocalConnect, ref int statu)
|
| | | {
|
| | | //是否达成中断的时机
|
| | | bool canBreak = false;
|
| | | //超时时间
|
| | | int TimeOut = 0;
|
| | | //设备总数
|
| | | int deviceCount = -1;
|
| | | //接收数
|
| | | int receiveCount = 0;
|
| | | //设备列表
|
| | | var listDeviceJson = new List<Newtonsoft.Json.Linq.JObject>();
|
| | |
|
| | | HdlGatewayReceiveLogic.Current.AddGatewayReceiveEvent(gatewayId, (topic, message) =>
|
| | | {
|
| | | if (topic == gatewayId + "/GetStatusRecord_Respon")
|
| | | {
|
| | | lock (listDeviceJson)
|
| | | {
|
| | | //设备接收数
|
| | | receiveCount++;
|
| | | TimeOut = 0;
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
|
| | | var totalNum = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["TotalNum"].ToString());
|
| | | if (totalNum == 0)
|
| | | {
|
| | | //这个网关没有设备
|
| | | canBreak = true;
|
| | | return;
|
| | | }
|
| | | if (deviceCount == -1)
|
| | | {
|
| | | //设置需要接收多少个设备
|
| | | deviceCount = totalNum;
|
| | | }
|
| | | listDeviceJson.Add(jobject);
|
| | | }
|
| | |
|
| | | if (receiveCount == deviceCount && deviceCount != -1)
|
| | | {
|
| | | //设备全部接收完成
|
| | | canBreak = true;
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "DeviceAddr", i_deviceMac }, { "Epoint", 255 }, { "Cluster_ID", 0 }, { "Command", 80 } };
|
| | | HdlGatewayLogic.Current.SendJobjectData(gatewayId, "GetStatusRecord", jObject.ToString(), useLocalConnect);
|
| | |
|
| | | while (canBreak == false && TimeOut <= 150)
|
| | | {
|
| | | System.Threading.Thread.Sleep(20);
|
| | | TimeOut++;
|
| | | }
|
| | | //移除监听
|
| | | HdlGatewayReceiveLogic.Current.RemoveGatewayReceiveEvent();
|
| | |
|
| | | if (TimeOut > 150)
|
| | | {
|
| | | statu = listDeviceJson.Count == 0 ? -1 : 2;
|
| | | } |
| | | else
|
| | | {
|
| | | statu = 1;
|
| | | }
|
| | | return listDeviceJson;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 将设备的Json转换为设备对象
|
| | | /// </summary>
|
| | | /// <param name="listIObjects">设备Json</param>
|
| | | /// <param name="gwId">网关id</param>
|
| | | /// <param name="listFucDevice">需要变更功能类型的回路</param>
|
| | | /// <returns></returns>
|
| | | public List<CommonDevice> ConvertJObjectToDevice(List<Newtonsoft.Json.Linq.JObject> listIObjects, string gwId, ref List<CommonDevice> listFucDevice)
|
| | | {
|
| | | //设备列表
|
| | | var listDevice = new List<CommonDevice>();
|
| | | //网关里面有可能会有重复的回路
|
| | | var listCheck = new HashSet<string>();
|
| | |
|
| | | foreach (var jobject in listIObjects)
|
| | | {
|
| | | var deviceID = (DeviceType)jobject.Value<int>("Device_ID");
|
| | | //根据设备类型创建设备对象的实例
|
| | | var device = this.NewDeviceObjectByDeviceId(deviceID, jobject, gwId);
|
| | | if (device != null)
|
| | | {
|
| | | string mainkeys = this.GetDeviceMainKeys(device);
|
| | | //网关里面有可能会有重复的回路
|
| | | if (listCheck.Contains(mainkeys) == false)
|
| | | {
|
| | | listDevice.Add(device);
|
| | | listCheck.Add(mainkeys);
|
| | | //刷新一下本地缓存
|
| | | var localDevice = this.GetDevice(mainkeys);
|
| | | var tempDevice = localDevice == null ? device : localDevice;
|
| | |
|
| | | //如果这个设备ID变更了的话
|
| | | bool typeNotEquals = localDevice != null && deviceID != localDevice.Type;
|
| | | if (typeNotEquals == true)
|
| | | {
|
| | | //重新New这个对象
|
| | | typeNotEquals = this.ReNewDeviceOnTypeIsChanged(localDevice, deviceID);
|
| | | //重新再次获取对象
|
| | | tempDevice = this.GetDevice(mainkeys);
|
| | | }
|
| | |
|
| | | //刷新属性
|
| | | this.SetDeviceInfoToMain(tempDevice, device);
|
| | | if (this.RefreshDeviceFunctionType(tempDevice, device, false) == true)
|
| | | {
|
| | | //需要发送功能类型给网关
|
| | | listFucDevice.Add(tempDevice);
|
| | | }
|
| | | if (typeNotEquals == true)
|
| | | {
|
| | | //重新生成缓存
|
| | | tempDevice.ReSave();
|
| | | HdlAutoBackupLogic.AddOrEditorFile(tempDevice.FilePath);
|
| | | //全部主页菜单需要刷新
|
| | | Phone.UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return listDevice;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | #region ■ 获取设备列表的接口_________________
|
| | |
|
| | | /// <summary>
|
| | | /// <para>从网关重新获取设备列表(返回的设备为虚拟出来的)</para>
|
| | | /// <para>从网关重新获取设备列表(返回的设备为虚拟出来的),一次性全部获取</para>
|
| | | /// <para>statu状态 -1:异常,会返回null, 1:没有异常, 2:数据接收不全</para>
|
| | | /// </summary>
|
| | | /// <param name="zbGateway">网关对象</param>
|
| | | /// <param name="gatewayId">网关id</param>
|
| | | /// <param name="statu">状态-> -1:异常,会返回null, 1:没有异常, 2:数据接收不全</param>
|
| | | /// <param name="useLocalConnect">是否使用本地连接发送</param>
|
| | | /// <param name="mode">是否显示错误</param>
|
| | | /// <returns></returns> |
| | | public List<CommonDevice> GetDeviceListFromGateway(ZbGateway zbGateway, ref int statu, bool useLocalConnect, ShowErrorMode mode = ShowErrorMode.YES) |
| | | public List<CommonDevice> GetDeviceListFromGateway(string gatewayId, ref int statu, bool useLocalConnect, ShowErrorMode mode = ShowErrorMode.YES) |
| | | {
|
| | | //如果切换到了别的界面,则不显示错误信息
|
| | | string nowFormId = UserCenterResourse.NowActionFormID;
|
| | |
|
| | | ZbGateway realWay = null;
|
| | | if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, zbGateway) == false)
|
| | | {
|
| | | if (nowFormId == UserCenterResourse.NowActionFormID && mode == ShowErrorMode.YES)
|
| | | {
|
| | | //错误:网关对象丢失
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uErrorGatewayLostMsg);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | statu = -1;
|
| | | return null;
|
| | | }
|
| | | //需要变更功能类型的回路
|
| | | var listFucDevice = new List<CommonDevice>();
|
| | |
|
| | | //是否达成中断的时机
|
| | | bool canBreak = false;
|
| | | //网关ID
|
| | | string gatewayID = zbGateway.GwId;
|
| | | //超时时间
|
| | | int TimeOut = 0;
|
| | | //当前设备接收数
|
| | | int nowReceiveCount = 0;
|
| | | //设备总数
|
| | | int deviceCount = -1;
|
| | | //接收数
|
| | | int receiveCount = 0;
|
| | | //设备列表
|
| | | var listDevice = new List<CommonDevice>();
|
| | | //网关里面有可能会有重复的回路
|
| | | var listCheck = new HashSet<string>();
|
| | | Action<string, string> getDeviceAction = (topic, message) =>
|
| | | ///Mac的端点总数
|
| | | var dicMacPointCount = new Dictionary<string, int>();
|
| | |
|
| | | HdlGatewayReceiveLogic.Current.AddGatewayReceiveEvent(gatewayId, (topic, message) =>
|
| | | {
|
| | | if (topic == gatewayID + "/DeviceInfoRespon")
|
| | | {
|
| | | try
|
| | | if (topic == gatewayId + "/DeviceInfoRespon")
|
| | | {
|
| | | lock (listDevice)
|
| | | {
|
| | | //设备接收数
|
| | | receiveCount++;
|
| | |
|
| | | TimeOut = 0;
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
|
| | | var totalNum = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["TotalNum"].ToString());
|
| | | var totalNum = Convert.ToInt32(jobject["Data"]["TotalNum"].ToString());
|
| | | if (totalNum == 0)
|
| | | {
|
| | | //这个网关没有设备
|
| | |
| | | //设置需要接收多少个设备
|
| | | deviceCount = totalNum;
|
| | | }
|
| | | nowReceiveCount++;
|
| | |
|
| | | //设备回路数收集
|
| | | string deviceMac = jobject.Value<string>("DeviceAddr");
|
| | | if (dicMacPointCount.ContainsKey(deviceMac) == false)
|
| | | {
|
| | | dicMacPointCount[deviceMac] = 0;
|
| | | }
|
| | | dicMacPointCount[deviceMac]++;
|
| | |
|
| | | var deviceID = (DeviceType)jobject.Value<int>("Device_ID");
|
| | | //根据设备类型创建设备对象的实例
|
| | | var device = this.NewDeviceObjectByDeviceId(deviceID, jobject, zbGateway);
|
| | | var device = this.NewDeviceObjectByDeviceId(deviceID, jobject, gatewayId);
|
| | | if (device != null)
|
| | | {
|
| | | string mainkeys = this.GetDeviceMainKeys(device);
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | //Log出力
|
| | | catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
|
| | |
|
| | | if (receiveCount == deviceCount && deviceCount != -1)
|
| | | if (nowReceiveCount >= deviceCount)
|
| | | {
|
| | | //设备全部接收完成
|
| | | canBreak = true;
|
| | | }
|
| | | }
|
| | | else if (topic == gatewayID + "/DeviceInfoResponEnd")
|
| | | {
|
| | | }
|
| | | };
|
| | |
|
| | | realWay.Actions += getDeviceAction;
|
| | | try
|
| | | {
|
| | | });
|
| | | //发送命令
|
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 93 } };
|
| | | if (useLocalConnect == false)
|
| | | {
|
| | | realWay.Send("GetDeviceInfo", jObject.ToString());
|
| | | }
|
| | | else
|
| | | {
|
| | | //强制使用本地连接
|
| | | realWay.SendLocation("GetDeviceInfo", Encoding.UTF8.GetBytes(jObject.ToString()));
|
| | | }
|
| | | }
|
| | | catch { canBreak = true; }
|
| | | HdlGatewayLogic.Current.SendJobjectData(gatewayId, "GetDeviceInfo", jObject.ToString(), useLocalConnect);
|
| | |
|
| | | while (canBreak == false && TimeOut < 60)
|
| | | while (canBreak == false && TimeOut <= 30)
|
| | | {
|
| | | System.Threading.Thread.Sleep(100);
|
| | | TimeOut++;
|
| | | }
|
| | | //移除网关监听事件
|
| | | HdlGatewayReceiveLogic.Current.RemoveGatewayReceiveEvent();
|
| | |
|
| | | realWay.Actions -= getDeviceAction;
|
| | | getDeviceAction = null;
|
| | |
|
| | | if (TimeOut >= 60)
|
| | | if (TimeOut > 30)
|
| | | {
|
| | | if (listDevice.Count == 0)
|
| | | if (listDevice.Count > 0)
|
| | | {
|
| | | if (nowFormId == UserCenterResourse.NowActionFormID && mode == ShowErrorMode.YES)
|
| | | {
|
| | | //获取设备列表失败
|
| | | //[XXXX]网关回复超时,请稍后再试
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGetDeviceListFail);
|
| | | msg += "\r\n[" + HdlGatewayLogic.Current.GetGatewayName(zbGateway).ToString() + "]";
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, null, "回复超时", false);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | statu = -1;
|
| | | return null;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (nowFormId == UserCenterResourse.NowActionFormID && mode == ShowErrorMode.YES)
|
| | | //网络不稳定,设备列表信息缺损,则采用按序号获取设备
|
| | | statu = this.GetDeviceListFromGatewayByMac(gatewayId, ref listDevice, ref listFucDevice, dicMacPointCount, useLocalConnect);
|
| | | if (statu == 2)
|
| | | {
|
| | | //网络不稳定,设备列表信息缺损
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uNetworkUnStableAndDeviceInfoIsNotFull);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | statu = 2;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (mode == ShowErrorMode.YES)
|
| | | {
|
| | | //获取设备列表失败
|
| | | //[XXXX]网关回复超时,请稍后再试
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGetDeviceListFail);
|
| | | var localGw = HdlGatewayLogic.Current.GetLocalGateway(gatewayId);
|
| | | if (localGw != null)
|
| | | {
|
| | | msg += "\r\n[" + HdlGatewayLogic.Current.GetGatewayName(localGw).ToString() + "]";
|
| | | }
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, null, "回复超时", false);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | statu = -1;
|
| | | return null;
|
| | | }
|
| | | } |
| | | else
|
| | |
| | | }
|
| | |
|
| | | return listDevice; |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 根据序号获取设备列表信息(只有在设备缺损的时候才调用这个函数) 1:正常 2:设备缺损
|
| | | /// </summary>
|
| | | /// <param name="gatewayId">网关id</param>
|
| | | /// <param name="listDevice">存储的设备对象集合</param>
|
| | | /// <param name="listFucDevice">需要变更功能类型的回路</param>
|
| | | /// <param name="dicNowPointCount">当前已经获取的Mac的端点总数</param>
|
| | | /// <param name="useLocalConnect">是否使用本地连接发送</param>
|
| | | /// <returns></returns>
|
| | | public int GetDeviceListFromGatewayByMac(string gatewayId, ref List<CommonDevice> listDevice, ref List<CommonDevice> listFucDevice, Dictionary<string, int> dicNowPointCount, bool useLocalConnect)
|
| | | {
|
| | | //首先先获取设备的mac列表
|
| | | var jObject33 = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 87 } };
|
| | | var result = HdlGatewayLogic.Current.SendJobjectDataToGateway(gatewayId, "GetStatusRecord", jObject33.ToString(), "DeviceMACDeviceListRespon", 3, useLocalConnect);
|
| | | if (result.ErrorMsgDiv == -1 || result.ErrorMsgDiv == 0)
|
| | | {
|
| | | //如果网关没有对这个主题做出回应的话,则说明它是一个旧网关
|
| | | return 2;
|
| | | }
|
| | | var resultMac = Newtonsoft.Json.JsonConvert.DeserializeObject<ReceiptMacResult>(result.ReceiptData);
|
| | |
|
| | | //设备列表
|
| | | var listDeviceJson = new List<Newtonsoft.Json.Linq.JObject>();
|
| | |
|
| | | int statu = 0;
|
| | | foreach (var macInfo in resultMac.MACDeviceList)
|
| | | {
|
| | | if (dicNowPointCount.ContainsKey(macInfo.MacAddr) == true
|
| | | && dicNowPointCount[macInfo.MacAddr] == macInfo.EPTotalNum)
|
| | | {
|
| | | //如果这个mac的端点数一致,则说明已经接收齐了,不需要再次接收
|
| | | continue;
|
| | | }
|
| | | //从网关读取指定Mac下的设备列表
|
| | | var jsonData = this.ReadDeviceListByMacFromGateway(gatewayId, macInfo.MacAddr, useLocalConnect, ref statu);
|
| | | foreach (var myData in jsonData)
|
| | | {
|
| | | listDeviceJson.Add(myData);
|
| | | }
|
| | | if (statu != 1)
|
| | | {
|
| | | //没有正常完成,则中断
|
| | | break;
|
| | | }
|
| | | }
|
| | | //转化为设备列表
|
| | | var listTempDevice = this.ConvertJObjectToDevice(listDeviceJson, gatewayId, ref listFucDevice);
|
| | | for (int i = 0; i < listTempDevice.Count; i++)
|
| | | {
|
| | | listDevice.Add(listTempDevice[i]);
|
| | | }
|
| | | return statu == 1 ? 1 : 2;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 接收设备Mac列表的类
|
| | | /// </summary>
|
| | | private class ReceiptMacResult
|
| | | {
|
| | | /// <summary>
|
| | | /// mac总数
|
| | | /// </summary>
|
| | | public int MACDeviceTotalNum = 0;
|
| | | /// <summary>
|
| | | /// 设备mac列表
|
| | | /// </summary>
|
| | | public List<MacResult> MACDeviceList = new List<MacResult>();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 设备Mac的内容
|
| | | /// </summary>
|
| | | private class MacResult
|
| | | {
|
| | | /// <summary>
|
| | | /// 设备Mac
|
| | | /// </summary>
|
| | | public string MacAddr = string.Empty;
|
| | | /// <summary>
|
| | | /// mac端点的总数
|
| | | /// </summary>
|
| | | public int EPTotalNum = 0;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 创建新设备对象相关_________________
|
| | |
| | | /// </summary>
|
| | | /// <param name="deviceType">设备类型</param>
|
| | | /// <param name="jobject">主题Data</param>
|
| | | /// <param name="zbGateway">网关对象</param>
|
| | | /// <param name="gwid">网关id</param>
|
| | | /// <returns></returns>
|
| | | private CommonDevice NewDeviceObjectByDeviceId(DeviceType deviceType, Newtonsoft.Json.Linq.JObject jobject, ZbGateway zbGateway)
|
| | | private CommonDevice NewDeviceObjectByDeviceId(DeviceType deviceType, Newtonsoft.Json.Linq.JObject jobject, string gwid)
|
| | | {
|
| | | string gwId = zbGateway.GwId;
|
| | |
|
| | | //根据设备类型创建设备对象的实例
|
| | | CommonDevice device = this.NewDeviceObjectByDeviceId(deviceType);
|
| | | CommonDevice device = this.NewDeviceObjectByDeviceId(deviceType, jobject.Value<int>("Epoint"));
|
| | | if (device == null)
|
| | | {
|
| | | return null;
|
| | |
| | |
|
| | | //设置设备主键类
|
| | | this.SetNewDeviceMainKeys(device, jobject);
|
| | | device.CurrentGateWayId = gwId;
|
| | | device.CurrentGateWayId = gwid;
|
| | |
|
| | | return device;
|
| | | }
|
| | |
| | | /// 根据设备Type创建对应的设备对象
|
| | | /// </summary>
|
| | | /// <param name="deviceType">设备Type</param>
|
| | | /// <param name="DeviceEpoint">设备端点(没有什么特殊需求的话,填0即可)</param>
|
| | | /// <returns></returns>
|
| | | public CommonDevice NewDeviceObjectByDeviceId(DeviceType deviceType)
|
| | | public CommonDevice NewDeviceObjectByDeviceId(DeviceType deviceType, int DeviceEpoint)
|
| | | {
|
| | | //根据设备类型创建设备对象的实例
|
| | | var device = CommonDevice.CommonDeviceByByteString((int)deviceType, "{\"DeviceID\":" + (int)deviceType + "}");
|
| | | var device = CommonDevice.CommonDeviceByByteString((int)deviceType, "{\"DeviceID\":" + (int)deviceType + ",\"DeviceEpoint\":" + DeviceEpoint + "}");
|
| | | if (device == null)
|
| | | {
|
| | | return null;
|
| | |
| | | /// </summary>
|
| | | Relay_FangyueFreshAirModul = 2310,
|
| | | /// <summary>
|
| | | /// 国标3路10A继电器小模块 镜像id:2311(临时)
|
| | | /// 国标3路10A继电器小模块 镜像id:2301
|
| | | /// </summary>
|
| | | Relay_NationalThreeLoadTenA = 2311,
|
| | | Relay_NationalThreeLoadTenA = 2301,
|
| | | /// <summary>
|
| | | /// 欧标2路5A继电器小模块 镜像id:2312(临时)
|
| | | /// 欧标2路5A继电器小模块 镜像id:2315
|
| | | /// </summary>
|
| | | Relay_EuropeanTwoLoadFiveA = 2312,
|
| | | Relay_EuropeanTwoLoadFiveA = 2315,
|
| | | /// <summary>
|
| | | /// 欧标14路干接点小模块 镜像id:2313(临时)
|
| | | /// 7路干接点输入输出模块 镜像id:2320
|
| | | /// </summary>
|
| | | Relay_EuropeanFourteenLoadDryContact = 2313,
|
| | | Relay_SevenLoadInOutPutDryContact = 2320,
|
| | |
|
| | | //=========★★调光器类(2500-2799)★★=========
|
| | | /// <summary>
|
| | |
| | | //回调控件被移除的事件
|
| | | this.RowNeedRemoveEvent?.Invoke();
|
| | | this.RemoveFromParent();
|
| | | //上传空间区域信息
|
| | | HdlRoomLogic.Current.SetRoomInfoToGateway();
|
| | | };
|
| | | };
|
| | | }
|
| | |
| | | CommonPage.Instance.FailureToServer();
|
| | | CommonPage.Loading.Hide();
|
| | | });
|
| | | HdlLogLogic.Current.WriteLog(-1, "登陆时,没网络");
|
| | | return;
|
| | | }
|
| | | var stateCodeStr = revertObj.StateCode.ToUpper();
|
| | |
| | | this.SaveSelectDeviceAndScene(room);
|
| | | //分类界面需要刷新
|
| | | UserPage.Instance.RefreshCategoryForm = true; |
| | | //上传空间区域信息 |
| | | HdlRoomLogic.Current.SetRoomInfoToGateway(); |
| | | });
|
| | | };
|
| | | }
|
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Shared.Phone.UserCenter; |
| | | using Shared.Phone.UserCenter.SmartSound.Forms; |
| | | |
| | | namespace Shared.Phone.SmartSound.Forms |
| | | { |
| | | public class AddSmartSound : EditorCommonForm |
| | | { |
| | | |
| | | /// 列表控件 |
| | | /// </summary> |
| | | private VerticalListControl listView = null; |
| | | |
| | | private FrameLayout contentLayout = null; |
| | | /// <summary> |
| | | /// 当前楼层的索引 |
| | | /// </summary> |
| | | public int CurrentIndex = 0; |
| | | private BottomClickButton bottomClickButton = null; |
| | | private RoomRowLayout xiaoduRowLayout = null;//小度 |
| | | private RoomRowLayout sbcRowLayout = null; |
| | | |
| | | /// <summary> |
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建) |
| | | /// </summary> |
| | | public void ShowForm() |
| | | { |
| | | this.ScrollEnabled = false; |
| | | base.SetTitleText("添加音箱");//设置标题信息 |
| | | |
| | | contentLayout = new FrameLayout(); |
| | | this.bodyFrameLayout.AddChidren(contentLayout); |
| | | |
| | | IniAllDataView(); |
| | | } |
| | | |
| | | #region 加载本地所有数据,生成供用户选择房间的界面 |
| | | |
| | | private void IniAllDataView() |
| | | { |
| | | contentLayout.RemoveAll(); |
| | | |
| | | if (listView == null) |
| | | { |
| | | listView = new VerticalListControl(); |
| | | contentLayout.AddChidren(listView); |
| | | listView.Height = bodyFrameLayout.Height - Application.GetRealHeight(173); |
| | | } |
| | | |
| | | Sound sound = new Sound(); |
| | | //添加小度音箱 |
| | | sound.Checked = false; |
| | | sound.Name = "小度"; |
| | | sound.type = 0; |
| | | xiaoduRowLayout = new RoomRowLayout(sound); |
| | | listView.AddChidren(xiaoduRowLayout); |
| | | xiaoduRowLayout.InitControl(); |
| | | xiaoduRowLayout.Right_icon.IsSelected = true; |
| | | xiaoduRowLayout.ButtonClickEvent += (sender, e) => |
| | | { |
| | | xiaoduRowLayout.Right_icon.IsSelected = true; |
| | | sbcRowLayout.Right_icon.IsSelected = false; |
| | | CurrentIndex = 0; |
| | | }; |
| | | |
| | | //添加思必驰音箱 |
| | | sound.Checked = false; |
| | | sound.Name = "思必驰"; |
| | | sound.type = 1 ; |
| | | sbcRowLayout = new RoomRowLayout(sound); |
| | | listView.AddChidren(sbcRowLayout); |
| | | sbcRowLayout.InitControl(); |
| | | sbcRowLayout.Right_icon.IsSelected = false; |
| | | sbcRowLayout.ButtonClickEvent += (sender, e) => |
| | | { |
| | | xiaoduRowLayout.Right_icon.IsSelected = false; |
| | | sbcRowLayout.Right_icon.IsSelected = true; |
| | | CurrentIndex = 1; |
| | | }; |
| | | |
| | | //跳转至第三方下载按钮 |
| | | bottomClickButton = new BottomClickButton(); |
| | | this.bodyFrameLayout.AddChidren(bottomClickButton); |
| | | bottomClickButton.Text = "跳转至第三方APP"; |
| | | bottomClickButton.ButtonClickEvent += (sender, e) => |
| | | { |
| | | // |
| | | if (CurrentIndex == 0) |
| | | { |
| | | OpenXiaoDuAPP(); |
| | | |
| | | } |
| | | else if (CurrentIndex == 1) |
| | | { |
| | | OpenSBCAPP(); |
| | | } |
| | | }; |
| | | |
| | | //bottomClickButton.Visible = false; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 小度 |
| | | /// </summary> |
| | | private void OpenXiaoDuAPP() |
| | | { |
| | | bool bol = false; |
| | | try |
| | | { |
| | | #if Android |
| | | bol = HDLUtils.OpenAppWithPackageName("com.baidu.duer.superapp"); |
| | | #else |
| | | bol=HDLUtils.OpenApp("xiaoduapp://"); |
| | | #endif |
| | | |
| | | if (!bol) |
| | | { |
| | | #if Android |
| | | HDLUtils.OpenUrl("market://details?id=com.baidu.duer.superapp"); |
| | | #else |
| | | HDLUtils.OpenUrl("https://apps.apple.com/cn/app/%E5%B0%8F%E5%BA%A6/id1437733193"); |
| | | #endif |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | string error = e.Message; |
| | | bol = false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 思必驰 |
| | | /// </summary> |
| | | private void OpenSBCAPP() |
| | | { |
| | | bool bol = false; |
| | | try |
| | | { |
| | | #if Android |
| | | bol = HDLUtils.OpenAppWithPackageName("com.aispeech.companionapp"); |
| | | #else |
| | | bol=HDLUtils.OpenApp("AispeechMobile://"); |
| | | #endif |
| | | |
| | | if (!bol) |
| | | { |
| | | #if Android |
| | | HDLUtils.OpenUrl("market://details?id=com.aispeech.companionapp"); |
| | | #else |
| | | HDLUtils.OpenUrl("https://apps.apple.com/cn/app/id1460767442"); |
| | | #endif |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | string error = e.Message; |
| | | bol = false; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region ■ 自定义房间选择控件_____________________ |
| | | |
| | | /// <summary> |
| | | /// 房间列表行 |
| | | /// </summary> |
| | | private class RoomRowLayout : FrameRowControl |
| | | { |
| | | /// <summary> |
| | | /// 房间名称 |
| | | /// </summary> |
| | | private NormalViewControl btnName = null; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | private Sound sound=null; |
| | | public MostRightIconControl Right_icon = null; |
| | | private IconViewControl iconViewControl = null; |
| | | private NormalViewControl bottomLine = null; |
| | | |
| | | /// <summary> |
| | | /// 房间列表行 |
| | | /// </summary> |
| | | public RoomRowLayout(Sound _sound) |
| | | { |
| | | this.sound = _sound; |
| | | this.UseClickStatu = false; |
| | | this.BackgroundColor = UserCenterColor.Current.White; |
| | | this.Height = Application.GetRealHeight(170); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化控件 |
| | | /// </summary> |
| | | public void InitControl() |
| | | { |
| | | //图标 |
| | | if (sound.type == 0) |
| | | { |
| | | iconViewControl = this.AddLeftIcon(81, "SmartSound/Xiaodu.png"); |
| | | } |
| | | else |
| | | { |
| | | iconViewControl = this.AddLeftIcon(81, "SmartSound/Sibici.png"); |
| | | } |
| | | |
| | | //显示文本 |
| | | btnName = this.AddLeftCaption(string.Empty, 2000); |
| | | btnName.Height = Application.GetRealHeight(60); |
| | | btnName.TextSize = 14; |
| | | btnName.Y = Application.GetRealHeight(57); |
| | | btnName.Text = sound.Name; |
| | | //btnName.X = iconViewControl.X + iconViewControl.Width ; |
| | | |
| | | Right_icon = this.AddMostRightEmptyIcon(58, 58); |
| | | Right_icon.Gravity = Gravity.CenterVertical; |
| | | |
| | | Right_icon.SelectedImagePath = "Item/ItemSelected.png"; |
| | | Right_icon.UnSelectedImagePath = "Item/ItemUnSelected.png"; |
| | | |
| | | bottomLine = AddBottomLine(); |
| | | bottomLine.X = btnName.X; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | private class Sound |
| | | { |
| | | public int type = 0; |
| | | public string Name=""; |
| | | public bool Checked = false; |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Threading.Tasks; |
| | | using Newtonsoft.Json.Linq; |
| | | using Shared.Common; |
| | | using Shared.Phone.SmartSound.Forms; |
| | | using Shared.Phone.UserCenter.Device; |
| | | using Shared.Phone.UserCenter.SmartSound.Util; |
| | | using Shared.Phone.UserCenter.SmartSound.Widget; |
| | |
| | | private RowLayoutControl oldShowRightMuneRow = null; |
| | | |
| | | private static string dataString = ""; |
| | | private MostRightIconControl btnAddDeviceIcon = null; |
| | | |
| | | |
| | | #region ■ 初始化_____________________________ |
| | |
| | | base.SetTitleText("智能音箱"); |
| | | Dictionary<string, string> floorDictionary = Config.Instance.Home.FloorDics;//楼层列表 |
| | | |
| | | var helpBtn = new MyButton(); |
| | | helpBtn.TextColor = UserCenterColor.Current.TextOrangeColor; |
| | | helpBtn.Text = "帮助"; |
| | | helpBtn.Gravity = Gravity.CenterRight; |
| | | helpBtn.TextAlignment = TextAlignment.CenterRight; |
| | | topFrameLayout.AddChidren(helpBtn); |
| | | helpBtn.X -= Application.GetRealWidth(58); |
| | | //右上添加按钮 |
| | | if (btnAddDeviceIcon == null) |
| | | { |
| | | btnAddDeviceIcon = new MostRightIconControl(69, 69); |
| | | btnAddDeviceIcon.UnSelectedImagePath = "Item/Add.png"; |
| | | topFrameLayout.AddChidren(btnAddDeviceIcon); |
| | | btnAddDeviceIcon.InitControl(); |
| | | btnAddDeviceIcon.ButtonClickEvent += (sender, e) => |
| | | { |
| | | var helpForm = new AddSmartSound(); |
| | | helpForm.AddForm(); |
| | | }; |
| | | } |
| | | |
| | | //var helpBtn = new MyButton(); |
| | | //helpBtn.TextColor = UserCenterColor.Current.TextOrangeColor; |
| | | //helpBtn.Text = "帮助"; |
| | | //helpBtn.Gravity = Gravity.CenterRight; |
| | | //helpBtn.TextAlignment = TextAlignment.CenterRight; |
| | | //topFrameLayout.AddChidren(helpBtn); |
| | | //helpBtn.X -= Application.GetRealWidth(58); |
| | | |
| | | //初始化中部控件 |
| | | this.InitMiddleFrame(); |
| | | |
| | | helpBtn.MouseUpEventHandler += (sernder, e) => |
| | | { |
| | | //生成一个弹窗画面 |
| | | var dialogForm = new TextDialog("绑定智能音箱到第三方 APP 进行操作", "跳转至小度APP"); |
| | | dialogForm.SetTitleText("帮助"); |
| | | //helpBtn.MouseUpEventHandler += (sernder, e) => |
| | | //{ |
| | | // var helpForm = new AddSmartSound(); |
| | | // helpForm.AddForm(); |
| | | // /* |
| | | // //生成一个弹窗画面 |
| | | // var dialogForm = new TextDialog("绑定智能音箱到第三方 APP 进行操作", "跳转至小度APP"); |
| | | // dialogForm.SetTitleText("帮助"); |
| | | |
| | | //按下确认按钮 |
| | | dialogForm.ComfirmClickEvent += () => |
| | | { |
| | | //画面关闭 |
| | | dialogForm.CloseDialog(); |
| | | OpenXiaoDuAPP(); |
| | | }; |
| | | }; |
| | | // //按下确认按钮 |
| | | // dialogForm.ComfirmClickEvent += () => |
| | | // { |
| | | // //画面关闭 |
| | | // dialogForm.CloseDialog(); |
| | | // OpenXiaoDuAPP(); |
| | | // };*/ |
| | | //}; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | if (smartSound.Remark != null && smartSound.Remark.Trim() != "") |
| | | remark += "(" + smartSound.Remark + ")"; |
| | | |
| | | row.ImagePath = "SmartSound/Xiaodu.png"; |
| | | row.ImagePath = "SmartSound/Sibici.png"; |
| | | row.Remark = remark; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 思必驰 |
| | | /// </summary> |
| | | private void OpenSBCAPP() |
| | | { |
| | | bool bol = false; |
| | | try |
| | | { |
| | | #if Android |
| | | bol = HDLUtils.OpenAppWithPackageName("com.aispeech.companionapp"); |
| | | #else |
| | | bol=HDLUtils.OpenApp("AispeechMobile://"); |
| | | #endif |
| | | |
| | | if (!bol) |
| | | { |
| | | #if Android |
| | | HDLUtils.OpenUrl("market://details?id=com.aispeech.companionapp"); |
| | | #else |
| | | HDLUtils.OpenUrl("https://apps.apple.com/cn/app/id1460767442"); |
| | | #endif |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | string error = e.Message; |
| | | bol = false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 解除绑定弹窗 |
| | | /// </summary> |
| | | private void ShowDelectDialog(SmartSoundInfo.SoundInfo smartSound) |
| | | { |
| | | //生成一个弹窗画面 |
| | | var dialogForm = new TextDialog("解除绑定需要到第三方 APP 进行操作", "跳转至小度APP"); |
| | | var dialogForm = new TextDialog("解除绑定需要到第三方 APP 进行操作", "跳转至第三方APP"); |
| | | dialogForm.SetTitleText("解除绑定"); |
| | | |
| | | //按下确认按钮 |
| | | dialogForm.ComfirmClickEvent += () => |
| | | {
|
| | | if (smartSound.PlatfromName == "Baidu")
|
| | | {
|
| | | OpenXiaoDuAPP();
|
| | | |
| | | /* |
| | | HdlThreadLogic.Current.RunThread(() => |
| | | { |
| | | this.ShowProgressBar("删除服务器记录..."); |
| | | string json = DelectSmartSound(smartSound); |
| | | if (json == "SUCCESS") |
| | | { |
| | | smartSoundInfo.ResponseData.Data.Remove(smartSound); |
| | | } |
| | | this.CloseProgressBar(); |
| | | |
| | | HdlThreadLogic.Current.RunMainInThread(() => |
| | | { |
| | | //画面关闭 |
| | | dialogForm.CloseDialog(); |
| | | OpenXiaoDuAPP(); |
| | | iniView(); |
| | | }); |
| | | });*/ |
| | | else if (smartSound.PlatfromName == "AISpeech") {
|
| | | OpenSBCAPP();
|
| | | } |
| | | }; |
| | | } |
| | | /// <summary> |
| | |
| | | if (str == "SUCCESS") |
| | | { |
| | | smartSound.Remark = remark; |
| | | if (smartSound.PlatfromName == "Baidu")
|
| | | {
|
| | | soundRowLayout.btnRemark.Text = "小度" + "(" + textValue + ")"; |
| | | } |
| | | else if (smartSound.PlatfromName == "AISpeech")
|
| | | {
|
| | | soundRowLayout.btnRemark.Text = "思必驰" + "(" + textValue + ")";
|
| | | }
|
| | | else |
| | | {
|
| | | soundRowLayout.btnRemark.Text = textValue;
|
| | | }
|
| | | |
| | | } |
| | | else |
| | | { |
| | | //错误弹窗提示 |
| | |
| | | //本地备份保存成功
|
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.SaveLocalBackDataSuccess));
|
| | | }
|
| | | ProgressFormBar.Current.Close();
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | var homeInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<TemplateHomeInfo>(homeData);
|
| | | myModel.ListUintContent.AddRange(homeInfo.ListUintContent);
|
| | | myModel.ListUintName.AddRange(homeInfo.ListUintName);
|
| | | myModel.ResidenceAddressName = homeInfo.ResidenceAddressName;
|
| | | }
|
| | | }
|
| | |
| | | public string GetNewTemplateFileName()
|
| | | {
|
| | | return "ModelData_Local_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".bin";
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取一个新的模板保存文件名
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | public string GetNewTemplateFileName(DateTime dateTime)
|
| | | {
|
| | | return "ModelData_Local_" + dateTime.ToString("yyyyMMdd_HHmmss") + ".bin";
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | var modelData = new LocalModelBaseInfo();
|
| | | modelData.EditorTime = DateTime.Now.ToString("yyyy.MM.dd HH:mm");
|
| | | modelData.ModelName = backUpName;
|
| | | modelData.ListUintContent.AddRange(Common.Config.Instance.Home.ListUintContent);
|
| | | modelData.FloorCount = Common.Config.Instance.Home.FloorDics.Count;
|
| | | modelData.DeviceCount = this.modelData.dicDeviceTemplateData.Count;
|
| | | //功能数
|
| | |
| | | {
|
| | | var homeData = new TemplateHomeInfo();
|
| | | homeData.ResidenceAddressName = Common.Config.Instance.Home.ResidenceAddressName;
|
| | | homeData.ListUintName.AddRange(Common.Config.Instance.Home.ListUintName);
|
| | | homeData.ListUintContent.AddRange(Common.Config.Instance.Home.ListUintContent);
|
| | |
|
| | | writeText += "#START#\r\n";
|
| | |
| | | {
|
| | | //获取本地指定的Mac的全部设备
|
| | | var listDevice = Common.LocalDevice.Current.GetDevicesByMac(sourceMac, false);
|
| | | var otaDevice = Common.LocalDevice.Current.GetOTADevice(sourceMac);
|
| | | if (otaDevice != null)
|
| | | {
|
| | | //这里ota设备也要加进去,重中之重
|
| | | listDevice.Add(otaDevice);
|
| | | }
|
| | |
|
| | | foreach (var device in listDevice)
|
| | | {
|
| | |
| | | string localDeviceKey = Common.LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | string templateDeviceKey = Common.LocalDevice.Current.GetDeviceMainKeys(targetMac, device.DeviceEpoint);
|
| | |
|
| | | if (this.modelData.dicDeviceTemplateRoom.ContainsKey(templateDeviceKey) == true)
|
| | | if (this.modelData.dicDeviceTemplateRoom.ContainsKey(templateDeviceKey) == true
|
| | | && (device is OTADevice) == false)
|
| | | {
|
| | | //如果模板里面,这个端点设置有房间的话
|
| | | HdlRoomLogic.Current.ChangedRoom(device, this.modelData.dicDeviceTemplateRoom[templateDeviceKey], false);
|
| | |
| | |
|
| | | //保存路径
|
| | | string saveFile = DirNameResourse.LocalTemplateDirectory;
|
| | | saveFile = System.IO.Path.Combine(saveFile, mainkey);
|
| | | saveFile = System.IO.Path.Combine(saveFile, "Device_" + mainkey);
|
| | |
|
| | | var listData = this.modelData.dicDeviceTemplateData[mainkey];
|
| | | if (listData.Count == 0)
|
| | |
| | | get { return FileName.StartsWith("ModelData_Local"); }
|
| | | }
|
| | | /// <summary>
|
| | | /// 单元标题(这个目前是给查看模板使用的)
|
| | | /// </summary>
|
| | | [Newtonsoft.Json.JsonIgnore]
|
| | | public List<string> ListUintName = new List<string>();
|
| | | /// <summary>
|
| | | /// 单元名称(这个目前是给查看模板使用的)
|
| | | /// </summary>
|
| | | [Newtonsoft.Json.JsonIgnore]
|
| | |
| | | public class TemplateHomeInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 单元标题
|
| | | /// </summary>
|
| | | public List<string> ListUintName = new List<string>();
|
| | | /// <summary>
|
| | | /// 单元名称
|
| | | /// </summary>
|
| | | public List<string> ListUintContent = new List<string>();
|
| | |
| | | /// <param name="finishEvent">结束选择的事件,第一个参数是选择的模板的名字,第二个参数是选择的模板的文件名字</param>
|
| | | public void ShowBottomSelectTemplateForm(string nowSelectFile, Action<string, string> finishEvent)
|
| | | {
|
| | | //2020.09.15 不再获取云端模板
|
| | |
|
| | | //获取本地的模板
|
| | | var listLocal = TemplateCommonLogic.Current.GetLocalAllModelList();
|
| | | //获取云端的模板
|
| | | var listClound = TemplateCommonLogic.Current.GetCloundAllModelList();
|
| | | if (listLocal.Count == 0 && listClound.Count == 0)
|
| | | //var listClound = TemplateCommonLogic.Current.GetCloundAllModelList();
|
| | | //if (listLocal.Count == 0 && listClound.Count == 0)
|
| | | if (listLocal.Count == 0)
|
| | | {
|
| | | //检测不到可供选择的模板数据
|
| | | HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.NotHadTemplateDataToSelect));
|
| | |
| | | //已经存在了的模板名字
|
| | | listEsixtName.Add(listLocal[i].ModelName);
|
| | | }
|
| | | for (int i = 0; i < listClound.Count; i++)
|
| | | {
|
| | | //如果本地已经存在了这个模板,则已本地的为准
|
| | | if (listEsixtName.Contains(listClound[i].TemplateName) == true)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | listText1.Add(listClound[i].TemplateName);
|
| | | listText2.Add(listClound[i].CreatedOnUtc);
|
| | | }
|
| | | //for (int i = 0; i < listClound.Count; i++)
|
| | | //{
|
| | | // //如果本地已经存在了这个模板,则已本地的为准
|
| | | // if (listEsixtName.Contains(listClound[i].TemplateName) == true)
|
| | | // {
|
| | | // continue;
|
| | | // }
|
| | | // listText1.Add(listClound[i].TemplateName);
|
| | | // listText2.Add(listClound[i].CreatedOnUtc);
|
| | | //}
|
| | |
|
| | | var selectForm = new BottomItemSelectForm();
|
| | | selectForm.SelectRowCanCancel = false;
|
| | |
| | | selectForm.FinishSelectEvent += (select) =>
|
| | | {
|
| | | //已选模版:南沙金茂府_户型A
|
| | | if (select >= listLocal.Count)
|
| | | {
|
| | | //如果选择的是云端模板的话
|
| | | int index = select - listLocal.Count;
|
| | | //需要去下载这个模板
|
| | | TemplateCommonLogic.Current.DownLoadTemplate(listClound[index].Id, (fullName) =>
|
| | | {
|
| | | if (fullName != null)
|
| | | {
|
| | | string fileName = fullName.Substring(DirNameResourse.AllResidenceTemplateDirectory.Length + 1);
|
| | | //调用回调函数
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | finishEvent?.Invoke(listText1[select], fileName);
|
| | | });
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | //if (select >= listLocal.Count)
|
| | | //{
|
| | | // //如果选择的是云端模板的话
|
| | | // int index = select - listLocal.Count;
|
| | | // //需要去下载这个模板
|
| | | // TemplateCommonLogic.Current.DownLoadTemplate(listClound[index].Id, (fullName) =>
|
| | | // {
|
| | | // if (fullName != null)
|
| | | // {
|
| | | // string fileName = fullName.Substring(DirNameResourse.AllResidenceTemplateDirectory.Length + 1);
|
| | | // //调用回调函数
|
| | | // HdlThreadLogic.Current.RunMain(() =>
|
| | | // {
|
| | | // finishEvent?.Invoke(listText1[select], fileName);
|
| | | // });
|
| | | // }
|
| | | // });
|
| | | //}
|
| | | //else
|
| | | {
|
| | | //调用回调函数
|
| | | finishEvent?.Invoke(listText1[select], listLocal[select].FileName);
|
| | |
| | | /// 当设备Type不一样时,是否生成Log 1->生成
|
| | | /// </summary>
|
| | | public int CheckDeviceType = 0;
|
| | | /// <summary>
|
| | | /// 是否使用以前旧的设备列表获取方式 1->使用
|
| | | /// </summary>
|
| | | public int UseOldSearchDeviceMethord = 0;
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | txtView.Text = selectName;
|
| | | //调用回调函数
|
| | | this.SelectRoomEvent?.Invoke(RoomKey);
|
| | | //上传空间区域信息
|
| | | HdlRoomLogic.Current.SetRoomInfoToGateway();
|
| | | });
|
| | | if (result == false)
|
| | | {
|
| | |
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //刷新控件
|
| | | tempWay.GatewayOnlineFlage = true;
|
| | | this.RefreshControl(tempWay);
|
| | | });
|
| | | }
|
| | |
| | | {
|
| | | this.zbGatewayId = zbway.GwId;
|
| | | }
|
| | | bool bonline = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway);
|
| | | bool bonline = HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(zbway);
|
| | |
|
| | | this.IsOnline = bonline;
|
| | |
|
| | |
| | | topBackFame.AddChidren(btnTitle); |
| | | |
| | | //取消 |
| | | var btnCancel = new NormalViewControl(Application.GetRealWidth(200), topBackFame.Height, true); |
| | | var btnCancel = new NormalViewControl(Application.GetRealWidth(200), topBackFame.Height, false); |
| | | btnCancel.X = Application.GetRealWidth(81); |
| | | btnCancel.TextColor = UserCenterColor.Current.TextGrayColor1; |
| | | btnCancel.TextID = R.MyInternationalizationString.uCancel; |
| | |
| | | };
|
| | |
|
| | | //完成
|
| | | var btnFinish = new NormalViewControl(Application.GetRealWidth(200), topBackFame.Height, true); |
| | | var btnFinish = new NormalViewControl(Application.GetRealWidth(200), topBackFame.Height, false); |
| | | btnFinish.X = topBackFame.Width - btnCancel.X - Application.GetRealWidth(200); |
| | | btnFinish.TextAlignment = TextAlignment.CenterRight; |
| | | btnFinish.TextColor = 0xfffb744a; |
| | |
| | | #region ■ 上传备份___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 执行上传自动备份数据(0:没有可上传的自动备份数据 1:成功 -1:失败)
|
| | | /// 手动执行上传自动备份数据(0:没有可上传的自动备份数据 1:成功 -1:失败)
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | public static int DoUpLoadAutoBackupData()
|
| | | public static int DoUpLoadAutoBackupDataByHand()
|
| | | {
|
| | | //获取app的自动备份
|
| | | var data = HdlBackupLogic.Current.GetBackupListNameFromDB(1);
|
| | | if (data == null)
|
| | | {
|
| | | return -1;
|
| | | }
|
| | |
|
| | | if (data.Count == 0)
|
| | | {
|
| | | //删除全部的自动备份的本地文件
|
| | | DeleteAllAutoBackupFile();
|
| | | //如果没有自动备份数据,则把本地全部东西上传
|
| | | var pathTemp = DirNameResourse.AutoBackupDirectory;
|
| | | //复制本地所有文件过去
|
| | | List<string> listAllFile = HdlFileLogic.Current.GetRootPathListFile();
|
| | | foreach (string fileName in listAllFile)
|
| | | {
|
| | | string oldFile = System.IO.Path.Combine(Config.Instance.FullPath, fileName);
|
| | | string newFile = System.IO.Path.Combine(pathTemp, fileName);
|
| | | //复制文件
|
| | | HdlFileLogic.Current.CopyFile(oldFile, newFile);
|
| | | }
|
| | | }
|
| | |
|
| | | //编辑文件
|
| | | List<string> listEditor = GetAutoBackupEditorFile();
|
| | | //删除文件
|
| | |
| | | /// <summary>
|
| | | /// 上传文件到云端
|
| | | /// </summary>
|
| | | /// <param name="listFile"></param>
|
| | | /// <param name="listFile">编辑或者添加的文件(目前已经不是上传它了)</param>
|
| | | /// <returns></returns>
|
| | | private static bool UpLoadBackupFileToDB(List<string> listFile)
|
| | | {
|
| | | int listFileCount = listFile.Count;
|
| | | string backUpDir = DirNameResourse.AutoBackupDirectory;
|
| | | for (int i = 0; i < listFile.Count; i++)
|
| | | string localPath = Config.Instance.FullPath;
|
| | |
|
| | | //将模板数据保存到到指定的文件夹中
|
| | | var templateName = TemplateData.TemplateCommonLogic.Current.GetNewTemplateFileName(new DateTime(2000, 12, 31, 12, 59, 57));
|
| | | var templateFile = TemplateData.TemplateCommonLogic.Current.SaveTemplateDataToFile(templateName, "HomeTemplate");
|
| | |
|
| | | //将模板bin文件移动到备份文件夹中
|
| | | var localTemplateName = System.IO.Path.Combine(localPath, templateName);
|
| | | try { System.IO.File.Move(templateFile, localTemplateName); }
|
| | | catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex, "移动模板失败"); }
|
| | |
|
| | | //获取本地文件
|
| | | var listAllFile = HdlFileLogic.Current.GetRootPathListFile();
|
| | | var listUpFile = new List<string>();
|
| | | foreach (string fileName in listAllFile)
|
| | | {
|
| | | string file = listFile[i];
|
| | | //判断指定文件是否需要上传(根目录的才判断)
|
| | | if (HdlBackupLogic.Current.IsNotUpLoadFile(fileName) == true)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | //其他图片的资源文件,只有在变更了的时候,才上传
|
| | | if (fileName.EndsWith(".png") == true && listFile.Contains(fileName) == false)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | listUpFile.Add(fileName);
|
| | | }
|
| | |
|
| | | int listFileCount = listUpFile.Count;
|
| | | for (int i = 0; i < listUpFile.Count; i++)
|
| | | {
|
| | | string file = listUpFile[i];
|
| | | var datainfo = new FileInfoData();
|
| | | datainfo.BackupFileName = file;
|
| | | datainfo.BackupFileContent = HdlFileLogic.Current.ReadFileByteContent(System.IO.Path.Combine(backUpDir, file));
|
| | | datainfo.BackupFileContent = HdlFileLogic.Current.ReadFileByteContent(System.IO.Path.Combine(localPath, file));
|
| | | if (datainfo.BackupFileContent == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | var list = new List<FileInfoData>();
|
| | | list.Add(datainfo);
|
| | |
|
| | | var upData = new UpLoadDataPra();
|
| | | upData.HomeId = Config.Instance.Home.Id;
|
| | | upData.UploadSubFileLists = new List<FileInfoData> { datainfo };
|
| | | //获取控制主人账号的Token
|
| | | upData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | |
|
| | | //执行是上传
|
| | | bool falge = DoUpLoadInfoToDB(list);
|
| | | bool falge = UserCenterLogic.GetResultStatuByRequestHttps("App/HomeAppAutoDataBackup", true, upData, null, true);
|
| | | if (falge == false)
|
| | | {
|
| | | return false;
|
| | |
| | | //设置进度值
|
| | | ProgressFormBar.Current.SetValue(i + 1, listFileCount);
|
| | | }
|
| | |
|
| | | //删除掉这个模板文件
|
| | | HdlFileLogic.Current.DeleteFile(localTemplateName);
|
| | |
|
| | | //删除文件
|
| | | var backPath = DirNameResourse.AutoBackupDirectory;
|
| | | foreach (var file in listFile)
|
| | | {
|
| | | string fullName = System.IO.Path.Combine(backPath, file);
|
| | | HdlFileLogic.Current.DeleteFile(fullName);
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | //自动备份只有一个
|
| | | var autoBackupId = data[0].Id;
|
| | | var nowZigbeeNumHomeId = Shared.Common.Config.Instance.Home.Id;
|
| | |
|
| | | var upData = new DeleteFilePra();
|
| | | upData.BackupClassId = autoBackupId;
|
| | | upData.HomeId = nowZigbeeNumHomeId;
|
| | | upData.HomeId = Config.Instance.Home.Id;
|
| | | upData.DeleteFileNameLists = listData;
|
| | | //获取控制主人账号的Token
|
| | | upData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | |
| | | string fullName = System.IO.Path.Combine(backPath, file);
|
| | | HdlFileLogic.Current.DeleteFile(fullName);
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 执行上传文件到云端
|
| | | /// </summary>
|
| | | /// <param name="listData">上传的数据</param>
|
| | | /// <returns></returns>
|
| | | private static bool DoUpLoadInfoToDB(List<FileInfoData> listData)
|
| | | {
|
| | | var nowZigbeeNumHomeId = Shared.Common.Config.Instance.Home.Id;
|
| | |
|
| | | var upData = new UpLoadDataPra();
|
| | | upData.HomeId = nowZigbeeNumHomeId;
|
| | | upData.UploadSubFileLists = listData;
|
| | | //获取控制主人账号的Token
|
| | | upData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | |
|
| | | bool falge = UserCenterLogic.GetResultStatuByRequestHttps("App/HomeAppAutoDataBackup", true, upData, null, true);
|
| | | if (falge == false)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | //删除文件
|
| | | var backPath = DirNameResourse.AutoBackupDirectory;
|
| | | foreach (var file in listData)
|
| | | {
|
| | | string fullName = System.IO.Path.Combine(backPath, file.BackupFileName);
|
| | | HdlFileLogic.Current.DeleteFile(fullName);
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | /// <returns></returns>
|
| | | public static int SynchronizeDbAutoBackupData()
|
| | | {
|
| | | //判断是否能够同步数据
|
| | | string checkFile = DirNameResourse.AutoDownLoadBackupCheckFile;
|
| | | //如果本地已经拥有了这个文件,则说明不是新手机,不再自动还原
|
| | | if (System.IO.File.Exists(checkFile) == true)
|
| | | {
|
| | | //同步服务器的分享内容
|
| | | HdlShardLogic.Current.SynchronizeDbSharedContent();
|
| | | return 0;
|
| | | }
|
| | |
|
| | | //暂时不支持成员
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 3)
|
| | | {
|
| | | //同步服务器的分享内容
|
| | | HdlShardLogic.Current.SynchronizeDbSharedContent();
|
| | | //创建一个空文件(标识已经完成同步)
|
| | | var file = System.IO.File.Create(checkFile);
|
| | | file.Close();
|
| | | return 1;
|
| | | }
|
| | | //判断是否能够同步数据
|
| | | string checkFile = DirNameResourse.AutoDownLoadBackupCheckFile;
|
| | | //如果本地已经拥有了这个文件,则说明不是新手机,不再自动还原
|
| | | if (System.IO.File.Exists(checkFile) == true)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | |
|
| | | //获取app的自动备份
|
| | |
| | | }
|
| | | if (data.Count == 0)
|
| | | {
|
| | | //同步服务器的分享内容
|
| | | HdlShardLogic.Current.SynchronizeDbSharedContent();
|
| | | //创建一个空文件(标识已经完成同步)
|
| | | var file = System.IO.File.Create(checkFile);
|
| | | file.Close();
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | List<string> listFile1 = HdlFileLogic.Current.GetFileFromDirectory(DirNameResourse.AutoBackupDirectory);
|
| | | List<string> listFile2 = GetAutoBackupDeleteFile();
|
| | |
|
| | | if (listFile1.Count == 0 && listFile2.Count == 0)
|
| | | //判断是否有文件变更了
|
| | | if (CheckAutoBackupFileIsChanged() == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (listFile1.Count == 1 && listFile1[0] == "Room_Favorite.json")
|
| | | {
|
| | | //这个东西好像APP启动的时候都会创建的样子
|
| | | return;
|
| | | }
|
| | |
|
| | | //文件全路径
|
| | | string fullName = DirNameResourse.AutoBackupNotPromptedFile;
|
| | | if (System.IO.File.Exists(fullName) == false)
|
| | | //判断能否显示自动备份的界面
|
| | | if (CheckCanShowAutoBackupForm() == true)
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | var form = new HdlBackup.HdlAutoBackupForm();
|
| | | form.AddForm();
|
| | | });
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 检测自动备份文件是否变更过
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | private static bool CheckAutoBackupFileIsChanged()
|
| | | {
|
| | | List<string> listFile1 = HdlFileLogic.Current.GetFileFromDirectory(DirNameResourse.AutoBackupDirectory);
|
| | | List<string> listFile2 = GetAutoBackupDeleteFile();
|
| | |
|
| | | if (listFile1.Count == 0 && listFile2.Count == 0)
|
| | | {
|
| | | //没有文件变更
|
| | | return false;
|
| | | }
|
| | | if (listFile2.Count > 0)
|
| | | {
|
| | | //有文件被删除
|
| | | return true;
|
| | | }
|
| | | foreach (var fileName in listFile1)
|
| | | {
|
| | | //住宅和收藏文件,不作为判断标准
|
| | | if (fileName.StartsWith("House_") == true
|
| | | || fileName == "Room_Favorite.json")
|
| | | {
|
| | | continue;
|
| | | }
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 检测能否显示自动备份的界面
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | private static bool CheckCanShowAutoBackupForm()
|
| | | {
|
| | | //文件全路径
|
| | | string fullName = DirNameResourse.AutoBackupNotPromptedFile;
|
| | | if (System.IO.File.Exists(fullName) == false)
|
| | | {
|
| | | //本地没有存在这个文件
|
| | | return true;
|
| | | }
|
| | | BackupNotPrompted info = null;
|
| | | var data = HdlFileLogic.Current.ReadFileByteContent(fullName);
|
| | |
| | | if (info.NotPrompted == true)
|
| | | {
|
| | | //不再提示
|
| | | return;
|
| | | return false;
|
| | | }
|
| | | if (info.Day == 0)
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | var form = new HdlBackup.HdlAutoBackupForm();
|
| | | form.AddForm();
|
| | | });
|
| | | return;
|
| | | return true;
|
| | | }
|
| | |
|
| | | DateTime oldTime = Convert.ToDateTime(info.OldDay);
|
| | | int intDay = (DateTime.Now - oldTime).Days;
|
| | | //时间已经超过
|
| | | if (intDay > info.Day)
|
| | | if (intDay >= info.Day)
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | var form = new HdlBackup.HdlAutoBackupForm();
|
| | | form.AddForm();
|
| | | });
|
| | | return;
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// </summary>
|
| | | /// <param name="file"></param>
|
| | | /// <returns></returns>
|
| | | private bool IsNotUpLoadFile(string file)
|
| | | public bool IsNotUpLoadFile(string file)
|
| | | {
|
| | | if (file.StartsWith("Device_") == true
|
| | | || file.StartsWith("Gateway_") == true
|
| | |
| | | //添加网关的话,强制主页刷新 |
| | | UserView.UserPage.Instance.RefreshAllForm = true; |
| | | |
| | | if (Config.Instance.Home.TemplateMode == 2)
|
| | | {
|
| | | //如果这个类型的网关只有一个模板,则自动匹配
|
| | | var dicName = TemplateData.TemplateCommonLogic.Current.GetGatewayCanSelectTemplateName(zbGateway);
|
| | | if (dicName.Count == 1)
|
| | | {
|
| | | foreach (var tempId in dicName.Keys)
|
| | | {
|
| | | TemplateData.TemplateCommonLogic.Current.AddGatewayTemplateSelect(zbGateway.GwId, tempId);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return true; |
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | //刷新的是缓存,不刷新真实物理网关
|
| | | this.dicGateway[gwID].GatewayOnlineFlage = zbGateway.GatewayOnlineFlage;
|
| | | this.dicGateway[gwID].OnlineTime = DateTime.Now;
|
| | | //将网关的数据设置到本地缓存中
|
| | | this.SetGatewayDataToLocalMemmory(this.dicGateway[gwID], result);
|
| | | //顺便这个变量也设置一下
|
| | |
| | | var data = new Newtonsoft.Json.Linq.JObject { { "HomeId", HomeId }, { "AccountId", accountId } };
|
| | | jObject.Add("Data", data);
|
| | | //住宅ID的设置,固定使用局域网,不存在远程的说法
|
| | | var result = this.SendJobjectDataToGateway(zbGateway, "GwSetHomeId", jObject.ToString(), "GwSetHomeId_Respon", 5, true);
|
| | | var result = this.SendJobjectDataToGateway(zbGateway.GwId, "GwSetHomeId", jObject.ToString(), "GwSetHomeId_Respon", 5, true);
|
| | | if (result.ErrorMsgDiv == -1)
|
| | | {
|
| | | if (mode == ShowErrorMode.YES)
|
| | |
| | | }
|
| | |
|
| | | //刷新的是缓存,不刷新真实物理网关
|
| | | this.dicGateway[gwID].GatewayOnlineFlage = zbGateway.GatewayOnlineFlage;
|
| | | this.dicGateway[gwID].OnlineTime = DateTime.Now;
|
| | | //将网关的数据设置到本地缓存中
|
| | | this.SetGatewayDataToLocalMemmory(this.dicGateway[gwID], result);
|
| | | //顺便这个变量也设置一下
|
| | |
| | |
|
| | | //添加网关的话,强制主页刷新
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | if (Config.Instance.Home.TemplateMode == 2)
|
| | | {
|
| | | //如果这个类型的网关只有一个模板,则自动匹配
|
| | | var dicName = TemplateData.TemplateCommonLogic.Current.GetGatewayCanSelectTemplateName(zbGateway);
|
| | | if (dicName.Count == 1)
|
| | | {
|
| | | foreach (var tempId in dicName.Keys)
|
| | | {
|
| | | TemplateData.TemplateCommonLogic.Current.AddGatewayTemplateSelect(zbGateway.GwId, tempId);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return 1; |
| | | } |
| | |
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 91 } };
|
| | | var data = new Newtonsoft.Json.Linq.JObject { { "GwName", gatewayName } };
|
| | | jObject.Add("Data", data);
|
| | | var result = this.SendJobjectDataToGateway(zbGateway, "GwReName", jObject.ToString(), "GwReName_Respon");
|
| | | var result = this.SendJobjectDataToGateway(zbGateway.GwId, "GwReName", jObject.ToString(), "GwReName_Respon");
|
| | | if (result.ErrorMsg != null)
|
| | | {
|
| | | this.ShowTipMsg(result.ErrorMsg);
|
| | |
| | | }
|
| | |
|
| | | //获取全部设备
|
| | | int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(realWay, false);
|
| | | int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(realWay.GwId, false);
|
| | | //关闭进度条
|
| | | ProgressBar.Close();
|
| | | if (result == -1)
|
| | |
| | | //虚拟物理网关
|
| | | listRealWay.Add(listGateway[i]);
|
| | | }
|
| | | //标识指定网关为不在线
|
| | | listRealWay[i].GatewayOnlineFlage = false;
|
| | | }
|
| | |
|
| | | //这是第一道坎,强制检查WIFI:等待2秒(因为wifi的时候,它会自动去刷新flage)
|
| | | System.Threading.Thread.Sleep(2000);
|
| | | //检查是否拥有网关存在于WIFi下
|
| | | if (this.CheckHadGatewayInWifi(listRealWay) == false)
|
| | | {
|
| | | //第二道坎:在远程的情况下刷新网关的在线状态
|
| | | this.RefreshGatewayOnlineOnRemode(listRealWay);
|
| | | }
|
| | |
|
| | | //刷新缓存的在线标识
|
| | | foreach (var zbway in listRealWay)
|
| | | {
|
| | | string gwID = zbway.GwId;
|
| | | if (this.dicGateway.ContainsKey(gwID) == false)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | this.dicGateway[gwID].GatewayOnlineFlage = zbway.GatewayOnlineFlage;
|
| | | }
|
| | | //wifi情况下,由Application自己刷新标识
|
| | | } |
| | | |
| | | /// <summary>
|
| | |
| | | foreach (var zbway in listGateway)
|
| | | {
|
| | | //是否存在网关存在于WIFI下
|
| | | if (zbway.GatewayOnlineFlage == true)
|
| | | if (this.CheckGatewayOnlineByFlage(zbway) == true)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | | private void RefreshGatewayOnlineOnRemode(List<ZbGateway> listGateway)
|
| | | {
|
| | | //获取云端上面的网关
|
| | | Dictionary<string, GatewayResult> dicDbGateway = HdlGatewayLogic.Current.GetGateWayListFromDataBase();
|
| | | Dictionary<string, GatewayResult> dicDbGateway = this.GetGateWayListFromDataBase();
|
| | | if (dicDbGateway == null)
|
| | | {
|
| | | return;
|
| | |
| | | continue;
|
| | | }
|
| | | string strId = way.GwId;
|
| | | if (dicDbGateway.ContainsKey(strId) == true) //如果云端上面有这个网关
|
| | | if (dicDbGateway.ContainsKey(strId) == true
|
| | | && dicDbGateway[strId].MqttOnlineStatus == true) //如果云端上面有这个网关
|
| | | {
|
| | | way.GatewayOnlineFlage = dicDbGateway[strId].MqttOnlineStatus;
|
| | | way.OnlineTime = DateTime.Now;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 根据某种标识判断指定网关是否在线
|
| | | /// 根据本地缓存判断指定网关是否在线
|
| | | /// </summary>
|
| | | /// <param name="zbGateway"></param>
|
| | | /// <returns></returns> |
| | | public bool CheckGatewayOnlineByFlag(ZbGateway zbGateway)
|
| | | public bool CheckGatewayOnlineByMemory(ZbGateway zbGateway)
|
| | | {
|
| | | if (zbGateway == null)
|
| | | {
|
| | |
| | | string gwID = zbGateway.GwId;
|
| | | if (this.dicGateway.ContainsKey(gwID) == true)
|
| | | {
|
| | | return this.dicGateway[gwID].GatewayOnlineFlage;
|
| | | return this.CheckGatewayOnlineByFlage(dicGateway[gwID]);
|
| | | }
|
| | |
|
| | | return zbGateway.GatewayOnlineFlage;
|
| | | return this.CheckGatewayOnlineByFlage(zbGateway);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 根据指定标识,判断网关是否在线
|
| | | /// </summary>
|
| | | /// <param name="zbGateway"></param>
|
| | | /// <returns></returns>
|
| | | private bool CheckGatewayOnlineByFlage(ZbGateway zbGateway)
|
| | | {
|
| | | if (this.nowGwConnectMode == GatewayConnectMode.Remote)
|
| | | {
|
| | | //远程每20秒检测一次
|
| | | return (DateTime.Now - zbGateway.OnlineTime).TotalSeconds <= 40;
|
| | | }
|
| | | //如果广播得到网关,则会刷新OnlineTime,如果与当前时间相差少于10秒,则判断为在线
|
| | | return (DateTime.Now - zbGateway.OnlineTime).TotalSeconds <= 15;
|
| | | } |
| | | |
| | | #endregion |
| | |
| | | {
|
| | | //获取网关版本信息
|
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 95 } };
|
| | | var result = this.SendJobjectDataToGateway(zbGateway, "GetZbGwInfo", jObject.ToString(), "GetZbGwInfo_Respon", 5, useLocalConnect);
|
| | | var result = this.SendJobjectDataToGateway(zbGateway.GwId, "GetZbGwInfo", jObject.ToString(), "GetZbGwInfo_Respon", 5, useLocalConnect);
|
| | |
|
| | | if (result.ErrorMsgDiv != 1)
|
| | | {
|
| | |
| | | localWay.GwSerialNum = data.GWSN;
|
| | | localWay.IsMainGateWay = data.IsDominant == 1 ? true : false;
|
| | | localWay.GwIP = data.GwIP;
|
| | | localWay.GwMac = data.GwMac;
|
| | | localWay.LinuxImageType = data.LinuxImageType;
|
| | | localWay.LinuxHardVersion = data.LinuxHWVersion;
|
| | | localWay.LinuxFirmwareVersion = data.LinuxFWVersion;
|
| | |
| | | localWay.CoordinatorImageId = data.ZbImageType;
|
| | | localWay.DriveCodeList = data.DriveCodeList;
|
| | | localWay.GwVersionDate = data.AppVersion;
|
| | | localWay.OnlineTime = DateTime.Now;
|
| | |
|
| | | if (saveFile == true)
|
| | | {
|
| | | localWay.ReSave();
|
| | |
| | | return localgw != null ? zbGateway.DriveCodeList : zbGateway.DriveCodeList;
|
| | | }
|
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 505 } };
|
| | | var result = this.SendJobjectDataToGateway(zbGateway, "VirtualDrive/CatDriveCode", jObject.ToString(), "VirtualDrive/CatDriveCode_Respon");
|
| | | var result = this.SendJobjectDataToGateway(zbGateway.GwId, "VirtualDrive/CatDriveCode", jObject.ToString(), "VirtualDrive/CatDriveCode_Respon");
|
| | | if (result.ErrorMsg != null)
|
| | | {
|
| | | this.ShowTipMsg(result.ErrorMsg);
|
| | |
| | | /// <param name="waitTime">超时时间(秒)</param>
|
| | | /// <param name="useLocalConnect">是否强制使用本地连接发送</param>
|
| | | /// <returns>网关返回的数据</returns>
|
| | | public ReceiptGatewayResult SendJobjectDataToGateway(ZbGateway gateway, string sendTopic, string sendData, string receiptTopic, int waitTime = 5, bool useLocalConnect = false)
|
| | | public ReceiptGatewayResult SendJobjectDataToGateway(string gatewayId, string sendTopic, string sendData, string receiptTopic, int waitTime = 5, bool useLocalConnect = false)
|
| | | {
|
| | | var reResult = new ReceiptGatewayResult();
|
| | |
|
| | | ZbGateway myGateway = null;
|
| | | if (this.GetRealGateway(ref myGateway, gateway) == false)
|
| | | {
|
| | | //获取网关对象失败
|
| | | reResult.ErrorMsg = Language.StringByID(R.MyInternationalizationString.uGetGatewayTagartFail);
|
| | | reResult.ErrorMsgDiv = -1;
|
| | | return reResult;
|
| | | }
|
| | | //网关ID
|
| | | string gatewayID = gateway.GwId;
|
| | | //错误主题
|
| | | string errorTopic = gatewayID + "/" + "Error_Respon";
|
| | | string errorTopic = gatewayId + "/" + "Error_Respon";
|
| | | //检测对象的主题
|
| | | string checkTopic = gatewayID + "/" + receiptTopic;
|
| | | string checkTopic = gatewayId + "/" + receiptTopic;
|
| | |
|
| | | Action<string, string> receiptAction = (topic, message) =>
|
| | | HdlGatewayReceiveLogic.Current.AddGatewayReceiveEvent(gatewayId, (topic, message) =>
|
| | | {
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
|
| | |
|
| | |
| | | {
|
| | | reResult.ReceiptData = jobject["Data"].ToString();
|
| | | }
|
| | | };
|
| | | myGateway.Actions += receiptAction;
|
| | | });
|
| | |
|
| | | //发送数据
|
| | | if (useLocalConnect == false)
|
| | | {
|
| | | myGateway.Send(sendTopic, sendData);
|
| | | }
|
| | | else
|
| | | {
|
| | | myGateway.SendLocation(sendTopic, System.Text.Encoding.UTF8.GetBytes(sendData));
|
| | | }
|
| | | this.SendJobjectData(gatewayId, sendTopic, sendData, useLocalConnect);
|
| | |
|
| | | //超时时间
|
| | | int TimeOut = 0;
|
| | |
| | | System.Threading.Thread.Sleep(50);
|
| | | TimeOut++;
|
| | | }
|
| | | myGateway.Actions -= receiptAction;
|
| | | receiptAction = null;
|
| | | //移除网关监听事件
|
| | | HdlGatewayReceiveLogic.Current.RemoveGatewayReceiveEvent();
|
| | |
|
| | | if (reResult.ReceiptData == null)
|
| | | {
|
| | | reResult.ErrorMsgDiv = 0;
|
| | | }
|
| | |
|
| | | return reResult;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 单纯执行发送json数据到网关
|
| | | /// </summary>
|
| | | /// <param name="i_gatewayId">网关id</param>
|
| | | /// <param name="topic">主题</param>
|
| | | /// <param name="sendData">发送的json数据</param>
|
| | | /// <param name="useLocalConnect">是否强制使用本地连接发送</param>
|
| | | public void SendJobjectData(string i_gatewayId, string topic, string sendData, bool useLocalConnect = false)
|
| | | {
|
| | | ZbGateway realWay = null;
|
| | | for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
|
| | | {
|
| | | //寻找真实物理网关对象
|
| | | if (ZbGateway.GateWayList[i].GwId == i_gatewayId)
|
| | | {
|
| | | realWay = ZbGateway.GateWayList[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | if (realWay == null)
|
| | | {
|
| | | //如果网关对象丢失了,则创建个新的
|
| | | realWay = new ZbGateway { IsVirtual = true, };
|
| | | realWay.GwId = i_gatewayId;
|
| | | realWay.HomeId = Config.Instance.HomeId;
|
| | | ZbGateway.GateWayList.Add(realWay);
|
| | | }
|
| | | if (useLocalConnect == false)
|
| | | {
|
| | | realWay.Send(topic, System.Text.Encoding.UTF8.GetBytes(sendData));
|
| | | }
|
| | | else
|
| | | {
|
| | | //强制使用本地连接
|
| | | realWay.SendLocation(topic, System.Text.Encoding.UTF8.GetBytes(sendData));
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | }
|
| | | else if (this.nowGwConnectMode == GatewayConnectMode.WIFI)
|
| | | {
|
| | | //局域网每5秒检测一次
|
| | | if (waitCount < 5) { continue; }
|
| | | //局域网每8秒检测一次
|
| | | if (waitCount < 8) { continue; }
|
| | | }
|
| | | waitCount = 0;
|
| | |
|
| | |
| | | {
|
| | | //从网关获取全部的网关
|
| | | List<ZbGateway> list = this.GetAllGatewayFromGateway();
|
| | | foreach (var way in list)
|
| | | {
|
| | | //将标识置为false
|
| | | way.GatewayOnlineFlage = false;
|
| | | }
|
| | | //等个2秒
|
| | | System.Threading.Thread.Sleep(2000);
|
| | |
|
| | | //2020.05.25追加:此住宅是否拥有网关在线
|
| | | var hadGwOnline = false;
|
| | | foreach (var way in list)
|
| | | {
|
| | | if (dicOldOnline.ContainsKey(way.GwId) == true)
|
| | | {
|
| | | if (way.GatewayOnlineFlage == true)
|
| | | if (dicOldOnline.ContainsKey(way.GwId) == true
|
| | | && this.CheckGatewayOnlineByFlage(way) == true)
|
| | | {
|
| | | //有一个网关在线,即在线
|
| | | hadGwOnline = true;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (dicOldOnline.ContainsKey(gwId) == true)
|
| | | {
|
| | | //网关也不多,直接推送吧
|
| | | this.PushGatewayOnlineStatuToForm(gwId, way.GatewayOnlineFlage, hadGwOnline);
|
| | | bool online = this.CheckGatewayOnlineByFlage(way);
|
| | | this.PushGatewayOnlineStatuToForm(gwId, online, hadGwOnline);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | private void CheckGatewayStatuByRemote(Dictionary<string, bool> dicOldOnline)
|
| | | {
|
| | | //获取云端上面的网关
|
| | | Dictionary<string, GatewayResult> dicDbGateway = HdlGatewayLogic.Current.GetGateWayListFromDataBase();
|
| | | Dictionary<string, GatewayResult> dicDbGateway = this.GetGateWayListFromDataBase();
|
| | | if (dicDbGateway == null)
|
| | | {
|
| | | //如果网络不通,则也往下走
|
| | |
| | | foreach (var zbway in this.dicGateway.Values)
|
| | | {
|
| | | //获取前回的在线状态
|
| | | dicOldOnline[zbway.GwId] = zbway.GatewayOnlineFlage;
|
| | | dicOldOnline[zbway.GwId] = this.CheckGatewayOnlineByFlage(zbway);
|
| | | }
|
| | | return dicOldOnline;
|
| | | }
|
| | |
| | | if (zbway != null)
|
| | | {
|
| | | //切换住宅时,这个东西有可能是null
|
| | | zbway.GatewayOnlineFlage = online;
|
| | | if (online == true)
|
| | | {
|
| | | zbway.OnlineTime = DateTime.Now;
|
| | | }
|
| | | UserCenterResourse.DicActionForm[formId]?.GatewayOnlinePush(zbway, online, hadGwOnline);
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 网关接收事件(参数1:主题 参数2:推送消息)
|
| | | /// </summary>
|
| | | private Action<string, string> GatewayReceiveEvent = null;
|
| | | /// <summary>
|
| | | /// 接收网关的id
|
| | | /// </summary>
|
| | | private string GatewayReceiveId = null;
|
| | | /// <summary>
|
| | | /// 设备推送事件集合
|
| | | /// </summary>
|
| | | private Dictionary<string, Action<CommonDevice>> dicDeviceEvent = new Dictionary<string, Action<CommonDevice>>();
|
| | |
| | | else if (topic == gatewayId + "/Scene/Exec_Respon")
|
| | | {
|
| | | this.SceneExecPush(null);
|
| | | }
|
| | | //网关接收事件
|
| | | else if (gatewayId == this.GatewayReceiveId)
|
| | | {
|
| | | this.GatewayReceiveEvent?.Invoke(topic, msgData);
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 添加网关接收事件(action只能存在一个,与AddAttributeEvent不共存,AddAttributeEvent优先)
|
| | | /// </summary>
|
| | | /// <param name="i_gatewayId">网关id</param>
|
| | | /// <param name="action">只能存在一个action (参数1:主题 参数2:推送消息)</param>
|
| | | public void AddGatewayReceiveEvent(string i_gatewayId, Action<string, string> action)
|
| | | {
|
| | | //添加事件
|
| | | this.GatewayReceiveEvent = action;
|
| | | this.GatewayReceiveId = i_gatewayId;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 移除设备监听_______________________
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 移除网关接收事件(只能存在一个事件)
|
| | | /// </summary>
|
| | | public void RemoveGatewayReceiveEvent()
|
| | | {
|
| | | this.GatewayReceiveEvent = null;
|
| | | this.GatewayReceiveId = null;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 一般方法___________________________
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 发送房间信息给网关_________________
|
| | |
|
| | | /// <summary>
|
| | | /// 发送房间信息给网关
|
| | | /// </summary>
|
| | | public void SetRoomInfoToGateway()
|
| | | {
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1 && UserCenterResourse.UserInfo.AuthorityNo != 2)
|
| | | {
|
| | | //不是主人和管理员,则不处理
|
| | | return;
|
| | | }
|
| | | var realMain = ZbGateway.MainGateWay;
|
| | | if (realMain == null || Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | //没有主网关,则不理
|
| | | return;
|
| | | }
|
| | | //获取房间全部的设备对象
|
| | | string strSendDeviceRoomInfo = string.Empty;
|
| | | foreach (var room in this.dicRooms.Values)
|
| | | {
|
| | | if (room.IsSharedRoom || room.IsLove)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | var listDevice = this.GetRoomListDevice(room);
|
| | | //发送给网关的设备房间json
|
| | | foreach (var device in listDevice)
|
| | | {
|
| | | if (strSendDeviceRoomInfo != string.Empty)
|
| | | {
|
| | | strSendDeviceRoomInfo += "\r\n";
|
| | | }
|
| | | strSendDeviceRoomInfo += " " + this.SetDoublMark(device.DeviceAddr) + " ";
|
| | | strSendDeviceRoomInfo += this.SetDoublMark("0x" + Convert.ToString(device.DeviceEpoint, 16).PadLeft(2, '0')) + " ";
|
| | | strSendDeviceRoomInfo += this.SetDoublMark(LocalDevice.Current.GetDeviceEpointName(device).Replace(UserCenterResourse.douMarks, string.Empty)) + " ";
|
| | | strSendDeviceRoomInfo += this.SetDoublMark(room.Id);
|
| | | }
|
| | | }
|
| | |
|
| | | var listAreaSpaceInfo = new List<AreaSpaceInfo>();
|
| | | //首先添加住宅
|
| | | var houseInfo = new AreaSpaceInfo();
|
| | | houseInfo.name = Common.Config.Instance.Home.Name;
|
| | | houseInfo.uid = Common.Config.Instance.Home.Id;
|
| | | houseInfo.parentId = "null";
|
| | | listAreaSpaceInfo.Add(houseInfo);
|
| | | //然后添加楼层
|
| | | foreach (var floorId in Common.Config.Instance.Home.FloorDics.Keys)
|
| | | {
|
| | | var floorInfo = new AreaSpaceInfo();
|
| | | floorInfo.name = Common.Config.Instance.Home.FloorDics[floorId];
|
| | | floorInfo.uid = floorId;
|
| | | floorInfo.parentId = Common.Config.Instance.Home.Id;
|
| | | listAreaSpaceInfo.Add(floorInfo);
|
| | | }
|
| | | //然后添加房间
|
| | | var listRoom = this.GetAllListRooms();
|
| | | foreach (var room in listRoom)
|
| | | {
|
| | | if (room.IsLove == true) { continue; }
|
| | |
|
| | | var roomInfo = new AreaSpaceInfo();
|
| | | roomInfo.name = room.Name;
|
| | | roomInfo.uid = room.Id;
|
| | | if (Common.Config.Instance.Home.FloorDics.ContainsKey(room.FloorId) == true)
|
| | | {
|
| | | roomInfo.parentId = room.FloorId;
|
| | | }
|
| | | else
|
| | | {
|
| | | roomInfo.parentId = Common.Config.Instance.Home.Id;
|
| | | }
|
| | | listAreaSpaceInfo.Add(roomInfo);
|
| | | }
|
| | | //然后添加网关房间信息
|
| | | var gatewayInfo = new GatewayAreaSpaceInfo();
|
| | |
|
| | | var loaclGateway = HdlGatewayLogic.Current.GetLocalGateway(realMain.GwId);
|
| | | if (loaclGateway == null || loaclGateway.GwMac == string.Empty)
|
| | | {
|
| | | //没有mac,或者找不到对象,则不上传
|
| | | return;
|
| | | }
|
| | | string gwMac = loaclGateway.GwMac.Replace(":", string.Empty);
|
| | | gatewayInfo.uid = "000101" + gwMac.Substring(2) + "07";
|
| | | gatewayInfo.name = HdlGatewayLogic.Current.GetGatewayName(loaclGateway);
|
| | |
|
| | | var roomGateway = HdlGatewayLogic.Current.GetRoomByGateway(loaclGateway);
|
| | | if (roomGateway != null)
|
| | | {
|
| | | gatewayInfo.parentId = roomGateway.Id;
|
| | | }
|
| | | gatewayInfo.hwInfo = new GatewayHwInfo();
|
| | | gatewayInfo.pkgInfo = new GatewayPkgInfo { version = loaclGateway.LinuxFirmwareVersion.ToString() };
|
| | | gatewayInfo.swInfo = new List<GatewaySwInfo> { new GatewaySwInfo { ver = loaclGateway.LinuxFirmwareVersion.ToString() } };
|
| | | gatewayInfo.ip = loaclGateway.GwIP;
|
| | | gatewayInfo.mac = loaclGateway.GwMac;
|
| | |
|
| | | var data = new { spaces = listAreaSpaceInfo, gateway = gatewayInfo };
|
| | | string strSendRoomInfo = Newtonsoft.Json.JsonConvert.SerializeObject(data);
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | //发送设备区域信息
|
| | | if (strSendDeviceRoomInfo != string.Empty)
|
| | | {
|
| | | //创建文件对象
|
| | | var result0 = await realMain.CreateFileAsync("DeviceRoomInfo.json");
|
| | | if (result0 == null || result0.Result != 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //发送数据流
|
| | | var byteData = ASCIIEncoding.UTF8.GetBytes(strSendDeviceRoomInfo);
|
| | | var result1 = await realMain.SendFileAsync(byteData);
|
| | | if (result1 == null || result1.Result != 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | //创建文件对象
|
| | | var result3 = await realMain.CreateFileAsync("space.json");
|
| | | if (result3 == null || result3.Result != 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | //发送区域信息
|
| | | var byteData2 = ASCIIEncoding.UTF8.GetBytes(strSendRoomInfo);
|
| | | var result4 = await realMain.SendFileAsync(byteData2);
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 设置双引号
|
| | | /// </summary>
|
| | | /// <param name="i_text"></param>
|
| | | /// <returns></returns>
|
| | | private string SetDoublMark(string i_text)
|
| | | {
|
| | | return UserCenterResourse.douMarks + i_text + UserCenterResourse.douMarks;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 空间区域信息
|
| | | /// </summary>
|
| | | private class AreaSpaceInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 住宅ID 或者 楼层ID 或者 房间ID
|
| | | /// </summary>
|
| | | public string uid = string.Empty;
|
| | | /// <summary>
|
| | | /// 住宅名称 或者 楼层名称 或者 房间名称
|
| | | /// </summary>
|
| | | public string name = string.Empty;
|
| | | /// <summary>
|
| | | /// 当前ID的父ID,如果没有,则为带双引号的"null" 比如 楼层ID就填住宅ID 房间ID就填楼层ID
|
| | | /// </summary>
|
| | | public string parentId = string.Empty;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 网关空间区域信息
|
| | | /// </summary>
|
| | | private class GatewayAreaSpaceInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 【000101】+绑定网关的时间戳转16进制+【07】
|
| | | /// </summary>
|
| | | public string uid = string.Empty;
|
| | | /// <summary>
|
| | | /// 这个固定
|
| | | /// </summary>
|
| | | public string name = "hdl_bus_gatway";
|
| | | /// <summary>
|
| | | /// 网关所在的房间ID
|
| | | /// </summary>
|
| | | public string parentId = string.Empty;
|
| | | /// <summary>
|
| | | /// 这个固定
|
| | | /// </summary>
|
| | | public int deviceType = 61184;
|
| | | /// <summary>
|
| | | /// 网关硬件信息
|
| | | /// </summary>
|
| | | public GatewayHwInfo hwInfo = null;
|
| | | /// <summary>
|
| | | /// 网关标准信息
|
| | | /// </summary>
|
| | | public GatewayPkgInfo pkgInfo = null;
|
| | | /// <summary>
|
| | | /// 网关固件版本
|
| | | /// </summary>
|
| | | public List<GatewaySwInfo> swInfo = null;
|
| | | /// <summary>
|
| | | /// 网关IP
|
| | | /// </summary>
|
| | | public string ip = string.Empty;
|
| | | /// <summary>
|
| | | /// 网关的Mac
|
| | | /// </summary>
|
| | | public string mac = string.Empty;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 网关硬件信息
|
| | | /// </summary>
|
| | | private class GatewayHwInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 这个固定
|
| | | /// </summary>
|
| | | public string brand = "MIPS";
|
| | | /// <summary>
|
| | | /// 这个固定
|
| | | /// </summary>
|
| | | public string model = "MT7688";
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 网关标准信息
|
| | | /// </summary>
|
| | | private class GatewayPkgInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 这个是Linux的固件版本
|
| | | /// </summary>
|
| | | public string version = string.Empty;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 网关固件版本
|
| | | /// </summary>
|
| | | private class GatewaySwInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 这个固定
|
| | | /// </summary>
|
| | | public string name = "HDL";
|
| | | /// <summary>
|
| | | /// 这个是Linux的固件版本
|
| | | /// </summary>
|
| | | public string ver = string.Empty;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 克隆房间对象_______________________
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <param name="useLocalConnect">是否强制使用本地连接发送</param>
|
| | | public bool RefreshSceneUIList(bool useLocalConnect)
|
| | | {
|
| | | if (Config.Instance.Home.TemplateMode == 2 && Config.Instance.Home.SendTemplateSuccess == false)
|
| | | {
|
| | | //如果是有模板有设备模式,但是还没有导入成功的情况下,不允许刷新场景列表
|
| | | return true;
|
| | | }
|
| | | //获取网关存在的场景
|
| | | var sceneList = this.RefreshSceneListFromGateway(useLocalConnect);
|
| | | if (sceneList == null)
|
| | |
| | | //如果当前住宅不是虚拟住宅
|
| | | if (Config.Instance.Home.IsVirtually == false)
|
| | | {
|
| | | var mainWay = ZbGateway.MainGateWay;
|
| | | if (mainWay == null) { return null; }
|
| | |
|
| | | //获取新建一个场景的命令字符
|
| | | var strCommand = this.GetAddNewSceneCommand(sceneName);
|
| | | var result = HdlGatewayLogic.Current.SendJobjectDataToGateway(ZbGateway.MainGateWay, "Scene/GetNewId", strCommand, "Scene/GetNewId_Respon");
|
| | | var result = HdlGatewayLogic.Current.SendJobjectDataToGateway(mainWay.GwId, "Scene/GetNewId", strCommand, "Scene/GetNewId_Respon");
|
| | | if (result.ErrorMsg != null)
|
| | | {
|
| | | this.ShowTipMsg(result.ErrorMsg);
|
| | |
| | | return listAdjustTarget;
|
| | | }
|
| | | var listSuccess = new List<Scene.DeviceListData>();
|
| | | var mainWay = ZbGateway.MainGateWay;
|
| | | if (mainWay == null) { return listSuccess; }
|
| | |
|
| | | //获取添加执行目标到场景的命令
|
| | | var listCommand = this.GetAddTargetToSceneCommand(sceneId, listAdjustTarget);
|
| | | for (int i = 0; i < listCommand.Count; i++)
|
| | | {
|
| | | var result = HdlGatewayLogic.Current.SendJobjectDataToGateway(ZbGateway.MainGateWay, "Scene/AddMember", listCommand[i], "Scene/AddMember_Respon");
|
| | | var result = HdlGatewayLogic.Current.SendJobjectDataToGateway(mainWay.GwId, "Scene/AddMember", listCommand[i], "Scene/AddMember_Respon");
|
| | | if (result.ErrorMsg != null || result.ErrorMsgDiv == 0)
|
| | | {
|
| | | //出现错误
|
| | |
| | | listAdjustTarget.AddRange(i_scene.AdjustTargetList);
|
| | | return listAdjustTarget;
|
| | | }
|
| | | var mainWay = ZbGateway.MainGateWay;
|
| | | if (mainWay == null) { return null; }
|
| | |
|
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 806 } };
|
| | | var data = new Newtonsoft.Json.Linq.JObject { { "ScenesId", i_scene.Id } };
|
| | | jObject.Add("Data", data);
|
| | | //发送命令
|
| | | var result = HdlGatewayLogic.Current.SendJobjectDataToGateway(ZbGateway.MainGateWay, "Scene/GetDeviceList", jObject.ToString(), "Scene/GetDeviceList_Respon");
|
| | | var result = HdlGatewayLogic.Current.SendJobjectDataToGateway(mainWay.GwId, "Scene/GetDeviceList", jObject.ToString(), "Scene/GetDeviceList_Respon");
|
| | |
|
| | | if (result.ErrorMsg != null)
|
| | | {
|
| | |
| | | string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote);
|
| | | string nameValue = Common.LocalDevice.Current.GetDeviceEpointName(deviceAc);
|
| | | var btnNote = new FrameCaptionInputControl(caption, nameValue, listview.rowSpace / 2);
|
| | | btnNote.txtInput.MaxByte = 48;//限制只能输入48个字节
|
| | | listview.AddChidren(btnNote);
|
| | | btnNote.InitControl();
|
| | | //划线
|
| | |
| | | string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote);
|
| | | string deviceName = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]);
|
| | | this.btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2);
|
| | | this.btnNote.txtInput.MaxByte = 48;//限制只能输入48个字节
|
| | | listview.AddChidren(btnNote);
|
| | | btnNote.InitControl();
|
| | | //划线
|
| | |
| | | if (isHdlDevice == true)
|
| | | {
|
| | | //如果是3路继电器或者1路调光器,并且是第七回路的时候,它好像可以改变类型
|
| | | //如果是欧标14路干接点小模块,并且是第七回路的时候,它好像可以改变类型
|
| | | //如果是7路干接点输入输出模块,并且是第七回路的时候,它好像可以改变类型
|
| | | if ((deviceEnumInfo.ConcreteType == DeviceConcreteType.Relay_ThreeLoad && nowSelectDevice.DeviceEpoint == 10)
|
| | | || (deviceEnumInfo.ConcreteType == DeviceConcreteType.DimmableLight_OneLoad && nowSelectDevice.DeviceEpoint == 7)
|
| | | || (deviceEnumInfo.ConcreteType == DeviceConcreteType.Relay_EuropeanFourteenLoadDryContact && nowSelectDevice.DeviceEpoint == 7))
|
| | | || (deviceEnumInfo.ConcreteType == DeviceConcreteType.Relay_SevenLoadInOutPutDryContact && nowSelectDevice.DeviceEpoint == 7))
|
| | | {
|
| | | //这里先去获取它的干接点类型
|
| | | this.ShowProgressBar();
|
| | |
| | | || myType.ConcreteType == DeviceConcreteType.DimmableLight_OneLoad
|
| | | || myType.ConcreteType == DeviceConcreteType.Relay_NationalThreeLoadTenA
|
| | | || myType.ConcreteType == DeviceConcreteType.Relay_EuropeanTwoLoadFiveA
|
| | | || myType.ConcreteType == DeviceConcreteType.Relay_EuropeanFourteenLoadDryContact)
|
| | | || myType.ConcreteType == DeviceConcreteType.Relay_SevenLoadInOutPutDryContact)
|
| | | {
|
| | | //背光灯
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uBackLight);
|
| | |
| | | {
|
| | | if (myType.ConcreteType == DeviceConcreteType.Relay_NationalThreeLoadTenA
|
| | | || myType.ConcreteType == DeviceConcreteType.Relay_EuropeanTwoLoadFiveA
|
| | | || myType.ConcreteType == DeviceConcreteType.Relay_EuropeanFourteenLoadDryContact)
|
| | | || myType.ConcreteType == DeviceConcreteType.Relay_SevenLoadInOutPutDryContact)
|
| | | {
|
| | | //国标3路10A继电器小模块 或者 欧标2路5A继电器小模块 或者 欧标14路干接点小模块
|
| | | //国标3路10A继电器小模块 或者 欧标2路5A继电器小模块 或者 7路干接点输入输出模块
|
| | | var form = new DeviceRelay.RelayNationalBackLightSettionForm();
|
| | | form.AddForm(deviceObj.DeviceAddr);
|
| | | }
|
| | |
| | | }
|
| | | //如果是在线的
|
| | | var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.NowSelectGatewayId);
|
| | | if (HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(nowGateway) == true)
|
| | | if (HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(nowGateway) == true)
|
| | | {
|
| | | //检测广播到的这个网关是否拥有住宅ID
|
| | | ZbGateway realWay = null;
|
| | |
| | | }
|
| | |
|
| | | //获取全部设备
|
| | | int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway, false);
|
| | | int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway.GwId, false);
|
| | | if (this.Parent == null)
|
| | | {
|
| | | return;
|
| | |
| | | {
|
| | | if (this.gatewayViewRow != null && this.gatewayViewRow.zbGatewayId == selectGwId)
|
| | | {
|
| | | bool online = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbGateway);
|
| | | bool online = HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(zbGateway);
|
| | | //刷新控件在线状态
|
| | | this.gatewayViewRow?.RefreshOnlineStatu();
|
| | | //根据网关在线状态刷新设备在线状态
|
| | |
| | | {
|
| | | btnName.Text = HdlGatewayLogic.Current.GetGatewayName(zbway);
|
| | | //在线状态
|
| | | this.isOnline = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway);
|
| | | this.isOnline = HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(zbway);
|
| | | if (this.isOnline == false)
|
| | | {
|
| | | btnName.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | |
| | | return;
|
| | | }
|
| | | //在线状态
|
| | | bool statu = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway);
|
| | | bool statu = HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(zbway);
|
| | | if (this.isOnline != statu)
|
| | | {
|
| | | this.isOnline = statu;
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | } catch (Exception ex)
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | var mess = ex.Message;
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | | //根据设备Type创建对应的设备对象
|
| | | var device = Common.LocalDevice.Current.NewDeviceObjectByDeviceId((DeviceType)jobject.Value<int>("Device_ID"));
|
| | | var device = Common.LocalDevice.Current.NewDeviceObjectByDeviceId((DeviceType)jobject.Value<int>("Device_ID"), jobject.Value<int>("Epoint"));
|
| | | if (device == null)
|
| | | {
|
| | | return;
|
| | |
| | | /// 当前网关对象
|
| | | /// </summary> |
| | | private ZbGateway zbGateway = null; |
| | | /// <summary>
|
| | | /// mini网关是否能够添加设备
|
| | | /// </summary> |
| | | private bool MiniGatewayCanAddDevice = true; |
| | | |
| | | #endregion |
| | | |
| | |
| | | //设定标题 |
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uDeviceType));
|
| | |
|
| | | this.zbGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.AppOldSelectGatewayId); |
| | | if (zbGateway != null && zbGateway.LinuxImageType == 11)
|
| | | {
|
| | | //初始化Mini网关的界面
|
| | | this.InitControlByMiniGateway();
|
| | | } |
| | | else
|
| | | {
|
| | | //初始化中部控件
|
| | | this.InitMiddleFrame();
|
| | | } |
| | | |
| | | this.zbGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.AppOldSelectGatewayId); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | var rowThrid = this.AddMenuRow(objectText, unSelectPic, string.Empty, false); |
| | | rowThrid.ButtonClickEvent += (sender, e) => |
| | | {
|
| | | if (this.MiniGatewayCanAddDevice == false)
|
| | | rowThrid.CanClick = false;
|
| | | HdlThreadLogic.Current.RunThread(() => |
| | | {
|
| | | //Mini网关最大只能添加16个设备
|
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uMiniGatewayMaxDeviceCountMsg));
|
| | | return;
|
| | | //检测网关
|
| | | var errorMsg = this.CheckGateway();
|
| | | HdlThreadLogic.Current.RunMain(() => |
| | | {
|
| | | rowThrid.CanClick = true; |
| | | if (errorMsg != null) |
| | | { |
| | | this.ShowMassage(ShowMsgType.Tip, errorMsg); |
| | | } |
| | | else |
| | | { |
| | | var form = new Device.DeviceSearchForm(); |
| | | form.AddForm(string.Empty); |
| | | } |
| | | }); |
| | | }); |
| | | }; |
| | | |
| | | //调整列表控件的高度 |
| | |
| | |
|
| | | #endregion |
| | |
|
| | | #region ■ mini网关___________________________ |
| | | #region ■ 检测网关___________________________ |
| | | |
| | | /// <summary>
|
| | | /// 初始化Mini网关的界面
|
| | | /// 检测网关(返回错误信息,null代表没问题)
|
| | | /// </summary> |
| | | private void InitControlByMiniGateway()
|
| | | private string CheckGateway()
|
| | | {
|
| | | if (zbGateway != null && zbGateway.LinuxImageType == 11) |
| | | {
|
| | | //mini夜灯只能限制加入16和设备
|
| | | this.ShowProgressBar();
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | int statu = 0;
|
| | | //重新获取设备列表
|
| | | var listDevice = Common.LocalDevice.Current.GetDeviceListFromGateway(zbGateway, ref statu, true, ShowErrorMode.NO);
|
| | | this.CloseProgressBar();
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | var listDevice = Common.LocalDevice.Current.GetDeviceListFromGateway(zbGateway.GwId, ref statu, true, ShowErrorMode.NO);
|
| | | if (statu != 1)
|
| | | {
|
| | | //如果 |
| | | listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(zbGateway.GwId);
|
| | | }
|
| | | //检测mini网关的设备数
|
| | | this.CheckMiniGatewayDeviceCount(listDevice);
|
| | | //初始化界面
|
| | | this.InitMiddleFrame();
|
| | | });
|
| | | });
|
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 检测mini网关的设备数
|
| | | /// </summary>
|
| | | /// <param name="listDevice"></param> |
| | | private void CheckMiniGatewayDeviceCount(List<CommonDevice> listDevice)
|
| | | {
|
| | | var listMac = new HashSet<string>();
|
| | | foreach (var device in listDevice)
|
| | | {
|
| | |
| | | listMac.Add(device.DeviceAddr);
|
| | | }
|
| | | }
|
| | | MiniGatewayCanAddDevice = listMac.Count < 16;
|
| | | this.CloseProgressBar(); |
| | | |
| | | bool canAdd = listMac.Count < 16;
|
| | | if (canAdd == false) |
| | | { |
| | | //Mini网关最大只能添加16个设备 |
| | | return Language.StringByID(R.MyInternationalizationString.uMiniGatewayMaxDeviceCountMsg); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | { |
| | | rowLayout.ButtonClickEvent += (sender, e) => |
| | | { |
| | | if (this.MiniGatewayCanAddDevice == false)
|
| | | rowLayout.CanClick = false;
|
| | | HdlThreadLogic.Current.RunThread(() => |
| | | {
|
| | | //Mini网关最大只能添加16个设备
|
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uMiniGatewayMaxDeviceCountMsg));
|
| | | return;
|
| | | //检测网关
|
| | | var errorMsg = this.CheckGateway();
|
| | | HdlThreadLogic.Current.RunMain(() => |
| | | {
|
| | | rowLayout.CanClick = true; |
| | | if (errorMsg != null) |
| | | { |
| | | this.ShowMassage(ShowMsgType.Tip, errorMsg); |
| | | } |
| | | else |
| | | { |
| | | //反射目标界面 |
| | | this.LoadFormByFullName("Shared.Phone.UserCenter.DeviceDirection." + formName); |
| | | } |
| | | }); |
| | | }); |
| | | }; |
| | | } |
| | | |
| | |
| | | string caption = Language.StringByID(R.MyInternationalizationString.uDeviceEpointNote);
|
| | | string nameValue = Common.LocalDevice.Current.GetDeviceEpointName(this.device);
|
| | | var btnDeviceName = new FrameCaptionInputControl(caption, nameValue, listview.rowSpace / 2);
|
| | | btnDeviceName.txtInput.MaxByte = 48;//限制只能输入48个字节
|
| | | listview.AddChidren(btnDeviceName);
|
| | | btnDeviceName.InitControl();
|
| | | btnDeviceName.AddBottomLine();
|
| | |
| | | { |
| | | devicePic.UnSelectedImagePath = "Device/SensorTemperature.png"; |
| | | btnName.Text = Language.StringByID(R.MyInternationalizationString.Temperature) + " (℃)"; |
| | | invalidText1 = btnNum.Text;
|
| | | } |
| | | else |
| | | { |
| | | line2.Visible = false; |
| | | devicePic.UnSelectedImagePath = "Device/SensorHumidity.png"; |
| | | btnName.Text = Language.StringByID(R.MyInternationalizationString.Humidity) + " (%)"; |
| | | invalidText2 = btnNum.Text;
|
| | | } |
| | | |
| | | btnNum.TextChangeEventHandler += (sender, e) =>
|
| | |
| | | //按键备注
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uPanelButtonNote);
|
| | | this.btnDeviceName = new FrameCaptionInputControl(caption, nameValue, listview.rowSpace / 2);
|
| | | btnDeviceName.txtInput.MaxByte = 48;//限制只能输入48个字节
|
| | | listview.AddChidren(btnDeviceName);
|
| | | btnDeviceName.InitControl();
|
| | | btnDeviceName.AddBottomLine();
|
| | |
| | | //按键备注
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uPanelButtonNote);
|
| | | this.btnDeviceName = new FrameCaptionInputControl(caption, nameValue, listview.rowSpace / 2);
|
| | | this.btnDeviceName.txtInput.MaxByte = 48;//限制只能输入48个字节
|
| | | listview.AddChidren(btnDeviceName);
|
| | | btnDeviceName.InitControl();
|
| | | btnDeviceName.AddBottomLine();
|
| | |
| | | }
|
| | |
|
| | | this.btnDeviceName = new FrameCaptionInputControl(caption, nameValue, listview.rowSpace / 2);
|
| | | this.btnDeviceName.txtInput.MaxByte = 48;//限制只能输入48个字节
|
| | | listview.AddChidren(btnDeviceName);
|
| | | btnDeviceName.InitControl();
|
| | | btnDeviceName.AddBottomLine();
|
| | |
| | | }
|
| | |
|
| | | this.btnDeviceName = new FrameCaptionInputControl(caption, nameValue, listview.rowSpace / 2);
|
| | | this.btnDeviceName.txtInput.MaxByte = 48;//限制只能输入48个字节
|
| | | listview.AddChidren(btnDeviceName);
|
| | | btnDeviceName.InitControl();
|
| | | btnDeviceName.AddBottomLine();
|
| | |
| | | string caption = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm); |
| | | string deviceName = Common.LocalDevice.Current.GetDeviceMacName(doorLock); |
| | | var btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2); |
| | | btnNote.txtInput.MaxByte = 48;//限制只能输入48个字节 |
| | | listview.AddChidren(btnNote); |
| | | btnNote.InitControl(); |
| | | //划线 |
| | |
| | | if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
|
| | | {
|
| | | //我觉得这里需要获取一下新网关的设备列表
|
| | | Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(way, true);
|
| | | Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(way.GwId, true);
|
| | | if (way.IsMainGateWay == true)
|
| | | {
|
| | | //如果它是主网关,则刷新场景列表
|
| | |
| | | if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
|
| | | {
|
| | | //我觉得这里需要获取一下新网关的设备列表
|
| | | Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(way, true);
|
| | | Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(way.GwId, true);
|
| | | if (way.IsMainGateWay == true)
|
| | | {
|
| | | //如果它是主网关,则刷新场景列表
|
| | |
| | | if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
|
| | | {
|
| | | //我觉得这里需要获取一下新网关的设备列表
|
| | | Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(way, true);
|
| | | Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(way.GwId, true);
|
| | | if (way.IsMainGateWay == true)
|
| | | {
|
| | | //如果它是主网关,则刷新场景列表
|
| | |
| | | if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
|
| | | {
|
| | | //我觉得这里需要获取一下新网关的设备列表
|
| | | Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(way, true);
|
| | | Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(way.GwId, true);
|
| | | if (way.IsMainGateWay == true)
|
| | | {
|
| | | //如果它是主网关,则刷新场景列表
|
| | |
| | | string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote);
|
| | | string nameValue = HdlGatewayLogic.Current.GetGatewayName(zbGateway);
|
| | | var btnNote = new FrameCaptionInputControl(caption, nameValue, listview.rowSpace / 2);
|
| | | btnNote.txtInput.MaxByte = 48;//限制只能输入48个字节
|
| | | listview.AddChidren(btnNote);
|
| | | btnNote.InitControl();
|
| | | //划线
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | bool online = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(way);
|
| | | bool online = HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(way);
|
| | | this.GatewayOnlinePush(way, online, true);
|
| | | }
|
| | | //网关新版本检测
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | if (HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(way) == false)
|
| | | if (HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(way) == false)
|
| | | {
|
| | | //不在线的不用理它
|
| | | continue;
|
| | |
| | | if (gateWayExist == true)
|
| | | {
|
| | | btnGateName = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2);
|
| | | btnGateName.txtInput.MaxByte = 48;//限制只能输入48个字节
|
| | | listview.AddChidren(btnGateName);
|
| | | btnGateName.InitControl();
|
| | | //划线
|
| | |
| | | //成功
|
| | | i_dicZbGatewayDiv[i_gateway.GwId] = 1;
|
| | | //我觉得这里需要获取一下新网关的设备列表
|
| | | Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(i_gateway, true);
|
| | | Common.LocalDevice.Current.SetDeviceToMemmoryByGateway(i_gateway.GwId, true);
|
| | | if (i_gateway.IsMainGateWay == true)
|
| | | {
|
| | | //如果它是主网关,则刷新场景列表
|
| | |
| | | bodyFrameLayout.Height = ControlCommonResourse.TopMenuFrameHeight + ControlCommonResourse.TopFrameHeight
|
| | | + ControlCommonResourse.BodyFrameHeight;
|
| | |
|
| | | var btnPic = new NormalViewControl(991, 438, true);
|
| | | var btnPic = new PicViewControl(991, 438, true);
|
| | | btnPic.UnSelectedImagePath = "Item/AutoBackup.png";
|
| | | btnPic.Y = Application.GetRealHeight(374);
|
| | | bodyFrameLayout.AddChidren(btnPic);
|
| | |
| | | bodyFrameLayout.AddChidren(btnRemind);
|
| | | btnRemind.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | HdlAutoBackupLogic.SaveBackupNotPrompted(false, 3);
|
| | | //一天之内不再提醒
|
| | | HdlAutoBackupLogic.SaveBackupNotPrompted(false, 1);
|
| | | this.CloseForm();
|
| | | };
|
| | | }
|
| | |
| | | /// </summary>
|
| | | private void UpLoadBackupInfo()
|
| | | {
|
| | | int result = HdlAutoBackupLogic.DoUpLoadAutoBackupData();
|
| | | int result = HdlAutoBackupLogic.DoUpLoadAutoBackupDataByHand();
|
| | | if (result == -1)
|
| | | {
|
| | | //文件上传失败
|
| | |
| | | {
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | int result = HdlAutoBackupLogic.DoUpLoadAutoBackupData();
|
| | | int result = HdlAutoBackupLogic.DoUpLoadAutoBackupDataByHand();
|
| | | if (result == -1)
|
| | | {
|
| | | //文件上传失败
|
| | |
| | |
|
| | | row1 = new FrameRowControl(listView.rowSpace / 2);
|
| | | listView.AddChidren(row1);
|
| | | row1.AddLeftCaption("使用旧的设备获取方式", 600);
|
| | | row1.AddBottomLine();
|
| | | var btnSwitchDeviceMethord = row1.AddMostRightSwitchIcon();
|
| | | btnSwitchDeviceMethord.IsSelected = UserCenterResourse.HideOption.UseOldSearchDeviceMethord == 1;
|
| | | btnSwitchDeviceMethord.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | btnSwitchDeviceMethord.IsSelected = !btnSwitchDeviceMethord.IsSelected;
|
| | | UserCenterResourse.HideOption.UseOldSearchDeviceMethord = btnSwitchDeviceMethord.IsSelected == true ? 1 : 0;
|
| | | };
|
| | |
|
| | | row1 = new FrameRowControl(listView.rowSpace / 2);
|
| | | listView.AddChidren(row1);
|
| | | row1.AddLeftCaption("重置导入标识", 500);
|
| | | row1.AddRightArrow();
|
| | | row1.AddBottomLine();
|
| | |
| | | btnReName.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //生成一个弹窗画面
|
| | | var dialogForm = new DialogInputControl();
|
| | | var dialogForm = new DialogInputControl(360);
|
| | | //保存模板到App
|
| | | dialogForm.SetTitleText("重命名");
|
| | | //请输入新名字
|
| | |
| | | //调整高度
|
| | | frameRow.RemoveFromParent();
|
| | | listView.AdjustRealHeight(Application.GetRealHeight(23));
|
| | |
|
| | | if (room.ListDevice.Count > 0)
|
| | | {
|
| | | //上传空间区域信息
|
| | | HdlRoomLogic.Current.SetRoomInfoToGateway();
|
| | | }
|
| | | });
|
| | | };
|
| | | }
|
| | |
| | | //删除当前楼层的话,需要去刷新主页左边的房间列表
|
| | | HdlRoomLogic.Current.RefreshRoomListView();
|
| | | }
|
| | | var uploadRoom = false;
|
| | | var listDeleteId = new List<string>();
|
| | | var listAllRoom = HdlRoomLogic.Current.GetAllListRooms();
|
| | | for (int i = 0; i < listAllRoom.Count; i++)
|
| | |
| | | if (listAllRoom[i].FloorId == keys)
|
| | | {
|
| | | listDeleteId.Add(listAllRoom[i].Id);
|
| | | }
|
| | | if (listAllRoom[i].ListDevice.Count > 0)
|
| | | {
|
| | | //需要上传空间区域
|
| | | uploadRoom = true;
|
| | | }
|
| | | }
|
| | | //删除房间
|
| | |
| | | frameRow.RemoveFromParent();
|
| | | //调整桌布高度
|
| | | this.AdjustContrlTableHeight();
|
| | | }
|
| | | if (uploadRoom == true)
|
| | | {
|
| | | //上传空间区域信息
|
| | | HdlRoomLogic.Current.SetRoomInfoToGateway();
|
| | | }
|
| | | //删除楼层的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
| | | //调整桌布高度
|
| | | this.AdjustContrlTableHeight();
|
| | | }
|
| | | if (room.ListDevice.Count > 0)
|
| | | {
|
| | | //上传空间区域信息
|
| | | HdlRoomLogic.Current.SetRoomInfoToGateway();
|
| | | }
|
| | | //删除房间的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | });
|
| | |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var searchCount = 3; |
| | | var broadBytes = new byte[44];// byteHomeId[0] ,//H |
| | | broadBytes[0] = 0xfe; |
| | | broadBytes[1] = 0x29; |
| | |
| | | } |
| | | |
| | | var broadcastIpAddress = new Shared.Net.NetWiFi().BroadcastIpAddress;
|
| | | if (Shared.Application.IsWifi)
|
| | | |
| | | //清空接收到的IP |
| | | listReceiveIP.Clear(); |
| | | if (broadcastIpAddress.ToString() != "0.0.0.0") |
| | | {
|
| | | if (0 < listReceiveIP.Count)
|
| | | //广播出去 |
| | | FindGateWaySocket.BeginSend(new System.Net.IPEndPoint(broadcastIpAddress, 7624), broadBytes); |
| | | } |
| | | //等待3秒,下面的接收方法会去接收广播 |
| | | System.Threading.Thread.Sleep(3000); |
| | | |
| | | if (listReceiveIP.Count > 0)
|
| | | {
|
| | | searchCount = 3;
|
| | | //局域网能够广播得到网关
|
| | | ZbGateway.IsRemote = false;
|
| | | //当网关的连接方式改变时,记录当前的连接方式
|
| | | Shared.Phone.UserCenter.HdlGatewayLogic.Current.CheckGatewayByConnectChanged(Shared.Phone.UserCenter.GatewayConnectMode.WIFI);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (searchCount < 0)
|
| | | {
|
| | | //局域网广播不到网关 |
| | | ZbGateway.IsRemote = true;
|
| | | //当网关的连接方式改变时,记录当前的连接方式
|
| | | Shared.Phone.UserCenter.HdlGatewayLogic.Current.CheckGatewayByConnectChanged(Shared.Phone.UserCenter.GatewayConnectMode.Remote);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ZbGateway.IsRemote = true;
|
| | | //当网关的连接方式改变时,记录当前的连接方式
|
| | | Shared.Phone.UserCenter.HdlGatewayLogic.Current.CheckGatewayByConnectChanged(Shared.Phone.UserCenter.GatewayConnectMode.Remote);
|
| | |
|
| | | for (int i = 0; i < ZbGateway.GateWayList.Count; i++) |
| | | {
|
| | | ZbGateway.GateWayList[i].DisConnectLocalMqttClient("1"); |
| | | }
|
| | | //非wifi情况下,不需要广播
|
| | | System.Threading.Thread.Sleep(1000);
|
| | | continue;
|
| | | }
|
| | | searchCount--; |
| | | |
| | | //每秒广播发现一次网关 |
| | | int count = 2; |
| | | listReceiveIP.Clear(); |
| | | while (0 < count--) |
| | | { |
| | | //点对点发送(先发一条已有的点播,回复几率高一点) |
| | | for (int i = 0; i < listReceiveIP.Count; i++)
|
| | | { |
| | | FindGateWaySocket.BeginSend(new System.Net.IPEndPoint(System.Net.IPAddress.Parse(listReceiveIP[i]), 7624), broadBytes); |
| | | } |
| | | //广播发送 |
| | | if (broadcastIpAddress.ToString() != "0.0.0.0") |
| | | { |
| | | FindGateWaySocket.BeginSend(new System.Net.IPEndPoint(broadcastIpAddress, 7624), broadBytes); |
| | | } |
| | | System.Threading.Thread.Sleep(1000); |
| | | } |
| | | } |
| | | catch { } |
| | |
| | | HomeId = homeID, |
| | | IsMainGateWay = isMainGateWay, |
| | | GwId = id, |
| | | GatewayOnlineFlage = true, |
| | | PubKey = pubKey |
| | | }; |
| | | //通讯到网关列表 |
| | |
| | | var gateWay = ZbGateway.GateWayList.Find(obj => obj.GwId == zbGateWay.GwId); |
| | | if (gateWay == null) |
| | | {
|
| | | zbGateWay.OnlineTime = DateTime.Now; |
| | | ZbGateway.GateWayList.Add(zbGateWay); |
| | | await zbGateWay.StartLocalMqtt(ipAddress); |
| | | } |
| | |
| | | { |
| | | gateWay.IsVirtual = false; |
| | | //将该网关标识为【可搜索到,即:在线】 |
| | | gateWay.GatewayOnlineFlage = true; |
| | | gateWay.OnlineTime = DateTime.Now; |
| | | if (gateWay.GwIP != ipAddress) |
| | | { |
| | | await gateWay.DisConnectLocalMqttClient("2"); |
| | |
| | | } |
| | | list.Clear(); |
| | | oldHomeID = Shared.Common.Config.Instance.HomeId; |
| | | |
| | | var tempBytes = System.Text.Encoding.UTF8.GetBytes(Shared.Common.Config.Instance.HomeId); |
| | | System.Array.Copy(tempBytes, 0, broadBytes, 7, 36 < tempBytes.Length ? 36 : tempBytes.Length); |
| | | |
| | | //住宅中已经存在的网关如果局域网不存在,需要在当前住宅中虚拟一个网关ID相同的网关 |
| | | var gateWayFileList = Global.FileListByHomeId().FindAll(obj => obj.StartsWith("Gateway_")); |
| | | foreach (var filePath in gateWayFileList) |
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | udpClient.Send(bytes, bytes.Length, iPEndPoint);
|
| | | int value = udpClient.Send(bytes, bytes.Length, iPEndPoint);
|
| | | //调试用 |
| | | if (Shared.Phone.UserCenter.UserCenterResourse.HideOption.WriteSocketReceiveDataToFile == 1) |
| | | { |
| | | Shared.Phone.UserCenter.HdlLogLogic.Current.WriteLog(3, "发送长度(BeginSendTo):" + value + " 发送内容:" + System.Text.Encoding.UTF8.GetString(bytes)); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | {
|
| | |
| | | { |
| | | #region 一堆变量 |
| | | /// <summary> |
| | | /// 判断网关是否在线的标识,APP界面会改变它的值,Application会重新刷新它的值 |
| | | /// 网关在线的时间点 |
| | | /// </summary> |
| | | public bool GatewayOnlineFlage = false; |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public DateTime OnlineTime = DateTime.Now; |
| | | /// <summary>
|
| | | /// 住宅ID |
| | | /// </summary> |
| | |
| | | ///网关序列号,该网关唯一标识 |
| | | /// </summary> |
| | | public string GwId = string.Empty; |
| | | /// <summary> |
| | | ///网关绑定网卡的mac地址 |
| | | /// </summary> |
| | | public string GwMac = string.Empty; |
| | | /// <summary> |
| | | ///网关名称 |
| | | /// </summary> |
| | |
| | | /// 虚拟驱动信息 |
| | | /// </summary> |
| | | public List<DriveCodeObj> DriveCodeList = new List<DriveCodeObj>(); |
| | | |
| | | /// <summary> |
| | | /// 虚拟网关 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public const int PleaseInputProgramName = 13611; |
| | | /// <summary> |
| | | /// 楼号 |
| | | /// 楼 |
| | | /// </summary> |
| | | public const int FloorNo = 13612; |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public const int BetweenOneAndHundred = 13613; |
| | | /// <summary> |
| | | /// 单元号 |
| | | /// 单元 |
| | | /// </summary> |
| | | public const int UnitNo = 13614; |
| | | /// <summary> |
| | | /// 户号 |
| | | /// 户 |
| | | /// </summary> |
| | | public const int HouseholdsNo = 13615; |
| | | /// <summary> |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\SafetyShortcutControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\SceneCardControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\HomeMainPageForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Forms\AddSmartSound.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Forms\SmartSoundContentForDevice.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Forms\SmartSoundContentForDeviceChange.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Forms\SmartSoundControlContentForm.cs" />
|