mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 12:09:19 +02:00
Ask the cell itself whether its command is still pending, guard the order table
The spent command was tracked in a table flag, which is lost whenever the speed table is rebuilt - the cell would go back to being a stop point. The memcell already knows: StopCommandSent() drops the pending flag and keeps the text, so the event now answers is_command_spent() and the table point follows it. OrderNextGet() read one past the end of OrderList when the current order sat in the last slot; it now reports Wait_for_orders there, which is what OrderNext() wraps to anyway.
This commit is contained in:
@@ -415,6 +415,13 @@ basic_event::is_command() const {
|
||||
return false;
|
||||
};
|
||||
|
||||
// returns: true for a data cell whose command has already been delivered
|
||||
bool
|
||||
basic_event::is_command_spent() const {
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
std::string
|
||||
basic_event::input_text() const {
|
||||
// odczytanie komendy z eventu
|
||||
@@ -650,6 +657,13 @@ getvalues_event::is_command() const {
|
||||
return m_input.data_cell()->StopCommand();
|
||||
}
|
||||
|
||||
// returns: true for a data cell whose command has already been delivered
|
||||
bool
|
||||
getvalues_event::is_command_spent() const {
|
||||
// the cell keeps its text after the command was sent, only the pending flag is dropped
|
||||
return false == m_input.data_cell()->StopCommand();
|
||||
}
|
||||
|
||||
// input data access
|
||||
std::string
|
||||
getvalues_event::input_text() const {
|
||||
|
||||
Reference in New Issue
Block a user