12.4.1-4 baseline

Former-commit-id: 4767b0e069 [formerly 750b7543dd] [formerly 67a5a68300] [formerly 2a216f333c [formerly 67a5a68300 [formerly ad648deaf4d3edaabdda15184289b3a927308bd7]]]
Former-commit-id: 2a216f333c
Former-commit-id: e8514db31c64b82122112f0e87cbbf3cda2d8c2b [formerly a4e519f3cd]
Former-commit-id: a2a6a18fae
This commit is contained in:
Steve Harris 2012-04-18 15:18:16 -05:00
parent ea7fcde242
commit 98d8b3f188
1286 changed files with 117107 additions and 116024 deletions

View file

View file

View file

@ -79,146 +79,155 @@ import com.raytheon.rcm.server.Log;
import com.raytheon.rcm.server.RadarServer; import com.raytheon.rcm.server.RadarServer;
import com.raytheon.rcm.server.StatusManager.RadarStatus; import com.raytheon.rcm.server.StatusManager.RadarStatus;
public class MsgServ implements RadarEventListener, MessageListener { public class MsgServ implements RadarEventListener, MessageListener {
QueueConnection queueConn;
QueueSession queueSession;
QueueSender queueSender;
TopicConnection topicConn;
TopicSession topicSession;
TopicPublisher topicPublisher;
JAXBContext jaxbCtx;
Marshaller m;
Unmarshaller u;
Serv serv;
public MsgServ(RadarServer server) {
serv = new Serv(server);
try {
jaxbCtx = JAXBContext.newInstance(ReqObj.class, ReplyObj.class,
EventObj.class, RmrEvent.class);
m = jaxbCtx.createMarshaller();
u = jaxbCtx.createUnmarshaller();
} catch (JAXBException e) {
Log.errorf("MsgServ could not create JAXBContext: %s", e);
}
}
public void start(QueueConnectionFactory qConnFac,
TopicConnectionFactory tConnFac) {
try {
queueConn = qConnFac.createQueueConnection();
queueSession = queueConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue queue = queueSession.createQueue("RadarServer");
queueSender = queueSession.createSender(null);
QueueReceiver qr = queueSession.createReceiver(queue);
qr.setMessageListener(this);
topicConn = tConnFac.createTopicConnection();
topicSession = topicConn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topic = topicSession.createTopic("RadarEvents");
topicPublisher = topicSession.createPublisher(topic);
queueConn.start();
} catch (JMSException e) {
Log.errorf("MsgServ could not start connections: %s", e);
}
}
@Override QueueConnection queueConn;
public void handleRadarEvent(RadarEvent event) {
RadarEvent eventToSend = EventObj.filterRadarEvent(event);
if (eventToSend != null)
publishEvent(eventToSend);
}
@Override QueueSession queueSession;
public void onMessage(Message msg) {
try {
ReplyObj po = null;
String error = null;
Exception exc = null;
Destination replyToDestination = msg.getJMSReplyTo();
if (msg instanceof TextMessage) {
TextMessage tms = (TextMessage) msg;
StringReader sr = new StringReader(tms.getText());
Object o = null;
try {
o = u.unmarshal(sr);
} catch (JAXBException e) {
exc = e;
}
if (o instanceof ReqObj) {
ReqObj ro = (ReqObj) o;
try {
po = handleRequest(replyToDestination, ro);
} catch (RuntimeException e) {
error = "Unexpected error while processing request: " + e.toString();
exc = e;
}
} else if (o != null)
error = String.format("Invalid request class '%s'", o.getClass());
} else
error = "Invalid JMS message type";
if (error == null && exc != null) QueueSender queueSender;
error = exc.toString();
if (po == null) TopicConnection topicConn;
po = ReplyObj.error(error != null ? error : "Unknown error");
TopicSession topicSession;
if (exc != null)
Log.errorf("Error processing remote request: %s", exc); TopicPublisher topicPublisher;
else if (error != null)
Log.errorf("Error processing remote request: %s", error); JAXBContext jaxbCtx;
if (po != null) { Marshaller m;
StringWriter sw = new StringWriter();
try { Unmarshaller u;
synchronized (m) {
m.marshal(po, sw); Serv serv;
}
} catch (JAXBException e) { public MsgServ(RadarServer server) {
Log.errorf("Error processing remote request: %s", e); serv = new Serv(server);
return; try {
} jaxbCtx = JAXBContext.newInstance(ReqObj.class, ReplyObj.class,
TextMessage rtm = queueSession.createTextMessage( EventObj.class, RmrEvent.class);
sw.toString()); m = jaxbCtx.createMarshaller();
u = jaxbCtx.createUnmarshaller();
String id = msg.getJMSCorrelationID(); } catch (JAXBException e) {
if (id == null) Log.errorf("MsgServ could not create JAXBContext: %s", e);
id = msg.getJMSMessageID(); }
if (id != null) }
rtm.setJMSCorrelationID(id);
if (replyToDestination != null) public void start(QueueConnectionFactory qConnFac,
queueSender.send(replyToDestination, rtm); TopicConnectionFactory tConnFac) {
else try {
Log.errorf("Client did not specify reply-to destination"); queueConn = qConnFac.createQueueConnection();
} queueSession = queueConn.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
} catch (JMSException e) { Queue queue = queueSession.createQueue("RadarServer");
Log.errorf("Error while processing JMS message: %s", e); queueSender = queueSession.createSender(null);
} QueueReceiver qr = queueSession.createReceiver(queue);
} qr.setMessageListener(this);
private ReplyObj handleRequest(Destination replyToDestination, ReqObj ro) { topicConn = tConnFac.createTopicConnection();
ReplyObj po = null; topicSession = topicConn.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
Topic topic = topicSession.createTopic("RadarEvents");
topicPublisher = topicSession.createPublisher(topic);
queueConn.start();
} catch (JMSException e) {
Log.errorf("MsgServ could not start connections: %s", e);
}
}
@Override
public void handleRadarEvent(RadarEvent event) {
RadarEvent eventToSend = EventObj.filterRadarEvent(event);
if (eventToSend != null)
publishEvent(eventToSend);
}
@Override
public void onMessage(Message msg) {
try {
ReplyObj po = null;
String error = null;
Exception exc = null;
Destination replyToDestination = msg.getJMSReplyTo();
if (msg instanceof TextMessage) {
TextMessage tms = (TextMessage) msg;
StringReader sr = new StringReader(tms.getText());
Object o = null;
try {
o = u.unmarshal(sr);
} catch (JAXBException e) {
exc = e;
}
if (o instanceof ReqObj) {
ReqObj ro = (ReqObj) o;
try {
po = handleRequest(replyToDestination, ro);
} catch (RuntimeException e) {
error = "Unexpected error while processing request: "
+ e.toString();
exc = e;
}
} else if (o != null)
error = String.format("Invalid request class '%s'",
o.getClass());
} else
error = "Invalid JMS message type";
if (error == null && exc != null)
error = exc.toString();
if (po == null)
po = ReplyObj.error(error != null ? error : "Unknown error");
if (exc != null)
Log.errorf("Error processing remote request: %s", exc);
else if (error != null)
Log.errorf("Error processing remote request: %s", error);
if (po != null) {
StringWriter sw = new StringWriter();
try {
synchronized (m) {
m.marshal(po, sw);
}
} catch (JAXBException e) {
Log.errorf("Error processing remote request: %s", e);
return;
}
TextMessage rtm = queueSession.createTextMessage(sw.toString());
String id = msg.getJMSCorrelationID();
if (id == null)
id = msg.getJMSMessageID();
if (id != null)
rtm.setJMSCorrelationID(id);
if (replyToDestination != null)
queueSender.send(replyToDestination, rtm);
else
Log.errorf("Client did not specify reply-to destination");
}
} catch (JMSException e) {
Log.errorf("Error while processing JMS message: %s", e);
}
}
private ReplyObj handleRequest(Destination replyToDestination, ReqObj ro) {
ReplyObj po = null;
String error = null; String error = null;
Log.eventf("Got remote request %s", ro); Log.eventf("Got remote request %s", ro);
if (ro instanceof GetRadarList) if (ro instanceof GetRadarList)
po = ReplyObj.toGetRadarList( po = ReplyObj.toGetRadarList(serv.getRadarList());
serv.getRadarList());
else if (ro instanceof GetRadarConfig) { else if (ro instanceof GetRadarConfig) {
GetRadarConfig grc = (GetRadarConfig) ro; GetRadarConfig grc = (GetRadarConfig) ro;
if (grc.radarID != null) if (grc.radarID != null)
po = ReplyObj.toGetRadarConfig( po = ReplyObj
serv.getRadarConfig(grc.radarID)); .toGetRadarConfig(serv.getRadarConfig(grc.radarID));
else else
po = ReplyObj.toGetRadarConfig(serv.getAllRadarConfigs()); po = ReplyObj.toGetRadarConfig(serv.getAllRadarConfigs());
} else if (ro instanceof SetRadarConfig) { } else if (ro instanceof SetRadarConfig) {
@ -227,33 +236,31 @@ public class MsgServ implements RadarEventListener, MessageListener {
} else if (ro instanceof GetRadarStatusMessages) { } else if (ro instanceof GetRadarStatusMessages) {
GetRadarStatusMessages grs = (GetRadarStatusMessages) ro; GetRadarStatusMessages grs = (GetRadarStatusMessages) ro;
if (grs.radarID != null) if (grs.radarID != null)
po = ReplyObj.toGetRadarStatusMessages( po = ReplyObj.toGetRadarStatusMessages(createROStatus(
createROStatus(grs.radarID, grs.radarID, serv.getRadarStatus(grs.radarID)));
serv.getRadarStatus(grs.radarID)));
else { else {
ArrayList<ROStatus> status = new ArrayList<ROStatus>(); ArrayList<ROStatus> status = new ArrayList<ROStatus>();
for (Map.Entry<String, ? extends RadarStatus> e : for (Map.Entry<String, ? extends RadarStatus> e : serv
serv.getAllRadarStatus().entrySet()) { .getAllRadarStatus().entrySet()) {
status.add(createROStatus(e.getKey(), status.add(createROStatus(e.getKey(), e.getValue()));
e.getValue()));
} }
po = ReplyObj.toGetRadarStatusMessages(status); po = ReplyObj.toGetRadarStatusMessages(status);
} }
} else if (ro instanceof SendOneTimeRequests) { } else if (ro instanceof SendOneTimeRequests) {
MsgServOtrHandler handler = null; MsgServOtrHandler handler = null;
/* Correlation ID should be null so as to not intefere /*
* with the handler list on the client side. * Correlation ID should be null so as to not intefere with the
* handler list on the client side.
*/ */
/* /*
String id = msg.getJMSCorrelationID(); * String id = msg.getJMSCorrelationID(); if (id == null) id =
if (id == null) * msg.getJMSMessageID();
id = msg.getJMSMessageID(); */
*/ String id = null;
String id = null;
if (replyToDestination != null) if (replyToDestination != null)
handler = new MsgServOtrHandler(replyToDestination, id); handler = new MsgServOtrHandler(replyToDestination, id);
SendOneTimeRequests r = (SendOneTimeRequests) ro; SendOneTimeRequests r = (SendOneTimeRequests) ro;
serv.sendOTRs(r.radarIDs, r.requests, handler); serv.sendOTRs(r.radarIDs, r.requests, handler);
} else if (ro instanceof SendRpsList) { } else if (ro instanceof SendRpsList) {
@ -267,17 +274,17 @@ public class MsgServ implements RadarEventListener, MessageListener {
} else if (ro instanceof GetRpsList) { } else if (ro instanceof GetRpsList) {
GetRpsList r = (GetRpsList) ro; GetRpsList r = (GetRpsList) ro;
if (r.radarID != null) { if (r.radarID != null) {
int vcp = r.vcp != null ? r.vcp : -1; int vcp = r.vcp != null ? r.vcp : -1;
int opMode = r.opMode != null ? r.opMode : GSM.OP_MODE_MAINTENANCE; int opMode = r.opMode != null ? r.opMode
: GSM.OP_MODE_MAINTENANCE;
RpsList rpsList = serv.getRpsList(r.radarID, opMode, vcp); RpsList rpsList = serv.getRpsList(r.radarID, opMode, vcp);
po = new ReplyObj.RpsListReply(rpsList); po = new ReplyObj.RpsListReply(rpsList);
/* /*
if (rpsList != null) * if (rpsList != null) po = ReplyObj.toGetRpsList(rpsList);
po = ReplyObj.toGetRpsList(rpsList); * else error =
else * String.format("Could not retrieve RPS list for radar %s%s",
error = String.format("Could not retrieve RPS list for radar %s%s", * r.radarID, vcp != -1 ? ", VCP " + vcp : "");
r.radarID, vcp != -1 ? ", VCP " + vcp : ""); */
*/
} else } else
error = "Must specify a radar name"; error = "Must specify a radar name";
} else if (ro instanceof GetGlobalConfig) { } else if (ro instanceof GetGlobalConfig) {
@ -301,7 +308,8 @@ public class MsgServ implements RadarEventListener, MessageListener {
po = r; po = r;
} else if (ro instanceof SendAlertRequest) { } else if (ro instanceof SendAlertRequest) {
SendAlertRequest ro2 = (SendAlertRequest) ro; SendAlertRequest ro2 = (SendAlertRequest) ro;
error = serv.sendAlertRequest(ro2.radarID, ro2.areaIndex, ro2.alertRequest); error = serv.sendAlertRequest(ro2.radarID, ro2.areaIndex,
ro2.alertRequest);
} else if (ro instanceof SendMessageToRPG) { } else if (ro instanceof SendMessageToRPG) {
SendMessageToRPG ro2 = (SendMessageToRPG) ro; SendMessageToRPG ro2 = (SendMessageToRPG) ro;
error = serv.sendMessageToRPG(ro2.radarID, ro2.message); error = serv.sendMessageToRPG(ro2.radarID, ro2.message);
@ -316,7 +324,7 @@ public class MsgServ implements RadarEventListener, MessageListener {
error = serv.debugHandleMessage(r.radarID, r.message); error = serv.debugHandleMessage(r.radarID, r.message);
} else } else
error = String.format("Unsupported request '%s'", ro.toString()); error = String.format("Unsupported request '%s'", ro.toString());
if (po == null) { if (po == null) {
if (error == null) if (error == null)
po = new ReplyObj(); po = new ReplyObj();
@ -324,97 +332,97 @@ public class MsgServ implements RadarEventListener, MessageListener {
po = ReplyObj.error(error); po = ReplyObj.error(error);
} }
return po; return po;
} }
private ROStatus createROStatus(String radarID, RadarStatus rs) {
ROStatus ros = new ROStatus();
ros.radarID = radarID;
ros.currentAAP = rs.getCurrentAAP();
ros.currentGSM = rs.getCurrentGSM();
ros.currentPTL = rs.getCurrentPTL();
ros.lastAAP = rs.getLastAAP();
ros.lastGSM = rs.getLastGSM();
ros.lastPTL = rs.getLastPTL();
return ros;
}
@Override private ROStatus createROStatus(String radarID, RadarStatus rs) {
public void handleConfigEvent(ConfigEvent event) { ROStatus ros = new ROStatus();
publishEvent(event); ros.radarID = radarID;
} ros.currentAAP = rs.getCurrentAAP();
ros.currentGSM = rs.getCurrentGSM();
private void publishEvent(Object obj) { ros.currentPTL = rs.getCurrentPTL();
// Can get events before mq is set up. ros.lastAAP = rs.getLastAAP();
if (topicPublisher == null) ros.lastGSM = rs.getLastGSM();
return; ros.lastPTL = rs.getLastPTL();
return ros;
StringWriter sw = new StringWriter(); }
try {
synchronized (m) {
m.marshal(obj, sw);
}
} catch (JAXBException e) {
Log.errorf("Error serializing event: %s", e);
return;
}
try {
TextMessage tm = topicSession.createTextMessage(
sw.toString());
topicPublisher.publish(tm);
} catch (JMSException e) {
Log.errorf("Error sending message: %s", e);
}
}
@Override @Override
public void handleNotificationEvent(NotificationEvent event) { public void handleConfigEvent(ConfigEvent event) {
publishEvent(event); publishEvent(event);
} }
class MsgServOtrHandler implements OTRHandler { private void publishEvent(Object obj) {
Destination destination; // Can get events before mq is set up.
String correlationID; if (topicPublisher == null)
return;
public MsgServOtrHandler(Destination destination, String correlationID) {
this.destination = destination; StringWriter sw = new StringWriter();
this.correlationID = correlationID; try {
} synchronized (m) {
m.marshal(obj, sw);
@Override }
public void handleOtrEvent(OtrEvent event) { } catch (JAXBException e) {
OtrEvent eventToSend = event.clone(); Log.errorf("Error serializing event: %s", e);
/* This OTR notification capability is currently only used to return;
* display alerts in CAVE. Thus, there is no need to send the }
* actual product data. Given that some products can be larger try {
* than one megabyte and the notification is in XML format, TextMessage tm = topicSession.createTextMessage(sw.toString());
* this is a useful optimization. topicPublisher.publish(tm);
*/ } catch (JMSException e) {
if (event.product != null Log.errorf("Error sending message: %s", e);
}
}
@Override
public void handleNotificationEvent(NotificationEvent event) {
publishEvent(event);
}
class MsgServOtrHandler implements OTRHandler {
Destination destination;
String correlationID;
public MsgServOtrHandler(Destination destination, String correlationID) {
this.destination = destination;
this.correlationID = correlationID;
}
@Override
public void handleOtrEvent(OtrEvent event) {
OtrEvent eventToSend = event.clone();
/*
* This OTR notification capability is currently only used to
* display alerts in CAVE. Thus, there is no need to send the actual
* product data. Given that some products can be larger than one
* megabyte and the notification is in XML format, this is a useful
* optimization.
*/
if (event.product != null
&& com.raytheon.rcm.message.Message && com.raytheon.rcm.message.Message
.messageCodeOf(event.product) > 16) .messageCodeOf(event.product) > 16)
eventToSend.product = GraphicProduct eventToSend.product = GraphicProduct
.extractHeaderAndPDB(event.product); .extractHeaderAndPDB(event.product);
StringWriter sw = new StringWriter(); StringWriter sw = new StringWriter();
try { try {
synchronized (m) { synchronized (m) {
m.marshal(eventToSend, sw); m.marshal(eventToSend, sw);
} }
} catch (JAXBException e) { } catch (JAXBException e) {
Log.errorf("Error processing remote request: %s", e); Log.errorf("Error processing remote request: %s", e);
return; return;
} }
try { try {
TextMessage rtm = queueSession.createTextMessage( TextMessage rtm = queueSession.createTextMessage(sw.toString());
sw.toString()); if (correlationID != null)
if (correlationID != null) rtm.setJMSCorrelationID(correlationID);
rtm.setJMSCorrelationID(correlationID); queueSender.send(destination, rtm);
queueSender.send(destination, rtm); } catch (JMSException e) {
} catch (JMSException e) { Log.errorf("Error sending message: %s", e);
Log.errorf("Error sending message: %s", e); }
} }
}
}
}
} }

View file

@ -1,262 +1,262 @@
<project name="Build specific targets and properties" default="noDefault"> <project name="Build specific targets and properties" default="noDefault">
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Run a given ${target} on all elements being built --> <!-- Run a given ${target} on all elements being built -->
<!-- Add on <ant> task for each top level element being built. --> <!-- Add on <ant> task for each top level element being built. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<property name="allElementsFile" value="${builder}/allElements.xml"/> <property name="allElementsFile" value="${builder}/allElements.xml"/>
<import file="${allElementsFile}" /> <import file="${allElementsFile}" />
<target name="allElements"> <target name="allElements">
<antcall target="allElementsDelegator" /> <antcall target="allElementsDelegator" />
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="getBaseComponents" depends="checkLocalBase" unless="skipBase"> <target name="getBaseComponents" depends="checkLocalBase" unless="skipBase">
<get src="${eclipseBaseURL}" dest="${buildDirectory}/../temp-base.zip" /> <get src="${eclipseBaseURL}" dest="${buildDirectory}/../temp-base.zip" />
<unzip dest="${base}" overwrite="true" src="${buildDirectory}/../temp-base.zip" /> <unzip dest="${base}" overwrite="true" src="${buildDirectory}/../temp-base.zip" />
</target> </target>
<target name="checkLocalBase"> <target name="checkLocalBase">
<available file="${base}" property="skipBase" /> <available file="${base}" property="skipBase" />
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Check out map files from correct repository --> <!-- Check out map files from correct repository -->
<!-- Replace values for mapsCheckoutTag as desired. --> <!-- Replace values for mapsCheckoutTag as desired. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="getMapFiles" depends="checkLocalMaps" unless="skipMaps"> <target name="getMapFiles" depends="checkLocalMaps" unless="skipMaps">
</target> </target>
<target name="checkLocalMaps"> <target name="checkLocalMaps">
</target> </target>
<target name="tagMapFiles" if="tagMaps"> <target name="tagMapFiles" if="tagMaps">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="clean" unless="noclean"> <target name="clean" unless="noclean">
<antcall target="allElements"> <antcall target="allElements">
<param name="target" value="cleanElement" /> <param name="target" value="cleanElement" />
</antcall> </antcall>
</target> </target>
<target name="gatherLogs"> <target name="gatherLogs">
<mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" /> <mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" />
<antcall target="allElements"> <antcall target="allElements">
<param name="target" value="gatherLogs" /> <param name="target" value="gatherLogs" />
</antcall> </antcall>
<unzip dest="${buildDirectory}/${buildLabel}/compilelogs" overwrite="true"> <unzip dest="${buildDirectory}/${buildLabel}/compilelogs" overwrite="true">
<fileset dir="${buildDirectory}/features"> <fileset dir="${buildDirectory}/features">
<include name="**/*.log.zip" /> <include name="**/*.log.zip" />
</fileset> </fileset>
</unzip> </unzip>
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do before setup --> <!-- Steps to do before setup -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="preSetup"> <target name="preSetup">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after setup but before starting the build proper --> <!-- Steps to do after setup but before starting the build proper -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postSetup"> <target name="postSetup">
<echo message="${buildDirectory}"/> <echo message="${buildDirectory}"/>
<mkdir dir="${buildDirectory}/plugins"/> <mkdir dir="${buildDirectory}/plugins"/>
<echo message="com.*/**"/> <echo message="com.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="com.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="com.*/**"/>
</copy> </copy>
<echo message="ucar.*/**"/> <echo message="ucar.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="ucar.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="ucar.*/**"/>
</copy> </copy>
<echo message="features.*/**"/> <echo message="features.*/**"/>
<copy todir="${buildDirectory}/features"> <copy todir="${buildDirectory}/features">
<fileset dir="${buildDirectory}/../../../" includes="*.feature*/**"/> <fileset dir="${buildDirectory}/../../../" includes="*.feature*/**"/>
</copy> </copy>
<echo message="ncsa.*/**"/> <echo message="ncsa.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="ncsa.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="ncsa.*/**"/>
</copy> </copy>
<echo message="org.*/**"/> <echo message="org.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="org.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="org.*/**"/>
</copy> </copy>
<echo message="net.*/**"/> <echo message="net.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="net.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="net.*/**"/>
</copy> </copy>
<echo message="ohd.*/**"/> <echo message="ohd.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="ohd*/**"/> <fileset dir="${buildDirectory}/../../../" includes="ohd*/**"/>
</copy> </copy>
<echo message="meteolib.*/**"/> <echo message="meteolib.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="meteolib.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="meteolib.*/**"/>
</copy> </copy>
<echo message="javax.*/**"/> <echo message="javax.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="javax.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="javax.*/**"/>
</copy> </copy>
<echo message="gov.*/**"/> <echo message="gov.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="gov.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="gov.*/**"/>
</copy> </copy>
<antcall target="getBaseComponents" /> <antcall target="getBaseComponents" />
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do before fetching the build elements --> <!-- Steps to do before fetching the build elements -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="preFetch"> <target name="preFetch">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after fetching the build elements --> <!-- Steps to do after fetching the build elements -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postFetch"> <target name="postFetch">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do before generating the build scripts. --> <!-- Steps to do before generating the build scripts. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="preGenerate"> <target name="preGenerate">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after generating the build scripts. --> <!-- Steps to do after generating the build scripts. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postGenerate"> <target name="postGenerate">
<antcall target="clean" /> <antcall target="clean" />
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do before running the build.xmls for the elements being built. --> <!-- Steps to do before running the build.xmls for the elements being built. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="preProcess"> <target name="preProcess">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after running the build.xmls for the elements being built. --> <!-- Steps to do after running the build.xmls for the elements being built. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postProcess"> <target name="postProcess">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do before running assemble. --> <!-- Steps to do before running assemble. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="preAssemble"> <target name="preAssemble">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after running assemble. --> <!-- Steps to do after running assemble. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postAssemble"> <target name="postAssemble">
<copy todir="${buildDirectory}/../../static/common/alertviz/etc" <copy todir="${buildDirectory}/../../static/common/alertviz/etc"
verbose="true"> verbose="true">
<fileset dir="${buildDirectory}/../../static/common/cave/etc"> <fileset dir="${buildDirectory}/../../static/common/cave/etc">
<include name="alertViz*/**" /> <include name="alertViz*/**" />
<include name="monitorIcons/**" /> <include name="monitorIcons/**" />
</fileset> </fileset>
</copy> </copy>
<!-- Update the 32-bit linux AlertViz zip with static files --> <!-- Update the 32-bit linux AlertViz zip with static files -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip" <zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip"
update="true"> update="true">
<fileset dir="${buildDirectory}/../../static/common" <fileset dir="${buildDirectory}/../../static/common"
excludes="cave/**" /> excludes="cave/**" />
<fileset dir="${buildDirectory}/../../static/linux" <fileset dir="${buildDirectory}/../../static/linux"
excludes="cave/**" /> excludes="cave/**" />
</zip> </zip>
<!-- Update the 64-bit linux AlertViz zip with static files --> <!-- Update the 64-bit linux AlertViz zip with static files -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86_64.zip" <zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86_64.zip"
update="true"> update="true">
<fileset dir="${buildDirectory}/../../static/common" <fileset dir="${buildDirectory}/../../static/common"
excludes="cave/**" /> excludes="cave/**" />
<fileset dir="${buildDirectory}/../../static/linux" <fileset dir="${buildDirectory}/../../static/linux"
excludes="cave/**" /> excludes="cave/**" />
</zip> </zip>
<!-- Update the 32-bit win32 AlertViz zip with static files --> <!-- Update the 32-bit win32 AlertViz zip with static files -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-win32.win32.x86.zip" <zip destfile="${buildDirectory}/${buildLabel}/${buildId}-win32.win32.x86.zip"
update="true"> update="true">
<fileset dir="${buildDirectory}/../../static/common" <fileset dir="${buildDirectory}/../../static/common"
excludes="cave/**" /> excludes="cave/**" />
<fileset dir="${buildDirectory}/../../static/win32.x86" <fileset dir="${buildDirectory}/../../static/win32.x86"
excludes="cave/**" /> excludes="cave/**" />
</zip> </zip>
<delete includeEmptyDirs="true"> <delete includeEmptyDirs="true">
<fileset dir="${buildDirectory}/../../static/common/alertviz/etc"> <fileset dir="${buildDirectory}/../../static/common/alertviz/etc">
<include name="alertViz*/**" /> <include name="alertViz*/**" />
<include name="monitorIcons/**" /> <include name="monitorIcons/**" />
</fileset> </fileset>
</delete> </delete>
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do before running package. --> <!-- Steps to do before running package. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="prePackage"> <target name="prePackage">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after running package. --> <!-- Steps to do after running package. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postPackage"> <target name="postPackage">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after the build is done. --> <!-- Steps to do after the build is done. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postBuild"> <target name="postBuild">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do to test the build results --> <!-- Steps to do to test the build results -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="test"> <target name="test">
<ant antfile="${builder}/test.xml" /> <ant antfile="${builder}/test.xml" />
</target> </target>
<target name="checkJUnitTestResults"> <target name="checkJUnitTestResults">
<taskdef name="checkJUnitReports" classname="sample.tools.TestResultCheck" classpath="${builder}/bin;${builder}/extraTools/sampletools.jar" /> <taskdef name="checkJUnitReports" classname="sample.tools.TestResultCheck" classpath="${builder}/bin;${builder}/extraTools/sampletools.jar" />
<checkJUnitReports dir="${buildDirectory}/${buildLabel}/testresults" output="${buildDirectory}/junitresults.txt" /> <checkJUnitReports dir="${buildDirectory}/${buildLabel}/testresults" output="${buildDirectory}/junitresults.txt" />
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do to publish the build results --> <!-- Steps to do to publish the build results -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="publish"> <target name="publish">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Default target --> <!-- Default target -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="noDefault"> <target name="noDefault">
<echo message="You must specify a target when invoking this file" /> <echo message="You must specify a target when invoking this file" />
</target> </target>
</project> </project>

0
cave/build/build.ecl Normal file
View file

View file

@ -1,485 +1,485 @@
<project name="Build specific targets and properties" default="noDefault"> <project name="Build specific targets and properties" default="noDefault">
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Run a given ${target} on all elements being built --> <!-- Run a given ${target} on all elements being built -->
<!-- Add on <ant> task for each top level element being built. --> <!-- Add on <ant> task for each top level element being built. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<property name="allElementsFile" value="${builder}/allElements.xml"/> <property name="allElementsFile" value="${builder}/allElements.xml"/>
<import file="${allElementsFile}" /> <import file="${allElementsFile}" />
<target name="allElements"> <target name="allElements">
<antcall target="allElementsDelegator" /> <antcall target="allElementsDelegator" />
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="getBaseComponents" depends="checkLocalBase" unless="skipBase"> <target name="getBaseComponents" depends="checkLocalBase" unless="skipBase">
<get src="${eclipseBaseURL}" dest="${buildDirectory}/../temp-base.zip" /> <get src="${eclipseBaseURL}" dest="${buildDirectory}/../temp-base.zip" />
<unzip dest="${base}" overwrite="true" src="${buildDirectory}/../temp-base.zip" /> <unzip dest="${base}" overwrite="true" src="${buildDirectory}/../temp-base.zip" />
</target> </target>
<target name="checkLocalBase"> <target name="checkLocalBase">
<available file="${base}" property="skipBase" /> <available file="${base}" property="skipBase" />
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Check out map files from correct repository --> <!-- Check out map files from correct repository -->
<!-- Replace values for mapsCheckoutTag as desired. --> <!-- Replace values for mapsCheckoutTag as desired. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="getMapFiles" depends="checkLocalMaps" unless="skipMaps"> <target name="getMapFiles" depends="checkLocalMaps" unless="skipMaps">
</target> </target>
<target name="checkLocalMaps"> <target name="checkLocalMaps">
</target> </target>
<target name="tagMapFiles" if="tagMaps"> <target name="tagMapFiles" if="tagMaps">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="clean" unless="noclean"> <target name="clean" unless="noclean">
<antcall target="allElements"> <antcall target="allElements">
<param name="target" value="cleanElement" /> <param name="target" value="cleanElement" />
</antcall> </antcall>
</target> </target>
<target name="gatherLogs"> <target name="gatherLogs">
<mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" /> <mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" />
<antcall target="allElements"> <antcall target="allElements">
<param name="target" value="gatherLogs" /> <param name="target" value="gatherLogs" />
</antcall> </antcall>
<unzip dest="${buildDirectory}/${buildLabel}/compilelogs" overwrite="true"> <unzip dest="${buildDirectory}/${buildLabel}/compilelogs" overwrite="true">
<fileset dir="${buildDirectory}/features"> <fileset dir="${buildDirectory}/features">
<include name="**/*.log.zip" /> <include name="**/*.log.zip" />
</fileset> </fileset>
</unzip> </unzip>
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do before setup --> <!-- Steps to do before setup -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="preSetup"> <target name="preSetup">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after setup but before starting the build proper --> <!-- Steps to do after setup but before starting the build proper -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postSetup"> <target name="postSetup">
<echo message="${buildDirectory}"/> <echo message="${buildDirectory}"/>
<mkdir dir="${buildDirectory}/plugins"/> <mkdir dir="${buildDirectory}/plugins"/>
<echo message="com.*/**"/> <echo message="com.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="com.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="com.*/**"/>
</copy> </copy>
<echo message="ucar.*/**"/> <echo message="ucar.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="ucar.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="ucar.*/**"/>
</copy> </copy>
<echo message="features.*/**"/> <echo message="features.*/**"/>
<copy todir="${buildDirectory}/features"> <copy todir="${buildDirectory}/features">
<fileset dir="${buildDirectory}/../../../" includes="*.feature*/**"/> <fileset dir="${buildDirectory}/../../../" includes="*.feature*/**"/>
</copy> </copy>
<echo message="ncsa.*/**"/> <echo message="ncsa.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="ncsa.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="ncsa.*/**"/>
</copy> </copy>
<echo message="org.*/**"/> <echo message="org.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="org.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="org.*/**"/>
</copy> </copy>
<echo message="net.*/**"/> <echo message="net.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="net.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="net.*/**"/>
</copy> </copy>
<echo message="ohd.*/**"/> <echo message="ohd.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="ohd*/**"/> <fileset dir="${buildDirectory}/../../../" includes="ohd*/**"/>
</copy> </copy>
<echo message="meteolib.*/**"/> <echo message="meteolib.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="meteolib.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="meteolib.*/**"/>
</copy> </copy>
<echo message="javax.*/**"/> <echo message="javax.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="javax.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="javax.*/**"/>
</copy> </copy>
<echo message="gov.*/**"/> <echo message="gov.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="gov.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="gov.*/**"/>
</copy> </copy>
<echo message="edu.*/**"/> <echo message="edu.*/**"/>
<copy todir="${buildDirectory}/plugins"> <copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="edu.*/**"/> <fileset dir="${buildDirectory}/../../../" includes="edu.*/**"/>
</copy> </copy>
<antcall target="getBaseComponents" /> <antcall target="getBaseComponents" />
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do before fetching the build elements --> <!-- Steps to do before fetching the build elements -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="preFetch"> <target name="preFetch">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after fetching the build elements --> <!-- Steps to do after fetching the build elements -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postFetch"> <target name="postFetch">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do before generating the build scripts. --> <!-- Steps to do before generating the build scripts. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="preGenerate"> <target name="preGenerate">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after generating the build scripts. --> <!-- Steps to do after generating the build scripts. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postGenerate"> <target name="postGenerate">
<antcall target="clean" /> <antcall target="clean" />
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do before running the build.xmls for the elements being built. --> <!-- Steps to do before running the build.xmls for the elements being built. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="preProcess"> <target name="preProcess">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after running the build.xmls for the elements being built. --> <!-- Steps to do after running the build.xmls for the elements being built. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postProcess"> <target name="postProcess">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do before running assemble. --> <!-- Steps to do before running assemble. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="preAssemble"> <target name="preAssemble">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after running assemble. --> <!-- Steps to do after running assemble. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postAssemble"> <target name="postAssemble">
<!-- Update the 32-bit linux CAVE zip with static files --> <!-- Update the 32-bit linux CAVE zip with static files -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip" <zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip"
update="true"> update="true">
<fileset dir="${buildDirectory}/../../static/linux" <fileset dir="${buildDirectory}/../../static/linux"
excludes="alertviz/**" /> excludes="alertviz/**" />
<fileset dir="${buildDirectory}/../../static/linux.x86" /> <fileset dir="${buildDirectory}/../../static/linux.x86" />
</zip> </zip>
<!-- Update the 64-bit linux CAVE zip with static files --> <!-- Update the 64-bit linux CAVE zip with static files -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86_64.zip" <zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86_64.zip"
update="true"> update="true">
<fileset dir="${buildDirectory}/../../static/linux" <fileset dir="${buildDirectory}/../../static/linux"
excludes="alertviz/**" /> excludes="alertviz/**" />
<fileset dir="${buildDirectory}/../../static/linux.x86_64" /> <fileset dir="${buildDirectory}/../../static/linux.x86_64" />
</zip> </zip>
<!-- Update the 32-bit win32 CAVE zip with static files --> <!-- Update the 32-bit win32 CAVE zip with static files -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-win32.win32.x86.zip" <zip destfile="${buildDirectory}/${buildLabel}/${buildId}-win32.win32.x86.zip"
update="true"> update="true">
<fileset dir="${buildDirectory}/../../static/win32.x86" <fileset dir="${buildDirectory}/../../static/win32.x86"
excludes="alertviz/**" /> excludes="alertviz/**" />
<!-- Include cave/etc in the win32 CAVE zip --> <!-- Include cave/etc in the win32 CAVE zip -->
<fileset dir="${buildDirectory}/../../static/common" <fileset dir="${buildDirectory}/../../static/common"
excludes="alertviz/**" /> excludes="alertviz/**" />
</zip> </zip>
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do before running package. --> <!-- Steps to do before running package. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="prePackage"> <target name="prePackage">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after running package. --> <!-- Steps to do after running package. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postPackage"> <target name="postPackage">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do after the build is done. --> <!-- Steps to do after the build is done. -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="postBuild"> <target name="postBuild">
<taskdef resource="net/sf/antcontrib/antlib.xml" <taskdef resource="net/sf/antcontrib/antlib.xml"
classpath="${builder}/../lib/ant/ant-contrib-1.0b3.jar" /> classpath="${builder}/../lib/ant/ant-contrib-1.0b3.jar" />
<taskdef name="xmltask" <taskdef name="xmltask"
classpath="${builder}/../lib/ant/xmltask-v1.15.1.jar" classpath="${builder}/../lib/ant/xmltask-v1.15.1.jar"
classname="com.oopsconsultancy.xmltask.ant.XmlTask" /> classname="com.oopsconsultancy.xmltask.ant.XmlTask" />
<!-- Generate the 32-bit CAVE ini files --> <!-- Generate the 32-bit CAVE ini files -->
<var name="cave.arch" value="arch.x86" /> <var name="cave.arch" value="arch.x86" />
<extractCAVEini <extractCAVEini
zip.file="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip" /> zip.file="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip" />
<antcall target="generateDynamicCAVE" /> <antcall target="generateDynamicCAVE" />
<!-- Update the 32-bit CAVE zip file --> <!-- Update the 32-bit CAVE zip file -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip" <zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip"
basedir="/tmp" basedir="/tmp"
includes="cave/*.ini, cave/*.sh" includes="cave/*.ini, cave/*.sh"
update="true" /> update="true" />
<!-- Generate the 64-bit CAVE ini files --> <!-- Generate the 64-bit CAVE ini files -->
<var name="cave.arch" value="arch.x86_64" /> <var name="cave.arch" value="arch.x86_64" />
<extractCAVEini <extractCAVEini
zip.file="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86_64.zip" /> zip.file="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86_64.zip" />
<antcall target="generateDynamicCAVE" /> <antcall target="generateDynamicCAVE" />
<!-- Update the 64-bit cave.ini file --> <!-- Update the 64-bit cave.ini file -->
<antcall target="update64BitINI" /> <antcall target="update64BitINI" />
<!-- Update the 64-bit CAVE zip file --> <!-- Update the 64-bit CAVE zip file -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86_64.zip" <zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86_64.zip"
basedir="/tmp" basedir="/tmp"
includes="cave/*.ini, cave/*.sh" includes="cave/*.ini, cave/*.sh"
update="true" /> update="true" />
</target> </target>
<macrodef name="extractCAVEini"> <macrodef name="extractCAVEini">
<attribute name="zip.file" /> <attribute name="zip.file" />
<sequential> <sequential>
<unzip src="@{zip.file}" <unzip src="@{zip.file}"
dest="/tmp"> dest="/tmp">
<patternset> <patternset>
<include name="**/cave/cave.ini" /> <include name="**/cave/cave.ini" />
</patternset> </patternset>
</unzip> </unzip>
</sequential> </sequential>
</macrodef> </macrodef>
<macrodef name="verifyVersion"> <macrodef name="verifyVersion">
<attribute name="file.version" /> <attribute name="file.version" />
<sequential> <sequential>
<property name="___memorySettingsVersion___" <property name="___memorySettingsVersion___"
value="3.0"/> value="3.0"/>
<if> <if>
<not> <not>
<equals <equals
arg1="${___memorySettingsVersion___}" arg1="${___memorySettingsVersion___}"
arg2="@{file.version}" /> arg2="@{file.version}" />
</not> </not>
<then> <then>
<fail <fail
message="ERROR: memorySettings.xml Version Mismatch." /> message="ERROR: memorySettings.xml Version Mismatch." />
</then> </then>
</if> </if>
</sequential> </sequential>
</macrodef> </macrodef>
<target name="generateDynamicCAVE"> <target name="generateDynamicCAVE">
<xmlproperty file="${builder}/memorySettings.xml" <xmlproperty file="${builder}/memorySettings.xml"
collapseAttributes="true"/> collapseAttributes="true"/>
<verifyVersion <verifyVersion
file.version="${cave-memory-settings.file-version}" /> file.version="${cave-memory-settings.file-version}" />
<property name="iniLookupScript" <property name="iniLookupScript"
value="/tmp/cave/iniLookup.sh" /> value="/tmp/cave/iniLookup.sh" />
<!-- Start the iniLookup.sh script --> <!-- Start the iniLookup.sh script -->
<echo message="#!/bin/bash${line.separator}" <echo message="#!/bin/bash${line.separator}"
file="${iniLookupScript}" /> file="${iniLookupScript}" />
<echo message="${line.separator}" <echo message="${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message="# This auto-generated script will be sourced by caveUtil.sh.${line.separator}" <echo message="# This auto-generated script will be sourced by caveUtil.sh.${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message="export ASSOCIATED_INI=${line.separator}" <echo message="export ASSOCIATED_INI=${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message="${line.separator}" <echo message="${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message="function retrieveAssociatedINI()${line.separator}" <echo message="function retrieveAssociatedINI()${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message="{${line.separator}" <echo message="{${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message=" # Arguments${line.separator}" <echo message=" # Arguments${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message=" # ${1} == one in the set: {-component, -perspective}${line.separator}" <echo message=" # ${1} == one in the set: {-component, -perspective}${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message=" # ${2} == the argument that corresponds to the first argument${line.separator}" <echo message=" # ${2} == the argument that corresponds to the first argument${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message="${line.separator}" <echo message="${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message=" # AUTOGENERATED IF STATEMENTS." <echo message=" # AUTOGENERATED IF STATEMENTS."
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<xmltask source="${builder}/memorySettings.xml"> <xmltask source="${builder}/memorySettings.xml">
<call path="//${cave.arch}/memory-setting"> <call path="//${cave.arch}/memory-setting">
<param name="first-arg" <param name="first-arg"
path="command-line-args/first-arg/text()" /> path="command-line-args/first-arg/text()" />
<param name="second-arg" <param name="second-arg"
path="command-line-args/second-arg/text()" /> path="command-line-args/second-arg/text()" />
<!-- TODO: Explore using copy and buffers to do <!-- TODO: Explore using copy and buffers to do
the following actions in a better way. --> the following actions in a better way. -->
<param name="max-memory" <param name="max-memory"
path="ini-substitutions/max-memory/value/text()" /> path="ini-substitutions/max-memory/value/text()" />
<param name="max-perm" <param name="max-perm"
path="ini-substitutions/max-perm/value/text()" /> path="ini-substitutions/max-perm/value/text()" />
<actions> <actions>
<!-- Create a component-specific ini file --> <!-- Create a component-specific ini file -->
<copy verbose="true" <copy verbose="true"
file="/tmp/cave/cave.ini" file="/tmp/cave/cave.ini"
tofile="/tmp/cave/@{second-arg}.ini" tofile="/tmp/cave/@{second-arg}.ini"
overwrite="true" /> overwrite="true" />
<!-- Update the ini file --> <!-- Update the ini file -->
<update.ini <update.ini
ini.file="@{second-arg}.ini" ini.file="@{second-arg}.ini"
jvm.arg="${cave-memory-settings.default-memory-setting.default-max-memory.jvm-arg}" jvm.arg="${cave-memory-settings.default-memory-setting.default-max-memory.jvm-arg}"
current.value="${cave-memory-settings.default-memory-setting.default-max-memory.value}" current.value="${cave-memory-settings.default-memory-setting.default-max-memory.value}"
new.value="@{max-memory}" /> new.value="@{max-memory}" />
<update.ini <update.ini
ini.file="@{second-arg}.ini" ini.file="@{second-arg}.ini"
jvm.arg="${cave-memory-settings.default-memory-setting.default-max-perm.jvm-arg}" jvm.arg="${cave-memory-settings.default-memory-setting.default-max-perm.jvm-arg}"
current.value="${cave-memory-settings.default-memory-setting.default-max-perm.value}" current.value="${cave-memory-settings.default-memory-setting.default-max-perm.value}"
new.value="@{max-perm}" /> new.value="@{max-perm}" />
<!-- Add to the ini lookup utility script --> <!-- Add to the ini lookup utility script -->
<echo message="${line.separator}" <echo message="${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message=" if [ &quot;$${1}&quot; == &quot;@{first-arg}&quot; ] &amp;&amp;${line.separator}" <echo message=" if [ &quot;$${1}&quot; == &quot;@{first-arg}&quot; ] &amp;&amp;${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message=" [ &quot;$${2}&quot; == &quot;@{second-arg}&quot; ]; then${line.separator}" <echo message=" [ &quot;$${2}&quot; == &quot;@{second-arg}&quot; ]; then${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message="${line.separator}" <echo message="${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message=" export ASSOCIATED_INI=&quot;@{second-arg}.ini&quot;${line.separator}" <echo message=" export ASSOCIATED_INI=&quot;@{second-arg}.ini&quot;${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message=" return 0${line.separator}" <echo message=" return 0${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message="${line.separator}" <echo message="${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message=" fi${line.separator}" <echo message=" fi${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
</actions> </actions>
</call> </call>
</xmltask> </xmltask>
<!-- Finish the iniLookup.sh script --> <!-- Finish the iniLookup.sh script -->
<echo message="${line.separator}" <echo message="${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message=" return 1${line.separator}" <echo message=" return 1${line.separator}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
<echo message="}" <echo message="}"
file="${iniLookupScript}" file="${iniLookupScript}"
append="true" /> append="true" />
</target> </target>
<!-- Used to update cave.ini for the x86_64 cave. --> <!-- Used to update cave.ini for the x86_64 cave. -->
<target name="update64BitINI"> <target name="update64BitINI">
<xmlproperty file="${builder}/memorySettings.xml" <xmlproperty file="${builder}/memorySettings.xml"
collapseAttributes="true"/> collapseAttributes="true"/>
<property name="caveXmx" value="2048M" /> <property name="caveXmx" value="2048M" />
<property name="caveMaxPermSize" value="256m" /> <property name="caveMaxPermSize" value="256m" />
<update.ini <update.ini
ini.file="cave.ini" ini.file="cave.ini"
jvm.arg="${cave-memory-settings.default-memory-setting.default-max-memory.jvm-arg}" jvm.arg="${cave-memory-settings.default-memory-setting.default-max-memory.jvm-arg}"
current.value="${cave-memory-settings.default-memory-setting.default-max-memory.value}" current.value="${cave-memory-settings.default-memory-setting.default-max-memory.value}"
new.value="${caveXmx}" /> new.value="${caveXmx}" />
<update.ini <update.ini
ini.file="cave.ini" ini.file="cave.ini"
jvm.arg="${cave-memory-settings.default-memory-setting.default-max-perm.jvm-arg}" jvm.arg="${cave-memory-settings.default-memory-setting.default-max-perm.jvm-arg}"
current.value="${cave-memory-settings.default-memory-setting.default-max-perm.value}" current.value="${cave-memory-settings.default-memory-setting.default-max-perm.value}"
new.value="${caveMaxPermSize}" /> new.value="${caveMaxPermSize}" />
</target> </target>
<macrodef name="update.ini"> <macrodef name="update.ini">
<attribute name="ini.file" /> <attribute name="ini.file" />
<attribute name="jvm.arg" /> <attribute name="jvm.arg" />
<attribute name="current.value" /> <attribute name="current.value" />
<attribute name="new.value" /> <attribute name="new.value" />
<sequential> <sequential>
<if> <if>
<not> <not>
<equals arg1="@{new.value}" <equals arg1="@{new.value}"
arg2="DEFAULT" /> arg2="DEFAULT" />
</not> </not>
<then> <then>
<exec executable="/bin/sed" <exec executable="/bin/sed"
output="/tmp/cave/ini.tmp"> output="/tmp/cave/ini.tmp">
<arg value="-e" /> <arg value="-e" />
<arg value="s/@{jvm.arg}@{current.value}/@{jvm.arg}@{new.value}/" /> <arg value="s/@{jvm.arg}@{current.value}/@{jvm.arg}@{new.value}/" />
<arg value="/tmp/cave/@{ini.file}" /> <arg value="/tmp/cave/@{ini.file}" />
</exec> </exec>
<move verbose="true" <move verbose="true"
file="/tmp/cave/ini.tmp" file="/tmp/cave/ini.tmp"
tofile="/tmp/cave/@{ini.file}" tofile="/tmp/cave/@{ini.file}"
overwrite="true" /> overwrite="true" />
</then> </then>
</if> </if>
</sequential> </sequential>
</macrodef> </macrodef>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do to test the build results --> <!-- Steps to do to test the build results -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="test"> <target name="test">
<ant antfile="${builder}/test.xml" /> <ant antfile="${builder}/test.xml" />
</target> </target>
<target name="checkJUnitTestResults"> <target name="checkJUnitTestResults">
<taskdef name="checkJUnitReports" classname="sample.tools.TestResultCheck" classpath="${builder}/bin;${builder}/extraTools/sampletools.jar" /> <taskdef name="checkJUnitReports" classname="sample.tools.TestResultCheck" classpath="${builder}/bin;${builder}/extraTools/sampletools.jar" />
<checkJUnitReports dir="${buildDirectory}/${buildLabel}/testresults" output="${buildDirectory}/junitresults.txt" /> <checkJUnitReports dir="${buildDirectory}/${buildLabel}/testresults" output="${buildDirectory}/junitresults.txt" />
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Steps to do to publish the build results --> <!-- Steps to do to publish the build results -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="publish"> <target name="publish">
</target> </target>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Default target --> <!-- Default target -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<target name="noDefault"> <target name="noDefault">
<echo message="You must specify a target when invoking this file" /> <echo message="You must specify a target when invoking this file" />
</target> </target>
</project> </project>

View file

@ -18,9 +18,13 @@
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information. further_licensing_information.
--> -->
<!--
Date DR# Engineer Description
03/26/2012 12864 zhao Changed CigVisTrendTimeout from 300 to 1800
-->
<ClimateTimeouts> <ClimateTimeouts>
<ClimateMetarTimeout>20</ClimateMetarTimeout> <ClimateMetarTimeout>20</ClimateMetarTimeout>
<WindRoseTimeout>20</WindRoseTimeout> <WindRoseTimeout>20</WindRoseTimeout>
<CigVisDistTimeout>90</CigVisDistTimeout> <CigVisDistTimeout>90</CigVisDistTimeout>
<CigVisTrendTimeout>300</CigVisTrendTimeout> <CigVisTrendTimeout>1800</CigVisTrendTimeout>
</ClimateTimeouts> </ClimateTimeouts>

View file

@ -452,7 +452,8 @@ class Procedure (SmartScript.SmartScript):
" locked by another user." " locked by another user."
self.statusBarMsg(msg, "S") self.statusBarMsg(msg, "S")
continue continue
gustGrid[windTooHigh] = windGrid
gustGrid = where(windTooHigh, windGrid, gustGrid)
self.createGrid(MODEL, "WindGust", "SCALAR", gustGrid, tr) self.createGrid(MODEL, "WindGust", "SCALAR", gustGrid, tr)
gustDict[tr] = gustGrid # update the gustDict gustDict[tr] = gustGrid # update the gustDict

View file

@ -66,7 +66,7 @@ VariableList=[]
VariableList.append(("Value:",1,"numeric")) VariableList.append(("Value:",1,"numeric"))
VariableList.append(("Action:","Add","radio",["Add","Subtract","Multiply","Divide"])) VariableList.append(("Action:","Add","radio",["Add","Subtract","Multiply","Divide"]))
VariableList.append(("Elevation:","None","radio",["None","Mountain","Valley","Specific"])) VariableList.append(("Elevation:","None","radio",["None","Mountain","Valley","Specific"]))
VariableList.append(("Vectors:","Magnitude","radio",["Both","Magnitude","Direction"])) VariableList.append(("Vectors:","Magnitude","radio",["Magnitude","Direction"]))
VariableList.append(("Edge:","Flat","radio",["Flat","Edge","Taper"])) VariableList.append(("Edge:","Flat","radio",["Flat","Edge","Taper"]))
VariableList.append(("Edge Width:",5,"scale",[1,30],1)) VariableList.append(("Edge Width:",5,"scale",[1,30],1))
VariableList.append(("Specific Elevation:",5000,"numeric")) VariableList.append(("Specific Elevation:",5000,"numeric"))
@ -76,7 +76,7 @@ class Tool (SmartScript.SmartScript):
SmartScript.SmartScript.__init__(self, dbss) SmartScript.SmartScript.__init__(self, dbss)
def preProcessTool(self): def preProcessTool(self):
self.savemode=self.getVectorEditMode() self.savemode=self.getVectorEditMode()
self.setVectorEditMode("Both") self.setVectorEditMode("Magnitude")
def postProcessTool(self): def postProcessTool(self):
self.setVectorEditMode(self.savemode) self.setVectorEditMode(self.savemode)
def preProcessGrid(self,Topo,editArea,varDict): def preProcessGrid(self,Topo,editArea,varDict):
@ -167,7 +167,7 @@ class Tool (SmartScript.SmartScript):
else: else:
mag=variableElement[0] mag=variableElement[0]
dir=variableElement[1] dir=variableElement[1]
if ((vect=="Magnitude")or(vect=="Both")): if (vect=="Magnitude"):
if (action=="Add"): if (action=="Add"):
newmag=mag+(self.deltagrid*deltavalue) newmag=mag+(self.deltagrid*deltavalue)
elif (action=="Subtract"): elif (action=="Subtract"):

View file

@ -162,6 +162,7 @@ class DiscretePhrases(PhraseBuilder.PhraseBuilder):
timeDescriptor = self.headlinesTimeRange_descriptor( timeDescriptor = self.headlinesTimeRange_descriptor(
tree, node, key, tr, areaLabel, issuanceTime) tree, node, key, tr, areaLabel, issuanceTime)
from com.raytheon.uf.common.dataplugin.gfe.discrete import DiscreteKey
headlineWords = DiscreteKey.discreteDefinition(siteId).keyDesc( headlineWords = DiscreteKey.discreteDefinition(siteId).keyDesc(
"Hazards" + "_SFC", key) "Hazards" + "_SFC", key)
if headlineWords == "": # Don't process the "<None>" key if headlineWords == "": # Don't process the "<None>" key

View file

@ -1,69 +1,69 @@
@echo OFF @echo OFF
REM Determine if we are running on a 32-bit or 64-bit OS. REM Determine if we are running on a 32-bit or 64-bit OS.
IF NOT EXIST C:\Windows\SysWOW64\reg.exe ( IF NOT EXIST C:\Windows\SysWOW64\reg.exe (
SET REG_EXE=C:\Windows\System32\reg.exe SET REG_EXE=C:\Windows\System32\reg.exe
) ELSE ( ) ELSE (
SET REG_EXE=C:\Windows\SysWOW64\reg.exe SET REG_EXE=C:\Windows\SysWOW64\reg.exe
) )
REM Determine where we are located. REM Determine where we are located.
SET CONTAINING_DIRECTORY=%~dp0 SET CONTAINING_DIRECTORY=%~dp0
REM Prepare the environment. REM Prepare the environment.
REM Registry Query Variables. REM Registry Query Variables.
SET A2_JAVA_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Java" SET A2_JAVA_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Java"
SET A2_PYTHON_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Python" SET A2_PYTHON_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Python"
REM Determine where AWIPS II Java (the jre) is located. REM Determine where AWIPS II Java (the jre) is located.
%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory > NUL 2>&1 %REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory > NUL 2>&1
IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Java. && PAUSE && EXIT) IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Java. && PAUSE && EXIT)
FOR /F "tokens=2* delims= " %%A IN ( FOR /F "tokens=2* delims= " %%A IN (
'%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory') DO ( '%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory') DO (
SET JavaJreDirectory=%%B) SET JavaJreDirectory=%%B)
REM Determine where AWIPS II Python is located. REM Determine where AWIPS II Python is located.
%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory > NUL 2>&1 %REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory > NUL 2>&1
IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Python. && PAUSE && EXIT) IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Python. && PAUSE && EXIT)
FOR /F "tokens=2* delims= " %%A IN ( FOR /F "tokens=2* delims= " %%A IN (
'%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory') DO ( '%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory') DO (
SET PythonInstallDirectory=%%B) SET PythonInstallDirectory=%%B)
REM Add Java and Python to the path. REM Add Java and Python to the path.
SET Path=%PythonInstallDirectory%;%PythonInstallDirectory%\DLLs;%Path% SET Path=%PythonInstallDirectory%;%PythonInstallDirectory%\DLLs;%Path%
SET Path=%JavaJreDirectory%\bin;%Path% SET Path=%JavaJreDirectory%\bin;%Path%
REM Define 'PythonPath'. REM Define 'PythonPath'.
SET PythonPath=%PythonInstallDirectory%\Lib\lib-tk;%PythonPath% SET PythonPath=%PythonInstallDirectory%\Lib\lib-tk;%PythonPath%
SET PythonPath=%PythonInstallDirectory%\DLLs;%PythonPath% SET PythonPath=%PythonInstallDirectory%\DLLs;%PythonPath%
SET PythonPath=%PythonInstallDirectory%\Lib;%PythonPath% SET PythonPath=%PythonInstallDirectory%\Lib;%PythonPath%
SET PythonPath=%PythonInstallDirectory%;%PythonPath% SET PythonPath=%PythonInstallDirectory%;%PythonPath%
REM Eliminate variables that will no longer be used. REM Eliminate variables that will no longer be used.
SET PythonInstallDirectory= SET PythonInstallDirectory=
SET JavaJreDirectory= SET JavaJreDirectory=
SET REG_EXE= SET REG_EXE=
SET A2_JAVA_REG= SET A2_JAVA_REG=
SET A2_PYTHON_REG= SET A2_PYTHON_REG=
REM Determine where we will be logging to. REM Determine where we will be logging to.
SET HOME_DIRECTORY=%HOMEDRIVE%%HOMEPATH% SET HOME_DIRECTORY=%HOMEDRIVE%%HOMEPATH%
SET CAVEDATA_LOG_DIRECTORY=%HOMEDRIVE%%HOMEPATH%\caveData\logs SET CAVEDATA_LOG_DIRECTORY=%HOMEDRIVE%%HOMEPATH%\caveData\logs
SET CONSOLE_LOG_DIRECTORY=%CAVEDATA_LOG_DIRECTORY%\consoleLogs\%COMPUTERNAME% SET CONSOLE_LOG_DIRECTORY=%CAVEDATA_LOG_DIRECTORY%\consoleLogs\%COMPUTERNAME%
IF NOT EXIST "%CONSOLE_LOG_DIRECTORY%" (MKDIR "%CONSOLE_LOG_DIRECTORY%") IF NOT EXIST "%CONSOLE_LOG_DIRECTORY%" (MKDIR "%CONSOLE_LOG_DIRECTORY%")
echo Starting ALERTVIZ; leave this CMD window open to enable AlertViz 'restart'. echo Starting ALERTVIZ; leave this CMD window open to enable AlertViz 'restart'.
REM Start AlertViz (and implement the alertviz restart capability). REM Start AlertViz (and implement the alertviz restart capability).
:AlertVizLoopStart :AlertVizLoopStart
SET RND=%random% SET RND=%random%
SET RND_DATETIME_FILE=%TMP%\awips2dt_%RND%.tmp SET RND_DATETIME_FILE=%TMP%\awips2dt_%RND%.tmp
REM Python is used to retrieve the current date and time because the order REM Python is used to retrieve the current date and time because the order
REM of the Windows date/time fields is not necessarily guaranteed and the REM of the Windows date/time fields is not necessarily guaranteed and the
REM Windows date/time fields can only be extracted using substring operations REM Windows date/time fields can only be extracted using substring operations
REM instead of -formatter- strings like Linux allows. REM instead of -formatter- strings like Linux allows.
python -c "from datetime import datetime; print datetime.now().strftime('%%Y%%m%%d_%%H%%M%%S');" > %RND_DATETIME_FILE% python -c "from datetime import datetime; print datetime.now().strftime('%%Y%%m%%d_%%H%%M%%S');" > %RND_DATETIME_FILE%
SET /p LOG_DATETIME= < %RND_DATETIME_FILE% SET /p LOG_DATETIME= < %RND_DATETIME_FILE%
DEL %RND_DATETIME_FILE% DEL %RND_DATETIME_FILE%
"%CONTAINING_DIRECTORY%alertviz.exe" %* > "%CONSOLE_LOG_DIRECTORY%\alertviz_%LOG_DATETIME%.log" 2>&1 "%CONTAINING_DIRECTORY%alertviz.exe" %* > "%CONSOLE_LOG_DIRECTORY%\alertviz_%LOG_DATETIME%.log" 2>&1
IF %ERRORLEVEL% == 0 (EXIT) IF %ERRORLEVEL% == 0 (EXIT)
echo Restarting AlertViz. echo Restarting AlertViz.
GOTO AlertVizLoopStart GOTO AlertVizLoopStart

View file

@ -1,72 +1,72 @@
@echo OFF @echo OFF
REM Determine if we are running on a 32-bit or 64-bit OS. REM Determine if we are running on a 32-bit or 64-bit OS.
IF NOT EXIST C:\Windows\SysWOW64\reg.exe ( IF NOT EXIST C:\Windows\SysWOW64\reg.exe (
SET REG_EXE=C:\Windows\System32\reg.exe SET REG_EXE=C:\Windows\System32\reg.exe
) ELSE ( ) ELSE (
SET REG_EXE=C:\Windows\SysWOW64\reg.exe SET REG_EXE=C:\Windows\SysWOW64\reg.exe
) )
REM Determine where we are located. REM Determine where we are located.
SET CONTAINING_DIRECTORY=%~dp0 SET CONTAINING_DIRECTORY=%~dp0
REM Prepare the environment. REM Prepare the environment.
REM Registry Query Variables. REM Registry Query Variables.
SET A2_JAVA_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Java" SET A2_JAVA_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Java"
SET A2_PYTHON_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Python" SET A2_PYTHON_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Python"
REM Determine where AWIPS II Java (the jre) is located. REM Determine where AWIPS II Java (the jre) is located.
%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory > NUL 2>&1 %REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory > NUL 2>&1
IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Java. && PAUSE && EXIT) IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Java. && PAUSE && EXIT)
FOR /F "tokens=2* delims= " %%A IN ( FOR /F "tokens=2* delims= " %%A IN (
'%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory') DO ( '%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory') DO (
SET JavaJreDirectory=%%B) SET JavaJreDirectory=%%B)
REM Determine where AWIPS II Python is located. REM Determine where AWIPS II Python is located.
%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory > NUL 2>&1 %REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory > NUL 2>&1
IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Python. && PAUSE && EXIT) IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Python. && PAUSE && EXIT)
FOR /F "tokens=2* delims= " %%A IN ( FOR /F "tokens=2* delims= " %%A IN (
'%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory') DO ( '%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory') DO (
SET PythonInstallDirectory=%%B) SET PythonInstallDirectory=%%B)
REM Add Java and Python to the path. REM Add Java and Python to the path.
SET Path=%PythonInstallDirectory%;%PythonInstallDirectory%\DLLs;%Path% SET Path=%PythonInstallDirectory%;%PythonInstallDirectory%\DLLs;%Path%
SET Path=%JavaJreDirectory%\bin;%Path% SET Path=%JavaJreDirectory%\bin;%Path%
REM Add the CAVE lib directory to the path. REM Add the CAVE lib directory to the path.
SET Path=%CONTAINING_DIRECTORY%lib;%Path% SET Path=%CONTAINING_DIRECTORY%lib;%Path%
REM Define 'PythonPath'. REM Define 'PythonPath'.
SET PythonPath=%CONTAINING_DIRECTORY%lib;%PythonPath% SET PythonPath=%CONTAINING_DIRECTORY%lib;%PythonPath%
SET PythonPath=%PythonInstallDirectory%\Lib\lib-tk;%PythonPath% SET PythonPath=%PythonInstallDirectory%\Lib\lib-tk;%PythonPath%
SET PythonPath=%PythonInstallDirectory%\DLLs;%PythonPath% SET PythonPath=%PythonInstallDirectory%\DLLs;%PythonPath%
SET PythonPath=%PythonInstallDirectory%\Lib;%PythonPath% SET PythonPath=%PythonInstallDirectory%\Lib;%PythonPath%
SET PythonPath=%PythonInstallDirectory%;%PythonPath% SET PythonPath=%PythonInstallDirectory%;%PythonPath%
REM Eliminate variables that will no longer be used. REM Eliminate variables that will no longer be used.
SET PythonInstallDirectory= SET PythonInstallDirectory=
SET JavaJreDirectory= SET JavaJreDirectory=
SET REG_EXE= SET REG_EXE=
SET A2_JAVA_REG= SET A2_JAVA_REG=
SET A2_PYTHON_REG= SET A2_PYTHON_REG=
REM Determine where we will be logging to. REM Determine where we will be logging to.
SET HOME_DIRECTORY=%HOMEDRIVE%%HOMEPATH% SET HOME_DIRECTORY=%HOMEDRIVE%%HOMEPATH%
SET CAVEDATA_LOG_DIRECTORY=%HOMEDRIVE%%HOMEPATH%\caveData\logs SET CAVEDATA_LOG_DIRECTORY=%HOMEDRIVE%%HOMEPATH%\caveData\logs
SET CONSOLE_LOG_DIRECTORY=%CAVEDATA_LOG_DIRECTORY%\consoleLogs\%COMPUTERNAME% SET CONSOLE_LOG_DIRECTORY=%CAVEDATA_LOG_DIRECTORY%\consoleLogs\%COMPUTERNAME%
IF NOT EXIST "%CONSOLE_LOG_DIRECTORY%" (MKDIR "%CONSOLE_LOG_DIRECTORY%") IF NOT EXIST "%CONSOLE_LOG_DIRECTORY%" (MKDIR "%CONSOLE_LOG_DIRECTORY%")
SET RND=%random% SET RND=%random%
SET RND_DATETIME_FILE=%TMP%\awips2dt_%RND%.tmp SET RND_DATETIME_FILE=%TMP%\awips2dt_%RND%.tmp
REM Python is used to retrieve the current date and time because the order REM Python is used to retrieve the current date and time because the order
REM of the Windows date/time fields is not necessarily guaranteed and the REM of the Windows date/time fields is not necessarily guaranteed and the
REM Windows date/time fields can only be extracted using substring operations REM Windows date/time fields can only be extracted using substring operations
REM instead of -formatter- strings like Linux allows. REM instead of -formatter- strings like Linux allows.
python -c "from datetime import datetime; print datetime.now().strftime('%%Y%%m%%d_%%H%%M%%S');" > %RND_DATETIME_FILE% python -c "from datetime import datetime; print datetime.now().strftime('%%Y%%m%%d_%%H%%M%%S');" > %RND_DATETIME_FILE%
SET /p LOG_DATETIME= < %RND_DATETIME_FILE% SET /p LOG_DATETIME= < %RND_DATETIME_FILE%
DEL %RND_DATETIME_FILE% DEL %RND_DATETIME_FILE%
echo THIS CMD WINDOW CAN BE CLOSED AT ANY TIME! echo THIS CMD WINDOW CAN BE CLOSED AT ANY TIME!
cd %HOMEPATH% cd %HOMEPATH%
REM Start CAVE. REM Start CAVE.
"%CONTAINING_DIRECTORY%cave.exe" %* > "%CONSOLE_LOG_DIRECTORY%\cave_%LOG_DATETIME%.log" 2>&1 "%CONTAINING_DIRECTORY%cave.exe" %* > "%CONSOLE_LOG_DIRECTORY%\cave_%LOG_DATETIME%.log" 2>&1
IF ERRORLEVEL 1 (echo CAVE ERROR - check the logs for additional information. && PAUSE) IF ERRORLEVEL 1 (echo CAVE ERROR - check the logs for additional information. && PAUSE)
EXIT EXIT

View file

@ -407,6 +407,12 @@ public class CoopPrecipDataCubeAdapter implements IDataCubeAdapter {
return null; return null;
} }
@Override
public String recordKeyGenerator(PluginDataObject pdo) {
// TODO Auto-generated method stub
return null;
}
@Override @Override
public void initInventory() { public void initInventory() {
// TODO Auto-generated method stub // TODO Auto-generated method stub

View file

@ -87,7 +87,6 @@ public abstract class AbstractDbMapResource<T extends AbstractDbMapResourceData,
if (font != null) { if (font != null) {
font.dispose(); font.dispose();
font = null;
} }
} }

