#'_hash3_pathfilename',
'db_bydate_addrecord',
'db_lastinfo_setrecord_ifnewer',
- 'sql_add_nmea5',
+ #'sql_add_nmea5',
#'aivdm_record123_format',
#'aivdm_record123_length',
#'aivdm_record5_format',
sqlinfo['name'] = name or None
sqlinfo['callsign'] = callsign or None
sqlinfo['type'] = type
+ sqlinfo['dim_bow'] = dim_bow
+ sqlinfo['dim_stern'] = dim_stern
+ sqlinfo['dim_port'] = dim_port
+ sqlinfo['dim_starboard'] = dim_starboard
sqlinfo['destination'] = None
if destination:
destination = destination.replace('\0', ' ').rstrip(' @\0')
sqlexec(u'UPDATE vessel SET callsign = %(callsign)s WHERE mmsi=%(mmsi)s AND (callsign IS NULL OR updated<%(updated)s)', sqlinfo)
if sqlinfo['type']:
sqlexec(u'UPDATE vessel SET type = %(type)s WHERE mmsi=%(mmsi)s AND (type IS NULL OR updated<%(updated)s)', sqlinfo)
+ if sqlinfo['dim_bow'] or sqlinfo['dim_stern']:
+ sqlexec(u'UPDATE vessel SET dim_bow = %(dim_bow)s, dim_stern = %(dim_stern)s WHERE mmsi=%(mmsi)s AND ((dim_port = 0 OR dim_stern=0) OR updated<%(updated)s)', sqlinfo)
+ if sqlinfo['dim_port'] or sqlinfo['dim_starboard']:
+ sqlexec(u'UPDATE vessel SET dim_port = %(dim_port)s, dim_starboard = %(dim_starboard)s WHERE mmsi=%(mmsi)s AND ((dim_port = 0 OR dim_starboard=0) OR updated<%(updated)s)', sqlinfo)
if sqlinfo['destination']:
sqlexec(u'UPDATE vessel SET destination = %(destination)s WHERE mmsi=%(mmsi)s AND (destination IS NULL OR updated<%(updated)s)', sqlinfo)
sqlexec(u'UPDATE vessel SET (updated, source) = (%(updated)s, %(source)s) WHERE mmsi=%(mmsi)s AND updated<%(updated)s', sqlinfo)
source character varying(8),
mmsi integer NOT NULL,
imo integer,
- destination character varying(20)
+ destination character varying(20),
+ dim_bow integer DEFAULT 0 NOT NULL,
+ dim_stern integer DEFAULT 0 NOT NULL,
+ dim_port integer DEFAULT 0 NOT NULL,
+ dim_starboard integer DEFAULT 0 NOT NULL
);