This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
using DTS.Common.Interface;
using System.ComponentModel;
namespace DTS.Common.Classes.Viewer.Reports
{
public class ChannelGRMSSummary : IChannelGRMSSummary
{
public string ChannelName { get; set; }
public int SampleRate { get; set; }
public double GRMS { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Reflection;
using DataPro.Common.Base;
namespace DataPro.Common.Interface
{
public interface IGroupListViewModel : IBaseViewModel
{
IMainViewModel Parent { get; set; }
IGroupListView View { get; set; }
List<IGroupView> GroupList { get; set; }
}
}

View File

@@ -0,0 +1,40 @@
using DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile;
namespace DTS.Common.Interface.TestSetups.Imports.TTS.LevelTrigger
{
public interface ILevelTrigger
{
string Code { get; }
string JCode { get; }
double ValuePercent { get; set; }
double ValueEU { get; set; }
string EULabel { get; }
string HWSerialNumber { get; }
int ChannelNumber { get; }
ITTSChannelRecord Channel { get; set; }
ITTSSetup TestSetup { get; }
ITTSChannelRecord[] AvailableChannels { get; }
bool IsActive { get; }
/// <summary>
/// updates available channels and Channel
/// </summary>
void Refresh();
/// <summary>
/// adds the channel as a possible channel for level trigger
/// </summary>
/// <param name="channel"></param>
void Add(ITTSChannelRecord channel);
/// <summary>
/// removes the channel as a possible channel for level trigger,
/// unassigns channel if currently assigned
/// </summary>
/// <param name="channel"></param>
void Remove(ITTSChannelRecord channel);
bool IsModified { get; set; }
/// <summary>
/// returns a sequence of bytes representing this level trigger suitable to base a hash on
/// </summary>
/// <returns></returns>
byte[] GetBytes();
}
}

View File

@@ -0,0 +1,209 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace DTS.Common.Classes
{
public static class WindowsAPIHelpers
{
/// <summary>
/// POINT aka POINTAPI
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
/// <summary>
/// x coordinate of point.
/// </summary>
public int x;
/// <summary>
/// y coordinate of point.
/// </summary>
public int y;
/// <summary>
/// Construct a point of coordinates (x,y).
/// </summary>
public POINT(int x, int y)
{
this.x = x;
this.y = y;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct MINMAXINFO
{
public POINT ptReserved;
public POINT ptMaxSize;
public POINT ptMaxPosition;
public POINT ptMinTrackSize;
public POINT ptMaxTrackSize;
};
/// <summary>
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public class MONITORINFO
{
/// <summary>
/// </summary>
public int cbSize = Marshal.SizeOf(typeof(MONITORINFO));
/// <summary>
/// </summary>
public RECT rcMonitor = new RECT();
/// <summary>
/// </summary>
public RECT rcWork = new RECT();
/// <summary>
/// </summary>
public int dwFlags = 0;
}
/// <summary> Win32 </summary>
[StructLayout(LayoutKind.Sequential, Pack = 0)]
public struct RECT
{
/// <summary> Win32 </summary>
public int left;
/// <summary> Win32 </summary>
public int top;
/// <summary> Win32 </summary>
public int right;
/// <summary> Win32 </summary>
public int bottom;
/// <summary> Win32 </summary>
public static readonly RECT Empty = new RECT();
/// <summary> Win32 </summary>
public int Width => Math.Abs(right - left);
/// <summary> Win32 </summary>
public int Height => bottom - top;
/// <summary> Win32 </summary>
public RECT(int left, int top, int right, int bottom)
{
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
/// <summary> Win32 </summary>
public RECT(RECT rcSrc)
{
left = rcSrc.left;
top = rcSrc.top;
right = rcSrc.right;
bottom = rcSrc.bottom;
}
/// <summary> Win32 </summary>
public bool IsEmpty => left >= right || top >= bottom;
/// <summary> Return a user friendly representation of this struct </summary>
public override string ToString()
{
if (this == Empty) { return "RECT {Empty}"; }
return "RECT { left : " + left + " / top : " + top + " / right : " + right + " / bottom : " + bottom + " }";
}
/// <summary> Determine if 2 RECT are equal (deep compare) </summary>
public override bool Equals(object obj)
{
if (!(obj is Rect)) { return false; }
return (this == (RECT)obj);
}
/// <summary>Return the HashCode for this struct (not garanteed to be unique)</summary>
public override int GetHashCode()
{
return left.GetHashCode() + top.GetHashCode() + right.GetHashCode() + bottom.GetHashCode();
}
/// <summary> Determine if 2 RECT are equal (deep compare)</summary>
public static bool operator ==(RECT rect1, RECT rect2)
{
return (rect1.left == rect2.left && rect1.top == rect2.top && rect1.right == rect2.right && rect1.bottom == rect2.bottom);
}
/// <summary> Determine if 2 RECT are different(deep compare)</summary>
public static bool operator !=(RECT rect1, RECT rect2)
{
return !(rect1 == rect2);
}
}
public enum WM
{
WINDOWMAX = 0x0024,
WINDOWPOSCHANGING = 0x0046,
}
public enum SWP
{
NOMOVE = 0x0002,
}
[StructLayout(LayoutKind.Sequential)]
public struct WINDOWPOS
{
public IntPtr hwnd;
public IntPtr hwndInsertAfter;
public int x;
public int y;
public int cx;
public int cy;
public int flags;
}
public static void GetMinMaxInfo(IntPtr hwnd, IntPtr lParam)
{
var mmi = (MINMAXINFO)Marshal.PtrToStructure(lParam, typeof(MINMAXINFO));
// Adjust the maximized size and position to fit the work area of the correct monitor
const int monitorDefaulttonearest = 0x00000002;
var monitor = MonitorFromWindow(hwnd, monitorDefaulttonearest);
if (monitor != IntPtr.Zero)
{
var monitorInfo = new MONITORINFO();
GetMonitorInfo(monitor, monitorInfo);
var rcWorkArea = monitorInfo.rcWork;
var rcMonitorArea = monitorInfo.rcMonitor;
mmi.ptMaxPosition.x = Math.Abs(rcWorkArea.left - rcMonitorArea.left);
mmi.ptMaxPosition.y = Math.Abs(rcWorkArea.top - rcMonitorArea.top);
mmi.ptMaxSize.x = Math.Abs(rcWorkArea.right - rcWorkArea.left);
mmi.ptMaxSize.y = Math.Abs(rcWorkArea.bottom - rcWorkArea.top);
}
Marshal.StructureToPtr(mmi, lParam, true);
}
[DllImport("user32")]
public static extern bool GetMonitorInfo(IntPtr hMonitor, MONITORINFO lpmi);
/// <summary>
///
/// </summary>
[DllImport("User32")]
public static extern IntPtr MonitorFromWindow(IntPtr handle, int flags);
}
}

View File

@@ -0,0 +1,12 @@
namespace DTS.Common.Enums.Sensors.SensorsList
{
public enum CanSettingFields
{
CanIsFD,
CanArbBaseBitrate,
CanArbBaseSJW,
CanDataBitrate,
CanDataSJW,
CanFileType
}
}

View File

@@ -0,0 +1,153 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using DTS.Common.Base;
using DTS.Common.Classes.DSP;
using DTS.Common.Classes.Hardware;
using DTS.Common.Enums;
using DTS.Common.Interface.Pagination;
using DTS.Common.Interface.TestSetups.TestSetupsList;
namespace DTS.Common.Interface.DASFactory.Diagnostics.HardwareList
{
public interface IHardwareListViewModel : IBaseViewModel, IFilterableListView
{
/// <summary>
/// a user selected slice6
/// </summary>
ISLICE6TreeNode SelectedSLICE6 { get; set; }
/// <summary>
/// all slice6 which are not associated with a given S6DB
/// </summary>
ISLICE6TreeNode[] AvailableSLICE6 { get; set; }
/// <summary>
/// currently selected SLICE6DB
/// </summary>
IHardware SelectedSLICE6DB { get; set; }
/// <summary>
/// all available SLICE6DB
/// </summary>
IHardware[] AvailableSLICE6DB { get; set; }
bool IsEdit { get; set; }
int TDASCalPeriod { get; set; }
int G5CalPeriod { get; set; }
int SLICE1CalPeriod { get; set; }
int SLICE1_5CalPeriod { get; set; }
int SLICE2_CalPeriod { get; set; }
int SLICE6_CalPeriod { get; set; }
int POWERPRO_CalPeriod { get; set; }
int SLICE6Air_CalPeriod { get; set; }
int SLICE6DB_CalPeriod { get; set; }
int TSRAir_CalPeriod { get; set; }
IStreamingFilterProfile StreamingDSPProfile { get;set; }
/// <summary>
/// the hardware replacement view
/// </summary>
IHardwareListReplaceView ReplaceView { get; set; }
IHardwareListView View { get; set; }
IHardwareListOverdueView OverdueView { get; set; }
IHardwareListSelectView SelectView { get; set; }
ISLICE6TreeView SLICE6TreeView { get; set; }
IHardware[] Hardware { get; set; }
IHardware[] OverdueHardware { get; set; }
/// <summary>
/// the hardware in the test (replacementview)
/// </summary>
IHardware[] HardwareInTest { get; set; }
/// <summary>
/// the hardware to replace
/// </summary>
IHardware HardwareToReplace { get; set; }
/// <summary>
/// the hardware that is available to replace with
/// </summary>
IHardware[] AvailableHardware { get; set; }
/// <summary>
/// initializes the replacement view given a test id
/// </summary>
void InitializeReplace(ITestSetup setup, IsoViewMode viewMode);
void GetHardware(bool bIncludeModules, bool bIncludeOverdue, bool bIncludeBridges, int? testId, int? groupId);
void GetAvailableSampleRates(int[] availableSampleRates);
void SetTestSampleRates(Dictionary<string, double> testSampleRates);
void SetHasIncludedChildren();
void UpdateTestSampleRate(string childSerialNumber, double testSampleRate);
int TestAAFRateHzColumnWidth { get; set; }
void SetTestAAFRates(Dictionary<string, float> testAAFRates);
void UpdateTestAAFilterRate(string childSerialNumber, float testAAFilterRate);
Func<SerializableAAF.DAS_TYPE, int, float> GetAAFForHardwareFunc { get; set; }
void CheckForMixedDAS(string nonParentSerialNumber, double testSampleRate);
void SetParentMixedRates(string parentDAS, bool mixedRates);
int TestSampleRateColumnWidth { get; set; }
int TestClockMasterColumnWidth { get; set; }
int PTPDomainColumnWidth { get; set; }
void SetTestClockProfiles(DTS.Common.ClockSyncProfile masterProfile, DTS.Common.ClockSyncProfile slaveProfile);
void SetTestClockMasters(Dictionary<string, bool> testClockMasters);
void UpdateTestClockMaster(string childSerialNumber, bool testClockMaster);
void SetTestPTPDomainIDs(Dictionary<string, byte> testPTPDomainIDs);
void UpdateTestPTPDomainID(string childSerialNumber, byte ptpDomainId);
void Unset();
void Sort(object o, bool columnClick);
void SortOverdue(object o, bool columnClick);
void SetIncluded(string[] serialNumbers, bool included);
void SetIncluded(int[] dasId);
void Filter(string term);
void MouseDoubleClick(int index);
void SetCache(IISOHardware[] hardware);
/// <summary>
/// whether to show a compact view (no rack modules) or
/// expanded (show rack modules)
/// </summary>
bool ShowCompact { get; set; }
/// <summary>
/// loads tree for given hardware
/// </summary>
/// <param name="serialNumber"></param>
void LoadTreeView(string serialNumber);
/// <summary>
/// all the SLICE6 associated with a S6DB
/// (LoadTreeView will set this)
/// </summary>
ISLICE6TreeNode[] SLICE6TreeNodes { get; set; }
/// <summary>
/// associates a SLICE6 with a SLICE6DB
/// [does not commit]
/// </summary>
/// <param name="node"></param>
void Associate(ISLICE6TreeNode node);
/// <summary>
/// associates units from one SLICE6DB
/// with another
/// [does not commit]
/// </summary>
/// <param name="node"></param>
void Associate(IHardware node);
/// <summary>
/// removes the association of a SLICE6 with a SLICE6DB
/// [does not commit]
/// </summary>
/// <param name="node"></param>
void UnAssociate(ISLICE6TreeNode node);
/// <summary>
/// associates or de-associates SLICE6 from a SLICE6DB
/// </summary>
void SaveSLICE6Associations(string serialNumber);
IHardware[] GetSelectedItems();
/// <summary>
/// Replaces HardwareToReplace with ReplacementHardware
/// </summary>
void Replace();
/// <summary>
/// the selected hardware to replace with
/// </summary>
IHardware ReplacementHardware { get; set; }
void SetCalPeriods(int g5CalPeriod, int slice1CalPeriod, int slice1_5CalPeriod, int slice2_CalPeriod, int slice6_CalPeriod, int tdasCalPeriod,
int powerpro_CalPeriod, int slice6Air_CalPeriod, int slice6DB_CalPeriod, int tsrAir_CalPeriod, int slice6AirBridge_CalPeriod, int sliceTcCalPeriod,
int sliceProCanFdPeriod);
}
}