Add Horizonal Navigation bars (breadcrumbs) to all documentation pages (#1328)

* Add breadcrumbs to all documentation pages, fix some links between pages
This commit is contained in:
Jacqueline Deans 2022-08-05 17:05:10 -05:00 committed by GitHub
parent 3e54516abb
commit 279d131a0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
60 changed files with 255 additions and 81 deletions

View File

@ -51,14 +51,14 @@ The user guide contains information pertinent to Trick users. These pages will h
01. [Standard Template Library Checkpointing](simulation_capabilities/STL-Checkpointing)
01. [Threads](simulation_capabilities/Threads)
01. Web Server
01. [Adding a Web Server to Your Sim](web/Adding_a_Web_Server_to_Your_Sim)
01. Web Server APIs
01. [HTTP-API_alloc_info](web/HTTP-API_alloc_info)
01. [WS-API_VariableServer](web/WS-API_VariableServer)
01. Adding New Web Server APIs
01. [Extending_the_HTTP-API](web/Extending_the_HTTP-API)
01. [Extending_the_WS-API](web/Extending_the_WS-API)
01. [Web Server](web/Webserver)
01. [Configure Trick with Civetweb](web/Configure-Civetweb)
01. [Add SSL encryption to your webserver](web/SSL)
01. [Web Server APIs](web/Webserver-apis)
01. [HTTP alloc API](web/http-alloc-api.md)
01. [WS Variable Server API](web/ws-variable-server-api.md)
01. [Extend the HTTP API](web/Extend-http-api.md)
01. [Extend the WS API](web/Extend-ws-api.md)
01. [Simulation Utilities](simulation_utilities/Simulation-Utilities)
01. [Trickcomm](simulation_utilities/Trickcomm)

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → Building a Simulation |
|------------------------------------------------------------------|
The building blocks of a basic Trick simulation are C/C++ structures/classes (models), a Python input file and a Trick simulation definition file (S_define). The S_define contains simulation objects which offer a way to turn the C/C++ function/methods into simulation jobs. Trick generates the necessary Python glue code which makes the C/C++ structures/classes accessible by the Python input file. The input file configures the simulation and is a command-line argument to the simulation executable.
... to be continued ...

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Building a Simulation](Building-a-Simulation) → Environment Variables |
|------------------------------------------------------------------|
Trick uses a list of variables for building sims e.g. TRICK_CFLAGS and TRICK_CXXFLAGS. Each variable has a default value that may be overridden by setting the value in the environment. Trick resolves these variables by a call to a function called "trick-gte". Type in "${TRICK_HOME}/bin/trick-gte" on the command line to see what the "Trick environment" is.
### Adding ${TRICK_HOME}/bin to PATH

View File

@ -1,3 +1,7 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Building a Simulation](Building-a-Simulation) → Making the Simulation |
|------------------------------------------------------------------|
### Simulation Compilation Environment Variables
The -Ipaths in TRICK_CFLAGS and TRICK_CXXFLAGS tell Trick where to find model source files. The flags also can contain compiler settings, for instance the -g flag is used for compiling in debug mode. See section Trick_Environment for more detail and information on variables for linking in external libraries, setting the compiler etc.

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Building a Simulation](Building-a-Simulation) → Model Source Code |
|------------------------------------------------------------------|
This section details the syntax for creating headers and source code that Trick can process.
It also details the operation of the Trick Interface Code Generator (ICG) that processes headers, and the Module Interface Specification Processor (MIS) that processes source code.

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Building a Simulation](Building-a-Simulation) → Simulation Definition File |
|------------------------------------------------------------------|
The Simulation Definition File or S_define is the file which lays out the architecture
of the simulation. Details about job frequencies, job class, job data, importing/exporting
data to other simulations, freeze cycles, integration, etc. are all housed in this one file.

View File

