Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit b81c8b08 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

serialize enums in model data

parent c56fb59d
Branches
Tags
No related merge requests found
...@@ -205,10 +205,12 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory ...@@ -205,10 +205,12 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory
// TODO: MQ 20200410 - Remove for official release! // TODO: MQ 20200410 - Remove for official release!
if (SerializeVectoRunData) { if (SerializeVectoRunData) {
var jsonSerializerSettings = new JsonSerializerSettings();
jsonSerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
File.WriteAllText( File.WriteAllText(
Path.Combine( Path.Combine(
(ReportWriter as FileOutputWriter)?.BasePath ?? "", $"{data.JobName}_{data.Cycle.Name}{data.ModFileSuffix}.json"), (ReportWriter as FileOutputWriter)?.BasePath ?? "", $"{data.JobName}_{data.Cycle.Name}{data.ModFileSuffix}.json"),
JsonConvert.SerializeObject(data, Formatting.Indented)); JsonConvert.SerializeObject(data, Formatting.Indented, jsonSerializerSettings));
} }
data.JobNumber = JobNumber; data.JobNumber = JobNumber;
data.RunNumber = current; data.RunNumber = current;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment