init
This commit is contained in:
@@ -0,0 +1,263 @@
|
||||
using DTS.Common.Enums.Hardware;
|
||||
using DTS.Common.Enums.Sensors;
|
||||
using DTS.Common.Interface.DASFactory.ARM;
|
||||
using DTS.Common.Interface.DASFactory.Config;
|
||||
using DTS.Common.Interface.DASFactory.Diagnostics;
|
||||
using DTS.Common.Interface.DASFactory.Download;
|
||||
using System;
|
||||
using static DTS.Common.Enums.DASFactory.DFConstantsAndEnums;
|
||||
|
||||
namespace DTS.Common.Interface.DASFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface to a DAS unit. The IDASCommunication interface for a DAS unit is the most used
|
||||
/// data structure in the API. Nearly all services performed on the hardware will take a List
|
||||
/// of these interfaces (representing a List of hardware units) as a parameter. Each DAS unit in
|
||||
/// the real world will have an IDASCommunication interface in the API. In the case of Configuration, for
|
||||
/// example, the local IDASCommunication corresponding to the hardware configuration target is edited, then
|
||||
/// ConfigurationService.SetConfiguration(...) is called which basically synchronizes the local IDASCommunication
|
||||
/// with the hardware, and vice versa with GetConfiguration(...).
|
||||
/// </summary>
|
||||
public interface IDASCommunication : IConfiguration,
|
||||
IDiagnos,
|
||||
ITriggerCheck,
|
||||
IRealTime,
|
||||
IArmStatus,
|
||||
IDownload,
|
||||
IInformation,
|
||||
IComparable<IDASCommunication>,
|
||||
IDisposable,
|
||||
IAutoArmStatus,
|
||||
IAutoArmed,
|
||||
IRangeBandwidthLimited,
|
||||
ITimeSynchronization
|
||||
{
|
||||
/// <summary>
|
||||
/// The Excitation status for DAS
|
||||
/// </summary>
|
||||
ExcitationStatus ExcitationStatus { get; set; }
|
||||
/// <summary>
|
||||
/// populates IsFirstUseDateSupported and FirstUseDate properties
|
||||
/// if unit supports first use date then requires communication with unit
|
||||
/// (to retrieve attribute)
|
||||
/// 15524 DAS "First Use Date"
|
||||
/// this isn't really designed to be called externally, but as part of IDASCommunication initialization
|
||||
/// </summary>
|
||||
void ReadFirstUseDate();
|
||||
/// <summary>
|
||||
/// indicates date of first use
|
||||
/// null indicates the hardware has not been used since calibration
|
||||
/// only valid when IsFirstUseDateSupported is true
|
||||
/// 15524 DAS "First Use Date"
|
||||
/// </summary>
|
||||
DateTime? FirstUseDate { get; set; }
|
||||
/// <summary>
|
||||
/// returns whether the hardware supports first use or not
|
||||
/// for hardware to support first use the hardware must support
|
||||
/// storage for user attributes in firmware and also have been
|
||||
/// calibrated by software support hardware first use
|
||||
/// 15524 DAS "First Use Date"
|
||||
/// </summary>
|
||||
bool IsFirstUseDateSupported { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SetIsStreamingSupported(bool supported = false);
|
||||
/// <summary>
|
||||
/// indicates whether or not streaming is supported
|
||||
/// 30429 TSR AIRs can enable/disable streaming via the DISABLE_STREAMING_FEATURE system attribute
|
||||
/// </summary>
|
||||
bool IsStreamingSupported { get; set; }
|
||||
/// <summary>
|
||||
/// performs a quick connection check, returns true if unit can be communicated with
|
||||
/// returns false otherwise
|
||||
/// does not go through units busy service or check that unit is not being communicated with
|
||||
/// this is an emergency check
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool ConnectionCheck();
|
||||
HardwareTypes GetHardwareType();
|
||||
int RecordId { get; set; }
|
||||
/// returns the nominal ranges for the das given a bridge type
|
||||
double[] GetNominalRanges(SensorConstants.BridgeType bridge);
|
||||
float InputLowVoltage { get; set; }
|
||||
float InputMediumVoltage { get; set; }
|
||||
float InputHighVoltage { get; set; }
|
||||
float BatteryLowVoltage { get; set; }
|
||||
float BatteryMediumVoltage { get; set; }
|
||||
float BatteryHighVoltage { get; set; }
|
||||
double MinimumValidInputVoltage { get; set; }
|
||||
double MaximumValidInputVoltage { get; set; }
|
||||
double MinimumValidBatteryVoltage { get; set; }
|
||||
double MaximumValidBatteryVoltage { get; set; }
|
||||
/// <summary>
|
||||
/// The serial number of the base unit of this DAS.
|
||||
/// </summary>
|
||||
string SerialNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The firmware version currently installed on this DAS.
|
||||
/// </summary>
|
||||
string FirmwareVersion { get; }
|
||||
|
||||
/// <summary>
|
||||
/// This flag is used to tell if arm attributes should be defaulted when arming
|
||||
/// or not. It also serves to let the user know that this DAS has not been
|
||||
/// diagnosed.
|
||||
/// </summary>
|
||||
bool DiagnosticsHasBeenRun { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// this flag is used to tell if configure has been run
|
||||
/// this is used prior to when diagnostic results are needed, like the
|
||||
/// diagnostics tab or the acquire tab [when running acquire]
|
||||
/// </summary>
|
||||
bool ConfigureHasBeenRun { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Count how many channels are configured.
|
||||
/// </summary>
|
||||
/// <returns>Number of configured channels.</returns>
|
||||
int NumberOfConfiguredChannels();
|
||||
|
||||
/// <summary>
|
||||
/// Count how many channels we have (regardless if they are configured or not).
|
||||
/// </summary>
|
||||
/// <returns>Total number of channels</returns>
|
||||
int NumberOfChannels();
|
||||
|
||||
/// <summary>
|
||||
/// max memory for the das
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
long MaxMemory();
|
||||
|
||||
int MaxModules { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// min sample rate for the das
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
uint MinSampleRate();
|
||||
|
||||
/// <summary>
|
||||
/// max sample rate for the das
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
uint MaxSampleRate(int numberOfConfiguredChannels);
|
||||
uint MaxAAFilterRate();
|
||||
|
||||
bool SupportsAutoArm();
|
||||
|
||||
bool SupportsLevelTrigger();
|
||||
|
||||
bool SupportsRealtime();
|
||||
|
||||
bool SupportsMultipleEvents();
|
||||
|
||||
/// <summary>
|
||||
/// returns true if the device supports trigger completion inversion or not
|
||||
/// </summary>
|
||||
/// <returns>true if the device supports trigger completion inversion, false otherwise</returns>
|
||||
bool SupportsTriggerInversion();
|
||||
bool InvertTrigger { set; }
|
||||
|
||||
/// <summary>
|
||||
/// returns true if the device supports start completion inversion or not
|
||||
/// </summary>
|
||||
/// <returns>returns true if the device supports start completion inversion, false otherwise</returns>
|
||||
bool SupportsStartInversion();
|
||||
bool InvertStart { get; set; }
|
||||
|
||||
bool IgnoreShortedStart { get; set; }
|
||||
bool IgnoreShortedTrigger { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SLICE Base firmware supports checking the trigger and start lines as of protocol 7,
|
||||
/// this function returns whether the hardware supports checking input status or not
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool SupportsHardwareInputCheck();
|
||||
/// <summary>
|
||||
/// whether to use multiple sample real time or not
|
||||
/// for sliceware there are times we need to turn off multiple sample realtime
|
||||
/// (like when using a slicedb for instance)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool SupportsMultipleSampleRealtime();
|
||||
/// <summary>
|
||||
/// whether the DASbase actually controls the DAQ for modules
|
||||
/// in the case of TDAS, the modules actually are responsible for the DAQ and the
|
||||
/// rack is just a middleman
|
||||
/// this is relevant because if the DAQ is controlled by the base then the sample numbers
|
||||
/// should match for all modules.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool ControlsDAQ();
|
||||
/// <summary>
|
||||
/// returns if the new AAF rate is acceptible or not
|
||||
/// right now this is only used to handle SLICE2 and it's multiple rate tables
|
||||
/// it does this by comparing the AAF rate that the unit was configured with against the new rate
|
||||
/// </summary>
|
||||
/// <param name="rate">new AAF rate</param>
|
||||
/// <returns></returns>
|
||||
bool CheckAAF(float rate);
|
||||
|
||||
bool RequireDiagnosticRateMatchSampleRate();
|
||||
|
||||
/// <summary>
|
||||
/// returns the phase delay in samples given a module index, a sample rate, and a
|
||||
/// Hardware AAF
|
||||
/// some DAS may have one phase delay across all modules, some may have separate phase delays for
|
||||
/// individual module types.
|
||||
///
|
||||
/// for now most systems will just return 0 for the phase shift samples as the amount of delay
|
||||
/// is only know for a very small number of DAS types
|
||||
/// </summary>
|
||||
/// <param name="ModuleIndex">module to query</param>
|
||||
/// <param name="ActualSampleRate">actual sample rate of data collection</param>
|
||||
/// <param name="HardwareAAF">actual rate of Hardware AAF, this is the sum of
|
||||
/// fixed and variable AAFs
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
ulong GetPhaseShiftSamples(uint ModuleIndex, double ActualSampleRate, uint HardwareAAF, ulong originalT0);
|
||||
|
||||
/// <summary>
|
||||
/// returns true if the devices is an ethernet distributor
|
||||
/// for now that is SLICEDb, SLICE ECM, SLICE6DB
|
||||
/// these are devices that we talk through, but not to for device communication
|
||||
/// a rack we communicate with the modules by talking to the rack, so it's not a distributor
|
||||
/// </summary>
|
||||
/// <returns>returns true if the devices is an ethernet distributor</returns>
|
||||
bool IsEthernetDistributor();
|
||||
|
||||
/// <summary>
|
||||
/// returns true if the unit is capable of reading arm status
|
||||
/// 17800 Trigger status is "waiting" but PPRO has indeed triggered
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool GetCanCheckArmStatus();
|
||||
/// <summary>
|
||||
/// returns true if the device is a SLICE6DB, originally for the purpose
|
||||
/// of knowing when we should download values from external temperature sensors
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool IsSlice6Distributor();
|
||||
|
||||
bool IsBattery();
|
||||
|
||||
bool IsTSRAIR();
|
||||
|
||||
bool IsSlice6Air();
|
||||
bool IsScheduleEventCountSupported();
|
||||
|
||||
string MACAddress { get; set; }
|
||||
string[] DownstreamMACAddresses { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates that the unit supports selectable channels for realtime streaming
|
||||
/// this is for 10572 implement SW side for single command streaming realtime
|
||||
/// only SPS supports this currently
|
||||
/// </summary>
|
||||
bool SupportsIndividualChannelRealtimeStreaming { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using DTS.Common.Enums;
|
||||
using Prism.Events;
|
||||
|
||||
namespace DTS.Common.Events
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The SLICE6MulticastPropertyEventChanged event.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>This event has to be used when SLICE6 multicast property(s) have changed.</remarks>
|
||||
///
|
||||
public class SLICE6MulticastPropertyEventChanged : PubSubEvent<SLICE6MulticastPropertyEventArgs>
|
||||
{
|
||||
}
|
||||
|
||||
public class SLICE6MulticastPropertyEventArgs
|
||||
{
|
||||
public SLICE6Properties SLICE6Property { get; private set; }
|
||||
public string SLICE6MulticastAddress { get; private set; }
|
||||
public int SLICE6MulticastCommandPort { get; private set; }
|
||||
public int SLICE6MulticastResponsePort { get; private set; }
|
||||
|
||||
public SLICE6MulticastPropertyEventArgs(SLICE6Properties property, string address, int commandPort, int responsePort)
|
||||
{
|
||||
SLICE6Property = property;
|
||||
SLICE6MulticastAddress = address;
|
||||
SLICE6MulticastCommandPort = commandPort;
|
||||
SLICE6MulticastResponsePort = responsePort;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
using DTS.Common.Base;
|
||||
|
||||
namespace DTS.Common.Interface
|
||||
{
|
||||
public interface IHeadReportInputView : IBaseView { }
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
|
||||
namespace DTS.Common.Interface.Sensors.SensorsList
|
||||
{
|
||||
public interface IDigitalOutputSetting
|
||||
{
|
||||
/// <summary>
|
||||
/// database id for digital output setting
|
||||
/// only ids > 0 are valid
|
||||
/// </summary>
|
||||
int DatabaseId { get; set; }
|
||||
/// <summary>
|
||||
/// whether digital output should have a check in a list with a checkbox
|
||||
/// </summary>
|
||||
bool Included { get; set; }
|
||||
/// <summary>
|
||||
/// serialnumber/setting name for digital output setting
|
||||
/// </summary>
|
||||
string SerialNumber { get; set; }
|
||||
/// <summary>
|
||||
/// description/comment for setting
|
||||
/// </summary>
|
||||
string Description { get; set; }
|
||||
/// <summary>
|
||||
/// delay in ms before outputting
|
||||
/// </summary>
|
||||
double DODelay { get; set; }
|
||||
/// <summary>
|
||||
/// duration in ms of output (if limiting duration)
|
||||
/// </summary>
|
||||
double DODuration { get; set; }
|
||||
/// <summary>
|
||||
/// who last modified the digital output
|
||||
/// </summary>
|
||||
string ModifiedBy { get; set; }
|
||||
/// <summary>
|
||||
/// when the digital output was last modified
|
||||
/// </summary>
|
||||
DateTime LastModified { get; set; }
|
||||
/// <summary>
|
||||
/// returns true if the digital output matches filter criteria
|
||||
/// </summary>
|
||||
/// <param name="term"></param>
|
||||
/// <returns></returns>
|
||||
bool Filter(string term);
|
||||
/// <summary>
|
||||
/// whether digital output is associated with a channel
|
||||
/// </summary>
|
||||
bool Assigned { get; set; }
|
||||
/// <summary>
|
||||
/// whether digital output was found online or not (there's no real way of finding digital output online, it has no EID)
|
||||
/// </summary>
|
||||
bool Online { get; set; }
|
||||
/// <summary>
|
||||
/// isocode associated with digital output
|
||||
/// digital outputs aren't in collected data so there's not a real need for this ...
|
||||
/// </summary>
|
||||
string ISOCode { get; set; }
|
||||
/// <summary>
|
||||
/// iso channel name associated with digital output
|
||||
/// digital outputs aren't in collected data so there's no real need for this ...
|
||||
/// </summary>
|
||||
string ISOChannelName { get; set; }
|
||||
/// <summary>
|
||||
/// user code associated with digital output
|
||||
/// there's no collected data for outputs so there's no real need for this
|
||||
/// </summary>
|
||||
string UserCode { get; set; }
|
||||
/// <summary>
|
||||
/// user channel name associated with digital output
|
||||
/// there's no collected data for outputs so there's no real need for this
|
||||
/// </summary>
|
||||
string UserChannelName { get; set; }
|
||||
/// <summary>
|
||||
/// whether output should be limited or not
|
||||
/// </summary>
|
||||
bool LimitDuration { get; set; }
|
||||
/// <summary>
|
||||
/// the output mode for the digital output setting
|
||||
/// </summary>
|
||||
Enums.DigitalOutputModes DOMode { get; set; }
|
||||
/// <summary>
|
||||
/// used to mark whether the digital output is broken
|
||||
/// broken sensors do not appear in selectable lists of sensors in edit group or edit test setup
|
||||
/// </summary>
|
||||
bool Broken { get; set; }
|
||||
/// <summary>
|
||||
/// used to mark whether the digital output should not be used
|
||||
/// donotuse sensors do not appear in selectable lists of sensors in edit group or edit test setup
|
||||
/// </summary>
|
||||
bool DoNotUse { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,462 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
|
||||
// ReSharper disable UnusedMember.Local
|
||||
// ReSharper disable UnusedVariable
|
||||
|
||||
namespace DTS.Common.Utils
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public static class FileUtils
|
||||
{
|
||||
[Flags]
|
||||
enum MoveFileFlags
|
||||
{
|
||||
MOVEFILE_REPLACE_EXISTING = 0x00000001,
|
||||
MOVEFILE_COPY_ALLOWED = 0x00000002,
|
||||
MOVEFILE_DELAY_UNTIL_REBOOT = 0x00000004,
|
||||
MOVEFILE_WRITE_THROUGH = 0x00000008,
|
||||
MOVEFILE_CREATE_HARDLINK = 0x00000010,
|
||||
MOVEFILE_FAIL_IF_NOT_TRACKABLE = 0x00000020
|
||||
}
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
private static extern bool MoveFileEx(string lpExistingFileName, string lpNewFileName, MoveFileFlags dwFlags);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool DeleteFile(string lpFileName);
|
||||
public const double DataPROPre20XmlVersion = 2.0D;
|
||||
public const double DataPRO20XmlVersion = 3.0D;
|
||||
public const double DataPRO21XmlVersion = 4.0D;
|
||||
public const double DataPRO22XmlVersion = 5.0D;
|
||||
//FB 13120 Added FilterClass and deleted CFC in version 6.0
|
||||
//15390 Store the ZMO in EU in the DataPRO DB in version 7.0, adds top level field SensorChangeHistory
|
||||
//13065 Sensor "First Use" Date, version 8, adds LatestCalibrationId, CalibrationId and FirstUse tags
|
||||
//15727Building and Replacing Racks/Mods - version 9, adds TestId,GroupId, StandIn to hardware and Id to tests
|
||||
//Version 10 adds TSR Air settings
|
||||
//Version 11 adds AlignUDPToPPS
|
||||
public const double CurrentXmlVersion = 11.0D;
|
||||
|
||||
|
||||
public static XmlElement GetImportXmlNode(string filename, string xmlDoc, out double importVersion)
|
||||
{
|
||||
var doc = new XmlDocument();
|
||||
importVersion = 0D;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(xmlDoc))
|
||||
{
|
||||
doc.LoadXml(xmlDoc);
|
||||
}
|
||||
else
|
||||
{
|
||||
doc.Load(filename);
|
||||
}
|
||||
|
||||
foreach (var node in doc.ChildNodes)
|
||||
{
|
||||
if (node is XmlDeclaration) continue;
|
||||
if (!(node is XmlElement)) continue;
|
||||
if ((node as XmlElement).Name != "ExportFile") continue;
|
||||
|
||||
importVersion = Convert.ToDouble(((XmlElement)node).GetAttribute("Version"),
|
||||
System.Globalization.CultureInfo.InvariantCulture);
|
||||
if (importVersion > CurrentXmlVersion)
|
||||
{
|
||||
throw new NotSupportedException("Unsupported version: " + importVersion);
|
||||
}
|
||||
|
||||
return (XmlElement)node;
|
||||
}
|
||||
|
||||
throw new Exception("Invalid Import XML");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This API can accept a parameter “MOVEFILE_DELAY_UNTIL_REBOOT ” to remove the file only after reboot.
|
||||
/// https://msdn.microsoft.com/en-us/library/windows/desktop/aa365240(v=vs.85).aspx
|
||||
/// </summary>
|
||||
/// <param name="filePath">Entire path of the file we want to move</param>
|
||||
public static void moveFileEx(string filePath)
|
||||
{
|
||||
MoveFileEx(filePath, null, MoveFileFlags.MOVEFILE_DELAY_UNTIL_REBOOT);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// FB16400: ISO exports error in 3rd Party Software, related to FB15801
|
||||
/// By default, C# returns UTF-8 Encoding with Byte-Order Mark turned on. Need to explicitly call the overloaded constructor to turn it off:
|
||||
/// https://docs.microsoft.com/en-us/dotnet/api/system.text.encoding.utf8?view=netcore-3.1
|
||||
/// </summary>
|
||||
/// <param name="codepage"></param>
|
||||
/// <returns></returns>
|
||||
public static Encoding GetEncoding(int codepage)
|
||||
{
|
||||
var encoding = Encoding.GetEncoding(codepage);
|
||||
if (encoding is UTF8Encoding) { encoding = new UTF8Encoding(false); }
|
||||
return encoding;
|
||||
}
|
||||
|
||||
public static XmlWriter GetExportWriter(int count, double version, string software, string softwareVersion, LogDelegate logDelegate, out StringBuilder sb)
|
||||
{
|
||||
sb = new StringBuilder(5000000);
|
||||
|
||||
var xSet = new XmlWriterSettings { Indent = true, CheckCharacters = true };
|
||||
var writer = XmlWriter.Create(sb, xSet);
|
||||
|
||||
writer.WriteStartDocument();
|
||||
|
||||
writer.WriteStartElement("ExportFile");
|
||||
|
||||
writer.WriteAttributeString("TotalItems", count.ToString(System.Globalization.CultureInfo.InvariantCulture));
|
||||
writer.WriteAttributeString("Version", version.ToString(System.Globalization.CultureInfo.InvariantCulture));
|
||||
writer.WriteAttributeString("Software", software);
|
||||
writer.WriteAttributeString("SoftwareVersion", softwareVersion);
|
||||
return writer;
|
||||
}
|
||||
/// <summary>
|
||||
/// This API deletes an existing file.
|
||||
/// https://msdn.microsoft.com/en-us/library/windows/desktop/aa363915(v=vs.85).aspx
|
||||
/// </summary>
|
||||
/// <param name="filePath">Entire path of the file to be deleted.</param>
|
||||
/// <param name="lastError">Error if failed to delete file
|
||||
/// If the function succeeds, the return value is nonzero.
|
||||
/// If the function fails, the return value is zero (0).
|
||||
/// To get extended error information, call GetLastError.</param>
|
||||
public static bool deleteFile(string filePath, ref int lastError)
|
||||
{
|
||||
if (!File.Exists(filePath)) return true;
|
||||
|
||||
var deleted = DeleteFile(filePath);
|
||||
if (!deleted)
|
||||
{
|
||||
lastError = Marshal.GetLastWin32Error();
|
||||
}
|
||||
return deleted;
|
||||
}
|
||||
public delegate void LogDelegate(params object[] paramlist);
|
||||
public static void DeleteFileOrMove(string filepath, LogDelegate logfunction)
|
||||
{
|
||||
var lastError = 0;
|
||||
if (!deleteFile(filepath, ref lastError))
|
||||
{
|
||||
logfunction("failed to delete file: ", filepath, " error: ", lastError);
|
||||
moveFileEx(filepath);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// One time sql script conversion from SQLite syntax to MS SQL Server
|
||||
/// all you need to know about Regex is here - http://rubular.com/r/kcqDdLJBpx
|
||||
/// </summary>
|
||||
/// <param name="script">SQLite script file path</param>
|
||||
/// <returns></returns>
|
||||
public static string ScriptFromSQLiteToSQL(string script)
|
||||
{
|
||||
if (string.IsNullOrEmpty(script)) return script;
|
||||
|
||||
const string BLOB = "BLOB";
|
||||
const string NVCHAR = "NVCHAR";
|
||||
const string NVARCHAR = "NVARCHAR";
|
||||
const string COLLATE_NOCASE = "COLLATE NOCASE";
|
||||
const string Couldnt = "Couldn't";
|
||||
const string Couldnot = "Could not";
|
||||
const string IDENTITY = "IDENTITY(1,1)";
|
||||
const string AUTOINCREMENT = "AUTOINCREMENT";
|
||||
const string varbinary_max = "varbinary(max)";
|
||||
const string varchar_max = "varchar(max)";
|
||||
const string max = "(max)";
|
||||
const string BigInt = "bigint";
|
||||
const string Integer = "integer";
|
||||
const string Int = "int";
|
||||
const string _2048 = "(2048)";
|
||||
const string _5000 = "(5000)";
|
||||
|
||||
var sql = new StringBuilder();
|
||||
long count = 0;
|
||||
using (var inputStream = File.OpenRead(script))
|
||||
{
|
||||
using (var inputReader = new StreamReader(inputStream))
|
||||
{
|
||||
string tempLineValue;
|
||||
|
||||
while (null != (tempLineValue = inputReader.ReadLine()))
|
||||
{
|
||||
Debug.Print("Line: " + count++);
|
||||
var addGo = false;
|
||||
const string dropTable = "DROP TABLE IF EXISTS";
|
||||
const string dropTableNew = @"if exists(SELECT * FROM sysobjects where name = '{0}') DROP TABLE [dbo].[{0}];";
|
||||
const string insertInto = "INSERT INTO";
|
||||
const string convert = "convert(varbinary(max), {0})";
|
||||
|
||||
if (tempLineValue.StartsWith(dropTable))
|
||||
{
|
||||
var tableName = tempLineValue.Replace(dropTable, string.Empty).Replace("\"", string.Empty).Replace(";", string.Empty).Trim();
|
||||
tempLineValue = string.Format(dropTableNew, tableName);
|
||||
addGo = true;
|
||||
}
|
||||
else if (tempLineValue.StartsWith(insertInto))
|
||||
{
|
||||
|
||||
//find SQLite (or C#) date (Format: '2016-06-06 15:15:38.0630927' )
|
||||
const string patternSQLiteDate = @"(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2}).\d{3,7}";
|
||||
var regexSQLiteDate = new Regex(patternSQLiteDate, RegexOptions.IgnoreCase);
|
||||
var matchSQLiteDate = regexSQLiteDate.Match(tempLineValue);
|
||||
|
||||
while (matchSQLiteDate.Success)
|
||||
{
|
||||
var foundSQLiteDate = matchSQLiteDate.Value;
|
||||
|
||||
//find SQL date in SQLite date (Format: '2016-06-06 15:15:38.063' )
|
||||
const string patternSQLDate = @"(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})";
|
||||
var rDate = new Regex(patternSQLDate, RegexOptions.IgnoreCase);
|
||||
|
||||
var mDate = rDate.Match(foundSQLiteDate);
|
||||
if (mDate.Success)
|
||||
{
|
||||
//replace date
|
||||
tempLineValue = tempLineValue.Replace(foundSQLiteDate, mDate.Value);
|
||||
|
||||
}
|
||||
matchSQLiteDate = matchSQLiteDate.NextMatch();
|
||||
|
||||
}
|
||||
|
||||
const string patternBinary = @"[X]'\w+'";
|
||||
var regexBinary = new Regex(patternBinary, RegexOptions.IgnoreCase);
|
||||
var matchBinary = regexBinary.Match(tempLineValue);
|
||||
while (matchBinary.Success)
|
||||
{
|
||||
var matchValue = matchBinary.Value;
|
||||
var newValue = string.Format(convert, matchValue.Replace("X", string.Empty).Replace(",", string.Empty));
|
||||
tempLineValue = tempLineValue.Replace(matchValue, newValue);
|
||||
matchBinary = matchBinary.NextMatch();
|
||||
}
|
||||
addGo = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
const string patternText = @"text\s{0,}\(\w+\)";
|
||||
var regexText = new Regex(patternText, RegexOptions.IgnoreCase);
|
||||
var matchText = regexText.Match(tempLineValue);
|
||||
if (matchText.Success)
|
||||
{
|
||||
tempLineValue = tempLineValue.Replace(matchText.Value, varchar_max);
|
||||
}
|
||||
|
||||
const string patternMaxMemory = @"\[MaxMemory\]\sinteger,";
|
||||
var regexMaxMemory = new Regex(patternMaxMemory, RegexOptions.IgnoreCase);
|
||||
var matchMaxMemory = regexMaxMemory.Match(tempLineValue);
|
||||
if (matchMaxMemory.Success)
|
||||
{
|
||||
tempLineValue = tempLineValue.Replace(Integer, BigInt);
|
||||
}
|
||||
|
||||
}
|
||||
sql.AppendLine(tempLineValue);
|
||||
if (addGo) sql.AppendLine("GO");
|
||||
}
|
||||
}
|
||||
}
|
||||
return sql
|
||||
.Replace(AUTOINCREMENT, string.Empty)
|
||||
.Replace(Couldnt, Couldnot)
|
||||
.Replace(_2048, max)
|
||||
.Replace(_5000, max)
|
||||
.Replace(Integer, Int)
|
||||
.Replace(COLLATE_NOCASE, string.Empty)
|
||||
.Replace(BLOB, varbinary_max)
|
||||
.Replace(BLOB.ToLower(), varbinary_max)
|
||||
.Replace(NVCHAR, NVARCHAR)
|
||||
.Replace(NVCHAR.ToLower(), NVARCHAR).ToString();
|
||||
}
|
||||
|
||||
#region File List
|
||||
private static List<string> _fileList = new List<string>();
|
||||
|
||||
public static List<string> FileList { get => _fileList; set => _fileList = value; }
|
||||
|
||||
private static List<string> _newFileList = new List<string>();
|
||||
|
||||
public static List<string> NewFileList { get => _newFileList; set => _newFileList = value; }
|
||||
|
||||
/// <summary>
|
||||
/// recursively search directory and subdirectories and return a list of files
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="pattern">*.dts</param>
|
||||
/// <returns></returns>
|
||||
public static void FindFiles(string path, string pattern)
|
||||
{
|
||||
_fileList.AddRange(FindFiles(path, pattern, SearchOption.AllDirectories));
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Search directory and return a list of files
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="pattern">*.dts</param>
|
||||
/// <returns></returns>
|
||||
public static List<string> FindFilesInDirectory(string path, string pattern)
|
||||
{
|
||||
return FindFiles(path, pattern, SearchOption.TopDirectoryOnly);
|
||||
}
|
||||
|
||||
private static List<string> FindFiles(string path, string pattern, SearchOption searchOption)
|
||||
{
|
||||
return Directory.GetFiles(path, "*" + pattern, searchOption).
|
||||
Select(fn => new FileInfo(fn)).
|
||||
OrderBy(f => Regex.Replace(f.Name, @"\d+", n => n.Value.PadLeft(4, '0'))).
|
||||
Select(f => f.FullName).
|
||||
ToList();
|
||||
}
|
||||
|
||||
#endregion File List
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct RM_UNIQUE_PROCESS
|
||||
{
|
||||
public int dwProcessId;
|
||||
public System.Runtime.InteropServices.ComTypes.FILETIME ProcessStartTime;
|
||||
}
|
||||
|
||||
private const int RmRebootReasonNone = 0;
|
||||
private const int CCH_RM_MAX_APP_NAME = 255;
|
||||
private const int CCH_RM_MAX_SVC_NAME = 63;
|
||||
|
||||
private enum RM_APP_TYPE
|
||||
{
|
||||
RmUnknownApp = 0,
|
||||
RmMainWindow = 1,
|
||||
RmOtherWindow = 2,
|
||||
RmService = 3,
|
||||
RmExplorer = 4,
|
||||
RmConsole = 5,
|
||||
RmCritical = 1000
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
private struct RM_PROCESS_INFO
|
||||
{
|
||||
public RM_UNIQUE_PROCESS Process;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCH_RM_MAX_APP_NAME + 1)]
|
||||
public string strAppName;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCH_RM_MAX_SVC_NAME + 1)]
|
||||
public string strServiceShortName;
|
||||
|
||||
public RM_APP_TYPE ApplicationType;
|
||||
public uint AppStatus;
|
||||
public uint TSSessionId;
|
||||
[MarshalAs(UnmanagedType.Bool)]
|
||||
public bool bRestartable;
|
||||
}
|
||||
|
||||
[DllImport("rstrtmgr.dll", CharSet = CharSet.Unicode)]
|
||||
private static extern int RmRegisterResources(uint pSessionHandle,
|
||||
UInt32 nFiles,
|
||||
string[] rgsFilenames,
|
||||
UInt32 nApplications,
|
||||
[In] RM_UNIQUE_PROCESS[] rgApplications,
|
||||
UInt32 nServices,
|
||||
string[] rgsServiceNames);
|
||||
|
||||
[DllImport("rstrtmgr.dll", CharSet = CharSet.Auto)]
|
||||
private static extern int RmStartSession(out uint pSessionHandle, int dwSessionFlags, string strSessionKey);
|
||||
|
||||
[DllImport("rstrtmgr.dll")]
|
||||
private static extern int RmEndSession(uint pSessionHandle);
|
||||
|
||||
[DllImport("rstrtmgr.dll")]
|
||||
private static extern int RmGetList(uint dwSessionHandle,
|
||||
out uint pnProcInfoNeeded,
|
||||
ref uint pnProcInfo,
|
||||
[In, Out] RM_PROCESS_INFO[] rgAffectedApps,
|
||||
ref uint lpdwRebootReasons);
|
||||
|
||||
/// <summary>
|
||||
/// Find out what process(es) have a lock on the specified file.
|
||||
/// </summary>
|
||||
/// <param name="path">Path of the file.</param>
|
||||
/// <returns>Processes locking the file</returns>
|
||||
/// <remarks>See also:
|
||||
/// http://msdn.microsoft.com/en-us/library/windows/desktop/aa373661(v=vs.85).aspx
|
||||
/// http://wyupdate.googlecode.com/svn-history/r401/trunk/frmFilesInUse.cs (no copyright in code at time of viewing)
|
||||
///
|
||||
/// </remarks>
|
||||
public static List<Process> WhoIsLocking(string path)
|
||||
{
|
||||
uint handle;
|
||||
string key = Guid.NewGuid().ToString();
|
||||
List<Process> processes = new List<Process>();
|
||||
|
||||
int res = RmStartSession(out handle, 0, key);
|
||||
if (res != 0) throw new Exception("Could not begin restart session. Unable to determine file locker.");
|
||||
|
||||
try
|
||||
{
|
||||
const int ERROR_MORE_DATA = 234;
|
||||
uint pnProcInfoNeeded = 0,
|
||||
pnProcInfo = 0,
|
||||
lpdwRebootReasons = RmRebootReasonNone;
|
||||
|
||||
string[] resources = new string[] { path }; // Just checking on one resource.
|
||||
|
||||
res = RmRegisterResources(handle, (uint)resources.Length, resources, 0, null, 0, null);
|
||||
|
||||
if (res != 0) throw new Exception("Could not register resource.");
|
||||
|
||||
//Note: there's a race condition here -- the first call to RmGetList() returns
|
||||
// the total number of process. However, when we call RmGetList() again to get
|
||||
// the actual processes this number may have increased.
|
||||
res = RmGetList(handle, out pnProcInfoNeeded, ref pnProcInfo, null, ref lpdwRebootReasons);
|
||||
|
||||
if (res == ERROR_MORE_DATA)
|
||||
{
|
||||
// Create an array to store the process results
|
||||
RM_PROCESS_INFO[] processInfo = new RM_PROCESS_INFO[pnProcInfoNeeded];
|
||||
pnProcInfo = pnProcInfoNeeded;
|
||||
|
||||
// Get the list
|
||||
res = RmGetList(handle, out pnProcInfoNeeded, ref pnProcInfo, processInfo, ref lpdwRebootReasons);
|
||||
if (res == 0)
|
||||
{
|
||||
processes = new List<Process>((int)pnProcInfo);
|
||||
|
||||
// Enumerate all of the results and add them to the
|
||||
// list to be returned
|
||||
for (int i = 0; i < pnProcInfo; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
processes.Add(Process.GetProcessById(processInfo[i].Process.dwProcessId));
|
||||
}
|
||||
// catch the error -- in case the process is no longer running
|
||||
catch (ArgumentException)
|
||||
{
|
||||
//ignore exception
|
||||
}
|
||||
}
|
||||
}
|
||||
else throw new Exception("Could not list processes locking resource.");
|
||||
}
|
||||
else if (res != 0) throw new Exception("Could not list processes locking resource. Failed to get size of result.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
RmEndSession(handle);
|
||||
}
|
||||
|
||||
return processes;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
using DTS.Common.Enums.Hardware;
|
||||
using DTS.Common.Enums.Sensors;
|
||||
using DTS.Common.Interface.DASFactory.ARM;
|
||||
using DTS.Common.Interface.DASFactory.Config;
|
||||
using DTS.Common.Interface.DASFactory.Diagnostics;
|
||||
using DTS.Common.Interface.DASFactory.Download;
|
||||
using System;
|
||||
using static DTS.Common.Enums.DASFactory.DFConstantsAndEnums;
|
||||
|
||||
namespace DTS.Common.Interface.DASFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface to a DAS unit. The IDASCommunication interface for a DAS unit is the most used
|
||||
/// data structure in the API. Nearly all services performed on the hardware will take a List
|
||||
/// of these interfaces (representing a List of hardware units) as a parameter. Each DAS unit in
|
||||
/// the real world will have an IDASCommunication interface in the API. In the case of Configuration, for
|
||||
/// example, the local IDASCommunication corresponding to the hardware configuration target is edited, then
|
||||
/// ConfigurationService.SetConfiguration(...) is called which basically synchronizes the local IDASCommunication
|
||||
/// with the hardware, and vice versa with GetConfiguration(...).
|
||||
/// </summary>
|
||||
public interface IDASCommunication : IConfiguration,
|
||||
IDiagnos,
|
||||
ITriggerCheck,
|
||||
IRealTime,
|
||||
IArmStatus,
|
||||
IDownload,
|
||||
IInformation,
|
||||
IComparable<IDASCommunication>,
|
||||
IDisposable,
|
||||
IAutoArmStatus,
|
||||
IAutoArmed,
|
||||
IRangeBandwidthLimited,
|
||||
ITimeSynchronization
|
||||
{
|
||||
/// <summary>
|
||||
/// The Excitation status for DAS
|
||||
/// </summary>
|
||||
ExcitationStatus ExcitationStatus { get; set; }
|
||||
/// <summary>
|
||||
/// populates IsFirstUseDateSupported and FirstUseDate properties
|
||||
/// if unit supports first use date then requires communication with unit
|
||||
/// (to retrieve attribute)
|
||||
/// 15524 DAS "First Use Date"
|
||||
/// this isn't really designed to be called externally, but as part of IDASCommunication initialization
|
||||
/// </summary>
|
||||
void ReadFirstUseDate();
|
||||
/// <summary>
|
||||
/// indicates date of first use
|
||||
/// null indicates the hardware has not been used since calibration
|
||||
/// only valid when IsFirstUseDateSupported is true
|
||||
/// 15524 DAS "First Use Date"
|
||||
/// </summary>
|
||||
DateTime? FirstUseDate { get; set; }
|
||||
/// <summary>
|
||||
/// returns whether the hardware supports first use or not
|
||||
/// for hardware to support first use the hardware must support
|
||||
/// storage for user attributes in firmware and also have been
|
||||
/// calibrated by software support hardware first use
|
||||
/// 15524 DAS "First Use Date"
|
||||
/// </summary>
|
||||
bool IsFirstUseDateSupported { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SetIsStreamingSupported(bool supported = false);
|
||||
/// <summary>
|
||||
/// indicates whether or not streaming is supported
|
||||
/// 30429 TSR AIRs can enable/disable streaming via the DISABLE_STREAMING_FEATURE system attribute
|
||||
/// </summary>
|
||||
bool IsStreamingSupported { get; set; }
|
||||
/// <summary>
|
||||
/// performs a quick connection check, returns true if unit can be communicated with
|
||||
/// returns false otherwise
|
||||
/// does not go through units busy service or check that unit is not being communicated with
|
||||
/// this is an emergency check
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool ConnectionCheck();
|
||||
HardwareTypes GetHardwareType();
|
||||
int[] GetStackChannelConfigTypes();
|
||||
int RecordId { get; set; }
|
||||
/// returns the nominal ranges for the das given a bridge type
|
||||
double[] GetNominalRanges(SensorConstants.BridgeType bridge);
|
||||
float InputLowVoltage { get; set; }
|
||||
float InputMediumVoltage { get; set; }
|
||||
float InputHighVoltage { get; set; }
|
||||
float BatteryLowVoltage { get; set; }
|
||||
float BatteryMediumVoltage { get; set; }
|
||||
float BatteryHighVoltage { get; set; }
|
||||
double MinimumValidInputVoltage { get; set; }
|
||||
double MaximumValidInputVoltage { get; set; }
|
||||
double MinimumValidBatteryVoltage { get; set; }
|
||||
double MaximumValidBatteryVoltage { get; set; }
|
||||
/// <summary>
|
||||
/// The serial number of the base unit of this DAS.
|
||||
/// </summary>
|
||||
string SerialNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The firmware version currently installed on this DAS.
|
||||
/// </summary>
|
||||
string FirmwareVersion { get; }
|
||||
|
||||
/// <summary>
|
||||
/// This flag is used to tell if arm attributes should be defaulted when arming
|
||||
/// or not. It also serves to let the user know that this DAS has not been
|
||||
/// diagnosed.
|
||||
/// </summary>
|
||||
bool DiagnosticsHasBeenRun { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// this flag is used to tell if configure has been run
|
||||
/// this is used prior to when diagnostic results are needed, like the
|
||||
/// diagnostics tab or the acquire tab [when running acquire]
|
||||
/// </summary>
|
||||
bool ConfigureHasBeenRun { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Count how many channels are configured.
|
||||
/// </summary>
|
||||
/// <returns>Number of configured channels.</returns>
|
||||
int NumberOfConfiguredChannels();
|
||||
|
||||
/// <summary>
|
||||
/// Count how many channels we have (regardless if they are configured or not).
|
||||
/// </summary>
|
||||
/// <returns>Total number of channels</returns>
|
||||
int NumberOfChannels();
|
||||
|
||||
/// <summary>
|
||||
/// max memory for the das
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
long MaxMemory();
|
||||
|
||||
int MaxModules { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// min sample rate for the das
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
uint MinSampleRate();
|
||||
|
||||
/// <summary>
|
||||
/// max sample rate for the das
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
uint MaxSampleRate(int numberOfConfiguredChannels);
|
||||
uint MaxAAFilterRate();
|
||||
|
||||
bool SupportsAutoArm();
|
||||
|
||||
bool SupportsMultipleConfigurations();
|
||||
|
||||
bool SupportsLevelTrigger();
|
||||
|
||||
bool SupportsRealtime();
|
||||
|
||||
bool SupportsMultipleEvents();
|
||||
|
||||
/// <summary>
|
||||
/// returns true if the device supports trigger completion inversion or not
|
||||
/// </summary>
|
||||
/// <returns>true if the device supports trigger completion inversion, false otherwise</returns>
|
||||
bool SupportsTriggerInversion();
|
||||
bool InvertTrigger { set; }
|
||||
|
||||
/// <summary>
|
||||
/// returns true if the device supports start completion inversion or not
|
||||
/// </summary>
|
||||
/// <returns>returns true if the device supports start completion inversion, false otherwise</returns>
|
||||
bool SupportsStartInversion();
|
||||
bool InvertStart { get; set; }
|
||||
|
||||
bool IgnoreShortedStart { get; set; }
|
||||
bool IgnoreShortedTrigger { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SLICE Base firmware supports checking the trigger and start lines as of protocol 7,
|
||||
/// this function returns whether the hardware supports checking input status or not
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool SupportsHardwareInputCheck();
|
||||
/// <summary>
|
||||
/// whether to use multiple sample real time or not
|
||||
/// for sliceware there are times we need to turn off multiple sample realtime
|
||||
/// (like when using a slicedb for instance)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool SupportsMultipleSampleRealtime();
|
||||
/// <summary>
|
||||
/// whether the DASbase actually controls the DAQ for modules
|
||||
/// in the case of TDAS, the modules actually are responsible for the DAQ and the
|
||||
/// rack is just a middleman
|
||||
/// this is relevant because if the DAQ is controlled by the base then the sample numbers
|
||||
/// should match for all modules.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool ControlsDAQ();
|
||||
/// <summary>
|
||||
/// returns if the new AAF rate is acceptible or not
|
||||
/// right now this is only used to handle SLICE2 and it's multiple rate tables
|
||||
/// it does this by comparing the AAF rate that the unit was configured with against the new rate
|
||||
/// </summary>
|
||||
/// <param name="rate">new AAF rate</param>
|
||||
/// <returns></returns>
|
||||
bool CheckAAF(float rate);
|
||||
|
||||
bool RequireDiagnosticRateMatchSampleRate();
|
||||
|
||||
/// <summary>
|
||||
/// returns the phase delay in samples given a module index, a sample rate, and a
|
||||
/// Hardware AAF
|
||||
/// some DAS may have one phase delay across all modules, some may have separate phase delays for
|
||||
/// individual module types.
|
||||
///
|
||||
/// for now most systems will just return 0 for the phase shift samples as the amount of delay
|
||||
/// is only know for a very small number of DAS types
|
||||
/// </summary>
|
||||
/// <param name="ModuleIndex">module to query</param>
|
||||
/// <param name="ActualSampleRate">actual sample rate of data collection</param>
|
||||
/// <param name="HardwareAAF">actual rate of Hardware AAF, this is the sum of
|
||||
/// fixed and variable AAFs
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
ulong GetPhaseShiftSamples(uint ModuleIndex, double ActualSampleRate, uint HardwareAAF, ulong originalT0);
|
||||
|
||||
/// <summary>
|
||||
/// returns true if the devices is an ethernet distributor
|
||||
/// for now that is SLICEDb, SLICE ECM, SLICE6DB
|
||||
/// these are devices that we talk through, but not to for device communication
|
||||
/// a rack we communicate with the modules by talking to the rack, so it's not a distributor
|
||||
/// </summary>
|
||||
/// <returns>returns true if the devices is an ethernet distributor</returns>
|
||||
bool IsEthernetDistributor();
|
||||
|
||||
/// <summary>
|
||||
/// returns true if the unit is capable of reading arm status
|
||||
/// 17800 Trigger status is "waiting" but PPRO has indeed triggered
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool GetCanCheckArmStatus();
|
||||
/// <summary>
|
||||
/// returns true if the device is a SLICE6DB, originally for the purpose
|
||||
/// of knowing when we should download values from external temperature sensors
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool IsSlice6Distributor();
|
||||
|
||||
bool IsBattery();
|
||||
|
||||
bool IsTSRAIR();
|
||||
|
||||
bool IsSlice6Air();
|
||||
|
||||
bool IsSlice6AirTc();
|
||||
|
||||
bool IsScheduleEventCountSupported();
|
||||
|
||||
string MACAddress { get; set; }
|
||||
string[] DownstreamMACAddresses { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates that the unit supports selectable channels for realtime streaming
|
||||
/// this is for 10572 implement SW side for single command streaming realtime
|
||||
/// only SPS supports this currently
|
||||
/// </summary>
|
||||
bool SupportsIndividualChannelRealtimeStreaming { get; }
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
Reference in New Issue
Block a user