当前位置: 首页>>代码示例>>C#>>正文


C# Device.GetType方法代码示例

本文整理汇总了C#中Device.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Device.GetType方法的具体用法?C# Device.GetType怎么用?C# Device.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Device的用法示例。


在下文中一共展示了Device.GetType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetDevice

 public override void SetDevice(Device.FADevice aDevice)
 {
     if (aDevice is FADeviceAutonicsTZHeater)
         Device = aDevice as FADeviceAutonicsTZHeater;
     else
         throw new Exception("Device Type is not correct." + " Device Name : " + Name + " Device Type : " + aDevice.GetType().ToString());
 }
开发者ID:vesteksoftware,项目名称:Onyang_CL_CSharp_VT5081,代码行数:7,代码来源:FAAutonicsTZHeater.cs

示例2: SetDevice

 public override void SetDevice(Device.FADevice aDevice)
 {
     if (aDevice is FACommonSerialPortDevice)
         Device = aDevice as FACommonSerialPortDevice;
     else
         throw new Exception("Device Type is not correct." + " Device Name : " + Name + " Device Type : " + aDevice.GetType().ToString());
 }
开发者ID:vesteksoftware,项目名称:Onyang_3L_CSharp_VT5080,代码行数:7,代码来源:FACommonSerialPortPart.cs

示例3: SetDevice

 public override void SetDevice(Device.FADevice aDevice)
 {
     if (aDevice is FADeviceIndicator)
         _device = aDevice as FADeviceIndicator;
     else
         throw new Exception("Device Type is not correct." + " Device Name : " + Name + " Device Type : " + aDevice.GetType().ToString());
 }
开发者ID:vesteksoftware,项目名称:FALibrary,代码行数:7,代码来源:FAPartSingleFloatingIndicator.cs

示例4: SetDevice

 public override void SetDevice(Device.FADevice aDevice)
 {
     if (aDevice is Device.AbstractDevice.FADeviceDisplayUnit)
         _device = aDevice as Device.AbstractDevice.FADeviceDisplayUnit;
     else
         throw new Exception("Device Type is not correct." + " Device Name : " + Name + " Device Type : " + aDevice.GetType().ToString());
 }
开发者ID:vesteksoftware,项目名称:FALibrary,代码行数:7,代码来源:FAPartDisplayUnit.cs

