mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-21 22:52:22 +00:00
Update to Nilus 3
This commit is contained in:
parent
9c10af43bc
commit
bfed9cfa00
@ -17,10 +17,6 @@
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="C:/Users/dg50/Tethys/NilusXMLGenerator/target/nilus-1.5.jar">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="jar:file:/C:/Users/dg50/Tethys/NilusXMLGenerator/target/nilus-1.5-javadoc.jar!/"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="C:/Users/dg50/source/repos/nilusxmlgenerator/target/nilus-3.0.jar"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
@ -11,8 +11,8 @@ import javax.swing.JMenuItem;
|
||||
import PamController.PamControlledUnit;
|
||||
import PamController.PamController;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import nilus.Deployment;
|
||||
import nilus.Deployment.Instrument;
|
||||
//import nilus.Deployment;
|
||||
//import nilus.Deployment.Instrument;
|
||||
import tethys.output.StreamExportParams;
|
||||
import tethys.output.TethysExportParams;
|
||||
import tethys.output.TethysExporter;
|
||||
|
@ -12,10 +12,10 @@ import javax.xml.bind.Marshaller;
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.validation.Schema;
|
||||
|
||||
import nilus.Deployment.Data.Audio;
|
||||
import nilus.Deployment;
|
||||
import nilus.Deployment.Data;
|
||||
import nilus.Deployment.Instrument;
|
||||
//import nilus.Deployment.Data.Audio;
|
||||
//import nilus.Deployment;
|
||||
//import nilus.Deployment.Data;
|
||||
//import nilus.Deployment.Instrument;
|
||||
|
||||
public class DeploymentWrapper<T extends Serializable> {
|
||||
|
||||
@ -34,52 +34,52 @@ public class DeploymentWrapper<T extends Serializable> {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// quick play with some JAXB objects to see what they can do.
|
||||
Deployment deployment = new Deployment();
|
||||
|
||||
Class<? extends Deployment> deploymentClass = deployment.getClass();
|
||||
Annotation[] annots = deploymentClass.getAnnotations();
|
||||
AnnotatedType[] annotInterfaces = deploymentClass.getAnnotatedInterfaces();
|
||||
Annotation[] declAnnots = deploymentClass.getDeclaredAnnotations();
|
||||
|
||||
Instrument instrument = new Instrument();
|
||||
instrument.setID("22");
|
||||
instrument.setType("SoundTrap");
|
||||
QName qName = new QName("Instrument");
|
||||
JAXBElement<Instrument> jInst = new JAXBElement<Deployment.Instrument>(qName, Instrument.class, instrument);
|
||||
deployment.getContent().add(jInst);
|
||||
|
||||
Deployment.Data data = new Data();
|
||||
Audio audio = new Audio();
|
||||
audio.setProcessed("??");
|
||||
data.setAudio(audio);
|
||||
JAXBElement jData = new JAXBElement<Deployment.Data>(new QName("Data"), Data.class, data);
|
||||
deployment.getContent().add(jData);
|
||||
|
||||
String project = "Project Name";
|
||||
JAXBElement<String> jProj = new JAXBElement<String>(new QName("Project"), String.class, project);
|
||||
deployment.getContent().add(jProj);
|
||||
|
||||
String aaa = "Project Something else";
|
||||
JAXBElement<String> jProj2 = new JAXBElement<String>(new QName("Region"), String.class, aaa);
|
||||
deployment.getContent().add(jProj2);
|
||||
|
||||
|
||||
try {
|
||||
JAXBContext jContext = JAXBContext.newInstance(Deployment.class);
|
||||
Marshaller mar = (Marshaller) jContext.createMarshaller();
|
||||
mar.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, true);
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
mar.marshal(deployment, bos);
|
||||
String xml = new String(bos.toByteArray());
|
||||
System.out.println(xml);
|
||||
// Schema schema = mar.getSchema(); // is null. Can't generate it's own it seems.
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Deployment deployment = new Deployment();
|
||||
//
|
||||
// Class<? extends Deployment> deploymentClass = deployment.getClass();
|
||||
// Annotation[] annots = deploymentClass.getAnnotations();
|
||||
// AnnotatedType[] annotInterfaces = deploymentClass.getAnnotatedInterfaces();
|
||||
// Annotation[] declAnnots = deploymentClass.getDeclaredAnnotations();
|
||||
//
|
||||
// Instrument instrument = new Instrument();
|
||||
// instrument.setID("22");
|
||||
// instrument.setType("SoundTrap");
|
||||
// QName qName = new QName("Instrument");
|
||||
// JAXBElement<Instrument> jInst = new JAXBElement<Deployment.Instrument>(qName, Instrument.class, instrument);
|
||||
// deployment.getContent().add(jInst);
|
||||
//
|
||||
// Deployment.Data data = new Data();
|
||||
// Audio audio = new Audio();
|
||||
// audio.setProcessed("??");
|
||||
// data.setAudio(audio);
|
||||
// JAXBElement jData = new JAXBElement<Deployment.Data>(new QName("Data"), Data.class, data);
|
||||
// deployment.getContent().add(jData);
|
||||
//
|
||||
// String project = "Project Name";
|
||||
// JAXBElement<String> jProj = new JAXBElement<String>(new QName("Project"), String.class, project);
|
||||
// deployment.getContent().add(jProj);
|
||||
//
|
||||
// String aaa = "Project Something else";
|
||||
// JAXBElement<String> jProj2 = new JAXBElement<String>(new QName("Region"), String.class, aaa);
|
||||
// deployment.getContent().add(jProj2);
|
||||
//
|
||||
//
|
||||
// try {
|
||||
// JAXBContext jContext = JAXBContext.newInstance(Deployment.class);
|
||||
// Marshaller mar = (Marshaller) jContext.createMarshaller();
|
||||
// mar.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, true);
|
||||
//
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
// mar.marshal(deployment, bos);
|
||||
// String xml = new String(bos.toByteArray());
|
||||
// System.out.println(xml);
|
||||
//// Schema schema = mar.getSchema(); // is null. Can't generate it's own it seems.
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package tethys.deployment;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import nilus.DeploymentRecoveryDetails;
|
||||
//import nilus.DeploymentRecoveryDetails;
|
||||
|
||||
/**
|
||||
* Wrapper and functions associated with the Tethys Deployment object which can
|
||||
@ -49,12 +49,12 @@ public class PamDeployment {
|
||||
public PamDeployment() {
|
||||
|
||||
}
|
||||
|
||||
public DeploymentRecoveryDetails getDeploymentRecoveryDetails() {
|
||||
DeploymentRecoveryDetails drd = new DeploymentRecoveryDetails();
|
||||
|
||||
return null;
|
||||
}
|
||||
//
|
||||
// public DeploymentRecoveryDetails getDeploymentRecoveryDetails() {
|
||||
// DeploymentRecoveryDetails drd = new DeploymentRecoveryDetails();
|
||||
//
|
||||
// return null;
|
||||
// }
|
||||
|
||||
private void ripApart(Serializable object) {
|
||||
Class cls = object.getClass();
|
||||
|
Loading…
Reference in New Issue
Block a user