Moved Model Name and Predictor Model Name to
Property Configuration
This commit is contained in:
@ -6,7 +6,7 @@ namespace View_by_Distance.Compare.Models.Binder;
|
||||
public class Configuration
|
||||
{
|
||||
[Display(Name = "Diff Property Directory"), Required] public string DiffPropertyDirectory { 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 = "Rename"), Required] public string[] Rename { get; set; }
|
||||
[Display(Name = "Rename B"), Required] public string[] RenameB { get; set; }
|
||||
[Display(Name = "Rename C"), Required] public string[] RenameC { get; set; }
|
||||
|
@ -7,20 +7,20 @@ public class Configuration
|
||||
{
|
||||
|
||||
protected readonly string _DiffPropertyDirectory;
|
||||
protected Property.Models.Configuration? _PropertyConfiguration;
|
||||
protected Property.Models.Configuration _PropertyConfiguration;
|
||||
protected readonly string[] _Rename;
|
||||
protected readonly string[] _RenameB;
|
||||
protected readonly string[] _RenameC;
|
||||
protected readonly string[] _Spelling;
|
||||
public string DiffPropertyDirectory => _DiffPropertyDirectory;
|
||||
public Property.Models.Configuration? PropertyConfiguration => _PropertyConfiguration;
|
||||
public Property.Models.Configuration PropertyConfiguration => _PropertyConfiguration;
|
||||
public string[] Rename => _Rename;
|
||||
public string[] RenameB => _RenameB;
|
||||
public string[] RenameC => _RenameC;
|
||||
public string[] Spelling => _Spelling;
|
||||
|
||||
[JsonConstructor]
|
||||
public Configuration(string diffPropertyDirectory, Property.Models.Configuration? propertyConfiguration, string[] rename, string[] renameB, string[] renameC, string[] spelling)
|
||||
public Configuration(string diffPropertyDirectory, Property.Models.Configuration propertyConfiguration, string[] rename, string[] renameB, string[] renameC, string[] spelling)
|
||||
{
|
||||
_DiffPropertyDirectory = diffPropertyDirectory;
|
||||
_PropertyConfiguration = propertyConfiguration;
|
||||
@ -36,8 +36,10 @@ public class Configuration
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Set(Property.Models.Configuration configuration) => _PropertyConfiguration = configuration;
|
||||
|
||||
public void Update() => _PropertyConfiguration?.Update();
|
||||
public void SetAndUpdate(Property.Models.Configuration configuration, int? numberOfJitters, int? numberOfTimesToUpsample, string? modelName, string? predictorModelName)
|
||||
{
|
||||
_PropertyConfiguration = configuration;
|
||||
_PropertyConfiguration.Update(numberOfJitters, numberOfTimesToUpsample, modelName, predictorModelName);
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
|
Reference in New Issue
Block a user