init
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace DTS.Common.Utils
|
||||
{
|
||||
public class MouseUtilities
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct Win32Point
|
||||
{
|
||||
public int X;
|
||||
public int Y;
|
||||
};
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool GetCursorPos(ref Win32Point pt);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool GetPhysicalCursorPos(ref Win32Point pt);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool ScreenToClient(IntPtr hwnd, ref Win32Point pt);
|
||||
|
||||
public static Point GetMousePosition(Visual relativeTo)
|
||||
{
|
||||
var mouse = new Win32Point();
|
||||
GetCursorPos(ref mouse);
|
||||
|
||||
var presentationSource =
|
||||
(System.Windows.Interop.HwndSource)PresentationSource.FromVisual(relativeTo);
|
||||
|
||||
var factor = 2D - presentationSource.CompositionTarget.TransformToDevice.M22;
|
||||
|
||||
ScreenToClient(presentationSource.Handle, ref mouse);
|
||||
|
||||
var transform = relativeTo.TransformToAncestor(presentationSource.RootVisual);
|
||||
|
||||
var offset = transform.Transform(new Point(0, 0));
|
||||
if (factor > 0)
|
||||
{
|
||||
offset.Y = offset.Y + offset.Y * (presentationSource.CompositionTarget.TransformToDevice.M22 - 1);
|
||||
}
|
||||
return new Point(mouse.X - offset.X, mouse.Y - offset.Y);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
G\PN:{NAME OF PROGRAM};
|
||||
G\TA:{TEST ID};
|
||||
G\106:17;
|
||||
G\DSI\N:1;
|
||||
G\DSI-1:{TEST ID};
|
||||
G\DST-1:STO;
|
||||
R-1\ID:{TEST ID};
|
||||
R-1\RID:S6A_1;
|
||||
R-1\R1:generated from XML CH10 mapping;
|
||||
R-1\TC1:OTHR;
|
||||
R-1\COM:=========================================================================;
|
||||
R-1\COM: This simple settings for PCM stream
|
||||
R-1\COM: Mapping defined in the CH10 Programmers Handbook (RCC document 123-16) ;
|
||||
R-1\COM: appendix P/Q from the definition of a user defined external XML file;
|
||||
R-1\COM:=========================================================================;
|
||||
R-1\RML:E;
|
||||
R-1\ERBS:AUTO;
|
||||
R-1\NSB:0;
|
||||
R-1\RI1:Data Bus Tools GmbH;
|
||||
R-1\RI2:S6A_1;
|
||||
R-1\RI3:N;
|
||||
R-1\RI6:N;
|
||||
R-1\CRE:F;
|
||||
R-1\RSS:R;
|
||||
R-1\N:2;
|
||||
R-1\TK1-1:1;
|
||||
R-1\TK4-1:1;
|
||||
R-1\COM: ======================= Time Channel ========================;
|
||||
R-1\COM: == Format 2 with PTP timestamp ==;
|
||||
R-1\TK1-1:1;
|
||||
R-1\TK2-1:OTHER;
|
||||
R-1\DSI-1:1;
|
||||
R-1\TK3-1:FWD;
|
||||
R-1\TK4-1:1;
|
||||
R-1\CHE-1:T;
|
||||
R-1\CDT-1:TIMEIN;
|
||||
R-1\CDLN-1:1;
|
||||
R-1\TTF-1:{STREAM TIME FORMAT};
|
||||
R-1\SHTF-1:1;
|
||||
R-1\COM: ======================= PCM Channel Description =====================;
|
||||
R-1\DSI-2:PCMIN;
|
||||
R-1\TK1-2:3;
|
||||
R-1\TK4-2:3;
|
||||
R-1\CHE-2:T;
|
||||
R-1\CDT-2:PCMIN;
|
||||
R-1\CDLN-2:{TEST ID};
|
||||
R-1\PDTF-2:1;
|
||||
R-1\PDP-2:TM;
|
||||
R-1\ICE-2:180;
|
||||
R-1\IST-2:SE;
|
||||
R-1\ITH-2:1;
|
||||
R-1\ITM-2:Low-Z;
|
||||
R-1\PTF-2:NONE;
|
||||
P-1\DLN:{TEST ID};
|
||||
P-1\D1:NRZ-L;
|
||||
P-1\D2:{DAS BIT RATE};
|
||||
P-1\D3:U;
|
||||
P-1\D4:N;
|
||||
P-1\D7:N;
|
||||
P-1\D8:NA;
|
||||
P-1\TF:ONE;
|
||||
P-1\F1:16;
|
||||
P-1\F2:M;
|
||||
P-1\F3:NO;
|
||||
P-1\F4:T;
|
||||
P-1\ISF\N:0;
|
||||
P-1\MF\N:1;
|
||||
P-1\COM: === Number of channels (including time sync) ===;
|
||||
P-1\MF1:{NUMBER OF WORDS};
|
||||
P-1\MF2:{NUMBER OF BITS};
|
||||
P-1\MF3:FPT;
|
||||
P-1\MF4:32;
|
||||
P-1\MF5:11111110011010110010100001000000;
|
||||
D-1\DLN:{DAS SERIAL NUMBER};
|
||||
D-1\ML\N:1;
|
||||
D-1\MLN-1:Measurement List;
|
||||
D-1\COM: === Number of channels in the measurement list ===;
|
||||
D-1\MN\N-1:{NUMBER OF CHANNELS};
|
||||
@@ -0,0 +1,35 @@
|
||||
R-1\COM:--------------------- Subchannel Description ---------------------;
|
||||
R-1\AMCE-2-{CHANNEL NUMBER}:T;
|
||||
R-1\AMCN-2-{CHANNEL NUMBER}:{CHANNEL NUMBER};
|
||||
R-1\AMN-2-{CHANNEL NUMBER}:{CHANNEL NAME};
|
||||
R-1\ADL-2-{CHANNEL NUMBER}:16;
|
||||
R-1\AMSK-2-{CHANNEL NUMBER}:FW;
|
||||
R-1\AMTO-2-{CHANNEL NUMBER}:L;
|
||||
R-1\ASF-2-{CHANNEL NUMBER}:0;
|
||||
R-1\ASBW-2-{CHANNEL NUMBER}:200;
|
||||
R-1\ACP-2-{CHANNEL NUMBER}:D;
|
||||
R-1\AII-2-{CHANNEL NUMBER}:50;
|
||||
R-1\AGI-2-1:100;
|
||||
R-1\AFSI-2-{CHANNEL NUMBER}:5000;
|
||||
R-1\AOVI-2-{CHANNEL NUMBER}:2500;
|
||||
R-1\ALSV-2-{CHANNEL NUMBER}:19;
|
||||
R-1\AECS-2-{CHANNEL NUMBER}:{CHANNEL SCALEFACTOR EU};
|
||||
R-1\AECO-2-{CHANNEL NUMBER}:{CHANNEL OFFSET EU};
|
||||
R-1\AECU-2-{CHANNEL NUMBER}:{CHANNEL EU};
|
||||
R-1\AF-2-{CHANNEL NUMBER}:2;
|
||||
R-1\AIT-2-{CHANNEL NUMBER}:S;
|
||||
R-1\AV-2-{CHANNEL NUMBER}:N;
|
||||
C-{CHANNEL NUMBER}\DCN:{CHANNEL NAME};
|
||||
C-{CHANNEL NUMBER}\MN1:{CHANNEL NAME};
|
||||
C-{CHANNEL NUMBER}\BFM:TWO;
|
||||
C-{CHANNEL NUMBER}\DCT:COE;
|
||||
C-{CHANNEL NUMBER}\CO\N:1;
|
||||
C-{CHANNEL NUMBER}\CO:{CHANNEL OFFSET EU};
|
||||
C-{CHANNEL NUMBER}\CO-1:{CHANNEL SCALEFACTOR EU};
|
||||
C-{CHANNEL NUMBER}\MN3:{CHANNEL EU};
|
||||
C-{CHANNEL NUMBER}\MOT1:{CHANNEL MAX RANGE EU};
|
||||
C-{CHANNEL NUMBER}\MOT3:{CHANNEL MAX RANGE EU};
|
||||
C-{CHANNEL NUMBER}\MOT5:{CHANNEL MAX RANGE EU};
|
||||
C-{CHANNEL NUMBER}\MOT2:{CHANNEL MIN RANGE EU};
|
||||
C-{CHANNEL NUMBER}\MOT4:{CHANNEL MIN RANGE EU};
|
||||
C-{CHANNEL NUMBER}\MOT6:{CHANNEL MIN RANGE EU};
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
// ReSharper disable PossibleNullReferenceException
|
||||
|
||||
namespace DTS.Common.Converters
|
||||
{
|
||||
public class EnumBooleanConverter : IValueConverter
|
||||
{
|
||||
//#region IValueConverter Members
|
||||
//public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
//{
|
||||
// var parameterString = parameter as string;
|
||||
// if (parameterString == null)
|
||||
// return DependencyProperty.UnsetValue;
|
||||
|
||||
// if (Enum.IsDefined(value.GetType(), value) == false)
|
||||
// return DependencyProperty.UnsetValue;
|
||||
|
||||
// var parameterValue = Enum.Parse(value.GetType(), parameterString);
|
||||
|
||||
// return parameterValue.Equals(value);
|
||||
//}
|
||||
|
||||
//public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
//{
|
||||
// var parameterString = parameter as string;
|
||||
// return parameterString == null ? DependencyProperty.UnsetValue : Enum.Parse(targetType, parameterString);
|
||||
//}
|
||||
//#endregion
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return value.Equals(parameter);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return value.Equals(true) ? parameter : Binding.DoNothing;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Prism.Events;
|
||||
|
||||
namespace DTS.Common.Events.Hardware.HardwareList
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The HardwareListShowCompact event.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>This event is used to indicate show compact/expanded was changed.</remarks>
|
||||
///
|
||||
public class HardwareListShowCompactEvent : PubSubEvent<bool> { }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
using DTS.Common.RibbonControl;
|
||||
|
||||
namespace DTS.Common.Interface
|
||||
{
|
||||
public interface ICheckChannelsMenuViewModel : IRibbonViewModel { }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
using DTS.Common.Base;
|
||||
|
||||
namespace DTS.Common.Interface
|
||||
{
|
||||
public interface ILabDetailsViewModel : IBaseViewModel { }
|
||||
}
|
||||
Reference in New Issue
Block a user