Files
DP44/DataPRO/SensorDB/TSF/TSFModuleDescription.cs
2026-04-17 14:55:32 -04:00

102 lines
4.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.SensorDB
{
/// <summary>
/// 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
/// </summary>
public class TSFModuleDescription
{
private int _version;
public int Version { get { return _version; } set { _version = value; } }
/// <summary>
/// See HLAPI_MODULE_TYPE_
/// </summary>
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; } }
/// <summary>
/// See HLAPI_MODULE_TOM_TIGGER_
/// </summary>
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<TSFChannelDescription> _hwChannelList = new List<TSFChannelDescription>();
public TSFChannelDescription[] HWChannelList { get { return _hwChannelList.ToArray(); } set { _hwChannelList = new List<TSFChannelDescription>(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<TSFChannelDescription>();
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;
}
}
}