init
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
namespace DTS.Common.Classes.GroupTemplates
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public const string NON_ISO_TESTOBJECT_CHANNEL_TYPE = "x_NonISOTestObjectType_x";
|
||||
public const string NON_ISO_TESTOBJECT_NAME = "x_NonISOTestObjectName_x";
|
||||
public const string NON_ISO_TESTOBJECT_CHANNEL_TYPE2 = "NONISO_x_";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.Windows;
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace DTS.Common.Base
|
||||
{
|
||||
public class BaseWindow : Window, IBaseWindow
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the bound object data data has been changed (View is dirty).
|
||||
/// </summary>
|
||||
public bool IsDirty
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DataContext != null)
|
||||
{
|
||||
if (DataContext is IBaseWindowModel baseWindowModel)
|
||||
return baseWindowModel.IsDirty;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a header info which uses by the TabControl to display the TabItem's header.
|
||||
/// </summary>
|
||||
public string HeaderInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DataContext != null)
|
||||
{
|
||||
if (DataContext is IHeaderInfoProvider<string> iHeaderInfoProvider)
|
||||
return iHeaderInfoProvider.HeaderInfo;
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using DTS.Common.Classes.Sensors;
|
||||
using DTS.Common.Enums;
|
||||
using DTS.Common.Enums.Sensors;
|
||||
|
||||
namespace DTS.Common.Interface.Sensors
|
||||
{
|
||||
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
|
||||
public interface ICalibrationRecords
|
||||
{
|
||||
ICalibrationRecord[] Records { get; set; }
|
||||
void FromSerializedString(string s);
|
||||
bool IsEqual(object obj, ISensorCalibration sc);
|
||||
string ToDisplayString(ISensorCalibration sc, ISensorCalibration previous, string linearFormat, string nonlinearFormat);
|
||||
string ToSerializedString(ISensorCalDbRecord sc);
|
||||
}
|
||||
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
|
||||
public interface ICalibrationRecord
|
||||
{
|
||||
bool AtCapacity { get; set; }
|
||||
double CapacityOutputIsBasedOn { get; set; }
|
||||
string EngineeringUnits { get; set; }
|
||||
ExcitationVoltageOptions.ExcitationVoltageOption Excitation { get; set; }
|
||||
string ISOCode { get; set; }
|
||||
LinearizationFormula Poly { get; set; }
|
||||
double Sensitivity { get; set; }
|
||||
SensorConstants.SensUnits SensitivityUnits { get; set; }
|
||||
double ZeroPoint { get; set; }
|
||||
string ToDisplayString(ISensorCalibration sc, ICalibrationRecord previous, ISensorCalibration sc2, string linearFormat, string nonlinearFormat);
|
||||
string ToSerializedString(ISensorCalDbRecord sc);
|
||||
bool IsEqual(object obj, ISensorCalibration sc);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
namespace DTS.Common.RibbonControl
|
||||
{
|
||||
public class ComboBoxData : MenuButtonData
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Interop;
|
||||
|
||||
namespace DTS.Common.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ConfirmationWindow.xaml
|
||||
/// </summary>
|
||||
public partial class ConfirmationWindow
|
||||
{
|
||||
/// <summary>
|
||||
/// The content template to use when showing <see cref="Microsoft.Practices.Prism.Interactivity.InteractionRequest.Confirmation"/> data.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty ConfirmationTemplateProperty =
|
||||
DependencyProperty.Register(
|
||||
"ConfirmationTemplate",
|
||||
typeof (DataTemplate),
|
||||
typeof (ConfirmationWindow),
|
||||
new PropertyMetadata(null));
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of ConfirmationChildWindow.
|
||||
/// </summary>
|
||||
public ConfirmationWindow()
|
||||
{
|
||||
// Hook the SourceInitialized event and then using the SetWindowLong function to strip off the WS_SYSMENU bit.
|
||||
SourceInitialized += ConfirmationWindow_SourceInitialized;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The content template to use when showing <see cref="Microsoft.Practices.Prism.Interactivity.InteractionRequest.Confirmation"/> data.
|
||||
/// </summary>
|
||||
public DataTemplate ConfirmationTemplate
|
||||
{
|
||||
get => (DataTemplate) GetValue(ConfirmationTemplateProperty);
|
||||
set => SetValue(ConfirmationTemplateProperty, value);
|
||||
}
|
||||
|
||||
private void ConfirmationWindow_SourceInitialized(object sender, EventArgs e)
|
||||
{
|
||||
// Removing the Close Button on a WPF window.
|
||||
// The key here is hooking the SourceInitialized event and then using the SetWindowLong function to strip off the WS_SYSMENU bit.
|
||||
var wih = new WindowInteropHelper(this);
|
||||
var style = GetWindowLong(wih.Handle, GWL_STYLE);
|
||||
SetWindowLong(wih.Handle, GWL_STYLE, style & ~WS_SYSMENU);
|
||||
}
|
||||
|
||||
private const int GWL_STYLE = -16;
|
||||
private const int WS_SYSMENU = 0x00080000;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern int SetWindowLong(IntPtr hwnd, int index, int value);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern int GetWindowLong(IntPtr hwnd, int index);
|
||||
|
||||
public void Connect(int connectionId, object target)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
using DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile;
|
||||
using Microsoft.Practices.Prism.Events;
|
||||
|
||||
namespace DTS.Common.Events
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The TTSImportReadFileFinishedEvent event.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>This event has to be used by the Read File step to indicate that it has finished.</remarks>
|
||||
///
|
||||
public class TTSImportReadFileFinishedEvent : CompositePresentationEvent<ITTSSetup> { }
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DTS.Common.Behaviors
|
||||
{
|
||||
/// <summary>
|
||||
/// generic attribute to store string meta data on an object or enum
|
||||
/// </summary>
|
||||
public class StringMetaDataAttr : Attribute
|
||||
{
|
||||
public string MetaData { get; }
|
||||
|
||||
internal StringMetaDataAttr(string attr)
|
||||
{
|
||||
MetaData = attr;
|
||||
}
|
||||
|
||||
public static string GetStringMetaData(object o)
|
||||
{
|
||||
var mi = o?.GetType().GetMember(o.ToString());
|
||||
if ( null == mi || 0 == mi.Length) { return null; }
|
||||
if (GetCustomAttribute(mi[0], typeof(StringMetaDataAttr)) is StringMetaDataAttr attr)
|
||||
{
|
||||
return attr.MetaData;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user