View file

@ -540,7 +540,7 @@ public class DbMapResource extends
if (shadedShape != null) { if (shadedShape != null) {
shadedShape.dispose(); shadedShape.dispose();
} }
lastExtent = null;
super.disposeInternal(); super.disposeInternal();
} }

View file

@ -133,4 +133,11 @@ public abstract class AbstractGraphicsFactoryAdapter {
public abstract Canvas constrcutCanvas(Composite canvasComp) public abstract Canvas constrcutCanvas(Composite canvasComp)
throws VizException; throws VizException;
/**
* Dispose of the canvas, it can be assumed the canvas is the same type
* created from constructCanvas
*
* @param canvas
*/
public abstract void disposeCanvas(Canvas canvas);
} }

View file

@ -45,16 +45,11 @@ public class DrawableImage {
private PixelCoverage coverage; private PixelCoverage coverage;
private RasterMode mode; private RasterMode mode = RasterMode.SYNCHRONOUS;
public DrawableImage(IImage image, PixelCoverage coverage) { public DrawableImage(IImage image, PixelCoverage coverage) {
this(image, coverage, RasterMode.SYNCHRONOUS);
}
public DrawableImage(IImage image, PixelCoverage coverage, RasterMode mode) {
this.image = image; this.image = image;
this.coverage = coverage; this.coverage = coverage;
this.mode = mode;
} }
public IImage getImage() { public IImage getImage() {

View file

@ -39,8 +39,6 @@ import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.IShadedShape; import com.raytheon.uf.viz.core.drawables.IShadedShape;
import com.raytheon.uf.viz.core.drawables.IWireframeShape; import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.geom.PixelCoordinate; import com.raytheon.uf.viz.core.geom.PixelCoordinate;
import com.vividsolutions.jts.geom.LinearRing; import com.vividsolutions.jts.geom.LinearRing;
@ -66,7 +64,7 @@ import com.vividsolutions.jts.geom.LinearRing;
* @author chammack * @author chammack
* @version 1 * @version 1
*/ */
public interface IGraphicsTarget extends IImagingExtension { public interface IGraphicsTarget {
/** Defines alignment characteristics */ /** Defines alignment characteristics */
public static enum HorizontalAlignment { public static enum HorizontalAlignment {
@ -191,6 +189,24 @@ public interface IGraphicsTarget extends IImagingExtension {
public abstract boolean drawRaster(IImage image, PixelCoverage extent, public abstract boolean drawRaster(IImage image, PixelCoverage extent,
PaintProperties paintProps) throws VizException; PaintProperties paintProps) throws VizException;
/**
* Draw a raster to a target, given an extent and an alpha (transparency)
* value. Assumes synchronous operation.
*
* This operation will block on unavailable data.
*
* @param image
* the image reference object to draw
* @param extent
* the extent of the drawable area
* @param paintProps
* the paint properties
* @return status whether the raster was able to be drawn
* @throws VizException
*/
public abstract boolean drawRasters(PaintProperties paintProps,
DrawableImage... images) throws VizException;
/** /**
* Draw a raster to a target, given an extent and an alpha (transparency) * Draw a raster to a target, given an extent and an alpha (transparency)
* value * value
@ -646,6 +662,15 @@ public interface IGraphicsTarget extends IImagingExtension {
*/ */
public abstract boolean isNeedsRefresh(); public abstract boolean isNeedsRefresh();
/**
* Stage an image
*
* @param image
* the image to stage
* @throws VizException
*/
public abstract void stage(final IImage image) throws VizException;
/** /**
* Sets the background color of the panes. * Sets the background color of the panes.
* *
@ -655,10 +680,6 @@ public interface IGraphicsTarget extends IImagingExtension {
public abstract void setBackgroundColor(RGB backgroundColor); public abstract void setBackgroundColor(RGB backgroundColor);
/** /**
* DEPRECATED: This method has no effect. IGraphicsTargets are not
* responsible to drawing a colorbar. Use method drawColorRamp to draw a
* color ramp
*
* Sets whether to display a builtin colorbar when displaying colormapped * Sets whether to display a builtin colorbar when displaying colormapped
* images (Defaults to true) * images (Defaults to true)
* *
@ -666,7 +687,6 @@ public interface IGraphicsTarget extends IImagingExtension {
* boolean flag indicating whether to display the built in * boolean flag indicating whether to display the built in
* colorbar * colorbar
*/ */
@Deprecated
public abstract void setUseBuiltinColorbar(boolean isColorbarDisplayed); public abstract void setUseBuiltinColorbar(boolean isColorbarDisplayed);
/** /**
@ -1024,7 +1044,6 @@ public interface IGraphicsTarget extends IImagingExtension {
* @param extensionClass * @param extensionClass
* @return * @return
*/ */
public abstract <T extends IGraphicsExtensionInterface> T getExtension( public abstract <T> T getExtension(Class<T> extensionClass)
Class<T> extensionClass) throws VizException; throws VizException;
} }

View file

@ -19,13 +19,14 @@
**/ **/
package com.raytheon.uf.viz.core; package com.raytheon.uf.viz.core;
import org.geotools.coverage.grid.GeneralGridGeometry; import org.geotools.coverage.grid.GridGeometry2D;
import org.opengis.referencing.operation.MathTransform;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.drawables.IRenderable;
import com.raytheon.uf.viz.core.rsc.hdf5.ImageTile;
/** /**
* Base for any mesh 2D/3D, Quad/Triangle -- etc. See {@link PixelCoverage} / * Base for any mesh 2D/3D, Quad/Triangle -- etc
* {@link DrawableImage}
* *
* <pre> * <pre>
* SOFTWARE HISTORY * SOFTWARE HISTORY
@ -39,7 +40,27 @@ import com.raytheon.uf.viz.core.exception.VizException;
* @version 1.0 * @version 1.0
*/ */
public interface IMesh { public interface IMesh extends IRenderable {
/**
* Calculate all the mesh vertices and texture coordinates
*
* @param pc
* @param tile
* @param toLatLon
* translate the tile coordinates to lat/lon coords if the tile
* envelope is not already
*/
public abstract void calculateMesh(PixelCoverage pc, ImageTile tile,
MathTransform toLatLon);
/**
* Calculate all the mesh vertices and texture coordinates
*
* @param pc
* @param gg
*/
public void calculateMesh(PixelCoverage pc, GridGeometry2D gg);
/** /**
* Dispose of the mesh data * Dispose of the mesh data
@ -52,12 +73,4 @@ public interface IMesh {
* @param extent * @param extent
*/ */
public boolean intersects(IExtent extent); public boolean intersects(IExtent extent);
/**
* Reprojects the mesh into the new target geometry
*
* @param targetGeometry
*/
public void reproject(GeneralGridGeometry targetGeometry)
throws VizException;
} }

View file

@ -1,19 +1,19 @@
/** /**
* This software was developed and / or modified by Raytheon Company, * This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government. * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
* *
* U.S. EXPORT CONTROLLED TECHNICAL DATA * U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose * This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination * export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires * to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization. * an export license or other authorization.
* *
* Contractor Name: Raytheon Company * Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340 * Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8 * Mail Stop B8
* Omaha, NE 68106 * Omaha, NE 68106
* 402.291.0100 * 402.291.0100
* *
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/

View file

@ -77,6 +77,8 @@ public class Colormapper {
boolean log = parameters.isLogarithmic(); boolean log = parameters.isLogarithmic();
double logFactor = parameters.getLogFactor(); double logFactor = parameters.getLogFactor();
boolean mirror = parameters.isMirror(); boolean mirror = parameters.isMirror();
double naturalMin = parameters.getDataMin();
double naturalMax = parameters.getDataMax();
double cmapMin = parameters.getColorMapMin(); double cmapMin = parameters.getColorMapMin();
double cmapMax = parameters.getColorMapMax(); double cmapMax = parameters.getColorMapMax();
int colorMapSz = parameters.getColorMap().getSize(); int colorMapSz = parameters.getColorMap().getSize();

View file

@ -34,6 +34,7 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.dataquery.requests.TimeQueryRequest; import com.raytheon.uf.common.dataquery.requests.TimeQueryRequest;
import com.raytheon.uf.common.dataquery.requests.TimeQueryRequestSet;
import com.raytheon.uf.common.datastorage.Request; import com.raytheon.uf.common.datastorage.Request;
import com.raytheon.uf.common.datastorage.StorageException; import com.raytheon.uf.common.datastorage.StorageException;
import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.datastorage.records.IDataRecord;
@ -41,7 +42,10 @@ import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.time.BinOffset; import com.raytheon.uf.common.time.BinOffset;
import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.catalog.LayerProperty; import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.comm.Loader;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
/** /**
* The DataCubeContainer is responsible for handling requests for data times, * The DataCubeContainer is responsible for handling requests for data times,
@ -97,7 +101,7 @@ public class DataCubeContainer {
if (container.adapter != null) { if (container.adapter != null) {
synchronized (container.adapter) { synchronized (container.adapter) {
Boolean initialized = initializedMap.get(container.adapter); Boolean initialized = initializedMap.get(container.adapter);
if (initialized == null || !initialized) { if (!initialized) {
container.adapter.initInventory(); container.adapter.initInventory();
initializedMap.put(container.adapter, true); initializedMap.put(container.adapter, true);
} }
@ -117,9 +121,21 @@ public class DataCubeContainer {
} }
} }
} }
if (adapter == null) { }
// Construct default adapter for plugin if none found
adapter = new DefaultDataCubeAdapter(plugin); private IDataRecord[] getDataRecordInternal(PluginDataObject obj)
throws VizDataCubeException {
if (adapter != null) {
return adapter.getRecord(obj);
} else {
IDataRecord record = null;
try {
record = CubeUtil.retrieveData(obj, pluginName);
} catch (VizException e) {
throw new VizDataCubeException(
"Error retrieving 2D grid record.", e);
}
return new IDataRecord[] { record };
} }
} }
@ -137,7 +153,23 @@ public class DataCubeContainer {
*/ */
public static IDataRecord[] getDataRecord(PluginDataObject obj) public static IDataRecord[] getDataRecord(PluginDataObject obj)
throws VizDataCubeException { throws VizDataCubeException {
return getInstance(obj.getPluginName()).adapter.getRecord(obj); return getInstance(obj.getPluginName()).getDataRecordInternal(obj);
}
private IDataRecord[] getDataRecordInternal(PluginDataObject obj,
Request req, String dataset) throws VizDataCubeException {
if (adapter != null) {
return adapter.getRecord(obj, req, dataset);
} else {
IDataRecord record = null;
try {
record = CubeUtil.retrieveData(obj, pluginName, req, dataset);
} catch (VizException e) {
throw new VizDataCubeException(
"Error retrieving 2D grid record.", e);
}
return new IDataRecord[] { record };
}
} }
/** /**
@ -156,10 +188,29 @@ public class DataCubeContainer {
*/ */
public static IDataRecord[] getDataRecord(PluginDataObject obj, public static IDataRecord[] getDataRecord(PluginDataObject obj,
Request req, String dataset) throws VizDataCubeException { Request req, String dataset) throws VizDataCubeException {
return getInstance(obj.getPluginName()).adapter.getRecord(obj, req, return getInstance(obj.getPluginName()).getDataRecordInternal(obj, req,
dataset); dataset);
} }
private void getDataRecordsInternal(List<PluginDataObject> objs,
Request req, String dataset) throws VizDataCubeException {
if (adapter != null) {
adapter.getRecords(objs, req, dataset);
} else {
for (PluginDataObject obj : objs) {
IDataRecord record = null;
try {
record = CubeUtil.retrieveData(obj, pluginName, req,
dataset);
} catch (VizException e) {
throw new VizDataCubeException(
"Error retrieving 2D grid record.", e);
}
obj.setMessageData(record);
}
}
}
/** /**
* For each PluginDataObject requests the DataRecords specified by Request * For each PluginDataObject requests the DataRecords specified by Request
* and dataSet and stores those DataRecords in the PluginDataObject message * and dataSet and stores those DataRecords in the PluginDataObject message
@ -187,25 +238,41 @@ public class DataCubeContainer {
"All PluginDataObjects must be for the same plugin"); "All PluginDataObjects must be for the same plugin");
} }
} }
getInstance(pluginName).adapter.getRecords(objs, req, dataset); getInstance(pluginName).getDataRecordsInternal(objs, req, dataset);
}
private PointDataContainer getPointDataInternal(String[] params,
Map<String, RequestConstraint> map) throws VizException {
if (adapter != null) {
return adapter.getPoints(pluginName, params, map);
} else {
return null;
}
} }
public static PointDataContainer getPointData(String plugin, public static PointDataContainer getPointData(String plugin,
String[] params, Map<String, RequestConstraint> map) String[] params, Map<String, RequestConstraint> map)
throws VizException { throws VizException {
DataCubeContainer container = getInstance(plugin); return getInstance(plugin).getPointDataInternal(params, map);
return container.adapter.getPoints(container.pluginName, params, map); }
private PointDataContainer getPointDataInternal(String[] params,
String levelKey, Map<String, RequestConstraint> map)
throws VizException {
if (levelKey == null) {
return getPointData(pluginName, params, map);
}
if (adapter != null) {
return adapter.getPoints(pluginName, params, levelKey, map);
} else {
return null;
}
} }
public static PointDataContainer getPointData(String plugin, public static PointDataContainer getPointData(String plugin,
String[] params, String levelKey, Map<String, RequestConstraint> map) String[] params, String levelKey, Map<String, RequestConstraint> map)
throws VizException { throws VizException {
DataCubeContainer container = getInstance(plugin); return getInstance(plugin).getPointDataInternal(params, levelKey, map);
if (levelKey == null) {
return getPointData(container.pluginName, params, map);
}
return container.adapter.getPoints(container.pluginName, params,
levelKey, map);
} }
public static DataTime[] performTimeQuery( public static DataTime[] performTimeQuery(
@ -241,6 +308,20 @@ public class DataCubeContainer {
new DataTime[0]); new DataTime[0]);
} }
public List<List<DataTime>> performTimeQueriesInternal(
List<TimeQueryRequest> requests) throws VizException {
if (adapter == null) {
TimeQueryRequestSet set = new TimeQueryRequestSet();
set.setRequests(requests.toArray(new TimeQueryRequest[0]));
@SuppressWarnings("unchecked")
List<List<DataTime>> result = (List<List<DataTime>>) ThriftClient
.sendRequest(set);
return result;
} else {
return adapter.timeQuery(requests);
}
}
/** /**
* Perform a bulk time query request when all requests have the same plugin * Perform a bulk time query request when all requests have the same plugin
* type. * type.
@ -253,7 +334,7 @@ public class DataCubeContainer {
if (requests.isEmpty()) { if (requests.isEmpty()) {
return Collections.emptyList(); return Collections.emptyList();
} }
return getInstance(pluginName).adapter.timeQuery(requests); return getInstance(pluginName).performTimeQueriesInternal(requests);
} }
/** /**
@ -265,8 +346,8 @@ public class DataCubeContainer {
*/ */
public static List<List<DataTime>> performTimeQueries(String pluginName, public static List<List<DataTime>> performTimeQueries(String pluginName,
TimeQueryRequest... requests) throws VizException { TimeQueryRequest... requests) throws VizException {
return getInstance(pluginName).adapter.timeQuery(Arrays return getInstance(pluginName).performTimeQueriesInternal(
.asList(requests)); Arrays.asList(requests));
} }
/** /**
@ -322,6 +403,17 @@ public class DataCubeContainer {
return result; return result;
} }
private synchronized List<Object> getDataInternal(LayerProperty property,
int timeOut) throws VizException {
if (adapter == null) {
String scriptToExecute = ScriptCreator.createScript(property);
return Loader
.loadScripts(new String[] { scriptToExecute }, timeOut);
} else {
return adapter.getData(property, timeOut);
}
}
/** /**
* Returns a list of responses for the requested layer property. If a * Returns a list of responses for the requested layer property. If a
* derived parameter, this will piece together the base parameteters. * derived parameter, this will piece together the base parameteters.
@ -340,11 +432,31 @@ public class DataCubeContainer {
.getEntryQueryParameters(false); .getEntryQueryParameters(false);
String pluginName = originalQuery.get("pluginName") String pluginName = originalQuery.get("pluginName")
.getConstraintValue(); .getConstraintValue();
return getInstance(pluginName).adapter.getData(property, timeOut); return getInstance(pluginName).getDataInternal(property, timeOut);
}
private Object getInventoryInternal() {
if (adapter != null) {
return adapter.getInventory();
} else {
return null;
}
} }
public static Object getInventory(String plugin) { public static Object getInventory(String plugin) {
return getInstance(plugin).adapter.getInventory(); return getInstance(plugin).getInventoryInternal();
}
private List<Map<String, RequestConstraint>> getBaseUpdateConstraintsInternal(
Map<String, RequestConstraint> constraints) {
if (adapter != null) {
return adapter.getBaseUpdateConstraints(constraints);
} else {
List<Map<String, RequestConstraint>> result = new ArrayList<Map<String, RequestConstraint>>(
1);
result.add(constraints);
return result;
}
} }
public static List<Map<String, RequestConstraint>> getBaseUpdateConstraints( public static List<Map<String, RequestConstraint>> getBaseUpdateConstraints(
@ -355,8 +467,8 @@ public class DataCubeContainer {
&& pluginRC.getConstraintType() == ConstraintType.EQUALS) { && pluginRC.getConstraintType() == ConstraintType.EQUALS) {
plugin = pluginRC.getConstraintValue(); plugin = pluginRC.getConstraintValue();
} }
return getInstance(plugin).adapter return getInstance(plugin)
.getBaseUpdateConstraints(constraints); .getBaseUpdateConstraintsInternal(constraints);
} }
} }

View file

@ -1,239 +0,0 @@
/**
* 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.
**/
package com.raytheon.uf.viz.core.datastructure;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.TimeQueryRequest;
import com.raytheon.uf.common.dataquery.requests.TimeQueryRequestSet;
import com.raytheon.uf.common.datastorage.Request;
import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
import com.raytheon.uf.viz.core.comm.Loader;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
/**
* Default implementation of IDataCubeAdapter, function implementations were
* moved from DataCubeContainer into here
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 7, 2011 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class DefaultDataCubeAdapter implements IDataCubeAdapter {
private String pluginName;
public DefaultDataCubeAdapter(String pluginName) {
this.pluginName = pluginName;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getSupportedPlugins
* ()
*/
@Override
public String[] getSupportedPlugins() {
return new String[] { pluginName };
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#timeQuery(java
* .util.List)
*/
@Override
public List<List<DataTime>> timeQuery(List<TimeQueryRequest> requests)
throws VizException {
TimeQueryRequestSet set = new TimeQueryRequestSet();
set.setRequests(requests.toArray(new TimeQueryRequest[0]));
@SuppressWarnings("unchecked")
List<List<DataTime>> result = (List<List<DataTime>>) ThriftClient
.sendRequest(set);
return result;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getPoints(java
* .lang.String, java.lang.String[], java.util.Map)
*/
@Override
public PointDataContainer getPoints(String plugin, String[] parameters,
Map<String, RequestConstraint> queryParams) throws VizException {
return null;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getPoints(java
* .lang.String, java.lang.String[], java.lang.String, java.util.Map)
*/
@Override
public PointDataContainer getPoints(String plugin, String[] parameters,
String levelKey, Map<String, RequestConstraint> queryParams)
throws VizException {
return null;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getRecord(com
* .raytheon.uf.common.dataplugin.PluginDataObject)
*/
@Override
public IDataRecord[] getRecord(PluginDataObject obj)
throws VizDataCubeException {
IDataRecord record = null;
try {
record = CubeUtil.retrieveData(obj, pluginName);
} catch (VizException e) {
throw new VizDataCubeException("Error retrieving 2D data record.",
e);
}
return new IDataRecord[] { record };
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getRecord(com
* .raytheon.uf.common.dataplugin.PluginDataObject,
* com.raytheon.uf.common.datastorage.Request, java.lang.String)
*/
@Override
public IDataRecord[] getRecord(PluginDataObject obj, Request req,
String dataset) throws VizDataCubeException {
IDataRecord record = null;
try {
record = CubeUtil.retrieveData(obj, pluginName, req, dataset);
} catch (VizException e) {
throw new VizDataCubeException("Error retrieving 2D data record.",
e);
}
return new IDataRecord[] { record };
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getRecords(java
* .util.List, com.raytheon.uf.common.datastorage.Request, java.lang.String)
*/
@Override
public void getRecords(List<PluginDataObject> objs, Request req,
String dataset) throws VizDataCubeException {
for (PluginDataObject obj : objs) {
IDataRecord record = null;
try {
record = CubeUtil.retrieveData(obj, pluginName, req, dataset);
} catch (VizException e) {
throw new VizDataCubeException(
"Error retrieving 2D grid record.", e);
}
obj.setMessageData(record);
}
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getData(com.raytheon
* .uf.viz.core.catalog.LayerProperty, int)
*/
@Override
public List<Object> getData(LayerProperty property, int timeOut)
throws VizException {
String scriptToExecute = ScriptCreator.createScript(property);
return Loader.loadScripts(new String[] { scriptToExecute }, timeOut);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#initInventory()
*/
@Override
public void initInventory() {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#getInventory()
*/
@Override
public Object getInventory() {
// TODO Auto-generated method stub
return null;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter#
* getBaseUpdateConstraints(java.util.Map)
*/
@Override
public List<Map<String, RequestConstraint>> getBaseUpdateConstraints(
Map<String, RequestConstraint> constraints) {
List<Map<String, RequestConstraint>> result = new ArrayList<Map<String, RequestConstraint>>(
1);
result.add(constraints);
return result;
}
}

View file

@ -145,6 +145,16 @@ public interface IDataCubeAdapter {
public List<Object> getData(LayerProperty property, int timeOut) public List<Object> getData(LayerProperty property, int timeOut)
throws VizException; throws VizException;
/**
* A simple method that will create a unique string based on the information
* in the PluginDataObject passed in.
*
* @param pdo
* The PDO to generate a unique name from
* @return A string unique to that PDO
*/
public String recordKeyGenerator(PluginDataObject pdo);
/** /**
* If the inventory for a particular data type is large (for example, Grib), * If the inventory for a particular data type is large (for example, Grib),
* a call to this method should get a copy of that data type's inventory * a call to this method should get a copy of that data type's inventory

View file

@ -31,22 +31,7 @@ import java.util.concurrent.ConcurrentHashMap;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.geotools.coverage.grid.GeneralGridEnvelope;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridGeometry2D;
import org.geotools.geometry.GeneralEnvelope;
import org.geotools.referencing.CRS;
import org.geotools.referencing.operation.DefaultMathTransformFactory;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.crs.GeneralDerivedCRS;
import org.opengis.referencing.datum.PixelInCell;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.TransformException;
import com.raytheon.uf.common.serialization.adapters.GridGeometryAdapter;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
@ -54,7 +39,6 @@ import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.AbstractTimeMatcher; import com.raytheon.uf.viz.core.AbstractTimeMatcher;
import com.raytheon.uf.viz.core.IDisplayPane; import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer; import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.VizConstants; import com.raytheon.uf.viz.core.VizConstants;
import com.raytheon.uf.viz.core.datastructure.LoopProperties; import com.raytheon.uf.viz.core.datastructure.LoopProperties;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
@ -127,19 +111,6 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
/** The frame coordination object */ /** The frame coordination object */
protected IFrameCoordinator frameCoordinator; protected IFrameCoordinator frameCoordinator;
private MathTransform worldToPixel;
private MathTransform pixelToWorld;
/** The spatial grid for the descriptor */
private GeneralGridGeometry gridGeometry;
public AbstractDescriptor(GeneralGridGeometry gridGeometry) {
this();
this.gridGeometry = gridGeometry;
init();
}
/** /**
* Constructor * Constructor
*/ */
@ -225,8 +196,7 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
protected void preAddListener(ResourcePair rp) protected void preAddListener(ResourcePair rp)
throws WrongProjectionException { throws WrongProjectionException {
AbstractVizResource<?, AbstractDescriptor> resource = (AbstractVizResource<?, AbstractDescriptor>) rp AbstractVizResource resource = rp.getResource();
.getResource();
resource.setDescriptor(this); resource.setDescriptor(this);
@ -684,119 +654,6 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
return frameCoordinator; return frameCoordinator;
} }
private void init() {
GeneralGridGeometry gridGeometry = getGridGeometry();
MathTransform worldToCRS = getWorldToCRSTransform(gridGeometry);
if (worldToCRS != null) {
try {
MathTransform crsToPixel = gridGeometry.getGridToCRS(
PixelInCell.CELL_CENTER).inverse();
worldToPixel = new DefaultMathTransformFactory()
.createConcatenatedTransform(worldToCRS, crsToPixel);
pixelToWorld = worldToPixel.inverse();
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"Error setting up Math Transforms,"
+ " this descriptor may not work properly", e);
}
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IDescriptor#getCRS()
*/
@Override
public final CoordinateReferenceSystem getCRS() {
if (gridGeometry != null && gridGeometry.getEnvelope() != null) {
return gridGeometry.getEnvelope().getCoordinateReferenceSystem();
} else {
return null;
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IDescriptor#getGridGeometry()
*/
@Override
@XmlElement
@XmlJavaTypeAdapter(value = GridGeometryAdapter.class)
public final GeneralGridGeometry getGridGeometry() {
return gridGeometry;
}
/**
* Set the grid geometry
*
* @param gridGeometry
* the gridGeometry to set
* @throws VizException
*/
public void setGridGeometry(GeneralGridGeometry gridGeometry)
throws VizException {
this.gridGeometry = gridGeometry;
init();
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.IDescriptor#pixelToWorld(double[])
*/
@Override
public final double[] pixelToWorld(double[] pixel) {
double[] output = new double[3];
double[] wpixel = pixel;
if (pixel.length == 2) {
wpixel = new double[] { pixel[0], pixel[1], 0 };
}
if (pixelToWorld != null) {
try {
pixelToWorld.transform(wpixel, 0, output, 0, 1);
} catch (TransformException e) {
e.printStackTrace();
return null;
}
} else {
System.arraycopy(wpixel, 0, output, 0, wpixel.length);
}
return output;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.IDescriptor#worldToPixel(double[])
*/
@Override
public final double[] worldToPixel(double[] world) {
double[] output = new double[3];
double[] input = world;
if (world.length == 2) {
input = new double[] { world[0], world[1], 0 };
}
if (worldToPixel != null) {
try {
worldToPixel.transform(input, 0, output, 0, 1);
} catch (TransformException e) {
return null;
}
} else {
System.arraycopy(input, 0, output, 0, input.length);
}
return output;
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
@ -826,40 +683,4 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
getFrameCoordinator().changeFrame(loopProperties); getFrameCoordinator().changeFrame(loopProperties);
} }
protected static GeneralGridGeometry createGridGeometry(IExtent extent,
CoordinateReferenceSystem crs) {
GeneralEnvelope envelope = new GeneralEnvelope(2);
envelope.setRange(0, extent.getMinX(), extent.getMaxX());
envelope.setRange(1, extent.getMinY(), extent.getMaxY());
envelope.setCoordinateReferenceSystem(crs);
return new GridGeometry2D(
new GeneralGridEnvelope(new int[] { 0, 0 }, new int[] {
(int) extent.getWidth(), (int) extent.getHeight() },
false), envelope);
}
/**
* Get the world to CRS transform used for {@link #worldToPixel(double[])}
* and {@link #pixelToWorld(double[])}
*
* @param gridGeometry
* @return The world to gridGeometry CRS transform or null if there is none
*/
public static MathTransform getWorldToCRSTransform(
GeneralGridGeometry gridGeometry) {
CoordinateReferenceSystem crs = gridGeometry.getEnvelope()
.getCoordinateReferenceSystem();
if (crs instanceof GeneralDerivedCRS) {
GeneralDerivedCRS projCRS = (GeneralDerivedCRS) crs;
CoordinateReferenceSystem worldCRS = projCRS.getBaseCRS();
try {
return CRS.findMathTransform(worldCRS, crs);
} catch (FactoryException e) {
statusHandler.handle(Priority.PROBLEM,
"Error setting up Math Transforms,"
+ " this descriptor may not work properly", e);
}
}
return null;
}
} }

View file

@ -206,8 +206,8 @@ public class ColorMapLoader {
ColorMap cm = (ColorMap) SerializationUtil ColorMap cm = (ColorMap) SerializationUtil
.jaxbUnmarshalFromXmlFile(colorMapFile.getFile() .jaxbUnmarshalFromXmlFile(colorMapFile.getFile()
.getAbsolutePath()); .getAbsolutePath());
cm.setName(name); cm.setName(name);
cm.setChanged(false);
return cm; return cm;
} else { } else {
return null; return null;

View file

@ -22,8 +22,6 @@ package com.raytheon.uf.viz.core.drawables;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import javax.measure.converter.UnitConverter; import javax.measure.converter.UnitConverter;
import javax.measure.unit.Unit; import javax.measure.unit.Unit;
@ -118,7 +116,7 @@ public class ColorMapParameters implements Cloneable, ISerializableObject {
} }
protected Set<IColorMapParametersListener> listeners = new HashSet<IColorMapParametersListener>(); protected IColorMapParametersListener listener;
/** Units of the colormap parameters (min/max) */ /** Units of the colormap parameters (min/max) */
protected Unit<?> displayUnit; protected Unit<?> displayUnit;
@ -716,19 +714,13 @@ public class ColorMapParameters implements Cloneable, ISerializableObject {
} }
private void notifyListener() { private void notifyListener() {
for (IColorMapParametersListener listener : listeners) { if (listener != null) {
listener.colorMapChanged(); listener.colorMapChanged();
} }
} }
public void addListener(IColorMapParametersListener listener) { public void setListener(IColorMapParametersListener listener) {
if (listener != null) { this.listener = listener;
listeners.add(listener);
}
}
public void removeListener(IColorMapParametersListener listener) {
listeners.remove(listener);
} }
public void setAlphaMask(byte[] alphaMask) { public void setAlphaMask(byte[] alphaMask) {
@ -749,8 +741,8 @@ public class ColorMapParameters implements Cloneable, ISerializableObject {
@Override @Override
public int hashCode() { public int hashCode() {
if (listeners.size() > 0) { if (listener != null) {
return listeners.hashCode(); return listener.hashCode();
} else if (colorMap != null) { } else if (colorMap != null) {
return colorMap.hashCode(); return colorMap.hashCode();
} else { } else {

View file

@ -20,9 +20,6 @@
package com.raytheon.uf.viz.core.drawables; package com.raytheon.uf.viz.core.drawables;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
import com.raytheon.uf.viz.core.exception.VizException;
/** /**
* Describes a generic Image resource. The IImage resource is an interface * Describes a generic Image resource. The IImage resource is an interface
* handle to an image. The image resource manages the lifecycle of the * handle to an image. The image resource manages the lifecycle of the
@ -66,11 +63,6 @@ public interface IImage {
UNLOADED, STAGED, LOADED, LOADING, FAILED, INVALID UNLOADED, STAGED, LOADED, LOADING, FAILED, INVALID
}; };
/**
* Stages any data required for the image to load/draw
*/
public abstract void stage() throws VizException;
/** /**
* @return the status * @return the status
*/ */
@ -114,10 +106,4 @@ public interface IImage {
*/ */
public abstract void setContrast(float contrast); public abstract void setContrast(float contrast);
/**
* Gets the extension class for this image
*
* @return
*/
public abstract Class<? extends IImagingExtension> getExtensionClass();
} }

View file

@ -1,143 +0,0 @@
/**
* 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.
**/
package com.raytheon.uf.viz.core.drawables;
import java.util.ArrayList;
import java.util.List;
import com.raytheon.uf.viz.core.DrawableImage;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.RasterMode;
import com.raytheon.uf.viz.core.drawables.IImage.Status;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
import com.raytheon.uf.viz.core.drawables.ext.TextureLoader;
import com.raytheon.uf.viz.core.exception.VizException;
/**
* Support class for rendering images to a target
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 13, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class ImagingSupport {
protected static final TextureLoader textureLoader = TextureLoader
.getInstance();
/**
* Prepares images for painting by staging and/or targeting the image
*
* @param target
* @param images
* @throws VizException
*/
public static void prepareImages(IGraphicsTarget target,
DrawableImage... images) throws VizException {
for (DrawableImage di : images) {
IImage image = di.getImage();
RasterMode mode = di.getMode();
if (image.getStatus() != Status.LOADED
&& image.getStatus() != Status.STAGED) {
if (mode == RasterMode.ASYNCHRONOUS) {
textureLoader.requestLoad(image);
target.setNeedsRefresh(true);
} else if (mode == RasterMode.SYNCHRONOUS) {
image.stage();
}
}
}
}
/**
* Routes the images to be rendered by their proper extensions, expects
* images have already been "prepared" (Status=STAGED)
*
* @param target
* @param paintProps
* @param images
* @return
* @throws VizException
*/
public static boolean routeImages(IGraphicsTarget target,
PaintProperties paintProps, DrawableImage[] images)
throws VizException {
boolean rval = true;
boolean skipped = false;
List<DrawableImage> bulk = new ArrayList<DrawableImage>();
Class<? extends IImagingExtension> lastExt = null;
for (DrawableImage di : images) {
IImage image = di.getImage();
IImage.Status imageSts = image.getStatus();
if (imageSts == IImage.Status.LOADED
|| imageSts == IImage.Status.STAGED) {
Class<? extends IImagingExtension> imageExt = image
.getExtensionClass();
if (imageExt.equals(lastExt) == false && bulk.size() > 0) {
DrawableImage[] extImages = bulk
.toArray(new DrawableImage[bulk.size()]);
// Render what we have
IImagingExtension impl = target.getExtension(lastExt);
rval &= impl.drawRasters(paintProps, extImages);
bulk.clear();
}
bulk.add(di);
lastExt = imageExt;
} else {
skipped = true;
}
}
if (bulk.size() > 0) {
// Render what is left
IImagingExtension impl = target.getExtension(lastExt);
rval &= impl.drawRasters(paintProps,
bulk.toArray(new DrawableImage[bulk.size()]));
}
return rval & skipped;
}
/**
* Prepares the images, then routes them for rendering
*
* @param paintProps
* @param images
* @return
*/
public static boolean drawRasters(IGraphicsTarget target,
PaintProperties paintProps, DrawableImage[] images)
throws VizException {
prepareImages(target, images);
return routeImages(target, paintProps, images);
}
}

View file

@ -0,0 +1,66 @@
package com.raytheon.uf.viz.core.drawables;
import org.eclipse.swt.graphics.RGB;
public class SingleColorImage implements IImage {
private IImage image = null;
private RGB color = null;
public IImage getWrappedImage() {
return image;
}
public void setWrappedImage(IImage image) {
this.image = image;
}
public void setColor(RGB color) {
this.color = color;
}
public RGB getColor() {
return color;
}
public SingleColorImage(IImage image) {
this.image = image;
}
@Override
public Status getStatus() {
return image.getStatus();
}
@Override
public void setInterpolated(boolean isInterpolated) {
image.setInterpolated(isInterpolated);
}
@Override
public void dispose() {
image.dispose();
}
@Override
public int getWidth() {
return image.getWidth();
}
@Override
public int getHeight() {
return image.getHeight();
}
@Override
public void setBrightness(float brightness) {
image.setBrightness(brightness);
}
@Override
public void setContrast(float contrast) {
image.setContrast(contrast);
}
}

View file

@ -40,22 +40,15 @@ import com.raytheon.uf.viz.core.IGraphicsTarget;
*/ */
public abstract class GraphicsExtension<T extends IGraphicsTarget> { public abstract class GraphicsExtension<T extends IGraphicsTarget> {
/** public static enum Compatibilty {
* Interface that other interfaces should extend if they want to be used as INCOMPATIBLE(-1), GENERIC(0), TARGET_COMPATIBLE(1000), ENHANCED_TARGET_COMPATIBLE(
* a graphics extension 2000);
*/
public static interface IGraphicsExtensionInterface {
} public int value;
public static class Compatibilty { private Compatibilty(int value) {
public static final int INCOMPATIBLE = -1; this.value = value;
}
public static final int GENERIC = 0;
public static final int TARGET_COMPATIBLE = 1000;
public static final int ENHANCED_TARGET_COMPATIBLE = 2000;
} }
protected T target; protected T target;
@ -76,19 +69,12 @@ public abstract class GraphicsExtension<T extends IGraphicsTarget> {
public final int setTarget(IGraphicsTarget target) { public final int setTarget(IGraphicsTarget target) {
try { try {
this.target = (T) target; this.target = (T) target;
return getCompatibilityValue(this.target);
} catch (ClassCastException e) { } catch (ClassCastException e) {
this.target = null; return Compatibilty.INCOMPATIBLE.value;
return Compatibilty.INCOMPATIBLE;
} }
return getCompatibilityValue(this.target);
} }
/**
* Get the target compability value.
*
* @param target
* @return
*/
public abstract int getCompatibilityValue(T target); public abstract int getCompatibilityValue(T target);
/** /**

View file

@ -15,7 +15,6 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
public class GraphicsExtensionManager { public class GraphicsExtensionManager {
@ -68,8 +67,8 @@ public class GraphicsExtensionManager {
* @return * @return
* @throws VizException * @throws VizException
*/ */
public synchronized <T extends IGraphicsExtensionInterface> T getExtension( public synchronized <T> T getExtension(Class<T> extensionClass)
Class<T> extensionClass) throws VizException { throws VizException {
if (cached.containsKey(extensionClass)) { if (cached.containsKey(extensionClass)) {
return extensionClass.cast(cached.get(extensionClass)); return extensionClass.cast(cached.get(extensionClass));
} }
@ -77,14 +76,10 @@ public class GraphicsExtensionManager {
int bestVal = -1; int bestVal = -1;
for (Class<?> eClass : extensions) { for (Class<?> eClass : extensions) {
if (extensionClass.isAssignableFrom(eClass)) { if (extensionClass.isAssignableFrom(eClass)) {
GraphicsExtension<?> graphicsExt;
try { try {
GraphicsExtension<?> graphicsExt = GraphicsExtension.class.cast(eClass graphicsExt = GraphicsExtension.class.cast(eClass
.newInstance()); .newInstance());
int val = graphicsExt.setTarget(target);
if (val > bestVal) {
bestVal = val;
bestExt = extensionClass.cast(graphicsExt);
}
} catch (InstantiationException e) { } catch (InstantiationException e) {
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e); e.getLocalizedMessage(), e);
@ -94,6 +89,11 @@ public class GraphicsExtensionManager {
e.getLocalizedMessage(), e); e.getLocalizedMessage(), e);
continue; continue;
} }
int val = graphicsExt.setTarget(target);
if (val > bestVal) {
bestVal = val;
bestExt = extensionClass.cast(graphicsExt);
}
} }
} }
if (bestExt != null) { if (bestExt != null) {

View file

@ -4,11 +4,9 @@ import java.nio.Buffer;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters; import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IImage; import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
public interface IOffscreenRenderingExtension extends public interface IOffscreenRenderingExtension {
IGraphicsExtensionInterface {
/** /**
* All drawing between a call to renderOffscreen and the next call to * All drawing between a call to renderOffscreen and the next call to
* renderOnscreen will be drawn to offscreenImage rather than to the screen. * renderOnscreen will be drawn to offscreenImage rather than to the screen.

View file

@ -1,129 +0,0 @@
/**
* 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.
**/
package com.raytheon.uf.viz.core.drawables.ext;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.ui.services.IDisposable;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.Activator;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.jobs.JobPool;
/**
* Class that loads data for AbstractGLImages asynchronously
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/1/06 chammack Initial Creation.
*
* </pre>
*
* @author chammack
*
*/
public class TextureLoader {
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(TextureLoader.class);
/** The instance */
private static TextureLoader instance;
private JobPool loaderPool;
private List<IImage> texturesToLoad;
/**
* Get the currently running instance of the texture loader
*
* @return
*/
public static synchronized TextureLoader getInstance() {
if (instance == null) {
instance = new TextureLoader();
}
return instance;
}
/**
* Use getInstance() instead of constructor
*
*/
private TextureLoader() {
this.texturesToLoad = new ArrayList<IImage>();
this.loaderPool = new JobPool("Texture Loader", Runtime.getRuntime()
.availableProcessors(), true);
// Make sure we get shutdown properly
Activator.getDefault().registerDisposable(new IDisposable() {
@Override
public void dispose() {
shutdown();
}
});
}
/**
* Request an image to be loaded
*
* @param img
* the image
*/
public void requestLoad(final IImage img) {
if (!texturesToLoad.contains(img)) {
texturesToLoad.add(img);
loaderPool.schedule(new Runnable() {
@Override
public void run() {
try {
try {
img.stage();
} catch (Throwable t) {
statusHandler.handle(
Priority.PROBLEM,
"Error staging texture: "
+ t.getLocalizedMessage(), t);
}
} finally {
texturesToLoad.remove(img);
}
}
});
}
}
/**
* Request the job to be shut down
*
*/
public void shutdown() {
loaderPool.cancel();
}
}

View file

@ -1,240 +0,0 @@
/**
* 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.
**/
package com.raytheon.uf.viz.core.drawables.ext.colormap;
import java.awt.image.RenderedImage;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapData;
import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
import com.raytheon.uf.viz.core.data.prep.Colormapper;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IColorMapParametersListener;
import com.raytheon.uf.viz.core.drawables.IColormappedImage;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
import com.raytheon.uf.viz.core.exception.VizException;
/**
* General colormapped image, regenerates image if parameters change
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 16, 2011 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class ColormappedImage implements IColormappedImage,
IRenderedImageCallback, IColorMapParametersListener {
private IImage image;
private IColorMapDataRetrievalCallback callback;
private ColorMapParameters parameters;
public ColormappedImage(IGraphicsTarget target,
IColorMapDataRetrievalCallback callback,
ColorMapParameters parameters) {
this.callback = callback;
setColorMapParameters(parameters);
image = target.initializeRaster(this);
}
/**
* Get the wrapped image for the colormapped image
*
* @return
*/
public IImage getWrappedImage() {
return image;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#getStatus()
*/
@Override
public Status getStatus() {
return image.getStatus();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#setInterpolated(boolean)
*/
@Override
public void setInterpolated(boolean isInterpolated) {
image.setInterpolated(isInterpolated);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#dispose()
*/
@Override
public void dispose() {
if (image != null) {
image.dispose();
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#getWidth()
*/
@Override
public int getWidth() {
return image.getWidth();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#getHeight()
*/
@Override
public int getHeight() {
return image.getHeight();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#setBrightness(float)
*/
@Override
public void setBrightness(float brightness) {
image.setBrightness(brightness);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#setContrast(float)
*/
@Override
public void setContrast(float contrast) {
image.setContrast(contrast);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#getExtensionClass()
*/
@Override
public Class<? extends IImagingExtension> getExtensionClass() {
return GeneralColormappedImageExtension.class;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.IColormappedImage#getColorMapParameters
* ()
*/
@Override
public ColorMapParameters getColorMapParameters() {
return parameters;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.IColormappedImage#setColorMapParameters
* (com.raytheon.uf.viz.core.drawables.ColorMapParameters)
*/
@Override
public void setColorMapParameters(ColorMapParameters params) {
if (params != this.parameters) {
if (this.parameters != null) {
this.parameters.removeListener(this);
}
this.parameters = params;
if (this.parameters != null) {
this.parameters.addListener(this);
}
dispose();
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IColormappedImage#getValue(int,
* int)
*/
@Override
public double getValue(int x, int y) {
return Double.NaN;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.data.IRenderedImageCallback#getImage()
*/
@Override
public RenderedImage getImage() throws VizException {
if (parameters == null || parameters.getColorMap() == null) {
return null;
}
ColorMapData colorMapData = callback.getColorMapData();
return Colormapper.colorMap(colorMapData, parameters);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IColorMapParametersListener#
* colorMapChanged()
*/
@Override
public void colorMapChanged() {
dispose();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.drawables.IImage#stage()
*/
@Override
public void stage() throws VizException {
image.stage();
}
}

View file

@ -0,0 +1,81 @@
/**
* 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.
**/
package com.raytheon.uf.viz.core.drawables.ext.colormap;
import java.awt.image.RenderedImage;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapData;
import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
import com.raytheon.uf.viz.core.data.prep.Colormapper;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.exception.VizException;
/**
* General {@link IRenderedImageCallback} that takes a
* {@link IColorMapDataRetrievalCallback} and {@link ColorMapParameters} and
* will colormap the data returned from the callback into a
* {@link RenderedImage}
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 22, 2011 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class ColormappedRenderedImageCallback implements IRenderedImageCallback {
private IColorMapDataRetrievalCallback callback;
private ColorMapParameters parameters;
/**
* Construct a ColormappedRenderedImageCallback for the colormap data
* callback and parameters
*
* @param dataCallback
* @param parameters
*/
public ColormappedRenderedImageCallback(
IColorMapDataRetrievalCallback dataCallback,
ColorMapParameters parameters) {
this.callback = dataCallback;
this.parameters = parameters;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.data.IRenderedImageCallback#getImage()
*/
@Override
public RenderedImage getImage() throws VizException {
ColorMapData colorMapData = callback.getColorMapData();
return Colormapper.colorMap(colorMapData, parameters);
}
}

View file

@ -19,17 +19,11 @@
**/ **/
package com.raytheon.uf.viz.core.drawables.ext.colormap; package com.raytheon.uf.viz.core.drawables.ext.colormap;
import java.util.ArrayList;
import java.util.List;
import com.raytheon.uf.viz.core.DrawableImage;
import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback; import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters; import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IColormappedImage; import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension; import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension;
import com.raytheon.uf.viz.core.exception.VizException;
/** /**
* General colormapped image extension. Uses * General colormapped image extension. Uses
@ -62,10 +56,10 @@ public class GeneralColormappedImageExtension extends
* com.raytheon.uf.viz.core.drawables.ColorMapParameters) * com.raytheon.uf.viz.core.drawables.ColorMapParameters)
*/ */
@Override @Override
public IColormappedImage initializeRaster( public IImage initializeRaster(IColorMapDataRetrievalCallback dataCallback,
IColorMapDataRetrievalCallback dataCallback,
ColorMapParameters colorMapParameters) { ColorMapParameters colorMapParameters) {
return new ColormappedImage(target, dataCallback, colorMapParameters); return target.initializeRaster(new ColormappedRenderedImageCallback(
dataCallback, colorMapParameters));
} }
/* /*
@ -76,29 +70,7 @@ public class GeneralColormappedImageExtension extends
*/ */
@Override @Override
public int getCompatibilityValue(IGraphicsTarget target) { public int getCompatibilityValue(IGraphicsTarget target) {
return Compatibilty.GENERIC; return Compatibilty.GENERIC.value;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.ext.IImagingExtension#drawRasters(
* com.raytheon.uf.viz.core.drawables.PaintProperties,
* com.raytheon.uf.viz.core.DrawableImage[])
*/
@Override
public boolean drawRasters(PaintProperties paintProps,
DrawableImage... images) throws VizException {
List<DrawableImage> renderables = new ArrayList<DrawableImage>();
for (DrawableImage di : images) {
if (di.getImage() instanceof ColormappedImage) {
renderables.add(new DrawableImage(((ColormappedImage) di
.getImage()).getWrappedImage(), di.getCoverage()));
}
}
return target.drawRasters(paintProps,
renderables.toArray(new DrawableImage[renderables.size()]));
} }
} }

View file

@ -26,7 +26,6 @@ import org.eclipse.swt.graphics.RGB;
import com.raytheon.uf.viz.core.drawables.IDescriptor; import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IShadedShape; import com.raytheon.uf.viz.core.drawables.IShadedShape;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.LineString; import com.vividsolutions.jts.geom.LineString;
@ -54,8 +53,7 @@ import com.vividsolutions.jts.geom.LineString;
* @author bsteffen * @author bsteffen
* @version 1.0 * @version 1.0
*/ */
public interface IColormapShadedShapeExtension extends public interface IColormapShadedShapeExtension {
IGraphicsExtensionInterface {
public interface IColormapShadedShape { public interface IColormapShadedShape {

View file

@ -22,7 +22,7 @@ package com.raytheon.uf.viz.core.drawables.ext.colormap;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback; import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.drawables.ColorMapParameters; import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.IColormappedImage; import com.raytheon.uf.viz.core.drawables.IColormappedImage;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension; import com.raytheon.uf.viz.core.drawables.IImage;
/** /**
* Extension for creating {@link IColormappedImage} objects * Extension for creating {@link IColormappedImage} objects
@ -41,7 +41,7 @@ import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
* @version 1.0 * @version 1.0
*/ */
public interface IColormappedImageExtension extends IImagingExtension { public interface IColormappedImageExtension {
/** /**
* Initializes an IColormappedImage given the dataCallback and colormap * Initializes an IColormappedImage given the dataCallback and colormap
@ -51,7 +51,6 @@ public interface IColormappedImageExtension extends IImagingExtension {
* @param colorMapParameters * @param colorMapParameters
* @return * @return
*/ */
public IColormappedImage initializeRaster( public IImage initializeRaster(IColorMapDataRetrievalCallback dataCallback,
IColorMapDataRetrievalCallback dataCallback,
ColorMapParameters colorMapParameters); ColorMapParameters colorMapParameters);
} }

View file

@ -39,14 +39,14 @@ import com.raytheon.uf.viz.core.exception.VizCommunicationException;
* *
* <pre> * <pre>
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 11/01/2007 #518 S.Manoj Initial version * 11/01/2007 #518 S.Manoj Initial version
* 11/16/2009 #3120 rjpeter Modifed to better integrate with level framework. * 11/16/2009 #3120 rjpeter Modifed to better integrate with level framework.
* 11/21/2009 #3576 rjpeter Added group * 11/21/2009 #3576 rjpeter Added group
* *
* &#064;author smanoj * &#064;author smanoj
* @version 1.0 * @version 1.0
*/ */

View file

@ -19,12 +19,7 @@
**/ **/
package com.raytheon.uf.viz.core.map; package com.raytheon.uf.viz.core.map;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridGeometry2D;
import com.raytheon.uf.viz.core.IMesh; import com.raytheon.uf.viz.core.IMesh;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
/** /**
@ -44,31 +39,17 @@ import com.raytheon.uf.viz.core.exception.VizException;
* @version 1.0 * @version 1.0
*/ */
public interface IMapMeshExtension extends IGraphicsExtensionInterface { public interface IMapMeshExtension {
/** /**
* Constructs a mesh for mapping the imageGeometry onto the targetGeometry * Create a mesh
*
* @param descriptor
* *
* @param imageGeometry
* @param targetGeometry
* @return * @return
* @throws VizException * @throws VizException
*/ */
public abstract IMesh constructMesh(GridGeometry2D imageGeometry, public abstract IMesh constructMesh(IMapDescriptor descriptor)
GeneralGridGeometry targetGeometry) throws VizException; throws VizException;
/**
* Convenient method for constructing a mesh for mapping the imageGeometry
* onto the targetDescriptor. Same as calling
* {@link #constructMesh(GridGeometry2D, GeneralGridGeometry)} passing in
* target.getGridGeometry()
*
* @param imageGeometry
* @param targetDescriptor
* @return
* @throws VizException
*/
public abstract IMesh constructMesh(GridGeometry2D imageGeometry,
IDescriptor targetDescriptor) throws VizException;
} }

View file

@ -26,7 +26,9 @@ import java.util.ArrayList;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.RGB;
import org.geotools.coverage.grid.GeneralGridEnvelope; import org.geotools.coverage.grid.GeneralGridEnvelope;
@ -34,16 +36,23 @@ import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridGeometry2D; import org.geotools.coverage.grid.GridGeometry2D;
import org.geotools.geometry.DirectPosition2D; import org.geotools.geometry.DirectPosition2D;
import org.geotools.geometry.GeneralEnvelope; import org.geotools.geometry.GeneralEnvelope;
import org.geotools.referencing.CRS;
import org.geotools.referencing.GeodeticCalculator; import org.geotools.referencing.GeodeticCalculator;
import org.geotools.referencing.crs.DefaultGeocentricCRS;
import org.geotools.referencing.crs.DefaultGeographicCRS;
import org.geotools.referencing.operation.DefaultMathTransformFactory;
import org.opengis.geometry.DirectPosition; import org.opengis.geometry.DirectPosition;
import org.opengis.referencing.FactoryException; import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.datum.PixelInCell; import org.opengis.referencing.datum.PixelInCell;
import org.opengis.referencing.operation.MathTransform; import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.MathTransformFactory;
import org.opengis.referencing.operation.TransformException; import org.opengis.referencing.operation.TransformException;
import com.raytheon.uf.common.geospatial.CRSCache;
import com.raytheon.uf.common.geospatial.MapUtil; import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.adapters.GridGeometryAdapter;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
@ -187,12 +196,24 @@ public class MapDescriptor extends AbstractDescriptor implements
return gridGeom; return gridGeom;
} }
/** The transform from lat/lon to the current CRS */
protected MathTransform coordinateTransform;
/** The transform from the current CRS to lat/lon */
protected MathTransform inverseCoordinateTransform;
/** The mapping from grid to coordinate */ /** The mapping from grid to coordinate */
protected MathTransform mapToCoordinateTransform; protected MathTransform mapToCoordinateTransform;
/** The mapping from coordinate to grid */ /** The mapping from coordinate to grid */
protected MathTransform coordinateToMapTransform; protected MathTransform coordinateToMapTransform;
/** The mapping from wgs84 to grid */
protected MathTransform wgsToGridTransform;
/** The mapping from grid to wgs84 */
protected MathTransform gridToWGSTransform;
/** The time in ms that the last blink state was used */ /** The time in ms that the last blink state was used */
protected long timeLastBlink; protected long timeLastBlink;
@ -208,6 +229,9 @@ public class MapDescriptor extends AbstractDescriptor implements
*/ */
protected int mapWidth; protected int mapWidth;
/** The geospatial descriptor for the grid */
protected GeneralGridGeometry gridGeometry;
/** elevation exaggeration */ /** elevation exaggeration */
protected double elevationExageration = 0; protected double elevationExageration = 0;
@ -218,6 +242,8 @@ public class MapDescriptor extends AbstractDescriptor implements
LAT_LON_FORMATTER.setMaximumFractionDigits(2); LAT_LON_FORMATTER.setMaximumFractionDigits(2);
} }
private String cloudSourceName;
/** /**
* Constructor * Constructor
* *
@ -248,26 +274,49 @@ public class MapDescriptor extends AbstractDescriptor implements
* *
*/ */
public MapDescriptor(GeneralGridGeometry gridGeometry) throws VizException { public MapDescriptor(GeneralGridGeometry gridGeometry) throws VizException {
super(gridGeometry); super();
this.gridGeometry = gridGeometry;
init(); init();
} }
protected void init() throws VizException { protected void init() throws VizException {
MathTransformFactory mtf = new DefaultMathTransformFactory();
try { try {
GeneralGridGeometry gridGeometry = getGridGeometry();
mapToCoordinateTransform = gridGeometry mapToCoordinateTransform = this.gridGeometry
.getGridToCRS(PixelInCell.CELL_CENTER); .getGridToCRS(PixelInCell.CELL_CENTER);
coordinateToMapTransform = mapToCoordinateTransform.inverse(); coordinateToMapTransform = mapToCoordinateTransform.inverse();
CoordinateReferenceSystem descriptorCRS = this.gridGeometry
.getCoordinateReferenceSystem();
if (descriptorCRS.toWKT().equals(
DefaultGeocentricCRS.CARTESIAN.toWKT())) {
inverseCoordinateTransform = CRS.findMathTransform(
descriptorCRS, DefaultGeographicCRS.WGS84_3D);
CoordinateReferenceSystem crs = gridGeometry coordinateTransform = inverseCoordinateTransform.inverse();
} else {
inverseCoordinateTransform = CRSCache.getInstance()
.getTransformToLatLon(descriptorCRS);
coordinateTransform = inverseCoordinateTransform.inverse();
}
wgsToGridTransform = mtf.createConcatenatedTransform(
coordinateTransform, coordinateToMapTransform);
gridToWGSTransform = mtf.createConcatenatedTransform(
mapToCoordinateTransform, inverseCoordinateTransform);
CoordinateReferenceSystem crs = this.gridGeometry
.getCoordinateReferenceSystem(); .getCoordinateReferenceSystem();
DirectPosition s1, d1, s2, d2; DirectPosition s1, d1, s2, d2;
if (crs.getCoordinateSystem().getDimension() == 2) { if (crs.getCoordinateSystem().getDimension() == 2) {
double centerX = (gridGeometry.getGridRange().getLow(0) + gridGeometry double centerX = (this.gridGeometry.getGridRange().getLow(0) + this.gridGeometry
.getGridRange().getHigh(0)) / 2; .getGridRange().getHigh(0)) / 2;
double centerY = (gridGeometry.getGridRange().getLow(1) + gridGeometry double centerY = (this.gridGeometry.getGridRange().getLow(1) + this.gridGeometry
.getGridRange().getHigh(1)) / 2; .getGridRange().getHigh(1)) / 2;
s1 = new DirectPosition2D(centerX, centerY); s1 = new DirectPosition2D(centerX, centerY);
@ -318,6 +367,43 @@ public class MapDescriptor extends AbstractDescriptor implements
} }
} }
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.IDescriptor#pixelToWorld(double[])
*/
@Override
public double[] pixelToWorld(final double[] pixel) {
// if (pixel[0] < 1.0)
// pixel[0] = 1;
//
// if (pixel[0] > theWorldWidth - 1.0)
// pixel[0] = theWorldWidth - 1.0;
//
// if (pixel[1] < 1.0)
// pixel[1] = 1;
//
// if (pixel[1] > theWorldHeight - 1.0)
// pixel[1] = theWorldHeight;
double[] output = new double[3];
double[] wpixel = pixel;
if (pixel.length == 2) {
wpixel = new double[] { pixel[0], pixel[1], 0 };
}
try {
gridToWGSTransform.transform(wpixel, 0, output, 0, 1);
} catch (TransformException e) {
e.printStackTrace();
return null;
}
return output;
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
@ -331,7 +417,7 @@ public class MapDescriptor extends AbstractDescriptor implements
if (crs == MapUtil.LATLON_PROJECTION) { if (crs == MapUtil.LATLON_PROJECTION) {
return pixelToWorld(pixel); return pixelToWorld(pixel);
} else if (!crs.getName().equals( } else if (!crs.getName().equals(
getGridGeometry().getCoordinateReferenceSystem().getName())) { this.gridGeometry.getCoordinateReferenceSystem().getName())) {
return null; return null;
} }
@ -345,6 +431,33 @@ public class MapDescriptor extends AbstractDescriptor implements
return output2; return output2;
} }
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.IDescriptor#worldToPixel(double[])
*/
@Override
public double[] worldToPixel(double[] world) {
double[] output = new double[3];
double[] input = null;
if (world.length == 2) {
input = new double[] { world[0], world[1], 0 };
} else {
input = world;
}
try {
wgsToGridTransform.transform(input, 0, output, 0, 1);
} catch (TransformException e) {
return null;
}
return output;
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
@ -353,10 +466,11 @@ public class MapDescriptor extends AbstractDescriptor implements
*/ */
@Override @Override
public double[] worldToPixel(double[] pixel, CoordinateReferenceSystem crs) { public double[] worldToPixel(double[] pixel, CoordinateReferenceSystem crs) {
if (crs == MapUtil.LATLON_PROJECTION) { if (crs == MapUtil.LATLON_PROJECTION) {
return worldToPixel(pixel); return worldToPixel(pixel);
} else if (!crs.getName().equals( } else if (!crs.getName().equals(
getGridGeometry().getCoordinateReferenceSystem().getName())) { this.gridGeometry.getCoordinateReferenceSystem().getName())) {
return null; return null;
} }
@ -504,6 +618,18 @@ public class MapDescriptor extends AbstractDescriptor implements
return pc; return pc;
} }
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.map.IMapDescriptor#getMapData()
*/
@Override
@XmlElement
@XmlJavaTypeAdapter(value = GridGeometryAdapter.class)
public GeneralGridGeometry getGridGeometry() {
return this.gridGeometry;
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
@ -530,10 +656,29 @@ public class MapDescriptor extends AbstractDescriptor implements
@Override @Override
public void setGridGeometry(GeneralGridGeometry gridGeometry) public void setGridGeometry(GeneralGridGeometry gridGeometry)
throws VizException { throws VizException {
super.setGridGeometry(gridGeometry); this.gridGeometry = gridGeometry;
init(); init();
} }
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.map.IMapDescriptor#getCRS()
*/
@Override
public CoordinateReferenceSystem getCRS() {
if (this.gridGeometry != null) {
return this.gridGeometry.getCoordinateReferenceSystem();
} else {
return null;
}
}
public MathTransform getToGridTransform() {
return this.wgsToGridTransform;
}
/** /**
* Get the current display width * Get the current display width
* *

View file

@ -17,19 +17,12 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.uf.common.geospatial.util; package com.raytheon.uf.viz.core.map;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.referencing.CRS; import org.geotools.referencing.CRS;
import org.geotools.referencing.operation.DefaultMathTransformFactory;
import org.geotools.referencing.operation.projection.MapProjection; import org.geotools.referencing.operation.projection.MapProjection;
import org.geotools.referencing.operation.projection.MapProjection.AbstractProvider; import org.geotools.referencing.operation.projection.MapProjection.AbstractProvider;
import org.opengis.parameter.ParameterValueGroup; import org.opengis.parameter.ParameterValueGroup;
import org.opengis.referencing.operation.MathTransform;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
/** /**
* Given a descriptor of a map, this class will check line segments for wrapping * Given a descriptor of a map, this class will check line segments for wrapping
@ -57,9 +50,9 @@ public class WorldWrapChecker {
private boolean checkForWrapping = false; private boolean checkForWrapping = false;
public WorldWrapChecker(GeneralGridGeometry worldGeometry) { public WorldWrapChecker(IMapDescriptor descriptor) {
MapProjection worldProjection = CRS.getMapProjection(worldGeometry MapProjection worldProjection = CRS.getMapProjection(descriptor
.getCoordinateReferenceSystem()); .getCRS());
double centralMeridian = 0.0; double centralMeridian = 0.0;
if (worldProjection != null) { if (worldProjection != null) {
ParameterValueGroup group = worldProjection.getParameterValues(); ParameterValueGroup group = worldProjection.getParameterValues();
@ -78,27 +71,12 @@ public class WorldWrapChecker {
double r1 = inverseCentralMeridian - 359.9; double r1 = inverseCentralMeridian - 359.9;
double r2 = inverseCentralMeridian - 359.8; double r2 = inverseCentralMeridian - 359.8;
try { double xl1 = descriptor.worldToPixel(new double[] { l1, 0.0 })[0];
MathTransform latLonToGrid = new DefaultMathTransformFactory() double xl2 = descriptor.worldToPixel(new double[] { l2, 0.0 })[0];
.createConcatenatedTransform(MapUtil double xr1 = descriptor.worldToPixel(new double[] { r1, 0.0 })[0];
.getTransformFromLatLon(worldGeometry double xr2 = descriptor.worldToPixel(new double[] { r2, 0.0 })[0];
.getCoordinateReferenceSystem()),
worldGeometry.getGridToCRS().inverse());
double[] in = new double[] { l1, 0.0, l2, 0.0, r1, 0.0, r2, 0.0 }; checkForWrapping = Math.abs(xl1 - xr1) > Math.abs(xl2 - xr2);
double[] out = new double[in.length];
latLonToGrid.transform(in, 0, out, 0, 4);
double xl1 = out[0];
double xl2 = out[2];
double xr1 = out[4];
double xr2 = out[6];
checkForWrapping = Math.abs(xl1 - xr1) > Math.abs(xl2 - xr2);
} catch (Throwable t) {
UFStatus.getHandler().handle(Priority.PROBLEM,
"Error determing world wrap checking", t);
}
} }
/** /**

View file

@ -17,14 +17,12 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.uf.common.geospatial.util; package com.raytheon.uf.viz.core.map;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import org.geotools.coverage.grid.GeneralGridGeometry;
import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryCollection; import com.vividsolutions.jts.geom.GeometryCollection;
@ -55,12 +53,12 @@ public class WorldWrapCorrector {
private WorldWrapChecker checker; private WorldWrapChecker checker;
/** /**
* Constructs of world wrap corrector for the specified world * Constructs of world wrap corrector for the specified descriptor
* *
* @param descriptor * @param descriptor
*/ */
public WorldWrapCorrector(GeneralGridGeometry worldGeometry) { public WorldWrapCorrector(IMapDescriptor descriptor) {
checker = new WorldWrapChecker(worldGeometry); checker = new WorldWrapChecker(descriptor);
} }
/** /**

View file

@ -0,0 +1,148 @@
/**
* 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.
**/
package com.raytheon.uf.viz.core.preferences;
import java.util.UUID;
import org.eclipse.jface.preference.IPreferenceStore;
import com.raytheon.uf.viz.core.Activator;
/**
* Serialized class for the JMS policy type
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 30, 2012 mnash Initial creation
*
* </pre>
*
* @author mnash
* @version 1.0
*/
public class JMSPreferences {
// these are the policy types as supported by QPID
//
// reject - reject the message if the topic is full
//
// ring - start overwriting messages in a ring based on sizing. If head
// meets tail, advance head.
//
// flow to disk - flow the messages to disk to preserve memory
//
// ring strict - start overwriting messages in a ring based on sizing. If
// head meets tail, AND the consumer has the tail message acquired it will
// reject
//
public enum PolicyType {
REJECT("reject"), RING("ring"), FLOW_TO_DISK("flow_to_disk"), RING_STRICT(
"ring_strict");
private String type;
/**
* @return the type
*/
public String getType() {
return type;
}
private PolicyType(String name) {
type = name;
}
}
// declare topic as ADDR, not BURL
private static final String addressArgs = "ADDR:'amq.topic'/";
private static final String declareArgs = "; { node: { type: 'topic', x-declare: {arguments: {";
private static final String linkArgs = "}}}, link: { name: '";
private static final String linkDeclareArgs = "', x-declare: {arguments: {";
private static final String QPID_MAX_COUNT = "qpid.max_count";
private static final String QPID_POLICY_TYPE = "qpid.policy_type";
private static String policyType = "";
private static int maxVal = 0;
// putting together the arguments for the qpid queue
public static String getPolicyString(String val) {
// for qpid.policy_type, there is a corresponding constant in
// QpidQueueOptions, but did not want to add a dependency
return addressArgs + val + declareArgs + "'" + QPID_MAX_COUNT + "':"
+ getMaxCount() + ",'" + QPID_POLICY_TYPE + "':"
+ getPolicyType() + linkArgs + val + UUID.randomUUID()
+ linkDeclareArgs + "'" + QPID_MAX_COUNT + "':" + getMaxCount()
+ ",'" + QPID_POLICY_TYPE + "':" + getPolicyType() + "}}}}";
}
/**
* @return the policyTypeOption
*/
public static String getPolicyType() {
if (policyType != null && !policyType.isEmpty()) {
return policyType;
}
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
String value = store.getString(QPID_POLICY_TYPE);
// validation
for (PolicyType type : PolicyType.values()) {
if (!type.getType().equals(value)) {
policyType = value;
}
}
// fail safe for bad configurations
if (policyType == null || policyType.isEmpty()) {
policyType = PolicyType.RING.getType();
}
return "'" + policyType + "'";
}
/**
* Get the max count as given in the config.xml in the preference store
*
* @return
*/
public static int getMaxCount() {
if (maxVal != 0) {
return maxVal;
}
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
maxVal = store.getInt(QPID_MAX_COUNT);
// fail safe
if (maxVal == 0) {
maxVal = 1000;
}
return maxVal;
}
}

View file

@ -1,340 +0,0 @@
/**
* 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.
**/
package com.raytheon.uf.viz.core.rsc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IRenderable;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
/**
* Abstract resource class that manages frames with renderable objects
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 21, 2011 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public abstract class AbstractPluginDataObjectResource<T extends AbstractResourceData, D extends IDescriptor>
extends AbstractVizResource<T, D> {
private static class Frame {
List<PluginDataObject> records = new ArrayList<PluginDataObject>();
IRenderable renderable;
}
private Map<DataTime, Frame> frames = new HashMap<DataTime, Frame>();
private Object lock = new Object();
/**
* @param resourceData
* @param loadProperties
*/
protected AbstractPluginDataObjectResource(T resourceData,
LoadProperties loadProperties) {
super(resourceData, loadProperties);
dataTimes = new ArrayList<DataTime>();
resourceData.addChangeListener(new IResourceDataChanged() {
@Override
public void resourceChanged(ChangeType type, Object object) {
if (type == ChangeType.DATA_UPDATE) {
if (object instanceof PluginDataObject) {
addDataObject((PluginDataObject) object);
} else if (object instanceof PluginDataObject[]) {
for (PluginDataObject pdo : (PluginDataObject[]) object) {
addDataObject((PluginDataObject) pdo);
}
} else if (object instanceof Object[]) {
for (Object obj : (Object[]) object) {
if (obj instanceof PluginDataObject) {
addDataObject((PluginDataObject) obj);
}
}
}
} else if (type == ChangeType.CAPABILITY) {
if (object instanceof AbstractCapability) {
AbstractCapability capability = (AbstractCapability) object;
for (Frame frame : frames.values()) {
if (frame.renderable != null) {
capabilityChanged(frame.renderable, capability);
}
}
}
}
}
});
}
/**
* Adds the pdo to the appropriate time and removes any renderable or data
* cached for that time.
*
* @param pdo
*/
protected final void addDataObject(PluginDataObject pdo) {
synchronized (lock) {
if (frames == null) {
// Check for null in case we were waiting for lock from
// disposeInternal in which case we shouldn't process add
return;
}
DataTime time = getDataObjectTime(pdo);
Frame frame = frames.get(time);
if (frame == null) {
frame = new Frame();
frames.put(time, frame);
}
if (frame.records.contains(pdo)) {
frame.records.remove(pdo);
}
frame.records.add(pdo);
if (frame.renderable != null) {
if (updateRenderable(frame.renderable, pdo) == false) {
dispose(frame.renderable);
}
}
if (!dataTimes.contains(dataTimes)) {
dataTimes.add(time);
}
}
}
/**
* Return the DataTime to be associated with this record. Default returns
* PluginDataObject.getDataTime()
*
* @param pdo
* @return
*/
protected DataTime getDataObjectTime(PluginDataObject pdo) {
return pdo.getDataTime();
}
/**
* Get the records for the given time. Empty list will be returned if no
* frame for time
*
* @param time
* @return
*/
protected List<PluginDataObject> getPluginDataObjects(DataTime time) {
Frame frame = frames.get(time);
if (frame != null) {
return frame.records;
}
return new ArrayList<PluginDataObject>();
}
/**
* Get the current time for the resource, default calls
* descriptor.getTimeForResoruce(this)
*
* @return the current time
*/
protected DataTime getTimeForResource() {
return descriptor.getTimeForResource(this);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.rsc.AbstractVizResource#remove(com.raytheon.
* uf.common.time.DataTime)
*/
@Override
public final void remove(DataTime dataTime) {
synchronized (lock) {
super.remove(dataTime);
Frame frame = frames.remove(dataTime);
if (frame != null && frame.renderable != null) {
IRenderable dispose = frame.renderable;
frame.renderable = null;
dispose(dispose);
}
}
}
/**
* Dispose of a renderable.
*
* @param renderable
*/
private void dispose(final IRenderable renderable) {
VizApp.runAsync(new Runnable() {
@Override
public void run() {
disposeRenderable(renderable);
}
});
}
@Override
public final void project(CoordinateReferenceSystem crs)
throws VizException {
Iterator<Frame> iter = frames.values().iterator();
while (iter.hasNext()) {
Frame frame = iter.next();
IRenderable renderable = frame.renderable;
if (renderable != null) {
if (!projectRenderable(renderable, crs)) {
frame.renderable = null;
dispose(renderable);
}
}
}
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.rsc.AbstractVizResource#paintInternal(com.raytheon
* .uf.viz.core.IGraphicsTarget,
* com.raytheon.uf.viz.core.drawables.PaintProperties)
*/
@Override
protected final void paintInternal(IGraphicsTarget target,
PaintProperties paintProps) throws VizException {
DataTime time = paintProps.getDataTime();
if (time == null) {
time = getTimeForResource();
}
Frame currFrame = frames.get(time);
if (currFrame != null) {
IRenderable renderable = currFrame.renderable;
if (renderable == null) {
currFrame.renderable = renderable = constructRenderable(currFrame.records);
}
if (renderable != null) {
renderable.paint(target, paintProps);
}
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#disposeInternal()
*/
@Override
protected final void disposeInternal() {
synchronized (lock) {
for (Frame frame : frames.values()) {
if (frame.renderable != null) {
disposeRenderable(frame.renderable);
}
}
frames.clear();
frames = null;
}
disposeResource();
}
/**
* Dispose method for the resource to dispose any data not tied to a
* renderable. Called after all renderables have been disposed. Default impl
* does nothing
*/
protected void disposeResource() {
}
/**
* Notification that a capability has changed and the renderable should be
* updated
*
* @param renderable
* @param capability
*/
protected abstract void capabilityChanged(IRenderable renderable,
AbstractCapability capability);
/**
* Dispose the renderable object
*
* @param renderable
*/
protected abstract void disposeRenderable(IRenderable renderable);
/**
* Attempt to reproject the renderable object into this specified
* projection. If unable to reproject, return false and renderable will be
* recreated next paint
*
* @param renderable
* @param crs
* @return
*/
protected abstract boolean projectRenderable(IRenderable renderable,
CoordinateReferenceSystem crs) throws VizException;
/**
* Construct a renderable object for the given records. This method is
* called from paintInternal. Null can be returned and this method will be
* called next paintInternal. That can be used if requesting data that is
* required for the renderable asynchronously.
*
* NOTE: The size of the pdo list will only grow so it can be used to
* determine if new data has arrived since last call
*
* @param records
* @return
*/
protected abstract IRenderable constructRenderable(
List<PluginDataObject> records) throws VizException;
/**
* Update the renderable with the new pdo, if the renderable is updatable,
* return true. If the renderable needs to be recreated from scratch, return
* false
*
* @param renderable
* @param pdo
* @return
*/
protected abstract boolean updateRenderable(IRenderable renderable,
PluginDataObject pdo);
}

View file

@ -21,7 +21,6 @@ package com.raytheon.uf.viz.core.rsc;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
@ -386,6 +385,11 @@ public abstract class AbstractRequestableResourceData extends
Set<DataTime> currentSet = new HashSet<DataTime>(Arrays.asList(current)); Set<DataTime> currentSet = new HashSet<DataTime>(Arrays.asList(current));
boolean initialLoad = false;
if (currentSet.size() == 0) {
initialLoad = true;
}
Set<DataTime> loadSet = new HashSet<DataTime>(); Set<DataTime> loadSet = new HashSet<DataTime>();
for (DataTime t : desiredSet) { for (DataTime t : desiredSet) {
boolean found = false; boolean found = false;
@ -405,21 +409,6 @@ public abstract class AbstractRequestableResourceData extends
return new PluginDataObject[0]; return new PluginDataObject[0];
} }
return requestPluginDataObjects(loadSet);
}
/**
* Request plugin data objects for the passed in times. This method is
* called from getLatestPluginDataObjects(DataTime[],DataTime[]) after time
* filter from desired and current has been done. The times passed in is a
* collection of new times needed
*
* @param loadSet
* @return
* @throws VizException
*/
protected PluginDataObject[] requestPluginDataObjects(
Collection<DataTime> loadSet) throws VizException {
LayerProperty property = new LayerProperty(); LayerProperty property = new LayerProperty();
// TODO fix? // TODO fix?
property.setDesiredProduct(ResourceType.PLAN_VIEW); property.setDesiredProduct(ResourceType.PLAN_VIEW);
@ -487,7 +476,7 @@ public abstract class AbstractRequestableResourceData extends
/** /**
* Comparator for response array. * Comparator for response array.
*/ */
protected static Comparator<PluginDataObject> layerComparator = new Comparator<PluginDataObject>() { private static Comparator<PluginDataObject> layerComparator = new Comparator<PluginDataObject>() {
@Override @Override
public int compare(PluginDataObject arg0, PluginDataObject arg1) { public int compare(PluginDataObject arg0, PluginDataObject arg1) {

View file

@ -20,10 +20,10 @@
package com.raytheon.uf.viz.core.rsc; package com.raytheon.uf.viz.core.rsc;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
@ -152,11 +152,11 @@ public abstract class AbstractVizResource<T extends AbstractResourceData, D exte
protected AbstractVizResource(T resourceData, LoadProperties loadProperties) { protected AbstractVizResource(T resourceData, LoadProperties loadProperties) {
this.resourceData = resourceData; this.resourceData = resourceData;
this.loadProperties = loadProperties; this.loadProperties = loadProperties;
refreshListeners = new CopyOnWriteArraySet<IRefreshListener>(); refreshListeners = new HashSet<IRefreshListener>();
initListeners = new CopyOnWriteArraySet<IInitListener>(); initListeners = new HashSet<IInitListener>();
paintListeners = new CopyOnWriteArraySet<IPaintListener>(); paintListeners = new HashSet<IPaintListener>();
paintStatusListeners = new CopyOnWriteArraySet<IPaintStatusChangedListener>(); paintStatusListeners = new HashSet<IPaintStatusChangedListener>();
disposeListeners = new CopyOnWriteArraySet<IDisposeListener>(); disposeListeners = new HashSet<IDisposeListener>();
if (resourceData != null) { if (resourceData != null) {
resourceData.addChangeListener(new IResourceDataChanged() { resourceData.addChangeListener(new IResourceDataChanged() {
@ -717,7 +717,7 @@ public abstract class AbstractVizResource<T extends AbstractResourceData, D exte
*/ */
public final void recycle() { public final void recycle() {
if (status == ResourceStatus.INITIALIZED) { if (status == ResourceStatus.INITIALIZED) {
disposeInternal(); dispose();
} }
status = ResourceStatus.NEW; status = ResourceStatus.NEW;
initJob = null; initJob = null;

View file

@ -73,9 +73,6 @@ public class ColorMapCapability extends AbstractCapability implements
public void setColorMapParameters(ColorMapParameters colorMapParameters, public void setColorMapParameters(ColorMapParameters colorMapParameters,
boolean notify) { boolean notify) {
if (this.colorMapParameters != colorMapParameters) { if (this.colorMapParameters != colorMapParameters) {
if (this.colorMapParameters != null) {
this.colorMapParameters.removeListener(this);
}
this.colorMapParameters = colorMapParameters; this.colorMapParameters = colorMapParameters;
if (notify) { if (notify) {
capabilityChanged(); capabilityChanged();
@ -83,7 +80,7 @@ public class ColorMapCapability extends AbstractCapability implements
} }
if (this.colorMapParameters != null) { if (this.colorMapParameters != null) {
this.colorMapParameters.addListener(this); this.colorMapParameters.setListener(this);
} }
} }

View file

@ -21,115 +21,23 @@ package com.raytheon.uf.viz.core.rsc.hdf5;
import java.awt.Rectangle; import java.awt.Rectangle;
import org.geotools.coverage.grid.GeneralGridEnvelope;
import org.geotools.coverage.grid.GridGeometry2D;
import org.geotools.geometry.GeneralEnvelope;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.opengis.coverage.grid.GridEnvelope;
import org.opengis.geometry.Envelope;
import com.raytheon.uf.viz.core.PixelCoverage; import com.raytheon.uf.viz.core.PixelCoverage;
import com.vividsolutions.jts.geom.Coordinate;
/**
* ImageTile is an object that represents an image (or part of an image)
* geospatially, it contains a grid geometry that represents the projection and
* size of the image and a PixelCoverage which contains the screen projected
* data for the image. Because a single ImageTile can represent multiple images,
* this class does not contain the actual image it represents so the tile can be
* shared between images
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 13, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class ImageTile { public class ImageTile {
public GridGeometry2D imageGeometry; public com.vividsolutions.jts.geom.Envelope envelope;
public double elevation;
public PixelCoverage coverage; public PixelCoverage coverage;
/** public Rectangle rect;
* Checks to see if the x/y coordinate is contained by the ImageTile's CRS
* Envelope
*
* @param x
* @param y
* @return
*/
public boolean contains(double x, double y) {
Envelope env = imageGeometry.getEnvelope();
return env.getMinimum(0) <= x && env.getMaximum(0) >= x
&& env.getMinimum(1) <= y && env.getMaximum(1) >= y;
}
/** // TODO clean up occlusionQueries move to GLImage?
* Checks to see if the Coordinate is contained by the ImageTile's CRS public int query = -1;
* Envelope
*
* @param c
* @return
*/
public boolean contains(Coordinate c) {
return contains(c.x, c.y);
}
/** public boolean occlude = false;
* Set the grid geometry of the tile given the image rectangle and the
* referenced envelope
*
* @param rect
* @param env
*/
public void setGridGeometry(Rectangle rect, ReferencedEnvelope env) {
GeneralGridEnvelope gge = new GeneralGridEnvelope(rect);
GeneralEnvelope ge = new GeneralEnvelope(env);
imageGeometry = new GridGeometry2D(gge, ge);
}
/**
* Set the image geometry
*
* @param imageGeometry
*/
public void setGridGeometry(GridGeometry2D imageGeometry) {
this.imageGeometry = imageGeometry;
}
/**
* Get the image rectangle. This could be a subsection of a larger image so
* x and y may not be 0,0
*
* @return
*/
public Rectangle getRectangle() {
GridEnvelope env = imageGeometry.getGridRange();
return new Rectangle(env.getLow(0), env.getLow(1), env.getSpan(0),
env.getSpan(1));
}
/**
* Get the spatially referenced envelope of the image tile
*
* @return
*/
public ReferencedEnvelope getEnvelope() {
return new ReferencedEnvelope(imageGeometry.getEnvelope());
}
/**
* Dispose the image tile, disposes of the coverage object associated with
* it
*/
public void dispose() { public void dispose() {
if (coverage != null) { if (coverage != null) {
coverage.dispose(); coverage.dispose();

View file

@ -0,0 +1,163 @@
/**
* 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.
**/
package com.raytheon.uf.viz.core.rsc.hdf5;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.opengis.referencing.operation.MathTransform;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.IMesh;
import com.raytheon.uf.viz.core.IMeshCallback;
import com.raytheon.uf.viz.core.PixelCoverage;
import com.raytheon.uf.viz.core.rsc.RenderingOrderFactory;
/**
* Persistent job used to calculate mesh tiles outside of the rendering thread
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 1, 2007 chammack Initial Creation.
*
* </pre>
*
* @author cnh
* @version 1
*/
public class MeshCalculatorJob extends Job {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(MeshCalculatorJob.class);
private static MeshCalculatorJob instance;
private ConcurrentLinkedQueue<PixelCoverage> requests;
private ConcurrentHashMap<PixelCoverage, MeshParameters> map;
private MeshCalculatorJob() {
super("Mesh Calculator");
requests = new ConcurrentLinkedQueue<PixelCoverage>();
map = new ConcurrentHashMap<PixelCoverage, MeshParameters>();
}
/**
* Request to have the mesh be calculated in the mesh thread
*
* @param mesh
* @param tile
* @param preTransform
*/
public synchronized void requestLoad(IMesh mesh, ImageTile tile,
MathTransform preTransform) {
if (!requests.contains(tile.coverage)) {
MeshParameters params = new MeshParameters();
params.tile = tile;
params.mesh = mesh;
params.preTransform = preTransform;
map.put(tile.coverage, params);
requests.add(tile.coverage);
}
instance.schedule();
}
/**
* Request to have the mesh be calculated in the mesh thread, with the
* callback being notified after the mesh has been calculated
*
* @param callback
* @param mesh
* @param tile
* @param preTransform
*/
public synchronized void requestLoad(IMeshCallback callback, IMesh mesh,
ImageTile tile, MathTransform preTransform) {
if (!requests.contains(tile.coverage)) {
MeshParameters params = new MeshParameters();
params.tile = tile;
params.mesh = mesh;
params.preTransform = preTransform;
params.callback = callback;
map.put(tile.coverage, params);
requests.add(tile.coverage);
}
instance.schedule();
}
public static synchronized MeshCalculatorJob getInstance() {
if (instance == null) {
instance = new MeshCalculatorJob();
instance.setSystem(true);
}
return instance;
}
/*
* (non-Javadoc)
*
* @seeorg.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.
* IProgressMonitor)
*/
@Override
protected IStatus run(IProgressMonitor monitor) {
while (requests.size() > 0) {
PixelCoverage coverage = requests.peek();
try {
MeshParameters p = map.get(coverage);
coverage.setMesh(null);
p.mesh.calculateMesh(coverage, p.tile, p.preTransform);
coverage.setMesh(p.mesh);
if (p.callback != null) {
p.callback.meshCalculated(p.tile);
}
} catch (Throwable t) {
statusHandler.handle(Priority.PROBLEM, "An error occured during mesh calculations, some images may not be properly reprojected.", t);
}
map.remove(coverage);
requests.remove();
}
return Status.OK_STATUS;
}
private class MeshParameters {
// public MapDescriptor mapDescriptor;
public IMesh mesh;
public ImageTile tile;
public MathTransform preTransform;
public IMeshCallback callback;
}
}

View file

@ -1,19 +1,19 @@
/** /**
* This software was developed and / or modified by Raytheon Company, * This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government. * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
* *
* U.S. EXPORT CONTROLLED TECHNICAL DATA * U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose * This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination * export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires * to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization. * an export license or other authorization.
* *
* Contractor Name: Raytheon Company * Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340 * Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8 * Mail Stop B8
* Omaha, NE 68106 * Omaha, NE 68106
* 402.291.0100 * 402.291.0100
* *
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/

View file

@ -32,6 +32,7 @@ import com.raytheon.uf.common.message.IMessage;
import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.viz.core.comm.JMSConnection; import com.raytheon.uf.viz.core.comm.JMSConnection;
import com.raytheon.uf.viz.core.preferences.JMSPreferences;
/** /**
* Sends messages to jms endpoints programmatically. * Sends messages to jms endpoints programmatically.
@ -88,7 +89,8 @@ public class MessageSender {
dest = session.createQueue(endpoint); dest = session.createQueue(endpoint);
} }
if (DestinationType.TOPIC.equals(type)) { if (DestinationType.TOPIC.equals(type)) {
dest = session.createTopic(endpoint); dest = session
.createTopic(JMSPreferences.getPolicyString(endpoint));
} }
return dest; return dest;

View file

@ -37,6 +37,28 @@
</contourLabeling> </contourLabeling>
</contourStyle> </contourStyle>
</styleRule> </styleRule>
<!--
* GH, GHxSM, zAGL
dam | 0.1 | 0.0 | 4 | i4 | |..|8000F0FF| | 0 | 50
-->
<!-- geopotential height (GH) rules for HRRR-East -->
<styleRule>
<paramLevelMatches>
<parameter>GH</parameter>
<parameter>GHxSM</parameter>
<parameter>zAGL</parameter>
<creatingEntity>HRRR-East</creatingEntity>
<creatingEntity>HRRR-West</creatingEntity>
</paramLevelMatches>
<contourStyle>
<displayUnits>ft</displayUnits>
<contourLabeling labelSpacing="4" labelFormat="#">
<increment>5000</increment>
</contourLabeling>
</contourStyle>
</styleRule>
<!-- <!--
* GH, GHxSM, Topo, Surface * GH, GHxSM, Topo, Surface
m | 1.0 | 0.0 | 4 | i4 | |..|8000F0FF| | 12 | 1 100 200 300 500 700 1000 1500 2000 2500 3000 3500 m | 1.0 | 0.0 | 4 | i4 | |..|8000F0FF| | 12 | 1 100 200 300 500 700 1000 1500 2000 2500 3000 3500
@ -345,7 +367,7 @@ F | 1.8 |-459.67| 4 | | |..|8000F0FF| | 0 | 5
<contourStyle> <contourStyle>
<displayUnits>F</displayUnits> <displayUnits>F</displayUnits>
<range scale="LINEAR"> <range scale="LINEAR">
<minValue>-40</minValue> <minValue>-100</minValue>
<maxValue>115</maxValue> <maxValue>115</maxValue>
</range> </range>
<contourLabeling> <contourLabeling>
@ -962,7 +984,7 @@ PVU |1e5| 0.0 | 4 | | |..|8000F0FF| |16| \
<parameter>MpV</parameter> <parameter>MpV</parameter>
</paramLevelMatches> </paramLevelMatches>
<contourStyle> <contourStyle>
<displayUnits label="PVU">K/hPa/s*1.0E-5</displayUnits> <displayUnits label="PVU">K/hPa/s</displayUnits>
<contourLabeling labelSpacing="4"> <contourLabeling labelSpacing="4">
<values>-1 -.5 -.1 0 1 1.5 2 3 4 5 6 8 10 12 15 20</values> <values>-1 -.5 -.1 0 1 1.5 2 3 4 5 6 8 10 12 15 20</values>
</contourLabeling> </contourLabeling>

View file

@ -7,10 +7,7 @@ Bundle-Activator: com.raytheon.uf.viz.derivparam.Activator
Bundle-Vendor: RAYTHEON Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: org.eclipse.core.runtime,
javax.measure, javax.measure,
com.raytheon.uf.common.dataquery, com.raytheon.uf.common.dataquery
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
@ -20,13 +17,21 @@ Import-Package: com.raytheon.edex.meteoLib,
com.raytheon.uf.common.dataplugin, com.raytheon.uf.common.dataplugin,
com.raytheon.uf.common.dataplugin.level, com.raytheon.uf.common.dataplugin.level,
com.raytheon.uf.common.dataplugin.persist, com.raytheon.uf.common.dataplugin.persist,
com.raytheon.uf.common.datastorage.records,
com.raytheon.uf.common.derivparam.tree, com.raytheon.uf.common.derivparam.tree,
com.raytheon.uf.common.localization, com.raytheon.uf.common.localization,
com.raytheon.uf.common.message.response, com.raytheon.uf.common.message.response,
com.raytheon.uf.common.serialization, com.raytheon.uf.common.serialization,
com.raytheon.uf.common.serialization.adapters, com.raytheon.uf.common.serialization.adapters,
com.raytheon.uf.common.status, com.raytheon.uf.common.status,
com.raytheon.uf.common.time com.raytheon.uf.common.time,
com.raytheon.uf.viz.core,
com.raytheon.uf.viz.core.catalog,
com.raytheon.uf.viz.core.comm,
com.raytheon.uf.viz.core.exception,
com.raytheon.uf.viz.core.level,
com.raytheon.uf.viz.core.localization,
com.raytheon.uf.viz.core.status
Export-Package: com.raytheon.uf.viz.derivparam, Export-Package: com.raytheon.uf.viz.derivparam,
com.raytheon.uf.viz.derivparam.data, com.raytheon.uf.viz.derivparam.data,
com.raytheon.uf.viz.derivparam.inv, com.raytheon.uf.viz.derivparam.inv,

Some files were not shown because too many files have changed in this diff Show more