Moved Model Name and Predictor Model Name to
Property Configuration
This commit is contained in:
@ -8,7 +8,7 @@ public class Configuration
|
||||
|
||||
[Display(Name = "Compare Source"), Required] public string CompareSource { get; set; }
|
||||
[Display(Name = "Empty Destination"), Required] public string EmptyDestination { get; set; }
|
||||
[Display(Name = "Property Configuration"), Required] public Property.Models.Configuration? PropertyConfiguration { get; set; }
|
||||
[Display(Name = "Property Configuration"), Required] public Property.Models.Configuration PropertyConfiguration { get; set; }
|
||||
[Display(Name = "Selected Source"), Required] public string SelectedSource { get; set; }
|
||||
|
||||
public Configuration()
|
||||
|
@ -8,15 +8,15 @@ public class Configuration
|
||||
|
||||
protected string _CompareSource;
|
||||
protected string _EmptyDestination;
|
||||
protected Property.Models.Configuration? _PropertyConfiguration;
|
||||
protected Property.Models.Configuration _PropertyConfiguration;
|
||||
protected string _SelectedSource;
|
||||
public string CompareSource => _CompareSource;
|
||||
public string EmptyDestination => _EmptyDestination;
|
||||
public Property.Models.Configuration? PropertyConfiguration => _PropertyConfiguration;
|
||||
public Property.Models.Configuration PropertyConfiguration => _PropertyConfiguration;
|
||||
public string SelectedSource => _SelectedSource;
|
||||
|
||||
[JsonConstructor]
|
||||
public Configuration(string compareSource, string emptyDestination, Property.Models.Configuration? propertyConfiguration, string selectedSource)
|
||||
public Configuration(string compareSource, string emptyDestination, Property.Models.Configuration propertyConfiguration, string selectedSource)
|
||||
{
|
||||
_CompareSource = compareSource;
|
||||
_EmptyDestination = emptyDestination;
|
||||
@ -32,9 +32,9 @@ public class Configuration
|
||||
|
||||
public void Set(Property.Models.Configuration configuration) => _PropertyConfiguration = configuration;
|
||||
|
||||
public void Update()
|
||||
public void SetAndUpdate(Property.Models.Configuration configuration, int? numberOfJitters, int? numberOfTimesToUpsample, string? modelName, string? predictorModelName)
|
||||
{
|
||||
_PropertyConfiguration?.Update();
|
||||
_PropertyConfiguration.Update(numberOfJitters, numberOfTimesToUpsample, modelName, predictorModelName);
|
||||
_CompareSource = Path.GetFullPath(_CompareSource);
|
||||
_SelectedSource = Path.GetFullPath(_SelectedSource);
|
||||
_EmptyDestination = Path.GetFullPath(_EmptyDestination);
|
||||
|
@ -19,8 +19,7 @@ public abstract class Configuration
|
||||
if (result is null)
|
||||
throw new Exception(json);
|
||||
string jsonThis = result.ToString();
|
||||
result.Set(propertyConfiguration);
|
||||
result.Update();
|
||||
result.SetAndUpdate(propertyConfiguration, null, null, null, null);
|
||||
if (jsonThis != json)
|
||||
{
|
||||
int? check = null;
|
||||
|
@ -3,7 +3,6 @@ using Phares.Shared;
|
||||
using View_by_Distance.Not.Copy.Copy.Models;
|
||||
using View_by_Distance.Property.Models;
|
||||
using View_by_Distance.Shared.Models.Methods;
|
||||
using View_by_Distance.Shared.Models.Stateless;
|
||||
|
||||
namespace View_by_Distance.Not.Copy.Copy;
|
||||
|
||||
@ -31,13 +30,11 @@ public class NotCopyCopy
|
||||
Models.Configuration configuration = Models.Stateless.Configuration.Get(isEnvironment, configurationRoot, workingDirectory, propertyConfiguration);
|
||||
Verify(configuration);
|
||||
bool reverse = false;
|
||||
Model? model = null;
|
||||
string outputExtension = ".jpg";
|
||||
_Configuration = configuration;
|
||||
PredictorModel? predictorModel = null;
|
||||
if (!_IsEnvironment.Development)
|
||||
throw new Exception("This program only allows development environments!");
|
||||
A_Property propertyLogic = GetPropertyLogic(reverse, model, outputExtension, predictorModel);
|
||||
A_Property propertyLogic = GetPropertyLogic(reverse, outputExtension);
|
||||
propertyConfiguration.ChangeRootDirectory(configuration.CompareSource);
|
||||
(_, _, _, Shared.Models.Container[] compareContainers) = A_Property.Get(propertyConfiguration, propertyLogic);
|
||||
propertyConfiguration.ChangeRootDirectory(configuration.SelectedSource);
|
||||
@ -102,12 +99,12 @@ public class NotCopyCopy
|
||||
throw new NullReferenceException(nameof(configuration.SelectedSource));
|
||||
}
|
||||
|
||||
private A_Property GetPropertyLogic(bool reverse, Model? model, string outputExtension, PredictorModel? predictorModel)
|
||||
private A_Property GetPropertyLogic(bool reverse, string outputExtension)
|
||||
{
|
||||
A_Property result;
|
||||
if (_Configuration?.PropertyConfiguration is null)
|
||||
throw new NullReferenceException(nameof(_Configuration.PropertyConfiguration));
|
||||
result = new(_AppSettings.MaxDegreeOfParallelism, _Configuration.PropertyConfiguration, outputExtension, reverse, model, predictorModel);
|
||||
result = new(_AppSettings.MaxDegreeOfParallelism, _Configuration.PropertyConfiguration, outputExtension, reverse);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user