16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 12:29:18 +02:00

control for battery, pantographs, line breaker, converter and compressor

This commit is contained in:
tmj-fstate
2017-04-10 15:18:08 +02:00
parent e6f488ed6f
commit 1034fb8aa9
15 changed files with 830 additions and 350 deletions

View File

@@ -136,19 +136,22 @@ void TGauge::PutValue(double fNewDesired)
fValue = fDesiredValue;
};
double TGauge::GetValue() const {
// we feed value in range 0-1 so we should be getting it reported in the same range
return ( fValue - fOffset ) / fScale;
}
void TGauge::Update()
{
float dt = Timer::GetDeltaTime();
if ((fFriction > 0) && (dt < 0.5 * fFriction)) // McZapkie-281102:
// zabezpieczenie przed
// oscylacjami dla dlugich
// czasow
fValue += dt * (fDesiredValue - fValue) / fFriction;
if( ( fFriction > 0 ) && ( dt < 0.5 * fFriction ) ) {
// McZapkie-281102: zabezpieczenie przed oscylacjami dla dlugich czasow
fValue += dt * ( fDesiredValue - fValue ) / fFriction;
}
else
fValue = fDesiredValue;
if (SubModel)
{ // warunek na wszelki wypadek, gdyby się submodel nie
// podłączył
{ // warunek na wszelki wypadek, gdyby się submodel nie podłączył
TSubModel *sm;
switch (eType)
{