コード例 #1
0
 public override void SetDevice(FADevice aDevice)
 {
     if (aDevice is FAMemoryBaseDevice)
         Device = aDevice as FAMemoryBaseDevice;
     else
         throw new Exception("Device Type is not correct.");
 }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
 public CombinedIOInfo(FAMemoryBaseDevice device, int index)
 {
     Device = device;
     Index = index;
 }
コード例 #4
0
        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;
        }
コード例 #5
0
 public FAPartOutputIOInfo(FAMemoryBaseDevice aDevice, string aName, int aIndex, string aDescription)
 {
     Device = aDevice;
     Name = aName;
     Index = aIndex;
     Description = aDescription;
 }
コード例 #6
0
 public FAPartInputIOInfo(FAMemoryBaseDevice aDevice, string aName, int aIndex, string aDescription)
     : base(aDevice, aName, aIndex, aDescription)
 {
 }