init
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 573 B |
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DTS.Common.Interface.Connection
|
||||
{
|
||||
public interface IConnection : IDisposable
|
||||
{
|
||||
Task<int> SendAsync(byte[] sendBuffer,
|
||||
int bufferStartOffset,
|
||||
int bufferSizeToSend);
|
||||
/// <summary>
|
||||
/// returns true if the unit is soft disconnected
|
||||
/// soft disconnected means we've connected then voluntarily disconnected with the expectation of reconnecting
|
||||
/// </summary>
|
||||
bool IsSoftDisconnected { get; }
|
||||
/// <summary>
|
||||
/// soft disconnects the unit (voluntarily disconnect with the intention of reconnecting later)
|
||||
/// </summary>
|
||||
void SoftDisconnect();
|
||||
/// <summary>
|
||||
/// reconnects a soft disconnected unit
|
||||
/// </summary>
|
||||
void SoftConnect();
|
||||
|
||||
System.Net.Sockets.SocketFlags Flags { get; set; }
|
||||
|
||||
event EventHandler OnDisconnected;
|
||||
// indicates that the device has not received a timely response to keep-alive
|
||||
void KeepAliveErrorReceived();
|
||||
string ConnectString { get; }
|
||||
|
||||
bool Connected { get; }
|
||||
|
||||
void Create(string connectString);
|
||||
void Create(string connectString, string hostIPAddress);
|
||||
|
||||
string GetConnectionData();
|
||||
|
||||
IAsyncResult BeginConnect(AsyncCallback callback, object callbackObject);
|
||||
|
||||
void EndConnect(IAsyncResult ar);
|
||||
|
||||
IAsyncResult BeginDisconnect(bool reuseSocket, AsyncCallback callback, object state);
|
||||
|
||||
void EndDisconnect(IAsyncResult asyncResult);
|
||||
|
||||
IAsyncResult BeginAccept(AsyncCallback callback,
|
||||
object state);
|
||||
|
||||
IConnection EndAccept(IAsyncResult asyncResult);
|
||||
|
||||
void Bind(int port);
|
||||
|
||||
void Listen(int backlog);
|
||||
|
||||
IAsyncResult BeginSend(byte[] sendBuffer,
|
||||
int bufferStartOffset,
|
||||
int bufferSizeToSend,
|
||||
AsyncCallback callback,
|
||||
object callbackObject);
|
||||
|
||||
int EndSend(IAsyncResult ar);
|
||||
|
||||
IAsyncResult BeginReceive(byte[] receiveBuffer,
|
||||
int bufferStartOffset,
|
||||
int maxSizeToReceive,
|
||||
AsyncCallback callback,
|
||||
object callbackObject);
|
||||
|
||||
int EndReceive(IAsyncResult ar);
|
||||
|
||||
///// <summary>
|
||||
///// current upload rate in b/s
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//double GetCurrentUploadRate();
|
||||
///// <summary>
|
||||
///// current download rate in b/s
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//double GetCurrentDownloadRate();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using DTS.Common.Base;
|
||||
using DTS.Common.Enums.Database;
|
||||
|
||||
namespace DTS.Common.Interface.Database
|
||||
{
|
||||
/// <summary>
|
||||
/// this viewmodel provides a way for transferring a remote database to a local database
|
||||
/// it clears the local database and populates it with the remote databse
|
||||
/// it requires a local database that has the right tables and stored procedures already
|
||||
/// </summary>
|
||||
public interface IDatabaseCopyViewModel : IBaseViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// the view associated with the model
|
||||
/// </summary>
|
||||
IDatabaseCopyView View { get; set; }
|
||||
/// <summary>
|
||||
/// frees up any memory associated with viewmodel
|
||||
/// </summary>
|
||||
void Unset();
|
||||
/// <summary>
|
||||
/// copies from remote database to local database
|
||||
/// uses DTS.Common.Storage to determine local and remote
|
||||
/// </summary>
|
||||
void CopyDatabase();
|
||||
/// <summary>
|
||||
/// initializes viewmodel state
|
||||
/// </summary>
|
||||
void InitializeState(DbType dbType, string dbName);
|
||||
string DbName { get; }
|
||||
/// <summary>
|
||||
/// the overall status/progress
|
||||
/// </summary>
|
||||
IStatusAndProgressBarView OverallProgressBarView { get; }
|
||||
/// <summary>
|
||||
/// current task status/progress
|
||||
/// </summary>
|
||||
IStatusAndProgressBarView CurrentTaskProgressBarView { get; }
|
||||
DbType DatabaseType { get; }
|
||||
|
||||
bool CopyEnabled { get; }
|
||||
bool IsCopyVisible { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,283 @@
|
||||
using DTS.Common.Classes.Sensors;
|
||||
using DTS.Common.Enums;
|
||||
using DTS.Common.Enums.Sensors;
|
||||
using DTS.Common.Interface.Sensors.SoftwareFilters;
|
||||
using System;
|
||||
using System.IO.Ports;
|
||||
|
||||
namespace DTS.Common.Interface.Sensors
|
||||
{
|
||||
public interface ISensorData
|
||||
{
|
||||
string DIUnits { get; set; }
|
||||
/// <summary>
|
||||
/// gets the calibration due date for the sensor given a sensor calibration
|
||||
/// 13065 Sensor "First Use" Date
|
||||
/// </summary>
|
||||
DateTime GetDueDate(ISensorCalibration sc);
|
||||
/// <summary>
|
||||
/// initial offset information is stored in a sensor calibration at least in terms of possible settings for the sensor
|
||||
/// HOWEVER, the offset to use is stored here for convenience, this is the result of group or test parameters
|
||||
///
|
||||
/// </summary>
|
||||
InitialOffset InitialOffset { get; set; }
|
||||
SensorConstants.BridgeType Bridge { get; set; }
|
||||
ISensorCalibration GetLatestCalibration();
|
||||
ISensorCalibration NewEmbeddedSC(string units);
|
||||
|
||||
int DatabaseId { get; set; }
|
||||
/// <summary>
|
||||
/// 11260 Implement DiagnosticsMode in DataPRO
|
||||
/// DiagnosticsMode means the bridge in analog is short circuited to the outside world and only internal resistors are used
|
||||
/// </summary>
|
||||
bool DiagnosticsMode { get; set; }
|
||||
|
||||
bool IsTestSpecificDigitalOutput { get; set; }
|
||||
bool IsTestSpecificSquib { get; set; }
|
||||
/// <summary>
|
||||
/// returns true if the sensor is a test specific digital input
|
||||
/// a digital input only created inside a test
|
||||
/// </summary>
|
||||
bool IsTestSpecificDigitalIn { get; set; }
|
||||
bool IsTestSpecificEmbedded { get; set; }
|
||||
/// <summary>
|
||||
/// returns true if the sensor is a test specific thermocoupler
|
||||
/// </summary>
|
||||
bool IsTestSpecificThermo { get; }
|
||||
bool IsTestSpecificEmbeddedClock { get; set; }
|
||||
bool IsTestSpecificStreamInput { get; set; }
|
||||
bool IsTestSpecificStreamOutput { get; set; }
|
||||
bool IsTestSpecificUart { get; set; }
|
||||
bool IsTestSpecificCan { get; set; }
|
||||
/// <summary>
|
||||
/// At one time all the different DelayMS were using one underlying property for storage, _delayMS.
|
||||
/// Now, the individual SquibFireDelayMS, etc. are defined because we don't want controls that are sharing to limit each other.
|
||||
/// </summary>
|
||||
double DelayMS { get; set; }
|
||||
|
||||
double DigitalOutputDelayMS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// At one time all the different DurationMS were using one underlying property for storage, _durationMS.
|
||||
/// Now, the individual SquibFireDurationMS, etc. are defined because we don't want controls that are sharing to limit each other.
|
||||
/// </summary>
|
||||
double DurationMS { get; set; }
|
||||
double DigitalOutputDurationMS { get; set; }
|
||||
DigitalOutputModes DigitalOutputMode { get; set; }
|
||||
bool DigitalOutputLimitDuration { get; set; }
|
||||
double SquibFireDelayMS { get; set; }
|
||||
double SquibFireDurationMS { get; set; }
|
||||
/// <summary>
|
||||
/// right now all the Limit Duration mechanisms using the same underlying property for storage (_limitDuration), however
|
||||
/// the public access methods (LimitSquibDuration, etc) exist in case we separate them out in the future
|
||||
/// </summary>
|
||||
bool LimitDuration { get; set; }
|
||||
bool LimitSquibFireDuration { get; set; }
|
||||
double SquibToleranceLow { get; set; }
|
||||
double SquibToleranceHigh { get; set; }
|
||||
SquibMeasurementType SquibMeasurementType { get; set; }
|
||||
double SquibOutputCurrent { get; set; }
|
||||
string DisplayUnit { get; }
|
||||
bool BypassCurrentFilter { get; }
|
||||
bool BypassVoltageFilter { get; }
|
||||
SquibFireMode SquibFireMode { get; set; }
|
||||
/// <summary>
|
||||
/// the setting name allows us to refer to different settings and allow it to be more easily included in test setups and channel setups
|
||||
/// </summary>
|
||||
string SettingName { get; set; }
|
||||
|
||||
DigitalInputModes InputMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns comment string. Returns serial number with axis if comment is not present.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
string ToDisplayString();
|
||||
void ReadXML(System.Xml.XmlElement root);
|
||||
void WriteXML(ref System.Xml.XmlWriter writer, bool exportFirstUseDate = true);
|
||||
string UUID { get; set; }
|
||||
string SerialNumber { get; set; }
|
||||
string GetSerialNumberWithAxis(string format);
|
||||
string UserSerialNumber { get; set; }
|
||||
SensorStatus Status { get; set; }
|
||||
string EID { get; set; }
|
||||
string Comment { get; set; }
|
||||
bool PerformShuntEmulation { get; }
|
||||
bool CalSignal { get; set; }
|
||||
double InternalShuntResistance { get; set; }
|
||||
double ExternalShuntResistance { get; set; }
|
||||
string UserValue1 { get; set; }
|
||||
string UserValue2 { get; set; }
|
||||
string UserValue3 { get; set; }
|
||||
string GetSerializedSupportedExcitation();
|
||||
void SetSupportedExcitationFromString(string s);
|
||||
DateTime Created { get; set; }
|
||||
int TimesUsed { get; set; }
|
||||
int SensorCategory { get; set; }
|
||||
bool ByPassFilter { get; set; }
|
||||
bool CheckCalibrationSignal { get; set; }
|
||||
string TestObject { get; set; }
|
||||
string OriginalPosition { get; set; }
|
||||
string Position { get; set; }
|
||||
string MainLocation { get; set; }
|
||||
string FineLocation1 { get; set; }
|
||||
string FineLocation2 { get; set; }
|
||||
string FineLocation3 { get; set; }
|
||||
string FilterClassIso { get; set; }
|
||||
bool IncompatibleSensorAssignment(string sensorDimension, string channelDimension);
|
||||
bool IsDigitalInput();
|
||||
bool IsDigitalOutput();
|
||||
bool IsSquib();
|
||||
bool IsUart();
|
||||
bool IsCan();
|
||||
/// <summary>
|
||||
/// uart baud rate
|
||||
/// </summary>
|
||||
uint UartBaudRate { get; set; }
|
||||
/// <summary>
|
||||
/// uart data bits
|
||||
/// </summary>
|
||||
uint UartDataBits { get; set; }
|
||||
/// <summary>
|
||||
/// uart stop bits
|
||||
/// </summary>
|
||||
StopBits UartStopBits { get; set; }
|
||||
/// <summary>
|
||||
/// uart parity
|
||||
/// </summary>
|
||||
Parity UartParity { get; set; }
|
||||
/// <summary>
|
||||
/// uart flow control FB 30486 Hardcode FlowControl to NONE for UART sensor type.
|
||||
/// </summary>
|
||||
Handshake UartFlowControl { get; }
|
||||
/// <summary>
|
||||
/// the data format of incoming data
|
||||
/// </summary>
|
||||
UartDataFormat UartDataFormat { get; set; }
|
||||
bool CanIsFD { get; set; }
|
||||
int CanArbBaseBitrate { get; set; }
|
||||
int CanArbBaseSJW { get; set; }
|
||||
int CanDataBitrate { get; set; }
|
||||
int CanDataSJW { get; set; }
|
||||
string CanFileType { get; set; }
|
||||
bool IsStreamInput();
|
||||
///<summary>
|
||||
/// udp address setting value
|
||||
///</summary>
|
||||
string StreamInUDPAddress { get; set; }
|
||||
bool IsStreamOutput();
|
||||
bool IsThermocoupler();
|
||||
///<summary>
|
||||
/// udp profile setting value
|
||||
///</summary>
|
||||
UDPStreamProfile StreamOutUDPProfile { get; set; }
|
||||
///<summary>
|
||||
/// udp address setting value
|
||||
///</summary>
|
||||
string StreamOutUDPAddress { get; set; }
|
||||
///<summary>
|
||||
/// time channel id setting value
|
||||
///</summary>
|
||||
ushort StreamOutUDPTimeChannelId { get; set; }
|
||||
///<summary>
|
||||
/// data channel id setting value
|
||||
///</summary>
|
||||
ushort StreamOutUDPDataChannelId { get; set; }
|
||||
///<summary>
|
||||
/// tmns config setting value
|
||||
///</summary>
|
||||
string StreamOutUDPTmNSConfig { get; set; }
|
||||
///<summary>
|
||||
/// irig data packet interval setting value
|
||||
///</summary>
|
||||
ushort StreamOutIRIGTimeDataPacketIntervalMs { get; set; }
|
||||
/// <summary>
|
||||
/// interval in ms between sending out TMATs information
|
||||
/// http://manuscript.dts.local/f/cases/29987/Add-CG-DP-TMATS-interval-UI-support
|
||||
/// </summary>
|
||||
ushort StreamOutTMATSIntervalMs { get; set; }
|
||||
bool CheckOffset { get; set; }
|
||||
bool MeasureNoise { get; set; }
|
||||
|
||||
bool MeasureExcitation { get; set; }
|
||||
|
||||
bool Invert { get; set; }
|
||||
|
||||
string Model { get; set; }
|
||||
|
||||
string Manufacturer { get; set; }
|
||||
|
||||
string UserPartNumber { get; set; }
|
||||
|
||||
double Capacity { get; set; }
|
||||
//FB 13120 Added FilterClass property
|
||||
IFilterClass FilterClass { get; set; }
|
||||
|
||||
double FullScaleCapacity { get; }
|
||||
double OffsetToleranceLow { get; set; }
|
||||
double OffsetToleranceHigh { get; set; }
|
||||
|
||||
void SetDisplayUnitNoNotify(string unit);
|
||||
|
||||
double RangeLow { get; set; }
|
||||
double RangeMedium { get; set; }
|
||||
double RangeHigh { get; set; }
|
||||
|
||||
ExcitationVoltageOptions.ExcitationVoltageOption[] SupportedExcitation { get; set; }
|
||||
|
||||
void SetExcitationsNoNotify(ExcitationVoltageOptions.ExcitationVoltageOption[] excitations);
|
||||
|
||||
ISensorCalibration Calibration { get; set; }
|
||||
|
||||
double BridgeResistance { get; set; }
|
||||
bool UniPolar { get; set; }
|
||||
|
||||
bool IgnoreRange { get; set; }
|
||||
|
||||
string LastUpdatedBy { get; set; }
|
||||
|
||||
int Version { get; set; }
|
||||
|
||||
void SetLocalOnly(bool bLocalOnly);
|
||||
|
||||
short AxisNumber { get; set; }
|
||||
|
||||
short NumberOfAxes { get; set; }
|
||||
int CalInterval { get; set; }
|
||||
string Polarity { get; set; }
|
||||
|
||||
DateTime LastModified { get; set; }
|
||||
|
||||
string ISOCode { get; set; }
|
||||
string ISOChannelName { get; set; }
|
||||
string UserCode { get; set; }
|
||||
string UserChannelName { get; set; }
|
||||
string PhysicalDimension { get; set; }
|
||||
|
||||
string Direction { get; set; }
|
||||
bool DoNotUse { get; set; }
|
||||
|
||||
//FB 43046
|
||||
double SensitivityTolerancePercent { get; set; }
|
||||
|
||||
bool Broken { get; set; }
|
||||
double InputActiveValue { get; set; }
|
||||
double InputDefaultValue { get; set; }
|
||||
FilterClassType FilterType { get; }
|
||||
int SensorCalWarningPeriodDays { get; set; }
|
||||
/// <summary>
|
||||
/// Date of first use, null indicates value not set
|
||||
/// value is only valid when using the latest calibration (as indicated by LatestCalibrationId)
|
||||
/// 13065 Sensor "First Use" Date
|
||||
/// </summary>
|
||||
DateTime? FirstUseDate { get; set; }
|
||||
/// <summary>
|
||||
/// Latest calibration for sensor, null indicates value not set
|
||||
/// 13065 Sensor "First Use" Date
|
||||
/// </summary>
|
||||
int? LatestCalibrationId { get; set; }
|
||||
int UsageCount { get; set; }
|
||||
int MaximumUsage { get; set; }
|
||||
string AssemblyName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using DTS.Common.Base;
|
||||
|
||||
namespace DTS.Common.Interface
|
||||
{
|
||||
public interface IMenuViewModel : IBaseViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Shell View.
|
||||
/// </summary>
|
||||
IMenuView View { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using DTS.Common.Interface.Groups;
|
||||
using DTS.Common.Interface.Groups.GroupList;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Data;
|
||||
|
||||
namespace DTS.Common.Classes.Groups
|
||||
{
|
||||
/// <summary>
|
||||
/// represents a record in the GroupHardware table in the db
|
||||
/// <inheritdoc cref="IChannelDbRecord"/>
|
||||
/// </summary>
|
||||
public class GroupHardwareDbRecord : Base.BasePropertyChanged, IGroupHardwareDbRecord
|
||||
{
|
||||
protected int _id = -1;
|
||||
/// <summary>
|
||||
/// The database id of the Channel
|
||||
/// </summary>
|
||||
[Key]
|
||||
public int Id
|
||||
{
|
||||
get => _id;
|
||||
set => SetProperty(ref _id, value, "Id");
|
||||
}
|
||||
|
||||
private int _groupId = -1;
|
||||
public int GroupId
|
||||
{
|
||||
get => _groupId;
|
||||
set => SetProperty(ref _groupId, value, "GroupId");
|
||||
}
|
||||
|
||||
private int _dasId = -1;
|
||||
public int DASId
|
||||
{
|
||||
get => _dasId;
|
||||
set => SetProperty(ref _dasId, value, "DASId");
|
||||
}
|
||||
|
||||
private string _serialNumber = string.Empty;
|
||||
public string SerialNumber
|
||||
{
|
||||
get => _serialNumber;
|
||||
set => SetProperty(ref _serialNumber, value, "SerialNumber");
|
||||
}
|
||||
|
||||
public GroupHardwareDbRecord() { }
|
||||
public GroupHardwareDbRecord(IGroupHardwareDbRecord copy)
|
||||
{
|
||||
Id = copy.Id;
|
||||
GroupId = copy.GroupId;
|
||||
DASId = copy.DASId;
|
||||
SerialNumber = copy.SerialNumber;
|
||||
}
|
||||
public GroupHardwareDbRecord(IDataReader reader)
|
||||
{
|
||||
Id = Utility.GetInt(reader, "RecordId", -1);
|
||||
GroupId = Utility.GetInt(reader, "GroupId", -1);
|
||||
DASId = Utility.GetInt(reader, "DASId", -1);
|
||||
SerialNumber = Utility.GetString(reader, "SerialNumber");
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Reference in New Issue
Block a user