Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MoveInLogic"/> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="mcfClient">The mcfClient.</param>
 /// <param name="addressApi">The addressApi.</param>
 /// <param name="accountApi"></param>
 /// <param name="deviceApi">The deviceApi.</param>
 /// <param name="customerLogic"></param>
 public MoveInLogic(ILogger <MoveInLogic> logger, IMcfClient mcfClient, IAddressApi addressApi, IAccountApi accountApi, IDeviceApi deviceApi, ICustomerLogic customerLogic)
 {
     _logger        = logger ?? throw new ArgumentNullException(nameof(logger));
     _mcfClient     = mcfClient ?? throw new ArgumentNullException(nameof(mcfClient));
     _addressApi    = addressApi ?? throw new ArgumentNullException(nameof(addressApi));
     _accountApi    = accountApi ?? throw new ArgumentNullException(nameof(accountApi));
     _deviceApi     = deviceApi ?? throw new ArgumentNullException(nameof(deviceApi));
     _customerLogic = customerLogic ?? throw new ArgumentNullException(nameof(customerLogic));
 }
Ejemplo n.º 2
0
        public Default()
        {
            Name         = "农业气象物联网数据同步插件";
            EnableDelete = true;

            _farmApi     = new FarmApi();
            _facilityApi = new FacilityApi();
            _deviceApi   = new DeviceApi();

            _transport = ApiTransportHelper.GetTransport();
            SyncAll();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MoveOutLogic" /> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="mcfClient">The MCF client.</param>
 /// <param name="addressApi">The address API.</param>
 /// <param name="accountApi">The device API.</param>
 /// <param name="deviceApi">The device API.</param>
 /// <param name="requestContext">The request context.</param>
 /// <exception cref="ArgumentNullException">logger
 /// or
 /// mcfClient
 /// or
 /// addressApi
 /// or
 /// deviceApi
 /// or
 /// requestContext</exception>
 public MoveOutLogic(
     ILogger <MoveInLogic> logger,
     IMcfClient mcfClient,
     IAddressApi addressApi,
     IAccountApi accountApi,
     IDeviceApi deviceApi,
     IRequestContextAdapter requestContext)
 {
     _logger         = logger ?? throw new ArgumentNullException(nameof(logger));
     _mcfClient      = mcfClient ?? throw new ArgumentNullException(nameof(mcfClient));
     _addressApi     = addressApi ?? throw new ArgumentNullException(nameof(addressApi));
     _accountApi     = accountApi ?? throw new ArgumentNullException(nameof(accountApi));
     _deviceApi      = deviceApi ?? throw new ArgumentNullException(nameof(deviceApi));
     _requestContext = requestContext ?? throw new ArgumentNullException(nameof(requestContext));
 }
Ejemplo n.º 4
0
 public DriverGenerico(IDeviceApi device) : base(device)
 {
 }
Ejemplo n.º 5
0
 protected Driver(IDeviceApi device)
 {
     this.Device = device;
 }
Ejemplo n.º 6
0
 public DevicesManager(IDeviceSearchApi api, IDeviceApi deviceApi, IModuleFactory moduleFactory)
 {
     this.api = api;
       this.deviceApi = deviceApi;
       this.moduleFactory = moduleFactory;
 }
Ejemplo n.º 7
0
 static UploadClient()
 {
     _farmApi = new FarmApi();
     _facilityApi = new FacilityApi();
     _deviceApi = new DeviceApi();
 }
Ejemplo n.º 8
0
        internal Device(Platform platform, IntPtr deviceId, IDeviceApi deviceApi)
        {
            Platform   = platform ?? throw new ArgumentNullException(nameof(platform));
            _deviceApi = deviceApi ?? throw new ArgumentNullException(nameof(deviceApi));

            Id = deviceId;
            _deviceInfoHelper = new InfoHelper <DeviceInfoParameter>(this, _deviceApi.clGetDeviceInfo);

            Name                  = _deviceInfoHelper.GetStringValue(DeviceInfoParameter.Name);
            Type                  = _deviceInfoHelper.GetValue <DeviceType>(DeviceInfoParameter.Type);
            VendorId              = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.VendorId);
            MaxComputeUnits       = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.MaxComputeUnits);
            MaxWorkItemDimensions = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.MaxWorkItemDimensions);
            MaxWorkGroupSize      = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.MaxWorkGroupSize);

            MaxWorkItemSizes = _deviceInfoHelper.GetValues <ulong>(DeviceInfoParameter.MaxWorkItemSizes);

            //TODO: Get bit width of size_t from AddressBits - property
            //From enqueueNDRangeKernel: The sizeof(size_t) for a device can be determined using CL_DEVICE_ADDRESS_BITS

            MaxClockFrequency = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.MaxClockFrequency);
            GlobalMemorySize  = _deviceInfoHelper.GetValue <ulong>(DeviceInfoParameter.GlobalMemSize);
            MaxConstantArgs   = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.MaxConstantArgs);
            AddressBits       = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.AddressBits);
            Vendor            = _deviceInfoHelper.GetStringValue(DeviceInfoParameter.Vendor);

            PreferredVectorWidthChar   = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.PreferredVectorWidthChar);
            PreferredVectorWidthDouble = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.PreferredVectorWidthDouble);
            PreferredVectorWidthFloat  = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.PreferredVectorWidthFloat);
            PreferredVectorWidthHalf   = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.PreferredVectorWidthHalf);
            PreferredVectorWidthInt    = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.PreferredVectorWidthInt);
            PreferredVectorWidthLong   = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.PreferredVectorWidthLong);
            PreferredVectorWidthShort  = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.PreferredVectorWidthShort);

            NativeVectorWidthChar   = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.NativeVectorWidthChar);
            NativeVectorWidthDouble = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.NativeVectorWidthDouble);
            NativeVectorWidthFloat  = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.NativeVectorWidthFloat);
            NativeVectorWidthHalf   = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.NativeVectorWidthHalf);
            NativeVectorWidthInt    = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.NativeVectorWidthInt);
            NativeVectorWidthLong   = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.NativeVectorWidthLong);
            NativeVectorWidthShort  = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.NativeVectorWidthShort);

            Image2DMaxHeight = _deviceInfoHelper.GetValue <ulong>(DeviceInfoParameter.Image2DMaxHeight);
            Image2DMaxWidth  = _deviceInfoHelper.GetValue <ulong>(DeviceInfoParameter.Image2DMaxWidth);
            Image3DMaxHeight = _deviceInfoHelper.GetValue <ulong>(DeviceInfoParameter.Image3DMaxHeight);
            Image3DMaxWidth  = _deviceInfoHelper.GetValue <ulong>(DeviceInfoParameter.Image3DMaxWidth);
            Image3DMaxDepth  = _deviceInfoHelper.GetValue <ulong>(DeviceInfoParameter.Image3DMaxDepth);

            MaxReadImageArgs  = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.MaxReadImageArgs);
            MaxWriteImageArgs = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.MaxWriteImageArgs);

            ImageSupport = _deviceInfoHelper.GetValue <bool>(DeviceInfoParameter.ImageSupport);
            MaxSamplers  = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.MaxSamplers);

            MaxParameterSize     = _deviceInfoHelper.GetValue <ulong>(DeviceInfoParameter.MaxParameterSize);
            MemBaseAddressAlign  = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.MemBaseAddrAlign);
            MinDataTypeAlignSize = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.MinDataTypeAlignSize);
            MaxMemAllocSize      = _deviceInfoHelper.GetValue <ulong>(DeviceInfoParameter.MaxMemAllocSize);

            GlobalMemCacheType     = _deviceInfoHelper.GetValue <CacheType>(DeviceInfoParameter.GlobalMemCacheType);
            GlobalMemCacheSize     = _deviceInfoHelper.GetValue <ulong>(DeviceInfoParameter.GlobalMemCacheSize);
            GlobalMemCacheLineSize = _deviceInfoHelper.GetValue <uint>(DeviceInfoParameter.GlobalMemCachelineSize);
            MaxConstantBufferSize  = _deviceInfoHelper.GetValue <ulong>(DeviceInfoParameter.MaxConstantBufferSize);
            LocalMemorySize        = _deviceInfoHelper.GetValue <ulong>(DeviceInfoParameter.LocalMemSize);
            LocalMemoryType        = _deviceInfoHelper.GetValue <LocalMemoryType>(DeviceInfoParameter.LocalMemType);

            ErrorCorrectionSupport   = _deviceInfoHelper.GetValue <bool>(DeviceInfoParameter.ErrorCorrectionSupport);
            ProfilingTimerResolution = _deviceInfoHelper.GetValue <ulong>(DeviceInfoParameter.ProfilingTimerResolution);
            EndianLittle             = _deviceInfoHelper.GetValue <bool>(DeviceInfoParameter.EndianLittle);
            DriverVersion            = _deviceInfoHelper.GetStringValue(DeviceInfoParameter.DriverVersion);
            OpenClCVersion           = _deviceInfoHelper.GetStringValue(DeviceInfoParameter.OpenClCVersion);
            HostUnifiedMemory        = _deviceInfoHelper.GetValue <bool>(DeviceInfoParameter.HostUnifiedMemory);
            ExecutionCapabilities    = _deviceInfoHelper.GetValue <ExecutionCapabilities>(DeviceInfoParameter.ExecutionCapabilities);
            QueueProperties          = _deviceInfoHelper.GetValue <CommandQueueProperties>(DeviceInfoParameter.QueueProperties);

            SinglePrecisionFloatConfigurations = _deviceInfoHelper.GetValue <FloatConfigurations>(DeviceInfoParameter.SingleFpConfig);

            //Is double precision supported
            if (NativeVectorWidthDouble != 0)
            {
                DoublePrecisionFloatConfigurations = _deviceInfoHelper.GetValue <FloatConfigurations>(DeviceInfoParameter.DoubleFpConfig);
            }

            //Is half precision supported
            if (NativeVectorWidthHalf != 0)
            {
                HalfPrecisionFloatConfigurations = _deviceInfoHelper.GetValue <FloatConfigurations>(DeviceInfoParameter.HalfFpConfig);
            }
        }
