| | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 添加毫米波步骤1界面 |
| | | /// 添加环境传感器步骤1界面 |
| | | /// </summary> |
| | | public class AddSensorEnvironmentPage : EditorCommonForm |
| | | { |
| | |
| | | /// </summary> |
| | | public Action<Function> AddDeviceEvent = null; |
| | | |
| | | IntegratedBrandDevice integratedDevice = null; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 初始化_____________________________ |
| | |
| | | /// </summary> |
| | | public void ShowForm(IntegratedBrandDevice device) |
| | | { |
| | | integratedDevice = device; |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | //设置头部信息 |
| | |
| | | var btnPic = new PicViewControl(132, 132); |
| | | btnPic.Y = Application.GetRealHeight(69); |
| | | btnPic.Gravity = Gravity.CenterHorizontal; |
| | | btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/EnvironmentalSensorbg.png"; |
| | | if (integratedDevice.spk == SPK.SensorEnvironment3) |
| | | { |
| | | btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/EnvirSensorQingpingLitebg.png"; |
| | | } |
| | | else if (integratedDevice.spk == SPK.SensorEnvironment2) |
| | | { |
| | | btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/EnvirSensorQingpingCGS1bg.png"; |
| | | } |
| | | else |
| | | { |
| | | btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/EnvironmentalSensorbg.png"; |
| | | } |
| | | bodyFrameLayout.AddChidren(btnPic); |
| | | |
| | | //请输入设备机上的sn码 |
| | |
| | | }; |
| | | textView.AddChidren(editText); |
| | | |
| | | Button btnScan = new Button() |
| | | if (integratedDevice.spk == SPK.SensorEnvironment2 || integratedDevice.spk == SPK.SensorEnvironment3) |
| | | { |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | Gravity = Gravity.CenterVertical, |
| | | X = Application.GetRealWidth(275), |
| | | UnSelectedImagePath = "Public/Scan.png" |
| | | }; |
| | | textView.AddChidren(btnScan); |
| | | btnScan.MouseUpEventHandler = (sender, e) => |
| | | editText.PlaceholderText = Language.StringByID(StringId.PlsEntryMacCode); |
| | | } |
| | | if (integratedDevice.spk == SPK.SensorEnvironment) |
| | | { |
| | | Scan.OpenScan((scanString) => |
| | | Button btnScan = new Button() |
| | | { |
| | | editText.Text = scanString; |
| | | }); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | Gravity = Gravity.CenterVertical, |
| | | X = Application.GetRealWidth(275), |
| | | UnSelectedImagePath = "Public/Scan.png" |
| | | }; |
| | | textView.AddChidren(btnScan); |
| | | btnScan.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Scan.OpenScan((scanString) => |
| | | { |
| | | editText.Text = scanString; |
| | | }); |
| | | }; |
| | | } |
| | | //下一步 |
| | | var btnNext = this.AddBottomClickButton(Language.StringByID(StringId.Next)); |
| | | btnNext.ButtonClickEvent += (sender, e) => |
| | |
| | | try |
| | | { |
| | | var pm = new HttpServerRequest(); |
| | | var pack = pm.IndependentRegister3TyDevcie(SPK.SensorEnvironment, snCode, Language.StringByID(StringId.SensorEnvironment)); |
| | | var pack = pm.IndependentRegister3TyDevcie(integratedDevice.spk, snCode, Language.StringByID(StringId.SensorEnvironment)); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | //var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrandDevice>>(pack.Data.ToString()); |