init
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace DTS.SensorDB
|
||||
{
|
||||
/// <summary>
|
||||
/// 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 ...
|
||||
/// </summary>
|
||||
public class TSFChannelDescription
|
||||
{
|
||||
private int _version;
|
||||
public int Version { get { return _version; } set { _version = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// See HLAPI_CHANNEL_TYPE_
|
||||
/// </summary>
|
||||
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<string> _sensorEIDs = new List<string>();
|
||||
public string[] SensorEIDs { get { return _sensorEIDs.ToArray(); } set { _sensorEIDs = new List<string>(value); } }
|
||||
|
||||
private int _numSensorEIDs;
|
||||
public int NumSensorEIDs { get { return _numSensorEIDs; } set { _numSensorEIDs = value; } }
|
||||
|
||||
// Pre-cal results
|
||||
/// <summary>
|
||||
/// Is PreCalResults valid?
|
||||
/// </summary>
|
||||
private bool _preCalibrationInfoValid;
|
||||
public bool PreCalibrationInfoValid { get { return _preCalibrationInfoValid; } set { _preCalibrationInfoValid = value; ; } }
|
||||
|
||||
/// <summary>
|
||||
/// The pre-calibration results.
|
||||
/// </summary>
|
||||
private TSFCalibrationInformation _preCalResults;
|
||||
public TSFCalibrationInformation PreCalResults { get { return _preCalResults; } set { _preCalResults = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// When a unit is powered down,
|
||||
/// this is our saved copy of PreCalResults.
|
||||
/// It's not NULL if it's valid.
|
||||
/// </summary>
|
||||
private TSFCalibrationInformation _savedPreCalResults;
|
||||
public TSFCalibrationInformation SavedPreCalResults { get { return _savedPreCalResults; } set { _savedPreCalResults = value; } }
|
||||
|
||||
// Post-cal results
|
||||
/// <summary>
|
||||
/// Is PostCalResults valid?
|
||||
/// </summary>
|
||||
private bool _postCalibrationInfoValid;
|
||||
public bool PostCalibrationInfoValid { get { return _postCalibrationInfoValid; } set { _postCalibrationInfoValid = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// The post-calibration results.
|
||||
/// </summary>
|
||||
private TSFCalibrationInformation _postCalResults;
|
||||
public TSFCalibrationInformation PostCalResults { get { return _postCalResults; } set { _postCalResults = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// Is the Download* variables valid?
|
||||
/// </summary>
|
||||
private bool _downloadDataValid;
|
||||
public bool DownloadDataValid { get { return _downloadDataValid; } set { _downloadDataValid = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// The downloaded data is from this many seconds before t=0
|
||||
/// </summary>
|
||||
private double _downloadBeginSeconds;
|
||||
public double DownloadBeginSeconds { get { return _downloadBeginSeconds; } set { _downloadBeginSeconds = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// The downloaded data is to this many seconds after t=0
|
||||
/// </summary>
|
||||
private double _downloadEndSeconds;
|
||||
public double DownloadEndSeconds { get { return _downloadEndSeconds; } set { _downloadEndSeconds = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// How many elements in DownloadDataADC
|
||||
/// </summary>
|
||||
private int _downloadDataCount;
|
||||
public int DownloadDataCount { get { return _downloadDataCount; } set { _downloadDataCount = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// The filename where the downloaded data is stored
|
||||
/// </summary>
|
||||
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<string>(copy._sensorEIDs.ToArray());
|
||||
_sensorInfoValid = copy._sensorInfoValid;
|
||||
_sensorUserChannelDescription = copy._sensorUserChannelDescription;
|
||||
_source = copy._source;
|
||||
_type = copy._type;
|
||||
_userChannelNumber = copy._userChannelNumber;
|
||||
_version = copy._version;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user