using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DTS.SensorDB { /// /// this class is stolen from HLAPI I imported it hoping to steal some of the code from HLAPI /// however it's only sparsely used right now ... /// public class TSFChannelDescription { private int _version; public int Version { get { return _version; } set { _version = value; } } /// /// See HLAPI_CHANNEL_TYPE_ /// private int _type; public int Type { get { return _type; } set { _type = value; } } private TSFModuleDescription _parent; public TSFModuleDescription Parent { get { return _parent; } set { _parent = value; } } private int _source; public int Source { get { return _source; } set { _source = value; } } private ulong _crc32; public ulong CRC32 { get { return _crc32; } set { _crc32 = value; } } private bool _sensorInfoValid = false; public bool SensorInfoValid { get { return _sensorInfoValid; } set { _sensorInfoValid = value; } } private TSFInputChannelDescription _inputChannel; public TSFInputChannelDescription InputChannel { get { return _inputChannel; } set { _inputChannel = value; } } private TSFOutputChannelDescription _outputChannel; public TSFOutputChannelDescription OutputChannel { get { return _outputChannel; } set { _outputChannel = value; } } private string _userChannelNumber = ""; public string SensorUserChannelNumber { get { return _userChannelNumber; } set { _userChannelNumber = value; } } private string _sensorUserChannelDescription = ""; public string SensorUserChannelDescription { get { return _sensorUserChannelDescription; } set { _sensorUserChannelDescription = value; } } private string _sensorEID = ""; public string SensorEID { get { return _sensorEID; } set { _sensorEID = value; } } private List _sensorEIDs = new List(); public string[] SensorEIDs { get { return _sensorEIDs.ToArray(); } set { _sensorEIDs = new List(value); } } private int _numSensorEIDs; public int NumSensorEIDs { get { return _numSensorEIDs; } set { _numSensorEIDs = value; } } // Pre-cal results /// /// Is PreCalResults valid? /// private bool _preCalibrationInfoValid; public bool PreCalibrationInfoValid { get { return _preCalibrationInfoValid; } set { _preCalibrationInfoValid = value; ; } } /// /// The pre-calibration results. /// private TSFCalibrationInformation _preCalResults; public TSFCalibrationInformation PreCalResults { get { return _preCalResults; } set { _preCalResults = value; } } /// /// When a unit is powered down, /// this is our saved copy of PreCalResults. /// It's not NULL if it's valid. /// private TSFCalibrationInformation _savedPreCalResults; public TSFCalibrationInformation SavedPreCalResults { get { return _savedPreCalResults; } set { _savedPreCalResults = value; } } // Post-cal results /// /// Is PostCalResults valid? /// private bool _postCalibrationInfoValid; public bool PostCalibrationInfoValid { get { return _postCalibrationInfoValid; } set { _postCalibrationInfoValid = value; } } /// /// The post-calibration results. /// private TSFCalibrationInformation _postCalResults; public TSFCalibrationInformation PostCalResults { get { return _postCalResults; } set { _postCalResults = value; } } /// /// Is the Download* variables valid? /// private bool _downloadDataValid; public bool DownloadDataValid { get { return _downloadDataValid; } set { _downloadDataValid = value; } } /// /// The downloaded data is from this many seconds before t=0 /// private double _downloadBeginSeconds; public double DownloadBeginSeconds { get { return _downloadBeginSeconds; } set { _downloadBeginSeconds = value; } } /// /// The downloaded data is to this many seconds after t=0 /// private double _downloadEndSeconds; public double DownloadEndSeconds { get { return _downloadEndSeconds; } set { _downloadEndSeconds = value; } } /// /// How many elements in DownloadDataADC /// private int _downloadDataCount; public int DownloadDataCount { get { return _downloadDataCount; } set { _downloadDataCount = value; } } /// /// The filename where the downloaded data is stored /// private string _downloadDataFileName; public string DownloadDataFileName { get { return _downloadDataFileName; } set { _downloadDataFileName = value; } } public TSFChannelDescription() { } public TSFChannelDescription(TSFChannelDescription copy, TSFModuleDescription module) { _crc32 = copy._crc32; _downloadBeginSeconds = copy._downloadBeginSeconds; _downloadDataCount = copy._downloadDataCount; _downloadDataFileName = copy._downloadDataFileName; _downloadDataValid = copy._downloadDataValid; _downloadEndSeconds = copy._downloadEndSeconds; if (null != copy._inputChannel) { _inputChannel = new TSFInputChannelDescription(copy._inputChannel, this); } _numSensorEIDs = copy._numSensorEIDs; if (null != copy._outputChannel) { _outputChannel = new TSFOutputChannelDescription(copy._outputChannel, this); } _parent = module; _postCalibrationInfoValid = copy._postCalibrationInfoValid; if (null != copy._postCalResults) { _postCalResults = new TSFCalibrationInformation(copy._postCalResults, this); } _preCalibrationInfoValid = copy._preCalibrationInfoValid; if (null != copy._preCalResults) { _preCalResults = new TSFCalibrationInformation(copy._preCalResults, this); } if (null != copy._savedPreCalResults) { _savedPreCalResults = new TSFCalibrationInformation(copy._savedPreCalResults, this); } _sensorEID = copy._sensorEID; _sensorEIDs = new List(copy._sensorEIDs.ToArray()); _sensorInfoValid = copy._sensorInfoValid; _sensorUserChannelDescription = copy._sensorUserChannelDescription; _source = copy._source; _type = copy._type; _userChannelNumber = copy._userChannelNumber; _version = copy._version; } } }