hot reload

This commit is contained in:
EugeneTes
2026-02-18 11:01:35 +01:00
parent 2bac7140a4
commit 14fe822962
9 changed files with 345 additions and 47 deletions

View File

@@ -40,8 +40,9 @@
btnSelectRecipe = new MaterialSkin.Controls.MaterialRaisedButton();
btnStop = new MaterialSkin.Controls.MaterialRaisedButton();
btnPause = new MaterialSkin.Controls.MaterialRaisedButton();
materialDivider2 = new MaterialSkin.Controls.MaterialDivider();
btnResume = new MaterialSkin.Controls.MaterialRaisedButton();
btnHotReload = new MaterialSkin.Controls.MaterialRaisedButton();
materialDivider2 = new MaterialSkin.Controls.MaterialDivider();
((System.ComponentModel.ISupportInitialize)previewWindow1).BeginInit();
flowLayoutPanel1.SuspendLayout();
flowLayoutPanel2.SuspendLayout();
@@ -51,9 +52,9 @@
//
lblCameraName.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
lblCameraName.Font = new Font("Segoe UI Semibold", 12F, FontStyle.Bold, GraphicsUnit.Point, 204);
lblCameraName.Location = new Point(8, 8);
lblCameraName.Location = new Point(9, 11);
lblCameraName.Name = "lblCameraName";
lblCameraName.Size = new Size(744, 21);
lblCameraName.Size = new Size(850, 28);
lblCameraName.TabIndex = 2;
lblCameraName.Text = "CameraName";
lblCameraName.TextAlign = ContentAlignment.TopCenter;
@@ -62,9 +63,9 @@
//
label1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
label1.Font = new Font("Segoe UI", 12F);
label1.Location = new Point(784, 0);
label1.Location = new Point(896, 0);
label1.Name = "label1";
label1.Size = new Size(408, 21);
label1.Size = new Size(466, 28);
label1.TabIndex = 4;
label1.Text = "Errors";
label1.TextAlign = ContentAlignment.TopCenter;
@@ -72,9 +73,10 @@
// previewWindow1
//
previewWindow1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
previewWindow1.Location = new Point(0, 32);
previewWindow1.Location = new Point(0, 43);
previewWindow1.Margin = new Padding(3, 4, 3, 4);
previewWindow1.Name = "previewWindow1";
previewWindow1.Size = new Size(752, 456);
previewWindow1.Size = new Size(859, 608);
previewWindow1.SizeMode = PictureBoxSizeMode.Zoom;
previewWindow1.TabIndex = 5;
previewWindow1.TabStop = false;
@@ -84,28 +86,31 @@
materialDivider1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
materialDivider1.BackColor = Color.FromArgb(55, 71, 79);
materialDivider1.Depth = 0;
materialDivider1.Location = new Point(760, 24);
materialDivider1.Location = new Point(869, 32);
materialDivider1.Margin = new Padding(3, 4, 3, 4);
materialDivider1.MouseState = MaterialSkin.MouseState.HOVER;
materialDivider1.Name = "materialDivider1";
materialDivider1.Size = new Size(1, 456);
materialDivider1.Size = new Size(1, 608);
materialDivider1.TabIndex = 6;
materialDivider1.Text = "materialDivider1";
//
// errorPreview1
//
errorPreview1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
errorPreview1.Location = new Point(776, 24);
errorPreview1.Location = new Point(887, 32);
errorPreview1.Margin = new Padding(3, 5, 3, 5);
errorPreview1.Name = "errorPreview1";
errorPreview1.Size = new Size(416, 456);
errorPreview1.Size = new Size(475, 608);
errorPreview1.TabIndex = 7;
//
// stats1
//
stats1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
stats1.BackColor = Color.White;
stats1.Location = new Point(1200, 32);
stats1.Location = new Point(1371, 43);
stats1.Margin = new Padding(3, 5, 3, 5);
stats1.Name = "stats1";
stats1.Size = new Size(232, 456);
stats1.Size = new Size(265, 608);
stats1.TabIndex = 8;
//
// btnStart
@@ -114,13 +119,14 @@
btnStart.AutoSizeMode = AutoSizeMode.GrowAndShrink;
btnStart.Depth = 0;
btnStart.DrawBorder = false;
btnStart.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
btnStart.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point, 0);
btnStart.Icon = null;
btnStart.Location = new Point(21, 73);
btnStart.Location = new Point(25, 97);
btnStart.Margin = new Padding(3, 4, 3, 4);
btnStart.MouseState = MaterialSkin.MouseState.HOVER;
btnStart.Name = "btnStart";
btnStart.Primary = true;
btnStart.Size = new Size(176, 64);
btnStart.Size = new Size(201, 85);
btnStart.TabIndex = 9;
btnStart.Text = "Start";
btnStart.UseVisualStyleBackColor = true;
@@ -130,11 +136,12 @@
flowLayoutPanel1.Controls.Add(flowLayoutPanel2);
flowLayoutPanel1.Dock = DockStyle.Right;
flowLayoutPanel1.FlowDirection = FlowDirection.TopDown;
flowLayoutPanel1.Location = new Point(1448, 0);
flowLayoutPanel1.Location = new Point(1655, 0);
flowLayoutPanel1.Margin = new Padding(3, 4, 3, 4);
flowLayoutPanel1.Name = "flowLayoutPanel1";
flowLayoutPanel1.Padding = new Padding(8, 24, 8, 8);
flowLayoutPanel1.Padding = new Padding(9, 32, 9, 11);
flowLayoutPanel1.RightToLeft = RightToLeft.Yes;
flowLayoutPanel1.Size = new Size(240, 498);
flowLayoutPanel1.Size = new Size(274, 664);
flowLayoutPanel1.TabIndex = 10;
//
// flowLayoutPanel2
@@ -144,9 +151,11 @@
flowLayoutPanel2.Controls.Add(btnStop);
flowLayoutPanel2.Controls.Add(btnPause);
flowLayoutPanel2.Controls.Add(btnResume);
flowLayoutPanel2.Location = new Point(21, 27);
flowLayoutPanel2.Controls.Add(btnHotReload);
flowLayoutPanel2.Location = new Point(24, 36);
flowLayoutPanel2.Margin = new Padding(3, 4, 3, 4);
flowLayoutPanel2.Name = "flowLayoutPanel2";
flowLayoutPanel2.Size = new Size(200, 365);
flowLayoutPanel2.Size = new Size(229, 578);
flowLayoutPanel2.TabIndex = 12;
//
// btnSelectRecipe
@@ -157,11 +166,12 @@
btnSelectRecipe.DrawBorder = true;
btnSelectRecipe.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
btnSelectRecipe.Icon = null;
btnSelectRecipe.Location = new Point(21, 3);
btnSelectRecipe.Location = new Point(25, 4);
btnSelectRecipe.Margin = new Padding(3, 4, 3, 4);
btnSelectRecipe.MouseState = MaterialSkin.MouseState.HOVER;
btnSelectRecipe.Name = "btnSelectRecipe";
btnSelectRecipe.Primary = false;
btnSelectRecipe.Size = new Size(176, 64);
btnSelectRecipe.Size = new Size(201, 85);
btnSelectRecipe.TabIndex = 11;
btnSelectRecipe.Text = "Select recipe";
btnSelectRecipe.UseVisualStyleBackColor = true;
@@ -174,11 +184,12 @@
btnStop.DrawBorder = false;
btnStop.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
btnStop.Icon = null;
btnStop.Location = new Point(21, 143);
btnStop.Location = new Point(25, 190);
btnStop.Margin = new Padding(3, 4, 3, 4);
btnStop.MouseState = MaterialSkin.MouseState.HOVER;
btnStop.Name = "btnStop";
btnStop.Primary = true;
btnStop.Size = new Size(176, 64);
btnStop.Size = new Size(201, 85);
btnStop.TabIndex = 10;
btnStop.Text = "Stop";
btnStop.UseVisualStyleBackColor = true;
@@ -191,27 +202,16 @@
btnPause.DrawBorder = true;
btnPause.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
btnPause.Icon = null;
btnPause.Location = new Point(21, 213);
btnPause.Location = new Point(25, 283);
btnPause.Margin = new Padding(3, 4, 3, 4);
btnPause.MouseState = MaterialSkin.MouseState.HOVER;
btnPause.Name = "btnPause";
btnPause.Primary = false;
btnPause.Size = new Size(176, 64);
btnPause.Size = new Size(201, 85);
btnPause.TabIndex = 12;
btnPause.Text = "Pause";
btnPause.UseVisualStyleBackColor = true;
//
// materialDivider2
//
materialDivider2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
materialDivider2.BackColor = Color.FromArgb(55, 71, 79);
materialDivider2.Depth = 0;
materialDivider2.Location = new Point(1192, 24);
materialDivider2.MouseState = MaterialSkin.MouseState.HOVER;
materialDivider2.Name = "materialDivider2";
materialDivider2.Size = new Size(1, 456);
materialDivider2.TabIndex = 11;
materialDivider2.Text = "materialDivider2";
//
// btnResume
//
btnResume.Anchor = AnchorStyles.Top | AnchorStyles.Right;
@@ -220,18 +220,51 @@
btnResume.DrawBorder = true;
btnResume.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
btnResume.Icon = null;
btnResume.Location = new Point(21, 283);
btnResume.Location = new Point(25, 376);
btnResume.Margin = new Padding(3, 4, 3, 4);
btnResume.MouseState = MaterialSkin.MouseState.HOVER;
btnResume.Name = "btnResume";
btnResume.Primary = false;
btnResume.Size = new Size(176, 64);
btnResume.Size = new Size(201, 85);
btnResume.TabIndex = 13;
btnResume.Text = "Resume";
btnResume.UseVisualStyleBackColor = true;
//
// btnHotReload
//
btnHotReload.Anchor = AnchorStyles.Top | AnchorStyles.Right;
btnHotReload.AutoSizeMode = AutoSizeMode.GrowAndShrink;
btnHotReload.Depth = 0;
btnHotReload.DrawBorder = true;
btnHotReload.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
btnHotReload.Icon = null;
btnHotReload.Location = new Point(25, 469);
btnHotReload.Margin = new Padding(3, 4, 3, 4);
btnHotReload.MouseState = MaterialSkin.MouseState.HOVER;
btnHotReload.Name = "btnHotReload";
btnHotReload.Primary = false;
btnHotReload.Size = new Size(201, 85);
btnHotReload.TabIndex = 14;
btnHotReload.Text = "Hot Reload";
btnHotReload.UseVisualStyleBackColor = true;
btnHotReload.Visible = false;
//
// materialDivider2
//
materialDivider2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
materialDivider2.BackColor = Color.FromArgb(55, 71, 79);
materialDivider2.Depth = 0;
materialDivider2.Location = new Point(1362, 32);
materialDivider2.Margin = new Padding(3, 4, 3, 4);
materialDivider2.MouseState = MaterialSkin.MouseState.HOVER;
materialDivider2.Name = "materialDivider2";
materialDivider2.Size = new Size(1, 608);
materialDivider2.TabIndex = 11;
materialDivider2.Text = "materialDivider2";
//
// SingleCameraControl
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.White;
Controls.Add(materialDivider2);
@@ -242,8 +275,9 @@
Controls.Add(previewWindow1);
Controls.Add(label1);
Controls.Add(lblCameraName);
Margin = new Padding(3, 4, 3, 4);
Name = "SingleCameraControl";
Size = new Size(1688, 498);
Size = new Size(1929, 664);
((System.ComponentModel.ISupportInitialize)previewWindow1).EndInit();
flowLayoutPanel1.ResumeLayout(false);
flowLayoutPanel2.ResumeLayout(false);
@@ -266,5 +300,6 @@
private FlowLayoutPanel flowLayoutPanel2;
private MaterialSkin.Controls.MaterialRaisedButton btnPause;
private MaterialSkin.Controls.MaterialRaisedButton btnResume;
private MaterialSkin.Controls.MaterialRaisedButton btnHotReload;
}
}

View File

@@ -47,7 +47,9 @@ namespace VisionBuilder.UI.Windows.Components
btnSelectRecipe.DataBindings.Add(nameof(btnSelectRecipe.Primary), _singleCameraVm, nameof(_singleCameraVm.RecipeNotSelected), true, DataSourceUpdateMode.OnPropertyChanged);
btnPause.DataBindings.Add(nameof(btnPause.Visible), _singleCameraVm, nameof(_singleCameraVm.CanPause), true, DataSourceUpdateMode.OnPropertyChanged);
btnResume.DataBindings.Add(nameof(btnResume.Visible), _singleCameraVm, nameof(_singleCameraVm.CanResume), true, DataSourceUpdateMode.OnPropertyChanged);
btnHotReload.Command = _singleCameraVm.HotReloadCommand;
btnHotReload.DataBindings.Add(nameof(btnHotReload.Visible), _singleCameraVm, nameof(_singleCameraVm.CanHotReload), true, DataSourceUpdateMode.OnPropertyChanged);
}