| | |
| | | /// </summary>
|
| | | /// <param name="panel">干接点对象</param>
|
| | | /// <returns></returns>
|
| | | public async Task<List<CommonDevice.AttributeDataObj>> GetDryContactConfigureInfo(CommonDevice device)
|
| | | public List<CommonDevice.AttributeDataObj> GetDryContactConfigureInfo(CommonDevice device)
|
| | | {
|
| | | //借用它的函数
|
| | | var panel = new Panel();
|
| | | panel.DeviceAddr = device.DeviceAddr;
|
| | | panel.DeviceEpoint = device.DeviceEpoint;
|
| | | panel.CurrentGateWayId = device.CurrentGateWayId;
|
| | |
|
| | | var result = HdlDeviceBindLogic.Current.ReadPanelConfigureInfoAsync(panel);
|
| | | panel = null;
|
| | | var result = HdlDeviceBindLogic.Current.ReadPanelConfigureInfoAsync(device);
|
| | |
|
| | | //共通错误检测
|
| | | string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
|
| | |
| | | /// </summary>
|
| | | private void SaveDryContactFunctionToLocaltion()
|
| | | {
|
| | | var file = Newtonsoft.Json.JsonConvert.SerializeObject(dicDryContactFunction);
|
| | |
|
| | | var bytes = System.Text.Encoding.UTF8.GetBytes(file);
|
| | | Common.Global.WriteFileByBytesByHomeId(DirNameResourse.DryContactFunctionFile, bytes);
|
| | | HdlFileLogic.Current.SaveFileContent(DirNameResourse.DryContactFunctionFile, dicDryContactFunction);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// </summary>
|
| | | private void LoadDryContactFunctionFromLocaltion()
|
| | | {
|
| | | if (Common.Global.IsExistsByHomeId(DirNameResourse.DryContactFunctionFile) == false)
|
| | | this.dicDryContactFunction = new Dictionary<string, DryContactFunctionInfo>();
|
| | |
|
| | | byte[] filebyte = HdlFileLogic.Current.ReadFileByteContent(DirNameResourse.DryContactFunctionFile);
|
| | | if (filebyte == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | byte[] filebyte = Common.Global.ReadFileByHomeId(DirNameResourse.DryContactFunctionFile);
|
| | | string strvalue = System.Text.Encoding.UTF8.GetString(filebyte);
|
| | | this.dicDryContactFunction = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, DryContactFunctionInfo>>(strvalue);
|
| | | }
|