using API_SequentMicrosystems.Services; using Microsoft.AspNetCore.Mvc; // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 namespace API_SequentMicrosystems.Controllers { [Tags("RTD-8 Temperature Module")] [Route("api/RTDDA")] [ApiController] public class RTDDataAcquisitionController : ControllerBase { private RTDDAService _RTDDAservice; public RTDDataAcquisitionController(RTDDAService serv) { _RTDDAservice = serv; } // GET: api/ /// /// Read data from all configured RTD cards /// /// SortedList with data from configured RTD-8 Cards [HttpGet] public SortedList Get() { return _RTDDAservice.ReadAllConfiguredCard(); } // GET api//All /// /// Read data from All RTD cards /// /// SortedList with data from all conected RTD-8 cards [HttpGet("All")] public SortedList GetAll() { return _RTDDAservice.ReadAllCard(); } // GET api//5 /// /// Read data from specified by card id /// /// 0-7 /// Array with data from specified card [HttpGet("{stack}")] public float[] GetAll(byte stack) { return _RTDDAservice.ReadCard(stack); } //GET api/RTDDA/Names /// /// Get Configured Names of Chanels /// /// Sorted List of configured Names responded with data by Ids of SortedList and array [HttpGet("Names")] public SortedList GetNames() { return _RTDDAservice.GetChanelsNames(); } // POST api/ /// /// Post configured names of chanels /// /// Sorted List of configured Names responded with data by Ids of SortedList and array [HttpPost("Names")] public void PostNames([FromBody] SortedList data) { _RTDDAservice.SetChanelsNames(data); } //GET api/RTDDA/Names/Preconfigured /// /// Get preconfigured Names /// /// List of preconfigured names [HttpGet("Names/Preconfigured")] public List GetNamesPreconfigured() { return _RTDDAservice.GetPreconfiguratedChanelsNames(); } //POST api/RTDDA/Names/Preconfigured /// /// Post preconfigured names /// /// List of preconfigured names [HttpPost("Names/Preconfigured")] public void PostNamesPreconfigured([FromBody] List data) { _RTDDAservice.SetPreconfiguratedChanelsNames(data); } //GET api/RTDDA/Calibration /// /// Get Calibration data /// /// Sorted List of calibration data responded with data by Ids of SortedList and array [HttpGet("Calibration")] public SortedList GetCalibration() { return _RTDDAservice.GetCalibrationData(); } //POST api/RTDDA/Calibration /// /// Post Calibration data /// /// Sorted List of calibration data responded with data by Ids of SortedList and array [HttpPost("Calibration")] public void PostCalibration([FromBody] SortedList data) { _RTDDAservice.SetCalibrationData(data); } } }