STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_pressure_feed.cpp File Reference
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h>
#include <atomic>
#include <chrono>
#include <cstring>
#include <iostream>
#include <string>
#include <thread>
#include <vector>
#include "comms/messages/sensor/CalibratedPTMessage.hpp"
#include "config/Config.hpp"
#include "control/PressureFeed.hpp"
Include dependency graph for test_pressure_feed.cpp:

Go to the source code of this file.

Classes

struct  FakeDb
 Fake elodin-db: accept one connection, write blob, then hold the socket open. More...
struct  FakeDbRefuseFirst
 Fake elodin-db that REFUSES the first subscription, the way the real one does when the calibrated VTable does not exist yet. More...
class  PressureFeed
 Live calibrated pressures, by ROLE NAME, for the sequencer. More...

Functions

static void check (bool ok, const std::string &what)
static std::vector< uint8_t > ptFrame (uint8_t lo, uint8_t channel, float psi, uint8_t cal_status, uint8_t hi=0x20)
 One calibrated-PT frame for table [hi, lo] (0x20 an ESP32 PT, 0x26 a LabJack T7 input).
int main ()

Variables

static int g_failures = 0
static const char * kConfig
 Two PT boards laid out as the server profile lays them out.

Function Documentation

◆ check()

void check ( bool ok,
const std::string & what )
static

Definition at line 42 of file test_pressure_feed.cpp.

References g_failures, and ok.

Referenced by main().

◆ main()

◆ ptFrame()

std::vector< uint8_t > ptFrame ( uint8_t lo,
uint8_t channel,
float psi,
uint8_t cal_status,
uint8_t hi = 0x20 )
static

One calibrated-PT frame for table [hi, lo] (0x20 an ESP32 PT, 0x26 a LabJack T7 input).

Definition at line 49 of file test_pressure_feed.cpp.

References comms::CommsMessage< uint64_t, uint8_t, std::array< uint8_t, 3 >, float, uint32_t, uint8_t >::nbytes().

Referenced by main().

Variable Documentation

◆ g_failures

int g_failures = 0
static

Definition at line 40 of file test_pressure_feed.cpp.

◆ kConfig

const char* kConfig
static
Initial value:
= R"TOML(
[boards.pt_board]
type = "PT"
ip = "127.0.0.1"
board_id = 21
enabled = true
[boards.pt_board_2]
type = "PT"
ip = "127.0.0.1"
board_id = 22
enabled = true
[sensor_roles_pt_board]
"GN2 Regulated" = 6
[sensor_roles_pt_board_2]
"GN2 High" = 4
)TOML"

Two PT boards laid out as the server profile lays them out.

Definition at line 188 of file test_pressure_feed.cpp.