1.0.6
This commit is contained in:
@@ -12,8 +12,8 @@ public abstract class BaseRecognitionControlSettings(string cameraName) : ISetti
|
||||
|
||||
public virtual void RegisterSettings(InspectronSettings settings)
|
||||
{
|
||||
settings.RegisterSimple(this, () => this.MinimumProcessingTime, CameraName + "/Hawkeye recognition", "Minimum processing time (ms)");
|
||||
settings.RegisterSimple(this, () => this.RecipeNameFilter, CameraName + "/Hawkeye recognition", nameof(RecipeNameFilter));
|
||||
settings.RegisterSimple(this, () => this.ErrorsInSequenceAlarm, CameraName + "/Hawkeye recognition", nameof(ErrorsInSequenceAlarm));
|
||||
settings.RegisterSimple(this, () => this.MinimumProcessingTime, CameraName + "/Recognition", "Minimum processing time (ms)");
|
||||
settings.RegisterSimple(this, () => this.RecipeNameFilter, CameraName + "/Recognition", nameof(RecipeNameFilter));
|
||||
settings.RegisterSimple(this, () => this.ErrorsInSequenceAlarm, CameraName + "/Recognition", nameof(ErrorsInSequenceAlarm));
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,10 @@ public class UIConfiguration: ISettings
|
||||
|
||||
public bool ProtectSettingsWithPassword { get; set; }=false;
|
||||
|
||||
public bool ShowPauseButton { get; set; }=false;
|
||||
|
||||
public bool ShowTestModeButton { get; set; } = false;
|
||||
|
||||
public List<ErrorShortName> ErrorShortNames { get; set; } = new List<ErrorShortName>();
|
||||
|
||||
public void RegisterSettings(InspectronSettings settings)
|
||||
@@ -24,6 +28,8 @@ public class UIConfiguration: ISettings
|
||||
settings.RegisterSimple(this, () => this.AdminPassword, "System", "Password");
|
||||
settings.RegisterSimple(this, () => this.ProtectSettingsWithPassword, "System", nameof(ProtectSettingsWithPassword));
|
||||
settings.RegisterSimple(this, () => this.ErrorShortNames, "Errors", "Error short names");
|
||||
settings.RegisterSimple(this, () => this.ShowPauseButton, "System", nameof(ShowPauseButton));
|
||||
settings.RegisterSimple(this, () => this.ShowTestModeButton, "System", nameof(ShowTestModeButton));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ public partial class ErrorPreviewVM:ObservableObject
|
||||
[RelayCommand(CanExecute = nameof(LearnButtonVisible))]
|
||||
public void Learn()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_uiConfiguration.AdminPassword))
|
||||
if (!string.IsNullOrEmpty(_uiConfiguration.AdminPassword))
|
||||
{
|
||||
var passwordOk= _passwordInputService.GetPassword()==_uiConfiguration.AdminPassword;
|
||||
if (!passwordOk) return;
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace VisionBuilder.UI.Common
|
||||
public partial class SingleCameraVM : ObservableObject, IEventHandler<ImageProcessedEvent>
|
||||
{
|
||||
public SynchronizationContext? SynchronizationContext { get; set; }
|
||||
|
||||
|
||||
private readonly UIConfiguration _uiConfiguration;
|
||||
private readonly IRecipeSelectionDialogService _recipeSelectionDialogService;
|
||||
private readonly IRecognitionControl _recognitionControl;
|
||||
|
||||
@@ -56,8 +57,10 @@ namespace VisionBuilder.UI.Common
|
||||
|
||||
public bool CanStop => IsRunning;
|
||||
public bool CanStart => !IsRunning && SelectedRecipe!=null;
|
||||
public bool CanPause => IsRunning && !IsPaused;
|
||||
public bool CanResume => IsRunning && IsPaused;
|
||||
public bool CanPause => (IsRunning && !IsPaused)&&_uiConfiguration.ShowPauseButton;
|
||||
public bool CanResume => (IsRunning && IsPaused) && _uiConfiguration.ShowPauseButton;
|
||||
|
||||
|
||||
|
||||
public bool IsNotRunning => !IsRunning;
|
||||
private bool _handlingEnabled = true;
|
||||
@@ -77,10 +80,12 @@ namespace VisionBuilder.UI.Common
|
||||
[NotifyPropertyChangedFor(nameof(RecipeSelected))]
|
||||
[NotifyPropertyChangedFor(nameof(RecipeNotSelected))]
|
||||
private RecipeData? _selectedRecipe;
|
||||
|
||||
|
||||
|
||||
public SingleCameraVM(CameraSettings cameraSettings, UIConfiguration uiConfiguration, IRecipeSelectionDialogService recipeSelectionDialogService, IRecognitionControl recognitionControl, IImagePreviewService imagePreviewService, ILearningTool learningTool, IPasswordInputService passwordInputService)
|
||||
{
|
||||
_uiConfiguration = uiConfiguration;
|
||||
_recipeSelectionDialogService = recipeSelectionDialogService;
|
||||
|
||||
_recognitionControl = recognitionControl;
|
||||
@@ -94,6 +99,8 @@ namespace VisionBuilder.UI.Common
|
||||
|
||||
recognitionControl.SessionStarted += StatisticsVm.Handle;
|
||||
recognitionControl.SessionStarted += ErrorsVm.Handle;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user