2.0.8
This commit is contained in:
201
VisionBuilder.UI.Windows.Duo/Form1.Designer.cs
generated
Normal file
201
VisionBuilder.UI.Windows.Duo/Form1.Designer.cs
generated
Normal file
@@ -0,0 +1,201 @@
|
||||
namespace VisionBuilder.UI.Windows.Duo
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
btnMinimize = new MaterialSkin.Controls.MaterialRaisedButton();
|
||||
btnSettings = new MaterialSkin.Controls.MaterialRaisedButton();
|
||||
btnExit = new MaterialSkin.Controls.MaterialRaisedButton();
|
||||
materialDivider1 = new MaterialSkin.Controls.MaterialDivider();
|
||||
singleCameraControl1 = new VisionBuilder.UI.Windows.Components.SingleCameraControl();
|
||||
btnTestMode = new MaterialSkin.Controls.MaterialRaisedButton();
|
||||
flowLayoutPanel1 = new FlowLayoutPanel();
|
||||
lblVersion = new Label();
|
||||
singleCameraControl2 = new VisionBuilder.UI.Windows.Components.SingleCameraControl();
|
||||
flowLayoutPanel1.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// btnMinimize
|
||||
//
|
||||
btnMinimize.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
btnMinimize.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnMinimize.Depth = 0;
|
||||
btnMinimize.DrawBorder = true;
|
||||
btnMinimize.Font = new Font("Segoe UI Semibold", 12F, FontStyle.Bold);
|
||||
btnMinimize.Icon = null;
|
||||
btnMinimize.Location = new Point(367, 3);
|
||||
btnMinimize.MouseState = MaterialSkin.MouseState.HOVER;
|
||||
btnMinimize.Name = "btnMinimize";
|
||||
btnMinimize.Primary = false;
|
||||
btnMinimize.Size = new Size(176, 64);
|
||||
btnMinimize.TabIndex = 8;
|
||||
btnMinimize.Text = "Minimize";
|
||||
btnMinimize.UseVisualStyleBackColor = true;
|
||||
btnMinimize.Click += btnMinimize_Click;
|
||||
//
|
||||
// btnSettings
|
||||
//
|
||||
btnSettings.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
btnSettings.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnSettings.Depth = 0;
|
||||
btnSettings.DrawBorder = true;
|
||||
btnSettings.Font = new Font("Segoe UI Semibold", 12F, FontStyle.Bold);
|
||||
btnSettings.Icon = null;
|
||||
btnSettings.Location = new Point(185, 3);
|
||||
btnSettings.MouseState = MaterialSkin.MouseState.HOVER;
|
||||
btnSettings.Name = "btnSettings";
|
||||
btnSettings.Primary = false;
|
||||
btnSettings.Size = new Size(176, 64);
|
||||
btnSettings.TabIndex = 7;
|
||||
btnSettings.Text = "Settings";
|
||||
btnSettings.UseVisualStyleBackColor = true;
|
||||
btnSettings.Click += btnSettings_Click;
|
||||
//
|
||||
// btnExit
|
||||
//
|
||||
btnExit.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
btnExit.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnExit.Depth = 0;
|
||||
btnExit.DrawBorder = true;
|
||||
btnExit.Font = new Font("Segoe UI Semibold", 12F, FontStyle.Bold);
|
||||
btnExit.Icon = null;
|
||||
btnExit.Location = new Point(549, 3);
|
||||
btnExit.MouseState = MaterialSkin.MouseState.HOVER;
|
||||
btnExit.Name = "btnExit";
|
||||
btnExit.Primary = false;
|
||||
btnExit.Size = new Size(176, 64);
|
||||
btnExit.TabIndex = 6;
|
||||
btnExit.Text = "Exit";
|
||||
btnExit.UseVisualStyleBackColor = true;
|
||||
btnExit.Click += btnExit_Click;
|
||||
//
|
||||
// materialDivider1
|
||||
//
|
||||
materialDivider1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
materialDivider1.BackColor = Color.FromArgb(55, 71, 79);
|
||||
materialDivider1.Depth = 0;
|
||||
materialDivider1.Location = new Point(8, 984);
|
||||
materialDivider1.MouseState = MaterialSkin.MouseState.HOVER;
|
||||
materialDivider1.Name = "materialDivider1";
|
||||
materialDivider1.Size = new Size(1904, 1);
|
||||
materialDivider1.TabIndex = 9;
|
||||
materialDivider1.Text = "materialDivider1";
|
||||
//
|
||||
// singleCameraControl1
|
||||
//
|
||||
singleCameraControl1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
singleCameraControl1.BackColor = Color.White;
|
||||
singleCameraControl1.Location = new Point(8, 32);
|
||||
singleCameraControl1.Name = "singleCameraControl1";
|
||||
singleCameraControl1.Size = new Size(1904, 464);
|
||||
singleCameraControl1.TabIndex = 10;
|
||||
//
|
||||
// btnTestMode
|
||||
//
|
||||
btnTestMode.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
btnTestMode.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnTestMode.Depth = 0;
|
||||
btnTestMode.DrawBorder = true;
|
||||
btnTestMode.Font = new Font("Segoe UI Semibold", 12F, FontStyle.Bold);
|
||||
btnTestMode.Icon = null;
|
||||
btnTestMode.Location = new Point(3, 3);
|
||||
btnTestMode.MouseState = MaterialSkin.MouseState.HOVER;
|
||||
btnTestMode.Name = "btnTestMode";
|
||||
btnTestMode.Primary = false;
|
||||
btnTestMode.Size = new Size(176, 64);
|
||||
btnTestMode.TabIndex = 11;
|
||||
btnTestMode.Text = "Test mode";
|
||||
btnTestMode.UseVisualStyleBackColor = true;
|
||||
btnTestMode.Click += btnTestMode_Click;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
flowLayoutPanel1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
flowLayoutPanel1.AutoSize = true;
|
||||
flowLayoutPanel1.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
flowLayoutPanel1.BackColor = Color.Transparent;
|
||||
flowLayoutPanel1.Controls.Add(btnTestMode);
|
||||
flowLayoutPanel1.Controls.Add(btnSettings);
|
||||
flowLayoutPanel1.Controls.Add(btnMinimize);
|
||||
flowLayoutPanel1.Controls.Add(btnExit);
|
||||
flowLayoutPanel1.Location = new Point(664, 1002);
|
||||
flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
flowLayoutPanel1.Size = new Size(728, 70);
|
||||
flowLayoutPanel1.TabIndex = 12;
|
||||
//
|
||||
// lblVersion
|
||||
//
|
||||
lblVersion.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
lblVersion.BackColor = Color.Transparent;
|
||||
lblVersion.Location = new Point(1768, 1056);
|
||||
lblVersion.Name = "lblVersion";
|
||||
lblVersion.Size = new Size(148, 23);
|
||||
lblVersion.TabIndex = 13;
|
||||
lblVersion.Text = "Version 0.0.0.0";
|
||||
lblVersion.TextAlign = ContentAlignment.TopRight;
|
||||
//
|
||||
// singleCameraControl2
|
||||
//
|
||||
singleCameraControl2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
singleCameraControl2.BackColor = Color.White;
|
||||
singleCameraControl2.Location = new Point(8, 504);
|
||||
singleCameraControl2.Name = "singleCameraControl2";
|
||||
singleCameraControl2.Size = new Size(1904, 472);
|
||||
singleCameraControl2.TabIndex = 14;
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(1920, 1080);
|
||||
Controls.Add(singleCameraControl2);
|
||||
Controls.Add(lblVersion);
|
||||
Controls.Add(flowLayoutPanel1);
|
||||
Controls.Add(singleCameraControl1);
|
||||
Controls.Add(materialDivider1);
|
||||
Name = "Form1";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Form1";
|
||||
flowLayoutPanel1.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private MaterialSkin.Controls.MaterialRaisedButton btnMinimize;
|
||||
private MaterialSkin.Controls.MaterialRaisedButton btnSettings;
|
||||
private MaterialSkin.Controls.MaterialRaisedButton btnExit;
|
||||
private MaterialSkin.Controls.MaterialDivider materialDivider1;
|
||||
private Components.SingleCameraControl singleCameraControl1;
|
||||
private MaterialSkin.Controls.MaterialRaisedButton btnTestMode;
|
||||
private FlowLayoutPanel flowLayoutPanel1;
|
||||
private Label lblVersion;
|
||||
private Components.SingleCameraControl singleCameraControl2;
|
||||
}
|
||||
}
|
||||
109
VisionBuilder.UI.Windows.Duo/Form1.cs
Normal file
109
VisionBuilder.UI.Windows.Duo/Form1.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
using MaterialSkin;
|
||||
using MaterialSkin.Controls;
|
||||
using VisionBuilder.UI.Common;
|
||||
using VisionBuilder.UI.Common.Services;
|
||||
using VisionBuilder.UI.Common.ViewModel;
|
||||
|
||||
namespace VisionBuilder.UI.Windows.Duo
|
||||
{
|
||||
public partial class Form1 : MaterialForm
|
||||
{
|
||||
private readonly MainWindowVM _mainWindowVm;
|
||||
private readonly IPasswordInputService _passwordInputService;
|
||||
private readonly UIConfiguration _uiConfiguration;
|
||||
private readonly WindowsUISettings _windowsUiSettings;
|
||||
|
||||
public Form1(MainWindowVM mainWindowVm, IPasswordInputService passwordInputService, UIConfiguration uiConfiguration, WindowsUISettings windowsUiSettings)
|
||||
{
|
||||
|
||||
_mainWindowVm = mainWindowVm;
|
||||
_passwordInputService = passwordInputService;
|
||||
_uiConfiguration = uiConfiguration;
|
||||
_windowsUiSettings = windowsUiSettings;
|
||||
MaterialSkin.MaterialSkinManager.ConfigureForInspectron();
|
||||
InitializeComponent();
|
||||
singleCameraControl1.SetViewModel(mainWindowVm.SingleCameraVms[0]);
|
||||
singleCameraControl2.SetViewModel(mainWindowVm.SingleCameraVms[1]);
|
||||
Load += Form1_Load;
|
||||
_mainWindowVm.PropertyChanged += _mainWindowVm_PropertyChanged;
|
||||
lblVersion.Text = $"v{Application.ProductVersion.Split('+')[0]}";
|
||||
if(!_uiConfiguration.ShowTestModeButton)
|
||||
flowLayoutPanel1.Controls.Remove(btnTestMode);
|
||||
|
||||
}
|
||||
|
||||
private void _mainWindowVm_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == nameof(_mainWindowVm.TestMode))
|
||||
{
|
||||
if (_mainWindowVm.TestMode)
|
||||
{
|
||||
MaterialSkinManager.Instance.ColorScheme = new ColorScheme(Primary.Green800, Primary.Green800,
|
||||
Primary.Green400, Accent.Green200, TextShade.WHITE);
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialSkinManager.ConfigureForInspectron();
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
_mainWindowVm.OnProgramStarted();
|
||||
BringToFront();
|
||||
if (_windowsUiSettings.FullScreen)
|
||||
{
|
||||
WindowState = FormWindowState.Maximized;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnShown(EventArgs e)
|
||||
{
|
||||
base.OnShown(e);
|
||||
flowLayoutPanel1.Left = (ClientSize.Width - flowLayoutPanel1.Width) / 2;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void btnExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
_mainWindowVm.OnProgramClosed();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
base.OnClosed(e);
|
||||
_mainWindowVm.OnProgramClosed();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
private void btnMinimize_Click(object sender, EventArgs e)
|
||||
{
|
||||
WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
|
||||
private void btnSettings_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_uiConfiguration.ProtectSettingsWithPassword)
|
||||
{
|
||||
var passwordOk = _passwordInputService.GetPassword() == _uiConfiguration.AdminPassword;
|
||||
if (!passwordOk)
|
||||
return;
|
||||
}
|
||||
_mainWindowVm.SettingsCommand.Execute(null);
|
||||
}
|
||||
|
||||
private void btnTestMode_Click(object sender, EventArgs e)
|
||||
{
|
||||
_mainWindowVm.ToggleTestModeCommand.Execute(null);
|
||||
}
|
||||
|
||||
public object GetHandle()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
VisionBuilder.UI.Windows.Duo/Form1.resx
Normal file
120
VisionBuilder.UI.Windows.Duo/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>
|
||||
BIN
VisionBuilder.UI.Windows.Duo/Inspectron icon-512.ico
Normal file
BIN
VisionBuilder.UI.Windows.Duo/Inspectron icon-512.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 103 KiB |
105
VisionBuilder.UI.Windows.Duo/Program.cs
Normal file
105
VisionBuilder.UI.Windows.Duo/Program.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using Inspectron.Settings;
|
||||
using Lindt.Colorballs.Duo.Utils;
|
||||
using Ninject;
|
||||
using Ninject.Extensions.ChildKernel;
|
||||
using VisionBuilder.UI.Common;
|
||||
using VisionBuilder.UI.Common.Processing;
|
||||
using VisionBuilder.UI.Common.ViewModel;
|
||||
using VisionBuilder.UI.IOCommander;
|
||||
using VisionBuilder.UI.Recipes.HawkeyeRecipe;
|
||||
using VisionBuilder.UI.Ringbuffer;
|
||||
using VisionBuilder.UI.Statistics;
|
||||
using VisionBuilder.UI.Windows;
|
||||
using VisionBuilder.UI.Windows.Duo;
|
||||
|
||||
internal static class Program
|
||||
{
|
||||
private const string CAMERA1 = "Camera 1";
|
||||
private const string CAMERA2 = "Camera 2";
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
// In your application startup code
|
||||
MaterialSkin.MaterialSkinManager.ConfigureForInspectron();
|
||||
|
||||
InspectronSettings settings = new InspectronSettings("..\\Data\\Config");
|
||||
|
||||
var mainKernel = VisionBuilder.UI.Common.VisionBuilder.CreateMainKernel(settings);
|
||||
|
||||
mainKernel.UsePlugins();
|
||||
|
||||
|
||||
mainKernel
|
||||
.UseConsole()
|
||||
.UseIOCommander([CAMERA1,CAMERA2])
|
||||
.UseIOCommanderWindowsDebug()
|
||||
.UseIOCommanderVirtualInput()
|
||||
.UseWindowsServices()
|
||||
.RegisterGlobalPlugins()
|
||||
;
|
||||
|
||||
mainKernel.Get<ILoadingService>().StartLoading("Camera initialization");
|
||||
|
||||
|
||||
// CAMERAS //
|
||||
ChildKernel kernelCamera1 = new ChildKernel(mainKernel);
|
||||
ChildKernel kernelCamera2 = new ChildKernel(mainKernel);
|
||||
|
||||
// MODULES //
|
||||
kernelCamera1
|
||||
.RegisterCamera(CAMERA1)
|
||||
.UseStatistics(CAMERA1)
|
||||
.UseRingbuffer(CAMERA1)
|
||||
.UseHawkeyeRecipes(CAMERA1)
|
||||
.UseCameraIOCommander(CAMERA1)
|
||||
.RegisterCameraPlugins(CAMERA1)
|
||||
;
|
||||
|
||||
kernelCamera2
|
||||
.RegisterCamera(CAMERA2)
|
||||
.UseStatistics(CAMERA2)
|
||||
.UseRingbuffer(CAMERA2)
|
||||
.UseHawkeyeRecipes(CAMERA2)
|
||||
.UseCameraIOCommander(CAMERA2)
|
||||
.RegisterCameraPlugins(CAMERA2)
|
||||
;
|
||||
|
||||
// LOAD SETTINGS //
|
||||
mainKernel.RegisterSettings();
|
||||
kernelCamera1.RegisterSettings();
|
||||
kernelCamera2.RegisterSettings();
|
||||
settings.LoadSettings();
|
||||
|
||||
// Create camera and bind it
|
||||
// Must be done after settings are loaded
|
||||
kernelCamera1.UseCamera();
|
||||
kernelCamera2.UseCamera();
|
||||
|
||||
// initialize modules
|
||||
mainKernel.InitializeModules();
|
||||
kernelCamera1.InitializeModules();
|
||||
kernelCamera2.InitializeModules();
|
||||
|
||||
mainKernel.Get<ILoadingService>().StopLoading("Camera initialization");
|
||||
|
||||
|
||||
|
||||
var mainWindowVm = mainKernel.Get<MainWindowVM>();
|
||||
mainWindowVm.SingleCameraVms = [
|
||||
kernelCamera1.Get<SingleCameraVM>(),
|
||||
kernelCamera2.Get<SingleCameraVM>()
|
||||
];
|
||||
|
||||
var form = mainKernel.Get<Form1>();
|
||||
|
||||
settings.LoadSettings();
|
||||
|
||||
Application.Run(form);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<ApplicationIcon>Inspectron icon-512.ico</ApplicationIcon>
|
||||
<Deterministic>false</Deterministic>
|
||||
<Version>2.0.8</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="Inspectron icon-512.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Ninject.Extensions.ChildKernel" Version="3.3.0" />
|
||||
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.6.0.20220608" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\framework\Inspectron.Settings.Windows\Inspectron.Settings.Windows.csproj" />
|
||||
<ProjectReference Include="..\framework\Inspectron.Settings\Inspectron.Settings.csproj" />
|
||||
<ProjectReference Include="..\framework\MaterialSkin.Core\MaterialSkin.Core.csproj" />
|
||||
<ProjectReference Include="..\Hawkeye.VisionBuilder.UI.Sources.Emulation\Hawkeye.VisionBuilder.UI.Sources.Emulation.csproj" />
|
||||
<ProjectReference Include="..\VisionBuilder.UI.Camera\VisionBuilder.UI.Camera.csproj" />
|
||||
<ProjectReference Include="..\VisionBuilder.UI.Common\VisionBuilder.UI.Common.csproj" />
|
||||
<ProjectReference Include="..\VisionBuilder.UI.Console\VisionBuilder.UI.Console.csproj" />
|
||||
<ProjectReference Include="..\VisionBuilder.UI.IOCommander.Windows\VisionBuilder.UI.IOCommander.Windows.csproj" />
|
||||
<ProjectReference Include="..\VisionBuilder.UI.IOCommander\VisionBuilder.UI.IOCommander.csproj" />
|
||||
<ProjectReference Include="..\VisionBuilder.UI.Recipes.HawkeyeRecipe\VisionBuilder.UI.Recipes.HawkeyeRecipe.csproj" />
|
||||
<ProjectReference Include="..\VisionBuilder.UI.Ringbuffer\VisionBuilder.UI.Ringbuffer.csproj" />
|
||||
<ProjectReference Include="..\VisionBuilder.UI.Statistics\VisionBuilder.UI.Statistics.csproj" />
|
||||
<ProjectReference Include="..\VisionBuilder.UI.Windows\VisionBuilder.UI.Windows.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Installer\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user