@ -1,3 +1,7 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Building a Simulation](Building-a-Simulation) → Trickified Project Libraries |
|------------------------------------------------------------------|
During a simulation build, Trick generates several rounds of files to support data recording, checkpointing, and Python access:
* Trick generates `S_source.hh` from the `S_define`

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Data Products](Data-Products) → DP Product File Format |
|------------------------------------------------------------------|
Since Trick 10, the DP Product Specification File Format is changed to XML. The DP Product XML file
DTD is defined as following:

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Data Products](Data-Products) → DP Session File Format |
|------------------------------------------------------------------|
Since Trick 10, the DP Session file is changed to XML format. The Session XML Document
Type Definitions(DTD) is defined as following:

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Data Products](Data-Products) → Data Products GUIs |
|------------------------------------------------------------------|
There are two main GUIs for viewing Trick logged data:

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → Data Products |
|------------------------------------------------------------------|
The Data Products (DP) is a simulation data post processor designed to allow visualization of data recorded in the Trick simulation.
The data products can plot ASCII, Binary & HDF5 data. HDF5 is the new data format supported since Trick 10.

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Data Products](Data-Products) → Plot Printing |
|------------------------------------------------------------------|
To print fermi plots, simply bring up the fermi plot, and press either the "Print" (printer icon) button or the individual "Print" (printer icon) buttons on the plots themselves. In order for this to work you should set two environment variables:
```

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → Introduction |
|------------------------------------------------------------------|
The responsibility for this document lies with the [Simulation and Graphics Branch (ER7)](https://er.jsc.nasa.gov/ER7/) of the [Automation, Robotics and Simulation Division](https://er.jsc.nasa.gov/) of the NASA JSC Engineering Directorate.
The purpose of this document is to provide Trick simulation developers and users with a detailed users reference guide on how to install Trick, use Trick processors and utilities, and how to operate a simulation from execution to data post processing.

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → Miscellaneous Trick Tools |
|------------------------------------------------------------------|
### Interface Code Generator - ICG

View File

@ -1,3 +1,7 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Miscellaneous Trick Tools](Miscellaneous-Trick-Tools) → Python Variable Server Client |
|------------------------------------------------------------------|
`variable_server.py` is a Python module for communicating with a sim's variable server from a Python program. Its primary purpose is to easily get and set variable values and units, but it also includes some additional convenience methods for affecting the sim's state. The code itself is well-commented, so I won't be reproducing the API here. Run `pydoc variable_server` (in the containing directory) for that.
# Release Your Resources!
@ -384,4 +388,4 @@ class Variable(__builtin__.object)
| should not directly change any part of this class.
```
[Continue to Software Requirements](software_requirements_specification/SRS)
[Continue to Trick Ops](TrickOps)

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Miscellaneous Trick Tools](Miscellaneous-Trick-Tools) → Trick Ops |
|------------------------------------------------------------------|
# Table of Contents
* [Requirements](#Requirements)
* [Features](#Features)
@ -292,3 +295,4 @@ This is purposeful -- handling every project-specific constraint is impossible.
A lot of time was spent adding `python` docstrings to the `TrickWorkflow.py` and `WorkflowCommon.py` modules. This README does not cover all functionality, so please see the in-code documentation for more detailed information on the framework.
[Continue to Software Requirements](../software_requirements_specification/SRS)

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Running a Simulation](Running-a-Simulation) → Input File |
|------------------------------------------------------------------|
The primary interface between the simulation executable and the user is the runstream
input file. The Trick simulation input file syntax is Python. All Python syntax rules

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → Running a Simulation |
|------------------------------------------------------------------|
S_main_${TRICK_HOST_CPU}.exe is generated by the CP and is the simulation main executable program.
The runtime configuration of the executive and its associated support utilities may be manipulated through entries in the simulation input file. The input file is described in detail in Input_File.

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Running a Simulation](Running-a-Simulation) → Runtime Output|
|------------------------------------------------------------------|
Executing the simulation main executable S_main_${TRICK_HOST_CPU}.exe generates a handful of log files that document a simulation run.
The log files are written to the RUN_<name> directory by default. The destination can be redirected by specifying the -O or -OO option for the runtime executive. Two of the log files are described below.

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Running a Simulation](../Running-a-Simulation) → [Runtime GUIs](Runtime-GUIs) → Malfunctions |
|------------------------------------------------------------------|
### Events/Malfunctions Trick View
Events/Malfunctions Trick View (hereafter referred to as MTV) is a graphical user interface that has two main functions:

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Running a Simulation](../Running-a-Simulation) → [Runtime GUIs](Runtime-GUIs) → Monte Monitor |
|------------------------------------------------------------------|
### Monte Monitor
Monte Monitor (hereafter referred to as MM) is a graphical user interface that allows users to view and modify the states

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Running a Simulation](../Running-a-Simulation) → Runtime GUIs |
|------------------------------------------------------------------|
Trick provides the following graphical user interfaces:
### Simulation Control Panel

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Running a Simulation](../Running-a-Simulation) → [Runtime GUIs](Runtime-GUIs) → Trick View |
|------------------------------------------------------------------|
Trick View (hereafter referred to as TV) is a graphical user interface that allows users to view and modify Trick-managed variables in a simulation while it is running. It also provides for the launching of integrated strip charts and can save and restore lists of variables and their associated strip charts.
#### Launching

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Checkpoints |
|------------------------------------------------------------------|
The Trick CheckPointWriter is a C++ Class that implements checkpointing.
## Checkpointing

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Command Line Arguments |
|------------------------------------------------------------------|
The Trick::CommandLineArguments class stores the command line arguments specified
by the user when starting the simulation. The class provides routines to

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Data Record |
|------------------------------------------------------------------|
Data Recording provides the capability to specify any number of data recording groups,
each with an unlimited number of parameter references, and with each group recording

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Debug Pause |
|------------------------------------------------------------------|
Debug Pause is a debugging feature provided by Trick. When turned on, Debug Pause will print the current simulation time and
the name of the current job, and pause the simulation @e before the job is executed. Debug Pause provides a way for the user to step

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Echo Jobs |
|------------------------------------------------------------------|
Echo Jobs is a handy debugging toggle provided by Trick. When turned on, Echo Jobs will print the current simulation time and
the name of the current job being executed. Echo Jobs is a convenient way to see the order of job execution and narrow down when

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Environment |
|------------------------------------------------------------------|
This class saves the Trick environment variables at compile-time. The variables
are saved inside the S_main executable. These variables are read-only after they

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Event Manager |
|------------------------------------------------------------------|
This page describes the methods available in the Trick::EventManager and Trick::EventProcessor class.
See [Input_File](/trick/documentation/running_a_simulation/Input-File) for detailed information on the syntax of the input processor file.

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Executive Scheduler |
|------------------------------------------------------------------|
This scheduler or derivative of this class is required for Trick simulations to run.

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Frame Logging |
|------------------------------------------------------------------|
Trick provides a means to gather simulation performance data and view it using Data Products (see [Data Products](Data-Products)).
When the user turns on the Frame Logging feature, Trick will use its Data Recording mechanism to track the following:

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Input Processor |
|------------------------------------------------------------------|
This page describes the methods available in the Trick::InputProcessor class.
<b>See [Input File](../running_a_simulation/Input-File) for detailed information on the syntax of the input processor file.

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Integrator |
|------------------------------------------------------------------|
Trick provides a state integration capability described by the inputs below.
To use these options a developer must develop application code which interfaces the application states with

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → JIT Input Processor |
|------------------------------------------------------------------|
A JIT input file is a C++ input file that can be used along side a python input file, or even replace the python input file. The JIT input file includes "S_source.hh" that gives it access to the entire simulation. The code in a JIT input file is compiled into a shared library during simulation initialization. The simulation dynamically opens the shared library and runs a specific function called "run_me" that must be defined in the JIT input file. There are a couple of advantages to this type of input file.
1. Once compiled, a JIT input file is orders of magnitude faster to execute than a python equivalent. That is because there is no python is involved, everything is C++.

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Master/Slave |
|------------------------------------------------------------------|
Master/Slave is a way to do distributed processing in Trick using multiple simulations.
Master/Slave synchronization synchronizes a master simulation to one or more slave

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Realtime Clock |
|------------------------------------------------------------------|
# Realtime-Clock
**Contents**
@ -194,6 +197,6 @@ double exec_get_sim_time(void) ;
defined in ```exec_proto.h```.
Continue to [Realtime Timer](Realtime-Timer)

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Realtime Injector |
|------------------------------------------------------------------|
The Real Time Injector (RTI) allows the user to set simulation variables
synchronously without impacting real-time performance. The RTI performs the injection

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Realtime Timer |
|------------------------------------------------------------------|
A realtime sleep timer is an optional class for Trick simulations.

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Realtime |
|------------------------------------------------------------------|
Trick provides a real-time processing capability which is different from many real-time
simulation capabilities. The Trick executive is a "time based" executive and can run in

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → STL Checkpointing |
|------------------------------------------------------------------|
Trick checkpoints the following STL types: array, vector, list, deque, set, multiset map, multimap, stack, queue, priority_queue, pair.

