2024-01-28 00:02:54 +11:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-01-29 01:26:07 +11:00
|
|
|
#include <memory>
|
2024-02-13 22:33:55 +11:00
|
|
|
#include <json/json.h>
|
2024-01-29 01:26:07 +11:00
|
|
|
|
2024-01-28 00:02:54 +11:00
|
|
|
#include "reactor/coolant/vessel.hpp"
|
|
|
|
#include "reactor/reactor.hpp"
|
|
|
|
#include "coolant/pump.hpp"
|
|
|
|
#include "coolant/valve.hpp"
|
2024-02-02 22:03:47 +11:00
|
|
|
#include "coolant/condenser.hpp"
|
2024-02-07 16:04:22 +11:00
|
|
|
#include "coolant/condenser_secondary.hpp"
|
|
|
|
#include "coolant/evaporator.hpp"
|
|
|
|
#include "coolant/sink.hpp"
|
2024-02-03 18:12:18 +11:00
|
|
|
#include "electric/turbine.hpp"
|
2024-01-28 00:02:54 +11:00
|
|
|
|
2024-02-16 18:09:00 +11:00
|
|
|
namespace Sim
|
2024-01-28 00:02:54 +11:00
|
|
|
{
|
|
|
|
|
2024-02-16 16:51:25 +11:00
|
|
|
struct System
|
2024-01-28 00:02:54 +11:00
|
|
|
{
|
2024-02-16 16:51:25 +11:00
|
|
|
static System active;
|
2024-01-31 00:23:44 +11:00
|
|
|
|
2024-02-16 18:09:00 +11:00
|
|
|
std::unique_ptr<Sim::Reactor::Reactor> reactor;
|
2024-02-16 18:36:27 +11:00
|
|
|
std::unique_ptr<Sim::Reactor::Coolant::Vessel> vessel;
|
2024-02-07 16:04:22 +11:00
|
|
|
|
2024-02-16 18:09:00 +11:00
|
|
|
std::unique_ptr<Sim::Coolant::Sink> sink;
|
|
|
|
std::unique_ptr<Sim::Coolant::Condenser> condenser;
|
|
|
|
std::unique_ptr<Sim::Coolant::CondenserSecondary> condenser_secondary;
|
|
|
|
std::unique_ptr<Sim::Coolant::Evaporator> evaporator;
|
|
|
|
std::unique_ptr<Sim::Electric::Turbine> turbine;
|
2024-02-07 16:04:22 +11:00
|
|
|
|
2024-02-16 18:09:00 +11:00
|
|
|
std::unique_ptr<Sim::Coolant::Pump> primary_pump;
|
|
|
|
std::unique_ptr<Sim::Coolant::Pump> secondary_pump;
|
|
|
|
std::unique_ptr<Sim::Coolant::Pump> freight_pump;
|
2024-02-07 16:04:22 +11:00
|
|
|
|
2024-02-16 18:09:00 +11:00
|
|
|
std::unique_ptr<Sim::Coolant::Valve> turbine_bypass_valve;
|
|
|
|
std::unique_ptr<Sim::Coolant::Valve> turbine_inlet_valve;
|
2024-02-07 16:04:22 +11:00
|
|
|
|
2024-02-02 13:05:28 +11:00
|
|
|
double speed = 1;
|
2024-02-14 18:00:39 +11:00
|
|
|
double clock = 3600 * 12;
|
2024-01-29 01:26:07 +11:00
|
|
|
|
2024-02-16 16:51:25 +11:00
|
|
|
System();
|
|
|
|
System(const Json::Value& node);
|
2024-01-28 00:02:54 +11:00
|
|
|
|
|
|
|
void update(double dt);
|
2024-02-14 00:38:28 +11:00
|
|
|
|
2024-02-18 16:46:09 +11:00
|
|
|
static void save(const char* path);
|
|
|
|
static void load(const char* path);
|
2024-02-14 00:38:28 +11:00
|
|
|
static void save();
|
|
|
|
static void load();
|
2024-02-13 22:33:55 +11:00
|
|
|
|
|
|
|
operator Json::Value() const;
|
2024-01-28 00:02:54 +11:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|