init
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
namespace DTS.Common.Enums.DASFactory
|
||||
{
|
||||
public enum S6DBDiagnosticChannelList
|
||||
{
|
||||
//These match previous Base channels
|
||||
InputVoltage = 0,
|
||||
BackupVoltage = 1,
|
||||
TemperatureC = 2,
|
||||
BatterySoc = 3,
|
||||
|
||||
//These are the rest of the DB diag channels
|
||||
DiagInputVoltage = 100,
|
||||
DiagMcuTemperature = 101,
|
||||
DiagChargerPower = 102,
|
||||
DiagChargerInputCurrent = 103,
|
||||
//DiagChargerDischargeCurrent = 104,
|
||||
DiagEnv_1_Temperature = 104, //Internal
|
||||
DiagEnv_1_Humidity = 105, //Internal
|
||||
DiagEnv_2_Temperature = 106,
|
||||
DiagEnv_2_Humidity = 107,
|
||||
DiagEnv_3_Temperature = 108,
|
||||
DiagEnv_3_Humidity = 109,
|
||||
DiagEnv_4_Temperature = 110,
|
||||
DiagEnv_4_Humidity = 111,
|
||||
DiagEnv_5_Temperature = 112,
|
||||
DiagEnv_5_Humidity = 113,
|
||||
DiagBatterySoc = 114,
|
||||
DiagBatteryPackVoltage = 115,
|
||||
DiagBatteryPackCurrent = 116,
|
||||
DiagBatteryFgTemperature = 117,
|
||||
DiagBatteryThermistor1Temperature = 118,
|
||||
DiagBatteryThermistor2Temperature = 119,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace DTS.Common.Classes.Viewer.Commands
|
||||
{
|
||||
public class RelayCommand : ICommand
|
||||
{
|
||||
#region Fields
|
||||
|
||||
readonly Action<object> _execute;
|
||||
readonly Predicate<object> _canExecute;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public RelayCommand(Action<object> execute)
|
||||
: this(execute, null)
|
||||
{
|
||||
}
|
||||
|
||||
public RelayCommand(Action<object> execute, Predicate<object> canExecute)
|
||||
{
|
||||
_execute = execute ?? throw new ArgumentNullException("execute");
|
||||
_canExecute = canExecute;
|
||||
}
|
||||
#endregion // Constructors
|
||||
|
||||
#region ICommand Members
|
||||
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
return _canExecute?.Invoke(parameter) ?? true;
|
||||
}
|
||||
|
||||
public event EventHandler CanExecuteChanged
|
||||
{
|
||||
add => CommandManager.RequerySuggested += value;
|
||||
remove => CommandManager.RequerySuggested -= value;
|
||||
}
|
||||
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
_execute(parameter);
|
||||
}
|
||||
|
||||
#endregion // ICommand Members
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using DTS.Common.Base;
|
||||
using System.Collections.Generic;
|
||||
using DTS.Common.Enums.Sensors;
|
||||
using DTS.Common.Interface.Pagination;
|
||||
|
||||
namespace DTS.Common.Interface.Sensors.SensorsList
|
||||
{
|
||||
public interface ISensorsListEditGroupViewModel : IBaseViewModel, IFilterableListView
|
||||
{
|
||||
ISensorsListEditGroupView View { get; set; }
|
||||
IAnalogSensor[] AnalogSensors { get; set; }
|
||||
ISquib[] Squibs { get; set; }
|
||||
IDigitalInputSetting[] DigitalInputSettings { get; set; }
|
||||
IDigitalOutputSetting[] DigitalOutputSettings { get; set; }
|
||||
IUartIOSetting[] UartSettings { get; set; }
|
||||
IStreamOutputSetting[] StreamOutputSettings { get; set; }
|
||||
void GetSensors(int sensorCalWarningPeriodDays, bool dontAllowDataCollectionIfOverused, int sensorUsageWarningPeriodCount, bool included);
|
||||
void SetCapacityFormat(string format);
|
||||
void Sort(object sortBy, bool bColumnClick);
|
||||
void Unset();
|
||||
void Filter(string currentFilter);
|
||||
void FilterSquib(object columnTag, string searchTerm);
|
||||
void FilterDigitalIn(object columnTag, string searchTerm);
|
||||
void FilterDigitalOut(object columnTag, string searchTerm);
|
||||
void FilterUartIO(object columnTag, string searchTerm);
|
||||
void FilterStreamOut(object columnTag, string searchTerm);
|
||||
void FilterStreamIn(object columnTag, string searchTerm);
|
||||
void SetShowAssigned(bool showAssigned, bool showUnassigned, IReadOnlyDictionary<string, bool> assignedSensors);
|
||||
void SetShowOnline(bool showOnline);
|
||||
void SetAssignedSensors(IReadOnlyDictionary<string, bool> serialNumbers);
|
||||
void SetOnline(Dictionary<string, bool> serialNumbersToOnline);
|
||||
bool IsSensorOnline(string serialNumber);
|
||||
void SetCachedSensors(ISensorData[] cachedSensors);
|
||||
void SetCachedCalibrations(ISensorCalibration[] calibrations);
|
||||
// sets the currently active tab to the type of sensor (analog/squib/di/dout)
|
||||
void SetActiveTab(PossibleFilters filter);
|
||||
void HandleAssemblyVisibilityColumns(bool bDontAllowDataCollectionIfOverused);
|
||||
void HandleInspectBeforeUseVisibilityColumn(bool allow);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using DTS.Common.Classes.DASFactory;
|
||||
|
||||
namespace DTS.Common.Interface.DASFactory.Diagnostics
|
||||
{
|
||||
public interface IDiagnosticMessagesDevice
|
||||
{
|
||||
string[] GetFatalErrorFields();
|
||||
DiagnosticMessageRow[] GetCurrentDiagnosticMessages(string[] fields, bool failingOnly);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Input;
|
||||
using DTS.Common.Interface.Channels.ChannelCodes;
|
||||
|
||||
namespace DTS.Common.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for LookupPopup.xaml
|
||||
/// </summary>
|
||||
public partial class LookupPopup : Popup
|
||||
{
|
||||
public IEnumerable<IChannelCode> AllChannelCodes { get; private set; }
|
||||
|
||||
public LookupPopup()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public delegate void ChannelCodeSelectedEventHandler(object sender, string code, string name);
|
||||
|
||||
public event ChannelCodeSelectedEventHandler ChannelCodeSelected;
|
||||
private void LookupPopup_OnOpenedClosed(object sender, EventArgs e)
|
||||
{
|
||||
//OnPropertyChanged(new PropertyChangedEventArgs("PossibleChannels"));
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty PossibleChannelsProperty =
|
||||
DependencyProperty.Register(
|
||||
"PossibleChannels",
|
||||
typeof(IList),
|
||||
typeof(LookupPopup),
|
||||
new PropertyMetadata(Enumerable.Repeat(new { Code = "", Name = "" }, 0).ToList())
|
||||
);
|
||||
|
||||
public IList PossibleChannels
|
||||
{
|
||||
get => (IList)GetValue(PossibleChannelsProperty);
|
||||
set => SetValue(PossibleChannelsProperty, value);
|
||||
}
|
||||
|
||||
private void PossibleChannels_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (sender == null) return;
|
||||
if (((DataGrid)sender).SelectedIndex < 0) return;
|
||||
|
||||
var item = PossibleChannels[((DataGrid)sender).SelectedIndex];
|
||||
e.Handled = false;
|
||||
ChannelCodeSelected?.Invoke(this, item.GetType().GetProperty("Code")?.GetValue(item, null).ToString(), item.GetType().GetProperty("Name")?.GetValue(item, null).ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
|
||||
namespace DTS.Common.Classes.Sensors
|
||||
{
|
||||
/// <summary>
|
||||
/// public helper class for ZeroRefence in SIFs, which is serialized to an int
|
||||
/// </summary>
|
||||
public class ZeroRef
|
||||
{
|
||||
public enum ZeroType
|
||||
{
|
||||
AverageOverTime,
|
||||
UsePreEventDiagnostics,
|
||||
UseZeroMv
|
||||
}
|
||||
|
||||
public ZeroType ZeroMethod { get; }
|
||||
|
||||
public ZeroRef(string zeroref)
|
||||
{
|
||||
switch (zeroref)
|
||||
{
|
||||
case "0":
|
||||
ZeroMethod = ZeroType.AverageOverTime;
|
||||
break;
|
||||
case "1":
|
||||
ZeroMethod = ZeroType.UsePreEventDiagnostics;
|
||||
break;
|
||||
case "2":
|
||||
ZeroMethod = ZeroType.UseZeroMv;
|
||||
break;
|
||||
default:
|
||||
throw new NotSupportedException("TDAS::ZeroRef Invalid ZeroRef " + zeroref);
|
||||
}
|
||||
}
|
||||
public ZeroRef(ZeroType type) { ZeroMethod = type; }
|
||||
public override string ToString()
|
||||
{
|
||||
switch (ZeroMethod)
|
||||
{
|
||||
case ZeroType.AverageOverTime:
|
||||
return "0";
|
||||
case ZeroType.UsePreEventDiagnostics:
|
||||
return "1";
|
||||
case ZeroType.UseZeroMv:
|
||||
return "2";
|
||||
default:
|
||||
throw new NotSupportedException("TDAS::ZeroRef Invalid ZeroRef " + ZeroMethod);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1,21 @@
|
||||
namespace DTS.Common.Enums.DBExport
|
||||
{
|
||||
/// <summary>
|
||||
/// different tags for an ISODll.MMEFineLocation3
|
||||
/// </summary>
|
||||
public enum CustomFinLoc3Fields
|
||||
{
|
||||
Date,
|
||||
Expired,
|
||||
Fine_Loc_3,
|
||||
History,
|
||||
Last_Change,
|
||||
Last_Change_Text,
|
||||
Remarks,
|
||||
S_GUID,
|
||||
SortKey,
|
||||
Text_L1,
|
||||
Text_L2,
|
||||
Version,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user