OK x obj decodifica

This commit is contained in:
Samuele Locatelli
2023-05-05 19:44:47 +02:00
parent 81e45e9b8c
commit c77e776ca7
7 changed files with 213 additions and 210 deletions
+103
View File
@@ -0,0 +1,103 @@
{
"SetupSimFloat": {
"Temp_Filtro": {
0: 0.1,
1: 5.6,
25: 89.1,
50: 103.7,
75: 108.3,
99: 118.1,
100: 135.6
},
"T_Attuale_Cil": {
0: 0.01,
1: 0.65,
25: 10.36,
50: 11.46,
75: 11.98,
99: 13.99,
100: 327.67
},
"Flowrate": {
0: 0.01,
1: 0.06,
25: 5.34,
50: 8.22,
75: 9.48,
99: 12.86,
100: 262.8
},
"Ampere_Cil": {
0: 10.6,
1: 14.1,
25: 14.4,
50: 14.6,
75: 15,
99: 16.4,
100: 79.1
},
"Ampere_Asp": {
0: 12.1,
1: 14.8,
25: 15.9,
50: 17.2,
75: 22.1,
99: 32.4,
100: 87.3
},
"Ampere_Dosat": {
0: 0.1,
1: 1.8,
25: 2,
50: 2,
75: 2.1,
99: 2.4,
100: 3.3
}
},
"SetupSimInt": {
"Dep_Cil_mmH2O": {
0: 1,
1: 1,
25: 5,
50: 10,
75: 15,
99: 26,
100: 52
},
"Bruc_0_100": {
0: 1,
1: 17,
25: 24,
50: 33,
75: 47,
99: 71,
100: 100
},
"Asp_0_100": {
0: 3,
1: 36,
25: 52,
50: 59,
75: 77,
99: 100,
100: 100
}
},
"SetupDtData": {
"Tot_Parz_Dosatore": {
"2020-06-30 19:56:21": 1225.481,
"2020-11-16 13:01:33": 5419.626,
"2022-03-14 11:33:21": 20782.475,
"2022-11-21 08:48:21": 27770.447,
"2023-03-07 15:40:44": 30951.118
},
"Tot_Dosatore": {
"2020-06-30 19:56:21": 9053.072,
"2020-11-16 13:01:33": 13247.217,
"2022-03-14 11:33:21": 28610.066,
"2022-11-21 08:48:21": 35598.038,
"2023-03-07 15:40:44": 38778.709
}
}
}
-113
View File
@@ -1,113 +0,0 @@
---
SetupSimInt: {
Temp_Filtro:
{
0: 0.1,
1: 5.6,
25: 89.1,
50: 103.7,
75: 108.3,
99: 118.1,
100: 135.6
},
T_Attuale_Cil:
{
0: 0.01,
1: 0.65,
25: 10.36,
50: 11.46,
75: 11.98,
99: 13.99,
100: 327.67
},
Flowrate:
{
0: 0.01,
1: 0.06,
25: 5.34,
50: 8.22,
75: 9.48,
99: 12.86,
100: 262.8
},
Ampere_Cil:
{
0: 10.6,
1: 14.1,
25: 14.4,
50: 14.6,
75: 15.0,
99: 16.4,
100: 79.1
},
Ampere_Asp:
{
0: 12.1,
1: 14.8,
25: 15.9,
50: 17.2,
75: 22.1,
99: 32.4,
100: 87.3
},
Ampere_Dosat:
{
0: 0.1,
1: 1.8,
25: 2,
50: 2,
75: 2.1,
99: 2.4,
100: 3.3
}
}
SetupSimFloat: {
Dep_Cil_mmH2O:
{
0: 1,
1: 1,
25: 5,
50: 10,
75: 15,
99: 26,
100: 52
},
Bruc_0_100:
{
0: 1,
1: 17,
25: 24,
50: 33,
75: 47,
99: 71,
100: 100
},
Asp_0_100:
{
0: 3,
1: 36,
25: 52,
50: 59,
75: 77,
99: 100,
100: 100
}
}
SetupDtData: {
Tot_Parz_Dosatore:
{
2020-06-30 19:56:21: 1225.481,
2020-11-16 13:01:33: 5419.626,
2022-03-14 11:33:21: 20782.475,
2022-11-21 08:48:21: 27770.447,
2023-03-07 15:40:44: 30951.118
},
Tot_Dosatore:
{
2020-06-30 19:56:21: 9053.072,
2020-11-16 13:01:33: 13247.217,
2022-03-14 11:33:21: 28610.066,
2022-11-21 08:48:21: 35598.038,
2023-03-07 15:40:44: 38778.709
}
}
+103
View File
@@ -0,0 +1,103 @@
{
"SetupSimFloat": {
"Temp_Filtro": {
0: 0.1,
1: 5.6,
25: 89.1,
50: 103.7,
75: 108.3,
99: 118.1,
100: 135.6
},
"T_Attuale_Cil": {
0: 0.01,
1: 0.65,
25: 10.36,
50: 11.46,
75: 11.98,
99: 13.99,
100: 327.67
},
"Flowrate": {
0: 0.01,
1: 0.06,
25: 5.34,
50: 8.22,
75: 9.48,
99: 12.86,
100: 262.8
},
"Ampere_Cil": {
0: 10.6,
1: 14.1,
25: 14.4,
50: 14.6,
75: 15,
99: 16.4,
100: 79.1
},
"Ampere_Asp": {
0: 12.1,
1: 14.8,
25: 15.9,
50: 17.2,
75: 22.1,
99: 32.4,
100: 87.3
},
"Ampere_Dosat": {
0: 0.1,
1: 1.8,
25: 2,
50: 2,
75: 2.1,
99: 2.4,
100: 3.3
}
},
"SetupSimInt": {
"Dep_Cil_mmH2O": {
0: 1,
1: 1,
25: 5,
50: 10,
75: 15,
99: 26,
100: 52
},
"Bruc_0_100": {
0: 1,
1: 17,
25: 24,
50: 33,
75: 47,
99: 71,
100: 100
},
"Asp_0_100": {
0: 3,
1: 36,
25: 52,
50: 59,
75: 77,
99: 100,
100: 100
}
},
"SetupDtData": {
"Tot_Parz_Dosatore": {
"2020-06-30 19:56:21": 1225.481,
"2020-11-16 13:01:33": 5419.626,
"2022-03-14 11:33:21": 20782.475,
"2022-11-21 08:48:21": 27770.447,
"2023-03-07 15:40:44": 30951.118
},
"Tot_Dosatore": {
"2020-06-30 19:56:21": 9053.072,
"2020-11-16 13:01:33": 13247.217,
"2022-03-14 11:33:21": 28610.066,
"2022-11-21 08:48:21": 35598.038,
"2023-03-07 15:40:44": 38778.709
}
}
}
-88
View File
@@ -1,88 +0,0 @@
---
SetupSimInt:
Temp_Filtro:
"0": 0.1
"1": 5.6
"25": 89.1
"50": 103.7
"75": 108.3
"99": 118.1
"100": 135.6
T_Attuale_Cil:
"0": 0.01
"1": 0.65
"25": 10.36
"50": 11.46
"75": 11.98
"99": 13.99
"100": 327.67
Flowrate:
"0": 0.01
"1": 0.06
"25": 5.34
"50": 8.22
"75": 9.48
"99": 12.86
"100": 262.8
Ampere_Cil:
"0": 10.6
"1": 14.1
"25": 14.4
"50": 14.6
"75": 15
"99": 16.4
"100": 79.1
Ampere_Asp:
"0": 12.1
"1": 14.8
"25": 15.9
"50": 17.2
"75": 22.1
"99": 32.4
"100": 87.3
Ampere_Dosat:
"0": 0.1
"1": 1.8
"25": 2
"50": 2
"75": 2.1
"99": 2.4
"100": 3.3
SetupSimFloat:
Dep_Cil_mmH2O:
"0": 1
"1": 1
"25": 5
"50": 10
"75": 15
"99": 26
"100": 52
Bruc_0_100:
"0": 1
"1": 17
"25": 24
"50": 33
"75": 47
"99": 71
"100": 100
Asp_0_100:
"0": 3
"1": 36
"25": 52
"50": 59
"75": 77
"99": 100
"100": 100
SetupDtData:
Tot_Parz_Dosatore:
2020-06-30 19:56:21: 1225.481
2020-11-16 13:01:33: 5419.626
2022-03-14 11:33:21: 20782.475
2022-11-21 08:48:21: 27770.447
2023-03-07 15:40:44: 30951.118
Tot_Dosatore:
2020-06-30 19:56:21: 9053.072
2020-11-16 13:01:33: 13247.217
2022-03-14 11:33:21: 28610.066
2022-11-21 08:48:21: 35598.038
2023-03-07 15:40:44: 38778.709
+1 -1
View File
@@ -18,7 +18,7 @@
/// <returns></returns>
public SimBlock GetDataRows(string CodIOB, DayConf currDay)
{
string fileConf = Path.Combine("Conf", $"{CodIOB}.yaml");
string fileConf = Path.Combine("Conf", $"{CodIOB}.json");
if (File.Exists(fileConf))
{
currSetup = SimSetup.readConf(fileConf);
+3 -6
View File
@@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using YamlDotNet.Serialization.NamingConventions;
using YamlDotNet.Serialization;
using Newtonsoft.Json;
namespace MapoDataFiller
{
@@ -19,13 +20,9 @@ namespace MapoDataFiller
SimSetup retObj = new SimSetup();
if (File.Exists(filePath))
{
var deserializer = new DeserializerBuilder()
.WithNamingConvention(new PascalCaseNamingConvention())
.Build();
string rawData = File.ReadAllText(filePath);
var input = new StringReader(rawData);
retObj = deserializer.Deserialize<SimSetup>(input);
var rawDecode = JsonConvert.DeserializeObject<SimSetup>(rawData);
retObj = rawDecode != null ? rawDecode : new SimSetup();
}
return retObj;
}
+3 -2
View File
@@ -8,6 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Spectre.Console" Version="0.45.0" />
<PackageReference Include="YamlDotNet" Version="12.3.1" />
</ItemGroup>
@@ -16,10 +17,10 @@
<None Update="conf.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Conf\INTERCL_02.yaml">
<None Update="Conf\INTERCL_02.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Conf\INTERCL_01.yaml">
<None Update="Conf\INTERCL_01.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>