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

basic plc implementation

This commit is contained in:
tmj-fstate
2020-06-29 15:27:52 +02:00
parent 0af9e84453
commit 065c490bea
7 changed files with 585 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ http://mozilla.org/MPL/2.0/.
//Q: 20160805 - odlaczenie pliku fizyki .pas od kompilacji
#include <map>
#include "hamulce.h"
#include "ladderlogic.h"
/*
MaSzyna EU07 locomotive simulator
Copyright (C) 2001-2004 Maciej Czapkiewicz and others
@@ -1600,6 +1601,8 @@ public:
int iProblem = 0; // flagi problemów z taborem, aby AI nie musiało porównywać; 0=może jechać
int iLights[2]; // bity zapalonych świateł tutaj, żeby dało się liczyć pobór prądu
plc::basic_controller m_plc;
int AIHintPantstate{ 0 }; // suggested pantograph setup
bool AIHintPantUpIfIdle{ true }; // whether raise both pantographs if idling for a while
double AIHintLocalBrakeAccFactor{ 1.05 }; // suggested acceleration weight for local brake operation

View File

@@ -1458,6 +1458,8 @@ void TMoverParameters::compute_movement_( double const Deltatime ) {
// automatic doors
update_doors( Deltatime );
m_plc.update( Deltatime );
PowerCouplersCheck( Deltatime, coupling::highvoltage );
PowerCouplersCheck( Deltatime, coupling::power110v );
PowerCouplersCheck( Deltatime, coupling::power24v );