Skip to content

Commit

Permalink
Версия 1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
maisvendoo committed Apr 30, 2020
1 parent 1afa5e7 commit 9ce1c5a
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 2 deletions.
6 changes: 6 additions & 0 deletions addons/chs2t/chs2t/include/chs2t-signals.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ enum
VAL_PR_SKOR1 = 60,
VAL_PR_SKOR2 = 61,

LS_G = 62,
LS_R = 63,
LS_W = 64,
LS_Y = 65,
LS_YR = 66,

WHEEL_1 = 194,
WHEEL_2 = 195,
WHEEL_3 = 196,
Expand Down
2 changes: 2 additions & 0 deletions addons/chs2t/chs2t/include/chs2t.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ class CHS2T : public Vehicle

void stepSwitcherPanel();

void stepDecodeAlsn();

/// Шаг моделирования всех систем локомотива в целом
void step(double t, double dt);

Expand Down
44 changes: 44 additions & 0 deletions addons/chs2t/chs2t/src/chs2t-step-decode-alsn.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "chs2t.h"
#include "chs2t-signals.h"

void CHS2T::stepDecodeAlsn()
{
analogSignal[LS_W] = 0.0f;
analogSignal[LS_YR] = 0.0f;
analogSignal[LS_R] = 0.0f;
analogSignal[LS_Y] = 0.0f;
analogSignal[LS_G] = 0.0f;

switch (alsn_info.code_alsn)
{
case ALSN_WHITE:

analogSignal[LS_W] = 1.0f;

break;

case ALSN_RED:

analogSignal[LS_R] = 1.0f;

break;

case ALSN_RED_YELLOW:

analogSignal[LS_YR] = 1.0f;

break;

case ALSN_YELLOW:

analogSignal[LS_Y] = 1.0f;

break;

case ALSN_GREEN:

analogSignal[LS_G] = 1.0f;

break;
}
}
2 changes: 2 additions & 0 deletions addons/chs2t/chs2t/src/chs2t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ void CHS2T::step(double t, double dt)

stepSwitcherPanel();

stepDecodeAlsn();

registrate(t, dt);

//Journal::instance()->info("Step horn");
Expand Down
9 changes: 9 additions & 0 deletions addons/tep70/tep70/include/disel.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ class Disel : public Device
this->n_ref = n_ref;
}

/// Задать уровень топлива бака
void setFuelLevel(double fuel_level)
{
this->fuel_level = fuel_level;
}

/// Вернуть давление в системе смазки
double getOilPressure() const { return getY(0); }

Expand Down Expand Up @@ -141,6 +147,9 @@ class Disel : public Device
/// Имя текущего проигрываемого звука
QString soundName;

/// Уровень топлива в баке
double fuel_level;

enum
{
MIN_POS = 0,
Expand Down
3 changes: 2 additions & 1 deletion addons/tep70/tep70/src/disel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Disel::Disel(QObject *parent) : Device(parent)
, delta_omega(0.0)
, pos_count(0)
, soundName("pos0")
, fuel_level(0.0)
{
std::fill(K.begin(), K.end(), 0.0);

Expand Down Expand Up @@ -90,7 +91,7 @@ void Disel::preStep(state_vector_t &Y, double t)
}
else
{
is_fuel_ignition = state_mv6;
is_fuel_ignition = state_mv6 && (fuel_level >= 0.01);
}

delta_omega = n_ref * Physics::PI / 30.0 - Y[1];
Expand Down
1 change: 1 addition & 0 deletions addons/tep70/tep70/src/tep70-step-disel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ void TEP70::stepDisel(double t, double dt)
disel->setMV6state(mv6->getContactState(0));
disel->setVTNstate(vtn->getContactState(0));
disel->setRefFreq(km->getRefFreq());
disel->setFuelLevel(fuel_tank->getFuelLevel());
disel->step(t, dt);

double I_gen = Icc + motor_compressor->getCurrent();
Expand Down
2 changes: 1 addition & 1 deletion setup/setup.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define Name "RRS"
#define Version "1.0.5"
#define Version "1.0.6"
#define arch "x86_64"
#define Publisher "maisvendoo"

Expand Down

0 comments on commit 9ce1c5a

Please sign in to comment.