check point
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
namespace Hawkeye.VisionBuilder.Workflow.Configuration;
|
||||
|
||||
public class BadTweakLearning
|
||||
{
|
||||
public bool Enabled { get; set; } = false;
|
||||
public int ThresholdLevel { get; set; } = 80;
|
||||
|
||||
public void Save(BinaryWriter bw)
|
||||
{
|
||||
bw.Write(Enabled);
|
||||
bw.Write(ThresholdLevel);
|
||||
}
|
||||
|
||||
public void Load(BinaryReader br)
|
||||
{
|
||||
Enabled = br.ReadBoolean();
|
||||
ThresholdLevel = br.ReadInt32();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Hawkeye.VisionBuilder.Workflow.Configuration;
|
||||
|
||||
public enum ECameraType
|
||||
{
|
||||
Emulation=0,
|
||||
Hawkeye=1
|
||||
|
||||
}
|
||||
8
Hawkeye.VisionBuilder.Workflow/Configuration/EOutputs.cs
Normal file
8
Hawkeye.VisionBuilder.Workflow/Configuration/EOutputs.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Hawkeye.VisionBuilder.Workflow.Configuration;
|
||||
|
||||
public enum EOutputs
|
||||
{
|
||||
None,
|
||||
Firmata,
|
||||
NetServer
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace Hawkeye.VisionBuilder.Workflow.Configuration;
|
||||
|
||||
public class RecipeSelectionConfig
|
||||
{
|
||||
public bool SerialEnabled { get; set; } = false;
|
||||
public string ComPort { get; set; } = "COM3";
|
||||
|
||||
public void Save(BinaryWriter bw)
|
||||
{
|
||||
bw.Write(SerialEnabled);
|
||||
bw.Write(ComPort);
|
||||
}
|
||||
|
||||
public void Load(BinaryReader br)
|
||||
{
|
||||
SerialEnabled = br.ReadBoolean();
|
||||
ComPort = br.ReadString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Security.AccessControl;
|
||||
using Hawkeye.VisionBuilder.Workflow.Operations;
|
||||
|
||||
|
||||
namespace Hawkeye.VisionBuilder.Workflow.Configuration;
|
||||
|
||||
public class WorkflowConfiguration
|
||||
{
|
||||
public WorkflowConfiguration()
|
||||
{
|
||||
var userFolder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
PythonPath = Path.Combine(userFolder, @"miniconda3\envs\ai3_cpu\python.exe");
|
||||
}
|
||||
|
||||
public ECameraType RuntimeCameraType { get; set; } = ECameraType.Emulation;
|
||||
public ECameraType DevelopmentCameraType { get; set; } = ECameraType.Emulation;
|
||||
|
||||
public string EmulationPath { get; set; } = "..\\Data\\Emulation";
|
||||
public string PythonPath { get; set; }
|
||||
|
||||
public EOutputs Outputs { get; set; }
|
||||
public int ResultPin { get; set; }
|
||||
public string SerialPort { get; set; } = "";
|
||||
public int Delay { get; set; } = 0;
|
||||
|
||||
|
||||
public BadTweakLearning BadTweakLearning { get; set; } = new BadTweakLearning();
|
||||
public RecipeSelectionConfig RecipeSelectionConfig { get; set; }=new RecipeSelectionConfig();
|
||||
|
||||
public void Save(BinaryWriter bw)
|
||||
{
|
||||
bw.Write((int)RuntimeCameraType);
|
||||
bw.Write((int)DevelopmentCameraType);
|
||||
bw.Write((int)Outputs);
|
||||
bw.Write(EmulationPath);
|
||||
bw.Write(PythonPath);
|
||||
bw.Write(ResultPin);
|
||||
bw.Write(SerialPort);
|
||||
bw.Write(Delay);
|
||||
BadTweakLearning.Save(bw);
|
||||
RecipeSelectionConfig.Save(bw);
|
||||
}
|
||||
|
||||
public void Load(BinaryReader br)
|
||||
{
|
||||
RuntimeCameraType = (ECameraType) br.ReadInt32();
|
||||
DevelopmentCameraType = (ECameraType) br.ReadInt32();
|
||||
Outputs = (EOutputs) br.ReadInt32();
|
||||
EmulationPath = br.ReadString();
|
||||
PythonPath = br.ReadString();
|
||||
ResultPin = br.ReadInt32();
|
||||
SerialPort = br.ReadString();
|
||||
Delay = br.ReadInt32();
|
||||
BadTweakLearning.Load(br);
|
||||
RecipeSelectionConfig.Load(br);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user