init
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,141 @@
|
||||
using DTS.Common.Interface.Channels;
|
||||
namespace DTS.Common.Classes.Groups.ChannelSettings
|
||||
{
|
||||
public class ChannelSettingBase : IChannelSetting
|
||||
{
|
||||
//analog parameters
|
||||
public const string RANGE = "Range";
|
||||
public const string CFC = "CFC";
|
||||
//FB 13120 Add FilterClass
|
||||
public const string FilterClass = "FilterClass";
|
||||
public const string POLARITY = "Polarity";
|
||||
public const string POSITION = "Position";
|
||||
public const string ZEROMETHOD = "ZeroMethod";
|
||||
public const string ZEROMETHODSTART = "ZeroMethodStart";
|
||||
public const string ZEROMETHODEND = "ZeroMethodEnd";
|
||||
public const string USERVALUE1 = "UserValue1";
|
||||
public const string USERVALUE2 = "UserValue2";
|
||||
public const string USERVALUE3 = "UserValue3";
|
||||
public const string INITIAL_OFFSET = "InitialOffset";
|
||||
|
||||
/// <summary>
|
||||
/// the string key for the ac coupled enabled channel setting
|
||||
/// http://manuscript.dts.local/f/cases/29760/Implement-ACCoupleEnable-for-TSR-AIR
|
||||
/// </summary>
|
||||
public const string ACCouplingEnabled = "ACCouplingEnabled";
|
||||
//depreciated parameters
|
||||
//public const string LIMIT_DURATION = "LimitDuration";
|
||||
//public const string DURATION = "Duration";
|
||||
//public const string DELAY = "Delay";
|
||||
//33415 Voltage insertion channel should be half bridge
|
||||
public const string BRIDGE_TYPE = "BridgeType";
|
||||
|
||||
//squib parameters
|
||||
public const string SQUIB_CURRENT = "SquibCurrent";
|
||||
public const string SQUIB_LIMIT_DURATION = "SquibLimitDuration";
|
||||
public const string SQUIB_DURATION = "SquibDuration";
|
||||
public const string SQUIB_DELAY = "SquibDelay";
|
||||
public const string SQMODE = "SQMode";
|
||||
|
||||
//digital out parameters
|
||||
public const string DIGITALOUT_LIMIT_DURATION = "DigitalOutLimitDuration";
|
||||
public const string DIGITALOUT_DURATION = "DigitalOutDuration";
|
||||
public const string DIGITALOUT_DELAY = "DigitalOutDelay";
|
||||
public const string OUTPUT_MODE = "OutputMode";
|
||||
|
||||
//digital in parameters
|
||||
public const string DIMODE = "DIMode";
|
||||
public const string DEFAULT_VALUE = "DefaultValue";
|
||||
public const string ACTIVE_VALUE = "ActiveValue";
|
||||
|
||||
//uart parameters 18363
|
||||
public const string BAUD_RATE = "UartBaudRate";
|
||||
public const string DATA_BITS = "UartDataBits";
|
||||
public const string STOP_BITS = "UartStopBits";
|
||||
public const string PARITY = "UartParity";
|
||||
public const string FLOW_CONTROL = "UartFlowControl";
|
||||
public const string DATA_FORMAT = "UartDataFormat";
|
||||
//streamout parameters 18363
|
||||
public const string UDP_PROFILE = "StreamOutUDPProfile";
|
||||
public const string UDP_ADDRESS = "StreamOutUDPAddress";
|
||||
public const string UDP_TIME_CHID = "StreamOutUDPTimeChannelId";
|
||||
public const string UDP_DATA_CHID = "StreamOutUDPDataChannelId";
|
||||
public const string UDP_TMNS_CONFIG = "StreamOutUDPTmNSConfig";
|
||||
public const string IRIG_TDP_INTERVAL_MS = "StreamOutIRIGTimeDataPacketIntervalMs";
|
||||
public const string TMATS_INTERVAL_MS = "StreamOutTMATSIntervalMs";
|
||||
//streamin parameters 26828
|
||||
public const string UDP_ADDRESS_IN = "StreamInUDPAddress";
|
||||
|
||||
public ChannelSettingBase(int settingType, string name, string defaultValue)
|
||||
{
|
||||
SettingTypeId = settingType;
|
||||
SettingName = name;
|
||||
DefaultValue = defaultValue;
|
||||
}
|
||||
public IChannelSetting Clone()
|
||||
{
|
||||
return new ChannelSettingBase(this);
|
||||
}
|
||||
private ChannelSettingBase(IChannelSetting setting)
|
||||
{
|
||||
ChannelId = setting.ChannelId;
|
||||
SettingTypeId = setting.SettingTypeId;
|
||||
SettingName = setting.SettingName;
|
||||
DefaultValue = setting.DefaultValue;
|
||||
Value = setting.Value;
|
||||
}
|
||||
public long ChannelId { get; set; }
|
||||
public int SettingTypeId { get; protected set; }
|
||||
public string SettingName { get; protected set; }
|
||||
public string DefaultValue { get; protected set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
public double DoubleValue
|
||||
{
|
||||
get
|
||||
{
|
||||
if (double.TryParse(Value, System.Globalization.NumberStyles.Any,
|
||||
System.Globalization.CultureInfo.InvariantCulture, out double d))
|
||||
{
|
||||
return d;
|
||||
}
|
||||
return DoubleDefaultValue;
|
||||
}
|
||||
set => Value = value.ToString(System.Globalization.CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public double DoubleDefaultValue => double.Parse(DefaultValue, System.Globalization.NumberStyles.Any,
|
||||
System.Globalization.CultureInfo.InvariantCulture);
|
||||
|
||||
public int IntValue
|
||||
{
|
||||
get
|
||||
{
|
||||
if (int.TryParse(Value, System.Globalization.NumberStyles.Any,
|
||||
System.Globalization.CultureInfo.InvariantCulture, out int d))
|
||||
{
|
||||
return d;
|
||||
}
|
||||
return IntDefaultValue;
|
||||
}
|
||||
set => Value = value.ToString(System.Globalization.CultureInfo.InvariantCulture);
|
||||
}
|
||||
public int IntDefaultValue => int.Parse(DefaultValue, System.Globalization.NumberStyles.Any,
|
||||
System.Globalization.CultureInfo.InvariantCulture);
|
||||
|
||||
public bool BoolValue
|
||||
{
|
||||
get
|
||||
{
|
||||
if (bool.TryParse(Value, out bool b))
|
||||
{
|
||||
return b;
|
||||
}
|
||||
return BoolDefaultValue;
|
||||
}
|
||||
set => Value = value.ToString(System.Globalization.CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public bool BoolDefaultValue => bool.Parse(DefaultValue);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user