Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Papyrus-RT/User/User Guide/Tips

< Papyrus-RT‎ | User‎ | User Guide
Revision as of 14:20, 31 July 2017 by Charles.zeligsoft.com (Talk | contribs) (Code generation, building, and running: Added flags tables)

PapyrusForRealTime-Logo-Icon.png




Tips & Tricks




Overview

This page contains usage tips and tricks for Papyrus for Real Time.

Modeling

Logging

You may know that Papyrus-RT provides a logging mechanism, the "Log" service, that can be used within your model to output information from you model. By default, this information is sent to the standard error output, e.g., "stderr." So to see the output of the log, you can simply run your application from the command line and look at the output, e.g.,

./MyApp

You can also redirect the output to a file:

./MyApp >& myAppLog.log

You can also turn this on programmatically, in cases where you can not change the command line, e.g., for an application running on an embedded platform or if you want to selectively log parts of the execution.

This is done by using the "redirect" method (message) on the port:

log.redirect("mylog.log"); (where ""mylog.log" is the name of the file where the log will be written.)

Note.png
Note
This will redirect logging, but only for that specific log port. Other log ports will not be affected.




Short Flag Long Flag Description
[-h] [--help] Print usage and exit
[-u] [--userargs] Marks the start of application options
[-l] or [--logmsg] Enable capsule logMsg output of injected signals
[-c <controllers-file>] [--controllers=<controllers-file>] Specify a capsule-to-controller map file

Debug Features

Short Flag Long Flag Description
[-D 0/1] [--debug=0/1] Overall debug log enable.
[-C 0/1] [--debugcolor=0/1] Disable/enable terminal text color escape sequences.
[-s] [--debugsummary] Output debug summary.
[-T <type>] [--debugtypeon=<type>] Enable debug types. See <type> below.
[-t <type>] [--debugtypeoff=<type>] Disable debug types. See <type> below.
[-M] [--debugmodel] Output instance UML-RT model after startup. (Usually also requires '-T model')

Enabling invidual log message components

Short Flag Long Flag Description
[-S 0/1] or [--debugtime=0/1] Disable/enable log time-stamp.
[-N 0/1] or [--debugname=0/1] Disable/enable log type name.
[-F 0/1] or [--debugfile=0/1] Disable/enable log file-name.
[-L 0/1] or [--debugline=0/1] Disable/enable log file line #.
[-n 0/1] or [--debugthread=0/1] Disable/enable log thread name (or id).
[-r 0/1] or [--debugmethod=0/1] Disable/enable log method name.
[-m 0/1] or [--debugmsg=0/1] Disable/enable log application message.

Types

<type> is a string that matches (case-insensitive) one of the following debug-types:

BIND BINDDEBUG BINDFAIL COMMAND
CONNECT CONTROLLER CONTROLLERMAP DESTROY
ERROR HASHMAP IMPORT INJECT
INSTANTIATE LOCK LOGMSG MAIN
MODEL MSG MSGALLOC PARAMETER
SAP SEND SERIALIZE SIGNAL
SIGNALDATA SIGNALREF SIGNALINIT SIGNALALLOC
SWERR TIMER TIMERALLOC

Back to the top