Package ais :: Module sls_estlocktimes
[hide private]
[frames] | no frames]

Module sls_estlocktimes

source code

Autogenerated python functions to serialize/deserialize binary messages.

Generated by: ./aisxmlbinmsg2py.py

Need to then wrap these functions with the outer AIS packet and then convert the whole binary blob to a NMEA string. Those functions are not currently provided in this file.

serialize: python to ais binary deserialize: ais binary to python

The generated code uses translators.py, binary.py, and aisstring.py which should be packaged with the resulting files.


Requires:

Author: xmlbinmsg

Version: 4791

Status: under development

License: Generated code has no license

Classes [hide private]
  Testsls_lockorder
Use testvalue tag text from each type to build test case the sls_lockorder message

Functions [hide private]
BitVector encode(params, validate=False)
Create a sls_lockorder binary message payload to pack into an AIS Msg sls_lockorder.
dict decode(bv, validate=False)
Unpack a sls_lockorder message
  decodevessel(bv, validate=False)
  decodedirection(bv, validate=False)
  decodeETA_month(bv, validate=False)
  decodeETA_day(bv, validate=False)
  decodeETA_hour(bv, validate=False)
  decodeETA_min(bv, validate=False)
  decodereserved(bv, validate=False)
  printHtml(params, out=sys.stdout)
stdout printFields(params, out=sys.stdout, format='std')
Print a reserved message to stdout.
dict testParams()
Return a params file base on the testvalue tags.
  addMsgOptions(parser)

Variables [hide private]
  __date__ = '2007-01-18'
Date of last svn commit
  TrueBV = <ais.BitVector.BitVector object at 0x2344a10>
Why always rebuild the True bit? This should speed things up a bunch
  FalseBV = <ais.BitVector.BitVector object at 0x2344910>
Why always rebuild the False bit? This should speed things up a bunch
  directionEncodeLut = {'Down bound': '0', 'Up bound': '1'}
  directionDecodeLut = {'1': 'Up bound', '0': 'Down bound'}
  typeChoices = 'binary', 'nmeapayload', 'nmea'
  outputChoices = 'std', 'html', 'xml'
  outfile = file(options.outputFileName, 'w')
  msgDict = {'vessel': options.vesselField, 'direction': options...
  bitLen = len(bits)
  bits = bits+ BitVector(size= (6-(bitLen % 6)))

Function Details [hide private]

encode(params, validate=False)

source code 

Create a sls_lockorder binary message payload to pack into an AIS Msg sls_lockorder.

Fields in params:
  • vessel(aisstr6): Vessel Name
  • direction(bool): Up bound/Down bound
  • ETA_month(uint): Estimated time of arrival month 1..12
  • ETA_day(uint): Estimated time of arrival day of the month 1..31
  • ETA_hour(uint): Estimated time of arrival UTC hours 0..23
  • ETA_min(uint): Estimated time of arrival minutes
  • reserved(uint): Reserved bits for future use (field automatically set to "0")
Parameters:
  • params - Dictionary of field names/values. Throws a ValueError exception if required is missing
  • validate - Set to true to cause checking to occur. Runs slower. FIX: not implemented.
Returns: BitVector
encoded binary message (for binary messages, this needs to be wrapped in a msg 8

Note: The returned bits may not be 6 bit aligned. It is up to you to pad out the bits.

decode(bv, validate=False)

source code 

Unpack a sls_lockorder message

Fields in params:
  • vessel(aisstr6): Vessel Name
  • direction(bool): Up bound/Down bound
  • ETA_month(uint): Estimated time of arrival month 1..12
  • ETA_day(uint): Estimated time of arrival day of the month 1..31
  • ETA_hour(uint): Estimated time of arrival UTC hours 0..23
  • ETA_min(uint): Estimated time of arrival minutes
  • reserved(uint): Reserved bits for future use (field automatically set to "0")
Parameters:
  • bv (BitVector) - Bits defining a message
  • validate - Set to true to cause checking to occur. Runs slower. FIX: not implemented.
Returns: dict
params

decodevessel(bv, validate=False)

source code 
None

decodedirection(bv, validate=False)

source code 
None

decodeETA_month(bv, validate=False)

source code 
None

decodeETA_day(bv, validate=False)

source code 
None

decodeETA_hour(bv, validate=False)

source code 
None

decodeETA_min(bv, validate=False)

source code 
None

decodereserved(bv, validate=False)

source code 
None

printHtml(params, out=sys.stdout)

source code 
None

printFields(params, out=sys.stdout, format='std')

source code 

Print a reserved message to stdout.

Fields in params:
  • vessel(aisstr6): Vessel Name
  • direction(bool): Up bound/Down bound
  • ETA_month(uint): Estimated time of arrival month 1..12
  • ETA_day(uint): Estimated time of arrival day of the month 1..31
  • ETA_hour(uint): Estimated time of arrival UTC hours 0..23
  • ETA_min(uint): Estimated time of arrival minutes
  • reserved(uint): Reserved bits for future use (field automatically set to "0")
Parameters:
  • params - Dictionary of field names/values.
  • out - File like object to write to
Returns: stdout
text to out

testParams()

source code 
Return a params file base on the testvalue tags.
Returns: dict
params based on testvalue tags

addMsgOptions(parser)

source code 
None

Variables Details [hide private]

__date__

Date of last svn commit
Value:
'2007-01-18'                                                           
      

TrueBV

Why always rebuild the True bit? This should speed things up a bunch
Value:
<ais.BitVector.BitVector object at 0x2344a10>                          
      

FalseBV

Why always rebuild the False bit? This should speed things up a bunch
Value:
<ais.BitVector.BitVector object at 0x2344910>                          
      

directionEncodeLut

None
Value:
{'Down bound': '0', 'Up bound': '1'}                                   
      

directionDecodeLut

None
Value:
{'1': 'Up bound', '0': 'Down bound'}                                   
      

typeChoices

None
Value:
'binary', 'nmeapayload', 'nmea'                                        
      

outputChoices

None
Value:
'std', 'html', 'xml'                                                   
      

outfile

None
Value:
file(options.outputFileName, 'w')                                      
      

msgDict

None
Value:
{'vessel': options.vesselField, 'direction': options.directionField, '
ETA_month': options.ETA_monthField, 'ETA_day': options.ETA_dayField, '
ETA_hour': options.ETA_hourField, 'ETA_min': options.ETA_minField, 're
served': '0',}                                                         
      

bitLen

None
Value:
len(bits)                                                              
      

bits

None
Value:
bits+ BitVector(size= (6-(bitLen % 6)))