View File

@ -1,4 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → Simulation Capabilities |
|------------------------------------------------------------------|
This section details the runtime capabilities of Trick.

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Status Message System |
|------------------------------------------------------------------|
The Message Publisher publishes executive and/or model messages. A Message Subscriber gets the messages published by the Publisher.

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Threads |
|------------------------------------------------------------------|
# The ThreadBase Class
A trick sim is a multi-threaded process, and all of the threads that are created by Trick or Trick generated code inherit from the abstract class ThreadBase. ThreadBase classes have the capability to change the priority and cpu affinity of the thread. ThreadBase classes include trick_sys threads as well as user defined threads from the S_define:
@ -70,4 +73,5 @@ Set the priority for the thread. See the man page for sched(7) for more details.
```cpp
int set_priority(unsigned int req_priority)
```
[Continue to Simulation Utilities](/trick/documentation/simulation_utilities/Simulation-Utilities)
[Continue to Web Server](../web/Webserver)

View File

@ -1,5 +1,5 @@
| [Home](Home) → [Documentation Home](Documentation-Home) → Monte Carlo |
|--------------------------------------------------------------------------------------|
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Monte Carlo |
|------------------------------------------------------------------|
# Introduction
Monte Carlo is an advanced simulation capability provided by Trick that allows users to repeatedly run copies of a simulation with different input values. Users can vary the input space of a simulation via input file, random value generation, or by calculating values from previous Monte Carlo runs in a process called optimization.

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Capabilities](Simulation-Capabilities) → Variable Server |
|------------------------------------------------------------------|
When running a Trick simulation, unless specifically turned off, a server called the
"variable server" is always up and listening in a separate thread of execution. The

