Package viewer :: Module sim_viewer
[hide private]
[frames] | no frames]

Module sim_viewer

source code

A viewer for the MoSP simulator.

It uses a socket to receive geometric objects from the simulation and draws these onto a layer of OpenStreetMap-map-tiles.


To Do:

Author: P. Tute

Contact: henne@dcsec.uni-hannover.de

Copyright: (c) 2011-2012, DCSec, Leibniz Universitaet Hannover, Germany

License: GPLv3

Classes [hide private]
  SimViewer
A tool for displaying mosp-simulations.
Variables [hide private]
  __maintainer__ = "B. Henne"
  TILE_SIZE = 256
The size of one OSM-tile in pixels.
  KEYBOARD_SCROLL_VALUE = 50
Scrolling by keyboard will move the camera by this many pixels.
  MESSAGE_TYPES = {'\x00': 'coords', '\x01': 'point', '\x02': 'r...
Supported message types for lookup after receiving an identifier.
  MESSAGE_SIZE = {'\x00': struct.calcsize('!dd'), '\x01': struct...
The precalculated size of commonly used structs.
  ID_TYPE_PREFIX = {'\x00': 0, '\x01': 0, '\x02': 100000, '\x03'...
These values will be added to the IDs of the respecting object.
  PIXEL_DISTANCE = {}
precalculate lat/lon distance when moving one pixel for each zoom-level
Variables Details [hide private]

TILE_SIZE

The size of one OSM-tile in pixels. This is constant as long as OSM does not change.

Value:
256

MESSAGE_TYPES

Supported message types for lookup after receiving an identifier.

Value:
{'\x00': 'coords', '\x01': 'point', '\x02': 'rectangle', '\x03': 'circ\
le', '\x04': 'triangle', '\x05': 'text', '\x06': 'heatmap', '\x07': 'd\
irect-text', '\xFD': 'delete', '\xFE': 'draw', '\xFF': 'simulation_end\
ed',}

MESSAGE_SIZE

The precalculated size of commonly used structs.

Value:
{'\x00': struct.calcsize('!dd'), '\x01': struct.calcsize('!iddi4dd'), \
'\x02': struct.calcsize('!i4di?4dd'), '\x03': struct.calcsize('!iddi?4\
dd'), '\x04': struct.calcsize('!i2d2d2d?4dd'), '\x05': struct.calcsize\
('!iddiii4did'), '\x06': struct.calcsize('!ddi4d'), '\x07': struct.cal\
csize('!iiii4did'), '\xFD': struct.calcsize('!i'),}

ID_TYPE_PREFIX

These values will be added to the IDs of the respecting object. This is necessary to be able to differentiate between them after they are mixed together for faster calculations.

Value:
{'\x00': 0, '\x01': 0, '\x02': 100000, '\x03': 200000, '\x04': 300000,\
 '\x05': 0,}