public override void SetDevice(FADevice aDevice) { if (aDevice is FAMemoryBaseDevice) Device = aDevice as FAMemoryBaseDevice; else throw new Exception("Device Type is not correct."); }
private void AddIOInfo(FAMemoryBaseDevice device, int deviceIndexValue) { foreach (var item in device.GetInputIOInfoList().Values) { int index = deviceIndexValue + item.Index; _combinedInputIOList.Add(index, new CombinedIOInfo(device, item.Index)); FAIOInfo ioInfo = device.GetInputIOInfo(item.Index); InputIOInfoList.Add(index, new FAIOInfo(ioInfo.Name, index, ioInfo.Description)); } foreach (var item in device.GetOutputIOInfoList().Values) { int index = deviceIndexValue + item.Index; _combinedOutputIOList.Add(deviceIndexValue + item.Index, new CombinedIOInfo(device, item.Index)); FAIOInfo ioInfo = device.GetOutputIOInfo(item.Index); OutputIOInfoList.Add(index, new FAIOInfo(ioInfo.Name, index, ioInfo.Description)); } }
public CombinedIOInfo(FAMemoryBaseDevice device, int index) { Device = device; Index = index; }
private int GetMaxIndex(FAMemoryBaseDevice device) { int max = 0; bool first = false; foreach (var info in device.GetInputIOInfoList()) { if (first == false) { first = true; max = info.Value.Index; } else { if (max < info.Value.Index) max = info.Value.Index; } } return max; }
public FAPartOutputIOInfo(FAMemoryBaseDevice aDevice, string aName, int aIndex, string aDescription) { Device = aDevice; Name = aName; Index = aIndex; Description = aDescription; }
public FAPartInputIOInfo(FAMemoryBaseDevice aDevice, string aName, int aIndex, string aDescription) : base(aDevice, aName, aIndex, aDescription) { }