Download Software User Manual
Transcript
SUM
iss: 6 rev: 3
22.4.7
NLR-EFO-SUM-2
EuroSim::Conn module
This is the low-level module used to send and receive events (messages) from/to a running simulator. All
of these functions are used internally by the EuroSim::Session module.
To print a list of all events use print_event_list. This function prints a list of all events, their internal
event number and their arguments.
A complete overview of all functions provided by this module can be found in the manual page EuroSim::Conn(3).
22.5
Extending the batch utility
The batch utility is based on the Event module. This perl module provides a framework where you can
integrate various systems with each other. The client-server connection with the simulator sends packets
to its clients (such as the batch utility). These packets are handled by a callback (watcher in Event module
terminology). The Event module is used to perform the mapping between incoming data on a socket to
the central event dispatching function of the EuroSim::Session module. Also the wait functions are
implemented by using the timer watcher.
The interactive EuroSim shell is implemented using this module. The input is processed by the package
Term::ReadLine::Gnu. This package reads commands from stdin. The readline input function is hooked
into the Event framework using an io watcher. The EuroSim connection is handled by another Event::io
watcher. This enables the interactive shell to stay interactive. It reads simultaneously from the standard
input and from the EuroSim socket. This mechanism can be extended to your needs. For a complete
reference check out the Event(3) manual page.
22.6
Example
The following example is a complete script which performs one simulation run. Some event handlers are
installed as well as some monitors.
Batch script example
#!/usr/bin/perl
# This is an example perl script using the EuroSim bindings
# to automate a simulation run.
# Import all modules.
use EuroSim ’:all’;
use EuroSim::InitCond ’:all’;
use EuroSim::Session ’:all’;
use EuroSim::Link ’:all’;
use EuroSim::Conn ’:all’;
use EuroSim::MDL ’:all’;
# Load the simulation definition file.
$s = new EuroSim::Session("some.sim");
# Set to real-time.
$s->realtime(1);
# Define a callback to be called when standby state is reached.
sub cb_standby
{
my ($session, $event_name, $simtime_sec, $simtime_nsec,
$wallclock_sec, $wallclock_nsec) = @_;
print "going to standby at $wallclock_sec\n";
}
278
c Airbus Defence and Space
Related documents
Software User Manual
EuroSim Software User's Manual
EuroSim Mk4.0 Software User's Manual
CANopen Interface for SG5 and SG7
View/Open - of NLR Reports - National Aerospace Laboratory
EuroSim Mk4.0 Owner`s Manual
Owner`s Manual
Paper - EuroSim
Owner`s Manual
EuroSim Owner`s Manual
Owner`s Manual
EuroSim Software License Agreement Nr 5
EuroSim Manual Pages
DL_MULTI supplement
A CGV