示例5: Start

        public void Start()
        {
            var device = new Device();
            device.GetType().GetField("deviceName", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(device, _name);

            device.OnDeviceDiscovered += (sender, eventArgs) =>
            {
                Console.WriteLine($"Discovered: {eventArgs.Discovered} C:{device.IsConnected};R:{device.IsRunning}");
                // Enable Giroscope
                device.SetSensorsConf((byte)GyroscopeAxis.XYZ);
            };

            device.OnMotiStat += (sender, e) => Console.WriteLine("OnMotiStat");
            device.OnSensorsDataAvailable += (sender, e) =>
            {
                _sensorEvents.OnNext(new MoovEvent
                {
                    Gyroscope = new Vector3((float)e.GyroscopeX, (float)e.GyroscopeY, (float)e.GyroscopeZ),
                    Accelerometer = new Vector3((float)e.AccelerationX, (float)e.AccelerationY, (float)e.AccelerationZ)
                });
            };
            device.OnKeyEvent += (sender, e) =>
            {
                //Tracer.Trace($"Key: {eventArgs.KeyState}");
                _keys.OnNext(e);
            };

            device.Discover();
        }
开发者ID:chaliy,项目名称:moov-the-sphero,代码行数:29,代码来源:MoovManager.cs

示例6: SetDevice

 public override void SetDevice(Device.FADevice aDevice)
 {
     if (aDevice is FAHoneywellScannerDevice)
     {
         Device = aDevice as FAHoneywellScannerDevice;
         Device.OnReadData += OnReadData;
     }
     else
         throw new Exception("Device Type is not correct." + " Device Name : " + Name + " Device Type : " + aDevice.GetType().ToString());
 }
开发者ID:vesteksoftware,项目名称:FALibrary,代码行数:10,代码来源:FAHoneywellHandScannerPart.cs

示例7: SetDevice

 public override void SetDevice(Device.FADevice aDevice)
 {
     if (aDevice is FAECCommunicationDevice)
     {
         Device = aDevice as FAECCommunicationDevice;
         Device.OnRead += Read;
         Device.OnWrite += Write;
     }
     else
         throw new Exception("Device Type is not correct." + " Device Name : " + Name + " Device Type : " + aDevice.GetType().ToString());
 }
开发者ID:vesteksoftware,项目名称:Onyang_CL_CSharp_VT5081,代码行数:11,代码来源:FAECPart.cs

示例8: SetDevice

        public override void SetDevice(Device.FADevice aDevice)
        {
            if (aDevice is FALibrary.Device.Cognex.FADeviceCognexInsightController)
                Device = aDevice as FALibrary.Device.Cognex.FADeviceCognexInsightController;
            else
                throw new Exception("Device Type is not correct." + " Device Name : " + Name + " Device Type : " + aDevice.GetType().ToString());
            
            Device.ReceiveDataDelegate =
                delegate(string data)
                {
                    OnReceiveData(this, new FAGenericEventArgs<string>(data));
                    
                    var splitData = data.Split('\n');
                    string result = string.Empty;
                    if (splitData.Length > 0)
                        result = splitData[0].Trim();

                    if (result == "1")
                        CommandSendResult = true;
                    else
                        CommandSendResult = false;

                    if (splitData.Length > 1)
                        CommandResultMessage = splitData[1].Trim();
                };
        }
开发者ID:vesteksoftware,项目名称:FALibrary,代码行数:26,代码来源:FACognexInsightControlPart.cs

示例9: SetDevice

 public override void SetDevice(Device.FADevice aDevice)
 {
     if (aDevice is FASimaxDevice)
     {
         Device = aDevice as FASimaxDevice;
         Device.ReceivedData += ReceivedData;
     }
     else
         throw new Exception("Device Type is not correct." + " Device Name : " + Name + " Device Type : " + aDevice.GetType().ToString());
 }
开发者ID:vesteksoftware,项目名称:Onyang_CL_CSharp_VT5081,代码行数:10,代码来源:FASimaxPart.cs

示例10: SetDevice

 public override void SetDevice(Device.FADevice aDevice)
 {
     if (aDevice is FADeviceFH1050VisionController)
     {
         Device = aDevice as FADeviceFH1050VisionController;
         Device.OnRead += OnReadEventHandler;
     }
     else
         throw new Exception("Device Type is not correct." + " Device Name : " + Name + " Device Type : " + aDevice.GetType().ToString());
 }
开发者ID:vesteksoftware,项目名称:FALibrary,代码行数:10,代码来源:FAOmronFZVisionController.cs

示例11: SetDevice

 public override void SetDevice(Device.FADevice aDevice)
 {
     if (aDevice is FAAsyncServerSocketDevice)
     {
         Device = aDevice as FAAsyncServerSocketDevice;
         Device.OnRead += Read;
     }
     else
         throw new Exception("Device Type is not correct." + " Device Name : " + Name + " Device Type : " + aDevice.GetType().ToString());
 }
开发者ID:vesteksoftware,项目名称:FALibrary,代码行数:10,代码来源:FACommonAsyncServerPart.cs

示例12: AssertAndroidDevice

		public void AssertAndroidDevice(Device device)
		{
			Assert.IsTrue(device is AndroidDevice, device.GetType() + " - " + device.Name);
			Assert.IsNotEmpty(device.Name);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:5,代码来源:AndroidDeviceFinderTests.cs

示例13: OnDisconnect

        private void OnDisconnect(Device source)
        {
            source.Disconnected -= OnDisconnect;
            _devices.TryRemove(source.Name, out source);

            string deviceType = source.GetType().Name;
            if (deviceType == "Webcam")
                _view.RemovedWebcam = source.Name;
            else
                _view.RemovedClient = source.Name;

            _view.Status = string.Format("{0} {1} has disconnected", deviceType, source.Name);
            source.Dispose();
        }
开发者ID:eaglezhao,项目名称:tracnghiemweb,代码行数:14,代码来源:DevicePresenter.cs

示例14: ComposeCommandAndSendToControllerForDevice

 public void ComposeCommandAndSendToControllerForDevice(Device device, Slide prevSlide, Slide currentSlide)
 {
     if (!device.Type.IsHardware || device.Type.UID <= 0) return;
     IModule module;
     if (!_mappingList.TryGetValue(device.GetType(), out module)) return;
     try
     {
         foreach (CommandDescriptor commandDescriptor in module.ServerModule.GetCommand(prevSlide, currentSlide, _freezedEquipment.GetFreezedEquipment()))
         {
             DoEquipmentCommand(commandDescriptor);
         }
     }
     catch (Exception ex)
     {
         _config.EventLog.WriteWarning(string.Format("ShowService.ComposeCommandAndSendToControllerForDevice\n {0}", ex));
     }
 }
开发者ID:AlexSneg,项目名称:VIRD-1.0,代码行数:17,代码来源:ShowService.cs

示例15: SetDevice

 public override void SetDevice(Device.FADevice aDevice)
 {
     if (aDevice is FADeviceZebraPrinter)
     {
         Device = aDevice as FADeviceZebraPrinter;
         Device.OnWrite += Write;
     }
     else
         throw new Exception("Device Type is not correct." + " Device Name : " + Name + " Device Type : " + aDevice.GetType().ToString());
 }
开发者ID:vesteksoftware,项目名称:Onyang_3L_CSharp_VT5080,代码行数:10,代码来源:FAPrintronix5000TRPart.cs


注:本文中的Device.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。