mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 00:49:19 +02:00
snapshot
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "Logs.h"
|
||||
|
||||
ui::cameraview_panel::cameraview_panel()
|
||||
: ui_panel(STR_C(cameraview_window), false)
|
||||
: ui_panel(STR_C("Camera preview"), false)
|
||||
{
|
||||
size_min = { -2, -2 };
|
||||
}
|
||||
@@ -103,6 +103,7 @@ void ui::cameraview_panel::workthread_func()
|
||||
|
||||
if (buffer) {
|
||||
int w, h;
|
||||
stbi_set_flip_vertically_on_load(0);
|
||||
uint8_t *image = stbi_load_from_memory(buffer, len, &w, &h, nullptr, 4);
|
||||
if (!image)
|
||||
ErrorLog(std::string(stbi_failure_reason()));
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "Driver.h"
|
||||
#include "AnimModel.h"
|
||||
|
||||
ui::map_panel::map_panel() : ui_panel(STR_C(ui_map), false)
|
||||
ui::map_panel::map_panel() : ui_panel(STR_C("Map"), false)
|
||||
{
|
||||
size_min = {200, 200};
|
||||
size_max = {fb_size, fb_size};
|
||||
@@ -445,13 +445,13 @@ void ui::launcher_window::render_content()
|
||||
{
|
||||
ImGui::TextUnformatted(m_switch->name.c_str());
|
||||
|
||||
const std::string &open_label = STR(
|
||||
const std::string &open_label =
|
||||
m_switch->type == map::launcher::track_switch
|
||||
? locale::string::map_straight : locale::string::map_open);
|
||||
? STR("Straight |") : STR("Open |");
|
||||
|
||||
const std::string &close_label = STR(
|
||||
const std::string &close_label =
|
||||
m_switch->type == map::launcher::track_switch
|
||||
? locale::string::map_divert : locale::string::map_close);
|
||||
? STR("Divert /") : STR("Close -");
|
||||
|
||||
if (ImGui::Button(open_label.c_str()))
|
||||
{
|
||||
@@ -495,7 +495,7 @@ void ui::obstacle_insert_window::render_content()
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui::TextUnformatted(STR_C(map_obstacle_insert));
|
||||
ImGui::TextUnformatted(STR_C("Insert obstacle:"));
|
||||
for (auto const &entry : m_obstacles)
|
||||
{
|
||||
if (ImGui::Button(entry.first.c_str()))
|
||||
@@ -526,7 +526,7 @@ ui::obstacle_remove_window::obstacle_remove_window(ui_panel &panel, std::shared_
|
||||
|
||||
void ui::obstacle_remove_window::render_content()
|
||||
{
|
||||
if (ImGui::Button(STR_C(map_obstacle_remove))) {
|
||||
if (ImGui::Button(STR_C("Delete obstacle"))) {
|
||||
m_relay.post(user_command::deletemodel, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(), &m_obstacle->model_name);
|
||||
|
||||
auto &entries = map::Objects.entries;
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
#include "Timer.h"
|
||||
|
||||
perfgraph_panel::perfgraph_panel()
|
||||
: ui_panel("Perf", false)
|
||||
: ui_panel(STR("Performance"), false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void perfgraph_panel::render_contents() {
|
||||
if (ImGui::BeginCombo("Timer", timer_label[current_timer].c_str())) // The second parameter is the label previewed before opening the combo.
|
||||
if (ImGui::BeginCombo(STR_C("Timer"), timer_label[current_timer].c_str())) // The second parameter is the label previewed before opening the combo.
|
||||
{
|
||||
for (size_t i = 0; i < (size_t)TIMER_MAX; i++)
|
||||
{
|
||||
@@ -57,6 +57,6 @@ void perfgraph_panel::render_contents() {
|
||||
if (pos >= history.size())
|
||||
pos = 0;
|
||||
|
||||
ImGui::SliderFloat("Range", &max, 0.1f, 250.0f);
|
||||
ImGui::SliderFloat(STR_C("Range"), &max, 0.1f, 250.0f);
|
||||
ImGui::PlotLines("##timer", &history[0], history.size(), pos, label.c_str(), 0.0f, max, ImVec2(500, 200));
|
||||
}
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
#include "simulationtime.h"
|
||||
#include "Globals.h"
|
||||
|
||||
ui::time_panel::time_panel() : ui_panel(STR_C(time_window), false)
|
||||
ui::time_panel::time_panel() : ui_panel(STR_C("Time and environment"), false)
|
||||
{
|
||||
size.x = 450;
|
||||
}
|
||||
|
||||
void ui::time_panel::render_contents()
|
||||
{
|
||||
ImGui::SliderFloat(STR_C(time_time), &time, 0.0f, 24.0f, "%.1f");
|
||||
ImGui::SliderInt(STR_C(time_yearday), &yearday, 1, 365);
|
||||
ImGui::SliderFloat(STR_C(time_visibility), &fog, 50.0f, 3000.0f, "%.0f");
|
||||
ImGui::SliderFloat(STR_C(time_weather), &overcast, 0.0f, 2.0f, "%.1f");
|
||||
ImGui::SliderFloat(STR_C(time_temperature), &temperature, -20.0f, 40.0f, "%.0f");
|
||||
ImGui::SliderFloat(STR_C("Time"), &time, 0.0f, 24.0f, "%.1f");
|
||||
ImGui::SliderInt(STR_C("Day in year"), &yearday, 1, 365);
|
||||
ImGui::SliderFloat(STR_C("Visibility"), &fog, 50.0f, 3000.0f, "%.0f");
|
||||
ImGui::SliderFloat(STR_C("Overcast and precipitation"), &overcast, 0.0f, 2.0f, "%.1f");
|
||||
ImGui::SliderFloat(STR_C("Temperature"), &temperature, -20.0f, 40.0f, "%.0f");
|
||||
|
||||
if (ImGui::Button(STR_C(time_apply)))
|
||||
if (ImGui::Button(STR_C("Apply")))
|
||||
{
|
||||
m_relay.post(user_command::setdatetime, (double)yearday, time, 1, 0);
|
||||
m_relay.post(user_command::setweather, fog, overcast, 1, 0);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "widgets/vehicleparams.h"
|
||||
|
||||
ui::vehiclelist_panel::vehiclelist_panel(ui_layer &parent)
|
||||
: ui_panel(STR_C(vehiclelist_window), false), m_parent(parent)
|
||||
: ui_panel(STR_C("Vehicle list"), false), m_parent(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "Train.h"
|
||||
|
||||
ui::vehicleparams_panel::vehicleparams_panel(const std::string &vehicle)
|
||||
: ui_panel(std::string(STR(vehicleparams_window)) + ": " + vehicle, false), m_vehicle_name(vehicle)
|
||||
: ui_panel(std::string(STR("Vehicle parameters")) + ": " + vehicle, false), m_vehicle_name(vehicle)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -53,7 +53,7 @@ void ui::vehicleparams_panel::render_contents()
|
||||
|
||||
std::snprintf(
|
||||
buffer.data(), buffer.size(),
|
||||
STR_C(debug_vehicle_devicespower),
|
||||
STR_C("Devices: %c%c%c%c%c%c%c%c%c%c%c%c%c%c%s%s\nPower transfers: %.0f@%.0f%s%s%s%.0f@%.0f"),
|
||||
// devices
|
||||
( mover.Battery ? 'B' : '.' ),
|
||||
( mover.Mains ? 'M' : '.' ),
|
||||
@@ -70,7 +70,7 @@ void ui::vehicleparams_panel::render_contents()
|
||||
( mover.CompressorFlag ? 'C' : ( false == mover.CompressorAllowLocal ? '-' : ( ( mover.CompressorAllow || mover.CompressorStart == start_t::automatic ) ? 'c' : '.' ) ) ),
|
||||
( mover.CompressorGovernorLock ? '!' : '.' ),
|
||||
"",
|
||||
std::string( isdieselenginepowered ? STR(debug_vehicle_oilpressure) + to_string( mover.OilPump.pressure, 2 ) : "" ).c_str(),
|
||||
std::string( isdieselenginepowered ? STR(" oil pressure: ") + to_string( mover.OilPump.pressure, 2 ) : "" ).c_str(),
|
||||
// power transfers
|
||||
mover.Couplers[ end::front ].power_high.voltage,
|
||||
mover.Couplers[ end::front ].power_high.current,
|
||||
@@ -84,11 +84,11 @@ void ui::vehicleparams_panel::render_contents()
|
||||
|
||||
std::snprintf(
|
||||
buffer.data(), buffer.size(),
|
||||
STR_C(debug_vehicle_controllersenginerevolutions),
|
||||
STR_C("Controllers:\n master: %d(%d), secondary: %s\nEngine output: %.1f, current: %.0f\nRevolutions:\n engine: %.0f, motors: %.0f\n engine fans: %.0f, motor fans: %.0f+%.0f, cooling fans: %.0f+%.0f"),
|
||||
// controllers
|
||||
mover.MainCtrlPos,
|
||||
mover.MainCtrlActualPos,
|
||||
std::string( isdieselinshuntmode ? to_string( mover.AnPos, 2 ) + STR(debug_vehicle_shuntmode) : std::to_string( mover.ScndCtrlPos ) + "(" + std::to_string( mover.ScndCtrlActualPos ) + ")" ).c_str(),
|
||||
std::string( isdieselinshuntmode ? to_string( mover.AnPos, 2 ) + STR(" (shunt mode)") : std::to_string( mover.ScndCtrlPos ) + "(" + std::to_string( mover.ScndCtrlActualPos ) + ")" ).c_str(),
|
||||
// engine
|
||||
mover.EnginePower,
|
||||
std::abs( mover.TrainType == dt_EZT ? mover.ShowCurrent( 0 ) : mover.Im ),
|
||||
@@ -106,7 +106,7 @@ void ui::vehicleparams_panel::render_contents()
|
||||
if( isdieselenginepowered ) {
|
||||
std::snprintf(
|
||||
buffer.data(), buffer.size(),
|
||||
STR_C(debug_vehicle_temperatures),
|
||||
STR_C("\nTemperatures:\n engine: %.2f, oil: %.2f, water: %.2f%c%.2f"),
|
||||
mover.dizel_heat.Ts,
|
||||
mover.dizel_heat.To,
|
||||
mover.dizel_heat.temperatura1,
|
||||
@@ -132,7 +132,7 @@ void ui::vehicleparams_panel::render_contents()
|
||||
|
||||
std::snprintf(
|
||||
buffer.data(), buffer.size(),
|
||||
STR_C(debug_vehicle_brakespressures),
|
||||
STR_C("Brakes:\n train: %.2f, independent: %.2f, mode: %d, delay: %s, load flag: %d\nBrake cylinder pressures:\n train: %.2f, independent: %.2f, status: 0x%.2x\nPipe pressures:\n brake: %.2f (hat: %.2f), main: %.2f, control: %.2f\nTank pressures:\n auxiliary: %.2f, main: %.2f, control: %.2f"),
|
||||
// brakes
|
||||
mover.fBrakeCtrlPos,
|
||||
mover.LocalBrakePosA,
|
||||
@@ -158,7 +158,7 @@ void ui::vehicleparams_panel::render_contents()
|
||||
if( mover.EnginePowerSource.SourceType == TPowerSource::CurrentCollector ) {
|
||||
std::snprintf(
|
||||
buffer.data(), buffer.size(),
|
||||
STR_C(debug_vehicle_pantograph),
|
||||
STR_C(" pantograph: %.2f%cMT"),
|
||||
mover.PantPress,
|
||||
( mover.bPantKurek3 ? '-' : '|' ) );
|
||||
ImGui::TextUnformatted(buffer.data());
|
||||
@@ -166,7 +166,7 @@ void ui::vehicleparams_panel::render_contents()
|
||||
|
||||
std::snprintf(
|
||||
buffer.data(), buffer.size(),
|
||||
STR_C(debug_vehicle_forcesaccelerationvelocityposition),
|
||||
STR_C("Forces:\n tractive: %.1f, brake: %.1f, friction: %.2f%s\nAcceleration:\n tangential: %.2f, normal: %.2f (path radius: %s)\nVelocity: %.2f, distance traveled: %.2f\nPosition: [%.2f, %.2f, %.2f]"),
|
||||
// forces
|
||||
mover.Ft * 0.001f * ( mover.ActiveCab ? mover.ActiveCab : vehicle.ctOwner ? vehicle.ctOwner->Controlling()->ActiveCab : 1 ) + 0.001f,
|
||||
mover.Fb * 0.001f,
|
||||
@@ -186,40 +186,40 @@ void ui::vehicleparams_panel::render_contents()
|
||||
|
||||
ImGui::TextUnformatted(buffer.data());
|
||||
|
||||
if (ImGui::Button(STR_C(vehicleparams_radiostop)))
|
||||
if (ImGui::Button(STR_C("Radiostop")))
|
||||
m_relay.post(user_command::radiostop, 0.0, 0.0, GLFW_PRESS, 0, vehicle_ptr->GetPosition());
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button(STR_C(vehicleparams_reset)))
|
||||
if (ImGui::Button(STR_C("Stop and repair")))
|
||||
m_relay.post(user_command::resetconsist, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button(STR_C(vehicleparams_resetposition))) {
|
||||
if (ImGui::Button(STR_C("Reset position"))) {
|
||||
std::string payload = vehicle_ptr->name() + '%' + vehicle_ptr->initial_track->name();
|
||||
m_relay.post(user_command::consistteleport, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &payload);
|
||||
m_relay.post(user_command::resetconsist, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
}
|
||||
|
||||
if (ImGui::Button(STR_C(vehicleparams_resetpipe)))
|
||||
if (ImGui::Button(STR_C("Refill main tank")))
|
||||
m_relay.post(user_command::fillcompressor, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button(STR_C(vehicleparams_rupturepipe)))
|
||||
if (ImGui::Button(STR_C("Rupture main pipe")))
|
||||
m_relay.post(user_command::pullalarmchain, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::Button(STR_C(cab_releaser_bt));
|
||||
ImGui::Button(STR_C("independent brake releaser"));
|
||||
if (ImGui::IsItemClicked())
|
||||
m_relay.post(user_command::consistreleaser, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
if (ImGui::IsItemDeactivated())
|
||||
m_relay.post(user_command::consistreleaser, 0.0, 0.0, GLFW_RELEASE, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
|
||||
if (vehicle_ptr->MoverParameters->V < 0.01) {
|
||||
if (ImGui::Button(STR_C(vehicleparams_move500f)))
|
||||
if (ImGui::Button(STR_C("Move +500m")))
|
||||
m_relay.post(user_command::dynamicmove, 500.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button(STR_C(vehicleparams_move500b)))
|
||||
if (ImGui::Button(STR_C("Move -500m")))
|
||||
m_relay.post(user_command::dynamicmove, -500.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user