Delete unused Jsonoption
This commit is contained in:
parent
044cf24660
commit
c36ebeeb6a
|
@ -10,28 +10,26 @@ namespace InnovEnergy.App.SaliMax.AggregationService;
|
||||||
|
|
||||||
public class AggregatedData
|
public class AggregatedData
|
||||||
{
|
{
|
||||||
private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true };
|
|
||||||
|
|
||||||
public required Double AvgSoc { get; set; }
|
public required Double AvgSoc { get; set; }
|
||||||
public required Double AvgPvPower { get; set; }
|
public required Double AvgPvPower { get; set; }
|
||||||
public required Double BatteryPowerAverage { get; set; }
|
public required Double BatteryPowerAverage { get; set; }
|
||||||
|
|
||||||
public void Save(String directory)
|
public void Save(String directory)
|
||||||
{
|
{
|
||||||
var date = DateTime.Now.ToUnixTime();
|
var date = DateTime.Now.ToUnixTime();
|
||||||
var defaultHDataPath = Environment.CurrentDirectory + "/"+directory+"/";
|
var defaultHDataPath = Environment.CurrentDirectory + "/" + directory + "/";
|
||||||
var dataFilePath = defaultHDataPath+date+".csv";
|
var dataFilePath = defaultHDataPath + date + ".csv";
|
||||||
|
|
||||||
if (!Directory.Exists(defaultHDataPath))
|
if (!Directory.Exists(defaultHDataPath))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(defaultHDataPath);
|
Directory.CreateDirectory(defaultHDataPath);
|
||||||
Console.WriteLine("Directory created successfully.");
|
Console.WriteLine("Directory created successfully.");
|
||||||
}
|
}
|
||||||
Console.WriteLine("data file path is "+dataFilePath);
|
Console.WriteLine("data file path is " + dataFilePath);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var csvString = Units.ToCsv(this);
|
var csvString = this.ToCsv();
|
||||||
File.WriteAllText(dataFilePath, csvString);
|
File.WriteAllText(dataFilePath, csvString);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
Loading…
Reference in New Issue