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
{
[Tags("Internal Saving Points (Recommended only use \"Actual\" endpoint for read all data at once. Saving points is not recomended)")]
[Route("Points")]
[ApiController]
public class PointsController : ControllerBase
@ -60,6 +61,17 @@ namespace API_SequentMicrosystems.Controllers
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
/// <summary>
/// Read points from first to specified number

View File

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

View File

@ -107,15 +107,24 @@ namespace API_SequentMicrosystems.Services
}
/// <summary>
/// Save data/status point
/// Create actual point object
/// </summary>
public void SavePoint()
/// <returns></returns>
public PointsModel GetPoint()
{
PointsModel pm = new PointsModel(); //initialize point object
pm.Time = DateTime.Now; //set time of point created
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;
}

View File

@ -89,7 +89,7 @@ namespace API_SequentMicrosystems.Services
{
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++)
{