diff --git a/Controllers/RTDDataAcquisitionController.cs b/Controllers/RTDDataAcquisitionController.cs
index dd73afe..357cffd 100644
--- a/Controllers/RTDDataAcquisitionController.cs
+++ b/Controllers/RTDDataAcquisitionController.cs
@@ -117,5 +117,26 @@ namespace API_SequentMicrosystems.Controllers
_RTDDAservice.SetCalibrationData(data);
}
+ //GET api/RTDDA/ValueTypes
+ ///
+ /// Get ValueTypes data
+ ///
+ /// Sorted List of ValueTypes data responded with data by Ids of SortedList and array
+ [HttpGet("ValueTypes")]
+ public SortedList GetValueTypes()
+ {
+ return _RTDDAservice.LoadValueTypes();
+ }
+
+ //POST api/RTDDA/ValueTypes
+ ///
+ /// Post ValueTypes data
+ ///
+ /// Sorted List of Value types data responded with data by Ids of SortedList and array
+ [HttpPost("ValueTypes")]
+ public void PostValueTypes([FromBody] SortedList data)
+ {
+ _RTDDAservice.SaveValueTypes(data);
+ }
}
}
diff --git a/Services/RTDDataAcquisitionService.cs b/Services/RTDDataAcquisitionService.cs
index e7e2ba5..df4acf9 100644
--- a/Services/RTDDataAcquisitionService.cs
+++ b/Services/RTDDataAcquisitionService.cs
@@ -274,5 +274,37 @@ namespace API_SequentMicrosystems.Services
#endregion
+ #region ValueTypes
+
+ ///
+ /// Save ValueTypes data to File
+ ///
+ public void SaveValueTypes(SortedList data)
+ {
+ File.WriteAllText("RTDDA/ValueTypes.json", JsonConvert.SerializeObject(data));
+ }
+
+ ///
+ /// Load ValueTypes data from File
+ ///
+ ///
+ public SortedList LoadValueTypes()
+ {
+ try
+ {
+#pragma warning disable CS8603 // Může jít o vrácený odkaz null.
+ return JsonConvert.DeserializeObject>(File.ReadAllText("RTDDA/ValueTypes.json"));
+#pragma warning restore CS8603 // Může jít o vrácený odkaz null.
+ }
+ catch
+ {
+ return new();
+ }
+ }
+
+
+ #endregion
+
+
}
}