Delete unused Jsonoption

This commit is contained in:
atef 2023-12-18 08:23:23 +01:00
parent 044cf24660
commit c36ebeeb6a
1 changed files with 5 additions and 7 deletions

View File

@ -10,8 +10,6 @@ namespace InnovEnergy.App.SaliMax.AggregationService;
public class AggregatedData
{
private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true };
public required Double AvgSoc { get; set; }
public required Double AvgPvPower { get; set; }
public required Double BatteryPowerAverage { get; set; }
@ -19,19 +17,19 @@ public class AggregatedData
public void Save(String directory)
{
var date = DateTime.Now.ToUnixTime();
var defaultHDataPath = Environment.CurrentDirectory + "/"+directory+"/";
var dataFilePath = defaultHDataPath+date+".csv";
var defaultHDataPath = Environment.CurrentDirectory + "/" + directory + "/";
var dataFilePath = defaultHDataPath + date + ".csv";
if (!Directory.Exists(defaultHDataPath))
{
Directory.CreateDirectory(defaultHDataPath);
Console.WriteLine("Directory created successfully.");
}
Console.WriteLine("data file path is "+dataFilePath);
Console.WriteLine("data file path is " + dataFilePath);
try
{
var csvString = Units.ToCsv(this);
var csvString = this.ToCsv();
File.WriteAllText(dataFilePath, csvString);
}
catch (Exception e)