init
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
namespace DTS.Common.Enums.Sensors.SensorsList
|
||||
{
|
||||
public enum UartSettingFields
|
||||
{
|
||||
Included,
|
||||
SerialNumber,
|
||||
BaudRate,
|
||||
DataBits,
|
||||
StopBits,
|
||||
Parity,
|
||||
FlowControl,
|
||||
DataFormat,
|
||||
LastModifiedBy,
|
||||
LastModified
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,187 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Threading;
|
||||
using DTS.Common.Base;
|
||||
using DTS.Common.Events;
|
||||
using Microsoft.Practices.Prism.Commands;
|
||||
using Microsoft.Practices.Prism.Events;
|
||||
using Microsoft.Practices.Prism.Interactivity.InteractionRequest;
|
||||
using Microsoft.Practices.Prism.Regions;
|
||||
using Microsoft.Practices.Unity;
|
||||
|
||||
namespace DTS.Common.RibbonControl
|
||||
{
|
||||
public class RibbonViewModel<TModel> :BasePropertyChanged, IRibbonViewModel
|
||||
where TModel : class
|
||||
{
|
||||
protected IEventAggregator Aggregator { get; }
|
||||
protected IUnityContainer Container { get; }
|
||||
protected IRegionManager RegionManager { get; }
|
||||
public TModel Model { get; set; }
|
||||
public IRibbonView View { get; }
|
||||
|
||||
protected RibbonViewModel(IRibbonView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
|
||||
{
|
||||
View = view;
|
||||
Aggregator = eventAggregator;
|
||||
Container = unityContainer;
|
||||
RegionManager = regionManager;
|
||||
CreateCommands();
|
||||
}
|
||||
|
||||
protected virtual void CreateCommands()
|
||||
{
|
||||
ConfirmationRequest = new InteractionRequest<Confirmation>();
|
||||
CloseCommand = new DelegateCommand<object>(CloseMethod);
|
||||
}
|
||||
|
||||
#region Commands
|
||||
|
||||
/// <summary>
|
||||
/// The interaction request to display the confirmation.
|
||||
/// </summary>
|
||||
public InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The delegate command to close object.
|
||||
/// </summary>
|
||||
public DelegateCommand<object> CloseCommand { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// This is an execute method for the <see cref="CloseCommand">CloseCommand</see>.
|
||||
/// </summary>
|
||||
/// <param name="parameter">The parameter to pass to the <see cref="CloseCommand">CloseCommand</see>.</param>
|
||||
protected virtual void CloseMethod(object parameter)
|
||||
{
|
||||
CleanupAtClose();
|
||||
}
|
||||
|
||||
private void CleanupAtClose()
|
||||
{
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
#endregion Commands
|
||||
|
||||
#region Bases Methods
|
||||
|
||||
/// <summary>
|
||||
/// Executes after the viewmodel activated.
|
||||
/// </summary>
|
||||
public virtual void Activated()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Publishes the <see cref="ShowStatus">ShowStatus</see> during the viewmodel initialization.
|
||||
/// </summary>
|
||||
public virtual void Initialize()
|
||||
{
|
||||
Aggregator.GetEvent<ShowStatus>()
|
||||
.Publish(new StatusInfo(StatusInfo.StatusState.Busy, Strings.Strings.Loading));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Publishes the <see cref="ShowStatus">ShowStatus</see> during the viewmodel initialization.
|
||||
/// </summary>
|
||||
/// <param name="parameter">The parameter to be used initialize viewmodel.</param>
|
||||
public virtual void Initialize(object parameter)
|
||||
{
|
||||
Aggregator.GetEvent<ShowStatus>()
|
||||
.Publish(new StatusInfo(StatusInfo.StatusState.Busy, Strings.Strings.Loading));
|
||||
}
|
||||
|
||||
public void Initialize(object parameter, object model)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Publishes the <see cref="ShowStatus">ShowStatus</see> during the viewmodel initialization.
|
||||
/// </summary>
|
||||
public virtual async Task InitializeAsync()
|
||||
{
|
||||
await Dispatcher.CurrentDispatcher.InvokeAsync(() =>
|
||||
{
|
||||
Aggregator.GetEvent<ShowStatus>()
|
||||
.Publish(new StatusInfo(StatusInfo.StatusState.Busy, Strings.Strings.Loading));
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Publishes the <see cref="ShowStatus">ShowStatus</see> during the viewmodel initialization.
|
||||
/// </summary>
|
||||
/// <param name="parameter">The parameter to be used initialize viewmodel.</param>
|
||||
public virtual async Task InitializeAsync(object parameter)
|
||||
{
|
||||
await Dispatcher.CurrentDispatcher.InvokeAsync(() =>
|
||||
{
|
||||
Aggregator.GetEvent<ShowStatus>()
|
||||
.Publish(new StatusInfo(StatusInfo.StatusState.Busy, Strings.Strings.Loading));
|
||||
});
|
||||
}
|
||||
|
||||
#endregion Bases Methods
|
||||
|
||||
#region Methods
|
||||
#region PropertyChanged
|
||||
///<summary>
|
||||
///Occurs when a property value changes.
|
||||
///</summary>
|
||||
public new event PropertyChangedEventHandler PropertyChanged;
|
||||
private new void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
var eventHandler = PropertyChanged;
|
||||
if (eventHandler != null)
|
||||
{
|
||||
eventHandler(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
#endregion PropertyChanged
|
||||
#endregion Methods
|
||||
|
||||
#region Properties
|
||||
private bool _isMenuIncluded = true;
|
||||
public bool IsMenuIncluded
|
||||
{
|
||||
get => _isMenuIncluded;
|
||||
set
|
||||
{
|
||||
_isMenuIncluded = value;
|
||||
OnPropertyChanged("IsMenuIncluded");
|
||||
}
|
||||
}
|
||||
private bool _isNavigationIncluded = false;
|
||||
public bool IsNavigationIncluded
|
||||
{
|
||||
get => _isNavigationIncluded;
|
||||
set
|
||||
{
|
||||
_isNavigationIncluded = value;
|
||||
OnPropertyChanged("IsNavigationIncluded");
|
||||
}
|
||||
}
|
||||
|
||||
public int Percentage { get; set; }
|
||||
public string IsBusyMessage { get; set; }
|
||||
public bool IsBusy { get; set; }
|
||||
public bool IsDirty { get; set; }
|
||||
|
||||
#endregion Properties
|
||||
|
||||
/// <summary>
|
||||
/// Sets the Model to null.
|
||||
/// </summary>
|
||||
public virtual void Cleanup()
|
||||
{
|
||||
Model = default(TModel);
|
||||
}
|
||||
|
||||
public Task CleanupAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,203 @@
|
||||
using DTS.Common.Interface.Sensors;
|
||||
|
||||
namespace DTS.Common.Interface.TestSetups
|
||||
{
|
||||
public interface IISFFile
|
||||
{
|
||||
/// <summary>
|
||||
/// RECORD_LENGTH bytes (80)
|
||||
/// </summary>
|
||||
char [] HeaderLine1 {get; set; }
|
||||
/// <summary>
|
||||
/// 8 characters, starting at character 7
|
||||
/// </summary>
|
||||
char [] TestSetupName {get; set;}
|
||||
/// <summary>
|
||||
/// starts at character 15, 5 characters long
|
||||
/// </summary>
|
||||
short NumberOfRecords { get; }
|
||||
/// <summary>
|
||||
/// 22 characters, starting at character 20
|
||||
/// </summary>
|
||||
char [] TestType { get; set; }
|
||||
/// <summary>
|
||||
/// 30 characters, starting at character 42
|
||||
/// </summary>
|
||||
char [] TestDivision { get; set; }
|
||||
/// <summary>
|
||||
/// 8 characters start at character 72, without .TCF extension
|
||||
/// </summary>
|
||||
char [] TCFile { get; set; }
|
||||
/// <summary>
|
||||
/// RECORD_LENGTH, we don't use anything from it currently...
|
||||
/// </summary>
|
||||
char [] HeaderLine2 { get; set; }
|
||||
/// <summary>
|
||||
/// RECORD_LENGTH, we don't use anything from it currently
|
||||
/// </summary>
|
||||
char [] HeaderLine3 { get; set; }
|
||||
|
||||
IISFSensorRecord [] Records { get; }
|
||||
/// <summary>
|
||||
/// adds a record, updates record count
|
||||
/// </summary>
|
||||
/// <param name="record"></param>
|
||||
void AddRecord(IISFSensorRecord record);
|
||||
void WriteToFile(string pathToFile);
|
||||
void AddSensors(ISensorData[] sensors);
|
||||
}
|
||||
|
||||
public interface IISFSensorRecord
|
||||
{
|
||||
/// <summary>
|
||||
/// RECORD_LENGTH the whole first record
|
||||
/// </summary>
|
||||
char [] Record1 { get; set; }
|
||||
/// <summary>
|
||||
/// 2 characters, starting at character 75
|
||||
/// </summary>
|
||||
char [] Tag { get; set; }
|
||||
/// <summary>
|
||||
/// 5 characters start at character 7
|
||||
/// </summary>
|
||||
char [] DataChannelNumber { get; set; }
|
||||
void SetDataChannelNumber(short value);
|
||||
|
||||
/// <summary>
|
||||
/// 1 character, starting at character 15
|
||||
/// </summary>
|
||||
bool UserIdSensorIDIsNotSpecified { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 11 characters start at 19
|
||||
/// </summary>
|
||||
char [] CapacityCharacters { get; set; }
|
||||
void SetCapacity(double capacity);
|
||||
double GetCapacity();
|
||||
/// <summary>
|
||||
/// 12 characters, starting at 30
|
||||
/// </summary>
|
||||
char [] SerialNumber { get; set; }
|
||||
/// <summary>
|
||||
/// 11 characters, start at 42
|
||||
/// is Sensitivity/1000 (V)
|
||||
/// can also be c0 if polynomial
|
||||
/// </summary>
|
||||
char [] Sensitivity { get; set; }
|
||||
void SetSensitivity(double sensitivity);
|
||||
double GetSensitivity();
|
||||
/// <summary>
|
||||
/// 11 characters starting at 53
|
||||
/// </summary>
|
||||
char [] BridgeResistance { get; set; }
|
||||
|
||||
void SetBridgeResistance(double resistance);
|
||||
/// <summary>
|
||||
/// RECORD_LENGTH
|
||||
/// </summary>
|
||||
char [] Record2 { get; set; }
|
||||
/// <summary>
|
||||
/// 12 characters, starting at character 7 (of record 2)
|
||||
/// </summary>
|
||||
char [] EngineeringUnits { get; set; }
|
||||
/// <summary>
|
||||
/// 11 characters, starting at character 20
|
||||
/// </summary>
|
||||
char [] C1 { get; set; }
|
||||
void SetC1(double c1);
|
||||
double GetC1();
|
||||
/// <summary>
|
||||
/// 17 characters, starting at character 31
|
||||
/// </summary>
|
||||
char [] EID { get; set; }
|
||||
/// <summary>
|
||||
/// 4 characters, starting at 49
|
||||
/// </summary>
|
||||
char [] Unknown1 { get; set; }
|
||||
/// <summary>
|
||||
/// 2 characters, starting at 53
|
||||
/// </summary>
|
||||
char [] Unknown2 { get; set; }
|
||||
/// <summary>
|
||||
/// 11 characters starting at 55 (TOM ONLY [sensortype TI])
|
||||
/// is /1000 of ordinary
|
||||
/// </summary>
|
||||
char [] FireDelay { get; set; }
|
||||
/// <summary>
|
||||
/// 8 characters, starting at 66
|
||||
/// STANDARD is the default value, we don't really support anything else currently
|
||||
/// </summary>
|
||||
char [] TOMConfigurationName { get; set; }
|
||||
/// <summary>
|
||||
/// RECORD_LENGTH, third record of 4
|
||||
/// </summary>
|
||||
char [] Record3 { get; set; }
|
||||
/// <summary>
|
||||
/// 15 characters start at 14 of record 3
|
||||
/// </summary>
|
||||
char [] CommentPart1 { get; set; }
|
||||
/// <summary>
|
||||
/// 40 characters starting at 33
|
||||
/// </summary>
|
||||
char [] CommentPart2 { get; set; }
|
||||
/// <summary>
|
||||
/// RECORD_LENGTH, the 4th record of 4
|
||||
/// </summary>
|
||||
char [] Record4 { get; set; }
|
||||
/// <summary>
|
||||
/// 15 characters, starting at character 12
|
||||
/// </summary>
|
||||
char [] CommentPart3 { get; set; }
|
||||
/// <summary>
|
||||
/// sets CommentPart1, CommentPart2, CommentPart3
|
||||
/// </summary>
|
||||
/// <param name="s"></param>
|
||||
void SetSensorComment(string s);
|
||||
/// <summary>
|
||||
/// 20 characters starting at 30
|
||||
/// checked for digital inputs (should contain N/O or N/C)
|
||||
/// </summary>
|
||||
char [] SensorType { get; set; }
|
||||
/// <summary>
|
||||
/// 11 characters starting at 50
|
||||
/// </summary>
|
||||
char [] C2 { get; set; }
|
||||
void SetC2(double c2);
|
||||
/// <summary>
|
||||
/// 11 characters starting at 61
|
||||
/// notice for poly's we should be multiplying by 1000D?
|
||||
/// calibration.Records.Records.First().Poly.SetCoefficient(0, calibration.Records.Records[0].Sensitivity / 1000.0D);
|
||||
/// calibration.Records.Records.First().Poly.SetCoefficient(1, c1 / 1000.0D);
|
||||
/// calibration.Records.Records.First().Poly.SetCoefficient(2, c2 / 1000.0D);
|
||||
/// calibration.Records.Records.First().Poly.SetCoefficient(3, c3 / 1000.0D);
|
||||
/// </summary>
|
||||
char [] C3 { get; set; }
|
||||
void SetC3(double c3);
|
||||
/// <summary>
|
||||
/// writes record to stream
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
void Write(System.IO.BinaryWriter writer);
|
||||
|
||||
void SetSensor(ISensorData sensor);
|
||||
}
|
||||
|
||||
public abstract class ConstantsAndEnums
|
||||
{
|
||||
public const int RECORD_LENGTH = 80;
|
||||
public enum ISFKnownChannelTypes
|
||||
{
|
||||
VS,
|
||||
VU,
|
||||
SB,
|
||||
TI, //not analog (TOM)
|
||||
TC, //not analog (TOM)
|
||||
CT, //Digital
|
||||
XP,
|
||||
P4,
|
||||
VF,
|
||||
NB,
|
||||
EX
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user