Esempio n. 1
0
        public async Task <MTConnectDevicesType> ProbeAsync(string deciceId, CancellationToken cancellationToken = default(CancellationToken))
        {
            var adapterClient = new MTConnectAdapter(this.baseUrl)
            {
                DeviceName = deciceId
            };

            return(await Run <MTConnectDevicesType>(adapterClient.ProbeDeviceAsync, cancellationToken));
        }
Esempio n. 2
0
        public async Task <MTConnectStreamsType> CurrentAsync(string deviceId = "", string path = "", int?interval = null, int?at = null,
                                                              CancellationToken cancellationToken = default(CancellationToken))
        {
            var adapterClient = new MTConnectAdapter(this.baseUrl)
            {
                DeviceName = deviceId == string.Empty ? null : deviceId,
                Path       = path == string.Empty ? null : path,
                Interval   = interval,
                At         = at
            };

            if (deviceId == string.Empty)
            {
                return(await Run <MTConnectStreamsType>(adapterClient.CurrentAsync, cancellationToken));
            }
            return(await Run <MTConnectStreamsType>(adapterClient.DeviceCurrentAsync, cancellationToken));
        }
Esempio n. 3
0
        public async Task <MTConnectStreamsType> SampleAsync(string deviceId  = "", string path = "", int? @from = null, int?count = null, int?interval = null,
                                                             int?nextSequence = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            var adapterClient = new MTConnectAdapter(this.baseUrl)
            {
                DeviceName   = deviceId == string.Empty ? null : deviceId,
                Path         = path == string.Empty ? null : path,
                FromProperty = @from,
                Count        = count,
                Interval     = interval,
                NextSequence = nextSequence
            };

            if (deviceId == string.Empty)
            {
                return(await Run <MTConnectStreamsType>(adapterClient.SampleAsync, cancellationToken));
            }
            return(await Run <MTConnectStreamsType>(adapterClient.DeviceSampleAsync, cancellationToken));
        }
Esempio n. 4
0
 public void initialize()
 {
     stream  = new MemoryStream(2048);
     adapter = new MTConnectAdapterTests();
 }