mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
whitespace
This commit is contained in:
parent
2f227d6ae1
commit
c79433f59b
329 changed files with 2181 additions and 2190 deletions
|
@ -21,7 +21,7 @@ Install
|
|||
Requirements
|
||||
-------------
|
||||
|
||||
- Python 2.7 or later
|
||||
- Python 2.7 or later
|
||||
- pip install numpy shapely
|
||||
|
||||
From Github
|
||||
|
@ -57,7 +57,7 @@ A short script to request available grid names from an EDEX server::
|
|||
# Init data request
|
||||
request = DataAccessLayer.newDataRequest()
|
||||
|
||||
# Set datatype
|
||||
# Set datatype
|
||||
request.setDatatype("grid")
|
||||
|
||||
#
|
||||
|
@ -65,7 +65,7 @@ A short script to request available grid names from an EDEX server::
|
|||
#
|
||||
# LocationNames mean different things to different plugins beware...radar is icao,
|
||||
# satellite is sector, etc
|
||||
#
|
||||
#
|
||||
available_grids = DataAccessLayer.getAvailableLocationNames(request)
|
||||
for grid in available_grids:
|
||||
print grid
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -23,31 +23,30 @@
|
|||
# Pure python logging mechanism for logging to AlertViz from
|
||||
# pure python (ie not JEP). DO NOT USE IN PYTHON CALLED
|
||||
# FROM JAVA.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 08/18/10 njensen Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
import logging
|
||||
import NotificationMessage
|
||||
|
||||
|
||||
class AlertVizHandler(logging.Handler):
|
||||
|
||||
def __init__(self, host='localhost', port=61999, category='LOCAL', source='ANNOUNCER', level=logging.NOTSET):
|
||||
logging.Handler.__init__(self, level)
|
||||
logging.Handler.__init__(self, level)
|
||||
self._category = category
|
||||
self._host = host
|
||||
self._port = port
|
||||
self._source = source
|
||||
|
||||
|
||||
def emit(self, record):
|
||||
|
||||
def emit(self, record):
|
||||
"Implements logging.Handler's interface. Record argument is a logging.LogRecord."
|
||||
priority = None
|
||||
if record.levelno >= 50:
|
||||
|
@ -62,9 +61,9 @@ class AlertVizHandler(logging.Handler):
|
|||
priority = 'EVENTB'
|
||||
else:
|
||||
priority = 'VERBOSE'
|
||||
|
||||
|
||||
msg = self.format(record)
|
||||
|
||||
|
||||
notify = NotificationMessage.NotificationMessage(self._host, self._port, msg, priority, self._category, self._source)
|
||||
notify.send()
|
||||
|
||||
|
||||
|
|
|
@ -1,41 +1,40 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
||||
#
|
||||
# A set of utility functions for dealing with configuration files.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 09/27/10 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
def parseKeyValueFile(fileName):
|
||||
propDict= dict()
|
||||
|
||||
|
||||
try:
|
||||
propFile= open(fileName, "rU")
|
||||
for propLine in propFile:
|
||||
|
@ -53,4 +52,4 @@ def parseKeyValueFile(fileName):
|
|||
except:
|
||||
pass
|
||||
|
||||
return propDict
|
||||
return propDict
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
|
@ -26,19 +26,19 @@ import socket
|
|||
import sys
|
||||
import time
|
||||
import threading
|
||||
import xml.etree.ElementTree as ET
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
import ThriftClient
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.alertviz import AlertVizRequest
|
||||
from dynamicserialize import DynamicSerializationManager
|
||||
|
||||
#
|
||||
# Provides a capability of constructing notification messages and sending
|
||||
# Provides a capability of constructing notification messages and sending
|
||||
# them to a STOMP data source.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 09/30/08 chammack Initial Creation.
|
||||
|
@ -49,8 +49,8 @@ from dynamicserialize import DynamicSerializationManager
|
|||
# value
|
||||
#
|
||||
class NotificationMessage:
|
||||
|
||||
priorityMap = {
|
||||
|
||||
priorityMap = {
|
||||
0: 'CRITICAL',
|
||||
1: 'SIGNIFICANT',
|
||||
2: 'PROBLEM',
|
||||
|
@ -64,7 +64,7 @@ class NotificationMessage:
|
|||
self.message = message
|
||||
self.audioFile = audioFile
|
||||
self.source = source
|
||||
self.category = category
|
||||
self.category = category
|
||||
|
||||
priorityInt = None
|
||||
|
||||
|
@ -86,12 +86,12 @@ class NotificationMessage:
|
|||
elif priority == 'EVENTB':
|
||||
priorityInt = int(4)
|
||||
elif priority == 'VERBOSE' or priority == 'DEBUG':
|
||||
priorityInt = int(5)
|
||||
|
||||
if (priorityInt < 0 or priorityInt > 5):
|
||||
priorityInt = int(5)
|
||||
|
||||
if (priorityInt < 0 or priorityInt > 5):
|
||||
print "Error occurred, supplied an invalid Priority value: " + str(priorityInt)
|
||||
print "Priority values are 0, 1, 2, 3, 4 and 5."
|
||||
sys.exit(1)
|
||||
sys.exit(1)
|
||||
|
||||
if priorityInt is not None:
|
||||
self.priority = self.priorityMap[priorityInt]
|
||||
|
@ -110,7 +110,7 @@ class NotificationMessage:
|
|||
|
||||
def send(self):
|
||||
# depending on the value of the port number indicates the distribution
|
||||
# of the message to AlertViz
|
||||
# of the message to AlertViz
|
||||
# 9581 is global distribution thru ThriftClient to Edex
|
||||
# 61999 is local distribution
|
||||
if (self.port == 61999):
|
||||
|
@ -136,7 +136,7 @@ class NotificationMessage:
|
|||
msg.text = self.message
|
||||
details = ET.SubElement(sm, "details")
|
||||
msg = ET.tostring(sm, "UTF-8")
|
||||
|
||||
|
||||
try :
|
||||
conn.send(msg, destination='/queue/messages')
|
||||
time.sleep(2)
|
||||
|
@ -146,33 +146,33 @@ class NotificationMessage:
|
|||
# use ThriftClient
|
||||
alertVizRequest = createRequest(self.message, self.priority, self.source, self.category, self.audioFile)
|
||||
thriftClient = ThriftClient.ThriftClient(self.host, self.port, "/services")
|
||||
|
||||
|
||||
serverResponse = None
|
||||
try:
|
||||
serverResponse = thriftClient.sendRequest(alertVizRequest)
|
||||
except Exception, ex:
|
||||
print "Caught exception submitting AlertVizRequest: ", str(ex)
|
||||
|
||||
print "Caught exception submitting AlertVizRequest: ", str(ex)
|
||||
|
||||
if (serverResponse != "None"):
|
||||
print "Error occurred submitting Notification Message to AlertViz receiver: ", serverResponse
|
||||
sys.exit(1)
|
||||
else:
|
||||
print "Response: " + str(serverResponse)
|
||||
|
||||
def createRequest(message, priority, source, category, audioFile):
|
||||
print "Response: " + str(serverResponse)
|
||||
|
||||
def createRequest(message, priority, source, category, audioFile):
|
||||
obj = AlertVizRequest()
|
||||
|
||||
obj.setMachine(socket.gethostname())
|
||||
|
||||
obj.setMachine(socket.gethostname())
|
||||
obj.setPriority(priority)
|
||||
obj.setCategory(category)
|
||||
obj.setSourceKey(source)
|
||||
obj.setSourceKey(source)
|
||||
obj.setMessage(message)
|
||||
if (audioFile is not None):
|
||||
obj.setAudioFile(audioFile)
|
||||
else:
|
||||
obj.setAudioFile('\0')
|
||||
|
||||
|
||||
return obj
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
||||
#
|
||||
# Provides a Python-based interface for subscribing to qpid queues and topics.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 11/17/10 njensen Initial Creation.
|
||||
# 08/15/13 2169 bkowal Optionally gzip decompress any data that is read.
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
import qpid
|
||||
|
@ -39,7 +39,7 @@ from Queue import Empty
|
|||
from qpid.exceptions import Closed
|
||||
|
||||
class QpidSubscriber:
|
||||
|
||||
|
||||
def __init__(self, host='127.0.0.1', port=5672, decompress=False):
|
||||
self.host = host
|
||||
self.port = port
|
||||
|
@ -49,26 +49,26 @@ class QpidSubscriber:
|
|||
self.__connection.start()
|
||||
self.__session = self.__connection.session(str(qpid.datatypes.uuid4()))
|
||||
self.subscribed = True
|
||||
|
||||
|
||||
def topicSubscribe(self, topicName, callback):
|
||||
# if the queue is edex.alerts, set decompress to true always for now to
|
||||
# maintain compatibility with existing python scripts.
|
||||
if (topicName == 'edex.alerts'):
|
||||
self.decompress = True
|
||||
|
||||
self.decompress = True
|
||||
|
||||
print "Establishing connection to broker on", self.host
|
||||
queueName = topicName + self.__session.name
|
||||
self.__session.queue_declare(queue=queueName, exclusive=True, auto_delete=True, arguments={'qpid.max_count':100, 'qpid.policy_type':'ring'})
|
||||
self.__session.exchange_bind(exchange='amq.topic', queue=queueName, binding_key=topicName)
|
||||
self.__innerSubscribe(queueName, callback)
|
||||
|
||||
self.__innerSubscribe(queueName, callback)
|
||||
|
||||
def __innerSubscribe(self, serverQueueName, callback):
|
||||
local_queue_name = 'local_queue_' + serverQueueName
|
||||
local_queue_name = 'local_queue_' + serverQueueName
|
||||
queue = self.__session.incoming(local_queue_name)
|
||||
self.__session.message_subscribe(serverQueueName, destination=local_queue_name)
|
||||
queue.start()
|
||||
print "Connection complete to broker on", self.host
|
||||
|
||||
|
||||
while self.subscribed:
|
||||
try:
|
||||
message = queue.get(timeout=10)
|
||||
|
@ -82,7 +82,7 @@ class QpidSubscriber:
|
|||
content = d.decompress(content)
|
||||
except:
|
||||
# decompression failed, return the original content
|
||||
pass
|
||||
pass
|
||||
callback(content)
|
||||
except Empty:
|
||||
pass
|
||||
|
@ -95,6 +95,3 @@ class QpidSubscriber:
|
|||
self.__session.close(timeout=10)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
|
|
@ -21,10 +21,10 @@
|
|||
#
|
||||
# Common methods for the a2gtrad and a2advrad scripts.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 08/13/2014 3393 nabowle Initial creation to contain common
|
||||
|
@ -91,7 +91,7 @@ def get_header(record, format, xLen, yLen, azdat, description):
|
|||
msg = str(xLen) + " " + str(yLen) + " " + mytime + " " + \
|
||||
dattyp + " " + description + " " + \
|
||||
str(record.getTrueElevationAngle()) + " " + \
|
||||
str(record.getVolumeCoveragePattern()) + "\n"
|
||||
str(record.getVolumeCoveragePattern()) + "\n"
|
||||
|
||||
return msg
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -25,29 +25,28 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.serialization import Serial
|
|||
|
||||
#
|
||||
# Provides a Python-based interface for executing Thrift requests.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 09/20/10 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
class ThriftClient:
|
||||
|
||||
|
||||
# How to call this constructor:
|
||||
# 1. Pass in all arguments separately (e.g.,
|
||||
# 1. Pass in all arguments separately (e.g.,
|
||||
# ThriftClient.ThriftClient("localhost", 9581, "/services"))
|
||||
# will return a Thrift client pointed at http://localhost:9581/services.
|
||||
# 2. Pass in all arguments through the host string (e.g.,
|
||||
# 2. Pass in all arguments through the host string (e.g.,
|
||||
# ThriftClient.ThriftClient("localhost:9581/services"))
|
||||
# will return a Thrift client pointed at http://localhost:9581/services.
|
||||
# 3. Pass in host/port arguments through the host string (e.g.,
|
||||
# 3. Pass in host/port arguments through the host string (e.g.,
|
||||
# ThriftClient.ThriftClient("localhost:9581", "/services"))
|
||||
# will return a Thrift client pointed at http://localhost:9581/services.
|
||||
def __init__(self, host, port=9581, uri="/services"):
|
||||
|
@ -61,42 +60,42 @@ class ThriftClient:
|
|||
self.__httpConn = httplib.HTTPConnection(host)
|
||||
else:
|
||||
self.__httpConn = httplib.HTTPConnection(host, port)
|
||||
|
||||
|
||||
self.__uri = uri
|
||||
|
||||
|
||||
self.__dsm = DynamicSerializationManager.DynamicSerializationManager()
|
||||
|
||||
|
||||
def sendRequest(self, request, uri="/thrift"):
|
||||
message = self.__dsm.serializeObject(request)
|
||||
|
||||
|
||||
self.__httpConn.connect()
|
||||
self.__httpConn.request("POST", self.__uri + uri, message)
|
||||
|
||||
|
||||
response = self.__httpConn.getresponse()
|
||||
if (response.status != 200):
|
||||
raise ThriftRequestException("Unable to post request to server")
|
||||
|
||||
|
||||
rval = self.__dsm.deserializeBytes(response.read())
|
||||
self.__httpConn.close()
|
||||
|
||||
|
||||
# let's verify we have an instance of ServerErrorResponse
|
||||
# IF we do, through an exception up to the caller along
|
||||
# with the original Java stack trace
|
||||
# ELSE: we have a valid response and pass it back
|
||||
try:
|
||||
forceError = rval.getException()
|
||||
forceError = rval.getException()
|
||||
raise ThriftRequestException(forceError)
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
|
||||
return rval
|
||||
|
||||
|
||||
|
||||
|
||||
class ThriftRequestException(Exception):
|
||||
def __init__(self, value):
|
||||
self.parameter = value
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return repr(self.parameter)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -39,7 +39,7 @@ import time
|
|||
# negative for time in the past.
|
||||
#
|
||||
# May still want it to be normalized to the most recent midnight.
|
||||
#
|
||||
#
|
||||
# NOTES about synchronizing:
|
||||
# --With synchronizing on, the "current time" for all processes started
|
||||
# within a given hour will be the same.
|
||||
|
@ -52,7 +52,7 @@ import time
|
|||
# For example, if someone starts the GFE at 12:59 and someone
|
||||
# else starts it at 1:01, they will have different offsets and
|
||||
# current times.
|
||||
# --With synchronizing off, when the process starts, the current time
|
||||
# --With synchronizing off, when the process starts, the current time
|
||||
# matches the drtTime in the command line. However, with synchronizing
|
||||
# on, the current time will be offset by the fraction of the hour at
|
||||
# which the process was started. Examples:
|
||||
|
@ -81,7 +81,7 @@ def determineDrtOffset(timeStr):
|
|||
#print "input", year, month, day, hour, minute
|
||||
gm = time.gmtime()
|
||||
cur_t = time.mktime(gm)
|
||||
|
||||
|
||||
# Synchronize to most recent hour
|
||||
# i.e. "truncate" cur_t to most recent hour.
|
||||
#print "gmtime", gm
|
||||
|
@ -90,9 +90,9 @@ def determineDrtOffset(timeStr):
|
|||
curStr = '%4s%2s%2s_%2s00\n' % (`gm[0]`,`gm[1]`,`gm[2]`,`gm[3]`)
|
||||
curStr = curStr.replace(' ','0')
|
||||
launchStr = timeStr + "," + curStr
|
||||
|
||||
|
||||
#print "drt, cur", drt_t, cur_t
|
||||
offset = drt_t - cur_t
|
||||
offset = drt_t - cur_t
|
||||
#print "offset", offset, offset/3600, launchStr
|
||||
return int(offset), launchStr
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,17 +21,17 @@
|
|||
|
||||
#
|
||||
# __init__.py for awips package
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 09/21/10 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
__all__ = [
|
||||
__all__ = [
|
||||
]
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# #
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
# #
|
||||
|
@ -21,10 +21,10 @@
|
|||
|
||||
#
|
||||
# Published interface for awips.dataaccess package
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 12/10/12 njensen Initial Creation.
|
||||
|
@ -35,8 +35,8 @@
|
|||
# 03/03/14 2673 bsteffen Add ability to query only ref times.
|
||||
# 07/22/14 3185 njensen Added optional/default args to newDataRequest
|
||||
# 07/30/14 3185 njensen Renamed valid identifiers to optional
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
@ -56,19 +56,19 @@ else:
|
|||
from awips.dataaccess import ThriftClientRouter
|
||||
router = ThriftClientRouter.ThriftClientRouter(THRIFT_HOST)
|
||||
USING_NATIVE_THRIFT = True
|
||||
|
||||
|
||||
|
||||
def getAvailableTimes(request, refTimeOnly=False):
|
||||
"""
|
||||
Get the times of available data to the request.
|
||||
|
||||
Args:
|
||||
|
||||
Args:
|
||||
request: the IDataRequest to get data for
|
||||
refTimeOnly: optional, use True if only unique refTimes should be
|
||||
returned (without a forecastHr)
|
||||
|
||||
|
||||
Returns:
|
||||
a list of DataTimes
|
||||
a list of DataTimes
|
||||
"""
|
||||
return router.getAvailableTimes(request, refTimeOnly)
|
||||
|
||||
|
@ -77,12 +77,12 @@ def getGridData(request, times=[]):
|
|||
Gets the grid data that matches the request at the specified times. Each
|
||||
combination of parameter, level, and dataTime will be returned as a
|
||||
separate IGridData.
|
||||
|
||||
|
||||
Args:
|
||||
request: the IDataRequest to get data for
|
||||
times: a list of DataTimes, a TimeRange, or None if the data is time
|
||||
agnostic
|
||||
|
||||
|
||||
Returns:
|
||||
a list of IGridData
|
||||
"""
|
||||
|
@ -91,14 +91,14 @@ def getGridData(request, times=[]):
|
|||
def getGeometryData(request, times=[]):
|
||||
"""
|
||||
Gets the geometry data that matches the request at the specified times.
|
||||
Each combination of geometry, level, and dataTime will be returned as a
|
||||
Each combination of geometry, level, and dataTime will be returned as a
|
||||
separate IGeometryData.
|
||||
|
||||
|
||||
Args:
|
||||
request: the IDataRequest to get data for
|
||||
times: a list of DataTimes, a TimeRange, or None if the data is time
|
||||
agnostic
|
||||
|
||||
|
||||
Returns:
|
||||
a list of IGeometryData
|
||||
"""
|
||||
|
@ -108,10 +108,10 @@ def getAvailableLocationNames(request):
|
|||
"""
|
||||
Gets the available location names that match the request without actually
|
||||
requesting the data.
|
||||
|
||||
|
||||
Args:
|
||||
request: the request to find matching location names for
|
||||
|
||||
|
||||
Returns:
|
||||
a list of strings of available location names.
|
||||
"""
|
||||
|
@ -121,10 +121,10 @@ def getAvailableParameters(request):
|
|||
"""
|
||||
Gets the available parameters names that match the request without actually
|
||||
requesting the data.
|
||||
|
||||
|
||||
Args:
|
||||
request: the request to find matching parameter names for
|
||||
|
||||
|
||||
Returns:
|
||||
a list of strings of available parameter names.
|
||||
"""
|
||||
|
@ -134,10 +134,10 @@ def getAvailableLevels(request):
|
|||
"""
|
||||
Gets the available levels that match the request without actually
|
||||
requesting the data.
|
||||
|
||||
|
||||
Args:
|
||||
request: the request to find matching levels for
|
||||
|
||||
|
||||
Returns:
|
||||
a list of strings of available levels.
|
||||
"""
|
||||
|
@ -147,10 +147,10 @@ def getRequiredIdentifiers(datatype):
|
|||
"""
|
||||
Gets the required identifiers for this datatype. These identifiers
|
||||
must be set on a request for the request of this datatype to succeed.
|
||||
|
||||
|
||||
Args:
|
||||
datatype: the datatype to find required identifiers for
|
||||
|
||||
|
||||
Returns:
|
||||
a list of strings of required identifiers
|
||||
"""
|
||||
|
@ -159,10 +159,10 @@ def getRequiredIdentifiers(datatype):
|
|||
def getOptionalIdentifiers(datatype):
|
||||
"""
|
||||
Gets the optional identifiers for this datatype.
|
||||
|
||||
|
||||
Args:
|
||||
datatype: the datatype to find optional identifiers for
|
||||
|
||||
|
||||
Returns:
|
||||
a list of strings of optional identifiers
|
||||
"""
|
||||
|
@ -172,7 +172,7 @@ def newDataRequest(datatype=None, **kwargs):
|
|||
""""
|
||||
Creates a new instance of IDataRequest suitable for the runtime environment.
|
||||
All args are optional and exist solely for convenience.
|
||||
|
||||
|
||||
Args:
|
||||
datatype: the datatype to create a request for
|
||||
parameters: a list of parameters to set on the request
|
||||
|
@ -180,28 +180,28 @@ def newDataRequest(datatype=None, **kwargs):
|
|||
locationNames: a list of locationNames to set on the request
|
||||
envelope: an envelope to limit the request
|
||||
**kwargs: any leftover kwargs will be set as identifiers
|
||||
|
||||
|
||||
Returns:
|
||||
a new IDataRequest
|
||||
"""
|
||||
"""
|
||||
return router.newDataRequest(datatype, **kwargs)
|
||||
|
||||
def getSupportedDatatypes():
|
||||
"""
|
||||
Gets the datatypes that are supported by the framework
|
||||
|
||||
|
||||
Returns:
|
||||
a list of strings of supported datatypes
|
||||
"""
|
||||
return router.getSupportedDatatypes()
|
||||
|
||||
|
||||
|
||||
def changeEDEXHost(newHostName):
|
||||
"""
|
||||
Changes the EDEX host the Data Access Framework is communicating with. Only
|
||||
works if using the native Python client implementation, otherwise, this
|
||||
method will throw a TypeError.
|
||||
|
||||
|
||||
Args:
|
||||
newHostHame: the EDEX host to connect to
|
||||
"""
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,20 +21,20 @@
|
|||
#
|
||||
# Implements IData for use by native Python clients to the Data Access
|
||||
# Framework.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 06/03/13 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from awips.dataaccess import IData
|
||||
|
||||
class PyData(IData):
|
||||
|
||||
|
||||
def __init__(self, dataRecord):
|
||||
self.__time = dataRecord.getTime()
|
||||
self.__level = dataRecord.getLevel()
|
||||
|
@ -43,15 +43,15 @@ class PyData(IData):
|
|||
|
||||
def getAttribute(self, key):
|
||||
return self.__attributes[key]
|
||||
|
||||
|
||||
def getAttributes(self):
|
||||
return self.__attributes.keys()
|
||||
|
||||
|
||||
def getDataTime(self):
|
||||
return self.__time
|
||||
|
||||
|
||||
def getLevel(self):
|
||||
return self.__level
|
||||
|
||||
|
||||
def getLocationName(self):
|
||||
return self.__locationName
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,25 +21,25 @@
|
|||
#
|
||||
# Implements IGeometryData for use by native Python clients to the Data Access
|
||||
# Framework.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 06/03/13 dgilling Initial Creation.
|
||||
# 01/06/14 #2537 bsteffen Share geometry WKT.
|
||||
# 03/19/14 #2882 dgilling Raise an exception when getNumber()
|
||||
# is called for data that is not a
|
||||
# is called for data that is not a
|
||||
# numeric Type.
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from awips.dataaccess import IGeometryData
|
||||
from awips.dataaccess import PyData
|
||||
|
||||
class PyGeometryData(IGeometryData, PyData.PyData):
|
||||
|
||||
|
||||
def __init__(self, geoDataRecord, geometry):
|
||||
PyData.PyData.__init__(self, geoDataRecord)
|
||||
self.__geometry = geometry
|
||||
|
@ -50,18 +50,18 @@ class PyGeometryData(IGeometryData, PyData.PyData):
|
|||
|
||||
def getGeometry(self):
|
||||
return self.__geometry
|
||||
|
||||
def getParameters(self):
|
||||
|
||||
def getParameters(self):
|
||||
return self.__dataMap.keys()
|
||||
|
||||
|
||||
def getString(self, param):
|
||||
value = self.__dataMap[param][0]
|
||||
return str(value)
|
||||
|
||||
def getNumber(self, param):
|
||||
|
||||
def getNumber(self, param):
|
||||
value = self.__dataMap[param][0]
|
||||
t = self.getType(param)
|
||||
if t == 'INT':
|
||||
t = self.getType(param)
|
||||
if t == 'INT':
|
||||
return int(value)
|
||||
elif t == 'LONG':
|
||||
return long(value)
|
||||
|
@ -71,9 +71,9 @@ class PyGeometryData(IGeometryData, PyData.PyData):
|
|||
return float(value)
|
||||
else:
|
||||
raise TypeError("Data for parameter " + param + " is not a numeric type.")
|
||||
|
||||
|
||||
def getUnit(self, param):
|
||||
return self.__dataMap[param][2]
|
||||
|
||||
|
||||
def getType(self, param):
|
||||
return self.__dataMap[param][1]
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# #
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
# #
|
||||
|
@ -21,14 +21,14 @@
|
|||
#
|
||||
# Implements IGridData for use by native Python clients to the Data Access
|
||||
# Framework.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 06/03/13 #2023 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@ The ability to unit convert grid data is not currently available in this version
|
|||
|
||||
|
||||
class PyGridData(IGridData, PyData.PyData):
|
||||
|
||||
|
||||
def __init__(self, gridDataRecord, nx, ny, latLonGrid):
|
||||
PyData.PyData.__init__(self, gridDataRecord)
|
||||
nx = nx
|
||||
|
@ -53,13 +53,13 @@ class PyGridData(IGridData, PyData.PyData):
|
|||
self.__unit = gridDataRecord.getUnit()
|
||||
self.__gridData = numpy.reshape(numpy.array(gridDataRecord.getGridData()), (nx, ny))
|
||||
self.__latLonGrid = latLonGrid
|
||||
|
||||
|
||||
def getParameter(self):
|
||||
return self.__parameter
|
||||
|
||||
|
||||
def getUnit(self):
|
||||
return self.__unit
|
||||
|
||||
|
||||
def getRawData(self, unit=None):
|
||||
# TODO: Find a proper python library that deals will with numpy and
|
||||
# javax.measure style unit strings and hook it in to this method to
|
||||
|
@ -67,6 +67,6 @@ class PyGridData(IGridData, PyData.PyData):
|
|||
if unit is not None:
|
||||
warnings.warn(NO_UNIT_CONVERT_WARNING, stacklevel=2)
|
||||
return self.__gridData
|
||||
|
||||
|
||||
def getLatLonCoords(self):
|
||||
return self.__latLonGrid
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# #
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
# #
|
||||
|
@ -21,10 +21,10 @@
|
|||
#
|
||||
# Routes requests to the Data Access Framework through Python Thrift.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 05/21/13 #2023 dgilling Initial Creation.
|
||||
|
@ -56,18 +56,18 @@ from awips.dataaccess import PyGridData
|
|||
|
||||
|
||||
class ThriftClientRouter(object):
|
||||
|
||||
|
||||
def __init__(self, host='localhost'):
|
||||
self._client = ThriftClient.ThriftClient(host)
|
||||
|
||||
|
||||
def getAvailableTimes(self, request, refTimeOnly):
|
||||
timesRequest = GetAvailableTimesRequest()
|
||||
timesRequest.setRequestParameters(request)
|
||||
timesRequest.setRefTimeOnly(refTimeOnly)
|
||||
response = self._client.sendRequest(timesRequest)
|
||||
return response
|
||||
|
||||
def getGridData(self, request, times):
|
||||
|
||||
def getGridData(self, request, times):
|
||||
gridDataRequest = GetGridDataRequest()
|
||||
gridDataRequest.setRequestParameters(request)
|
||||
# if we have an iterable times instance, then the user must have asked
|
||||
|
@ -80,7 +80,7 @@ class ThriftClientRouter(object):
|
|||
except TypeError:
|
||||
gridDataRequest.setRequestedPeriod(times)
|
||||
response = self._client.sendRequest(gridDataRequest)
|
||||
|
||||
|
||||
locSpecificData = {}
|
||||
locNames = response.getSiteNxValues().keys()
|
||||
for location in locNames:
|
||||
|
@ -89,14 +89,14 @@ class ThriftClientRouter(object):
|
|||
latData = numpy.reshape(numpy.array(response.getSiteLatGrids()[location]), (nx, ny))
|
||||
lonData = numpy.reshape(numpy.array(response.getSiteLonGrids()[location]), (nx, ny))
|
||||
locSpecificData[location] = (nx, ny, (lonData, latData))
|
||||
|
||||
|
||||
retVal = []
|
||||
for gridDataRecord in response.getGridData():
|
||||
locationName = gridDataRecord.getLocationName()
|
||||
locData = locSpecificData[locationName]
|
||||
retVal.append(PyGridData.PyGridData(gridDataRecord, locData[0], locData[1], locData[2]))
|
||||
return retVal
|
||||
|
||||
|
||||
def getGeometryData(self, request, times):
|
||||
geoDataRequest = GetGeometryDataRequest()
|
||||
geoDataRequest.setRequestParameters(request)
|
||||
|
@ -113,7 +113,7 @@ class ThriftClientRouter(object):
|
|||
geometries = []
|
||||
for wkt in response.getGeometryWKTs():
|
||||
geometries.append(shapely.wkt.loads(wkt))
|
||||
|
||||
|
||||
retVal = []
|
||||
for geoDataRecord in response.getGeoData():
|
||||
geom = geometries[geoDataRecord.getGeometryWKTindex()]
|
||||
|
@ -125,48 +125,48 @@ class ThriftClientRouter(object):
|
|||
locNamesRequest.setRequestParameters(request)
|
||||
response = self._client.sendRequest(locNamesRequest)
|
||||
return response
|
||||
|
||||
|
||||
def getAvailableParameters(self, request):
|
||||
paramReq = GetAvailableParametersRequest()
|
||||
paramReq.setRequestParameters(request)
|
||||
response = self._client.sendRequest(paramReq)
|
||||
return response
|
||||
|
||||
|
||||
def getAvailableLevels(self, request):
|
||||
levelReq = GetAvailableLevelsRequest()
|
||||
levelReq.setRequestParameters(request)
|
||||
response = self._client.sendRequest(levelReq)
|
||||
return response
|
||||
|
||||
|
||||
def getRequiredIdentifiers(self, datatype):
|
||||
idReq = GetRequiredIdentifiersRequest()
|
||||
idReq.setDatatype(datatype)
|
||||
response = self._client.sendRequest(idReq)
|
||||
return response
|
||||
|
||||
|
||||
def getOptionalIdentifiers(self, datatype):
|
||||
idReq = GetOptionalIdentifiersRequest()
|
||||
idReq.setDatatype(datatype)
|
||||
response = self._client.sendRequest(idReq)
|
||||
return response
|
||||
return response
|
||||
|
||||
def newDataRequest(self, datatype, parameters=[], levels=[], locationNames = [], envelope=None, **kwargs):
|
||||
req = DefaultDataRequest()
|
||||
if datatype:
|
||||
req.setDatatype(datatype)
|
||||
if parameters:
|
||||
if parameters:
|
||||
req.setParameters(*parameters)
|
||||
if levels:
|
||||
if levels:
|
||||
req.setLevels(*levels)
|
||||
if locationNames:
|
||||
req.setLocationNames(*locationNames)
|
||||
if envelope:
|
||||
req.setEnvelope(envelope)
|
||||
req.setEnvelope(envelope)
|
||||
if kwargs:
|
||||
# any args leftover are assumed to be identifiers
|
||||
req.identifiers = kwargs
|
||||
req.identifiers = kwargs
|
||||
return req
|
||||
|
||||
def getSupportedDatatypes(self):
|
||||
|
||||
def getSupportedDatatypes(self):
|
||||
response = self._client.sendRequest(GetSupportedDatatypesRequest())
|
||||
return response
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,10 +21,10 @@
|
|||
|
||||
#
|
||||
# __init__.py for awips.dataaccess package
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 12/10/12 njensen Initial Creation.
|
||||
|
@ -33,11 +33,11 @@
|
|||
# Apr 09, 2013 1871 njensen Add doc strings
|
||||
# Jun 03, 2013 2023 dgilling Add getAttributes to IData, add
|
||||
# getLatLonGrids() to IGridData.
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
__all__ = [
|
||||
|
||||
|
||||
]
|
||||
|
||||
import abc
|
||||
|
@ -47,119 +47,119 @@ class IDataRequest(object):
|
|||
An IDataRequest to be submitted to the DataAccessLayer to retrieve data.
|
||||
"""
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def setDatatype(self, datatype):
|
||||
"""
|
||||
Sets the datatype of the request.
|
||||
|
||||
|
||||
Args:
|
||||
datatype: A string of the datatype, such as "grid", "radar", "gfe", "obs"
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def addIdentifier(self, key, value):
|
||||
"""
|
||||
Adds an identifier to the request. Identifiers are specific to the
|
||||
datatype being requested.
|
||||
|
||||
|
||||
Args:
|
||||
key: the string key of the identifier
|
||||
value: the value of the identifier
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def setParameters(self, params):
|
||||
"""
|
||||
Sets the parameters of data to request.
|
||||
|
||||
|
||||
Args:
|
||||
params: a list of strings of parameters to request
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def setLevels(self, levels):
|
||||
"""
|
||||
Sets the levels of data to request. Not all datatypes support levels.
|
||||
|
||||
|
||||
Args:
|
||||
levels: a list of strings of level abbreviations to request
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def setEnvelope(self, env):
|
||||
"""
|
||||
Sets the envelope of the request. If supported by the datatype factory,
|
||||
the data returned for the request will be constrained to only the data
|
||||
within the envelope.
|
||||
|
||||
|
||||
Args:
|
||||
env: a shapely geometry
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def setLocationNames(self, locationNames):
|
||||
"""
|
||||
Sets the location names of the request.
|
||||
|
||||
|
||||
Args:
|
||||
locationNames: a list of strings of location names to request
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getDatatype(self):
|
||||
"""
|
||||
Gets the datatype of the request
|
||||
|
||||
|
||||
Returns:
|
||||
the datatype set on the request
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getIdentifiers(self):
|
||||
"""
|
||||
Gets the identifiers on the request
|
||||
|
||||
|
||||
Returns:
|
||||
a dictionary of the identifiers
|
||||
"""
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getLevels(self):
|
||||
"""
|
||||
Gets the levels on the request
|
||||
|
||||
|
||||
Returns:
|
||||
a list of strings of the levels
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getLocationNames(self):
|
||||
"""
|
||||
Gets the location names on the request
|
||||
|
||||
|
||||
Returns:
|
||||
a list of strings of the location names
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getEnvelope(self):
|
||||
"""
|
||||
Gets the envelope on the request
|
||||
|
||||
|
||||
Returns:
|
||||
a rectangular shapely geometry
|
||||
"""
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
|
@ -169,55 +169,55 @@ class IData(object):
|
|||
An IData representing data returned from the DataAccessLayer.
|
||||
"""
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getAttribute(self, key):
|
||||
"""
|
||||
Gets an attribute of the data.
|
||||
|
||||
|
||||
Args:
|
||||
key: the key of the attribute
|
||||
|
||||
|
||||
Returns:
|
||||
the value of the attribute
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getAttributes(self):
|
||||
"""
|
||||
Gets the valid attributes for the data.
|
||||
|
||||
|
||||
Returns:
|
||||
a list of strings of the attribute names
|
||||
a list of strings of the attribute names
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getDataTime(self):
|
||||
"""
|
||||
Gets the data time of the data.
|
||||
|
||||
|
||||
Returns:
|
||||
the data time of the data, or None if no time is associated
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getLevel(self):
|
||||
"""
|
||||
Gets the level of the data.
|
||||
|
||||
|
||||
Returns:
|
||||
the level of the data, or None if no level is associated
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getLocationName(self, param):
|
||||
"""
|
||||
Gets the location name of the data.
|
||||
|
||||
|
||||
Returns:
|
||||
the location name of the data, or None if no location name is
|
||||
associated
|
||||
|
@ -230,44 +230,44 @@ class IGridData(IData):
|
|||
"""
|
||||
An IData representing grid data that is returned by the DataAccessLayer.
|
||||
"""
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getParameter(self):
|
||||
"""
|
||||
Gets the parameter of the data.
|
||||
|
||||
|
||||
Returns:
|
||||
the parameter of the data
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getUnit(self):
|
||||
"""
|
||||
Gets the unit of the data.
|
||||
|
||||
|
||||
Returns:
|
||||
the string abbreviation of the unit, or None if no unit is associated
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getRawData(self):
|
||||
"""
|
||||
Gets the grid data as a numpy array.
|
||||
|
||||
|
||||
Returns:
|
||||
a numpy array of the data
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getLatLonCoords(self):
|
||||
"""
|
||||
Gets the lat/lon coordinates of the grid data.
|
||||
|
||||
|
||||
Returns:
|
||||
a tuple where the first element is a numpy array of lons, and the
|
||||
a tuple where the first element is a numpy array of lons, and the
|
||||
second element is a numpy array of lats
|
||||
"""
|
||||
return
|
||||
|
@ -278,73 +278,73 @@ class IGeometryData(IData):
|
|||
"""
|
||||
An IData representing geometry data that is returned by the DataAccessLayer.
|
||||
"""
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getGeometry(self):
|
||||
"""
|
||||
Gets the geometry of the data.
|
||||
|
||||
|
||||
Returns:
|
||||
a shapely geometry
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getParameters(self):
|
||||
"""Gets the parameters of the data.
|
||||
|
||||
|
||||
Returns:
|
||||
a list of strings of the parameter names
|
||||
a list of strings of the parameter names
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getString(self, param):
|
||||
"""
|
||||
Gets the string value of the specified param.
|
||||
|
||||
|
||||
Args:
|
||||
param: the string name of the param
|
||||
|
||||
|
||||
Returns:
|
||||
the string value of the param
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getNumber(self, param):
|
||||
"""
|
||||
Gets the number value of the specified param.
|
||||
|
||||
|
||||
Args:
|
||||
param: the string name of the param
|
||||
|
||||
|
||||
Returns:
|
||||
the number value of the param
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getUnit(self, param):
|
||||
"""
|
||||
Gets the unit of the specified param.
|
||||
|
||||
|
||||
Args:
|
||||
param: the string name of the param
|
||||
|
||||
|
||||
Returns:
|
||||
the string abbreviation of the unit of the param
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def getType(self, param):
|
||||
"""
|
||||
Gets the type of the param.
|
||||
|
||||
|
||||
Args:
|
||||
param: the string name of the param
|
||||
|
||||
|
||||
Returns:
|
||||
a string of the type of the parameter, such as
|
||||
"STRING", "INT", "LONG", "FLOAT", or "DOUBLE"
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -34,16 +34,16 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.server.messa
|
|||
|
||||
#
|
||||
# Provides a Python-based interface for executing GFE requests.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 07/26/12 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
@ -57,14 +57,14 @@ class IFPClient(object):
|
|||
if len(sr.getPayload()) > 0:
|
||||
site = sr.getPayload()[0]
|
||||
self.__siteId = site
|
||||
|
||||
|
||||
def commitGrid(self, request):
|
||||
if type(request) is CommitGridRequest:
|
||||
return self.__commitGrid([request])
|
||||
elif self.__isHomogenousIterable(request, CommitGridRequest):
|
||||
return self.__commitGrid([cgr for cgr in request])
|
||||
raise TypeError("Invalid type: " + str(type(request)) + " specified to commitGrid(). Only accepts CommitGridRequest or lists of CommitGridRequest.")
|
||||
|
||||
|
||||
def __commitGrid(self, requests):
|
||||
ssr = ServerResponse()
|
||||
request = CommitGridsRequest()
|
||||
|
@ -72,15 +72,15 @@ class IFPClient(object):
|
|||
sr = self.__makeRequest(request)
|
||||
ssr.setMessages(sr.getMessages())
|
||||
return ssr
|
||||
|
||||
|
||||
def getParmList(self, id):
|
||||
argType = type(id)
|
||||
if argType is DatabaseID:
|
||||
return self.__getParmList([id])
|
||||
elif self.__isHomogenousIterable(id, DatabaseID):
|
||||
return self.__getParmList([dbid for dbid in id])
|
||||
raise TypeError("Invalid type: " + str(argType) + " specified to getParmList(). Only accepts DatabaseID or lists of DatabaseID.")
|
||||
|
||||
raise TypeError("Invalid type: " + str(argType) + " specified to getParmList(). Only accepts DatabaseID or lists of DatabaseID.")
|
||||
|
||||
def __getParmList(self, ids):
|
||||
ssr = ServerResponse()
|
||||
request = GetParmListRequest()
|
||||
|
@ -90,7 +90,7 @@ class IFPClient(object):
|
|||
list = sr.getPayload() if sr.getPayload() is not None else []
|
||||
ssr.setPayload(list)
|
||||
return ssr
|
||||
|
||||
|
||||
def __isHomogenousIterable(self, iterable, classType):
|
||||
try:
|
||||
iterator = iter(iterable)
|
||||
|
@ -100,7 +100,7 @@ class IFPClient(object):
|
|||
except TypeError:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def getGridInventory(self, parmID):
|
||||
if type(parmID) is ParmID:
|
||||
sr = self.__getGridInventory([parmID])
|
||||
|
@ -115,7 +115,7 @@ class IFPClient(object):
|
|||
elif self.__isHomogenousIterable(parmID, ParmID):
|
||||
return self.__getGridInventory([id for id in parmID])
|
||||
raise TypeError("Invalid type: " + str(type(parmID)) + " specified to getGridInventory(). Only accepts ParmID or lists of ParmID.")
|
||||
|
||||
|
||||
def __getGridInventory(self, parmIDs):
|
||||
ssr = ServerResponse()
|
||||
request = GetGridInventoryRequest()
|
||||
|
@ -125,7 +125,7 @@ class IFPClient(object):
|
|||
trs = sr.getPayload() if sr.getPayload() is not None else {}
|
||||
ssr.setPayload(trs)
|
||||
return ssr
|
||||
|
||||
|
||||
def getSelectTR(self, name):
|
||||
request = GetSelectTimeRangeRequest()
|
||||
request.setName(name)
|
||||
|
@ -134,7 +134,7 @@ class IFPClient(object):
|
|||
ssr.setMessages(sr.getMessages())
|
||||
ssr.setPayload(sr.getPayload())
|
||||
return ssr
|
||||
|
||||
|
||||
def getSiteID(self):
|
||||
ssr = ServerResponse()
|
||||
request = GetActiveSitesRequest()
|
||||
|
@ -143,7 +143,7 @@ class IFPClient(object):
|
|||
ids = sr.getPayload() if sr.getPayload() is not None else []
|
||||
sr.setPayload(ids)
|
||||
return sr
|
||||
|
||||
|
||||
def __makeRequest(self, request):
|
||||
try:
|
||||
request.setSiteID(self.__siteId)
|
||||
|
@ -153,7 +153,7 @@ class IFPClient(object):
|
|||
request.setWorkstationID(self.__wsId)
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
|
||||
sr = ServerResponse()
|
||||
response = None
|
||||
try:
|
||||
|
@ -169,5 +169,5 @@ class IFPClient(object):
|
|||
except AttributeError:
|
||||
# not a server response, nothing else to do
|
||||
pass
|
||||
|
||||
|
||||
return sr
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,17 +21,17 @@
|
|||
|
||||
#
|
||||
# __init__.py for awips.gfe package
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 07/26/12 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
__all__ = [
|
||||
__all__ = [
|
||||
]
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
# 06/13/2013 DR 16242 D. Friedman Add Qpid authentication info
|
||||
# 03/06/2014 DR 17907 D. Friedman Workaround for issue QPID-5569
|
||||
#
|
||||
#===============================================================================
|
||||
#===============================================================================
|
||||
|
||||
import qpid
|
||||
from qpid.util import connect
|
||||
|
@ -77,7 +77,7 @@ class IngestViaQPID:
|
|||
@param host: string hostname of computer running EDEX and QPID (default localhost)
|
||||
@param port: integer port used to connect to QPID (default 5672)
|
||||
'''
|
||||
|
||||
|
||||
try:
|
||||
#
|
||||
self.socket = connect(host, port)
|
||||
|
@ -88,7 +88,7 @@ class IngestViaQPID:
|
|||
print 'Connected to Qpid'
|
||||
except:
|
||||
print 'Unable to connect to Qpid'
|
||||
|
||||
|
||||
def sendmessage(self, filepath, header):
|
||||
'''
|
||||
This function sends a message to the external.dropbox queue providing the path
|
||||
|
@ -101,11 +101,11 @@ class IngestViaQPID:
|
|||
head = self.session.message_properties(application_headers={'header':header},
|
||||
user_id=QPID_USERNAME) # For issue QPID-5569. Fixed in Qpid 0.27
|
||||
self.session.message_transfer(destination='amq.direct', message=Message(props, head, filepath))
|
||||
|
||||
|
||||
def close(self):
|
||||
'''
|
||||
After all messages are sent call this function to close connection and make sure
|
||||
there are no threads left open
|
||||
'''
|
||||
self.session.close(timeout=10)
|
||||
print 'Connection to Qpid closed'
|
||||
print 'Connection to Qpid closed'
|
||||
|
|
138
awips/stomp.py
138
awips/stomp.py
|
@ -2,19 +2,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -23,14 +23,14 @@
|
|||
This provides basic connectivity to a message broker supporting the 'stomp' protocol.
|
||||
At the moment ACK, SEND, SUBSCRIBE, UNSUBSCRIBE, BEGIN, ABORT, COMMIT, CONNECT and DISCONNECT operations
|
||||
are supported.
|
||||
|
||||
|
||||
This changes the previous version which required a listener per subscription -- now a listener object
|
||||
just calls the 'addlistener' method and will receive all messages sent in response to all/any subscriptions.
|
||||
(The reason for the change is that the handling of an 'ack' becomes problematic unless the listener mechanism
|
||||
is decoupled from subscriptions).
|
||||
|
||||
|
||||
Note that you must 'start' an instance of Connection to begin receiving messages. For example:
|
||||
|
||||
|
||||
conn = stomp.Connection([('localhost', 62003)], 'myuser', 'mypass')
|
||||
conn.start()
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
|||
License: http://www.apache.org/licenses/LICENSE-2.0
|
||||
Start Date: 2005/12/01
|
||||
Last Revision Date: $Date: 2008/09/11 00:16 $
|
||||
|
||||
|
||||
Notes/Attribution
|
||||
-----------------
|
||||
* uuid method courtesy of Carl Free Jr:
|
||||
|
@ -49,7 +49,7 @@
|
|||
* patches from Julian Scheid of Rising Sun Pictures (http://open.rsp.com.au)
|
||||
* patch from Fernando
|
||||
* patches from Eugene Strulyov
|
||||
|
||||
|
||||
Updates
|
||||
-------
|
||||
* 2007/03/31 : (Andreas Schobel) patch to fix newlines problem in ActiveMQ 4.1
|
||||
|
@ -57,18 +57,18 @@
|
|||
* 2007/09/05 : (Julian Scheid) patch to allow sending custom headers
|
||||
* 2007/09/18 : (JRB) changed code to use logging instead of just print. added logger for jython to work
|
||||
* 2007/09/18 : (Julian Scheid) various updates, including:
|
||||
- change incoming message handling so that callbacks are invoked on the listener not only for MESSAGE, but also for
|
||||
- change incoming message handling so that callbacks are invoked on the listener not only for MESSAGE, but also for
|
||||
CONNECTED, RECEIPT and ERROR frames.
|
||||
- callbacks now get not only the payload but any headers specified by the server
|
||||
- all outgoing messages now sent via a single method
|
||||
- only one connection used
|
||||
- only one connection used
|
||||
- change to use thread instead of threading
|
||||
- sends performed on the calling thread
|
||||
- receiver loop now deals with multiple messages in one received chunk of data
|
||||
- added reconnection attempts and connection fail-over
|
||||
- changed defaults for "user" and "passcode" to None instead of empty string (fixed transmission of those values)
|
||||
- added readline support
|
||||
* 2008/03/26 : (Fernando) added cStringIO for faster performance on large messages
|
||||
* 2008/03/26 : (Fernando) added cStringIO for faster performance on large messages
|
||||
* 2008/09/10 : (Eugene) remove lower() on headers to support case-sensitive header names
|
||||
* 2008/09/11 : (JRB) fix incompatibilities with RabbitMQ, add wait for socket-connect
|
||||
* 2008/10/28 : (Eugene) add jms map (from stomp1.1 ideas)
|
||||
|
@ -105,10 +105,10 @@ def _uuid( *args ):
|
|||
uuid courtesy of Carl Free Jr:
|
||||
(http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/213761)
|
||||
"""
|
||||
|
||||
|
||||
t = long( time.time() * 1000 )
|
||||
r = long( random.random() * 100000000000000000L )
|
||||
|
||||
|
||||
try:
|
||||
a = socket.gethostbyname( socket.gethostname() )
|
||||
except:
|
||||
|
@ -119,7 +119,7 @@ def _uuid( *args ):
|
|||
md5.update(data)
|
||||
data = md5.hexdigest()
|
||||
return data
|
||||
|
||||
|
||||
|
||||
class DevNullLogger(object):
|
||||
"""
|
||||
|
@ -127,17 +127,17 @@ class DevNullLogger(object):
|
|||
"""
|
||||
def log(self, msg):
|
||||
print msg
|
||||
|
||||
|
||||
def devnull(self, msg):
|
||||
pass
|
||||
|
||||
|
||||
debug = devnull
|
||||
info = devnull
|
||||
warning = log
|
||||
error = log
|
||||
critical = log
|
||||
exception = log
|
||||
|
||||
|
||||
def isEnabledFor(self, lvl):
|
||||
return False
|
||||
|
||||
|
@ -153,7 +153,7 @@ try:
|
|||
except:
|
||||
log = DevNullLogger()
|
||||
|
||||
|
||||
|
||||
class ConnectionClosedException(Exception):
|
||||
"""
|
||||
Raised in the receiver thread when the connection has been closed
|
||||
|
@ -255,8 +255,8 @@ class Connection(object):
|
|||
Represents a STOMP client connection.
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
host_and_ports = [ ('localhost', 61613) ],
|
||||
def __init__(self,
|
||||
host_and_ports = [ ('localhost', 61613) ],
|
||||
user = None,
|
||||
passcode = None,
|
||||
prefer_localhost = True,
|
||||
|
@ -268,25 +268,25 @@ class Connection(object):
|
|||
"""
|
||||
Initialize and start this connection.
|
||||
|
||||
\param host_and_ports
|
||||
\param host_and_ports
|
||||
a list of (host, port) tuples.
|
||||
|
||||
\param prefer_localhost
|
||||
if True and the local host is mentioned in the (host,
|
||||
port) tuples, try to connect to this first
|
||||
|
||||
\param try_loopback_connect
|
||||
\param try_loopback_connect
|
||||
if True and the local host is found in the host
|
||||
tuples, try connecting to it using loopback interface
|
||||
(127.0.0.1)
|
||||
|
||||
\param reconnect_sleep_initial
|
||||
\param reconnect_sleep_initial
|
||||
|
||||
initial delay in seconds to wait before reattempting
|
||||
to establish a connection if connection to any of the
|
||||
hosts fails.
|
||||
|
||||
\param reconnect_sleep_increase
|
||||
\param reconnect_sleep_increase
|
||||
|
||||
factor by which the sleep delay is increased after
|
||||
each connection attempt. For example, 0.5 means
|
||||
|
@ -318,7 +318,7 @@ class Connection(object):
|
|||
def is_local_host(host):
|
||||
return host in Connection.__localhost_names
|
||||
|
||||
sorted_host_and_ports.sort(lambda x, y: (int(is_local_host(y[0]))
|
||||
sorted_host_and_ports.sort(lambda x, y: (int(is_local_host(y[0]))
|
||||
- int(is_local_host(x[0]))))
|
||||
|
||||
# If the user wishes to attempt connecting to local ports
|
||||
|
@ -330,7 +330,7 @@ class Connection(object):
|
|||
for host_and_port in sorted_host_and_ports:
|
||||
if is_local_host(host_and_port[0]):
|
||||
port = host_and_port[1]
|
||||
if (not ("127.0.0.1", port) in sorted_host_and_ports
|
||||
if (not ("127.0.0.1", port) in sorted_host_and_ports
|
||||
and not ("localhost", port) in sorted_host_and_ports):
|
||||
loopback_host_and_ports.append(("127.0.0.1", port))
|
||||
|
||||
|
@ -347,7 +347,7 @@ class Connection(object):
|
|||
self.__reconnect_sleep_increase = reconnect_sleep_increase
|
||||
self.__reconnect_sleep_jitter = reconnect_sleep_jitter
|
||||
self.__reconnect_sleep_max = reconnect_sleep_max
|
||||
|
||||
|
||||
self.__connect_headers = {}
|
||||
if user is not None and passcode is not None:
|
||||
self.__connect_headers['login'] = user
|
||||
|
@ -393,20 +393,20 @@ class Connection(object):
|
|||
connection.
|
||||
"""
|
||||
return self.__current_host_and_port
|
||||
|
||||
|
||||
def is_connected(self):
|
||||
try:
|
||||
return self.__socket is not None and self.__socket.getsockname()[1] != 0
|
||||
except socket.error:
|
||||
return False
|
||||
|
||||
|
||||
#
|
||||
# Manage objects listening to incoming frames
|
||||
#
|
||||
|
||||
def add_listener(self, listener):
|
||||
self.__listeners.append(listener)
|
||||
|
||||
|
||||
def remove_listener(self, listener):
|
||||
self.__listeners.remove(listener)
|
||||
|
||||
|
@ -419,29 +419,29 @@ class Connection(object):
|
|||
|
||||
def unsubscribe(self, headers={}, **keyword_headers):
|
||||
self.__send_frame_helper('UNSUBSCRIBE', '', self.__merge_headers([headers, keyword_headers]), [ ('destination', 'id') ])
|
||||
|
||||
|
||||
def send(self, message='', headers={}, **keyword_headers):
|
||||
if '\x00' in message:
|
||||
content_length_headers = {'content-length': len(message)}
|
||||
else:
|
||||
content_length_headers = {}
|
||||
self.__send_frame_helper('SEND', message, self.__merge_headers([headers,
|
||||
self.__send_frame_helper('SEND', message, self.__merge_headers([headers,
|
||||
keyword_headers,
|
||||
content_length_headers]), [ 'destination' ])
|
||||
|
||||
|
||||
def ack(self, headers={}, **keyword_headers):
|
||||
self.__send_frame_helper('ACK', '', self.__merge_headers([headers, keyword_headers]), [ 'message-id' ])
|
||||
|
||||
|
||||
def begin(self, headers={}, **keyword_headers):
|
||||
use_headers = self.__merge_headers([headers, keyword_headers])
|
||||
if not 'transaction' in use_headers.keys():
|
||||
if not 'transaction' in use_headers.keys():
|
||||
use_headers['transaction'] = _uuid()
|
||||
self.__send_frame_helper('BEGIN', '', use_headers, [ 'transaction' ])
|
||||
return use_headers['transaction']
|
||||
|
||||
def abort(self, headers={}, **keyword_headers):
|
||||
self.__send_frame_helper('ABORT', '', self.__merge_headers([headers, keyword_headers]), [ 'transaction' ])
|
||||
|
||||
|
||||
def commit(self, headers={}, **keyword_headers):
|
||||
self.__send_frame_helper('COMMIT', '', self.__merge_headers([headers, keyword_headers]), [ 'transaction' ])
|
||||
|
||||
|
@ -450,7 +450,7 @@ class Connection(object):
|
|||
while not self.is_connected(): time.sleep(0.1)
|
||||
del keyword_headers['wait']
|
||||
self.__send_frame_helper('CONNECT', '', self.__merge_headers([self.__connect_headers, headers, keyword_headers]), [ ])
|
||||
|
||||
|
||||
def disconnect(self, headers={}, **keyword_headers):
|
||||
self.__send_frame_helper('DISCONNECT', '', self.__merge_headers([self.__connect_headers, headers, keyword_headers]), [ ])
|
||||
self.__running = False
|
||||
|
@ -475,7 +475,7 @@ class Connection(object):
|
|||
#
|
||||
# Used to parse STOMP header lines in the format "key:value",
|
||||
#
|
||||
__header_line_re = re.compile('(?P<key>[^:]+)[:](?P<value>.*)')
|
||||
__header_line_re = re.compile('(?P<key>[^:]+)[:](?P<value>.*)')
|
||||
|
||||
#
|
||||
# Used to parse the STOMP "content-length" header lines,
|
||||
|
@ -493,7 +493,7 @@ class Connection(object):
|
|||
for header_key in header_map.keys():
|
||||
headers[header_key] = header_map[header_key]
|
||||
return headers
|
||||
|
||||
|
||||
def __convert_dict(self, payload):
|
||||
"""
|
||||
Encode python dictionary as <map>...</map> structure.
|
||||
|
@ -546,12 +546,12 @@ class Connection(object):
|
|||
"""
|
||||
if type(payload) == dict:
|
||||
headers["transformation"] = "jms-map-xml"
|
||||
payload = self.__convert_dict(payload)
|
||||
|
||||
payload = self.__convert_dict(payload)
|
||||
|
||||
if self.__socket is not None:
|
||||
frame = '%s\n%s\n%s\x00' % (command,
|
||||
reduce(lambda accu, key: accu + ('%s:%s\n' % (key, headers[key])), headers.keys(), ''),
|
||||
payload)
|
||||
payload)
|
||||
self.__socket.sendall(frame)
|
||||
log.debug("Sent frame: type=%s, headers=%r, body=%r" % (command, headers, payload))
|
||||
else:
|
||||
|
@ -575,23 +575,23 @@ class Connection(object):
|
|||
for listener in self.__listeners:
|
||||
if hasattr(listener, 'on_connecting'):
|
||||
listener.on_connecting(self.__current_host_and_port)
|
||||
|
||||
|
||||
while self.__running:
|
||||
frames = self.__read()
|
||||
|
||||
|
||||
for frame in frames:
|
||||
(frame_type, headers, body) = self.__parse_frame(frame)
|
||||
log.debug("Received frame: result=%r, headers=%r, body=%r" % (frame_type, headers, body))
|
||||
frame_type = frame_type.lower()
|
||||
if frame_type in [ 'connected',
|
||||
'message',
|
||||
'receipt',
|
||||
if frame_type in [ 'connected',
|
||||
'message',
|
||||
'receipt',
|
||||
'error' ]:
|
||||
for listener in self.__listeners:
|
||||
if hasattr(listener, 'on_%s' % frame_type):
|
||||
eval('listener.on_%s(headers, body)' % frame_type)
|
||||
else:
|
||||
log.debug('listener %s has no such method on_%s' % (listener, frame_type))
|
||||
log.debug('listener %s has no such method on_%s' % (listener, frame_type))
|
||||
else:
|
||||
log.warning('Unknown response frame type: "%s" (frame length was %d)' % (frame_type, len(frame)))
|
||||
finally:
|
||||
|
@ -638,9 +638,9 @@ class Connection(object):
|
|||
if '\x00' in c:
|
||||
break
|
||||
self.__recvbuf += fastbuf.getvalue()
|
||||
fastbuf.close()
|
||||
fastbuf.close()
|
||||
result = []
|
||||
|
||||
|
||||
if len(self.__recvbuf) > 0 and self.__running:
|
||||
while True:
|
||||
pos = self.__recvbuf.find('\x00')
|
||||
|
@ -669,7 +669,7 @@ class Connection(object):
|
|||
else:
|
||||
break
|
||||
return result
|
||||
|
||||
|
||||
|
||||
def __transform(self, body, transType):
|
||||
"""
|
||||
|
@ -677,7 +677,7 @@ class Connection(object):
|
|||
'jms-map-xml', which converts a map into python dictionary. This can be extended
|
||||
to support other transformation types.
|
||||
|
||||
The body has the following format:
|
||||
The body has the following format:
|
||||
<map>
|
||||
<entry>
|
||||
<string>name</string>
|
||||
|
@ -710,7 +710,7 @@ class Connection(object):
|
|||
except Exception, ex:
|
||||
# unable to parse message. return original
|
||||
return body
|
||||
|
||||
|
||||
|
||||
def __parse_frame(self, frame):
|
||||
"""
|
||||
|
@ -769,8 +769,8 @@ class Connection(object):
|
|||
log.warning("Could not connect to host %s, port %s: %s" % (host_and_port[0], host_and_port[1], exc))
|
||||
|
||||
if self.__socket is None:
|
||||
sleep_duration = (min(self.__reconnect_sleep_max,
|
||||
((self.__reconnect_sleep_initial / (1.0 + self.__reconnect_sleep_increase))
|
||||
sleep_duration = (min(self.__reconnect_sleep_max,
|
||||
((self.__reconnect_sleep_initial / (1.0 + self.__reconnect_sleep_increase))
|
||||
* math.pow(1.0 + self.__reconnect_sleep_increase, sleep_exp)))
|
||||
* (1.0 + random.random() * self.__reconnect_sleep_jitter))
|
||||
sleep_end = time.time() + sleep_duration
|
||||
|
@ -790,9 +790,9 @@ if __name__ == '__main__':
|
|||
try:
|
||||
import readline
|
||||
def stomp_completer(text, state):
|
||||
commands = [ 'subscribe', 'unsubscribe',
|
||||
'send', 'ack',
|
||||
'begin', 'abort', 'commit',
|
||||
commands = [ 'subscribe', 'unsubscribe',
|
||||
'send', 'ack',
|
||||
'begin', 'abort', 'commit',
|
||||
'connect', 'disconnect'
|
||||
]
|
||||
for command in commands[state:]:
|
||||
|
@ -839,44 +839,44 @@ if __name__ == '__main__':
|
|||
|
||||
def on_connected(self, headers, body):
|
||||
self.__print_async("CONNECTED", headers, body)
|
||||
|
||||
|
||||
def ack(self, args):
|
||||
if len(args) < 3:
|
||||
self.c.ack(message_id=args[1])
|
||||
else:
|
||||
self.c.ack(message_id=args[1], transaction=args[2])
|
||||
|
||||
|
||||
def abort(self, args):
|
||||
self.c.abort(transaction=args[1])
|
||||
|
||||
|
||||
def begin(self, args):
|
||||
print 'transaction id: %s' % self.c.begin()
|
||||
|
||||
|
||||
def commit(self, args):
|
||||
if len(args) < 2:
|
||||
print 'expecting: commit <transid>'
|
||||
else:
|
||||
print 'committing %s' % args[1]
|
||||
self.c.commit(transaction=args[1])
|
||||
|
||||
|
||||
def disconnect(self, args):
|
||||
try:
|
||||
self.c.disconnect()
|
||||
except NotConnectedException:
|
||||
pass # ignore if no longer connected
|
||||
|
||||
|
||||
def send(self, args):
|
||||
if len(args) < 3:
|
||||
print 'expecting: send <destination> <message>'
|
||||
else:
|
||||
self.c.send(destination=args[1], message=' '.join(args[2:]))
|
||||
|
||||
|
||||
def sendtrans(self, args):
|
||||
if len(args) < 3:
|
||||
print 'expecting: sendtrans <destination> <transid> <message>'
|
||||
else:
|
||||
self.c.send(destination=args[1], message="%s\n" % ' '.join(args[3:]), transaction=args[2])
|
||||
|
||||
|
||||
def subscribe(self, args):
|
||||
if len(args) < 2:
|
||||
print 'expecting: subscribe <destination> [ack]'
|
||||
|
@ -886,7 +886,7 @@ if __name__ == '__main__':
|
|||
else:
|
||||
print 'subscribing to "%s" with auto acknowledge' % args[1]
|
||||
self.c.subscribe(destination=args[1], ack='auto')
|
||||
|
||||
|
||||
def unsubscribe(self, args):
|
||||
if len(args) < 2:
|
||||
print 'expecting: unsubscribe <destination>'
|
||||
|
@ -906,14 +906,14 @@ if __name__ == '__main__':
|
|||
port = int(sys.argv[2])
|
||||
else:
|
||||
port = 61613
|
||||
|
||||
|
||||
if len(sys.argv) >= 5:
|
||||
user = sys.argv[3]
|
||||
passcode = sys.argv[4]
|
||||
else:
|
||||
user = None
|
||||
passcode = None
|
||||
|
||||
|
||||
st = StompTester(host, port, user, passcode)
|
||||
try:
|
||||
while True:
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -23,15 +23,15 @@
|
|||
# Pure python logging mechanism for logging to AlertViz from
|
||||
# pure python (ie not JEP). DO NOT USE IN PYTHON CALLED
|
||||
# FROM JAVA.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 11/03/10 5849 cjeanbap Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
import os
|
||||
|
@ -43,6 +43,6 @@ class Record():
|
|||
self.message=msg
|
||||
self.exc_info=sys.exc_info()
|
||||
self.exc_text="TEST"
|
||||
|
||||
|
||||
def getMessage(self):
|
||||
return self.message
|
||||
return self.message
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -23,15 +23,15 @@
|
|||
# Pure python logging mechanism for logging to AlertViz from
|
||||
# pure python (ie not JEP). DO NOT USE IN PYTHON CALLED
|
||||
# FROM JAVA.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 11/03/10 5849 cjeanbap Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
## to execute type python Test
|
||||
|
@ -45,4 +45,4 @@ import Record
|
|||
avh = AlertVizHandler.AlertVizHandler(host=os.getenv("BROKER_ADDR","localhost"), port=9581, category='LOCAL', source='ANNOUNCER', level=logging.NOTSET)
|
||||
record = Record.Record(10)
|
||||
avh.emit(record)
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,14 +21,14 @@
|
|||
|
||||
#
|
||||
# __init__.py for awips package
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 11/03/10 5489 cjeanbap Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 03/09/11 njensen Initial Creation.
|
||||
# 08/15/13 2169 bkowal Decompress data read from the queue
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
import time, sys
|
||||
|
@ -50,12 +50,12 @@ class ListenThread(threading.Thread):
|
|||
self.waitSecond = 0
|
||||
self.stopped = False
|
||||
threading.Thread.__init__(self)
|
||||
|
||||
|
||||
def run(self):
|
||||
from awips import QpidSubscriber
|
||||
self.qs = QpidSubscriber.QpidSubscriber(self.hostname, self.portNumber, True)
|
||||
self.qs.topicSubscribe(self.topicName, self.receivedMessage)
|
||||
|
||||
|
||||
def receivedMessage(self, msg):
|
||||
print "Received message"
|
||||
self.nMessagesReceived += 1
|
||||
|
@ -63,29 +63,28 @@ class ListenThread(threading.Thread):
|
|||
fmsg = open('/tmp/rawMessage', 'w')
|
||||
fmsg.write(msg)
|
||||
fmsg.close()
|
||||
|
||||
|
||||
while self.waitSecond < TIME_TO_SLEEP and not self.stopped:
|
||||
if self.waitSecond % 60 == 0:
|
||||
print time.strftime('%H:%M:%S'), "Sleeping and stuck in not so infinite while loop"
|
||||
self.waitSecond += 1
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
print time.strftime('%H:%M:%S'), "Received", self.nMessagesReceived, "messages"
|
||||
|
||||
|
||||
def stop(self):
|
||||
print "Stopping"
|
||||
self.stopped = True
|
||||
self.qs.close()
|
||||
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
print "Starting up at", time.strftime('%H:%M:%S')
|
||||
|
||||
|
||||
topic = 'edex.alerts'
|
||||
host = 'localhost'
|
||||
port = 5672
|
||||
|
||||
|
||||
thread = ListenThread(host, port, topic)
|
||||
try:
|
||||
thread.start()
|
||||
|
@ -95,10 +94,6 @@ def main():
|
|||
pass
|
||||
finally:
|
||||
thread.stop()
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
||||
|
||||
<bean id="obsDataAccessFactory" class="com.raytheon.uf.common.pointdata.dataaccess.PointDataAccessFactory" />
|
||||
|
||||
|
||||
<bean factory-bean="obsDataAccessFactory" factory-method="register2D">
|
||||
<!-- There is no counter field. -->
|
||||
<constructor-arg ><null /></constructor-arg>
|
||||
|
@ -18,7 +18,7 @@
|
|||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean factory-bean="obsDataAccessFactory" factory-method="register2D">
|
||||
<!-- There are no counter or layer fields. -->
|
||||
<constructor-arg><null /></constructor-arg>
|
||||
|
@ -30,10 +30,10 @@
|
|||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean factory-bean="dataAccessRegistry" factory-method="register">
|
||||
<constructor-arg value="obs"/>
|
||||
<constructor-arg ref="obsDataAccessFactory"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
|
|
@ -71,13 +71,12 @@ shapely 1.5.9 awips2-python-shapely
|
|||
matplotlib 1.5.1 awips2-python-matplotlib
|
||||
cython 0.23.4 awips2-python-cython
|
||||
pil 1.1.6 awips2-python-pil
|
||||
thrift 20080411p1 awips2-python-thrift
|
||||
thrift 20080411p1 **awips2-python-awips**
|
||||
cartopy 0.13.0 awips2-python-cartopy
|
||||
nose 0.11.1 awips2-python-nose
|
||||
pmw 1.3.2 awips2-python-pmw
|
||||
h5py 1.3.0 awips2-python-h5py
|
||||
tables 2.1.2 awips2-python-tables
|
||||
dynamicserialize 15.1.2 awips2-python-dynamicserialize
|
||||
qpid 0.32 awips2-python-qpid
|
||||
====================== ============== ==============================
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ An example of the spring xml for a satellite factory is provided below:
|
|||
|
||||
::
|
||||
|
||||
<bean id="satelliteFactory"
|
||||
<bean id="satelliteFactory"
|
||||
class="com.raytheon.uf.common.dataplugin.satellite.SatelliteFactory" />
|
||||
|
||||
<bean id="satelliteFactoryRegistered" factory-bean="dataFactoryRegistry" factory-method="register">
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
=====
|
||||
==================================
|
||||
Python AWIPS Data Access Framework
|
||||
=====
|
||||
|
||||
.. raw:: html
|
||||
==================================
|
||||
|
||||
The `python-awips <https://github.com/Unidata/python-awips>`_ package provides a Data Access Framework (DAF) for requesting data from a remote AWIPS II EDEX server.
|
||||
|
||||
The `AWIPS II Python Stack <about.html#awips-ii-python-stack>`_ installed via RPM contains the DAF, matplotlib, numpy, scipy, basemap, pint, shapely, and other packages.
|
||||
The `AWIPS II Python Stack <about.html#awips-ii-python-stack>`_ installed via RPM contains the DAF, matplotlib, numpy, scipy, basemap, pint, shapely, and other packages.
|
||||
|
||||
-------------
|
||||
Documentation
|
||||
|
|
|
@ -6,7 +6,7 @@ Install python-awips
|
|||
Requirements
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- Python 2.7 or later
|
||||
- Python 2.7 or later
|
||||
- pip install numpy shapely
|
||||
|
||||
From Github
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -24,46 +24,46 @@
|
|||
# DynamicSerialize binary data.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 06/09/10 njensen Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from thrift.transport import TTransport
|
||||
import SelfDescribingBinaryProtocol, ThriftSerializationContext
|
||||
|
||||
class DynamicSerializationManager:
|
||||
|
||||
|
||||
def __init__(self):
|
||||
self.transport = None
|
||||
|
||||
self.transport = None
|
||||
|
||||
def _deserialize(self, ctx):
|
||||
return ctx.deserializeMessage()
|
||||
|
||||
|
||||
def deserializeBytes(self, bytes):
|
||||
ctx = self._buildSerializationContext(bytes)
|
||||
ctx.readMessageStart()
|
||||
obj = self._deserialize(ctx)
|
||||
ctx.readMessageEnd()
|
||||
return obj
|
||||
|
||||
def _buildSerializationContext(self, bytes=None):
|
||||
|
||||
def _buildSerializationContext(self, bytes=None):
|
||||
self.transport = TTransport.TMemoryBuffer(bytes)
|
||||
protocol = SelfDescribingBinaryProtocol.SelfDescribingBinaryProtocol(self.transport)
|
||||
return ThriftSerializationContext.ThriftSerializationContext(self, protocol)
|
||||
|
||||
|
||||
def serializeObject(self, obj):
|
||||
ctx = self._buildSerializationContext()
|
||||
ctx.writeMessageStart("dynamicSerialize")
|
||||
self._serialize(ctx, obj)
|
||||
ctx.writeMessageEnd()
|
||||
return self.transport.getvalue()
|
||||
|
||||
return self.transport.getvalue()
|
||||
|
||||
def _serialize(self, ctx, obj):
|
||||
ctx.serializeMessage(obj)
|
||||
ctx.serializeMessage(obj)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
|
@ -32,15 +32,15 @@ from struct import pack, unpack
|
|||
# <LI> Custom Serializers
|
||||
# <LI> Inheritance
|
||||
# </UL>
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 11/11/09 chammack Initial Creation.
|
||||
# 06/09/10 njensen Added float, list methods
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
import struct, numpy
|
||||
|
@ -49,12 +49,12 @@ FLOAT = 64
|
|||
|
||||
intList = numpy.dtype(numpy.int32).newbyteorder('>')
|
||||
floatList = numpy.dtype(numpy.float32).newbyteorder('>')
|
||||
longList = numpy.dtype(numpy.int64).newbyteorder('>')
|
||||
longList = numpy.dtype(numpy.int64).newbyteorder('>')
|
||||
shortList = numpy.dtype(numpy.int16).newbyteorder('>')
|
||||
byteList = numpy.dtype(numpy.int8).newbyteorder('>')
|
||||
|
||||
class SelfDescribingBinaryProtocol(TBinaryProtocol):
|
||||
|
||||
|
||||
def readFieldBegin(self):
|
||||
type = self.readByte()
|
||||
if type == TType.STOP:
|
||||
|
@ -64,7 +64,7 @@ class SelfDescribingBinaryProtocol(TBinaryProtocol):
|
|||
return (name, type, id)
|
||||
|
||||
def readStructBegin(self):
|
||||
return self.readString()
|
||||
return self.readString()
|
||||
|
||||
def writeStructBegin(self, name):
|
||||
self.writeString(name)
|
||||
|
@ -84,49 +84,49 @@ class SelfDescribingBinaryProtocol(TBinaryProtocol):
|
|||
dAsBytes = struct.pack('f', f)
|
||||
i = struct.unpack('i', dAsBytes)
|
||||
self.writeI32(i[0])
|
||||
|
||||
def readI32List(self, sz):
|
||||
|
||||
def readI32List(self, sz):
|
||||
buff = self.trans.readAll(4*sz)
|
||||
val = numpy.frombuffer(buff, dtype=intList, count=sz)
|
||||
return val
|
||||
|
||||
|
||||
def readF32List(self, sz):
|
||||
buff = self.trans.readAll(4*sz)
|
||||
val = numpy.frombuffer(buff, dtype=floatList, count=sz)
|
||||
return val
|
||||
|
||||
|
||||
def readI64List(self, sz):
|
||||
buff = self.trans.readAll(8*sz)
|
||||
val = numpy.frombuffer(buff, dtype=longList, count=sz)
|
||||
return val
|
||||
|
||||
|
||||
def readI16List(self, sz):
|
||||
buff = self.trans.readAll(2*sz)
|
||||
val = numpy.frombuffer(buff, dtype=shortList, count=sz)
|
||||
return val
|
||||
|
||||
|
||||
def readI8List(self, sz):
|
||||
buff = self.trans.readAll(sz)
|
||||
val = numpy.frombuffer(buff, dtype=byteList, count=sz)
|
||||
return val
|
||||
|
||||
def writeI32List(self, buff):
|
||||
|
||||
def writeI32List(self, buff):
|
||||
b = numpy.asarray(buff, intList)
|
||||
self.trans.write(numpy.getbuffer(b))
|
||||
|
||||
def writeF32List(self, buff):
|
||||
|
||||
def writeF32List(self, buff):
|
||||
b = numpy.asarray(buff, floatList)
|
||||
self.trans.write(numpy.getbuffer(b))
|
||||
|
||||
def writeI64List(self, buff):
|
||||
|
||||
def writeI64List(self, buff):
|
||||
b = numpy.asarray(buff, longList)
|
||||
self.trans.write(numpy.getbuffer(b))
|
||||
|
||||
def writeI16List(self, buff):
|
||||
|
||||
def writeI16List(self, buff):
|
||||
b = numpy.asarray(buff, shortList)
|
||||
self.trans.write(numpy.getbuffer(b))
|
||||
|
||||
def writeI8List(self, buff):
|
||||
|
||||
def writeI8List(self, buff):
|
||||
b = numpy.asarray(buff, byteList)
|
||||
self.trans.write(numpy.getbuffer(b))
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -27,10 +27,10 @@
|
|||
# languages, it is instead all based on inspecting the types of the objects
|
||||
# passed to it. Therefore, ensure the types of python objects and primitives
|
||||
# match what they should be in the destination language.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 06/09/10 njensen Initial Creation.
|
||||
|
@ -47,18 +47,18 @@ import SelfDescribingBinaryProtocol
|
|||
import numpy
|
||||
|
||||
dsObjTypes = {}
|
||||
|
||||
|
||||
def buildObjMap(module):
|
||||
if module.__dict__.has_key('__all__'):
|
||||
if module.__dict__.has_key('__all__'):
|
||||
for i in module.__all__:
|
||||
name = module.__name__ + '.' + i
|
||||
__import__(name)
|
||||
buildObjMap(sys.modules[name])
|
||||
else:
|
||||
else:
|
||||
clzName = module.__name__[module.__name__.rfind('.') + 1:]
|
||||
clz = module.__dict__[clzName]
|
||||
tname = module.__name__
|
||||
tname = tname.replace('dynamicserialize.dstypes.', '')
|
||||
tname = tname.replace('dynamicserialize.dstypes.', '')
|
||||
dsObjTypes[tname] = clz
|
||||
|
||||
buildObjMap(dstypes)
|
||||
|
@ -89,7 +89,7 @@ pythonToThriftMap = {
|
|||
primitiveSupport = (TType.BYTE, TType.I16, TType.I32, TType.I64, SelfDescribingBinaryProtocol.FLOAT)
|
||||
|
||||
class ThriftSerializationContext(object):
|
||||
|
||||
|
||||
def __init__(self, serializationManager, selfDescribingBinaryProtocol):
|
||||
self.serializationManager = serializationManager
|
||||
self.protocol = selfDescribingBinaryProtocol
|
||||
|
@ -107,7 +107,7 @@ class ThriftSerializationContext(object):
|
|||
TType.BOOL: self.protocol.readBool,
|
||||
TType.STRUCT: self.deserializeMessage,
|
||||
TType.VOID: lambda: None
|
||||
}
|
||||
}
|
||||
self.typeSerializationMethod = {
|
||||
TType.STRING: self.protocol.writeString,
|
||||
TType.I16: self.protocol.writeI16,
|
||||
|
@ -137,15 +137,15 @@ class ThriftSerializationContext(object):
|
|||
TType.I64: self.protocol.writeI64List,
|
||||
SelfDescribingBinaryProtocol.FLOAT: self.protocol.writeF32List
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
def readMessageStart(self):
|
||||
msg = self.protocol.readMessageBegin()
|
||||
msg = self.protocol.readMessageBegin()
|
||||
return msg[0]
|
||||
|
||||
|
||||
def readMessageEnd(self):
|
||||
self.protocol.readMessageEnd()
|
||||
|
||||
|
||||
def deserializeMessage(self):
|
||||
name = self.protocol.readStructBegin()
|
||||
name = name.replace('_', '.')
|
||||
|
@ -156,29 +156,29 @@ class ThriftSerializationContext(object):
|
|||
return adapters.classAdapterRegistry[name].deserialize(self)
|
||||
elif name.find('$') > -1:
|
||||
# it's an inner class, we're going to hope it's an enum, treat it special
|
||||
fieldName, fieldType, fieldId = self.protocol.readFieldBegin()
|
||||
fieldName, fieldType, fieldId = self.protocol.readFieldBegin()
|
||||
if fieldName != '__enumValue__':
|
||||
raise dynamiceserialize.SerializationException("Expected to find enum payload. Found: " + fieldName)
|
||||
obj = self.protocol.readString()
|
||||
obj = self.protocol.readString()
|
||||
self.protocol.readFieldEnd()
|
||||
return obj
|
||||
else:
|
||||
else:
|
||||
clz = dsObjTypes[name]
|
||||
obj = clz()
|
||||
|
||||
|
||||
while self._deserializeField(name, obj):
|
||||
pass
|
||||
|
||||
|
||||
self.protocol.readStructEnd()
|
||||
return obj
|
||||
|
||||
|
||||
def _deserializeType(self, b):
|
||||
if self.typeDeserializationMethod.has_key(b):
|
||||
return self.typeDeserializationMethod[b]()
|
||||
else:
|
||||
raise dynamicserialize.SerializationException("Unsupported type value " + str(b))
|
||||
|
||||
|
||||
|
||||
|
||||
def _deserializeField(self, structname, obj):
|
||||
fieldName, fieldType, fieldId = self.protocol.readFieldBegin()
|
||||
if fieldType == TType.STOP:
|
||||
|
@ -199,11 +199,11 @@ class ThriftSerializationContext(object):
|
|||
raise dynamicserialize.SerializationException("Couldn't find setter method " + lookingFor)
|
||||
except:
|
||||
raise dynamicserialize.SerializationException("Couldn't find setter method " + lookingFor)
|
||||
|
||||
|
||||
self.protocol.readFieldEnd()
|
||||
return True
|
||||
|
||||
|
||||
|
||||
|
||||
def _deserializeArray(self):
|
||||
listType, size = self.protocol.readListBegin()
|
||||
result = []
|
||||
|
@ -215,39 +215,39 @@ class ThriftSerializationContext(object):
|
|||
result = self.listDeserializationMethod[listType](size)
|
||||
self.protocol.readListEnd()
|
||||
return result
|
||||
|
||||
|
||||
def _deserializeMap(self):
|
||||
keyType, valueType, size = self.protocol.readMapBegin()
|
||||
result = {}
|
||||
result = {}
|
||||
for n in xrange(size):
|
||||
# can't go off the type, due to java generics limitations dynamic serialize is
|
||||
# serializing keys and values as void
|
||||
key = self.typeDeserializationMethod[TType.STRUCT]()
|
||||
value = self.typeDeserializationMethod[TType.STRUCT]()
|
||||
result[key] = value
|
||||
result[key] = value
|
||||
self.protocol.readMapEnd()
|
||||
return result
|
||||
|
||||
|
||||
def _deserializeSet(self):
|
||||
setType, setSize = self.protocol.readSetBegin()
|
||||
setType, setSize = self.protocol.readSetBegin()
|
||||
result = set([])
|
||||
for n in xrange(setSize):
|
||||
result.add(self.typeDeserializationMethod[TType.STRUCT]())
|
||||
self.protocol.readSetEnd()
|
||||
return result
|
||||
|
||||
def _lookupType(self, obj):
|
||||
|
||||
def _lookupType(self, obj):
|
||||
pyt = type(obj)
|
||||
if pythonToThriftMap.has_key(pyt):
|
||||
return pythonToThriftMap[pyt]
|
||||
elif pyt.__module__.startswith('dynamicserialize.dstypes'):
|
||||
return pythonToThriftMap[types.InstanceType]
|
||||
else:
|
||||
raise dynamicserialize.SerializationException("Don't know how to serialize object of type: " + str(pyt))
|
||||
|
||||
else:
|
||||
raise dynamicserialize.SerializationException("Don't know how to serialize object of type: " + str(pyt))
|
||||
|
||||
def serializeMessage(self, obj):
|
||||
tt = self._lookupType(obj)
|
||||
|
||||
|
||||
if tt == TType.STRUCT:
|
||||
fqn = obj.__module__.replace('dynamicserialize.dstypes.', '')
|
||||
if adapters.classAdapterRegistry.has_key(fqn):
|
||||
|
@ -261,7 +261,7 @@ class ThriftSerializationContext(object):
|
|||
return
|
||||
else:
|
||||
self.protocol.writeStructBegin(fqn)
|
||||
methods = inspect.getmembers(obj, inspect.ismethod)
|
||||
methods = inspect.getmembers(obj, inspect.ismethod)
|
||||
fid = 1
|
||||
for m in methods:
|
||||
methodName = m[0]
|
||||
|
@ -276,25 +276,25 @@ class ThriftSerializationContext(object):
|
|||
self._serializeField(fieldname, ft, fid, val)
|
||||
fid += 1
|
||||
self.protocol.writeFieldStop()
|
||||
|
||||
|
||||
self.protocol.writeStructEnd()
|
||||
else:
|
||||
# basic types
|
||||
self.protocol.writeStructBegin(str(tt))
|
||||
self._serializeType(obj, tt)
|
||||
self.protocol.writeStructEnd()
|
||||
|
||||
|
||||
def _serializeField(self, fieldName, fieldType, fieldId, fieldValue):
|
||||
self.protocol.writeFieldBegin(fieldName, fieldType, fieldId)
|
||||
self._serializeType(fieldValue, fieldType)
|
||||
self.protocol.writeFieldEnd()
|
||||
|
||||
|
||||
def _serializeType(self, fieldValue, fieldType):
|
||||
if self.typeSerializationMethod.has_key(fieldType):
|
||||
return self.typeSerializationMethod[fieldType](fieldValue)
|
||||
else:
|
||||
raise dynamicserialize.SerializationException("Unsupported type value " + str(fieldType))
|
||||
|
||||
|
||||
def _serializeArray(self, obj):
|
||||
size = len(obj)
|
||||
if size:
|
||||
|
@ -304,21 +304,21 @@ class ThriftSerializationContext(object):
|
|||
else:
|
||||
t = self._lookupType(obj[0])
|
||||
else:
|
||||
t = TType.STRUCT
|
||||
t = TType.STRUCT
|
||||
self.protocol.writeListBegin(t, size)
|
||||
if t == TType.STRING:
|
||||
if type(obj) is numpy.ndarray:
|
||||
if len(obj.shape) == 1:
|
||||
for x in obj:
|
||||
for x in obj:
|
||||
s = str(x).strip()
|
||||
self.typeSerializationMethod[t](s)
|
||||
else:
|
||||
else:
|
||||
for x in obj:
|
||||
for y in x:
|
||||
s = str(y).strip()
|
||||
self.typeSerializationMethod[t](s)
|
||||
else:
|
||||
for x in obj:
|
||||
for x in obj:
|
||||
s = str(x)
|
||||
self.typeSerializationMethod[t](s)
|
||||
elif t not in primitiveSupport:
|
||||
|
@ -327,8 +327,8 @@ class ThriftSerializationContext(object):
|
|||
else:
|
||||
self.listSerializationMethod[t](obj)
|
||||
self.protocol.writeListEnd()
|
||||
|
||||
|
||||
|
||||
|
||||
def _serializeMap(self, obj):
|
||||
size = len(obj)
|
||||
self.protocol.writeMapBegin(TType.VOID, TType.VOID, size)
|
||||
|
@ -336,83 +336,83 @@ class ThriftSerializationContext(object):
|
|||
self.typeSerializationMethod[TType.STRUCT](k)
|
||||
self.typeSerializationMethod[TType.STRUCT](obj[k])
|
||||
self.protocol.writeMapEnd()
|
||||
|
||||
|
||||
def _serializeSet(self, obj):
|
||||
size = len(obj)
|
||||
self.protocol.writeSetBegin(TType.VOID, size)
|
||||
for x in obj:
|
||||
self.typeSerializationMethod[TType.STRUCT](x)
|
||||
self.protocol.writeSetEnd()
|
||||
|
||||
|
||||
def writeMessageStart(self, name):
|
||||
self.protocol.writeMessageBegin(name, TType.VOID, 0)
|
||||
|
||||
|
||||
def writeMessageEnd(self):
|
||||
self.protocol.writeMessageEnd()
|
||||
|
||||
|
||||
def readBool(self):
|
||||
return self.protocol.readBool()
|
||||
|
||||
|
||||
def writeBool(self, b):
|
||||
self.protocol.writeBool(b)
|
||||
|
||||
|
||||
def readByte(self):
|
||||
return self.protocol.readByte()
|
||||
|
||||
|
||||
def writeByte(self, b):
|
||||
self.protocol.writeByte(b)
|
||||
|
||||
|
||||
def readDouble(self):
|
||||
return self.protocol.readDouble()
|
||||
|
||||
|
||||
def writeDouble(self, d):
|
||||
self.protocol.writeDouble(d)
|
||||
|
||||
|
||||
def readFloat(self):
|
||||
return self.protocol.readFloat()
|
||||
|
||||
|
||||
def writeFloat(self, f):
|
||||
self.protocol.writeFloat(f)
|
||||
|
||||
|
||||
def readI16(self):
|
||||
return self.protocol.readI16()
|
||||
|
||||
|
||||
def writeI16(self, i):
|
||||
self.protocol.writeI16(i)
|
||||
|
||||
|
||||
def readI32(self):
|
||||
return self.protocol.readI32()
|
||||
|
||||
|
||||
def writeI32(self, i):
|
||||
self.protocol.writeI32(i)
|
||||
|
||||
|
||||
def readI64(self):
|
||||
return self.protocol.readI64()
|
||||
|
||||
|
||||
def writeI64(self, i):
|
||||
self.protocol.writeI64(i)
|
||||
|
||||
|
||||
def readString(self):
|
||||
return self.protocol.readString()
|
||||
|
||||
|
||||
def writeString(self, s):
|
||||
self.protocol.writeString(s)
|
||||
|
||||
|
||||
def readBinary(self):
|
||||
numBytes = self.protocol.readI32()
|
||||
return self.protocol.readI8List(numBytes)
|
||||
|
||||
|
||||
def readFloatArray(self):
|
||||
size = self.protocol.readI32()
|
||||
return self.protocol.readF32List(size)
|
||||
|
||||
|
||||
def writeFloatArray(self, floats):
|
||||
self.protocol.writeI32(len(floats))
|
||||
self.protocol.writeF32List(floats)
|
||||
|
||||
|
||||
def readObject(self):
|
||||
return self.deserializeMessage()
|
||||
|
||||
|
||||
def writeObject(self, obj):
|
||||
self.serializeMessage(obj)
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# TODO
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 08/20/10 njensen Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
__all__ = [
|
||||
|
@ -39,20 +39,20 @@ import dstypes, adapters
|
|||
import DynamicSerializationManager
|
||||
|
||||
class SerializationException(Exception):
|
||||
|
||||
|
||||
def __init__(self, message=None):
|
||||
self.message = message
|
||||
|
||||
|
||||
def __str__(self):
|
||||
if self.message:
|
||||
return self.message
|
||||
return self.message
|
||||
else:
|
||||
return ""
|
||||
|
||||
|
||||
def serialize(obj):
|
||||
dsm = DynamicSerializationManager.DynamicSerializationManager()
|
||||
return dsm.serializeObject(obj)
|
||||
|
||||
def deserialize(bytes):
|
||||
dsm = DynamicSerializationManager.DynamicSerializationManager()
|
||||
return dsm.deserializeBytes(bytes)
|
||||
return dsm.deserializeBytes(bytes)
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for com.raytheon.uf.common.activetable.ActiveTableMode
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 09/29/10 wldougher Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from thrift.Thrift import TType
|
||||
|
@ -40,7 +40,7 @@ ClassAdapter = 'com.raytheon.uf.common.activetable.ActiveTableMode'
|
|||
def serialize(context, mode):
|
||||
context.protocol.writeFieldBegin('__enumValue__', TType.STRING, 0)
|
||||
context.writeString(mode.value)
|
||||
|
||||
|
||||
def deserialize(context):
|
||||
result = ActiveTableMode()
|
||||
# Read the TType.STRING, "__enumValue__", and id.
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,19 +21,18 @@
|
|||
|
||||
#
|
||||
# Adapter for java.nio.ByteBuffer
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 08/03/11 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
ClassAdapter = ['java.nio.ByteBuffer', 'java.nio.HeapByteBuffer']
|
||||
|
||||
ClassAdapter = ['java.nio.ByteBuffer', 'java.nio.HeapByteBuffer']
|
||||
|
||||
def serialize(context, set):
|
||||
raise NotImplementedError("Serialization of ByteBuffers is not supported.")
|
||||
|
@ -41,6 +40,3 @@ def serialize(context, set):
|
|||
def deserialize(context):
|
||||
byteBuf = context.readBinary()
|
||||
return byteBuf
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for java.util.Calendar
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 09/29/10 wldougher Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.java.util import Calendar
|
||||
|
@ -39,7 +39,7 @@ ClassAdapter = 'java.util.Calendar'
|
|||
def serialize(context, calendar):
|
||||
calTiM = calendar.getTimeInMillis()
|
||||
context.writeI64(calTiM)
|
||||
|
||||
|
||||
def deserialize(context):
|
||||
result = Calendar()
|
||||
result.setTimeInMillis(context.readI64())
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for com.vividsolutions.jts.geom.Coordinate
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 01/20/11 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.com.vividsolutions.jts.geom import Coordinate
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 03/29/11 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import DatabaseID
|
||||
|
@ -38,7 +38,7 @@ ClassAdapter = 'com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID'
|
|||
|
||||
def serialize(context, dbId):
|
||||
context.writeString(str(dbId))
|
||||
|
||||
|
||||
def deserialize(context):
|
||||
result = DatabaseID(context.readString())
|
||||
return result
|
||||
result = DatabaseID(context.readString())
|
||||
return result
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for java.util.Date
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 12/06/10 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.java.util import Date
|
||||
|
@ -38,8 +38,8 @@ ClassAdapter = 'java.util.Date'
|
|||
|
||||
def serialize(context, date):
|
||||
context.writeI64(date.getTime())
|
||||
|
||||
|
||||
def deserialize(context):
|
||||
result = Date()
|
||||
result.setTime(context.readI64())
|
||||
return result
|
||||
return result
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,24 +21,23 @@
|
|||
|
||||
#
|
||||
# Adapter for java.util.EnumSet
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 07/28/11 dgilling Initial Creation.
|
||||
# 12/02/13 2537 bsteffen Serialize empty enum sets.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
||||
from dynamicserialize.dstypes.java.util import EnumSet
|
||||
|
||||
ClassAdapter = ['java.util.EnumSet', 'java.util.RegularEnumSet']
|
||||
|
||||
ClassAdapter = ['java.util.EnumSet', 'java.util.RegularEnumSet']
|
||||
|
||||
def serialize(context, set):
|
||||
setSize = len(set)
|
||||
|
@ -46,7 +45,6 @@ def serialize(context, set):
|
|||
context.writeString(set.getEnumClass())
|
||||
for val in set:
|
||||
context.writeString(val)
|
||||
|
||||
|
||||
def deserialize(context):
|
||||
setSize = context.readI32()
|
||||
|
@ -54,4 +52,4 @@ def deserialize(context):
|
|||
valList = []
|
||||
for i in xrange(setSize):
|
||||
valList.append(context.readString())
|
||||
return EnumSet(enumClassName, valList)
|
||||
return EnumSet(enumClassName, valList)
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,19 +21,18 @@
|
|||
|
||||
#
|
||||
# Adapter for java.nio.FloatBuffer
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 08/01/11 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
ClassAdapter = ['java.nio.FloatBuffer', 'java.nio.HeapFloatBuffer']
|
||||
|
||||
ClassAdapter = ['java.nio.FloatBuffer', 'java.nio.HeapFloatBuffer']
|
||||
|
||||
def serialize(context, set):
|
||||
raise NotImplementedError("Serialization of FloatBuffers is not supported.")
|
||||
|
@ -41,6 +40,3 @@ def serialize(context, set):
|
|||
def deserialize(context):
|
||||
floatBuf = context.readFloatArray()
|
||||
return floatBuf
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for com.vividsolutions.jts.geom.Polygon
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 01/20/11 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
# TODO: Implement serialization/make deserialization useful.
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for java.util.Calendar
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 09/29/10 wldougher Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.java.util import GregorianCalendar
|
||||
|
@ -39,7 +39,7 @@ ClassAdapter = 'java.util.GregorianCalendar'
|
|||
def serialize(context, calendar):
|
||||
calTiM = calendar.getTimeInMillis()
|
||||
context.writeI64(calTiM)
|
||||
|
||||
|
||||
def deserialize(context):
|
||||
result = GregorianCalendar()
|
||||
result.setTimeInMillis(context.readI64())
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -24,15 +24,15 @@
|
|||
#
|
||||
# TODO: REWRITE THIS ADAPTER when serialization/deserialization of this
|
||||
# class has been finalized.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 03/29/11 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe import GridDataHistory
|
||||
|
@ -41,7 +41,7 @@ ClassAdapter = 'com.raytheon.uf.common.dataplugin.gfe.GridDataHistory'
|
|||
|
||||
def serialize(context, history):
|
||||
context.writeString(history.getCodedString())
|
||||
|
||||
|
||||
def deserialize(context):
|
||||
result = GridDataHistory(context.readString())
|
||||
return result
|
||||
result = GridDataHistory(context.readString())
|
||||
return result
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,10 +21,10 @@
|
|||
|
||||
#
|
||||
# Adapter for com.vividsolutions.jts.geom.Envelope
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 05/29/13 2023 dgilling Initial Creation.
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for com.raytheon.uf.common.localization.LocalizationContext$LocalizationLevel
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 01/11/11 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
@ -52,5 +52,3 @@ def deserialize(context):
|
|||
systemLevel = context.readBool()
|
||||
level = LocalizationLevel(text, order, systemLevel=systemLevel)
|
||||
return level
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for com.raytheon.uf.common.localization.LocalizationContext$LocalizationType
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 01/11/11 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
||||
#
|
||||
# Adapter for com.raytheon.uf.common.dataplugin.gfe.server.lock.LockTable
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 04/22/13 rjpeter Initial Creation.
|
||||
# 06/12/13 #2099 dgilling Use new Lock constructor.
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.server.lock import LockTable
|
||||
|
@ -44,7 +44,7 @@ def serialize(context, lockTable):
|
|||
lockWsIdIndex = []
|
||||
for lock in locks:
|
||||
wsIdString = lock.getWsId().toString()
|
||||
|
||||
|
||||
if wsIds.has_key(wsIdString):
|
||||
lockWsIdIndex.append(wsIds[wsIdString])
|
||||
else:
|
||||
|
@ -53,24 +53,24 @@ def serialize(context, lockTable):
|
|||
index += 1
|
||||
|
||||
context.writeObject(lockTable.getParmId())
|
||||
|
||||
|
||||
context.writeI32(index)
|
||||
for wsId in sorted(wsIds, key=wsIds.get):
|
||||
context.writeObject(wsId)
|
||||
|
||||
|
||||
context.writeI32(len(locks))
|
||||
for lock, wsIndex in zip(locks, lockWsIdIndex):
|
||||
serializer.writeI64(lock.getStartTime())
|
||||
serializer.writeI64(lock.getEndTime())
|
||||
serializer.writeI32(wsIndex)
|
||||
|
||||
|
||||
def deserialize(context):
|
||||
parmId = context.readObject()
|
||||
numWsIds = context.readI32()
|
||||
wsIds = []
|
||||
for x in xrange(numWsIds):
|
||||
wsIds.append(context.readObject())
|
||||
|
||||
|
||||
numLocks = context.readI32()
|
||||
locks = []
|
||||
for x in xrange(numLocks):
|
||||
|
@ -79,10 +79,10 @@ def deserialize(context):
|
|||
wsId = wsIds[context.readI32()]
|
||||
lock = Lock(parmId, wsId, startTime, endTime)
|
||||
locks.append(lock)
|
||||
|
||||
|
||||
lockTable = LockTable()
|
||||
lockTable.setParmId(parmId)
|
||||
lockTable.setWsId(wsIds[0])
|
||||
lockTable.setLocks(locks)
|
||||
|
||||
return lockTable
|
||||
return lockTable
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 03/29/11 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import ParmID
|
||||
|
@ -38,7 +38,7 @@ ClassAdapter = 'com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID'
|
|||
|
||||
def serialize(context, parmId):
|
||||
context.writeString(str(parmId))
|
||||
|
||||
|
||||
def deserialize(context):
|
||||
result = ParmID(context.readString())
|
||||
return result
|
||||
result = ParmID(context.readString())
|
||||
return result
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for java.awt.Point
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 08/31/10 njensen Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.java.awt import Point
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for java.lang.StackTraceElement[]
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 09/21/10 njensen Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
import dynamicserialize
|
||||
|
@ -37,10 +37,9 @@ from dynamicserialize.dstypes.java.lang import StackTraceElement
|
|||
|
||||
ClassAdapter = 'java.lang.StackTraceElement'
|
||||
|
||||
|
||||
def serialize(context, obj):
|
||||
raise dynamicserialize.SerializationException('Not implemented yet')
|
||||
|
||||
|
||||
def deserialize(context):
|
||||
result = StackTraceElement()
|
||||
result.setDeclaringClass(context.readString())
|
||||
|
@ -48,5 +47,3 @@ def deserialize(context):
|
|||
result.setFileName(context.readString())
|
||||
result.setLineNumber(context.readI32())
|
||||
return result
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 03/20/13 #1774 randerso Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import TimeConstraints
|
||||
|
@ -40,7 +40,7 @@ def serialize(context, timeConstraints):
|
|||
context.writeI32(timeConstraints.getDuration());
|
||||
context.writeI32(timeConstraints.getRepeatInterval());
|
||||
context.writeI32(timeConstraints.getStartTime());
|
||||
|
||||
|
||||
def deserialize(context):
|
||||
result = TimeConstraints(context.readI32(), context.readI32(), context.readI32())
|
||||
return result
|
||||
result = TimeConstraints(context.readI32(), context.readI32(), context.readI32())
|
||||
return result
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,17 +21,17 @@
|
|||
|
||||
#
|
||||
# Adapter for com.raytheon.uf.common.message.WsId
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 09/16/10 dgilling Initial Creation.
|
||||
# 01/22/14 2667 bclement use method to get millis from time range
|
||||
# 02/28/14 2667 bclement deserialize now converts millis to micros
|
||||
#
|
||||
#
|
||||
# 01/22/14 2667 bclement use method to get millis from time range
|
||||
# 02/28/14 2667 bclement deserialize now converts millis to micros
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
@ -50,7 +50,7 @@ def serialize(context, timeRange):
|
|||
def deserialize(context):
|
||||
startTime = context.readI64()
|
||||
endTime = context.readI64()
|
||||
|
||||
|
||||
timeRange = TimeRange()
|
||||
# java uses milliseconds, python uses microseconds
|
||||
startSeconds = startTime // MILLIS_IN_SECOND
|
||||
|
@ -59,5 +59,5 @@ def deserialize(context):
|
|||
endExtraMicros = (endTime % MILLIS_IN_SECOND) * MICROS_IN_MILLISECOND
|
||||
timeRange.setStart(startSeconds, startExtraMicros)
|
||||
timeRange.setEnd(endSeconds, endExtraMicros)
|
||||
|
||||
|
||||
return timeRange
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,15 +21,15 @@
|
|||
|
||||
#
|
||||
# Adapter for java.sql.Timestamp
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 06/30/11 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.java.sql import Timestamp
|
||||
|
@ -38,7 +38,7 @@ ClassAdapter = 'java.sql.Timestamp'
|
|||
|
||||
def serialize(context, timestamp):
|
||||
context.writeI64(timestamp.getTime())
|
||||
|
||||
|
||||
def deserialize(context):
|
||||
result = Timestamp(context.readI64())
|
||||
return result
|
||||
return result
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,38 +21,34 @@
|
|||
|
||||
#
|
||||
# Adapter for com.raytheon.uf.common.message.WsId
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 09/16/10 dgilling Initial Creation.
|
||||
# 04/25/12 545 randerso Repurposed the lockKey field as threadId
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.message import WsId
|
||||
|
||||
ClassAdapter = 'com.raytheon.uf.common.message.WsId'
|
||||
|
||||
|
||||
def serialize(context, wsId):
|
||||
context.writeString(wsId.toString())
|
||||
|
||||
def deserialize(context):
|
||||
wsIdString = context.readString()
|
||||
wsIdParts = wsIdString.split(":", 5)
|
||||
|
||||
|
||||
wsId = WsId()
|
||||
wsId.setNetworkId(wsIdParts[0])
|
||||
wsId.setUserName(wsIdParts[1])
|
||||
wsId.setProgName(wsIdParts[2])
|
||||
wsId.setPid(wsIdParts[3])
|
||||
wsId.setThreadId(long(wsIdParts[4]))
|
||||
|
||||
return wsId
|
||||
|
||||
return wsId
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,10 +21,10 @@
|
|||
|
||||
#
|
||||
# __init__.py for Dynamic Serialize adapters.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 08/31/10 njensen Initial Creation.
|
||||
|
@ -32,7 +32,7 @@
|
|||
# 04/22/13 #1949 rjpeter Added LockTableAdapter
|
||||
# 02/06/14 #2672 bsteffen Added JTSEnvelopeAdapter
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
__all__ = [
|
||||
|
@ -59,12 +59,12 @@ __all__ = [
|
|||
'JTSEnvelopeAdapter'
|
||||
# 'GridDataHistoryAdapter',
|
||||
]
|
||||
|
||||
|
||||
classAdapterRegistry = {}
|
||||
|
||||
|
||||
|
||||
def getAdapterRegistry():
|
||||
import sys
|
||||
import sys
|
||||
for x in __all__:
|
||||
exec 'import ' + x
|
||||
m = sys.modules['dynamicserialize.adapters.' + x]
|
||||
|
@ -79,7 +79,6 @@ def getAdapterRegistry():
|
|||
else:
|
||||
raise LookupError('Adapter class ' + x + ' has no ClassAdapter field ' + \
|
||||
'and cannot be registered.')
|
||||
|
||||
|
||||
getAdapterRegistry()
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -23,6 +23,6 @@
|
|||
class ActiveTableMode(object):
|
||||
def __init__(self):
|
||||
self.value = None
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return repr(self.value)
|
||||
return repr(self.value)
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -27,25 +27,24 @@ class DumpActiveTableResponse(object):
|
|||
|
||||
def getUnfilteredCount(self):
|
||||
return self.unfilteredCount
|
||||
|
||||
|
||||
def getFilteredCount(self):
|
||||
return self.filteredCount
|
||||
|
||||
|
||||
def getDump(self):
|
||||
return self.dump
|
||||
|
||||
|
||||
def getMessage(self):
|
||||
return self.message
|
||||
|
||||
|
||||
def setUnfilteredCount(self, unfilteredCount):
|
||||
self.unfilteredCount = unfilteredCount
|
||||
|
||||
|
||||
def setFilteredCount(self, filteredCount):
|
||||
self.filteredCount = filteredCount
|
||||
|
||||
|
||||
def setDump(self, dump):
|
||||
self.dump = dump
|
||||
|
||||
|
||||
def setMessage(self, message):
|
||||
self.message = message
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -39,6 +39,6 @@ class GetActiveTableDictRequest(object):
|
|||
|
||||
def getWfos(self):
|
||||
return self.wfos
|
||||
|
||||
|
||||
def setWfos(self, wfos):
|
||||
self.wfos = wfos;
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,12 +21,12 @@
|
|||
# File auto-generated against equivalent DynamicSerialize Java class
|
||||
|
||||
class GetFourCharSitesRequest(object):
|
||||
|
||||
|
||||
def __init__(self):
|
||||
self.sites = None
|
||||
|
||||
|
||||
def getSites(self):
|
||||
return self.sites
|
||||
|
||||
|
||||
def setSites(self, sites):
|
||||
self.sites = sites
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -21,12 +21,12 @@
|
|||
# File auto-generated against equivalent DynamicSerialize Java class
|
||||
|
||||
class GetFourCharSitesResponse(object):
|
||||
|
||||
|
||||
def __init__(self):
|
||||
self.sites = None
|
||||
|
||||
|
||||
def getSites(self):
|
||||
return self.sites
|
||||
|
||||
|
||||
def setSites(self, sites):
|
||||
self.sites = sites
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -24,21 +24,21 @@ class GetVtecAttributeRequest(object):
|
|||
self.siteId = None
|
||||
self.attribute = None
|
||||
self.defaultValue = None
|
||||
|
||||
|
||||
def getSiteId(self):
|
||||
return self.siteId
|
||||
|
||||
|
||||
def setSiteId(self, site):
|
||||
self.siteId = site
|
||||
|
||||
def getAttribute(self):
|
||||
return self.attribute
|
||||
|
||||
|
||||
def setAttribute(self, attribute):
|
||||
self.attribute = attribute
|
||||
|
||||
|
||||
def getDefaultValue(self):
|
||||
return self.defaultValue
|
||||
|
||||
|
||||
def setDefaultValue(self, default):
|
||||
self.defaultValue = default
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -22,9 +22,9 @@ class GetVtecAttributeResponse(object):
|
|||
|
||||
def __init__(self):
|
||||
self.value = None
|
||||
|
||||
|
||||
def getValue(self):
|
||||
return self.value
|
||||
|
||||
|
||||
def setValue(self, value):
|
||||
self.value = value
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -22,8 +22,8 @@
|
|||
|
||||
class MergeActiveTableRequest(object):
|
||||
|
||||
def __init__(self, incomingRecords=[], tableName='PRACTICE', site=None,
|
||||
timeOffset=0.0, xmlSource=None, fromIngestAT=False,
|
||||
def __init__(self, incomingRecords=[], tableName='PRACTICE', site=None,
|
||||
timeOffset=0.0, xmlSource=None, fromIngestAT=False,
|
||||
makeBackups=True):
|
||||
self.incomingRecords = incomingRecords
|
||||
self.site = site
|
||||
|
@ -32,18 +32,18 @@ class MergeActiveTableRequest(object):
|
|||
self.xmlSource = xmlSource
|
||||
self.fromIngestAT = bool(fromIngestAT)
|
||||
self.makeBackups = bool(makeBackups)
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
retVal = "MergeActiveTableRequest("
|
||||
retVal = "MergeActiveTableRequest("
|
||||
retVal += repr(self.incomingRecords) + ", "
|
||||
retVal += repr(self.tableName) + ", "
|
||||
retVal += repr(self.site) + ", "
|
||||
retVal += repr(self.timeOffset) + ", "
|
||||
retVal += repr(self.xmlSource) + ", "
|
||||
retVal += repr(self.xmlSource) + ", "
|
||||
retVal += repr(self.fromIngestAT) + ", "
|
||||
retVal += repr(self.makeBackups) + ")"
|
||||
return retVal
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return self.__repr__()
|
||||
|
||||
|
@ -61,7 +61,7 @@ class MergeActiveTableRequest(object):
|
|||
if value not in ['OPERATIONAL', 'PRACTICE']:
|
||||
raise ValueError("Invalid value " + tableName + " specified for ActiveTableMode.")
|
||||
self.tableName = value
|
||||
|
||||
|
||||
def getSite(self):
|
||||
return self.site
|
||||
|
||||
|
@ -79,13 +79,13 @@ class MergeActiveTableRequest(object):
|
|||
|
||||
def setXmlSource(self, xmlSource):
|
||||
self.xmlSource = xmlSource
|
||||
|
||||
|
||||
def getFromIngestAT(self):
|
||||
return self.fromIngestAT
|
||||
|
||||
def setFromIngestAT(self, fromIngestAT):
|
||||
self.fromIngestAT = bool(fromIngestAT)
|
||||
|
||||
|
||||
def getMakeBackups(self):
|
||||
return self.makeBackups
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -22,8 +22,8 @@
|
|||
|
||||
class RetrieveRemoteActiveTableRequest(object):
|
||||
|
||||
def __init__(self, serverHost=None, serverPort=0, serverProtocol=None,
|
||||
mhsId=None, siteId=None, ancfAddress=None, bncfAddress=None,
|
||||
def __init__(self, serverHost=None, serverPort=0, serverProtocol=None,
|
||||
mhsId=None, siteId=None, ancfAddress=None, bncfAddress=None,
|
||||
transmitScript=None):
|
||||
self.serverHost = serverHost
|
||||
self.serverPort = int(serverPort)
|
||||
|
@ -33,19 +33,19 @@ class RetrieveRemoteActiveTableRequest(object):
|
|||
self.ancfAddress = ancfAddress
|
||||
self.bncfAddress = bncfAddress
|
||||
self.transmitScript = transmitScript
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
retVal = "RetrieveRemoteActiveTableRequest("
|
||||
retVal = "RetrieveRemoteActiveTableRequest("
|
||||
retVal += repr(self.serverHost) + ", "
|
||||
retVal += repr(self.serverPort) + ", "
|
||||
retVal += repr(self.serverProtocol) + ", "
|
||||
retVal += repr(self.mhsId) + ", "
|
||||
retVal += repr(self.siteId) + ", "
|
||||
retVal += repr(self.ancfAddress) + ", "
|
||||
retVal += repr(self.bncfAddress) + ", "
|
||||
retVal += repr(self.serverPort) + ", "
|
||||
retVal += repr(self.serverProtocol) + ", "
|
||||
retVal += repr(self.mhsId) + ", "
|
||||
retVal += repr(self.siteId) + ", "
|
||||
retVal += repr(self.ancfAddress) + ", "
|
||||
retVal += repr(self.bncfAddress) + ", "
|
||||
retVal += repr(self.transmitScript) + ")"
|
||||
return retVal
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return self.__repr__()
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
@ -22,16 +22,16 @@
|
|||
|
||||
class SendActiveTableRequest(object):
|
||||
|
||||
def __init__(self, serverHost=None, serverPort=None, serverProtocol=None,
|
||||
serverSite=None, mhsId=None, sites=None, filterSites=None,
|
||||
mhsSites=None, issueTime=None, countDict=None, fileName=None,
|
||||
def __init__(self, serverHost=None, serverPort=None, serverProtocol=None,
|
||||
serverSite=None, mhsId=None, sites=None, filterSites=None,
|
||||
mhsSites=None, issueTime=None, countDict=None, fileName=None,
|
||||
xmlIncoming=None, transmitScript=None):
|
||||
self.serverHost = serverHost
|
||||
self.serverPort = None if serverPort is None else int(serverPort)
|
||||
self.serverProtocol = serverProtocol
|
||||
self.serverSite = serverSite
|
||||
self.mhsId = mhsId
|
||||
self.sites = sites if sites is not None else []
|
||||
self.sites = sites if sites is not None else []
|
||||
self.filterSites = filterSites if filterSites is not None else []
|
||||
self.mhsSites = mhsSites if mhsSites is not None else []
|
||||
self.issueTime = None if issueTime is None else float(issueTime)
|
||||
|
@ -39,24 +39,24 @@ class SendActiveTableRequest(object):
|
|||
self.fileName = fileName
|
||||
self.xmlIncoming = xmlIncoming
|
||||
self.transmitScript = transmitScript
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
retVal = "SendActiveTableRequest("
|
||||
retVal = "SendActiveTableRequest("
|
||||
retVal += repr(self.serverHost) + ", "
|
||||
retVal += repr(self.serverPort) + ", "
|
||||
retVal += repr(self.serverProtocol) + ", "
|
||||
retVal += repr(self.serverPort) + ", "
|
||||
retVal += repr(self.serverProtocol) + ", "
|
||||
retVal += repr(self.serverSite) + ", "
|
||||
retVal += repr(self.mhsId) + ", "
|
||||
retVal += repr(self.sites) + ", "
|
||||
retVal += repr(self.filterSites) + ", "
|
||||
retVal += repr(self.mhsId) + ", "
|
||||
retVal += repr(self.sites) + ", "
|
||||
retVal += repr(self.filterSites) + ", "
|
||||
retVal += repr(self.mhsSites) + ", "
|
||||
retVal += repr(self.issueTime) + ", "
|
||||
retVal += repr(self.issueTime) + ", "
|
||||
retVal += repr(self.countDict) + ", "
|
||||
retVal += repr(self.fileName) + ", "
|
||||
retVal += repr(self.fileName) + ", "
|
||||
retVal += repr(self.xmlIncoming) + ", "
|
||||
retVal += repr(self.transmitScript) + ")"
|
||||
return retVal
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return self.__repr__()
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,30 +1,29 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
||||
# File auto-generated against equivalent DynamicSerialize Java class
|
||||
|
||||
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.serialization.comm.response import ServerErrorResponse
|
||||
|
||||
class AuthServerErrorResponse(ServerErrorResponse):
|
||||
|
||||
|
||||
def __init__(self):
|
||||
super(AuthServerErrorResponse, self).__init__()
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,41 +1,39 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
||||
# File auto-generated against equivalent DynamicSerialize Java class
|
||||
# and then modified post-generation to sub-class IDataRequest.
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 05/28/13 2023 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
|
||||
#
|
||||
|
||||
from awips.dataaccess import IDataRequest
|
||||
|
||||
from dynamicserialize.dstypes.com.vividsolutions.jts.geom import Envelope
|
||||
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.level import Level
|
||||
|
||||
|
||||
class DefaultDataRequest(IDataRequest):
|
||||
|
||||
def __init__(self):
|
||||
|
@ -45,22 +43,22 @@ class DefaultDataRequest(IDataRequest):
|
|||
self.levels = []
|
||||
self.locationNames = []
|
||||
self.envelope = None
|
||||
|
||||
|
||||
def setDatatype(self, datatype):
|
||||
self.datatype = str(datatype)
|
||||
|
||||
|
||||
def addIdentifier(self, key, value):
|
||||
self.identifiers[key] = value
|
||||
|
||||
|
||||
def removeIdentifier(self, key):
|
||||
del self.identifiers[key]
|
||||
|
||||
|
||||
def setParameters(self, *params):
|
||||
self.parameters = map(str, params)
|
||||
|
||||
|
||||
def setLevels(self, *levels):
|
||||
self.levels = map(self.__makeLevel, levels)
|
||||
|
||||
|
||||
def __makeLevel(self, level):
|
||||
if type(level) is Level:
|
||||
return level
|
||||
|
@ -68,27 +66,27 @@ class DefaultDataRequest(IDataRequest):
|
|||
return Level(level)
|
||||
else:
|
||||
raise TypeError("Invalid object type specified for level.")
|
||||
|
||||
|
||||
def setEnvelope(self, env):
|
||||
self.envelope = Envelope(env.envelope)
|
||||
|
||||
def setLocationNames(self, *locationNames):
|
||||
self.locationNames = map(str, locationNames)
|
||||
|
||||
|
||||
def getDatatype(self):
|
||||
return self.datatype
|
||||
|
||||
|
||||
def getIdentifiers(self):
|
||||
return self.identifiers
|
||||
|
||||
|
||||
def getParameters(self):
|
||||
return self.parameters
|
||||
|
||||
|
||||
def getLevels(self):
|
||||
return self.levels
|
||||
|
||||
|
||||
def getEnvelope(self):
|
||||
return self.envelope
|
||||
|
||||
|
||||
def getLocationNames(self):
|
||||
return self.locationNames
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
||||
# File auto-generated against equivalent DynamicSerialize Java class
|
||||
# and then modified post-generation to make it a abstract base class.
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 05/28/13 #2023 dgilling Initial Creation.
|
||||
# 05/28/13 #2023 dgilling Initial Creation.
|
||||
#
|
||||
#
|
||||
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
##
|
||||
# This software was developed and / or modified by Raytheon Company,
|
||||
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
#
|
||||
#
|
||||
# U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
# This software product contains export-restricted data whose
|
||||
# export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
# to non-U.S. persons whether in the United States or abroad requires
|
||||
# an export license or other authorization.
|
||||
#
|
||||
#
|
||||
# Contractor Name: Raytheon Company
|
||||
# Contractor Address: 6825 Pine Street, Suite 340
|
||||
# Mail Stop B8
|
||||
# Omaha, NE 68106
|
||||
# 402.291.0100
|
||||
#
|
||||
#
|
||||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
||||
# File auto-generated against equivalent DynamicSerialize Java class
|
||||
# and then modified post-generation to make it a abstract base class.
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 07/23/14 #3185 njensen Initial Creation.
|
||||
# 07/23/14 #3185 njensen Initial Creation.
|
||||
#
|
||||
#
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue