File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -385,6 +385,12 @@ class VtdBinding : public cloe::Simulator {
385
385
// b) to catch any restart requests.
386
386
this ->readall_scp ();
387
387
388
+ // We were operational when starting and are no longer.
389
+ // VTD must have signalled that it was stopped.
390
+ if (!operational_) {
391
+ return sync .time () - sync .step_width ();
392
+ }
393
+
388
394
// Send items to TaskControl:
389
395
for (auto v : vehicles_) {
390
396
v->vtd_step_actuator (*scp_client_, config_.label_vehicle );
@@ -612,7 +618,14 @@ class VtdBinding : public cloe::Simulator {
612
618
}
613
619
}
614
620
615
- void apply_scp_stop (boost::property_tree::ptree&) { operational_ = false ; }
621
+ void apply_scp_stop (boost::property_tree::ptree&) {
622
+ // If SimCtrl.Stop is received and we are operational, then this has been
623
+ // sent externally. Update the state and exit.
624
+ if (operational_) {
625
+ logger ()->info (" Received stop signal from VTD." );
626
+ operational_ = false ;
627
+ }
628
+ }
616
629
617
630
void apply_scenario_filename (boost::property_tree::ptree& xml) {
618
631
auto scenario = xml.get <std::string>(" <xmlattr>.filename" , " none" );
You can’t perform that action at this time.
0 commit comments