init
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,18 @@
|
||||
using DTS.Common.Interface.Sensors.SensorsList;
|
||||
|
||||
namespace DTS.Common.Classes.Sensors.SensorsList
|
||||
{
|
||||
public class DragAndDropPayload
|
||||
{
|
||||
public IDragAndDropItem [] Items { get; }
|
||||
|
||||
public DragAndDropPayload(IDragAndDropItem[] items)
|
||||
{
|
||||
Items = items;
|
||||
}
|
||||
|
||||
public const string FORMAT = "DTS.Common.Classes.Sensors.SensorsList.DragAndDropPayload";
|
||||
public const string ALT_FORMAT = "ALT_DTS.Common.Classes.Sensors.SensorsList.DragAndDropPayload";
|
||||
public const string CTRL_FORMAT = "CTRL_DTS.Common.Classes.Sensors.SensorsList.DragAndDropPayload";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using DTS.Common.Base;
|
||||
using DTS.Common.Interface.DASFactory.Diagnostics;
|
||||
using DTS.Common.Interface.DASFactory.Diagnostics.HardwareList;
|
||||
using DTS.Common.Interface.DataRecorders;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DTS.Common.Interface.Hardware.AddEditHardware
|
||||
{
|
||||
public interface IAddEditHardwareViewModel : IBaseViewModel
|
||||
{
|
||||
IAddEditHardwareView View { get; set; }
|
||||
void Unset();
|
||||
/// <summary>
|
||||
/// hardware being operated on in viewmodel
|
||||
/// </summary>
|
||||
IAddEditHardwareHardware Hardware { get; set; }
|
||||
int? TestId{ get; set; }
|
||||
/// <summary>
|
||||
/// initializes the viewmodel with the given hardware
|
||||
/// </summary>
|
||||
void SetHardware(IDASHardware hw, IISOHardware isoHW);
|
||||
/// <summary>
|
||||
/// whether to send notifications of changes or not
|
||||
/// this can be used to avoid notifications when initializing things
|
||||
/// <summary>
|
||||
bool NotificationsOn { get; set; }
|
||||
/// <summary>
|
||||
/// returns true if the hardware can be committed, false otherwise
|
||||
/// </summary>
|
||||
bool Validate(IISOHardware isoHW, ref List<string> errors, ref List<string> warnings, bool displayWindow, bool IsAdd);
|
||||
/// <summary>
|
||||
/// commits any changes present
|
||||
/// </summary>
|
||||
void Save();
|
||||
IISOHardware GetISOHardware();
|
||||
/// <summary>
|
||||
/// Whether standin hardware is supported by the current model
|
||||
/// </summary>
|
||||
bool AllowStandin { get; set; }
|
||||
/// <summary>
|
||||
/// allows access to the SLICE6 treeview module
|
||||
/// </summary>
|
||||
void SetSLICE6TreeView(ISLICE6TreeView treeView, IHardwareListViewModel treeViewModel);
|
||||
/// <summary>
|
||||
/// access to the current SLICE6TreeView
|
||||
/// </summary>
|
||||
ISLICE6TreeView SLICE6TreeView { get; }
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 128 B |
@@ -0,0 +1,395 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Drawing;
|
||||
using System.Reflection;
|
||||
using System.Windows.Media.Imaging;
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace DTS.Common
|
||||
{
|
||||
public static class AssemblyInfo
|
||||
{
|
||||
public static Dictionary<string, BitmapImage> AssemblyImage = new Dictionary<string, BitmapImage>();
|
||||
|
||||
public static BitmapImage GetImage(string asmName)
|
||||
{
|
||||
return LoadImages().Where(x => x.AssemblyName == asmName).Select(z => z.AssemblyImage).FirstOrDefault();
|
||||
}
|
||||
|
||||
private static List<AssemblyNameImage> LoadImages()
|
||||
{
|
||||
var tilesLocation = Properties.Settings.Default.TilesLocation;
|
||||
return new List<AssemblyNameImage>
|
||||
{
|
||||
new AssemblyNameImage(eAssemblyGroups.Hardware.ToString(), AssemblyNames.DataRecorders.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.DataRecorders + ".png", UriKind.Relative)),
|
||||
0),
|
||||
new AssemblyNameImage(eAssemblyGroups.Hardware.ToString(), AssemblyNames.SensorTemplates.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.SensorTemplates + ".png", UriKind.Relative)),
|
||||
0),
|
||||
new AssemblyNameImage(eAssemblyGroups.Hardware.ToString(), AssemblyNames.SensorDatabase.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.SensorDatabase + ".png", UriKind.Relative)),
|
||||
0),
|
||||
new AssemblyNameImage(eAssemblyGroups.Prepare.ToString(), AssemblyNames.GroupTemplate.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.GroupTemplate + ".png", UriKind.Relative)),
|
||||
1),
|
||||
new AssemblyNameImage(eAssemblyGroups.Prepare.ToString(), AssemblyNames.Groups.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Groups + ".png", UriKind.Relative)), 1),
|
||||
new AssemblyNameImage(eAssemblyGroups.Prepare.ToString(), AssemblyNames.CustomerDetails.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.CustomerDetails + ".png", UriKind.Relative)),
|
||||
1),
|
||||
new AssemblyNameImage(eAssemblyGroups.Prepare.ToString(), AssemblyNames.EngineerDetails.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.EngineerDetails + ".png", UriKind.Relative)),
|
||||
1),
|
||||
new AssemblyNameImage(eAssemblyGroups.Prepare.ToString(), AssemblyNames.LabDetails.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.LabDetails + ".png", UriKind.Relative)), 1),
|
||||
new AssemblyNameImage(eAssemblyGroups.Prepare.ToString(), AssemblyNames.TestSetups.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.TestSetups + ".png", UriKind.Relative)), 1),
|
||||
new AssemblyNameImage(eAssemblyGroups.Prepare.ToString(), AssemblyNames.CustomChannels.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.CustomChannels + ".png", UriKind.Relative)),
|
||||
1),
|
||||
new AssemblyNameImage(eAssemblyGroups.Diagnostics.ToString(), AssemblyNames.CheckChannels.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.CheckChannels + ".png", UriKind.Relative)),
|
||||
2),
|
||||
new AssemblyNameImage(eAssemblyGroups.Diagnostics.ToString(), AssemblyNames.CheckTrigger.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.CheckTrigger + ".png", UriKind.Relative)), 2),
|
||||
new AssemblyNameImage(eAssemblyGroups.Record.ToString(), AssemblyNames.RunTest.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.RunTest + ".png", UriKind.Relative)), 3),
|
||||
new AssemblyNameImage(eAssemblyGroups.Record.ToString(), AssemblyNames.DownloadData.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.DownloadData + ".png", UriKind.Relative)), 3),
|
||||
new AssemblyNameImage(eAssemblyGroups.Review.ToString(), AssemblyNames.ViewData.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.ViewData + ".png", UriKind.Relative)), 4),
|
||||
new AssemblyNameImage(eAssemblyGroups.Review.ToString(), AssemblyNames.ExportData.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.ExportData + ".png", UriKind.Relative)), 4),
|
||||
new AssemblyNameImage(eAssemblyGroups.Administrative.ToString(), AssemblyNames.ManageUsers.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.ManageUsers + ".png", UriKind.Relative)), 5),
|
||||
new AssemblyNameImage(eAssemblyGroups.Administrative.ToString(),
|
||||
AssemblyNames.SystemSettings.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.SystemSettings + ".png", UriKind.Relative)),
|
||||
5),
|
||||
new AssemblyNameImage(eAssemblyGroups.Administrative.ToString(), AssemblyNames.Networking.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Networking + ".png", UriKind.Relative)), 5),
|
||||
|
||||
//Not avaiable yet...
|
||||
new AssemblyNameImage(eAssemblyGroups.Viewer.ToString(), AssemblyNames.Navigation.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Navigation + ".png", UriKind.Relative)), 5),
|
||||
new AssemblyNameImage(eAssemblyGroups.Viewer.ToString(), AssemblyNames.Eu.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Eu + ".png", UriKind.Relative)), 5),
|
||||
new AssemblyNameImage(eAssemblyGroups.Viewer.ToString(), AssemblyNames.Mv.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Mv + ".png", UriKind.Relative)), 5),
|
||||
new AssemblyNameImage(eAssemblyGroups.Viewer.ToString(), AssemblyNames.Edc.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Edc + ".png", UriKind.Relative)), 5),
|
||||
new AssemblyNameImage(eAssemblyGroups.Viewer.ToString(), AssemblyNames.Tests.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Tests + ".png", UriKind.Relative)), 5),
|
||||
new AssemblyNameImage(eAssemblyGroups.Viewer.ToString(), AssemblyNames.Graphs.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Graphs + ".png", UriKind.Relative)), 5),
|
||||
new AssemblyNameImage(eAssemblyGroups.Viewer.ToString(), AssemblyNames.Legend.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Legend + ".png", UriKind.Relative)), 5),
|
||||
new AssemblyNameImage(eAssemblyGroups.Viewer.ToString(), AssemblyNames.Diag.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Diag + ".png", UriKind.Relative)), 5),
|
||||
new AssemblyNameImage(eAssemblyGroups.Viewer.ToString(), AssemblyNames.Stats.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Stats + ".png", UriKind.Relative)), 5),
|
||||
new AssemblyNameImage(eAssemblyGroups.Viewer.ToString(), AssemblyNames.Cursor.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Cursor + ".png", UriKind.Relative)), 5),
|
||||
new AssemblyNameImage(eAssemblyGroups.Viewer.ToString(), AssemblyNames.Property.ToString(),
|
||||
new BitmapImage(new Uri(tilesLocation + AssemblyNames.Property + ".png", UriKind.Relative)), 5),
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public static Type ImageAttribute;
|
||||
}
|
||||
|
||||
public class AssemblyNameImage : INotifyPropertyChanged
|
||||
{
|
||||
public AssemblyNameImage()
|
||||
{
|
||||
}
|
||||
|
||||
public AssemblyNameImage(string group, string name, BitmapImage image, int sort)
|
||||
{
|
||||
_assemblyGroup = group;
|
||||
_assemblyName = name;
|
||||
_assemblyImage = image;
|
||||
_sortOrder = sort;
|
||||
OnPropertyChanged("AssemblyGroup");
|
||||
OnPropertyChanged("AssemblyName");
|
||||
OnPropertyChanged("AssemblyImage");
|
||||
}
|
||||
|
||||
private string _assemblyGroup = string.Empty;
|
||||
|
||||
public string AssemblyGroup
|
||||
{
|
||||
get => _assemblyGroup;
|
||||
set
|
||||
{
|
||||
_assemblyGroup = value;
|
||||
OnPropertyChanged("AssemblyGroup");
|
||||
}
|
||||
}
|
||||
|
||||
private string _assemblyName = string.Empty;
|
||||
|
||||
public string AssemblyName
|
||||
{
|
||||
get => _assemblyName;
|
||||
set
|
||||
{
|
||||
_assemblyName = value;
|
||||
OnPropertyChanged("AssemblyName");
|
||||
}
|
||||
}
|
||||
|
||||
private eAssemblyRegion _assemblyRegion = eAssemblyRegion.NotAssigned;
|
||||
|
||||
public eAssemblyRegion AssemblyRegion
|
||||
{
|
||||
get => _assemblyRegion;
|
||||
set
|
||||
{
|
||||
_assemblyRegion = value;
|
||||
OnPropertyChanged("AssemblyRegion");
|
||||
}
|
||||
}
|
||||
|
||||
BitmapImage _assemblyImage = new BitmapImage();
|
||||
|
||||
public BitmapImage AssemblyImage
|
||||
{
|
||||
get => _assemblyImage;
|
||||
set
|
||||
{
|
||||
_assemblyImage = value;
|
||||
OnPropertyChanged("AssemblyImage");
|
||||
}
|
||||
}
|
||||
|
||||
private int _sortOrder = 0;
|
||||
|
||||
public int SortOrder
|
||||
{
|
||||
get => _sortOrder;
|
||||
set
|
||||
{
|
||||
_sortOrder = value;
|
||||
OnPropertyChanged("SortOrder");
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Occurs when a property value changes.
|
||||
///</summary>
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
var eventHandler = PropertyChanged;
|
||||
if (eventHandler != null)
|
||||
{
|
||||
eventHandler(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class AssemblyGroups : INotifyPropertyChanged
|
||||
{
|
||||
public AssemblyGroups()
|
||||
{
|
||||
}
|
||||
|
||||
private string _asemblyGroupName = string.Empty;
|
||||
|
||||
public string AssemblyGroupName
|
||||
{
|
||||
get => _asemblyGroupName;
|
||||
set
|
||||
{
|
||||
_asemblyGroupName = value;
|
||||
OnPropertyChanged("AssemblyGroupName");
|
||||
}
|
||||
}
|
||||
|
||||
private List<AssemblyNameImage> _assemblyList = new List<AssemblyNameImage>();
|
||||
|
||||
public List<AssemblyNameImage> AssemblyList
|
||||
{
|
||||
get => _assemblyList;
|
||||
set
|
||||
{
|
||||
_assemblyList = value;
|
||||
OnPropertyChanged("AssemblyList");
|
||||
}
|
||||
}
|
||||
|
||||
private int _sortOrder = 0;
|
||||
|
||||
public int SortOrder
|
||||
{
|
||||
get => _sortOrder;
|
||||
set
|
||||
{
|
||||
_sortOrder = value;
|
||||
OnPropertyChanged("SortOrder");
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Occurs when a property value changes.
|
||||
///</summary>
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
|
||||
public enum eAssemblyGroups
|
||||
{
|
||||
Hardware,
|
||||
Prepare,
|
||||
Diagnostics,
|
||||
Record,
|
||||
Review,
|
||||
Administrative,
|
||||
Viewer
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Assembly Names, aka Pluggable components, aka Modules.
|
||||
/// </summary>
|
||||
public enum AssemblyNames
|
||||
{
|
||||
CheckChannels,
|
||||
CheckTrigger,
|
||||
CustomChannels,
|
||||
CustomerDetails,
|
||||
DataRecorders,
|
||||
DownloadData,
|
||||
EngineerDetails,
|
||||
LabDetails,
|
||||
ExportData,
|
||||
Groups,
|
||||
GroupTemplate,
|
||||
ManageUsers,
|
||||
RunTest,
|
||||
SensorDatabase,
|
||||
SensorTemplates,
|
||||
SystemSettings,
|
||||
TestSetups,
|
||||
ViewData,
|
||||
Networking,
|
||||
IsoSettings,
|
||||
PowerAndBattery,
|
||||
RealtimeSettings,
|
||||
TablesSettings,
|
||||
TestSettings,
|
||||
QASettings,
|
||||
UISettings,
|
||||
DB,
|
||||
Navigation,
|
||||
Eu,
|
||||
Mv,
|
||||
Edc,
|
||||
Tests,
|
||||
Graphs,
|
||||
Legend,
|
||||
Diag,
|
||||
Stats,
|
||||
Cursor,
|
||||
Property,
|
||||
Graph,
|
||||
GraphList,
|
||||
CPU,
|
||||
GroupImport,
|
||||
TestSummaryList,
|
||||
Filter,
|
||||
ChartOptions,
|
||||
TestModification,
|
||||
AddCalculatedChannel,
|
||||
TTSImport,
|
||||
StatusAndProgressBar,
|
||||
SensorsList,
|
||||
HardwareList,
|
||||
GroupTemplateList,
|
||||
GroupList,
|
||||
TestSetupsList,
|
||||
CachedItemsList,
|
||||
RealtimeModule,
|
||||
TemplateChannelList,
|
||||
DatabaseServices,
|
||||
GroupChannelList,
|
||||
RegionOfInterestChannels,
|
||||
Diagnostics,
|
||||
ChannelCodes,
|
||||
ChannelCodeBuilder,
|
||||
SoftwareFilters,
|
||||
SensorSettingsModule,
|
||||
SquibsModule,
|
||||
ViewerSettings,
|
||||
HamburgerMenu,
|
||||
AddEditHardware,
|
||||
ExtraProperties,
|
||||
PSDReport,
|
||||
PSDReportResults,
|
||||
PSDReportSettings
|
||||
}
|
||||
|
||||
public enum eAssemblyRegion
|
||||
{
|
||||
NotAssigned,
|
||||
NavigationRegion,
|
||||
EuRegion,
|
||||
MvRegion,
|
||||
EdcRegion,
|
||||
TestsRegion,
|
||||
GraphsRegion,
|
||||
LegendRegion,
|
||||
DiagRegion,
|
||||
StatsRegion,
|
||||
CursorRegion,
|
||||
PropertyRegion,
|
||||
DisplayRegion,
|
||||
GraphRegion,
|
||||
GraphListRegion,
|
||||
TestSummaryRegion,
|
||||
FilterRegion,
|
||||
ChartOptionsRegion,
|
||||
TestModificationRegion,
|
||||
AddCalculatedChannelRegion,
|
||||
TTSImportRegion,
|
||||
StatusAndProgressBarRegion,
|
||||
SensorsListRegion,
|
||||
HardwareListRegion,
|
||||
GroupTemplateListRegion,
|
||||
GroupListRegion,
|
||||
TestSetupsListRegion,
|
||||
CachedItemsListRegion,
|
||||
RealtimeModuleRegion,
|
||||
TemplateChannelListRegion,
|
||||
DatabaseServicesRegion,
|
||||
CustomChannelsRegion,
|
||||
GroupChannelListRegion,
|
||||
RegionOfInterestChannelsRegion,
|
||||
DiagnosticsRegion,
|
||||
ChannelCodesRegion,
|
||||
ChannelCodeBuilderRegion,
|
||||
SoftwareFiltersRegion,
|
||||
SensorSettingsModuleRegion,
|
||||
SquibsModuleRegion,
|
||||
ViewerSettingsRegion,
|
||||
HamburgerMenuRegion,
|
||||
AddEditHardwareRegion,
|
||||
ExtraPropertiesRegion,
|
||||
PSDReportRegion,
|
||||
PSDReportResultsRegion,
|
||||
PSDReportSettingsRegion,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user