Ready to test
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
using FaceRecognitionDotNet;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using View_by_Distance.Property.Models;
|
||||
@ -103,7 +104,7 @@ public class G_Index : Shared.Models.Properties.IIndex, IIndex
|
||||
}
|
||||
}
|
||||
|
||||
private void WriteGroup(Property.Models.Configuration configuration, string outputResolution, List<Tuple<string, Dictionary<int, G_Index>>> indexInfoTuples)
|
||||
private void WriteGroup(Property.Models.Configuration configuration, Model model, PredictorModel predictorModel, string outputResolution, List<Tuple<string, Dictionary<int, G_Index>>> indexInfoTuples)
|
||||
{
|
||||
string json;
|
||||
G_Index[] indices;
|
||||
@ -111,14 +112,14 @@ public class G_Index : Shared.Models.Properties.IIndex, IIndex
|
||||
foreach (Tuple<string, Dictionary<int, G_Index>> tuple in indexInfoTuples)
|
||||
{
|
||||
indices = (from l in tuple.Item2 select l.Value).ToArray();
|
||||
directoryInfoCollection = Property.Models.Stateless.IResult.GetDirectoryInfoCollection(configuration, tuple.Item1, nameof(G_Index), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false, contentDescription: string.Empty, singletonDescription: string.Empty, collectionDescription: "Unknown A");
|
||||
directoryInfoCollection = Property.Models.Stateless.IResult.GetDirectoryInfoCollection(configuration, model.ToString(), predictorModel.ToString(), tuple.Item1, nameof(G_Index), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false, contentDescription: string.Empty, singletonDescription: string.Empty, collectionDescription: "Unknown A");
|
||||
json = JsonSerializer.Serialize(indices, _WriteIndentedJsonSerializerOptions);
|
||||
if (!Property.Models.Stateless.IPath.WriteAllText(string.Concat(directoryInfoCollection[0].Replace("<>", "[]"), ".json"), json, compareBeforeWrite: true))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
private void AppendTSV(Property.Models.Configuration configuration, string outputResolution, Dictionary<string, List<Tuple<string, A_Property>>> filePropertiesKeyValuePairs)
|
||||
private void AppendTSV(Property.Models.Configuration configuration, Model model, PredictorModel predictorModel, string outputResolution, Dictionary<string, List<Tuple<string, A_Property>>> filePropertiesKeyValuePairs)
|
||||
{
|
||||
A_Property property;
|
||||
DateTime?[] dateTimes;
|
||||
@ -137,11 +138,11 @@ public class G_Index : Shared.Models.Properties.IIndex, IIndex
|
||||
maximumDateTime = (from l in dateTimes where l.HasValue select l.Value).Max();
|
||||
minimumDateTime = (from l in dateTimes where l.HasValue select l.Value).Min();
|
||||
}
|
||||
directoryInfoCollection = Property.Models.Stateless.IResult.GetDirectoryInfoCollection(configuration, tuples.Key, nameof(G_Index), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false, contentDescription: string.Empty, singletonDescription: "Unkown B", collectionDescription: string.Empty);
|
||||
directoryInfoCollection = Property.Models.Stateless.IResult.GetDirectoryInfoCollection(configuration, model.ToString(), predictorModel.ToString(), tuples.Key, nameof(G_Index), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false, contentDescription: string.Empty, singletonDescription: "Unkown B", collectionDescription: string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
internal void SetIndex(Property.Models.Configuration configuration, string outputResolution, Dictionary<string, List<Tuple<string, A_Property>>> filePropertiesKeyValuePairs)
|
||||
internal void SetIndex(Property.Models.Configuration configuration, Model model, PredictorModel predictorModel, string outputResolution, Dictionary<string, List<Tuple<string, A_Property>>> filePropertiesKeyValuePairs)
|
||||
{
|
||||
if (_Configuration.PropertiesChangedForIndex is null)
|
||||
throw new Exception();
|
||||
@ -168,7 +169,7 @@ public class G_Index : Shared.Models.Properties.IIndex, IIndex
|
||||
foreach (KeyValuePair<string, List<Tuple<string, A_Property>>> tuples in filePropertiesKeyValuePairs)
|
||||
{
|
||||
valuePairs = new Dictionary<int, G_Index>();
|
||||
directoryInfoCollection = Property.Models.Stateless.IResult.GetDirectoryInfoCollection(configuration, tuples.Key, nameof(G_Index), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false, contentDescription: string.Empty, singletonDescription: "Unknown C", collectionDescription: string.Empty);
|
||||
directoryInfoCollection = Property.Models.Stateless.IResult.GetDirectoryInfoCollection(configuration, model.ToString(), predictorModel.ToString(), tuples.Key, nameof(G_Index), outputResolution, includeResizeGroup: false, includeModel: false, includePredictorModel: false, contentDescription: string.Empty, singletonDescription: "Unknown C", collectionDescription: string.Empty);
|
||||
foreach (Tuple<string, A_Property> tuple in tuples.Value)
|
||||
{
|
||||
fileInfo = new FileInfo(Path.Combine(directoryInfoCollection[0].Replace("<>", "{}"), string.Concat(Path.GetFileNameWithoutExtension(tuple.Item1), ".json")));
|
||||
@ -204,8 +205,8 @@ public class G_Index : Shared.Models.Properties.IIndex, IIndex
|
||||
throw new Exception(string.Join(Environment.NewLine, parseExceptions));
|
||||
if (neededTuples.Any())
|
||||
throw new Exception();
|
||||
WriteGroup(configuration, outputResolution, indexInfoTuples);
|
||||
AppendTSV(configuration, outputResolution, filePropertiesKeyValuePairs);
|
||||
WriteGroup(configuration, model, predictorModel, outputResolution, indexInfoTuples);
|
||||
AppendTSV(configuration, model, predictorModel, outputResolution, filePropertiesKeyValuePairs);
|
||||
}
|
||||
|
||||
string Shared.Models.Stateless.Methods.IIndex.TestStatic_GetJson(string jsonFileFullName, FileInfo fileInfo) => throw new NotImplementedException();
|
||||
|
Reference in New Issue
Block a user