Update Informational and add Points/Actual endpoin

master
Jan Beníček 2023-11-30 16:29:25 +01:00
parent 90f682195e
commit 4944df9c8a
4 changed files with 26 additions and 4 deletions

View File

@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Mvc;
namespace API_SequentMicrosystems.Controllers namespace API_SequentMicrosystems.Controllers
{ {
[Tags("Internal Saving Points (Recommended only use \"Actual\" endpoint for read all data at once. Saving points is not recomended)")]
[Route("Points")] [Route("Points")]
[ApiController] [ApiController]
public class PointsController : ControllerBase public class PointsController : ControllerBase
@ -60,6 +61,17 @@ namespace API_SequentMicrosystems.Controllers
return _PointsService.GetPoints(limit, pm); return _PointsService.GetPoints(limit, pm);
} }
//GET api/Points/Actual
/// <summary>
/// Get Actual Point
/// </summary>
/// <returns></returns>
[HttpGet("Actual")]
public PointsModel GetActual()
{
return _PointsService.GetPoint();
}
// GET api/<PointsController>/5 // GET api/<PointsController>/5
/// <summary> /// <summary>
/// Read points from first to specified number /// Read points from first to specified number

View File

@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc;
namespace API_SequentMicrosystems.Controllers namespace API_SequentMicrosystems.Controllers
{ {
[Tags("RTD-8 Temperature Module")]
[Route("RTDDA")] [Route("RTDDA")]
[ApiController] [ApiController]
public class RTDDataAcquisitionController : ControllerBase public class RTDDataAcquisitionController : ControllerBase

View File

@ -107,15 +107,24 @@ namespace API_SequentMicrosystems.Services
} }
/// <summary> /// <summary>
/// Save data/status point /// Create actual point object
/// </summary> /// </summary>
public void SavePoint() /// <returns></returns>
public PointsModel GetPoint()
{ {
PointsModel pm = new PointsModel(); //initialize point object PointsModel pm = new PointsModel(); //initialize point object
pm.Time = DateTime.Now; //set time of point created pm.Time = DateTime.Now; //set time of point created
pm.RTDDA = _RTDDAService.ReadAllCard(); //save RTD data to point pm.RTDDA = _RTDDAService.ReadAllCard(); //save RTD data to point
_points.Add(pm); //add point to list return pm;
}
/// <summary>
/// Save data/status point
/// </summary>
public void SavePoint()
{
_points.Add(GetPoint()); //add point to list
_SavePoints = true; _SavePoints = true;
} }

View File

@ -89,7 +89,7 @@ namespace API_SequentMicrosystems.Services
{ {
try try
{ {
float[] data = _stackLevelReader.GetStack(stack); //return data from specified card float[] data = _stackLevelReader.GetStack(stack); //return data from specified card and ted measure precision
for (byte i = 0;i < 8; i++) for (byte i = 0;i < 8; i++)
{ {