init
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace DTS.Common.Classes.Sensors
|
||||
{
|
||||
/// <summary>
|
||||
/// helper class for the calmode in SIFs which is actually a 3 character sequence for shunt/bridge/filter
|
||||
/// </summary>
|
||||
public class CalMode
|
||||
{
|
||||
public bool ShuntCheck { get; set; }
|
||||
|
||||
public bool FullBridge { get; set; }
|
||||
|
||||
public bool Filter { get; set; }
|
||||
|
||||
public CalMode(string value)
|
||||
{
|
||||
switch (value[0])
|
||||
{
|
||||
case 'S':
|
||||
ShuntCheck = true;
|
||||
break;
|
||||
case 'I':
|
||||
ShuntCheck = false;
|
||||
break;
|
||||
default:
|
||||
throw new NotSupportedException("TDAS::CalMode Invalid calmode position 0: " + value);
|
||||
}
|
||||
switch (value[1])
|
||||
{
|
||||
case 'D':
|
||||
FullBridge = true;
|
||||
break;
|
||||
case 'S':
|
||||
FullBridge = false;
|
||||
break;
|
||||
default:
|
||||
throw new NotSupportedException("TDAS::CalMode Invalid calmode position 1: " + value);
|
||||
}
|
||||
switch (value[2])
|
||||
{
|
||||
case 'F':
|
||||
Filter = true;
|
||||
break;
|
||||
case 'B':
|
||||
Filter = false;
|
||||
break;
|
||||
default:
|
||||
throw new NotSupportedException("TDAS::CalMode Invalid calmode position 2: " + value);
|
||||
}
|
||||
}
|
||||
public CalMode() { }
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
sb.Append(ShuntCheck ? 'S' : 'I');
|
||||
sb.Append(FullBridge ? 'D' : 'S');
|
||||
sb.Append(Filter ? 'F' : 'B');
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DTS.Common.Constant.DASSpecific
|
||||
{
|
||||
public class SLICE6DB
|
||||
{
|
||||
public const uint MaxAAFilterRateHz = 200000;
|
||||
|
||||
public const byte MIN_PROTOCOL_VER = 1;
|
||||
public const byte MIN_PROTOCOL_QUERYTEMPLOGFILE = 8;
|
||||
// 10582 Implement auto-discover and monitor DAS status.
|
||||
// firmware B0H3 first supported this according to documentation
|
||||
public const byte MIN_PROTOCOL_QUERYMACTABLE = 9;
|
||||
public const byte MIN_PROTOCOL_TILT = 14;
|
||||
public const int CLOCKSYNCPROFILE = 18;
|
||||
// minimum protocol version for PTP Domain ID per 30472
|
||||
public const int PTP_DOMAIN_ID_VER = 18;
|
||||
|
||||
public static bool IsClockSyncProfileSupported(ClockSyncProfile profile, int protocolVersion)
|
||||
{
|
||||
var result = false;
|
||||
switch (profile)
|
||||
{
|
||||
case ClockSyncProfile.None:
|
||||
result = true;
|
||||
break;
|
||||
case ClockSyncProfile.Manual:
|
||||
if (protocolVersion < CLOCKSYNCPROFILE)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
break;
|
||||
case ClockSyncProfile.Master_E2E:
|
||||
case ClockSyncProfile.Slave_E2E:
|
||||
if (protocolVersion >= CLOCKSYNCPROFILE)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
Reference in New Issue
Block a user