2024-01-18 18:00:39 +11:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-02-02 22:03:47 +11:00
|
|
|
#include "fluid_holder.hpp"
|
|
|
|
|
2024-01-18 18:00:39 +11:00
|
|
|
namespace sim::coolant
|
|
|
|
{
|
|
|
|
|
|
|
|
class valve
|
|
|
|
{
|
|
|
|
const double max;
|
2024-02-02 22:03:47 +11:00
|
|
|
|
|
|
|
fluid_holder* const src;
|
|
|
|
fluid_holder* const dst;
|
2024-01-18 18:00:39 +11:00
|
|
|
|
|
|
|
double state = 0;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2024-02-02 22:03:47 +11:00
|
|
|
valve(fluid_holder& src, fluid_holder& dst, double max);
|
|
|
|
|
|
|
|
void open(double v);
|
|
|
|
void update(double secs);
|
|
|
|
void set_state(double v);
|
|
|
|
|
|
|
|
constexpr double get_state() const { return state; }
|
2024-01-18 18:00:39 +11:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|