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

basic cargo attributes system, minor cargo enhancements and fixes

This commit is contained in:
tmj-fstate
2018-09-19 19:12:53 +02:00
parent 4c7d254539
commit 38591a09f2
8 changed files with 253 additions and 245 deletions

View File

@@ -944,11 +944,19 @@ public:
double MED_EPVC_Time = 7; // czas korekcji sily hamowania EP, gdy nie ma dostepnego ED
bool MED_Ncor = 0; // czy korekcja sily hamowania z uwzglednieniem nacisku
/*-dla wagonow*/
struct load_attributes {
std::string name; // name of the cargo
float offset_min { 0.f }; // offset applied to cargo model when load amount is 0
load_attributes() = default;
load_attributes( std::string const &Name, float const Offsetmin ) :
name( Name ), offset_min( Offsetmin )
{}
};
std::vector<load_attributes> LoadAttributes;
float MaxLoad = 0.f; /*masa w T lub ilosc w sztukach - ladownosc*/
std::string LoadAccepted; std::string LoadQuantity; /*co moze byc zaladowane, jednostki miary*/
double OverLoadFactor = 0.0; /*ile razy moze byc przekroczona ladownosc*/
float LoadMinOffset { 0.f }; // offset applied to cargo model when load amount is 0
float LoadSpeed = 0.f; float UnLoadSpeed = 0.f;/*szybkosc na- i rozladunku jednostki/s*/
double OverLoadFactor = 0.0; /*ile razy moze byc przekroczona ladownosc*/
float LoadSpeed = 0.f; float UnLoadSpeed = 0.f;/*szybkosc na- i rozladunku jednostki/s*/
int DoorOpenCtrl = 0; int DoorCloseCtrl = 0; /*0: przez pasazera, 1: przez maszyniste, 2: samoczynne (zamykanie)*/
double DoorStayOpen = 0.0; /*jak dlugo otwarte w przypadku DoorCloseCtrl=2*/
bool DoorClosureWarning = false; /*czy jest ostrzeganie przed zamknieciem*/
@@ -1167,9 +1175,10 @@ public:
double eAngle = M_PI * 0.5;
/*-dla wagonow*/
float Load = 0.f; /*masa w T lub ilosc w sztukach - zaladowane*/
std::string LoadType; /*co jest zaladowane*/
int LoadStatus = 0; //+1=trwa rozladunek,+2=trwa zaladunek,+4=zakończono,0=zaktualizowany model
float LoadAmount = 0.f; /*masa w T lub ilosc w sztukach - zaladowane*/
load_attributes LoadType;
std::string LoadQuantity; // jednostki miary
int LoadStatus = 0; //+1=trwa rozladunek,+2=trwa zaladunek,+4=zakończono,0=zaktualizowany model
double LastLoadChangeTime = 0.0; //raz (roz)ładowania
bool DoorBlocked = false; //Czy jest blokada drzwi
@@ -1211,7 +1220,7 @@ private:
double CouplerDist(int Coupler);
public:
TMoverParameters(double VelInitial, std::string TypeNameInit, std::string NameInit, int LoadInitial, std::string LoadTypeInitial, int Cab);
TMoverParameters(double VelInitial, std::string TypeNameInit, std::string NameInit, int Cab);
// obsługa sprzęgów
double Distance(const TLocation &Loc1, const TLocation &Loc2, const TDimension &Dim1, const TDimension &Dim2);
/* double Distance(const vector3 &Loc1, const vector3 &Loc2, const vector3 &Dim1, const vector3 &Dim2);
@@ -1375,7 +1384,8 @@ public:
bool dizel_Update(double dt);
/* funckje dla wagonow*/
bool LoadingDone(double LSpeed, std::string LoadInit);
bool AssignLoad( std::string const &Name, float const Amount = 0.f );
bool LoadingDone(double LSpeed, std::string const &Loadname);
bool DoorLeft(bool State, range_t const Notify = range_t::consist ); //obsluga drzwi lewych
bool DoorRight(bool State, range_t const Notify = range_t::consist ); //obsluga drzwi prawych
bool DoorBlockedFlag(void); //sprawdzenie blokady drzwi