init
This commit is contained in:
1
DataPRO/DbAPIUI/.svn/entries
Normal file
1
DataPRO/DbAPIUI/.svn/entries
Normal file
@@ -0,0 +1 @@
|
||||
12
|
||||
1
DataPRO/DbAPIUI/.svn/format
Normal file
1
DataPRO/DbAPIUI/.svn/format
Normal file
@@ -0,0 +1 @@
|
||||
12
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31410.357
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbAPIUI", "DbAPIUI\DbAPIUI\DbAPIUI.csproj", "{A3B37E9C-34CB-4A54-A967-ABBFE4812246}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Debug|x64.Build.0 = Debug|x64
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Debug|x86.Build.0 = Debug|x86
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Release|x64.ActiveCfg = Release|x64
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Release|x64.Build.0 = Release|x64
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Release|x86.ActiveCfg = Release|x86
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C2382640-BAE1-49BD-9CE7-0172DB8A60B5}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,16 @@
|
||||
using DbAPI.Connections;
|
||||
using DTS.Common.Interface.Database;
|
||||
using System;
|
||||
|
||||
namespace DbAPIUI.Connections
|
||||
{
|
||||
public class LoggedInUser
|
||||
{
|
||||
public Tuple<IUserDbRecord, IConnectionDetails> Details { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Details.Item2}\\{Details.Item1.DisplayName}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="DbAPIUI.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="DBFolder" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,24 @@
|
||||
using DTS.Common.Utilities.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DbAPIUI
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Logging.LogManager.Log(System.Diagnostics.TraceEventType.Information, Logging.LogManager.LogEvents.Application, "Starting");
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DbAPIUI.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string DBFolder {
|
||||
get {
|
||||
return ((string)(this["DBFolder"]));
|
||||
}
|
||||
set {
|
||||
this["DBFolder"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace DbAPIUI.Properties
|
||||
{
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DbAPIUI.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,468 @@
|
||||
using DbAPI.Errors;
|
||||
using DbAPIUI.Logging;
|
||||
using DTS.Common.Classes.Channels;
|
||||
using DTS.Common.Classes.Groups;
|
||||
using DTS.Common.Classes.Hardware;
|
||||
using DTS.Common.Classes.Sensors;
|
||||
using DTS.Common.Classes.TestSetups;
|
||||
using DTS.Common.Interface.Channels;
|
||||
using DTS.Common.Interface.Database;
|
||||
using DTS.Common.Interface.DataRecorders;
|
||||
using DTS.Common.Interface.Groups;
|
||||
using DTS.Common.Interface.Sensors;
|
||||
using DTS.Common.Interface.TestSetups.TestSetupsList;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using static DTS.Common.Enums.ExcitationVoltageOptions;
|
||||
|
||||
namespace DbAPIUI
|
||||
{
|
||||
public class DoEverythingSample
|
||||
{
|
||||
public void Start()
|
||||
{
|
||||
Task.Run(() => { Connect(); });
|
||||
}
|
||||
private ConnectionDetailsEx _connection;
|
||||
private const string DB_FILES_LOCATION = "db";
|
||||
private const string SQL_FILES_LOCATION = "SQL Server Scripts";
|
||||
private void LogStub(params object[] paramList) { }
|
||||
private void Connect()
|
||||
{
|
||||
//step 1, look for an mdb file and a scripts directory, we need them to mount the db
|
||||
//and connect. The db api will connect, but we'll have to provide it information
|
||||
_connection = new ConnectionDetailsEx() { SqlDbPath = ConnectionDetailsEx.GetSqlServerLocalDbPath(),
|
||||
ODBCToolsPath = DTS.Common.Utils.Database.GetODBCToolsPath(LogStub) };
|
||||
|
||||
if(Directory.Exists(DB_FILES_LOCATION))
|
||||
{
|
||||
var di = new DirectoryInfo(DB_FILES_LOCATION);
|
||||
_connection.DbFolderPath = di.FullName;
|
||||
}
|
||||
|
||||
if (Directory.Exists(SQL_FILES_LOCATION))
|
||||
{
|
||||
var di = new DirectoryInfo(SQL_FILES_LOCATION);
|
||||
_connection.AttachDbsBatPath = Path.Combine(di.FullName, "AttachDBs.bat");
|
||||
}
|
||||
|
||||
var hr = DbAPI.DbAPI.Connections.ConnectToDb(_connection);
|
||||
if( 0 == hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Information,
|
||||
LogManager.LogEvents.Connections, $"Success fully connected: {_connection}");
|
||||
Login();
|
||||
}
|
||||
else
|
||||
{
|
||||
LogManager.Log(TraceEventType.Information,
|
||||
LogManager.LogEvents.Connections, $"Failed to connect: {_connection} - {ErrorCodes.ResultToString(hr)}");
|
||||
}
|
||||
}
|
||||
private IUserDbRecord _user;
|
||||
private void Login()
|
||||
{
|
||||
var hr = DbAPI.DbAPI.Connections.LoginUser(_connection, "Admin", "DTSAdmin", out var user);
|
||||
if( 0 == hr)
|
||||
{
|
||||
_user = user;
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.Connections,
|
||||
$"Login successful: {user.DisplayName}");
|
||||
AddSensors();
|
||||
}
|
||||
else
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.Connections,
|
||||
$"Login failed: {user.DisplayName} {ErrorCodes.ResultToString(hr)}");
|
||||
}
|
||||
}
|
||||
private List<IAnalogDbRecord> _sensors = new List<IAnalogDbRecord>();
|
||||
private Dictionary<IAnalogDbRecord, ISensorCalDbRecord> _calRecords = new Dictionary<IAnalogDbRecord, ISensorCalDbRecord>();
|
||||
private void AddSensors()
|
||||
{
|
||||
_sensors.Clear();
|
||||
_calRecords.Clear();
|
||||
|
||||
var failed = false;
|
||||
for( var i = 0; i < 3; i++)
|
||||
{
|
||||
if( !CreateSensorAndCal($"Sensor {i + 1:000}", "Generic Analog Sensor", 2400))
|
||||
{
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(failed) { return; }
|
||||
CreateDAS();
|
||||
}
|
||||
private void CreateDAS()
|
||||
{
|
||||
var failed = false;
|
||||
|
||||
var hr = DbAPI.DbAPI.DAS.DASGet(_user, _connection, _connection.ClientDbVersion, "SLICEPRO Prototype", "Prototype", out var records);
|
||||
if( 0 != hr || null == records || 0 == records.Length)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.DAS, $"Failed to retrieve SPS prototype");
|
||||
return;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.DAS, $"DASGet success");
|
||||
|
||||
var newDAS = new DASDBRecord(records.First());
|
||||
|
||||
|
||||
hr = DbAPI.DbAPI.DAS.DASChannelsGet(_user, _connection, $"{newDAS.SerialNumber}_{newDAS.DASType}", out var channelRecords);
|
||||
|
||||
if( 0 != hr || null == channelRecords || 0 == channelRecords.Length)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.DAS, "DASChannelsGet Error - {hr}");
|
||||
return;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.DAS, "DASChannelsGet success");
|
||||
|
||||
newDAS.SerialNumber = "SPS0001";
|
||||
newDAS.Position = "";
|
||||
newDAS.DASId = -1;
|
||||
newDAS.CalDate = DateTime.Today;
|
||||
hr = DbAPI.DbAPI.DAS.DASInsert(_user, _connection, newDAS);
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.DAS, $"DASInsert - Error - {hr}");
|
||||
return;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.DAS, $"DASInsert {newDAS.SerialNumber} - success");
|
||||
_Das = newDAS;
|
||||
|
||||
foreach( var channelRecord in channelRecords)
|
||||
{
|
||||
channelRecord.DaschannelId = -1;
|
||||
channelRecord.Dasid = newDAS.DASId;
|
||||
var iCh = (IDASChannelDBRecord)channelRecord;
|
||||
hr = DbAPI.DbAPI.DAS.DASChannelsInsert(_user, _connection, $"{newDAS.SerialNumber}_{newDAS.DASType}",
|
||||
ref iCh);
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.DAS, $"DASChannelsInsert - Error {hr}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!failed) { CreateGroups(); }
|
||||
}
|
||||
private IDASDBRecord _Das = null;
|
||||
private List<IGroupDbRecord> _groups = new List<IGroupDbRecord>();
|
||||
private Dictionary<IGroupDbRecord, IChannelDbRecord[]> _channels = new Dictionary<IGroupDbRecord, IChannelDbRecord[]>();
|
||||
private void CreateGroups()
|
||||
{
|
||||
_groups.Clear();
|
||||
_channels.Clear();
|
||||
|
||||
var group = CreateGroup("MyStaticGroup", "MyStaticGroup", false);
|
||||
var hr = DbAPI.DbAPI.Groups.GroupsInsert(_user, _connection, ref group);
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.TestSetups, $"GroupsInsert - Error - {hr}");
|
||||
return;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.TestSetups, $"GroupsInsert static {group.DisplayName} success");
|
||||
|
||||
hr = DbAPI.DbAPI.GroupHardware.GroupHardwareInsert(_user, _connection,
|
||||
new GroupHardwareDbRecord() { DASId = _Das.DASId, GroupId = group.Id, Id = -1, SerialNumber = _Das.SerialNumber },
|
||||
out var newId, out var errorMessage);
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.DAS, $"GroupHardwareInsert - Error - {hr}");
|
||||
return;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.DAS, $"GroupHardwareInsert success");
|
||||
|
||||
if (!CreateGroupChannels(ref group, out var groupChannels))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!InsertGroupAndChannels(ref group, groupChannels))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var id = group.Id;
|
||||
group = CreateGroup(Guid.NewGuid().ToString(), "MyStaticGroup", true);
|
||||
group.StaticGroupId = id;
|
||||
if (!CreateTestSetup()) { return; }
|
||||
if (!InsertGroupAndChannels(ref group, groupChannels)) { return; }
|
||||
hr = DbAPI.DbAPI.TestSetups.TestSetupGroupsInsert(_user, _connection,
|
||||
new TestSetupGroupRecord()
|
||||
{
|
||||
DisplayOrder = 0,
|
||||
GroupId = group.Id,
|
||||
Position = "?",
|
||||
TestObjectType = "?",
|
||||
TestSetupId = _test.Id
|
||||
});
|
||||
if( 0 == hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.TestSetups, $"TestSetupGroupsInsert inserted {group.DisplayName} in test setup: {_test.Name}");
|
||||
}
|
||||
else { LogManager.Log(TraceEventType.Error, LogManager.LogEvents.TestSetups, $"TestSetupGroupInsert - Error - {hr}"); }
|
||||
|
||||
hr = DbAPI.DbAPI.TestSetups.TestSetupHardwareInsert(_user, _connection, new TestSetupHardwareRecord()
|
||||
{
|
||||
AddDAS = true,
|
||||
AntiAliasFilterRate = 2000,
|
||||
DASId = _Das.DASId,
|
||||
IsClockMaster = false,
|
||||
SamplesPerSecond = Convert.ToInt32(_test.SamplesPerSecondAggregate),
|
||||
TestSetupId = _test.Id
|
||||
});
|
||||
if (0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.TestSetups, $"TestSetupHardwareInsert - Error - {ErrorCodes.ResultToString(hr)}");
|
||||
return;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.TestSetups, $"TestSetupHardwareInsert - success");
|
||||
}
|
||||
private bool CreateTestSetup()
|
||||
{
|
||||
var test = new TestSetupRecord();
|
||||
test.AllowMissingSensors = true;
|
||||
test.AllowSensorIdToBlankChannel = true;
|
||||
var iTest = (ITestSetupRecord)test;
|
||||
SetTSRAirProperties(ref iTest);
|
||||
test.AutomaticProgression = false;
|
||||
test.AutomaticProgressionDelayMS = 5;
|
||||
test.AutoVerifyChannels = false;
|
||||
test.CalibrationBehavior = DTS.Common.Enums.Sensors.CalibrationBehaviors.LinearIfAvailable;
|
||||
test.CheckoutMode = false;
|
||||
test.CommonStatusLine = true;
|
||||
test.CustomerDetails = "";
|
||||
test.DefaultNumberRealtimeGraphs = 6;
|
||||
test.Description = "A fine test setup";
|
||||
test.DoAutoArm = false;
|
||||
test.DoROIDownload = true;
|
||||
test.DoStreaming = false;
|
||||
test.DownloadAll = true;
|
||||
test.ExportFormats = DTS.Common.Enums.SupportedExportFormatBitFlags.none;
|
||||
test.InvertStartRecordCompletion = false;
|
||||
test.InvertTriggerCompletion = false;
|
||||
test.ISFFile = "";
|
||||
test.LabDetails = "";
|
||||
test.LastModified = DateTime.Today;
|
||||
test.LastModifiedBy = _user.UserName;
|
||||
test.LocalOnly = false;
|
||||
test.MeasureSquibResistancesStep = false;
|
||||
test.Name = "MyTestSetup";
|
||||
test.NumberOfEvents = 1;
|
||||
test.PostTestDiagnosticsLevel = false;
|
||||
test.PostTriggerSeconds = 10;
|
||||
test.PreTriggerSeconds = 1;
|
||||
test.QuitTestWithoutWarning = false;
|
||||
test.RecordingMode = DTS.Common.Enums.RecordingModes.CircularBuffer;
|
||||
test.RequireUserConfirmationOnErrors = true;
|
||||
test.ROIStart = -.5;
|
||||
test.ROIEnd = .5;
|
||||
test.SamplesPerSecondAggregate = 20000;
|
||||
test.StrictDiagnostics = false;
|
||||
test.SuppressMissingSensorsWarning = false;
|
||||
test.TestEngineerDetails = "";
|
||||
test.TriggerCheckStep = true;
|
||||
test.TurnOffExcitation = false;
|
||||
test.UploadData = false;
|
||||
test.UseCustomerDetails = false;
|
||||
test.UseLabratoryDetails = false;
|
||||
test.UseTestEngineerDetails = false;
|
||||
test.VerifyChannels = true;
|
||||
test.ViewDiagnostics = true;
|
||||
test.ViewDownloadAll = false;
|
||||
test.ViewExport = false;
|
||||
test.ViewRealtime = true;
|
||||
test.ViewROIDownload = true;
|
||||
test.WarnOnFailedBattery = true;
|
||||
var hr = DbAPI.DbAPI.TestSetups.TestSetupsUpdateInsert(_user, _connection, _connection.ClientDbVersion, ref iTest);
|
||||
if (0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.TestSetups, $"TestSetupsInsert failed: {ErrorCodes.ResultToString(hr)}");
|
||||
return false;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.TestSetups, $"TestSetupInsert Success");
|
||||
_test = test;
|
||||
return true;
|
||||
}
|
||||
private ITestSetupRecord _test;
|
||||
private void SetTSRAirProperties(ref ITestSetupRecord test)
|
||||
{
|
||||
test.BatterySaverModeOn = false;
|
||||
test.AngularAccelLevelTriggerOn = false;
|
||||
test.AngularRateLevelTriggerOn = false;
|
||||
test.HighgLevelTriggerOn = false;
|
||||
test.HumidityLevelTriggerOn = false;
|
||||
test.LowgLevelTriggerOn = false;
|
||||
test.PressureLevelTriggerOn = false;
|
||||
test.RTCScheduleDuration = new TimeSpan(0);
|
||||
test.RTCScheduleStartDateTime = DateTime.Today;
|
||||
test.RTCScheduleTriggerOn = false;
|
||||
test.TemperatureLevelTriggerOn = false;
|
||||
test.WakeUpAndArmTriggerOn = false;
|
||||
test.WakeUpTimeDuration = new TimeSpan(0);
|
||||
test.WakeUpTimeSessionStart = DateTime.Today;
|
||||
}
|
||||
private bool InsertGroupAndChannels(ref IGroupDbRecord group, IChannelDbRecord [] channels)
|
||||
{
|
||||
var hr = DbAPI.DbAPI.Groups.GroupsInsert(_user, _connection, ref group);
|
||||
if (0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.TestSetups, $"Failed to insert group: {ErrorCodes.ResultToString(hr)}");
|
||||
return false;
|
||||
}
|
||||
else { LogManager.Log(TraceEventType.Information, LogManager.LogEvents.TestSetups, $"Created group: {group.SerialNumber}"); }
|
||||
|
||||
hr = DbAPI.DbAPI.GroupHardware.GroupHardwareInsert(_user, _connection,
|
||||
new GroupHardwareDbRecord()
|
||||
{
|
||||
DASId = _Das.DASId,
|
||||
GroupId = group.Id,
|
||||
SerialNumber = _Das.SerialNumber
|
||||
}, out var newId, out var errorMessage);
|
||||
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.DAS, $"GroupHardwareInsert - Error - {ErrorCodes.ResultToString(hr)}");
|
||||
return false;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.DAS, $"GroupHardwareInsert - success");
|
||||
_groups.Add(group);
|
||||
for (var i = 0; i < channels.Length; i++)
|
||||
{
|
||||
var channel = channels[i];
|
||||
channel.GroupId = group.Id;
|
||||
channel.DASId = _Das.DASId;
|
||||
channel.DASChannelIndex = i;
|
||||
hr = DbAPI.DbAPI.Channels.ChannelsInsert(_user, _connection, ref channel);
|
||||
if (0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.TestSetups, $"Failed to insert channel: {group.SerialNumber}:{i:00} {ErrorCodes.ResultToString(hr)}");
|
||||
return false;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.TestSetups, $"Created channel: {group.SerialNumber}:{i:00}");
|
||||
}
|
||||
_channels[group] = channels;
|
||||
return true;
|
||||
}
|
||||
private bool CreateGroupChannels(ref IGroupDbRecord group, out IChannelDbRecord [] channels)
|
||||
{
|
||||
var list = new List<IChannelDbRecord>();
|
||||
for (int i = 0; i < _sensors.Count; i++)
|
||||
{
|
||||
list.Add(CreateChannel(i));
|
||||
}
|
||||
channels = list.ToArray();
|
||||
return true;
|
||||
}
|
||||
private IChannelDbRecord CreateChannel(int index)
|
||||
{
|
||||
var channel = new ChannelDbRecord();
|
||||
channel.DASChannelIndex = index;
|
||||
channel.DASId = _Das.DASId;
|
||||
channel.GroupChannelOrder = index;
|
||||
channel.IsoChannelName = $"CHANNEL {index + 1:0000}";
|
||||
channel.IsoCode = $"??{index:0000}??????????";
|
||||
channel.LastModified = DateTime.Now;
|
||||
channel.LastModifiedBy = _user.UserName;
|
||||
channel.SensorId = _sensors[index].Id;
|
||||
channel.TestSetupOrder = index;
|
||||
channel.UserChannelName = channel.IsoChannelName;
|
||||
channel.UserCode = channel.IsoCode;
|
||||
return channel;
|
||||
}
|
||||
private IGroupDbRecord CreateGroup(string serialNumber, string displayname, bool embedded )
|
||||
{
|
||||
var group = new GroupDbRecord();
|
||||
group.DisplayName = displayname;
|
||||
group.SerialNumber = serialNumber;
|
||||
group.Embedded = embedded;
|
||||
group.Description = "Generic Group";
|
||||
group.ExtraProperties = "";
|
||||
group.LastModified = DateTime.Today;
|
||||
group.LastModifiedBy = _user.UserName;
|
||||
group.Picture = "";
|
||||
return group;
|
||||
}
|
||||
private bool CreateSensorAndCal(string serialNumber, string comment, int capacity)
|
||||
{
|
||||
var sensor = CreateAnalogSensor(serialNumber, comment, capacity);
|
||||
var hr = DbAPI.DbAPI.Sensors.SensorsAnalogUpdateInsert(_user, _connection, sensor);
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.Sensors, $"Failed to insert sensor {ErrorCodes.ResultToString(hr)}");
|
||||
return false;
|
||||
}
|
||||
else { LogManager.Log(TraceEventType.Information, LogManager.LogEvents.Sensors, $"Created sensor {serialNumber}"); }
|
||||
_sensors.Add(sensor);
|
||||
var sc = CreateAnalogSensorCalibration(sensor);
|
||||
hr = DbAPI.DbAPI.Sensors.SensorCalibrationsInsert(_user, _connection, sc, 0, true);
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.Sensors, $"Failed to insert sensor calibration {ErrorCodes.ResultToString(hr)}");
|
||||
return false;
|
||||
}
|
||||
else { LogManager.Log(TraceEventType.Information, LogManager.LogEvents.Sensors, $"Created SensorCalibration {serialNumber}"); }
|
||||
|
||||
_calRecords[sensor] = sc;
|
||||
return true;
|
||||
}
|
||||
private ISensorCalDbRecord CreateAnalogSensorCalibration(IAnalogDbRecord sensor)
|
||||
{
|
||||
var sc = new SensorCalDbRecord();
|
||||
sc.SerialNumber = sensor.SerialNumber;
|
||||
sc.CalibrationDate = DateTime.Today;
|
||||
sc.InitialOffsets = new InitialOffsets(new InitialOffset((double)sensor.InitialEu));
|
||||
sc.IsProportional = true;
|
||||
sc.NonLinear = false;
|
||||
sc.RemoveOffset = true;
|
||||
sc.ModifyDate = DateTime.Now;
|
||||
sc.ZeroMethods = new ZeroMethods(new ZeroMethod(DTS.Common.Enums.Sensors.ZeroMethodType.AverageOverTime, -.5, .5));
|
||||
sc.Records = new CalibrationRecords() { Records = new[] { GenerateCalibrationRecord() } };
|
||||
return sc;
|
||||
}
|
||||
private ICalibrationRecord GenerateCalibrationRecord()
|
||||
{
|
||||
var record = new CalibrationRecord();
|
||||
record.AtCapacity = false;
|
||||
record.EngineeringUnits = "G";
|
||||
record.Excitation = ExcitationVoltageOption.Volt5;
|
||||
record.InitialOffsetMethod = DTS.Common.Enums.Sensors.InitialOffsetTypes.EU;
|
||||
record.Sensitivity = .2;
|
||||
record.SensitivityUnits = DTS.Common.Enums.Sensors.SensorConstants.SensUnits.mVperVperEU;
|
||||
record.ZeroPoint = 0;
|
||||
return record;
|
||||
}
|
||||
private IAnalogDbRecord CreateAnalogSensor(string serialNumber, string description, int capacity)
|
||||
{
|
||||
var sensor = new AnalogDbRecord() { SerialNumber = serialNumber, Comment = description, Capacity = capacity };
|
||||
sensor.Bridge = DTS.Common.Enums.Sensors.SensorConstants.BridgeType.FullBridge;
|
||||
sensor.BridgeResistance = 350;
|
||||
sensor.CalInterval = 365;
|
||||
sensor.CheckOffset = true;
|
||||
sensor.Created = DateTime.Today;
|
||||
sensor.DiagnosticsMode = false;
|
||||
sensor.DisplayUnit = "G";
|
||||
sensor.Filter = new FilterClass(DTS.Common.Enums.Sensors.FilterClassType.CFC1000);
|
||||
sensor.FirstUseDate = null;
|
||||
sensor.InitialEu = 0;
|
||||
sensor.ISOChannelName = "";
|
||||
sensor.ISOCode = "";
|
||||
sensor.LastModified = DateTime.Today;
|
||||
sensor.Manufacturer = "DTS";
|
||||
sensor.Model = "Generic Sensor";
|
||||
sensor.ModifiedBy = _user.UserName;
|
||||
sensor.OffsetToleranceHigh = 1000;
|
||||
sensor.OffsetToleranceLow = -1000;
|
||||
sensor.Shunt = 1;
|
||||
sensor.SupportedExcitation = new[] { ExcitationVoltageOption.Volt5 };
|
||||
return sensor;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="DbAPIUI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<userSettings>
|
||||
<DbAPIUI.Properties.Settings>
|
||||
<setting name="DBFolder" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
</DbAPIUI.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
@@ -0,0 +1,144 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A3B37E9C-34CB-4A54-A967-ABBFE4812246}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>DbAPIUI</RootNamespace>
|
||||
<AssemblyName>DbAPIUI</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DbAPI, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\DbAPI\bin\x64\Debug\net452\DbAPI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DTS.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\DbAPI\bin\x64\Debug\net452\DTS.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DTS.Utilities, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\DbAPI\bin\x64\Debug\net452\DTS.Utilities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EquipmentExchange, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\EquipmentExchange\bin\x64\Debug\EquipmentExchange.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Design" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Connections\ConnectionDetailsEx.cs" />
|
||||
<Compile Include="Connections\LoggedInUser.cs" />
|
||||
<Compile Include="DoEverythingSample.cs" />
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Logging\LogManager.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace DbAPIUI.Logging
|
||||
{
|
||||
public class LogManager
|
||||
{
|
||||
private static TraceSource MySource = null;
|
||||
private static readonly object MyLock = new object();
|
||||
public enum LogEvents
|
||||
{
|
||||
Application,
|
||||
Message,
|
||||
Connections,
|
||||
DAS,
|
||||
Sensors,
|
||||
TestSetups,
|
||||
Tags
|
||||
}
|
||||
public static void Log(TraceEventType eventType, LogEvents logEvent, string msg)
|
||||
{
|
||||
InitializeSource();
|
||||
MySource.TraceEvent(eventType, (int)logEvent, msg);
|
||||
var dt = DateTime.Now;
|
||||
Form1.UpdateScreenLog($"{dt.Year}-{dt.Month:00}-{dt.Day:00} {dt.Hour:00}:{dt.Minute:00}:{dt.Second}.{dt.Millisecond:000} {msg}");
|
||||
}
|
||||
private static void InitializeSource()
|
||||
{
|
||||
lock (MyLock)
|
||||
{
|
||||
if( null != MySource)
|
||||
{
|
||||
return;
|
||||
}
|
||||
MySource = new TraceSource("DbAPIUI");
|
||||
MySource.Listeners.Clear();
|
||||
Trace.AutoFlush = true;
|
||||
MySource.Listeners.Add(new TextWriterTraceListener("DBAPIUI.log", "log"));
|
||||
MySource.Listeners["log"].IndentLevel = 1;
|
||||
MySource.Listeners["log"].TraceOutputOptions = TraceOptions.DateTime | TraceOptions.Timestamp;
|
||||
MySource.Switch.Level = SourceLevels.All;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("DbAPIUI")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DbAPIUI")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("a3b37e9c-34cb-4a54-a967-abbfe4812246")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,45 @@
|
||||
using DbAPI.Connections;
|
||||
using Microsoft.Win32;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
|
||||
namespace DbAPIUI
|
||||
{
|
||||
public class ConnectionDetailsEx: ConnectionDetails
|
||||
{
|
||||
[PasswordPropertyText(true)]
|
||||
public override string DbUserPassword { get; set; } = "DTSSealBeachHQ";
|
||||
|
||||
[Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public override string DbFolderPath { get; set; } = "";
|
||||
|
||||
[Editor(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public override string AttachDbsBatPath { get; set; } = "";
|
||||
/// <summary>
|
||||
/// gets the path to SqlServer
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetSqlServerLocalDbPath()
|
||||
{
|
||||
var highestVersionInstalledPath = string.Empty;
|
||||
|
||||
var rk = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
|
||||
var sk1 = rk.OpenSubKey("SOFTWARE\\Microsoft\\Microsoft SQL Server Local DB\\Installed Versions");
|
||||
if (sk1 == null) return string.Empty;
|
||||
var maxProductVersion = 0.0;
|
||||
foreach (var productSubKeyName in sk1.GetSubKeyNames())
|
||||
{
|
||||
if (!double.TryParse(productSubKeyName, NumberStyles.Float, CultureInfo.InvariantCulture, out var thisVersion)) continue;
|
||||
if (thisVersion < maxProductVersion) continue;
|
||||
maxProductVersion = thisVersion;
|
||||
var newKey = sk1.OpenSubKey(productSubKeyName);
|
||||
if (newKey == null) continue;
|
||||
var val = newKey.GetValue("InstanceAPIPath", -1, RegistryValueOptions.None).ToString();
|
||||
if (val == "-1" || !val.EndsWith("SqlUserInstance.dll")) continue;
|
||||
highestVersionInstalledPath = val.Substring(0, val.Length - "SqlUserInstance.dll".Length);
|
||||
}
|
||||
|
||||
return highestVersionInstalledPath.Replace("LocalDB", "Tools");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
BIN
DataPRO/DbAPIUI/.svn/wc.db
Normal file
BIN
DataPRO/DbAPIUI/.svn/wc.db
Normal file
Binary file not shown.
0
DataPRO/DbAPIUI/.svn/wc.db-journal
Normal file
0
DataPRO/DbAPIUI/.svn/wc.db-journal
Normal file
18
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/App.config
Normal file
18
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/App.config
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="DbAPIUI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<userSettings>
|
||||
<DbAPIUI.Properties.Settings>
|
||||
<setting name="DBFolder" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
</DbAPIUI.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
@@ -0,0 +1,45 @@
|
||||
using DbAPI.Connections;
|
||||
using Microsoft.Win32;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
|
||||
namespace DbAPIUI
|
||||
{
|
||||
public class ConnectionDetailsEx: ConnectionDetails
|
||||
{
|
||||
[PasswordPropertyText(true)]
|
||||
public override string DbUserPassword { get; set; } = "DTSSealBeachHQ";
|
||||
|
||||
[Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public override string DbFolderPath { get; set; } = "";
|
||||
|
||||
[Editor(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public override string AttachDbsBatPath { get; set; } = "";
|
||||
/// <summary>
|
||||
/// gets the path to SqlServer
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetSqlServerLocalDbPath()
|
||||
{
|
||||
var highestVersionInstalledPath = string.Empty;
|
||||
|
||||
var rk = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
|
||||
var sk1 = rk.OpenSubKey("SOFTWARE\\Microsoft\\Microsoft SQL Server Local DB\\Installed Versions");
|
||||
if (sk1 == null) return string.Empty;
|
||||
var maxProductVersion = 0.0;
|
||||
foreach (var productSubKeyName in sk1.GetSubKeyNames())
|
||||
{
|
||||
if (!double.TryParse(productSubKeyName, NumberStyles.Float, CultureInfo.InvariantCulture, out var thisVersion)) continue;
|
||||
if (thisVersion < maxProductVersion) continue;
|
||||
maxProductVersion = thisVersion;
|
||||
var newKey = sk1.OpenSubKey(productSubKeyName);
|
||||
if (newKey == null) continue;
|
||||
var val = newKey.GetValue("InstanceAPIPath", -1, RegistryValueOptions.None).ToString();
|
||||
if (val == "-1" || !val.EndsWith("SqlUserInstance.dll")) continue;
|
||||
highestVersionInstalledPath = val.Substring(0, val.Length - "SqlUserInstance.dll".Length);
|
||||
}
|
||||
|
||||
return highestVersionInstalledPath.Replace("LocalDB", "Tools");
|
||||
}
|
||||
}
|
||||
}
|
||||
16
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Connections/LoggedInUser.cs
Normal file
16
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Connections/LoggedInUser.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using DbAPI.Connections;
|
||||
using DTS.Common.Interface.Database;
|
||||
using System;
|
||||
|
||||
namespace DbAPIUI.Connections
|
||||
{
|
||||
public class LoggedInUser
|
||||
{
|
||||
public Tuple<IUserDbRecord, IConnectionDetails> Details { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Details.Item2}\\{Details.Item1.DisplayName}";
|
||||
}
|
||||
}
|
||||
}
|
||||
144
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/DbAPIUI.csproj
Normal file
144
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/DbAPIUI.csproj
Normal file
@@ -0,0 +1,144 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A3B37E9C-34CB-4A54-A967-ABBFE4812246}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>DbAPIUI</RootNamespace>
|
||||
<AssemblyName>DbAPIUI</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DbAPI, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\DbAPI\bin\x64\Debug\net452\DbAPI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DTS.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\DbAPI\bin\x64\Debug\net452\DTS.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DTS.Utilities, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\DbAPI\bin\x64\Debug\net452\DTS.Utilities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EquipmentExchange, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\EquipmentExchange\bin\x64\Debug\EquipmentExchange.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Design" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Connections\ConnectionDetailsEx.cs" />
|
||||
<Compile Include="Connections\LoggedInUser.cs" />
|
||||
<Compile Include="DoEverythingSample.cs" />
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Logging\LogManager.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
468
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/DoEverythingSample.cs
Normal file
468
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/DoEverythingSample.cs
Normal file
@@ -0,0 +1,468 @@
|
||||
using DbAPI.Errors;
|
||||
using DbAPIUI.Logging;
|
||||
using DTS.Common.Classes.Channels;
|
||||
using DTS.Common.Classes.Groups;
|
||||
using DTS.Common.Classes.Hardware;
|
||||
using DTS.Common.Classes.Sensors;
|
||||
using DTS.Common.Classes.TestSetups;
|
||||
using DTS.Common.Interface.Channels;
|
||||
using DTS.Common.Interface.Database;
|
||||
using DTS.Common.Interface.DataRecorders;
|
||||
using DTS.Common.Interface.Groups;
|
||||
using DTS.Common.Interface.Sensors;
|
||||
using DTS.Common.Interface.TestSetups.TestSetupsList;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using static DTS.Common.Enums.ExcitationVoltageOptions;
|
||||
|
||||
namespace DbAPIUI
|
||||
{
|
||||
public class DoEverythingSample
|
||||
{
|
||||
public void Start()
|
||||
{
|
||||
Task.Run(() => { Connect(); });
|
||||
}
|
||||
private ConnectionDetailsEx _connection;
|
||||
private const string DB_FILES_LOCATION = "db";
|
||||
private const string SQL_FILES_LOCATION = "SQL Server Scripts";
|
||||
private void LogStub(params object[] paramList) { }
|
||||
private void Connect()
|
||||
{
|
||||
//step 1, look for an mdb file and a scripts directory, we need them to mount the db
|
||||
//and connect. The db api will connect, but we'll have to provide it information
|
||||
_connection = new ConnectionDetailsEx() { SqlDbPath = ConnectionDetailsEx.GetSqlServerLocalDbPath(),
|
||||
ODBCToolsPath = DTS.Common.Utils.Database.GetODBCToolsPath(LogStub) };
|
||||
|
||||
if(Directory.Exists(DB_FILES_LOCATION))
|
||||
{
|
||||
var di = new DirectoryInfo(DB_FILES_LOCATION);
|
||||
_connection.DbFolderPath = di.FullName;
|
||||
}
|
||||
|
||||
if (Directory.Exists(SQL_FILES_LOCATION))
|
||||
{
|
||||
var di = new DirectoryInfo(SQL_FILES_LOCATION);
|
||||
_connection.AttachDbsBatPath = Path.Combine(di.FullName, "AttachDBs.bat");
|
||||
}
|
||||
|
||||
var hr = DbAPI.DbAPI.Connections.ConnectToDb(_connection);
|
||||
if( 0 == hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Information,
|
||||
LogManager.LogEvents.Connections, $"Success fully connected: {_connection}");
|
||||
Login();
|
||||
}
|
||||
else
|
||||
{
|
||||
LogManager.Log(TraceEventType.Information,
|
||||
LogManager.LogEvents.Connections, $"Failed to connect: {_connection} - {ErrorCodes.ResultToString(hr)}");
|
||||
}
|
||||
}
|
||||
private IUserDbRecord _user;
|
||||
private void Login()
|
||||
{
|
||||
var hr = DbAPI.DbAPI.Connections.LoginUser(_connection, "Admin", "DTSAdmin", out var user);
|
||||
if( 0 == hr)
|
||||
{
|
||||
_user = user;
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.Connections,
|
||||
$"Login successful: {user.DisplayName}");
|
||||
AddSensors();
|
||||
}
|
||||
else
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.Connections,
|
||||
$"Login failed: {user.DisplayName} {ErrorCodes.ResultToString(hr)}");
|
||||
}
|
||||
}
|
||||
private List<IAnalogDbRecord> _sensors = new List<IAnalogDbRecord>();
|
||||
private Dictionary<IAnalogDbRecord, ISensorCalDbRecord> _calRecords = new Dictionary<IAnalogDbRecord, ISensorCalDbRecord>();
|
||||
private void AddSensors()
|
||||
{
|
||||
_sensors.Clear();
|
||||
_calRecords.Clear();
|
||||
|
||||
var failed = false;
|
||||
for( var i = 0; i < 3; i++)
|
||||
{
|
||||
if( !CreateSensorAndCal($"Sensor {i + 1:000}", "Generic Analog Sensor", 2400))
|
||||
{
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(failed) { return; }
|
||||
CreateDAS();
|
||||
}
|
||||
private void CreateDAS()
|
||||
{
|
||||
var failed = false;
|
||||
|
||||
var hr = DbAPI.DbAPI.DAS.DASGet(_user, _connection, _connection.ClientDbVersion, "SLICEPRO Prototype", "Prototype", out var records);
|
||||
if( 0 != hr || null == records || 0 == records.Length)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.DAS, $"Failed to retrieve SPS prototype");
|
||||
return;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.DAS, $"DASGet success");
|
||||
|
||||
var newDAS = new DASDBRecord(records.First());
|
||||
|
||||
|
||||
hr = DbAPI.DbAPI.DAS.DASChannelsGet(_user, _connection, $"{newDAS.SerialNumber}_{newDAS.DASType}", out var channelRecords);
|
||||
|
||||
if( 0 != hr || null == channelRecords || 0 == channelRecords.Length)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.DAS, "DASChannelsGet Error - {hr}");
|
||||
return;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.DAS, "DASChannelsGet success");
|
||||
|
||||
newDAS.SerialNumber = "SPS0001";
|
||||
newDAS.Position = "";
|
||||
newDAS.DASId = -1;
|
||||
newDAS.CalDate = DateTime.Today;
|
||||
hr = DbAPI.DbAPI.DAS.DASInsert(_user, _connection, newDAS);
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.DAS, $"DASInsert - Error - {hr}");
|
||||
return;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.DAS, $"DASInsert {newDAS.SerialNumber} - success");
|
||||
_Das = newDAS;
|
||||
|
||||
foreach( var channelRecord in channelRecords)
|
||||
{
|
||||
channelRecord.DaschannelId = -1;
|
||||
channelRecord.Dasid = newDAS.DASId;
|
||||
var iCh = (IDASChannelDBRecord)channelRecord;
|
||||
hr = DbAPI.DbAPI.DAS.DASChannelsInsert(_user, _connection, $"{newDAS.SerialNumber}_{newDAS.DASType}",
|
||||
ref iCh);
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.DAS, $"DASChannelsInsert - Error {hr}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!failed) { CreateGroups(); }
|
||||
}
|
||||
private IDASDBRecord _Das = null;
|
||||
private List<IGroupDbRecord> _groups = new List<IGroupDbRecord>();
|
||||
private Dictionary<IGroupDbRecord, IChannelDbRecord[]> _channels = new Dictionary<IGroupDbRecord, IChannelDbRecord[]>();
|
||||
private void CreateGroups()
|
||||
{
|
||||
_groups.Clear();
|
||||
_channels.Clear();
|
||||
|
||||
var group = CreateGroup("MyStaticGroup", "MyStaticGroup", false);
|
||||
var hr = DbAPI.DbAPI.Groups.GroupsInsert(_user, _connection, ref group);
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.TestSetups, $"GroupsInsert - Error - {hr}");
|
||||
return;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.TestSetups, $"GroupsInsert static {group.DisplayName} success");
|
||||
|
||||
hr = DbAPI.DbAPI.GroupHardware.GroupHardwareInsert(_user, _connection,
|
||||
new GroupHardwareDbRecord() { DASId = _Das.DASId, GroupId = group.Id, Id = -1, SerialNumber = _Das.SerialNumber },
|
||||
out var newId, out var errorMessage);
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.DAS, $"GroupHardwareInsert - Error - {hr}");
|
||||
return;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.DAS, $"GroupHardwareInsert success");
|
||||
|
||||
if (!CreateGroupChannels(ref group, out var groupChannels))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!InsertGroupAndChannels(ref group, groupChannels))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var id = group.Id;
|
||||
group = CreateGroup(Guid.NewGuid().ToString(), "MyStaticGroup", true);
|
||||
group.StaticGroupId = id;
|
||||
if (!CreateTestSetup()) { return; }
|
||||
if (!InsertGroupAndChannels(ref group, groupChannels)) { return; }
|
||||
hr = DbAPI.DbAPI.TestSetups.TestSetupGroupsInsert(_user, _connection,
|
||||
new TestSetupGroupRecord()
|
||||
{
|
||||
DisplayOrder = 0,
|
||||
GroupId = group.Id,
|
||||
Position = "?",
|
||||
TestObjectType = "?",
|
||||
TestSetupId = _test.Id
|
||||
});
|
||||
if( 0 == hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.TestSetups, $"TestSetupGroupsInsert inserted {group.DisplayName} in test setup: {_test.Name}");
|
||||
}
|
||||
else { LogManager.Log(TraceEventType.Error, LogManager.LogEvents.TestSetups, $"TestSetupGroupInsert - Error - {hr}"); }
|
||||
|
||||
hr = DbAPI.DbAPI.TestSetups.TestSetupHardwareInsert(_user, _connection, new TestSetupHardwareRecord()
|
||||
{
|
||||
AddDAS = true,
|
||||
AntiAliasFilterRate = 2000,
|
||||
DASId = _Das.DASId,
|
||||
IsClockMaster = false,
|
||||
SamplesPerSecond = Convert.ToInt32(_test.SamplesPerSecondAggregate),
|
||||
TestSetupId = _test.Id
|
||||
});
|
||||
if (0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.TestSetups, $"TestSetupHardwareInsert - Error - {ErrorCodes.ResultToString(hr)}");
|
||||
return;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.TestSetups, $"TestSetupHardwareInsert - success");
|
||||
}
|
||||
private bool CreateTestSetup()
|
||||
{
|
||||
var test = new TestSetupRecord();
|
||||
test.AllowMissingSensors = true;
|
||||
test.AllowSensorIdToBlankChannel = true;
|
||||
var iTest = (ITestSetupRecord)test;
|
||||
SetTSRAirProperties(ref iTest);
|
||||
test.AutomaticProgression = false;
|
||||
test.AutomaticProgressionDelayMS = 5;
|
||||
test.AutoVerifyChannels = false;
|
||||
test.CalibrationBehavior = DTS.Common.Enums.Sensors.CalibrationBehaviors.LinearIfAvailable;
|
||||
test.CheckoutMode = false;
|
||||
test.CommonStatusLine = true;
|
||||
test.CustomerDetails = "";
|
||||
test.DefaultNumberRealtimeGraphs = 6;
|
||||
test.Description = "A fine test setup";
|
||||
test.DoAutoArm = false;
|
||||
test.DoROIDownload = true;
|
||||
test.DoStreaming = false;
|
||||
test.DownloadAll = true;
|
||||
test.ExportFormats = DTS.Common.Enums.SupportedExportFormatBitFlags.none;
|
||||
test.InvertStartRecordCompletion = false;
|
||||
test.InvertTriggerCompletion = false;
|
||||
test.ISFFile = "";
|
||||
test.LabDetails = "";
|
||||
test.LastModified = DateTime.Today;
|
||||
test.LastModifiedBy = _user.UserName;
|
||||
test.LocalOnly = false;
|
||||
test.MeasureSquibResistancesStep = false;
|
||||
test.Name = "MyTestSetup";
|
||||
test.NumberOfEvents = 1;
|
||||
test.PostTestDiagnosticsLevel = false;
|
||||
test.PostTriggerSeconds = 10;
|
||||
test.PreTriggerSeconds = 1;
|
||||
test.QuitTestWithoutWarning = false;
|
||||
test.RecordingMode = DTS.Common.Enums.RecordingModes.CircularBuffer;
|
||||
test.RequireUserConfirmationOnErrors = true;
|
||||
test.ROIStart = -.5;
|
||||
test.ROIEnd = .5;
|
||||
test.SamplesPerSecondAggregate = 20000;
|
||||
test.StrictDiagnostics = false;
|
||||
test.SuppressMissingSensorsWarning = false;
|
||||
test.TestEngineerDetails = "";
|
||||
test.TriggerCheckStep = true;
|
||||
test.TurnOffExcitation = false;
|
||||
test.UploadData = false;
|
||||
test.UseCustomerDetails = false;
|
||||
test.UseLabratoryDetails = false;
|
||||
test.UseTestEngineerDetails = false;
|
||||
test.VerifyChannels = true;
|
||||
test.ViewDiagnostics = true;
|
||||
test.ViewDownloadAll = false;
|
||||
test.ViewExport = false;
|
||||
test.ViewRealtime = true;
|
||||
test.ViewROIDownload = true;
|
||||
test.WarnOnFailedBattery = true;
|
||||
var hr = DbAPI.DbAPI.TestSetups.TestSetupsUpdateInsert(_user, _connection, _connection.ClientDbVersion, ref iTest);
|
||||
if (0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.TestSetups, $"TestSetupsInsert failed: {ErrorCodes.ResultToString(hr)}");
|
||||
return false;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.TestSetups, $"TestSetupInsert Success");
|
||||
_test = test;
|
||||
return true;
|
||||
}
|
||||
private ITestSetupRecord _test;
|
||||
private void SetTSRAirProperties(ref ITestSetupRecord test)
|
||||
{
|
||||
test.BatterySaverModeOn = false;
|
||||
test.AngularAccelLevelTriggerOn = false;
|
||||
test.AngularRateLevelTriggerOn = false;
|
||||
test.HighgLevelTriggerOn = false;
|
||||
test.HumidityLevelTriggerOn = false;
|
||||
test.LowgLevelTriggerOn = false;
|
||||
test.PressureLevelTriggerOn = false;
|
||||
test.RTCScheduleDuration = new TimeSpan(0);
|
||||
test.RTCScheduleStartDateTime = DateTime.Today;
|
||||
test.RTCScheduleTriggerOn = false;
|
||||
test.TemperatureLevelTriggerOn = false;
|
||||
test.WakeUpAndArmTriggerOn = false;
|
||||
test.WakeUpTimeDuration = new TimeSpan(0);
|
||||
test.WakeUpTimeSessionStart = DateTime.Today;
|
||||
}
|
||||
private bool InsertGroupAndChannels(ref IGroupDbRecord group, IChannelDbRecord [] channels)
|
||||
{
|
||||
var hr = DbAPI.DbAPI.Groups.GroupsInsert(_user, _connection, ref group);
|
||||
if (0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.TestSetups, $"Failed to insert group: {ErrorCodes.ResultToString(hr)}");
|
||||
return false;
|
||||
}
|
||||
else { LogManager.Log(TraceEventType.Information, LogManager.LogEvents.TestSetups, $"Created group: {group.SerialNumber}"); }
|
||||
|
||||
hr = DbAPI.DbAPI.GroupHardware.GroupHardwareInsert(_user, _connection,
|
||||
new GroupHardwareDbRecord()
|
||||
{
|
||||
DASId = _Das.DASId,
|
||||
GroupId = group.Id,
|
||||
SerialNumber = _Das.SerialNumber
|
||||
}, out var newId, out var errorMessage);
|
||||
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.DAS, $"GroupHardwareInsert - Error - {ErrorCodes.ResultToString(hr)}");
|
||||
return false;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.DAS, $"GroupHardwareInsert - success");
|
||||
_groups.Add(group);
|
||||
for (var i = 0; i < channels.Length; i++)
|
||||
{
|
||||
var channel = channels[i];
|
||||
channel.GroupId = group.Id;
|
||||
channel.DASId = _Das.DASId;
|
||||
channel.DASChannelIndex = i;
|
||||
hr = DbAPI.DbAPI.Channels.ChannelsInsert(_user, _connection, ref channel);
|
||||
if (0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.TestSetups, $"Failed to insert channel: {group.SerialNumber}:{i:00} {ErrorCodes.ResultToString(hr)}");
|
||||
return false;
|
||||
}
|
||||
LogManager.Log(TraceEventType.Information, LogManager.LogEvents.TestSetups, $"Created channel: {group.SerialNumber}:{i:00}");
|
||||
}
|
||||
_channels[group] = channels;
|
||||
return true;
|
||||
}
|
||||
private bool CreateGroupChannels(ref IGroupDbRecord group, out IChannelDbRecord [] channels)
|
||||
{
|
||||
var list = new List<IChannelDbRecord>();
|
||||
for (int i = 0; i < _sensors.Count; i++)
|
||||
{
|
||||
list.Add(CreateChannel(i));
|
||||
}
|
||||
channels = list.ToArray();
|
||||
return true;
|
||||
}
|
||||
private IChannelDbRecord CreateChannel(int index)
|
||||
{
|
||||
var channel = new ChannelDbRecord();
|
||||
channel.DASChannelIndex = index;
|
||||
channel.DASId = _Das.DASId;
|
||||
channel.GroupChannelOrder = index;
|
||||
channel.IsoChannelName = $"CHANNEL {index + 1:0000}";
|
||||
channel.IsoCode = $"??{index:0000}??????????";
|
||||
channel.LastModified = DateTime.Now;
|
||||
channel.LastModifiedBy = _user.UserName;
|
||||
channel.SensorId = _sensors[index].Id;
|
||||
channel.TestSetupOrder = index;
|
||||
channel.UserChannelName = channel.IsoChannelName;
|
||||
channel.UserCode = channel.IsoCode;
|
||||
return channel;
|
||||
}
|
||||
private IGroupDbRecord CreateGroup(string serialNumber, string displayname, bool embedded )
|
||||
{
|
||||
var group = new GroupDbRecord();
|
||||
group.DisplayName = displayname;
|
||||
group.SerialNumber = serialNumber;
|
||||
group.Embedded = embedded;
|
||||
group.Description = "Generic Group";
|
||||
group.ExtraProperties = "";
|
||||
group.LastModified = DateTime.Today;
|
||||
group.LastModifiedBy = _user.UserName;
|
||||
group.Picture = "";
|
||||
return group;
|
||||
}
|
||||
private bool CreateSensorAndCal(string serialNumber, string comment, int capacity)
|
||||
{
|
||||
var sensor = CreateAnalogSensor(serialNumber, comment, capacity);
|
||||
var hr = DbAPI.DbAPI.Sensors.SensorsAnalogUpdateInsert(_user, _connection, sensor);
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.Sensors, $"Failed to insert sensor {ErrorCodes.ResultToString(hr)}");
|
||||
return false;
|
||||
}
|
||||
else { LogManager.Log(TraceEventType.Information, LogManager.LogEvents.Sensors, $"Created sensor {serialNumber}"); }
|
||||
_sensors.Add(sensor);
|
||||
var sc = CreateAnalogSensorCalibration(sensor);
|
||||
hr = DbAPI.DbAPI.Sensors.SensorCalibrationsInsert(_user, _connection, sc, 0, true);
|
||||
if( 0 != hr)
|
||||
{
|
||||
LogManager.Log(TraceEventType.Error, LogManager.LogEvents.Sensors, $"Failed to insert sensor calibration {ErrorCodes.ResultToString(hr)}");
|
||||
return false;
|
||||
}
|
||||
else { LogManager.Log(TraceEventType.Information, LogManager.LogEvents.Sensors, $"Created SensorCalibration {serialNumber}"); }
|
||||
|
||||
_calRecords[sensor] = sc;
|
||||
return true;
|
||||
}
|
||||
private ISensorCalDbRecord CreateAnalogSensorCalibration(IAnalogDbRecord sensor)
|
||||
{
|
||||
var sc = new SensorCalDbRecord();
|
||||
sc.SerialNumber = sensor.SerialNumber;
|
||||
sc.CalibrationDate = DateTime.Today;
|
||||
sc.InitialOffsets = new InitialOffsets(new InitialOffset((double)sensor.InitialEu));
|
||||
sc.IsProportional = true;
|
||||
sc.NonLinear = false;
|
||||
sc.RemoveOffset = true;
|
||||
sc.ModifyDate = DateTime.Now;
|
||||
sc.ZeroMethods = new ZeroMethods(new ZeroMethod(DTS.Common.Enums.Sensors.ZeroMethodType.AverageOverTime, -.5, .5));
|
||||
sc.Records = new CalibrationRecords() { Records = new[] { GenerateCalibrationRecord() } };
|
||||
return sc;
|
||||
}
|
||||
private ICalibrationRecord GenerateCalibrationRecord()
|
||||
{
|
||||
var record = new CalibrationRecord();
|
||||
record.AtCapacity = false;
|
||||
record.EngineeringUnits = "G";
|
||||
record.Excitation = ExcitationVoltageOption.Volt5;
|
||||
record.InitialOffsetMethod = DTS.Common.Enums.Sensors.InitialOffsetTypes.EU;
|
||||
record.Sensitivity = .2;
|
||||
record.SensitivityUnits = DTS.Common.Enums.Sensors.SensorConstants.SensUnits.mVperVperEU;
|
||||
record.ZeroPoint = 0;
|
||||
return record;
|
||||
}
|
||||
private IAnalogDbRecord CreateAnalogSensor(string serialNumber, string description, int capacity)
|
||||
{
|
||||
var sensor = new AnalogDbRecord() { SerialNumber = serialNumber, Comment = description, Capacity = capacity };
|
||||
sensor.Bridge = DTS.Common.Enums.Sensors.SensorConstants.BridgeType.FullBridge;
|
||||
sensor.BridgeResistance = 350;
|
||||
sensor.CalInterval = 365;
|
||||
sensor.CheckOffset = true;
|
||||
sensor.Created = DateTime.Today;
|
||||
sensor.DiagnosticsMode = false;
|
||||
sensor.DisplayUnit = "G";
|
||||
sensor.Filter = new FilterClass(DTS.Common.Enums.Sensors.FilterClassType.CFC1000);
|
||||
sensor.FirstUseDate = null;
|
||||
sensor.InitialEu = 0;
|
||||
sensor.ISOChannelName = "";
|
||||
sensor.ISOCode = "";
|
||||
sensor.LastModified = DateTime.Today;
|
||||
sensor.Manufacturer = "DTS";
|
||||
sensor.Model = "Generic Sensor";
|
||||
sensor.ModifiedBy = _user.UserName;
|
||||
sensor.OffsetToleranceHigh = 1000;
|
||||
sensor.OffsetToleranceLow = -1000;
|
||||
sensor.Shunt = 1;
|
||||
sensor.SupportedExcitation = new[] { ExcitationVoltageOption.Volt5 };
|
||||
return sensor;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
2277
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Form1.Designer.cs
generated
Normal file
2277
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Form1.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
1227
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Form1.cs
Normal file
1227
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Form1.cs
Normal file
File diff suppressed because it is too large
Load Diff
120
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Form1.resx
Normal file
120
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Form1.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
45
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Logging/LogManager.cs
Normal file
45
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Logging/LogManager.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace DbAPIUI.Logging
|
||||
{
|
||||
public class LogManager
|
||||
{
|
||||
private static TraceSource MySource = null;
|
||||
private static readonly object MyLock = new object();
|
||||
public enum LogEvents
|
||||
{
|
||||
Application,
|
||||
Message,
|
||||
Connections,
|
||||
DAS,
|
||||
Sensors,
|
||||
TestSetups,
|
||||
Tags
|
||||
}
|
||||
public static void Log(TraceEventType eventType, LogEvents logEvent, string msg)
|
||||
{
|
||||
InitializeSource();
|
||||
MySource.TraceEvent(eventType, (int)logEvent, msg);
|
||||
var dt = DateTime.Now;
|
||||
Form1.UpdateScreenLog($"{dt.Year}-{dt.Month:00}-{dt.Day:00} {dt.Hour:00}:{dt.Minute:00}:{dt.Second}.{dt.Millisecond:000} {msg}");
|
||||
}
|
||||
private static void InitializeSource()
|
||||
{
|
||||
lock (MyLock)
|
||||
{
|
||||
if( null != MySource)
|
||||
{
|
||||
return;
|
||||
}
|
||||
MySource = new TraceSource("DbAPIUI");
|
||||
MySource.Listeners.Clear();
|
||||
Trace.AutoFlush = true;
|
||||
MySource.Listeners.Add(new TextWriterTraceListener("DBAPIUI.log", "log"));
|
||||
MySource.Listeners["log"].IndentLevel = 1;
|
||||
MySource.Listeners["log"].TraceOutputOptions = TraceOptions.DateTime | TraceOptions.Timestamp;
|
||||
MySource.Switch.Level = SourceLevels.All;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
24
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Program.cs
Normal file
24
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Program.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using DTS.Common.Utilities.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DbAPIUI
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Logging.LogManager.Log(System.Diagnostics.TraceEventType.Information, Logging.LogManager.LogEvents.Application, "Starting");
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
||||
36
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Properties/AssemblyInfo.cs
Normal file
36
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("DbAPIUI")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DbAPIUI")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("a3b37e9c-34cb-4a54-a967-abbfe4812246")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
70
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Properties/Resources.Designer.cs
generated
Normal file
70
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,70 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace DbAPIUI.Properties
|
||||
{
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DbAPIUI.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Properties/Resources.resx
Normal file
117
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
38
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Properties/Settings.Designer.cs
generated
Normal file
38
DataPRO/DbAPIUI/DbAPIUI/DbAPIUI/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,38 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DbAPIUI.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string DBFolder {
|
||||
get {
|
||||
return ((string)(this["DBFolder"]));
|
||||
}
|
||||
set {
|
||||
this["DBFolder"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="DbAPIUI.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="DBFolder" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
37
DataPRO/DbAPIUI/DbSDK.sln
Normal file
37
DataPRO/DbAPIUI/DbSDK.sln
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31410.357
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbAPIUI", "DbAPIUI\DbAPIUI\DbAPIUI.csproj", "{A3B37E9C-34CB-4A54-A967-ABBFE4812246}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Debug|x64.Build.0 = Debug|x64
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Debug|x86.Build.0 = Debug|x86
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Release|x64.ActiveCfg = Release|x64
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Release|x64.Build.0 = Release|x64
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Release|x86.ActiveCfg = Release|x86
|
||||
{A3B37E9C-34CB-4A54-A967-ABBFE4812246}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C2382640-BAE1-49BD-9CE7-0172DB8A60B5}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Reference in New Issue
Block a user