81 lines
2.7 KiB
C#
81 lines
2.7 KiB
C#
using DTS.Common.Enums;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace DTS.SensorDB
|
|
{
|
|
/// <summary>
|
|
/// an entry in TOM Digital Channels portion of TOM Channel Information section
|
|
/// each entry can contain
|
|
/// rack,module,chan,type,delay,durationON,duration
|
|
/// These are Output Channels
|
|
/// </summary>
|
|
public class TSFTOMDigitalOutputChannel : TSFChannel
|
|
{
|
|
private int _rack;
|
|
public int Rack { get { return _rack; } set { _rack = value; } }
|
|
|
|
private int _module;
|
|
public int Module { get { return _module; } set { _module = value; } }
|
|
|
|
private int _chan;
|
|
public int Chan { get { return _chan; } set { _chan = value; } }
|
|
|
|
public enum DigitalOutputTypes
|
|
{
|
|
NONE = 0,
|
|
FiveVLH = 1,
|
|
FiveVHL = 2,
|
|
CCNO = 3,
|
|
CCNC = 4
|
|
}
|
|
|
|
public static DigitalOutputModes GetDigitalOutputMode(DigitalOutputTypes outputType)
|
|
{
|
|
switch (outputType)
|
|
{
|
|
case TSFTOMDigitalOutputChannel.DigitalOutputTypes.CCNC:
|
|
return DigitalOutputModes.CCNC;
|
|
case TSFTOMDigitalOutputChannel.DigitalOutputTypes.CCNO:
|
|
return DigitalOutputModes.CCNO;
|
|
case TSFTOMDigitalOutputChannel.DigitalOutputTypes.FiveVHL:
|
|
return DigitalOutputModes.FVHL;
|
|
case TSFTOMDigitalOutputChannel.DigitalOutputTypes.FiveVLH:
|
|
return DigitalOutputModes.FVLH;
|
|
case TSFTOMDigitalOutputChannel.DigitalOutputTypes.NONE:
|
|
default:
|
|
return DigitalOutputModes.NONE;
|
|
}
|
|
}
|
|
|
|
|
|
private DigitalOutputTypes _type = DigitalOutputTypes.NONE;
|
|
public DigitalOutputTypes Type { get { return _type; } set { _type = value; } }
|
|
|
|
private double _delay;
|
|
public double Delay { get { return _delay; } set { _delay = value; } }
|
|
|
|
private bool _DurationOn;
|
|
public bool DurationOn { get { return _DurationOn; } set { _DurationOn = value; } }
|
|
|
|
private double _duration;
|
|
public double Duration { get { return _duration; } set { _duration = value; } }
|
|
|
|
private string _description = "N/A";
|
|
public string Description { get { return _description; } set { _description = value; } }
|
|
|
|
public enum Fields
|
|
{
|
|
rack, //%i
|
|
module, //%i
|
|
chan, //%i
|
|
type, //%i
|
|
delay, //%f
|
|
durationON, //%i
|
|
duration //%f
|
|
}
|
|
}
|
|
}
|