mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 18:39:18 +02:00
maintenance: event code refactoring, removed deprecated event code
This commit is contained in:
53
DynObj.cpp
53
DynObj.cpp
@@ -2234,11 +2234,11 @@ TDynamicObject::Init(std::string Name, // nazwa pojazdu, np. "EU07-424"
|
|||||||
// zrobiło tego
|
// zrobiło tego
|
||||||
Move( 0.0001 );
|
Move( 0.0001 );
|
||||||
ABuCheckMyTrack(); // zmiana toru na ten, co oś Axle0 (oś z przodu)
|
ABuCheckMyTrack(); // zmiana toru na ten, co oś Axle0 (oś z przodu)
|
||||||
TLocation loc; // Ra: ustawienie pozycji do obliczania sprzęgów
|
// Ra: ustawienie pozycji do obliczania sprzęgów
|
||||||
loc.X = -vPosition.x;
|
MoverParameters->Loc = {
|
||||||
loc.Y = vPosition.z;
|
-vPosition.x,
|
||||||
loc.Z = vPosition.y;
|
vPosition.z,
|
||||||
MoverParameters->Loc = loc; // normalnie przesuwa ComputeMovement() w Update()
|
vPosition.y }; // normalnie przesuwa ComputeMovement() w Update()
|
||||||
// ABuWozki 060504
|
// ABuWozki 060504
|
||||||
if (mdModel) // jeśli ma w czym szukać
|
if (mdModel) // jeśli ma w czym szukać
|
||||||
{
|
{
|
||||||
@@ -2807,20 +2807,7 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
return false; // a normalnie powinny mieć bEnabled==false
|
return false; // a normalnie powinny mieć bEnabled==false
|
||||||
|
|
||||||
double dDOMoveLen;
|
double dDOMoveLen;
|
||||||
|
|
||||||
TLocation l;
|
|
||||||
l.X = -vPosition.x; // przekazanie pozycji do fizyki
|
|
||||||
l.Y = vPosition.z;
|
|
||||||
l.Z = vPosition.y;
|
|
||||||
TRotation r;
|
|
||||||
r.Rx = r.Ry = r.Rz = 0;
|
|
||||||
// McZapkie: parametry powinny byc pobierane z toru
|
// McZapkie: parametry powinny byc pobierane z toru
|
||||||
|
|
||||||
// TTrackShape ts;
|
|
||||||
// ts.R=MyTrack->fRadius;
|
|
||||||
// if (ABuGetDirection()<0) ts.R=-ts.R;
|
|
||||||
// ts.R=MyTrack->fRadius; //ujemne promienie są już zamienione przy
|
|
||||||
// wczytywaniu
|
|
||||||
if (Axle0.vAngles.z != Axle1.vAngles.z)
|
if (Axle0.vAngles.z != Axle1.vAngles.z)
|
||||||
{ // wyliczenie promienia z obrotów osi - modyfikację zgłosił youBy
|
{ // wyliczenie promienia z obrotów osi - modyfikację zgłosił youBy
|
||||||
ts.R = Axle0.vAngles.z - Axle1.vAngles.z; // różnica może dawać stałą ±M_2PI
|
ts.R = Axle0.vAngles.z - Axle1.vAngles.z; // różnica może dawać stałą ±M_2PI
|
||||||
@@ -3232,16 +3219,15 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fragment "z EXE Kursa"
|
// fragment "z EXE Kursa"
|
||||||
if (MoverParameters->Mains) // nie wchodzić w funkcję bez potrzeby
|
if( MoverParameters->Mains ) { // nie wchodzić w funkcję bez potrzeby
|
||||||
if ( ( false == MoverParameters->Battery )
|
if( ( false == MoverParameters->Battery )
|
||||||
&& ( false == MoverParameters->ConverterFlag ) // added alternative power source. TODO: more generic power check
|
&& ( false == MoverParameters->ConverterFlag ) // added alternative power source. TODO: more generic power check
|
||||||
/*
|
/*
|
||||||
// NOTE: disabled on account of multi-unit setups, where the unmanned unit wouldn't be affected
|
// NOTE: disabled on account of multi-unit setups, where the unmanned unit wouldn't be affected
|
||||||
&& ( Controller == Humandriver )
|
&& ( Controller == Humandriver )
|
||||||
*/
|
*/
|
||||||
&& ( MoverParameters->EngineType != TEngineType::DieselEngine )
|
&& ( MoverParameters->EngineType != TEngineType::DieselEngine )
|
||||||
&& ( MoverParameters->EngineType != TEngineType::WheelsDriven ) )
|
&& ( MoverParameters->EngineType != TEngineType::WheelsDriven ) ) { // jeśli bateria wyłączona, a nie diesel ani drezyna reczna
|
||||||
{ // jeśli bateria wyłączona, a nie diesel ani drezyna reczna
|
|
||||||
if( MoverParameters->MainSwitch( false, ( MoverParameters->TrainType == dt_EZT ? range_t::unit : range_t::local ) ) ) {
|
if( MoverParameters->MainSwitch( false, ( MoverParameters->TrainType == dt_EZT ? range_t::unit : range_t::local ) ) ) {
|
||||||
// wyłączyć zasilanie
|
// wyłączyć zasilanie
|
||||||
// NOTE: we turn off entire EMU, but only the affected unit for other multi-unit consists
|
// NOTE: we turn off entire EMU, but only the affected unit for other multi-unit consists
|
||||||
@@ -3256,7 +3242,16 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// przekazanie pozycji do fizyki
|
||||||
|
// NOTE: coordinate system swap
|
||||||
|
// TODO: replace with regular glm vectors
|
||||||
|
TLocation const l {
|
||||||
|
-vPosition.x,
|
||||||
|
vPosition.z,
|
||||||
|
vPosition.y };
|
||||||
|
TRotation r { 0.0, 0.0, 0.0 };
|
||||||
// McZapkie-260202 - dMoveLen przyda sie przy stukocie kol
|
// McZapkie-260202 - dMoveLen przyda sie przy stukocie kol
|
||||||
dDOMoveLen = GetdMoveLen() + MoverParameters->ComputeMovement(dt, dt1, ts, tp, tmpTraction, l, r);
|
dDOMoveLen = GetdMoveLen() + MoverParameters->ComputeMovement(dt, dt1, ts, tp, tmpTraction, l, r);
|
||||||
if( Mechanik )
|
if( Mechanik )
|
||||||
@@ -3859,13 +3854,13 @@ bool TDynamicObject::FastUpdate(double dt)
|
|||||||
if (!bEnabled)
|
if (!bEnabled)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TLocation l;
|
// NOTE: coordinate system swap
|
||||||
l.X = -vPosition.x;
|
// TODO: replace with regular glm vectors
|
||||||
l.Y = vPosition.z;
|
TLocation const l {
|
||||||
l.Z = vPosition.y;
|
-vPosition.x,
|
||||||
TRotation r;
|
vPosition.z,
|
||||||
r.Rx = r.Ry = r.Rz = 0.0;
|
vPosition.y };
|
||||||
|
TRotation r { 0.0, 0.0, 0.0 };
|
||||||
// McZapkie: parametry powinny byc pobierane z toru
|
// McZapkie: parametry powinny byc pobierane z toru
|
||||||
// ts.R=MyTrack->fRadius;
|
// ts.R=MyTrack->fRadius;
|
||||||
// ts.Len= Max0R(MoverParameters->BDist,MoverParameters->ADist);
|
// ts.Len= Max0R(MoverParameters->BDist,MoverParameters->ADist);
|
||||||
|
|||||||
282
Event.h
282
Event.h
@@ -14,200 +14,6 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
#include "names.h"
|
#include "names.h"
|
||||||
#include "evlaunch.h"
|
#include "evlaunch.h"
|
||||||
|
|
||||||
//#define EU07_USE_LEGACY_EVENTS
|
|
||||||
|
|
||||||
#ifdef EU07_USE_LEGACY_EVENTS
|
|
||||||
enum TEventType {
|
|
||||||
tp_Unknown,
|
|
||||||
tp_Sound,
|
|
||||||
tp_Exit,
|
|
||||||
tp_Disable,
|
|
||||||
tp_Velocity,
|
|
||||||
tp_Animation,
|
|
||||||
tp_Lights,
|
|
||||||
tp_UpdateValues,
|
|
||||||
tp_GetValues,
|
|
||||||
tp_PutValues,
|
|
||||||
tp_Switch,
|
|
||||||
tp_DynVel,
|
|
||||||
tp_TrackVel,
|
|
||||||
tp_Multiple,
|
|
||||||
tp_AddValues,
|
|
||||||
tp_CopyValues,
|
|
||||||
tp_WhoIs,
|
|
||||||
tp_LogValues,
|
|
||||||
tp_Visible,
|
|
||||||
tp_Voltage,
|
|
||||||
tp_Message,
|
|
||||||
tp_Friction
|
|
||||||
};
|
|
||||||
|
|
||||||
const int update_memstring = 0x0000001; // zmodyfikować tekst (UpdateValues)
|
|
||||||
const int update_memval1 = 0x0000002; // zmodyfikować pierwszą wartosć
|
|
||||||
const int update_memval2 = 0x0000004; // zmodyfikować drugą wartosć
|
|
||||||
const int update_memadd = 0x0000008; // dodać do poprzedniej zawartości
|
|
||||||
const int update_load = 0x0000010; // odczytać ładunek
|
|
||||||
const int update_only = 0x00000FF; // wartość graniczna
|
|
||||||
const int conditional_memstring = 0x0000100; // porównanie tekstu
|
|
||||||
const int conditional_memval1 = 0x0000200; // porównanie pierwszej wartości liczbowej
|
|
||||||
const int conditional_memval2 = 0x0000400; // porównanie drugiej wartości
|
|
||||||
const int conditional_trackoccupied = 0x1000000; // jeśli tor zajęty
|
|
||||||
const int conditional_trackfree = 0x2000000; // jeśli tor wolny
|
|
||||||
const int conditional_propability = 0x4000000; // zależnie od generatora lizcb losowych
|
|
||||||
const int conditional_memcompare = 0x8000000; // porównanie zawartości
|
|
||||||
|
|
||||||
union TParam
|
|
||||||
{
|
|
||||||
void *asPointer;
|
|
||||||
TMemCell *asMemCell;
|
|
||||||
scene::basic_node *asSceneNode;
|
|
||||||
glm::dvec3 const *asLocation;
|
|
||||||
TTrack *asTrack;
|
|
||||||
TAnimModel *asModel;
|
|
||||||
TAnimContainer *asAnimContainer;
|
|
||||||
TTrain *asTrain;
|
|
||||||
TDynamicObject *asDynamic;
|
|
||||||
TEvent *asEvent;
|
|
||||||
double asdouble;
|
|
||||||
int asInt;
|
|
||||||
sound_source *tsTextSound;
|
|
||||||
char *asText;
|
|
||||||
TCommandType asCommand;
|
|
||||||
TTractionPowerSource *psPower;
|
|
||||||
};
|
|
||||||
|
|
||||||
class TEvent // zmienne: ev*
|
|
||||||
{ // zdarzenie
|
|
||||||
public:
|
|
||||||
// types
|
|
||||||
// wrapper for binding between editor-supplied name, event, and execution conditional flag
|
|
||||||
using conditional_event = std::tuple<std::string, TEvent *, bool>;
|
|
||||||
// constructors
|
|
||||||
TEvent(std::string const &m = "");
|
|
||||||
~TEvent();
|
|
||||||
// metody
|
|
||||||
void Load(cParser *parser, Math3D::vector3 const &org);
|
|
||||||
// sends basic content of the class in legacy (text) format to provided stream
|
|
||||||
void
|
|
||||||
export_as_text( std::ostream &Output ) const;
|
|
||||||
static void AddToQuery( TEvent *Event, TEvent *&Start );
|
|
||||||
std::string CommandGet();
|
|
||||||
TCommandType Command();
|
|
||||||
double ValueGet(int n);
|
|
||||||
glm::dvec3 PositionGet() const;
|
|
||||||
bool StopCommand();
|
|
||||||
void StopCommandSent();
|
|
||||||
void Append(TEvent *e);
|
|
||||||
void
|
|
||||||
group( scene::group_handle Group );
|
|
||||||
scene::group_handle
|
|
||||||
group() const;
|
|
||||||
// members
|
|
||||||
std::string asName;
|
|
||||||
bool m_ignored { false }; // replacement for tp_ignored
|
|
||||||
bool bEnabled = false; // false gdy ma nie być dodawany do kolejki (skanowanie sygnałów)
|
|
||||||
int iQueued = 0; // ile razy dodany do kolejki
|
|
||||||
TEvent *evNext = nullptr; // następny w kolejce
|
|
||||||
TEventType Type = tp_Unknown;
|
|
||||||
double fStartTime = 0.0;
|
|
||||||
double fDelay = 0.0;
|
|
||||||
TDynamicObject const *Activator = nullptr;
|
|
||||||
TParam Params[13]; // McZapkie-070502 //Ra: zamienić to na union/struct
|
|
||||||
unsigned int iFlags = 0; // zamiast Params[8] z flagami warunku
|
|
||||||
std::string asNodeName; // McZapkie-100302 - dodalem zeby zapamietac nazwe toru
|
|
||||||
TEvent *evJoined = nullptr; // kolejny event z tą samą nazwą - od wersji 378
|
|
||||||
double fRandomDelay = 0.0; // zakres dodatkowego opóźnienia // standardowo nie będzie dodatkowego losowego opóźnienia
|
|
||||||
std::vector<conditional_event> m_children; // events which are placed in the query when this event is executed
|
|
||||||
bool m_conditionalelse { false }; // TODO: make a part of condition struct
|
|
||||||
|
|
||||||
private:
|
|
||||||
// methods
|
|
||||||
void Conditions( cParser *parser, std::string s );
|
|
||||||
// members
|
|
||||||
scene::group_handle m_group { null_handle }; // group this event belongs to, if any
|
|
||||||
};
|
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
|
||||||
TEvent::group( scene::group_handle Group ) {
|
|
||||||
m_group = Group;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline
|
|
||||||
scene::group_handle
|
|
||||||
TEvent::group() const {
|
|
||||||
return m_group;
|
|
||||||
}
|
|
||||||
|
|
||||||
class event_manager {
|
|
||||||
|
|
||||||
public:
|
|
||||||
// constructors
|
|
||||||
event_manager() = default;
|
|
||||||
// destructor
|
|
||||||
~event_manager();
|
|
||||||
// methods
|
|
||||||
// adds specified event launcher to the list of global launchers
|
|
||||||
void
|
|
||||||
queue( TEventLauncher *Launcher );
|
|
||||||
// legacy method, updates event queues
|
|
||||||
void
|
|
||||||
update();
|
|
||||||
// adds provided event to the collection. returns: true on success
|
|
||||||
// TBD, TODO: return handle to the event
|
|
||||||
bool
|
|
||||||
insert( TEvent *Event );
|
|
||||||
bool
|
|
||||||
insert( TEventLauncher *Launcher ) {
|
|
||||||
return m_launchers.insert( Launcher ); }
|
|
||||||
// returns first event in the queue
|
|
||||||
TEvent *
|
|
||||||
begin() {
|
|
||||||
return QueryRootEvent; }
|
|
||||||
// legacy method, returns pointer to specified event, or null
|
|
||||||
TEvent *
|
|
||||||
FindEvent( std::string const &Name );
|
|
||||||
// legacy method, inserts specified event in the event query
|
|
||||||
bool
|
|
||||||
AddToQuery( TEvent *Event, TDynamicObject const *Owner );
|
|
||||||
// legacy method, executes queued events
|
|
||||||
bool
|
|
||||||
CheckQuery();
|
|
||||||
// legacy method, initializes events after deserialization from scenario file
|
|
||||||
void
|
|
||||||
InitEvents();
|
|
||||||
// legacy method, initializes event launchers after deserialization from scenario file
|
|
||||||
void
|
|
||||||
InitLaunchers();
|
|
||||||
// sends basic content of the class in legacy (text) format to provided stream
|
|
||||||
void
|
|
||||||
export_as_text( std::ostream &Output ) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
// types
|
|
||||||
using event_sequence = std::deque<TEvent *>;
|
|
||||||
using event_map = std::unordered_map<std::string, std::size_t>;
|
|
||||||
using eventlauncher_sequence = std::vector<TEventLauncher *>;
|
|
||||||
|
|
||||||
// methods
|
|
||||||
// legacy method, verifies condition for specified event
|
|
||||||
bool
|
|
||||||
EventConditon( TEvent *Event );
|
|
||||||
|
|
||||||
// members
|
|
||||||
event_sequence m_events;
|
|
||||||
/*
|
|
||||||
// NOTE: disabled until event class refactoring
|
|
||||||
event_sequence m_eventqueue;
|
|
||||||
*/
|
|
||||||
// legacy version of the above
|
|
||||||
TEvent *QueryRootEvent { nullptr };
|
|
||||||
TEvent *m_workevent { nullptr };
|
|
||||||
event_map m_eventmap;
|
|
||||||
basic_table<TEventLauncher> m_launchers;
|
|
||||||
eventlauncher_sequence m_launcherqueue;
|
|
||||||
};
|
|
||||||
#else
|
|
||||||
enum TEventType {
|
enum TEventType {
|
||||||
tp_Unknown,
|
tp_Unknown,
|
||||||
tp_Sound,
|
tp_Sound,
|
||||||
@@ -240,30 +46,26 @@ const int conditional_memval2 = 0x0000400; // porównanie drugiej wartości
|
|||||||
const int conditional_trackoccupied = 0x1000000; // jeśli tor zajęty
|
const int conditional_trackoccupied = 0x1000000; // jeśli tor zajęty
|
||||||
const int conditional_trackfree = 0x2000000; // jeśli tor wolny
|
const int conditional_trackfree = 0x2000000; // jeśli tor wolny
|
||||||
const int conditional_propability = 0x4000000; // zależnie od generatora lizcb losowych
|
const int conditional_propability = 0x4000000; // zależnie od generatora lizcb losowych
|
||||||
const int conditional_memcompare = 0x8000000; // porównanie zawartości
|
|
||||||
|
|
||||||
// zdarzenie
|
// zdarzenie
|
||||||
class TEvent {
|
class TEvent {
|
||||||
|
|
||||||
friend event_manager;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// types
|
|
||||||
// wrapper for binding between editor-supplied name, event, and execution conditional flag
|
|
||||||
using conditional_event = std::tuple<std::string, TEvent *, bool>;
|
|
||||||
using basic_node = std::tuple<std::string, scene::basic_node *>;
|
|
||||||
using basic_sound = std::tuple<std::string, sound_source *>;
|
|
||||||
// constructors
|
// constructors
|
||||||
TEvent();
|
TEvent() = default;
|
||||||
|
// destructor
|
||||||
~TEvent();
|
~TEvent();
|
||||||
// metody
|
// metody
|
||||||
void Load(cParser *parser, Math3D::vector3 const &org);
|
void Load(cParser *parser, Math3D::vector3 const &org);
|
||||||
// sends basic content of the class in legacy (text) format to provided stream
|
// prepares event for use
|
||||||
template <class TableType_>
|
|
||||||
void
|
void
|
||||||
init_targets( TableType_ &Repository, std::string const &Targettype, bool const Logerrors = true );
|
init();
|
||||||
|
// legacy method, verifies event condition
|
||||||
|
bool
|
||||||
|
test_condition() const;
|
||||||
|
// executes event
|
||||||
void
|
void
|
||||||
init_conditions();
|
run();
|
||||||
void
|
void
|
||||||
export_as_text( std::ostream &Output ) const;
|
export_as_text( std::ostream &Output ) const;
|
||||||
static void AddToQuery( TEvent *Event, TEvent *&Start );
|
static void AddToQuery( TEvent *Event, TEvent *&Start );
|
||||||
@@ -290,29 +92,14 @@ public:
|
|||||||
double fDelay = 0.0;
|
double fDelay = 0.0;
|
||||||
double fRandomDelay = 0.0; // zakres dodatkowego opóźnienia // standardowo nie będzie dodatkowego losowego opóźnienia
|
double fRandomDelay = 0.0; // zakres dodatkowego opóźnienia // standardowo nie będzie dodatkowego losowego opóźnienia
|
||||||
TEvent *evJoined = nullptr; // kolejny event z tą samą nazwą - od wersji 378
|
TEvent *evJoined = nullptr; // kolejny event z tą samą nazwą - od wersji 378
|
||||||
std::vector<basic_node> m_targets; // targets of operation performed when this event is executed
|
|
||||||
std::vector<conditional_event> m_children; // events which are placed in the query when this event is executed
|
|
||||||
std::vector<float> m_lights; // for tp_lights
|
|
||||||
bool m_visible { true }; // for tp_visible
|
|
||||||
double m_velocity { 0.0 }; // for tp_trackvel
|
|
||||||
std::vector<basic_sound> m_sounds; // for tp_sound
|
|
||||||
int m_soundmode{ 0 };
|
|
||||||
int m_soundradiochannel{ 0 };
|
|
||||||
int m_animationtype{ 0 }; // for tp_animation
|
|
||||||
std::array<double, 4> m_animationparams{ 0.0 };
|
|
||||||
std::string m_animationsubmodel;
|
|
||||||
std::vector<TAnimContainer *> m_animationcontainers;
|
|
||||||
std::string m_animationfilename;
|
|
||||||
std::size_t m_animationfilesize{ 0 };
|
|
||||||
char *m_animationfiledata{ nullptr };
|
|
||||||
int m_switchstate{ 0 }; // for tp_switch
|
|
||||||
float m_switchmoverate{ -1.f };
|
|
||||||
float m_switchmovedelay{ -1.f };
|
|
||||||
float m_friction { -1.f }; // for tp_friction
|
|
||||||
float m_voltage{ -1.f }; // for tp_voltage
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// types
|
// types
|
||||||
|
// wrapper for binding between editor-supplied name, event, and execution conditional flag
|
||||||
|
using conditional_event = std::tuple<std::string, TEvent *, bool>;
|
||||||
|
using basic_node = std::tuple<std::string, scene::basic_node *>;
|
||||||
|
using basic_sound = std::tuple<std::string, sound_source *>;
|
||||||
|
|
||||||
struct update_data {
|
struct update_data {
|
||||||
unsigned int flags { 0 };
|
unsigned int flags { 0 };
|
||||||
std::string data_text;
|
std::string data_text;
|
||||||
@@ -337,12 +124,41 @@ private:
|
|||||||
void load( cParser &Input );
|
void load( cParser &Input );
|
||||||
};
|
};
|
||||||
// methods
|
// methods
|
||||||
void load_targets( std::string const &Input );
|
void
|
||||||
std::string type_to_string() const;
|
load_targets( std::string const &Input );
|
||||||
|
// sends basic content of the class in legacy (text) format to provided stream
|
||||||
|
template <class TableType_>
|
||||||
|
void
|
||||||
|
init_targets( TableType_ &Repository, std::string const &Targettype, bool const Logerrors = true );
|
||||||
|
void
|
||||||
|
init_conditions();
|
||||||
|
std::string
|
||||||
|
type_to_string() const;
|
||||||
// members
|
// members
|
||||||
scene::group_handle m_group { null_handle }; // group this event belongs to, if any
|
scene::group_handle m_group { null_handle }; // group this event belongs to, if any
|
||||||
update_data m_update;
|
update_data m_update;
|
||||||
condition_data m_condition;
|
condition_data m_condition;
|
||||||
|
std::vector<basic_node> m_targets; // targets of operation performed when this event is executed
|
||||||
|
std::vector<conditional_event> m_children; // events which are placed in the query when this event is executed
|
||||||
|
// specialized fields
|
||||||
|
std::vector<float> m_lights; // for tp_lights
|
||||||
|
bool m_visible { true }; // for tp_visible
|
||||||
|
double m_velocity { 0.0 }; // for tp_trackvel
|
||||||
|
std::vector<basic_sound> m_sounds; // for tp_sound
|
||||||
|
int m_soundmode{ 0 };
|
||||||
|
int m_soundradiochannel{ 0 };
|
||||||
|
int m_animationtype{ 0 }; // for tp_animation
|
||||||
|
std::array<double, 4> m_animationparams{ 0.0 };
|
||||||
|
std::string m_animationsubmodel;
|
||||||
|
std::vector<TAnimContainer *> m_animationcontainers;
|
||||||
|
std::string m_animationfilename;
|
||||||
|
std::size_t m_animationfilesize{ 0 };
|
||||||
|
char *m_animationfiledata{ nullptr };
|
||||||
|
int m_switchstate{ 0 }; // for tp_switch
|
||||||
|
float m_switchmoverate{ -1.f };
|
||||||
|
float m_switchmovedelay{ -1.f };
|
||||||
|
float m_friction { -1.f }; // for tp_friction
|
||||||
|
float m_voltage{ -1.f }; // for tp_voltage
|
||||||
};
|
};
|
||||||
|
|
||||||
inline
|
inline
|
||||||
@@ -422,12 +238,6 @@ private:
|
|||||||
using event_sequence = std::deque<TEvent *>;
|
using event_sequence = std::deque<TEvent *>;
|
||||||
using event_map = std::unordered_map<std::string, std::size_t>;
|
using event_map = std::unordered_map<std::string, std::size_t>;
|
||||||
using eventlauncher_sequence = std::vector<TEventLauncher *>;
|
using eventlauncher_sequence = std::vector<TEventLauncher *>;
|
||||||
|
|
||||||
// methods
|
|
||||||
// legacy method, verifies condition for specified event
|
|
||||||
bool
|
|
||||||
EventConditon( TEvent *Event );
|
|
||||||
|
|
||||||
// members
|
// members
|
||||||
event_sequence m_events;
|
event_sequence m_events;
|
||||||
/*
|
/*
|
||||||
@@ -441,5 +251,5 @@ private:
|
|||||||
basic_table<TEventLauncher> m_launchers;
|
basic_table<TEventLauncher> m_launchers;
|
||||||
eventlauncher_sequence m_launcherqueue;
|
eventlauncher_sequence m_launcherqueue;
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -294,16 +294,16 @@ enum TProblem // lista problemów taboru, które uniemożliwiają jazdę
|
|||||||
/*lokacja*/
|
/*lokacja*/
|
||||||
struct TLocation
|
struct TLocation
|
||||||
{
|
{
|
||||||
double X = 0.0;
|
double X;
|
||||||
double Y = 0.0;
|
double Y;
|
||||||
double Z = 0.0;
|
double Z;
|
||||||
};
|
};
|
||||||
/*rotacja*/
|
/*rotacja*/
|
||||||
struct TRotation
|
struct TRotation
|
||||||
{
|
{
|
||||||
double Rx = 0.0;
|
double Rx;
|
||||||
double Ry = 0.0;
|
double Ry;
|
||||||
double Rz = 0.0;
|
double Rz;
|
||||||
};
|
};
|
||||||
/*wymiary*/
|
/*wymiary*/
|
||||||
struct TDimension
|
struct TDimension
|
||||||
@@ -965,8 +965,8 @@ public:
|
|||||||
double SpeedCtrlDelay = 2; /*opoznienie dzialania tempomatu z wybieralna predkoscia*/
|
double SpeedCtrlDelay = 2; /*opoznienie dzialania tempomatu z wybieralna predkoscia*/
|
||||||
/*--sekcja zmiennych*/
|
/*--sekcja zmiennych*/
|
||||||
/*--opis konkretnego egzemplarza taboru*/
|
/*--opis konkretnego egzemplarza taboru*/
|
||||||
TLocation Loc; //pozycja pojazdów do wyznaczenia odległości pomiędzy sprzęgami
|
TLocation Loc { 0.0, 0.0, 0.0 }; //pozycja pojazdów do wyznaczenia odległości pomiędzy sprzęgami
|
||||||
TRotation Rot;
|
TRotation Rot { 0.0, 0.0, 0.0 };
|
||||||
std::string Name; /*nazwa wlasna*/
|
std::string Name; /*nazwa wlasna*/
|
||||||
TCoupling Couplers[2]; //urzadzenia zderzno-sprzegowe, polaczenia miedzy wagonami
|
TCoupling Couplers[2]; //urzadzenia zderzno-sprzegowe, polaczenia miedzy wagonami
|
||||||
#ifdef EU07_USE_OLD_HVCOUPLERS
|
#ifdef EU07_USE_OLD_HVCOUPLERS
|
||||||
|
|||||||
@@ -1255,6 +1255,7 @@ double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShap
|
|||||||
OffsetTrackH = Sign(RunningShape.R) * 0.2;
|
OffsetTrackH = Sign(RunningShape.R) * 0.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: investigate, seems supplied NewRot is always 0 although the code here suggests some actual values are expected
|
||||||
Loc = NewLoc;
|
Loc = NewLoc;
|
||||||
Rot = NewRot;
|
Rot = NewRot;
|
||||||
NewRot.Rx = 0;
|
NewRot.Rx = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user