View File

@ -1,3 +1,7 @@
| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Simulation Capabilities](../Simulation-Capabilities) → [Memory Manager](MemoryManager) → Declaration String|
|------------------------------------------------------------------|
### Memory Manager Declaration
A declaration provides a data type description of a chunk of memory.

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Simulation Capabilities](../Simulation-Capabilities) → [Memory Manager](MemoryManager) → Trick Type|
|------------------------------------------------------------------|
- **TRICK_TYPE** is an enmeration type that specifies data types.
Available types are provided in the following table.

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../../Documentation-Home) → [Simulation Capabilities](../Simulation-Capabilities) → Memory Manager |
|------------------------------------------------------------------|
## Trick Memory Manager
The Memory Manager

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Utilities](Simulation-Utilities) → Math Utilities |
|------------------------------------------------------------------|
To be added.
[Continue to Miscellaneous Trick Tools](../miscellaneous_trick_tools/Miscellaneous-Trick-Tools)

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → Simulation Utilities |
|------------------------------------------------------------------|
This section details the simulation utilities of Trick. Simulation utilities provide a service to
user models. These included a socket communication library, Trickcomm, as well as math routines,
units conversion routines, and some abstract data types written in C.

View File

@ -1,3 +1,5 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Simulation Utilities](Simulation-Utilities) → TrickComm |
|------------------------------------------------------------------|
To be added.

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Web Server](Webserver) → Configuring Trick with Civetweb |
|------------------------------------------------------------------|
## Configuring Trick with Civetweb
To configure Trick to support the civetweb web server, you'll need to
@ -19,3 +22,5 @@ cd $(TRICK_HOME)
make clean
make
```
Continue to [Adding SSL Encryption](SSL)

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Web Server](Webserver) → [APIs](WebServerAPIs) → Extending the HTTP API |
|------------------------------------------------------------------|
## Extending the HTTP-API
The HTTP-API is implemented as a collection of ```httpMethodHandlers```. An ```httpMethodHandler``` is a pointer to a function that is expected to respond to an HTTP GET request, using the **CivetWeb** framework. An ```httpMethodHandler``` is defined (in ```trick/CivetWeb.hh```) as follows:
@ -113,3 +116,5 @@ void create_connections() {
}
```
Continue to [Extending the WS API](Extend-ws-api)

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Web Server](Webserver) → [APIs](WebServerAPIs) → Extend the WS API |
|------------------------------------------------------------------|
## Extending the WebSocket-API
## When You Create a WebSocket Connection
@ -267,6 +270,4 @@ To test your new web socket interface, put the following ```time.html``` file in
</html>
```
Continue to [Simulation Utilities](../simulation_utilities/Simulation-Utilities)

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Web Server](Webserver) → Adding SSL Encryption to your Webserver |
|------------------------------------------------------------------|
# Adding SSL Encryption to Your Webserver
## Getting started
@ -34,3 +37,5 @@ Where server.pem is the path to the server.pem file you created when creating a
## Access your webserver
Now that ssl encryption is enabled, to access you webserver use https://localhost.ssl:8888 instead of http and wss://localhost.ssl:8888 for http and ws protocals respectively.
Continue to [Adding SSL Encryption](SSL)

View File

@ -0,0 +1,12 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Web Server](Webserver) → APIs |
|------------------------------------------------------------------|
# Web Server APIs
The web server provides APIs over http and wss protocol. Both can be extended by a client developer if necessary.
API Documentation Pages
- [HTTP Alloc API](http-alloc-api)
- [WS Variable Server API](ws-variable-server-api)
- [Extending the HTTP API](Extend-http-api)
- [Extending the WS API](Extend-ws-api)

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → Web Server |
|------------------------------------------------------------------|
# Adding a Web Server to Your Sim
If Trick is [configured with Civetweb](Configuring_TRICK_with_Civetweb.md),
@ -77,3 +80,4 @@ The **images** directory contains trick_icon.png.
**You are encouraged to add to, modify, and/or delete these files and directories to best suite the needs of your project.**
Continue to [Configuring Trick with Civetweb](Configure-Civetweb)

View File

@ -1,16 +1,19 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Web Server](Webserver) → [APIs](WebServerAPIs) → HTTP Alloc API |
|------------------------------------------------------------------|
# HTTP-API: alloc_info
```http://localhost:8888/api/http/alloc_info```
```http://localhost:8888/api/http/alloc_info```
## Purpose
Request a JSON encoded sub-list of allocation descriptors from the Memory Managers alloc_info list.
Request a JSON encoded sub-list of allocation descriptors from the Memory Managers alloc_info list.
## Query String Parameters
| Parameter|Default|Description |
|-------------|----|----------------------------------|
| ```start``` | 0 | starting index of the sub-list. |
| ```count``` | 20 | number of allocation descriptors.|
|-------------|----|----------------------------------|
| ```start``` | 0 | starting index of the sub-list. |
| ```count``` | 20 | number of allocation descriptors.|
### EXAMPLE:
@ -20,11 +23,11 @@ Request a JSON encoded sub-list of allocation descriptors from the Memory Manage
Returns a JSON object containing four name-value pairs:
### JSON Response Object
### JSON Response Object
| Name | Value Description |
|-------------------|-----------------------------------------|
| ```alloc_total``` | Total number allocations in the Memory Managers alloc_info list. |
|-------------------|-----------------------------------------|
| ```alloc_total``` | Total number allocations in the Memory Managers alloc_info list. |
| ```chunk_size``` | Number of allocation description objects in ```alloc_list```. |
| ```chunk_start``` | The Memory Manager alloc_info index of the first ```alloc_list``` element below|
| ```alloc_list``` | Array of JSON Allocation Description objects (described below). |
@ -33,8 +36,8 @@ Returns a JSON object containing four name-value pairs:
### JSON Allocation Description Object
| Name | Value Description |
|---------------|---------------------------------------------------------------------------------|
| ```name``` | Name of the allocation. May be ```Null``` |
|---------------|---------------------------------------------------------------------------------|
| ```name``` | Name of the allocation. May be ```Null``` |
| ```start``` | Starting address of the allocation. |
| ```end``` | Ending address of the allocation. |
| ```num``` | |
@ -56,32 +59,34 @@ In ```SIM_cannon_numeric``` (one of Trick's example sims) the following query re
#### Response
```json
{ "alloc_total":43,
"chunk_size":2,
"chunk_start":20,
"alloc_list":[
{ "name":"dyn",
"start":"0x101aa9900",
"end":"0x101aa9b27",
"num":"1",
"size":"552",
"type":"CannonSimObject",
"stcl":"TRICK_EXTERN",
"language":"Language_CPP",
"index": []
}
,
{ "name":"web",
"start":"0x101aa9610",
"end":"0x101aa98ff",
"num":"1",
"size":"752",
"type":"WebServerSimObject",
"stcl":"TRICK_EXTERN",
"language":"Language_CPP",
"index": []
}
]
}
{ "alloc_total":43,
"chunk_size":2,
"chunk_start":20,
"alloc_list":[
{ "name":"dyn",
"start":"0x101aa9900",
"end":"0x101aa9b27",
"num":"1",
"size":"552",
"type":"CannonSimObject",
"stcl":"TRICK_EXTERN",
"language":"Language_CPP",
"index": []
}
,
{ "name":"web",
"start":"0x101aa9610",
"end":"0x101aa98ff",
"num":"1",
"size":"752",
"type":"WebServerSimObject",
"stcl":"TRICK_EXTERN",
"language":"Language_CPP",
"index": []
}
]
}
```
```
Continue to [WS Variable Server API](ws-variable-server-api)

View File

@ -1,3 +1,6 @@
| [Home](/trick) → [Documentation Home](../Documentation-Home) → [Web Server](Webserver) → [APIs](WebServerAPIs) → WS Variable Server API |
|------------------------------------------------------------------|
# WS-API: VariableServer
```ws://localhost:8888/api/ws/VariableServer```
@ -18,62 +21,62 @@ Add a Trick Variable to the current session.
Stop sending periodic ```var_list``` messages (*see below*) from the server.
```json
{ "cmd" : "var_pause" }
{ "cmd" : "var_pause" }
```
Resume sending periodic ```var_list``` response messages from the server.
```json
{ "cmd" : "var_unpause" }
{ "cmd" : "var_unpause" }
```
Send one ```var_list``` message from the server.
```json
{ "cmd" : "var_send" }
{ "cmd" : "var_send" }
```
Clear all variables from the current session, that is: undo all of the ```var_add``` commands.
```json
{ "cmd" : "var_clear" }
{ "cmd" : "var_clear" }
```
Disconnect from the variable server.
```json
{ "cmd" : "var_exit" }
{ "cmd" : "var_exit" }
```
Set the period (in milliseconds) at which ```var_list``` messages are sent form the server.
```json
{ "cmd" : "var_cycle",
"period" : integer
}
{ "cmd" : "var_cycle",
"period" : integer
}
```
Execute the given Python code in the host sim.
```json
{ "cmd" : "python",
"pycode" : string
}
{ "cmd" : "python",
"pycode" : string
}
```
Send the sie structure from the server. Response will be the ```sie``` response message (*below*).
```json
{ "cmd" : "sie" }
{ "cmd" : "sie" }
```
Send the units for the given variable. Response will be the ```units``` response message (*below*).
```json
{ "cmd" : "units",
"var_name" : string
}
{ "cmd" : "units",
"var_name" : string
}
```
## Server to Client Response Messages
@ -81,34 +84,34 @@ Send the units for the given variable. Response will be the ```units``` response
Error Response
```json
{ "msg_type" : "error",
"error_text" : string
{ "msg_type" : "error",
"error_text" : string
}
```
Periodic response containing the values of variables requested by ```var_add```.
```json
{ "msg_type" : "var_list"
"time" : double
"values" : []
{ "msg_type" : "var_list"
"time" : double
"values" : []
}
```
Response to the ```sie``` command (*above*).
```json
{ "msg_type" : "sie",
"data" : string
{ "msg_type" : "sie",
"data" : string
}
```
Response to the ```units``` command (*above*).
```json
{ "msg_type" : "units",
"var_name" : string,
"data" : string
{ "msg_type" : "units",
"var_name" : string,
"data" : string
}
```
@ -208,3 +211,5 @@ Response to the ```units``` command (*above*).
</body>
</html>
```
Continue to [Extending the HTTP API](Extend-http-api)