| 575 | // a message is printed out when they go out of bounds |
| 576 | |
| 577 | void FGScript::Debug(int from) |
| 578 | { |
| 579 | if (debug_lvl <= 0) return; |
| 580 | |
| 581 | if (debug_lvl & 1) { // Standard console startup message output |
| 582 | if (from == 0) { // Constructor |
| 583 | } else if (from == 3) { |
| 584 | } else if (from == 4) { // print out script data |
| 585 | FGLogging log(LogLevel::DEBUG); |
| 586 | log << "\nScript: \"" << ScriptName << "\"\n" |
| 587 | << " begins at " << StartTime << " seconds and runs to " << EndTime |
| 588 | << " seconds with dt = " << setprecision(6) << FDMExec->GetDeltaT() |
| 589 | << " (" << ceil(1.0/FDMExec->GetDeltaT()) << " Hz)\n\n"; |
| 590 | |
| 591 | for (auto node: LocalProperties) { |
| 592 | log << "Local property: " << node->getNameString() |
| 593 | << " = " << node->getDoubleValue() << "\n"; |
| 594 | } |
| 595 | |
| 596 | if (LocalProperties.empty()) log << "\n"; |
| 597 | |
| 598 | auto pm = FDMExec->GetPropertyManager(); |
| 599 | const SGPropertyNode* root_node = pm->GetNode(); |
| 600 | const string root_name = GetFullyQualifiedName(root_node) + "/"; |
| 601 | |
| 602 | for (unsigned i=0; i<Events.size(); i++) { |
| 603 | log << "Event " << i; |
| 604 | if (!Events[i].Name.empty()) log << " (" << Events[i].Name << ")"; |
| 605 | log << ":\n"; |
| 606 | |
| 607 | if (Events[i].Persistent) |
| 608 | log << " " << "Whenever triggered, executes once"; |
| 609 | else if (Events[i].Continuous) |
| 610 | log << " " << "While true, always executes"; |
| 611 | else |
| 612 | log << " " << "When first triggered, executes once"; |
| 613 | |
| 614 | Events[i].Condition->PrintCondition(); |
| 615 | |
| 616 | log << "\n Actions taken"; |
| 617 | if (Events[i].Delay > 0.0) |
| 618 | log << " (after a delay of " << Events[i].Delay << " secs)"; |
| 619 | log << ":\n" << " {"; |
| 620 | for (unsigned j=0; j<Events[i].SetValue.size(); j++) { |
| 621 | if (Events[i].SetValue[j] == 0.0 && Events[i].Functions[j] != 0L) { |
| 622 | if (Events[i].SetParam[j] == 0) { |
| 623 | if (Events[i].SetParamName[j].empty()) { |
| 624 | LogException err; |
| 625 | err << " An attempt has been made to access a non-existent property\n" |
| 626 | << " in this event. Please check the property names used, spelling, etc.\n"; |
| 627 | throw err; |
| 628 | } else { |
| 629 | log << "\n set " << Events[i].SetParamName[j] |
| 630 | << " to function value (Late Bound)"; |
| 631 | } |
| 632 | } else { |
| 633 | log << "\n set " |
| 634 | << GetRelativeName(Events[i].SetParam[j], root_name) |
nothing calls this directly
no test coverage detected