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

Merge branch 'mover_in_c++' of https://github.com/tmj-fstate/maszyna into tmj-fstate-mover_in_c++

This commit is contained in:
milek7
2017-11-03 20:31:20 +01:00
35 changed files with 442 additions and 467 deletions

View File

@@ -140,6 +140,11 @@ static int const ctrain_passenger = 16; //mostek przejściowy
static int const ctrain_scndpneumatic = 32; //przewody 8 atm (żółte; zasilanie powietrzem)
static int const ctrain_heating = 64; //przewody ogrzewania WN
static int const ctrain_depot = 128; //nie rozłączalny podczas zwykłych manewrów (międzyczłonowy), we wpisie wartość ujemna
// vehicle sides; exclusive
enum side {
front = 0,
rear
};
// possible coupling types; can be combined
enum coupling {
faux = 0x0,
@@ -162,6 +167,16 @@ enum range {
enum start {
manual,
automatic
};
// recognized vehicle light locations and types; can be combined
enum light {
headlight_left = 0x01,
redmarker_left = 0x02,
headlight_upper = 0x04,
headlight_right = 0x10,
redmarker_right = 0x20,
rearendsignals = 0x40
};
/*typ hamulca elektrodynamicznego*/
static int const dbrake_none = 0;
@@ -699,15 +714,6 @@ public:
int LightsDefPos = 1;
bool LightsWrap = false;
int Lights[2][17]; // pozycje świateł, przód - tył, 1 .. 16
enum light {
headlight_left = 0x01,
redmarker_left = 0x02,
headlight_upper = 0x04,
headlight_right = 0x10,
redmarker_right = 0x20,
rearendsignals = 0x40
};
int ScndInMain{ 0 }; /*zaleznosc bocznika od nastawnika*/
bool MBrake = false; /*Czy jest hamulec reczny*/
double StopBrakeDecc = 0.0;
@@ -802,10 +808,6 @@ public:
TRotation Rot;
std::string Name; /*nazwa wlasna*/
TCoupling Couplers[2]; //urzadzenia zderzno-sprzegowe, polaczenia miedzy wagonami
enum side {
front = 0,
rear
};
#ifdef EU07_USE_OLD_HVCOUPLERS
double HVCouplers[ 2 ][ 2 ]; //przewod WN
enum hvcoupler {

View File

@@ -294,10 +294,13 @@ bool FileExists( std::string const &Filename ) {
}
// returns time of last modification for specified file
time_t
std::time_t
last_modified( std::string const &Filename ) {
std::string fn = Filename;
std::replace(fn.begin(), fn.end(), '\\', '/');
struct stat filestat;
if( ::stat( Filename.c_str(), &filestat ) == 0 ) { return filestat.st_mtime; }
else { return 0; }
if( ::stat( fn.c_str(), &filestat ) == 0 )
return filestat.st_mtime;
else
return 0;
}

View File

@@ -160,4 +160,4 @@ extract_value( bool &Variable, std::string const &Key, std::string const &Input,
bool FileExists( std::string const &Filename );
// returns time of last modification for specified file
time_t last_modified( std::string const &Filename );
std::time_t last_modified( std::string const &Filename );