Ejemplo n.º 9
0
 internal SuspiciousDevice(Platform platform, IntPtr deviceId, IDeviceApi deviceApi) : base(platform, deviceId, deviceApi)
 {
 }
Ejemplo n.º 10
0
 public CafeController(IDeviceApi api, IMachineRepository repository)
 {
     _api        = api;
     _repository = repository;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="deviceAPi">The device API to use</param>
 /// <param name="authenticationData">AuthenticationConfigurationData configuration</param>
 public AuthenticationMethodProviderFromDevice(IDeviceApi deviceAPi, AuthenticationData authenticationData) : base(authenticationData)
 {
     _deviceAPi = deviceAPi;
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="authenticationData">AuthenticationConfigurationData configuration</param>
        public AuthenticationMethodProviderFromDevice(AuthenticationData authenticationData) : base(authenticationData)
        {
            RestClient restClient = RestClient.CreateFrom(authenticationData);

            _deviceAPi = new DevicesApi(restClient);
        }
Ejemplo n.º 13
0
        public Device(IDeviceApi deviceApi, IModuleFactory moduleFactory, int handle, byte version, string description)
        {
            this.deviceApi = deviceApi;
              this.moduleFactory = moduleFactory;

              Handle = handle;
              Version = version;
              Description = description;

              Active = false;

              Modules = new ObservableCollection<IModule>();
              modulesDictionary = new Dictionary<byte, IModule>();
        }