mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 15:09:19 +02:00
Merge branch 'milek-dev' into gfx-work
This commit is contained in:
12
Track.cpp
12
Track.cpp
@@ -106,13 +106,13 @@ TIsolated * TIsolated::Find(std::string const &n)
|
|||||||
return pRoot;
|
return pRoot;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool
|
void
|
||||||
TIsolated::AssignEvents() {
|
TIsolated::AssignEvents() {
|
||||||
|
|
||||||
evBusy = simulation::Events.FindEvent( asName + ":busy" );
|
evBusy = simulation::Events.FindEvent( asName + ":busy" );
|
||||||
evFree = simulation::Events.FindEvent( asName + ":free" );
|
evFree = simulation::Events.FindEvent( asName + ":free" );
|
||||||
|
evInc = simulation::Events.FindEvent( asName + ":inc" );
|
||||||
return ( evBusy != nullptr ) && ( evFree != nullptr );
|
evDec = simulation::Events.FindEvent( asName + ":dec" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void TIsolated::Modify(int i, TDynamicObject *o)
|
void TIsolated::Modify(int i, TDynamicObject *o)
|
||||||
@@ -144,6 +144,12 @@ void TIsolated::Modify(int i, TDynamicObject *o)
|
|||||||
pMemCell->UpdateValues( "", 0, int( pMemCell->Value2() ) | 1, basic_event::flags::value_2 ); // zmieniamy ostatnią wartość na nieparzystą
|
pMemCell->UpdateValues( "", 0, int( pMemCell->Value2() ) | 1, basic_event::flags::value_2 ); // zmieniamy ostatnią wartość na nieparzystą
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i > 0 && evInc)
|
||||||
|
simulation::Events.AddToQuery(evInc, o);
|
||||||
|
if (i < 0 && evDec)
|
||||||
|
simulation::Events.AddToQuery(evDec, o);
|
||||||
|
|
||||||
// pass the event to the parent
|
// pass the event to the parent
|
||||||
if( pParent != nullptr ) {
|
if( pParent != nullptr ) {
|
||||||
pParent->Modify( i, o );
|
pParent->Modify( i, o );
|
||||||
|
|||||||
4
Track.h
4
Track.h
@@ -105,7 +105,7 @@ public:
|
|||||||
// methods
|
// methods
|
||||||
static void DeleteAll();
|
static void DeleteAll();
|
||||||
static TIsolated * Find(const std::string &n); // znalezienie obiektu albo utworzenie nowego
|
static TIsolated * Find(const std::string &n); // znalezienie obiektu albo utworzenie nowego
|
||||||
bool AssignEvents();
|
void AssignEvents();
|
||||||
void Modify(int i, TDynamicObject *o); // dodanie lub odjęcie osi
|
void Modify(int i, TDynamicObject *o); // dodanie lub odjęcie osi
|
||||||
inline
|
inline
|
||||||
bool
|
bool
|
||||||
@@ -131,6 +131,8 @@ public:
|
|||||||
std::string asName; // nazwa obiektu, baza do nazw eventów
|
std::string asName; // nazwa obiektu, baza do nazw eventów
|
||||||
basic_event *evBusy { nullptr }; // zdarzenie wyzwalane po zajęciu grupy
|
basic_event *evBusy { nullptr }; // zdarzenie wyzwalane po zajęciu grupy
|
||||||
basic_event *evFree { nullptr }; // zdarzenie wyzwalane po całkowitym zwolnieniu zajętości grupy
|
basic_event *evFree { nullptr }; // zdarzenie wyzwalane po całkowitym zwolnieniu zajętości grupy
|
||||||
|
basic_event *evInc { nullptr }; // wyzwalane po wjeździe na grupę
|
||||||
|
basic_event *evDec { nullptr }; // wyzwalane po zjazdu z grupy
|
||||||
TMemCell *pMemCell { nullptr }; // automatyczna komórka pamięci, która współpracuje z odcinkiem izolowanym
|
TMemCell *pMemCell { nullptr }; // automatyczna komórka pamięci, która współpracuje z odcinkiem izolowanym
|
||||||
private:
|
private:
|
||||||
// members
|
// members
|
||||||
|
|||||||
Reference in New Issue
Block a user