Hello,
Im testing some of the URcap Samples. I want to create a Cap that allows me to store some Waypoints and attributes(Time, digital Out set true/false , etc) in a XML file. Im getting the actuel TCP pose via socket 30003.
And stored it into an Object of my Class “Vergusspunkt”. With the help of a Popup and the toString() method I checked it while the Cap is running. (everything fine: the actual TCP Pose appears in the Popup. Also creating the .xml File worked.( in the programs Folder) But when I open the file - its empty.
When i write a other Object like a JButton or something to the XML-file, the file is not empty…
Am i something missing at my own Classes? In Netbeans the XML works. It Shows a ArrayList with Waypoints and Attributes.
sry for my english
Ronny
the ArrayList for storing the Waypoints:
package com.ur.urcap.examples.RTDE.impl;
import java.util.ArrayList;
import java.util.List;
public class VergussProgramm {
private List<VergussPunkt> vergusspunkte;
public VergussProgramm()
{
vergusspunkte = new ArrayList<VergussPunkt>();
}
public List<VergussPunkt> getVergusspunkte() {
return vergusspunkte;
}
// public void setVergusspunkte(List vergusspunkte)
// {
// this.vergusspunkte = vergusspunkte;
// }
public void addVergusspunkte(VergussPunkt v)
{
vergusspunkte.add(v);
}
public void setData(List<VergussPunkt> ds)
{
vergusspunkte.addAll(ds);
}
}
the Class “Vergusspunkt” to store the pose and the Attributes:
package com.ur.urcap.examples.RTDE.impl;
import java.util.ArrayList;
public class VergussPunkt {
private String name;
private ArrayList<Double> pose;
private double acc;
private double vec;
private int setDO;
private double setTime;
private double waitTime;
public VergussPunkt() {
name = new String();
pose = new ArrayList<Double>();
acc = new Double(acc);
vec = new Double(vec);
setDO = new Integer(setDO);
setTime = new Double(setTime);
waitTime = new Double(waitTime);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ArrayList<Double> getPose() {
return pose;
}
public void setPose(ArrayList<Double> pose) {
this.pose = pose;
}
public double getAcc() {
return acc;
}
public void setAcc(double acc) {
this.acc = acc;
}
public double getVec() {
return vec;
}
public void setVec(double vec) {
this.vec = vec;
}
public int getSetDO() {
return setDO;
}
public void setSetDO(int setDO) {
this.setDO = setDO;
}
public double getSetTime() {
return setTime;
}
public void setSetTime(double setTime) {
this.setTime = setTime;
}
public double getWaitTime() {
return waitTime;
}
public void setWaitTime(double waitTime) {
this.waitTime = waitTime;
}
@Override
public String toString() {
return "VergussPunkt [name=" + name + ", pose=p" + pose + ", a=" + acc
+ ", v=" + vec + ", setDO=" + setDO + ", setTime=" + setTime
+ ", waitTime=" + waitTime + "]";
}
}