本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}
示例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();
}
示例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());
}
示例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());
}
示例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();
};
}
示例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());
}
示例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());
}
示例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());
}
示例12: AssertAndroidDevice
public void AssertAndroidDevice(Device device)
{
Assert.IsTrue(device is AndroidDevice, device.GetType() + " - " + device.Name);
Assert.IsNotEmpty(device.Name);
}
示例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();
}
示例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));
}
}
示例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());
}