mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 15:09:19 +02:00
Dalsze poprawki do AnsiString w różnych plikach.
This commit is contained in:
@@ -30,11 +30,8 @@ class TTraction; // drut
|
|||||||
class TTractionPowerSource; // zasilanie drutów
|
class TTractionPowerSource; // zasilanie drutów
|
||||||
|
|
||||||
class TMoverParameters;
|
class TMoverParameters;
|
||||||
namespace _mover
|
|
||||||
{
|
|
||||||
class TLocation;
|
class TLocation;
|
||||||
class TRotation;
|
class TRotation;
|
||||||
};
|
|
||||||
|
|
||||||
namespace Mtable
|
namespace Mtable
|
||||||
{
|
{
|
||||||
|
|||||||
22
Driver.cpp
22
Driver.cpp
@@ -828,9 +828,9 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
|
|||||||
{ // zaliczamy posterunek w pewnej odleg<65>o<EFBFBD>ci przed (cho<68> W4 nie zas<61>ania
|
{ // zaliczamy posterunek w pewnej odleg<65>o<EFBFBD>ci przed (cho<68> W4 nie zas<61>ania
|
||||||
// ju<6A> semafora)
|
// ju<6A> semafora)
|
||||||
#if LOGSTOPS
|
#if LOGSTOPS
|
||||||
WriteLog(pVehicle->asName + " as " + TrainParams->TrainName.c_str() + ": at " +
|
WriteLog(pVehicle->asName + " as " + TrainParams->TrainName + ": at " +
|
||||||
AnsiString(GlobalTime->hh) + ":" + AnsiString(GlobalTime->mm) +
|
to_string(GlobalTime->hh) + ":" + to_string(GlobalTime->mm) +
|
||||||
" skipped " + AnsiString(asNextStop.c_str())); // informacja
|
" skipped " + asNextStop.); // informacja
|
||||||
#endif
|
#endif
|
||||||
fLastStopExpDist = mvOccupied->DistCounter + 0.250 +
|
fLastStopExpDist = mvOccupied->DistCounter + 0.250 +
|
||||||
0.001 * fLength; // przy jakim dystansie (stanie
|
0.001 * fLength; // przy jakim dystansie (stanie
|
||||||
@@ -999,10 +999,10 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
|
|||||||
asNextStop = TrainParams->NextStop(); // pobranie kolejnego miejsca zatrzymania
|
asNextStop = TrainParams->NextStop(); // pobranie kolejnego miejsca zatrzymania
|
||||||
// TableClear(); //aby od nowa sprawdzi<7A>o W4 z inn<6E> nazw<7A> ju<6A> - to nie jest dobry pomys<79>
|
// TableClear(); //aby od nowa sprawdzi<7A>o W4 z inn<6E> nazw<7A> ju<6A> - to nie jest dobry pomys<79>
|
||||||
#if LOGSTOPS
|
#if LOGSTOPS
|
||||||
WriteLog(pVehicle->asName + " as " + AnsiString(TrainParams->TrainName.c_str()) +
|
WriteLog(pVehicle->asName + " as " + TrainParams->TrainName +
|
||||||
": at " + AnsiString(GlobalTime->hh) + ":" +
|
": at " + to_string(GlobalTime->hh) + ":" +
|
||||||
AnsiString(GlobalTime->mm) + " next " +
|
to_string(GlobalTime->mm) + " next " +
|
||||||
AnsiString(asNextStop.c_str())); // informacja
|
asNextStop); // informacja
|
||||||
#endif
|
#endif
|
||||||
if (int(floor(sSpeedTable[i].evEvent->ValueGet(1))) & 1)
|
if (int(floor(sSpeedTable[i].evEvent->ValueGet(1))) & 1)
|
||||||
iDrivigFlags |= moveStopHere; // nie podje<6A>d<EFBFBD>a<EFBFBD> do semafora,
|
iDrivigFlags |= moveStopHere; // nie podje<6A>d<EFBFBD>a<EFBFBD> do semafora,
|
||||||
@@ -1026,9 +1026,9 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
|
|||||||
else
|
else
|
||||||
{ // je<6A>li dojechali<6C>my do ko<6B>ca rozk<7A>adu
|
{ // je<6A>li dojechali<6C>my do ko<6B>ca rozk<7A>adu
|
||||||
#if LOGSTOPS
|
#if LOGSTOPS
|
||||||
WriteLog(pVehicle->asName + " as " + AnsiString(TrainParams->TrainName.c_str()) +
|
WriteLog(pVehicle->asName + " as " + TrainParams->TrainName) +
|
||||||
": at " + AnsiString(GlobalTime->hh) + ":" +
|
": at " + to_string(GlobalTime->hh) + ":" +
|
||||||
AnsiString(GlobalTime->mm) +
|
to_string(GlobalTime->mm) +
|
||||||
" end of route."); // informacja
|
" end of route."); // informacja
|
||||||
#endif
|
#endif
|
||||||
asNextStop = TrainParams->NextStop(); // informacja o ko<6B>cu trasy
|
asNextStop = TrainParams->NextStop(); // informacja o ko<6B>cu trasy
|
||||||
@@ -1486,7 +1486,7 @@ TController::TController(bool AI, TDynamicObject *NewControll, bool InitPsyche,
|
|||||||
if (WriteLogFlag)
|
if (WriteLogFlag)
|
||||||
{
|
{
|
||||||
mkdir("physicslog\\");
|
mkdir("physicslog\\");
|
||||||
LogFile.open(AnsiString("physicslog\\" + VehicleName + ".dat").c_str(),
|
LogFile.open("physicslog\\" + VehicleName.c_str() + ".dat",
|
||||||
std::ios::in | std::ios::out | std::ios::trunc);
|
std::ios::in | std::ios::out | std::ios::trunc);
|
||||||
#if LOGPRESS == 0
|
#if LOGPRESS == 0
|
||||||
LogFile << AnsiString(" Time [s] Velocity [m/s] Acceleration [m/ss] Coupler.Dist[m] "
|
LogFile << AnsiString(" Time [s] Velocity [m/s] Acceleration [m/ss] Coupler.Dist[m] "
|
||||||
|
|||||||
2
Driver.h
2
Driver.h
@@ -288,7 +288,7 @@ class TController
|
|||||||
private:
|
private:
|
||||||
double fMaxProximityDist; // akceptowalna odległość stanięcia przed przeszkodą
|
double fMaxProximityDist; // akceptowalna odległość stanięcia przed przeszkodą
|
||||||
TStopReason eStopReason; // powód zatrzymania przy ustawieniu zerowej prędkości
|
TStopReason eStopReason; // powód zatrzymania przy ustawieniu zerowej prędkości
|
||||||
AnsiString VehicleName;
|
std::string VehicleName;
|
||||||
double fVelPlus; // dopuszczalne przekroczenie prędkości na ograniczeniu bez hamowania
|
double fVelPlus; // dopuszczalne przekroczenie prędkości na ograniczeniu bez hamowania
|
||||||
double fVelMinus; // margines obniżenia prędkości, powodujący załączenie napędu
|
double fVelMinus; // margines obniżenia prędkości, powodujący załączenie napędu
|
||||||
double fWarningDuration; // ile czasu jeszcze trąbić
|
double fWarningDuration; // ile czasu jeszcze trąbić
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ void TEvent::Load(cParser *parser, vector3 *org)
|
|||||||
|
|
||||||
parser->getTokens();
|
parser->getTokens();
|
||||||
*parser >> token;
|
*parser >> token;
|
||||||
asName = AnsiString(token.c_str()).LowerCase(); // u¿ycie parametrów mo¿e dawaæ wielkie
|
asName = ToLower(token); // u¿ycie parametrów mo¿e dawaæ wielkie
|
||||||
|
|
||||||
parser->getTokens();
|
parser->getTokens();
|
||||||
*parser >> token;
|
*parser >> token;
|
||||||
@@ -224,7 +224,7 @@ void TEvent::Load(cParser *parser, vector3 *org)
|
|||||||
if (str != "none")
|
if (str != "none")
|
||||||
asNodeName = str; // nazwa obiektu powi¹zanego
|
asNodeName = str; // nazwa obiektu powi¹zanego
|
||||||
|
|
||||||
if (asName.SubString(1, 5) == "none_")
|
if (asName.substr(0, 5) == "none_")
|
||||||
Type = tp_Ignored; // Ra: takie s¹ ignorowane
|
Type = tp_Ignored; // Ra: takie s¹ ignorowane
|
||||||
|
|
||||||
switch (Type)
|
switch (Type)
|
||||||
@@ -568,9 +568,9 @@ void TEvent::Load(cParser *parser, vector3 *org)
|
|||||||
ti = !ti; // zmiana flagi dla s³owa "else"
|
ti = !ti; // zmiana flagi dla s³owa "else"
|
||||||
}
|
}
|
||||||
else if (i >= 8)
|
else if (i >= 8)
|
||||||
ErrorLog("Bad event: \"" + str + "\" ignored in multiple \"" + asName + "\"!");
|
ErrorLog("Bad event: \"" + string(str.c_str()) + "\" ignored in multiple \"" + asName + "\"!");
|
||||||
else
|
else
|
||||||
WriteLog("Event \"" + str + "\" ignored in multiple \"" + asName + "\"!");
|
WriteLog("Event \"" + string(str.c_str()) + "\" ignored in multiple \"" + asName + "\"!");
|
||||||
parser->getTokens();
|
parser->getTokens();
|
||||||
*parser >> token;
|
*parser >> token;
|
||||||
str = AnsiString(token.c_str());
|
str = AnsiString(token.c_str());
|
||||||
|
|||||||
2
Event.h
2
Event.h
@@ -12,6 +12,8 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
|
|
||||||
#include "Classes.h"
|
#include "Classes.h"
|
||||||
#include "dumb3d.h"
|
#include "dumb3d.h"
|
||||||
|
#include <string>
|
||||||
|
|
||||||
using namespace Math3D;
|
using namespace Math3D;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|||||||
@@ -976,7 +976,7 @@ std::string to_string(double _Val, int precision, int width)
|
|||||||
return o.str();
|
return o.str();
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string to_hex_str(double _Val, int precision = 0, int width = 0)
|
std::string to_hex_str(double _Val, int precision, int width)
|
||||||
{
|
{
|
||||||
std::ostringstream o;
|
std::ostringstream o;
|
||||||
if (width)
|
if (width)
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ class Global
|
|||||||
std::string to_string(double _Val);
|
std::string to_string(double _Val);
|
||||||
std::string to_string(double _Val, int precision);
|
std::string to_string(double _Val, int precision);
|
||||||
std::string to_string(double _Val, int precision, int width);
|
std::string to_string(double _Val, int precision, int width);
|
||||||
std::string to_hex_str(int _Val, int precision, int width);
|
std::string to_hex_str(int _Val, int precision = 0, int width = 0);
|
||||||
|
|
||||||
|
|
||||||
std::string ToLower(std::string text);
|
std::string ToLower(std::string text);
|
||||||
|
|||||||
8
Logs.cpp
8
Logs.cpp
@@ -75,6 +75,7 @@ void WriteLog(const char *str, bool newline)
|
|||||||
WriteConsoleOnly(str, newline);
|
WriteConsoleOnly(str, newline);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void ErrorLog(const char *str)
|
void ErrorLog(const char *str)
|
||||||
{ // Ra: bezwarunkowa rejestracja powa¿nych b³êdów
|
{ // Ra: bezwarunkowa rejestracja powa¿nych b³êdów
|
||||||
if (!errors.is_open())
|
if (!errors.is_open())
|
||||||
@@ -94,6 +95,13 @@ void Error(const AnsiString &asMessage, bool box)
|
|||||||
MessageBox(NULL, asMessage.c_str(), AnsiString("EU07 " + Global::asRelease).c_str(), MB_OK);
|
MessageBox(NULL, asMessage.c_str(), AnsiString("EU07 " + Global::asRelease).c_str(), MB_OK);
|
||||||
WriteLog(asMessage.c_str());
|
WriteLog(asMessage.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ErrorLog(const std::string &str, bool newline = true)
|
||||||
|
{
|
||||||
|
ErrorLog(str.c_str());
|
||||||
|
WriteLog(str.c_str(), newline);
|
||||||
|
}
|
||||||
|
|
||||||
void ErrorLog(const AnsiString &asMessage)
|
void ErrorLog(const AnsiString &asMessage)
|
||||||
{ // zapisywanie b³êdów "errors.txt"
|
{ // zapisywanie b³êdów "errors.txt"
|
||||||
ErrorLog(asMessage.c_str());
|
ErrorLog(asMessage.c_str());
|
||||||
|
|||||||
3
Logs.h
3
Logs.h
@@ -17,7 +17,8 @@ void WriteConsoleOnly(const char *str, bool newline = true);
|
|||||||
void WriteLog(const char *str, double value);
|
void WriteLog(const char *str, double value);
|
||||||
void WriteLog(const char *str, bool newline = true);
|
void WriteLog(const char *str, bool newline = true);
|
||||||
void Error(const AnsiString &asMessage, bool box = true);
|
void Error(const AnsiString &asMessage, bool box = true);
|
||||||
void ErrorLog(const AnsiString &asMessage);
|
void ErrorLog(const std::string &str, bool newline = true);
|
||||||
|
//void ErrorLog(const AnsiString &asMessage);
|
||||||
void WriteLog(const AnsiString &str, bool newline = true);
|
void WriteLog(const AnsiString &str, bool newline = true);
|
||||||
void WriteLog(const std::string &str, bool newline = true);
|
void WriteLog(const std::string &str, bool newline = true);
|
||||||
void CommLog(const char *str);
|
void CommLog(const char *str);
|
||||||
|
|||||||
15
MdlMngr.cpp
15
MdlMngr.cpp
@@ -20,6 +20,7 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
|
|
||||||
#include "MdlMngr.h"
|
#include "MdlMngr.h"
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#define SeekFiles AnsiString("*.t3d")
|
#define SeekFiles AnsiString("*.t3d")
|
||||||
|
|
||||||
@@ -99,7 +100,7 @@ TModel3d * TModelsManager::GetModel(const char *Name, bool dynamic)
|
|||||||
// - niebo animowane, œcie¿ka brana ze wpisu, tekstury nieokreœlone
|
// - niebo animowane, œcie¿ka brana ze wpisu, tekstury nieokreœlone
|
||||||
// - wczytanie modelu animowanego - Init() - sprawdziæ
|
// - wczytanie modelu animowanego - Init() - sprawdziæ
|
||||||
char buf[255];
|
char buf[255];
|
||||||
AnsiString buftp = Global::asCurrentTexturePath; // zapamiêtanie aktualnej œcie¿ki do tekstur,
|
std::string buftp = Global::asCurrentTexturePath; // zapamiêtanie aktualnej œcie¿ki do tekstur,
|
||||||
// bo bêdzie tyczmasowo zmieniana
|
// bo bêdzie tyczmasowo zmieniana
|
||||||
/*
|
/*
|
||||||
// Ra: niby tak jest lepiej, ale dzia³a gorzej, wiêc przywrócone jest oryginalne
|
// Ra: niby tak jest lepiej, ale dzia³a gorzej, wiêc przywrócone jest oryginalne
|
||||||
@@ -148,9 +149,9 @@ TModel3d * TModelsManager::GetModel(const char *Name, bool dynamic)
|
|||||||
strcat(buf, Name);
|
strcat(buf, Name);
|
||||||
if (strchr(Name, '/') != NULL)
|
if (strchr(Name, '/') != NULL)
|
||||||
{
|
{
|
||||||
Global::asCurrentTexturePath = Global::asCurrentTexturePath + AnsiString(Name);
|
Global::asCurrentTexturePath = Global::asCurrentTexturePath + Name;
|
||||||
Global::asCurrentTexturePath.Delete(Global::asCurrentTexturePath.Pos("/") + 1,
|
Global::asCurrentTexturePath.erase(Global::asCurrentTexturePath.find("/") + 1,
|
||||||
Global::asCurrentTexturePath.Length());
|
Global::asCurrentTexturePath.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -159,9 +160,9 @@ TModel3d * TModelsManager::GetModel(const char *Name, bool dynamic)
|
|||||||
if (dynamic) // na razie tak, bo nie wiadomo, jaki mo¿e mieæ wp³yw na pozosta³e modele
|
if (dynamic) // na razie tak, bo nie wiadomo, jaki mo¿e mieæ wp³yw na pozosta³e modele
|
||||||
if (strchr(Name, '/') != NULL)
|
if (strchr(Name, '/') != NULL)
|
||||||
{ // pobieranie tekstur z katalogu, w którym jest model
|
{ // pobieranie tekstur z katalogu, w którym jest model
|
||||||
Global::asCurrentTexturePath = Global::asCurrentTexturePath + AnsiString(Name);
|
Global::asCurrentTexturePath = Global::asCurrentTexturePath + Name;
|
||||||
Global::asCurrentTexturePath.Delete(Global::asCurrentTexturePath.Pos("/") + 1,
|
Global::asCurrentTexturePath.erase(Global::asCurrentTexturePath.find("/") + 1,
|
||||||
Global::asCurrentTexturePath.Length());
|
Global::asCurrentTexturePath.length() - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StrLower(buf);
|
StrLower(buf);
|
||||||
|
|||||||
10
Model3d.cpp
10
Model3d.cpp
@@ -1624,11 +1624,11 @@ void TSubModel::BinInit(TSubModel *s, float4x4 *m, float8 *v, TStringPack *t, TS
|
|||||||
// TextureID=TTexturesManager::GetTextureID(t->String(TextureID));
|
// TextureID=TTexturesManager::GetTextureID(t->String(TextureID));
|
||||||
// asTexture=AnsiString(t->String(iTexture));
|
// asTexture=AnsiString(t->String(iTexture));
|
||||||
pTexture = t->String(iTexture);
|
pTexture = t->String(iTexture);
|
||||||
AnsiString t = AnsiString(pTexture);
|
string tex = pTexture;
|
||||||
if (t.LastDelimiter("/\\") == 0)
|
if (tex.find_last_of("/\\") == string::npos)
|
||||||
t.Insert(Global::asCurrentTexturePath, 1);
|
tex.insert(0, Global::asCurrentTexturePath);
|
||||||
TextureID = TTexturesManager::GetTextureID(szTexturePath,
|
TextureID = TTexturesManager::GetTextureID(
|
||||||
Global::asCurrentTexturePath.c_str(), t.c_str());
|
szTexturePath, const_cast<char*>(Global::asCurrentTexturePath.c_str()), tex);
|
||||||
// TexAlpha=TTexturesManager::GetAlpha(TextureID); //zmienna robocza
|
// TexAlpha=TTexturesManager::GetAlpha(TextureID); //zmienna robocza
|
||||||
// ustawienie cyklu przezroczyste/nieprzezroczyste zale¿nie od w³asnoœci
|
// ustawienie cyklu przezroczyste/nieprzezroczyste zale¿nie od w³asnoœci
|
||||||
// sta³ej tekstury
|
// sta³ej tekstury
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ void TPythonScreens::reset(void *train)
|
|||||||
_train = train;
|
_train = train;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPythonScreens::init(TQueryParserComp *parser, TModel3d *model, AnsiString name, int cab)
|
void TPythonScreens::init(TQueryParserComp *parser, TModel3d *model, string name, int cab)
|
||||||
{
|
{
|
||||||
char buff[255];
|
char buff[255];
|
||||||
AnsiString asSubModelName = parser->GetNextSymbol();
|
AnsiString asSubModelName = parser->GetNextSymbol();
|
||||||
@@ -471,13 +471,13 @@ void TPythonScreens::update()
|
|||||||
_cleanupReadyFlag = true;
|
_cleanupReadyFlag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPythonScreens::setLookupPath(AnsiString path)
|
void TPythonScreens::setLookupPath(string path)
|
||||||
{
|
{
|
||||||
if (_lookupPath != NULL)
|
if (_lookupPath != NULL)
|
||||||
{
|
{
|
||||||
free(_lookupPath);
|
free(_lookupPath);
|
||||||
}
|
}
|
||||||
_lookupPath = (char *)calloc(path.Length() + 1, sizeof(char));
|
_lookupPath = (char *)calloc(path.length() + 1, sizeof(char));
|
||||||
strcpy(_lookupPath, path.c_str());
|
strcpy(_lookupPath, path.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
7
PyInt.h
7
PyInt.h
@@ -8,6 +8,9 @@
|
|||||||
#include "Model3d.h"
|
#include "Model3d.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
#define PyGetFloat(param) PyFloat_FromDouble(param >= 0 ? param : -param)
|
#define PyGetFloat(param) PyFloat_FromDouble(param >= 0 ? param : -param)
|
||||||
#define PyGetFloatS(param) PyFloat_FromDouble(param)
|
#define PyGetFloatS(param) PyFloat_FromDouble(param)
|
||||||
@@ -85,8 +88,8 @@ class TPythonScreens
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void reset(void *train);
|
void reset(void *train);
|
||||||
void setLookupPath(AnsiString path);
|
void setLookupPath(string path);
|
||||||
void init(TQueryParserComp *parser, TModel3d *model, AnsiString name, int cab);
|
void init(TQueryParserComp *parser, TModel3d *model, string name, int cab);
|
||||||
void update();
|
void update();
|
||||||
TPythonScreens();
|
TPythonScreens();
|
||||||
~TPythonScreens();
|
~TPythonScreens();
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ TTexturesManager::Names::iterator TTexturesManager::LoadFromFile(std::string fil
|
|||||||
if (!texinfo.first)
|
if (!texinfo.first)
|
||||||
{
|
{
|
||||||
WriteLog("Failed");
|
WriteLog("Failed");
|
||||||
ErrorLog("Missed texture: " + AnsiString(realFileName.c_str()));
|
ErrorLog("Missed texture: " + realFileName);
|
||||||
return _names.end();
|
return _names.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3104,7 +3104,7 @@ void TTrack::MovedUp1(double dh)
|
|||||||
fTexHeight1 += dh;
|
fTexHeight1 += dh;
|
||||||
};
|
};
|
||||||
|
|
||||||
AnsiString TTrack::NameGet()
|
string TTrack::NameGet()
|
||||||
{ // ustalenie nazwy toru
|
{ // ustalenie nazwy toru
|
||||||
if (this)
|
if (this)
|
||||||
if (pMyNode)
|
if (pMyNode)
|
||||||
|
|||||||
3
Track.h
3
Track.h
@@ -15,6 +15,7 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
#include "opengl/glew.h"
|
#include "opengl/glew.h"
|
||||||
#include <system.hpp>
|
#include <system.hpp>
|
||||||
#include "Classes.h"
|
#include "Classes.h"
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class TEvent;
|
class TEvent;
|
||||||
|
|
||||||
@@ -275,7 +276,7 @@ class TTrack : public Resource
|
|||||||
bool IsGroupable();
|
bool IsGroupable();
|
||||||
int TestPoint(vector3 *Point);
|
int TestPoint(vector3 *Point);
|
||||||
void MovedUp1(double dh);
|
void MovedUp1(double dh);
|
||||||
AnsiString NameGet();
|
string NameGet();
|
||||||
void VelocitySet(float v);
|
void VelocitySet(float v);
|
||||||
float VelocityGet();
|
float VelocityGet();
|
||||||
void ConnectionsLog();
|
void ConnectionsLog();
|
||||||
|
|||||||
45
Train.cpp
45
Train.cpp
@@ -24,6 +24,7 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
#include "McZapkie\hamulce.h"
|
#include "McZapkie\hamulce.h"
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
#include <fstream>
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
#pragma package(smart_init)
|
#pragma package(smart_init)
|
||||||
@@ -2709,7 +2710,7 @@ bool TTrain::Update()
|
|||||||
bDoors[i][2] = (p->dDoorMoveL > 0.001);
|
bDoors[i][2] = (p->dDoorMoveL > 0.001);
|
||||||
iDoorNo[i] = p->iAnimType[ANIM_DOORS];
|
iDoorNo[i] = p->iAnimType[ANIM_DOORS];
|
||||||
iUnits[i] = iUnitNo;
|
iUnits[i] = iUnitNo;
|
||||||
cCode[i] = p->MoverParameters->TypeName[p->MoverParameters->TypeName.Length()];
|
cCode[i] = p->MoverParameters->TypeName[p->MoverParameters->TypeName.length()];
|
||||||
asCarName[i] = p->GetName();
|
asCarName[i] = p->GetName();
|
||||||
bPants[iUnitNo - 1][0] = (bPants[iUnitNo - 1][0] || p->MoverParameters->PantFrontUp);
|
bPants[iUnitNo - 1][0] = (bPants[iUnitNo - 1][0] || p->MoverParameters->PantFrontUp);
|
||||||
bPants[iUnitNo - 1][1] = (bPants[iUnitNo - 1][1] || p->MoverParameters->PantRearUp);
|
bPants[iUnitNo - 1][1] = (bPants[iUnitNo - 1][1] || p->MoverParameters->PantRearUp);
|
||||||
@@ -5010,15 +5011,18 @@ bool TTrain::CabChange(int iDirection)
|
|||||||
bool TTrain::LoadMMediaFile(std::string asFileName)
|
bool TTrain::LoadMMediaFile(std::string asFileName)
|
||||||
{
|
{
|
||||||
double dSDist;
|
double dSDist;
|
||||||
TFileStream *fs;
|
std::ifstream t(asFileName.c_str());
|
||||||
fs = new TFileStream(asFileName, fmOpenRead | fmShareCompat);
|
std::stringstream buffer;
|
||||||
AnsiString str = "";
|
buffer << t.rdbuf();
|
||||||
|
//TFileStream *fs;
|
||||||
|
//fs = new TFileStream(asFileName, fmOpenRead | fmShareCompat);
|
||||||
|
AnsiString str = AnsiString(buffer.str().c_str());
|
||||||
// DecimalSeparator='.';
|
// DecimalSeparator='.';
|
||||||
int size = fs->Size;
|
//int size = fs->Size;
|
||||||
str.SetLength(size);
|
//str.SetLength(size);
|
||||||
fs->Read(str.c_str(), size);
|
//fs->Read(str.c_str(), size);
|
||||||
str += "";
|
//str += "";
|
||||||
delete fs;
|
//delete fs;
|
||||||
TQueryParserComp *Parser;
|
TQueryParserComp *Parser;
|
||||||
Parser = new TQueryParserComp(NULL);
|
Parser = new TQueryParserComp(NULL);
|
||||||
Parser->TextToParse = str;
|
Parser->TextToParse = str;
|
||||||
@@ -5302,15 +5306,18 @@ bool TTrain::InitializeCab(int NewCabNo, std::string asFileName)
|
|||||||
pyScreens.setLookupPath(DynamicObject->asBaseDir);
|
pyScreens.setLookupPath(DynamicObject->asBaseDir);
|
||||||
bool parse = false;
|
bool parse = false;
|
||||||
double dSDist;
|
double dSDist;
|
||||||
TFileStream *fs;
|
std::ifstream t(asFileName.c_str());
|
||||||
fs = new TFileStream(asFileName, fmOpenRead | fmShareCompat);
|
std::stringstream buffer;
|
||||||
AnsiString str = "";
|
buffer << t.rdbuf();
|
||||||
|
//TFileStream *fs;
|
||||||
|
//fs = new TFileStream(asFileName, fmOpenRead | fmShareCompat);
|
||||||
|
AnsiString str = AnsiString(buffer.str().c_str());
|
||||||
// DecimalSeparator='.';
|
// DecimalSeparator='.';
|
||||||
int size = fs->Size;
|
//int size = fs->Size;
|
||||||
str.SetLength(size);
|
//str.SetLength(size);
|
||||||
fs->Read(str.c_str(), size);
|
//fs->Read(str.c_str(), size);
|
||||||
str += "";
|
//str += "";
|
||||||
delete fs;
|
//delete fs;
|
||||||
TQueryParserComp *Parser;
|
TQueryParserComp *Parser;
|
||||||
Parser = new TQueryParserComp(NULL);
|
Parser = new TQueryParserComp(NULL);
|
||||||
Parser->TextToParse = str;
|
Parser->TextToParse = str;
|
||||||
@@ -5386,13 +5393,13 @@ bool TTrain::InitializeCab(int NewCabNo, std::string asFileName)
|
|||||||
str = Parser->GetNextSymbol().LowerCase();
|
str = Parser->GetNextSymbol().LowerCase();
|
||||||
if (str != AnsiString("none"))
|
if (str != AnsiString("none"))
|
||||||
{
|
{
|
||||||
str = DynamicObject->asBaseDir + str;
|
str = AnsiString(DynamicObject->asBaseDir.c_str()) + str;
|
||||||
Global::asCurrentTexturePath =
|
Global::asCurrentTexturePath =
|
||||||
DynamicObject->asBaseDir; // bie¿¹ca sciezka do tekstur to dynamic/...
|
DynamicObject->asBaseDir; // bie¿¹ca sciezka do tekstur to dynamic/...
|
||||||
TModel3d *k = TModelsManager::GetModel(
|
TModel3d *k = TModelsManager::GetModel(
|
||||||
str.c_str(), true); // szukaj kabinê jako oddzielny model
|
str.c_str(), true); // szukaj kabinê jako oddzielny model
|
||||||
Global::asCurrentTexturePath =
|
Global::asCurrentTexturePath =
|
||||||
AnsiString(szTexturePath); // z powrotem defaultowa sciezka do tekstur
|
szTexturePath; // z powrotem defaultowa sciezka do tekstur
|
||||||
// if (DynamicObject->mdKabina!=k)
|
// if (DynamicObject->mdKabina!=k)
|
||||||
if (k)
|
if (k)
|
||||||
DynamicObject->mdKabina = k; // nowa kabina
|
DynamicObject->mdKabina = k; // nowa kabina
|
||||||
|
|||||||
2
Train.h
2
Train.h
@@ -388,7 +388,7 @@ class TTrain
|
|||||||
int iUnits[20]; // numer jednostki
|
int iUnits[20]; // numer jednostki
|
||||||
int iDoorNo[20]; // liczba drzwi
|
int iDoorNo[20]; // liczba drzwi
|
||||||
char cCode[20]; //kod pojazdu
|
char cCode[20]; //kod pojazdu
|
||||||
AnsiString asCarName[20]; //nazwa czlonu
|
string asCarName[20]; //nazwa czlonu
|
||||||
bool bMains[8]; //WSy
|
bool bMains[8]; //WSy
|
||||||
float fCntVol[8]; //napiecie NN
|
float fCntVol[8]; //napiecie NN
|
||||||
bool bPants[8][2]; //podniesienie pantografow
|
bool bPants[8][2]; //podniesienie pantografow
|
||||||
|
|||||||
Reference in New Issue
Block a user