added measurements
This commit is contained in:
parent
052a65c31c
commit
2e67813f48
|
@ -2,22 +2,27 @@
|
|||
#include "display.hpp"
|
||||
|
||||
#include <curses.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void display::draw_text(int x, int y, const char* str)
|
||||
void display::draw_text(int x, int y, const char* at)
|
||||
{
|
||||
for(int i = 0;; i++)
|
||||
{
|
||||
const char* start = str;
|
||||
char c = (str++)[0];
|
||||
const char* start = at;
|
||||
char c = (at++)[0];
|
||||
|
||||
while(c != '\n' && c != '\0')
|
||||
{
|
||||
c = (str++)[0];
|
||||
c = (at++)[0];
|
||||
}
|
||||
|
||||
mvaddnstr(x + i, y, start, (size_t)(str - start));
|
||||
mvaddnstr(x + i, y, start, (size_t)(at - start));
|
||||
|
||||
if(c == '\0') return;
|
||||
if(c == '\0')
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ control_rod::control_rod(double limit, double max)
|
|||
void control_rod::display(std::ostream& o) const
|
||||
{
|
||||
o << "Inserted: " << (inserted * 100) << "%\n";
|
||||
o << "Absorbed: " << absorbed << " / " << limit << "\n";
|
||||
o << "Use: " << absorbed << " / " << limit << " mol\n";
|
||||
};
|
||||
|
||||
double control_rod::get_k(val_t type) const
|
||||
|
|
|
@ -22,6 +22,6 @@ double heater::get_k(sim::reactor::rod::val_t type) const
|
|||
|
||||
void heater::display(std::ostream& o) const
|
||||
{
|
||||
o << "Rate: " << rate << "\n";
|
||||
o << "Rate: " << rate << " C/s\n";
|
||||
}
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@ fuel_rod::fuel_rod(double fuel, double mass) : s(fuel, mass)
|
|||
|
||||
void fuel_rod::display(std::ostream& o) const
|
||||
{
|
||||
o << "Fuel: " << s.get_fuel() << " / " << s.get_mass() << "\n";
|
||||
o << "Fuel: " << s.get_fuel() << " / " << s.get_mass() << " mol\n";
|
||||
o << "Efficiency: " << s.get_efficiency() << "\n";
|
||||
o << "Energy: +" << s.get_energy() << "\n";
|
||||
o << "Energy: +" << s.get_energy() << " C\n";
|
||||
}
|
||||
|
||||
double fuel_rod::get_k(val_t type) const
|
||||
|
|
|
@ -38,9 +38,9 @@ public:
|
|||
|
||||
o << r.get_name() << "\n";
|
||||
r.display(o);
|
||||
o << "Heat: " << r.get(val_t::HEAT) << "\n";
|
||||
o << "Fast: " << r.get(val_t::N_FAST) << "\n";
|
||||
o << "Slow: " << r.get(val_t::N_SLOW) << "\n";
|
||||
o << "Heat: " << r.get(val_t::HEAT) << " C\n";
|
||||
o << "Fast: " << r.get(val_t::N_FAST) << " mol\n";
|
||||
o << "Slow: " << r.get(val_t::N_SLOW) << " mol\n";
|
||||
|
||||
return o;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue