using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DTS.SensorDB { /// /// stolen from HLAPI in the hope of bringing in some of the HLAPI code, however is very, very sparsely used /// we may want to remove these HLAPI derived classes soon /// public class TSFModuleDescription { private int _version; public int Version { get { return _version; } set { _version = value; } } /// /// See HLAPI_MODULE_TYPE_ /// private int _type; public int Type { get { return _type; } set { _type = value; } } private TSFRackDescription _parent; public TSFRackDescription Parent { get { return _parent; } set { _parent = value; } } private int _source; public int Source { get { return _source; } set { _source = value; } } private int _slot; public int Slot { get { return _slot; } set { _slot = value; } } private ulong _crc32; public ulong CRC32 { get { return _crc32; } set { _crc32 = value; } } private bool _hardwareInfoValid; public bool HardwareInfoValid { get { return _hardwareInfoValid; } set { _hardwareInfoValid = value; } } private string _hwSerialNumber; public string HWSerialNumber { get { return _hwSerialNumber; } set { _hwSerialNumber = value; } } /// /// See HLAPI_MODULE_TOM_TIGGER_ /// private int _hwTOMTriggerType; public int HWTOMTriggerType { get { return _hwTOMTriggerType; } set { _hwTOMTriggerType = value; } } private int _hwRackPosition; public int HWRackPosition { get { return _hwRackPosition; } set { _hwRackPosition = value; } } private int _hwChannelCount; public int HWChannelCount { get { return _hwChannelCount; } set { _hwChannelCount = value; } } private List _hwChannelList = new List(); public TSFChannelDescription[] HWChannelList { get { return _hwChannelList.ToArray(); } set { _hwChannelList = new List(value); } } //The following values are valid after TestTrigger and DownloadData private bool _downloadDescriptionValid; public bool DownloadDescriptionValid { get { return _downloadDescriptionValid; } set { _downloadDescriptionValid = value; } } private bool _downloadTriggerDetected; public bool DownloadTriggerDetected { get { return _downloadTriggerDetected; } set { _downloadTriggerDetected = value; } } //The following fields are used for the download process private char _downloadDataFlag; public char DownloadDataFlag { get { return _downloadDataFlag; } set { _downloadDataFlag = value; } } private double _downloadBeginSeconds; public double DownloadBeginSeconds { get { return _downloadBeginSeconds; } set { _downloadBeginSeconds = value; } } private double _downloadEndSeconds; public double DownloadEndSeconds { get { return _downloadEndSeconds; } set { _downloadEndSeconds = value; } } private double _moduleBatteryVolts; public double ModuleBatteryVolts { get { return _moduleBatteryVolts; } set { _moduleBatteryVolts = value; } } public TSFModuleDescription() { } public TSFModuleDescription(TSFModuleDescription copy, TSFRackDescription rack) { _crc32 = copy._crc32; _downloadBeginSeconds = copy._downloadBeginSeconds; _downloadDataFlag = copy._downloadDataFlag; _downloadDescriptionValid = copy._downloadDescriptionValid; _downloadEndSeconds = copy._downloadEndSeconds; _downloadTriggerDetected = copy._downloadTriggerDetected; _hardwareInfoValid = copy._hardwareInfoValid; _hwChannelCount = copy._hwChannelCount; _hwChannelList = new List(); foreach (var ch in copy._hwChannelList) { _hwChannelList.Add(new TSFChannelDescription(ch, this)); } _hwRackPosition = copy._hwRackPosition; _hwSerialNumber = copy._hwSerialNumber; _hwTOMTriggerType = copy._hwTOMTriggerType; _moduleBatteryVolts = copy._moduleBatteryVolts; _parent = rack; _slot = copy._slot; _source = copy._source; _type = copy._type; _version = copy._version; } } }