| | |
| | | using System; |
| | | using Android.App; |
| | | using Android.Content; |
| | | using Android.Content.PM; |
| | | using Android.Net; |
| | | using Android.OS; |
| | | using CN.Jpush.Android.Api; |
| | |
| | | |
| | | namespace HDL_ON_Android |
| | | { |
| | | [Activity(Label = "AgreementActivity", Theme = "@style/MyTheme1")] |
| | | [Activity(Label = "AgreementActivity", Theme = "@style/MyTheme1", ScreenOrientation = ScreenOrientation.Portrait)] |
| | | public class AgreementActivity : Activity |
| | | { |
| | | protected override void OnCreate(Bundle savedInstanceState) |
| | |
| | | 520=Electric Current (A) |
| | | 521=Power (W) |
| | | 522=Refresh |
| | | 523=Delay alarm |
| | | 524=Bypass |
| | | 525=Enable |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 520=电流(A) |
| | | 521=功率(W) |
| | | 522=刷新 |
| | | 523=延时报警 |
| | | 524=停用 |
| | | 525=启用 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\btnCloseIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\btnInfoIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\HumiOnIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg1.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg2.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg3.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg4.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidResource Include="Resources\values\colors.xml" /> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202112203" android:versionName="1.4.4" package="com.hdl.onpro"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202112271" android:versionName="1.4.5" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" /> |
| | | <!-- 乐橙可视对讲需要的权限 --> |
| | | <!--<uses-permission android:name="android.permission.INTERNET" />--> |
| | |
| | | android:orientation="vertical" |
| | | android:background="#55000000"> |
| | | |
| | | <RelativeLayout |
| | | <LinearLayout |
| | | android:layout_width="280dp" |
| | | android:layout_height="417dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:orientation="vertical" |
| | | android:background="@drawable/dialog_background2"> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="25dp" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/title_tv" |
| | | android:text="@string/privacy_policy_and_service_agreement" |
| | | android:textColor="#bb000000" |
| | | android:layout_marginTop="15dp" |
| | | android:layout_marginLeft="0dp" |
| | | android:layout_marginRight="0dp" |
| | | android:layout_marginLeft="10dp" |
| | | android:layout_marginRight="10dp" |
| | | android:textSize="18sp" |
| | | android:gravity="center"/> |
| | | |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/msg_content_tv" |
| | | android:layout_marginTop="49dp" |
| | | android:layout_marginTop="10dp" |
| | | android:layout_marginLeft="16dp" |
| | | android:layout_marginRight="16dp" |
| | | android:text="@string/read_privacy_policy_and_service_agreement_tip" |
| | |
| | | android:gravity="center" |
| | | android:text="@string/login_privacy_policy" |
| | | android:textColor="#E6000000" |
| | | android:layout_marginTop="105dp" |
| | | android:layout_marginTop="10dp" |
| | | android:layout_marginLeft="16dp"/> |
| | | |
| | | <TextView |
| | |
| | | android:text="@string/login_user_service_agreement" |
| | | android:textColor="#E6000000" |
| | | android:id="@+id/service_agreement_btn" |
| | | android:layout_marginTop="140dp" |
| | | android:layout_marginTop="10dp" |
| | | android:layout_marginLeft="16dp" |
| | | android:gravity="center"/> |
| | | |
| | | <Button |
| | | android:layout_width="120dp" |
| | | android:layout_height="52dp" |
| | | android:id="@+id/disagree_btn" |
| | | android:text="@string/disagree" |
| | | android:textColor="#245ec3" |
| | | android:layout_marginLeft="16dp" |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="120dp" |
| | | android:layout_marginBottom="20dp" |
| | | android:layout_alignParentBottom="true" |
| | | android:background="@drawable/btn_disagree"/> |
| | | android:orientation="horizontal"> |
| | | |
| | | <Button |
| | | android:layout_width="120dp" |
| | | android:layout_height="52dp" |
| | | android:id="@+id/agree_btn" |
| | | android:text="@string/agree" |
| | | android:textColor="@color/color_white" |
| | | android:layout_alignParentRight="true" |
| | | android:layout_alignParentBottom="true" |
| | | android:layout_marginRight="16dp" |
| | | android:layout_marginBottom="20dp" |
| | | android:background="@drawable/btn_agree"/> |
| | | <Button |
| | | android:layout_width="120dp" |
| | | android:layout_height="52dp" |
| | | android:id="@+id/disagree_btn" |
| | | android:text="@string/disagree" |
| | | android:textColor="#245ec3" |
| | | android:layout_marginLeft="13dp" |
| | | android:layout_alignParentBottom="true" |
| | | android:background="@drawable/btn_disagree"/> |
| | | |
| | | <Button |
| | | android:layout_width="120dp" |
| | | android:layout_height="52dp" |
| | | android:id="@+id/agree_btn" |
| | | android:text="@string/agree" |
| | | android:textColor="@color/color_white" |
| | | android:layout_alignParentRight="true" |
| | | android:layout_alignParentBottom="true" |
| | | android:layout_marginLeft="14dp" |
| | | android:background="@drawable/btn_agree"/> |
| | | |
| | | </RelativeLayout> |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | </FrameLayout> |
| | | |
| | | </LinearLayout> |
| | |
| | | <string name="talk_open_failed">对讲打开失败</string> |
| | | <string name="unlock_fail">开锁失败</string> |
| | | <string name="screenshot_fail">截图失败</string> |
| | | |
| | | <string name="login_user_service_agreement">《用户服务协议》</string> |
| | | <string name="login_privacy_policy">《隐私权政策》</string> |
| | | <string name="privacy_policy_and_service_agreement">隐私权政策及服务条款</string> |
| | | <string name="read_privacy_policy_and_service_agreement_tip">为了更好的保障您的合法权益,请您阅读并同意以下协议</string> |
| | | <string name="disagree">不同意</string> |
| | | <string name="agree">同意</string> |
| | | </resources> |
| | |
| | | <string name="screenshot_fail">Fail to screenshot</string> |
| | | |
| | | |
| | | <string name="login_user_service_agreement">《用户服务协议》</string> |
| | | <string name="login_privacy_policy">《隐私权政策》</string> |
| | | <string name="privacy_policy_and_service_agreement">隐私权政策及服务条款</string> |
| | | <string name="read_privacy_policy_and_service_agreement_tip">为了更好的保障您的合法权益,请您阅读并同意以下协议</string> |
| | | <string name="disagree">不同意</string> |
| | | <string name="agree">同意</string> |
| | | <string name="login_user_service_agreement">《User service agreement》</string> |
| | | <string name="login_privacy_policy">《Privacy policy》</string> |
| | | <string name="privacy_policy_and_service_agreement">Privacy policy and terms of service</string> |
| | | <string name="read_privacy_policy_and_service_agreement_tip">In order to better protect your legitimate rights and interests, please read and agree to the following agreement</string> |
| | | <string name="disagree">Disagree</string> |
| | | <string name="agree">Agree</string> |
| | | </resources> |
| | |
| | | using System; |
| | | using System.IO; |
| | | using Android.Content; |
| | | using Shared; |
| | | using ZXing.Mobile; |
| | | |
| | |
| | | else |
| | | { |
| | | action?.Invoke(null); |
| | | Action action1 = () => { |
| | | Intent intent = new Intent(Android.Provider.Settings.ActionApplicationDetailsSettings); |
| | | intent.AddFlags(ActivityFlags.NewTask); |
| | | Android.Net.Uri uri = Android.Net.Uri.FromParts("package", Application.Activity.PackageName, null); |
| | | intent.SetData(uri); |
| | | Application.Activity.StartActivity(intent); |
| | | }; |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | new HDL_ON.UI.PublicAssmebly().TipOptionMsg(StringId.Tip, "相机访问权限已被拒绝,请前往系统设置打开相关权限。", action1); |
| | | }else |
| | | { |
| | | new HDL_ON.UI.PublicAssmebly().TipOptionMsg(StringId.Tip, "Camera access has been denied. Please go to system settings to open relevant permissions.",action1); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | |
| | | using System;
|
| | | using Android.App; |
| | | using Android.Content; |
| | | using Android.Content.PM; |
| | | using Android.Net; |
| | | using Android.OS; |
| | | using CN.Jpush.Android.Api; |
| | |
| | | |
| | | namespace HDL_ON_Android |
| | | { |
| | | [Activity(Theme = "@style/SplashTheme", MainLauncher = true, Name = "com.hdl.onpro.SplashActivity")] |
| | | [Activity(Theme = "@style/SplashTheme", MainLauncher = true, Name = "com.hdl.onpro.SplashActivity",ScreenOrientation = ScreenOrientation.Portrait) ] |
| | | [IntentFilter(new string[] { "com.hdl.onpro.SplashActivity", Intent.ActionView })] |
| | | public class SplashActivity : Activity |
| | | { |
| | |
| | | base.OnActivityResult(requestCode, resultVal, data); |
| | | } |
| | | |
| | | |
| | | protected override void OnCreate(Bundle savedInstanceState) |
| | | { |
| | | base.OnCreate(savedInstanceState); |
| | |
| | | //OverridePendingTransition(0, 0); |
| | | //initAll(); |
| | | |
| | | |
| | | |
| | | if (HDL_ON.OnAppConfig.Instance.FirstRunApp) |
| | | { |
| | | |
| | |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\btnInfoIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\HumiOnIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\SiriIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg1.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg2.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg3.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg4.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.4.302112201</string> |
| | | <string>1.4.302112271</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.4.12201</string> |
| | | <string>1.4.12271</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | 520=Electric Current (A) |
| | | 521=Power (W) |
| | | 522=Refresh |
| | | 523=Delay alarm |
| | | 524=Bypass |
| | | 525=Enable |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 520=电流(A) |
| | | 521=功率(W) |
| | | 522=刷新 |
| | | 523=延时报警 |
| | | 524=停用 |
| | | 525=启用 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | { |
| | | public static class StringId |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 启用 |
| | | /// </summary> |
| | | public const int Enable = 525; |
| | | /// <summary> |
| | | /// 停用 |
| | | /// </summary> |
| | | public const int Bypass = 524; |
| | | /// <summary> |
| | | /// 触发后延时报警 |
| | | /// </summary> |
| | | public const int DelayAlarm = 523; |
| | | /// <summary> |
| | | /// 刷新 |
| | | /// </summary> |
| | |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | foreach (var temp in functions) |
| | | foreach (var function in functions) |
| | | { |
| | | Dictionary<string, string> d1 = new Dictionary<string, string>(); |
| | | d1.Add(FunctionAttributeKey.OnOff, open ? "on" : "off"); |
| | | SendWriteCommand(temp, d1); |
| | | if (function.spk == SPK.PanelSocket) |
| | | { |
| | | if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null) |
| | | { |
| | | d1.Add("on_off_usb", function.trait_on_off.curValue.ToString()); |
| | | } |
| | | } |
| | | SendWriteCommand(function, d1); |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | }) |
| | |
| | | |
| | | if (temp != null) |
| | | { |
| | | Control_Udp.ReceiveRepeatManager(temp.id, null); |
| | | foreach (var updataSecurity in temp.objects) |
| | | { |
| | | var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid); |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public string delay ="0"; |
| | | /// <summary> |
| | | /// 报警延时 |
| | | /// </summary> |
| | | public string output_delay = "0"; |
| | | /// <summary> |
| | | /// 状态 |
| | | /// 布防:enable |
| | | /// 撒防:disable |
| | |
| | | /// </summary> |
| | | public string sid; |
| | | /// <summary> |
| | | /// Bypass设置 true:启用中、false:临时bypass中 |
| | | /// Bypass设置 false:启用中、true:临时bypass中 |
| | | /// </summary> |
| | | public string bypass; |
| | | public string bypass = "false"; |
| | | /// <summary> |
| | | /// 安防输入条件 |
| | | /// </summary> |
| | |
| | | /// 值 |
| | | /// </summary> |
| | | public string value; |
| | | /// <summary> |
| | | /// Bypass设置 true:临时bypass中、false:启用中 |
| | | /// </summary> |
| | | public bool bypass = false; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 本地不存在数据(数据可能被删了) |
| | | /// </summary> |
| | | public bool NoLocalData () |
| | | public bool LocalData () |
| | | { |
| | | var function = FunctionList.List.GetLightList().Find((obj) => obj.sid == sid); |
| | | if (function != null) |
| | |
| | | var spkList = SPK.ArmSensorSpkList(); |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk)); |
| | | } |
| | | /// <summary> |
| | | /// 安防中心支持的传感器列表 |
| | | /// </summary> |
| | | public List<Function> GetArmCenterList() |
| | | { |
| | | var spkList = new List<string>() |
| | | { |
| | | SPK.SensorPir, |
| | | SPK.SensorDoorWindow, |
| | | SPK.SensorSmoke, |
| | | SPK.SensorWater, |
| | | SPK.SensorGas, |
| | | }; |
| | | |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk)); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 可视对讲列表,当为null或size为0则不显示可视对讲icon |
| | |
| | | /// </summary> |
| | | public List<SecurityAlarm> securities = new List<SecurityAlarm>(); |
| | | |
| | | public List<SecurityAlarm> GetOrdinarySecurities() |
| | | { |
| | | var ordinarySecurities = new List<SecurityAlarm>(); |
| | | foreach (var mode in securities) |
| | | { |
| | | if (mode.type == "all_day" || mode.type == "mute") |
| | | { |
| | | continue; |
| | | } |
| | | ordinarySecurities.Add(mode); |
| | | } |
| | | return ordinarySecurities; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载功能列表 |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.4.4"; |
| | | public static string VersionString = "1.4.5"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | Button btnMsg = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(25), |
| | | Height = Application.GetRealHeight(35), |
| | | Y = btnTitle.Bottom, |
| | | Width = Application.GetRealHeight(200), |
| | | TextAlignment = TextAlignment.Center, |
| | |
| | | Button btnMsg = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(25), |
| | | Height = Application.GetRealHeight(35), |
| | | Y = btnTitle.Bottom, |
| | | Width = Application.GetRealHeight(200), |
| | | TextAlignment = TextAlignment.Center, |
| | |
| | | /// </summary> |
| | | public void LoadView(UserInfo userInfo = null) |
| | | { |
| | | #if __Android__ |
| | | OnAppConfig.Instance.isAgreePrivacyPolicy = false; |
| | | #endif |
| | | var btnIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | |
| | | }; |
| | | #endif |
| | | |
| | | #region 登录方式选择 |
| | | #region 登录方式选择 |
| | | btnPhoneLogin = new Button() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | bodyView.AddChidren(btnEmailLogin); |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 账号填写 |
| | | #region 账号填写 |
| | | accountView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | |
| | | accountView.AddChidren(btnAccountIcon); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 密码填写 |
| | | #region 密码填写 |
| | | passwordView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | |
| | | }; |
| | | passwordView.AddChidren(etPassword); |
| | | |
| | | #region 密码登录-控件加载 |
| | | #region 密码登录-控件加载 |
| | | btnVisiblePassword = new Button() |
| | | { |
| | | X = Application.GetRealWidth(223), |
| | |
| | | TextSize = 12, |
| | | }; |
| | | passwordView.AddChidren(btnForgetPassword); |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 验证码登录-控件加载 |
| | | #region 验证码登录-控件加载 |
| | | btnGetVerificationCode = new Button() |
| | | { |
| | | X = Application.GetRealWidth(219), |
| | |
| | | IsSelected = false, |
| | | }; |
| | | passwordView.AddChidren(btnGetVerificationCode); |
| | | #endregion |
| | | #endregion |
| | | |
| | | btnPasswordViewBottomLine = new Button() |
| | | { |
| | |
| | | }; |
| | | passwordView.AddChidren(btnPasswordViewBottomLine); |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 注册与快捷登录 |
| | | #region 注册与快捷登录 |
| | | btnRegister = new Button() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | |
| | | }; |
| | | bodyView.AddChidren(btnSwitchLoginMode); |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | btnLogin = new Button() |
| | | { |
| | |
| | | //楼层房间列表 |
| | | var floor1 = new SpatialInfo("FLOOR") { roomName = "F1", parentId = DB_ResidenceData.Instance.CurrentRegion.id }; |
| | | floor1.SaveRoomFile(); |
| | | #region 房间一 -- 客厅 |
| | | #region 房间一 -- 客厅 |
| | | //处理房间列表 |
| | | |
| | | var room1 = new Room() |
| | |
| | | SpatialInfo.CurrentSpatial.RoomList.Add(room4); |
| | | |
| | | |
| | | #region 客厅 |
| | | #region 功能 |
| | | #region 客厅 |
| | | #region 功能 |
| | | var lightRgb1 = new Function() |
| | | { |
| | | sid = "light1", |
| | |
| | | }, |
| | | }; |
| | | fh.SaveFunctionFile(); |
| | | #endregion |
| | | #region 场景 |
| | | #endregion |
| | | #region 场景 |
| | | var scene1 = new Scene() |
| | | { |
| | | sid = "scene1", |
| | |
| | | |
| | | }; |
| | | scene2.SaveSceneFile(); |
| | | #endregion |
| | | #endregion |
| | | #region 餐厅 |
| | | #endregion |
| | | #endregion |
| | | #region 餐厅 |
| | | var lightSwitch3 = new Function() |
| | | { |
| | | sid = "light6", |
| | |
| | | } |
| | | }; |
| | | scene4.SaveSceneFile(); |
| | | #endregion |
| | | #region 卧室 |
| | | #endregion |
| | | #region 卧室 |
| | | var ac = new Function() |
| | | { |
| | | sid = "ac1", |
| | |
| | | // collect = false, |
| | | //}; |
| | | //scene6.SaveSceneFile(); |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | var lightSwitch6 = new Function() |
| | |
| | | }; |
| | | lightSwitch6.SaveFunctionFile(); |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | var fileList = Common.FileUtlis.Files.ReadFiles(); |
| | | foreach(var file in fileList) |
| | |
| | | LoadEventList(); |
| | | account = etAccount.Text.Trim(); |
| | | |
| | | #if DEBUG1211 |
| | | #if DEBUG1211 |
| | | //本地模式 |
| | | Button btnLocalMode = new Button() |
| | | { |
| | |
| | | |
| | | MainPage.Log("etAccount.TextAlignment : " + etAccount.TextAlignment.ToString()); |
| | | |
| | | #endif |
| | | #endif |
| | | |
| | | #region 隐私政策 |
| | | #region 隐私政策 |
| | | AddServiceAgreementControl(bodyView); |
| | | #endregion |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | #region ■ 服务协议___________________________ |
| | | #region ■ 服务协议___________________________ |
| | | bool isAgreePrivacyPolicy = false; |
| | | /// <summary> |
| | | /// 添加服务协议控件 |
| | |
| | | return true; |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | //}); |
| | | |
| | | |
| | | FunctionList.List.Functions.Add(new Function() |
| | | { |
| | | spk = SPK.HvacAirFreshJinmao, |
| | | name = "测试金茂新风", |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | new FunctionAttributes(){ key = "mode",curValue= "humidification",state = "humidification" ,value = new List<string>(){ "humidification", "fan" } }, |
| | | new FunctionAttributes(){ key = "energy",curValue= "true",state = "true" ,value = new List<string>(){ "true", "false" } }, |
| | | new FunctionAttributes(){ key = "fan",curValue= "level_1",state = "level_1" ,value = new List<string>(){ "level_1", "level_2", "level_3","auto" } }, |
| | | new FunctionAttributes(){ key = "humidity",curValue= "0",state = "0" ,value = new List<string>(){ },min = 0,max = 100 }, |
| | | new FunctionAttributes(){ key = "indoor_temp",curValue= "26",state = "26" ,value = new List<string>(){ },min = 0,max = 100 }, |
| | | new FunctionAttributes(){ key = "indoor_humidity",curValue= "0",state = "0" ,value = new List<string>(){ },min = 0,max = 100 }, |
| | | new FunctionAttributes(){ key = "filter_remain",curValue= "0",state = "0" ,value = new List<string>(){ },min = 0,max = 100 }, |
| | | new FunctionAttributes(){ key = "filter_timeout",curValue= "false",state = "false" ,value = new List<string>(){ "true", "false" }}, |
| | | }, |
| | | }); |
| | | //FunctionList.List.Functions.Add(new Function() |
| | | //{ |
| | | // spk = SPK.HvacAirFreshJinmao, |
| | | // name = "测试金茂新风", |
| | | // attributes = new List<FunctionAttributes>() |
| | | // { |
| | | // new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | // new FunctionAttributes(){ key = "mode",curValue= "humidification",state = "humidification" ,value = new List<string>(){ "humidification", "fan" } }, |
| | | // new FunctionAttributes(){ key = "energy",curValue= "true",state = "true" ,value = new List<string>(){ "true", "false" } }, |
| | | // new FunctionAttributes(){ key = "fan",curValue= "level_1",state = "level_1" ,value = new List<string>(){ "level_1", "level_2", "level_3","auto" } }, |
| | | // new FunctionAttributes(){ key = "humidity",curValue= "0",state = "0" ,value = new List<string>(){ },min = 0,max = 100 }, |
| | | // new FunctionAttributes(){ key = "indoor_temp",curValue= "26",state = "26" ,value = new List<string>(){ },min = 0,max = 100 }, |
| | | // new FunctionAttributes(){ key = "indoor_humidity",curValue= "0",state = "0" ,value = new List<string>(){ },min = 0,max = 100 }, |
| | | // new FunctionAttributes(){ key = "filter_remain",curValue= "0",state = "0" ,value = new List<string>(){ },min = 0,max = 100 }, |
| | | // new FunctionAttributes(){ key = "filter_timeout",curValue= "false",state = "false" ,value = new List<string>(){ "true", "false" }}, |
| | | // }, |
| | | //}); |
| | | |
| | | //FunctionList.List.Functions.Add(new Function() |
| | | //{ |
| | |
| | | d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime)); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else if (function.spk == SPK.PanelSocket) |
| | | { |
| | | if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null) |
| | | { |
| | | d.Add("on_off_usb", function.trait_on_off.curValue.ToString()); |
| | | } |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | d.Add("on_off", function.trait_on_off.curValue.ToString()); |
| | |
| | | }; |
| | | arcBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | temp = arcBar.Progress; |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | btnTemp.Text = arcBar.Progress.ToString(); |
| | | controlTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | |
| | | SecurityAlarm securityAlarm; |
| | | Action refreshAction; |
| | | |
| | | /// <summary> |
| | | /// 安防输出-临时 |
| | | /// </summary> |
| | | List<SecurityOutput> tempOutput = new List<SecurityOutput>(); |
| | | /// <summary> |
| | | /// 安防输入-临时 |
| | | /// </summary> |
| | | List<SecurityInput> tempInput = new List<SecurityInput>(); |
| | | |
| | | |
| | | |
| | | public AddAlarmDeploymentPage(SecurityAlarm alarm, Action action) |
| | | { |
| | |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedTitle); |
| | | btnDelayedTitle.Text += ":"; |
| | | btnDelayedTitle.Width = btnDelayedTitle.GetTextWidth()+Application.GetRealWidth(10); |
| | | btnDelayedTitle.Width = btnDelayedTitle.GetTextWidth() + Application.GetRealWidth(10); |
| | | |
| | | var btnDelayedText = new Button() |
| | | { |
| | |
| | | else |
| | | { |
| | | new TopViewDiv(bodyView, title).LoadTopView(); |
| | | securityAlarm.status = "enable"; |
| | | } |
| | | |
| | | //布防功能 |
| | |
| | | tip.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (securityAlarm.output.Count == 0) |
| | | { |
| | | var tipText = "请选择告警目标"; |
| | | if(Language.CurrentLanguage !="Chinese") |
| | | { |
| | | tipText = "Please select the alarm target"; |
| | | } |
| | | var tip = new Tip() |
| | | { |
| | | Text = tipText, |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | //if (securityAlarm.output.Count == 0) |
| | | //{ |
| | | // var tipText = "请选择告警目标"; |
| | | // if(Language.CurrentLanguage !="Chinese") |
| | | // { |
| | | // tipText = "Please select the alarm target"; |
| | | // } |
| | | // var tip = new Tip() |
| | | // { |
| | | // Text = tipText, |
| | | // CloseTime = 3, |
| | | // Direction = AMPopTipDirection.None |
| | | // }; |
| | | // tip.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | |
| | | { |
| | | if (target.GetFunction() != null) |
| | | { |
| | | inputTargetView.AddChidren(new InputRow(target.GetFunction().name, target.GetFunction().GetRoomListName(), target.StateText())); |
| | | inputTargetView.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | var inputView = new InputRow(target); |
| | | inputTargetView.AddChidren(inputView); |
| | | inputView.InitView(); |
| | | EventHandler<MouseEventArgs> eventHandler = (sener, e) => { |
| | | securityAlarm.input.Remove(target); |
| | | iniInputTargetView(); |
| | | }; |
| | | inputView.SetDelClickeEvent(eventHandler); |
| | | inputTargetView.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | } |
| | | count++; |
| | | } |
| | |
| | | }; |
| | | contentView.AddChidren(outputTargetView); |
| | | |
| | | outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count); |
| | | iniAlarmListView(); |
| | | |
| | | #endregion |
| | |
| | | private void iniAlarmListView() |
| | | { |
| | | outputTargetView.RemoveAll(); |
| | | |
| | | if (securityAlarm.output.Count > 0) |
| | | { |
| | | |
| | | if (securityAlarm.type == "all_day" || securityAlarm.type == "mute") |
| | | { } |
| | | else |
| | | { |
| | | |
| | | #region 告警延时 |
| | | var delayedRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | outputTargetView.AddChidren(delayedRow); |
| | | |
| | | var btnDelayedTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(72), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.DelayAlarm, |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedTitle); |
| | | btnDelayedTitle.Text += ":"; |
| | | btnDelayedTitle.Width = btnDelayedTitle.GetTextWidth() + Application.GetRealWidth(10); |
| | | |
| | | var btnDelayedText = new Button() |
| | | { |
| | | X = btnDelayedTitle.Right, |
| | | Width = Application.GetRealWidth(330), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = securityAlarm.output_delay + "s" |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedText); |
| | | btnDelayedText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Action<string> action = (obj) => |
| | | { |
| | | securityAlarm.output_delay = obj; |
| | | btnDelayedText.Text = securityAlarm.output_delay + "s"; |
| | | }; |
| | | new PublicAssmebly().SetSceneDelayDialog(action, securityAlarm.output_delay); |
| | | }; |
| | | |
| | | var btnDelayedRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedRight); |
| | | |
| | | |
| | | delayedRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | #endregion |
| | | } |
| | | |
| | | |
| | | foreach (var outTarget in securityAlarm.output) |
| | | { |
| | | if (outTarget.NoLocalData()) |
| | | if (outTarget.LocalData()) |
| | | { |
| | | var outputRow = new OutputRow(outTarget.name, outTarget.RoomName, outTarget); |
| | | var outputRow = new OutputRow( outTarget); |
| | | outputTargetView.AddChidren(outputRow); |
| | | outputRow.InitView(outTarget.name, outTarget.RoomName); |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | var delTemp = securityAlarm.output.Find((obj) => obj.sid == outTarget.sid); |
| | | if(delTemp!=null) |
| | |
| | | outputRow.RemoveFromParent(); |
| | | outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count); |
| | | }; |
| | | outputTargetView.AddChidren(outputRow); |
| | | outputRow.SetDelClickeEvent(eventHandler); |
| | | } |
| | | outputTargetView.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | } |
| | | outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count); |
| | | outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count + 50); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | Button btnSubTitle; |
| | | |
| | | public InputRow(string title, string subtitle,string state) |
| | | Button btnDel; |
| | | |
| | | Button btnBypass; |
| | | |
| | | SecurityInput input; |
| | | |
| | | public InputRow(SecurityInput input) |
| | | { |
| | | this.LineColor = 0x00000000; |
| | | this.Height = Application.GetRealHeight(65); |
| | | this.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | this.input = input; |
| | | } |
| | | |
| | | public void InitView( )//(, , ); |
| | | { |
| | | btnTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Height = Application.GetRealHeight(44), |
| | | Width = Application.GetRealWidth(320), |
| | | Text = title, |
| | | Text = input.GetFunction().name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | |
| | | Y = Application.GetRealHeight(24), |
| | | Height = Application.GetRealHeight(44), |
| | | Width = Application.GetRealWidth(320), |
| | | Text = subtitle, |
| | | Text = input.GetFunction().GetRoomListName(), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = state |
| | | Text = input.StateText() |
| | | }; |
| | | this.AddChidren(btnState); |
| | | |
| | | btnBypass = new Button() |
| | | { |
| | | BackgroundColor = CSS_Color.WarningColor, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextID = StringId.Bypass, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | this.AddRightView(btnBypass); |
| | | btnBypass.MouseUpEventHandler = (sender, e) => { |
| | | if (input.bypass == "true") |
| | | { |
| | | input.bypass = "false"; |
| | | btnBypass.BackgroundColor = CSS_Color.WarningColor; |
| | | btnBypass.TextID = StringId.Bypass; |
| | | } |
| | | else |
| | | { |
| | | input.bypass = "true"; |
| | | btnBypass.BackgroundColor = CSS_Color.MainColor; |
| | | btnBypass.TextID = StringId.Enable; |
| | | } |
| | | }; |
| | | if (input.bypass == "true") |
| | | { |
| | | btnBypass.BackgroundColor = CSS_Color.MainColor; |
| | | btnBypass.TextID = StringId.Enable; |
| | | } |
| | | |
| | | btnDel = new Button() |
| | | { |
| | | BackgroundColor = CSS_Color.TextualColor, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextID = StringId.Del, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | this.AddRightView(btnDel); |
| | | |
| | | } |
| | | |
| | |
| | | this.MouseUpEventHandler = eventHandler; |
| | | btnTitle.MouseUpEventHandler = eventHandler; |
| | | btnSubTitle.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | public void SetDelClickeEvent(EventHandler<MouseEventArgs> eventHandler) |
| | | { |
| | | btnDel.MouseUpEventHandler = eventHandler; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | SecurityOutput output; |
| | | |
| | | public OutputRow(string title, string subtitle, SecurityOutput inOutput) |
| | | public OutputRow(SecurityOutput inOutput) |
| | | { |
| | | output = inOutput; |
| | | |
| | | this.LineColor = 0x00000000; |
| | | this.Height = Application.GetRealHeight(65); |
| | | this.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | } |
| | | |
| | | public void InitView(string title, string subtitle ) |
| | | { |
| | | |
| | | btnTitle = new Button() |
| | | { |
| | |
| | | { |
| | | BackgroundColor = CSS_Color.WarningColor, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.Del, |
| | | }; |
| | | this.AddRightView(btnDel); |
| | | |
| | | } |
| | | |
| | | public void SetDelClick(EventHandler<MouseEventArgs> eventHandler) |
| | | { |
| | | btnDel.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | |
| | | public void SetClickEvent(EventHandler<MouseEventArgs> eventHandler) |
| | | { |
| | | btnState.MouseUpEventHandler = eventHandler; |
| | |
| | | btnSubTitle.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | |
| | | public void SetDelClickeEvent(EventHandler<MouseEventArgs> eventHandler) |
| | | { |
| | | btnDel.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | |
| | | private void ShowStateDialog() |
| | |
| | | btnFloor.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | string nowSelectId = null; |
| | | var list = FunctionList.List.GetArmSensorList(); |
| | | var list = FunctionList.List.GetArmCenterList(); |
| | | |
| | | #if DEBUG |
| | | list.AddRange(FunctionList.List.GetLightList()); |
| | |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | |
| | | var listAllFun = FunctionList.List.GetArmSensorList(); |
| | | var listAllFun = FunctionList.List.GetArmCenterList(); |
| | | #if DEBUG |
| | | listAllFun.AddRange(FunctionList.List.GetLightList()); |
| | | #endif |
| | |
| | | if (functions == null) |
| | | { |
| | | //初始值 |
| | | functions = FunctionList.List.GetArmSensorList(); |
| | | functions = FunctionList.List.GetArmCenterList(); |
| | | } |
| | | |
| | | |
| | |
| | | inValue = "alarm"; |
| | | break; |
| | | case SPK.SensorDoorWindow: |
| | | case SPK.SensorDryContact: |
| | | case SPK.SensorDryContact2: |
| | | inKey = "contact_status"; |
| | | inValue = "open"; |
| | | break; |
| | |
| | | addDefensePage.LoadPage(Language.StringByID(StringId.BurglarAlarm)); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | disasterAlarmView.SetClick(disasterAlarmViewClick); |
| | | burglarAlarmView.SetClick(burglarAlarmViewClick); |
| | | fixedDeploymentTypeView.AddChidren(burglarAlarmView); |
| | | #endregion |
| | | |
| | |
| | | armDiyViewList.Clear(); |
| | | foreach (var mode in FunctionList.List.securities) |
| | | { |
| | | if(mode.type== "all_day"|| mode.type == "mute") |
| | | { |
| | | continue; |
| | | } |
| | | var armDiyView = new ArmDiyView("FunctionIcon/ArmCenter/AtHomeDefenseIcon.png", "FunctionIcon/ArmCenter/AtHomeDefenseIconOn.png", |
| | | mode.name,mode.sid); |
| | | customDeploymentView.AddChidren(armDiyView); |
| | |
| | | armDiyViewList.Add(armDiyView); |
| | | } |
| | | |
| | | if (FunctionList.List.securities.Count < 4) |
| | | if (FunctionList.List.GetOrdinarySecurities().Count < 4) |
| | | { |
| | | var view = new ArmDiyView("FunctionIcon/ArmCenter/AddDefenseIcon.png", "FunctionIcon/ArmCenter/AddDefenseIcon.png", |
| | | Language.StringByID(StringId.Custom),"customSid"); |
| | |
| | | TextID = StringId.Cancel, |
| | | TextColor = CSS_Color.WarningColor, |
| | | IsBold = true, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | contentView.AddChidren(btnCancel); |
| | | |
| | |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | if(updataTemp.type == "all_day"|| updataTemp.type == "mute") |
| | | { |
| | | return; |
| | | } |
| | | bodyView.refreshAction?.Invoke(); |
| | | |
| | | //布防 |
| | |
| | | else |
| | | { |
| | | //撤防 |
| | | if(bodyView.InDefenseMode.sid == updataTemp.sid) |
| | | if (bodyView.InDefenseMode.sid == updataTemp.sid) |
| | | { |
| | | bodyView.InDefenseMode.status = updataTemp.status; |
| | | foreach (var tempView in bodyView.armDiyViewList) |
| | | { |
| | | tempView.LightingView(false); |
| | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | //Control.Send(CommandType_A.write, this.function); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", function.trait_on_off.curValue.ToString()); |
| | | if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null) { |
| | | d.Add("on_off_usb", function.trait_on_off.curValue.ToString()); |
| | | } |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | //Control.Send(CommandType_A.write, this.function); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", function.trait_on_off.curValue.ToString()); |
| | | if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null) |
| | | { |
| | | d.Add("on_off_usb", function.trait_on_off.curValue.ToString()); |
| | | } |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | |
| | | #region 选择数据日期范围 |
| | | var showDataTypeView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(183), |
| | | X = Application.GetRealWidth(136), |
| | | Y = Application.GetRealHeight(12), |
| | | Width = Application.GetRealWidth(144), |
| | | Width = Application.GetRealWidth(144+47), |
| | | Height = Application.GetRealHeight(24), |
| | | BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png", |
| | | BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png", |
| | | }; |
| | | diagramView.AddChidren(showDataTypeView); |
| | | |
| | |
| | | TextColor = CSS_Color.PromptingColor2, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = Language.StringByID(StringId.month),//DateTime.Now.Month.ToString() + |
| | | Text = Language.StringByID(StringId.month) |
| | | }; |
| | | showDataTypeView.AddChidren(btnShowHistroyData_Month); |
| | | |
| | | var btnShowHistroyData_Year = new Button() |
| | | { |
| | | X = Application.GetRealWidth(48 * 3), |
| | | Width = Application.GetRealWidth(48), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.PromptingColor2, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = Language.StringByID(StringId.Years), |
| | | }; |
| | | showDataTypeView.AddChidren(btnShowHistroyData_Year); |
| | | |
| | | |
| | | btnShowHistroyData_Day.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png"; |
| | | showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png"; |
| | | btnShowHistroyData_Day.IsSelected = true; |
| | | btnShowHistroyData_Month.IsSelected = false; |
| | | btnShowHistroyData_Week.IsSelected = false; |
| | | btnShowHistroyData_Year.IsSelected = false; |
| | | curQueryType = "hour"; |
| | | brokenLine.YvalueText = ""; |
| | | LoadMothed_GetHistoryData(); |
| | | LoadMothed_GetHistoryData(); |
| | | }; |
| | | |
| | | btnShowHistroyData_Week.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg2.png"; |
| | | showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg2.png"; |
| | | btnShowHistroyData_Day.IsSelected = false; |
| | | btnShowHistroyData_Month.IsSelected = false; |
| | | btnShowHistroyData_Week.IsSelected = true; |
| | | btnShowHistroyData_Year.IsSelected = false; |
| | | curQueryType = "week"; |
| | | brokenLine.YvalueText = ""; |
| | | LoadMothed_GetHistoryData(); |
| | | LoadMothed_GetHistoryData(); |
| | | }; |
| | | btnShowHistroyData_Month.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg3.png"; |
| | | showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg3.png"; |
| | | btnShowHistroyData_Day.IsSelected = false; |
| | | btnShowHistroyData_Month.IsSelected = true; |
| | | btnShowHistroyData_Week.IsSelected = false; |
| | | btnShowHistroyData_Year.IsSelected = false; |
| | | curQueryType = "month"; |
| | | brokenLine.YvalueText = ""; |
| | | LoadMothed_GetHistoryData(); |
| | | LoadMothed_GetHistoryData(); |
| | | }; |
| | | |
| | | btnShowHistroyData_Year.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg4.png"; |
| | | btnShowHistroyData_Day.IsSelected = false; |
| | | btnShowHistroyData_Month.IsSelected = false; |
| | | btnShowHistroyData_Year.IsSelected = true; |
| | | btnShowHistroyData_Week.IsSelected = false; |
| | | curQueryType = "year_month"; |
| | | brokenLine.YvalueText = ""; |
| | | LoadMothed_GetHistoryData(); |
| | | }; |
| | | |
| | | #endregion |