コード例 #1
0
        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;
            //        }
            //    }
            //}
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: DeviceInfoServiceProxy.cs プロジェクト: wpmyj/dms
 public static RestServiceResponse Add(DeviceInfoBase deviceInfoBase)
 {
     return(new ServiceClientBase("operate-device-info").Call <RestServiceResponse <DeviceInfoBase> >(new RestServiceRequest <DeviceInfoBase>()
     {
         Body = deviceInfoBase,
         ActionName = "Add",
     }));
 }
コード例 #4
0
        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);
        }
コード例 #5
0
 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);
     }
 }
コード例 #6
0
 /// <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));
 }
コード例 #7
0
 /// <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());
 }