diff --git a/MapoDataFiller/Conf/INTERCL_01.json b/MapoDataFiller/Conf/INTERCL_01.json new file mode 100644 index 0000000..c143703 --- /dev/null +++ b/MapoDataFiller/Conf/INTERCL_01.json @@ -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 + } + } +} \ No newline at end of file diff --git a/MapoDataFiller/Conf/INTERCL_01.yaml b/MapoDataFiller/Conf/INTERCL_01.yaml deleted file mode 100644 index 1f0024d..0000000 --- a/MapoDataFiller/Conf/INTERCL_01.yaml +++ /dev/null @@ -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 - } -} \ No newline at end of file diff --git a/MapoDataFiller/Conf/INTERCL_02.json b/MapoDataFiller/Conf/INTERCL_02.json new file mode 100644 index 0000000..c143703 --- /dev/null +++ b/MapoDataFiller/Conf/INTERCL_02.json @@ -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 + } + } +} \ No newline at end of file diff --git a/MapoDataFiller/Conf/INTERCL_02.yaml b/MapoDataFiller/Conf/INTERCL_02.yaml deleted file mode 100644 index eecf920..0000000 --- a/MapoDataFiller/Conf/INTERCL_02.yaml +++ /dev/null @@ -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 diff --git a/MapoDataFiller/Filler/InterClays.cs b/MapoDataFiller/Filler/InterClays.cs index e5048a8..e432578 100644 --- a/MapoDataFiller/Filler/InterClays.cs +++ b/MapoDataFiller/Filler/InterClays.cs @@ -18,7 +18,7 @@ /// 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); diff --git a/MapoDataFiller/FluxStats.cs b/MapoDataFiller/FluxStats.cs index 866c18e..c90a84f 100644 --- a/MapoDataFiller/FluxStats.cs +++ b/MapoDataFiller/FluxStats.cs @@ -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(input); + var rawDecode = JsonConvert.DeserializeObject(rawData); + retObj = rawDecode != null ? rawDecode : new SimSetup(); } return retObj; } diff --git a/MapoDataFiller/MapoDataFiller.csproj b/MapoDataFiller/MapoDataFiller.csproj index ad1f3dd..5e57c73 100644 --- a/MapoDataFiller/MapoDataFiller.csproj +++ b/MapoDataFiller/MapoDataFiller.csproj @@ -8,6 +8,7 @@ + @@ -16,10 +17,10 @@ Always - + Always - + Always