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

radio channel selection tweak, minor bug fixes

This commit is contained in:
tmj-fstate
2020-07-26 13:49:25 +02:00
parent f80a41d3dd
commit 138b793f5a
12 changed files with 47 additions and 20 deletions

View File

@@ -730,7 +730,8 @@ putvalues_event::run_() {
m_input.data_value_2,
loc );
}
else if( m_activator->ctOwner ) {
else if( ( m_activator->ctOwner )
&& ( is_command_for_owner( m_input ) ) ) {
// send the command to consist owner,
// we're acting on presumption there's hardly ever need to issue command to unmanned vehicle
// and the intended recipient moved between vehicles after the event was queued
@@ -765,6 +766,17 @@ putvalues_event::export_as_text_( std::ostream &Output ) const {
<< m_input.data_value_2 << ' ';
}
//determines whether provided input should be passed to consist owner
bool
putvalues_event::is_command_for_owner( input_data const &Input ) const {
if( Input.data_text.rfind( "Load=", 0 ) == std::string::npos ) { return false; }
if( Input.data_text.rfind( "UnLoad=", 0 ) == std::string::npos ) { return false; }
// TBD, TODO: add other exceptions
return true;
}
// input data access
std::string
putvalues_event::input_text() const {