using System;
using System.Collections.Generic;
using DTS.Common.Enums.Communication;
using DTS.Common.Enums.DASFactory;
using DTS.Common.Interface.Communication;
using DTS.Common.Interface.Connection;
namespace DTS.Common.ICommunication
{
public class CanceledException : ApplicationException
{
}
public class Communication_DASInfo : ICommunication_DASInfo
{
///
/// indicates date of first use
/// null value indicates hardware has not been used since calibration
/// only valid when IsFirstUseDateSupported is true
///
public DateTime? FirstUseDate { get; set; } = null;
///
/// indicates that FirstUseDate data is valid and hardware supports First use dates
/// 15524 DAS "First Use Date"
///
public bool IsFirstUseDateSupported { get; set; } = false;
///
/// indicates whether or not streaming is supported
/// 30429 TSR AIRs can enable/disable streaming via the DISABLE_STREAMING_FEATURE system attribute
///
public bool IsStreamingSupported { get; set; } = false;
///
/// these are devices which are connected to the das
/// currently only used by SLICE6DB
///
public IDASConnectedDevice[] ConnectedDevices { get; private set; } = new IDASConnectedDevice[0];
///
/// sets ConnectedDevices
///
/// devices connected to this das
public void SetConnectedDevices(IDASConnectedDevice[] devices) { ConnectedDevices = devices; }
public string[] SerialNumbers { get; set; }
public string[] FirmwareVersions { get; set; }
public string StackSerialNumber(int devid)
{
if (null == SerialNumbers || SerialNumbers.Length < 1)
{
return "N/A";
}
else if (0 != devid && devid < SerialNumbers.Length)
{
return SerialNumbers[0] + "::" + SerialNumbers[devid];
}
else
{
return SerialNumbers[0];
}
}
public Communication_DASInfo()
{
}
public Communication_DASInfo(string[] serials, string[] fwnums)
{
SerialNumbers = (string[])serials.Clone();
FirmwareVersions = (string[])fwnums.Clone();
}
}
}