public void DownloadExecute() { List <DeviceInfo8003> list = TheLoop.GetDevices <DeviceInfo8003>(); List <DeviceInfoBase> baseList = new List <DeviceInfoBase>(); foreach (var item in list) { DeviceInfoBase baseItem = (DeviceInfoBase)item; baseList.Add(baseItem); } ProjectManager.GetInstance.NTConnection.SetDeviceSetup(baseList, TheLoop.DeviceAmount, TheLoop.Controller.Type); //InvokeControllerCom iCC = InvokeControllerCom.Instance; //if (iCC.GetPortStatus()) //{ // if (iCC.TheControllerType != null) //如果已经取得当前的控制器类型 // { // if (iCC.TheControllerType.ControllerType == ControllerType.FT8003) //如果控制器类型不相符,则不执行操作 // { // List<LoopModel> lstLoopsModel = new List<LoopModel>(); // lstLoopsModel.Add(TheLoop); // ((ControllerType8003)iCC.TheControllerType).Loops = lstLoopsModel; // iCC.TheControllerType.OperableDataType = OperantDataType.Device; // iCC.TheControllerType.Status = ControllerStatus.DataSending; // iCC.TheControllerType.UpdateProgressBarEvent += UpdateProcessBarStatus; // } // } //} }
private DeviceInfoBase GenerateDeviceInfo(ReportRequest rRequest) { if (rRequest.ExecuteType == ReportExecuteType.Export) { var di = new DeviceInfoBase { Toolbar = false }; return(di); } HtmlDeviceInfo deviceInfo = new HtmlDeviceInfo(); deviceInfo.HTMLFragment = false; if (rRequest.PageIndex < 1) { rRequest.PageIndex = 1; } deviceInfo.Section = rRequest.PageIndex; deviceInfo.Toolbar = false; if (!string.IsNullOrEmpty(rRequest.FindString)) { deviceInfo.FindString = rRequest.FindString; deviceInfo.Toolbar = null; } if (!string.IsNullOrEmpty(this.ReportSettings.UserAgent)) { deviceInfo.UserAgent = this.ReportSettings.UserAgent; } //deviceInfo.ExpandContent = true; // deviceInfo.ToggleItems = true; //deviceInfo.MeasureItems = true; //deviceInfo.StylePrefixId return(deviceInfo); }
public static RestServiceResponse Add(DeviceInfoBase deviceInfoBase) { return(new ServiceClientBase("operate-device-info").Call <RestServiceResponse <DeviceInfoBase> >(new RestServiceRequest <DeviceInfoBase>() { Body = deviceInfoBase, ActionName = "Add", })); }
public void DownloadExecute() { List <DeviceInfo8053> list = TheLoop.GetDevices <DeviceInfo8053>(); List <DeviceInfoBase> baseList = new List <DeviceInfoBase>(); foreach (var item in list) { DeviceInfoBase baseItem = (DeviceInfoBase)item; baseList.Add(baseItem); } ProjectManager.GetInstance.NTConnection.SetDeviceSetup(baseList, TheLoop.DeviceAmount, TheLoop.Controller.Type); }
public string EditDevice(DeviceInfoBase device) { try { var result = RestProxy.DeviceInfoServiceProxy.Edit(device); if (!result.HasError) { return("修改成功"); } else { return("修改失败" + result.Errors[0].ErrorMessage); } } catch (System.Exception ex) { throw new System.Exception(ex.Message); } }
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary> /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param> /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> public static void BindService(grpc::ServiceBinderBase serviceBinder, DeviceInfoBase serviceImpl) { serviceBinder.AddMethod(__Method_GetDeviceInfo, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Google.Protobuf.WellKnownTypes.Empty, global::Deviceinfo.DeviceInfoResponse>(serviceImpl.GetDeviceInfo)); serviceBinder.AddMethod(__Method_SetDeviceBindingStatus, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Deviceinfo.SetBindingStatusRequest, global::Deviceinfo.SetBindingStatusResponse>(serviceImpl.SetDeviceBindingStatus)); }
/// <summary>Creates service definition that can be registered with a server</summary> /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> public static grpc::ServerServiceDefinition BindService(DeviceInfoBase serviceImpl) { return(grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_GetDeviceInfo, serviceImpl.GetDeviceInfo) .AddMethod(__Method_SetDeviceBindingStatus, serviceImpl.SetDeviceBindingStatus).Build()); }