use of org.yamcs.protobuf.Yamcs.ArchiveRecord in project yamcs-studio by yamcs.
the class ArchivePanel method receiveArchiveRecords.
public synchronized void receiveArchiveRecords(IndexResult ir) {
dataViewer.receiveArchiveRecords(ir);
long start, stop;
for (ArchiveRecord r : ir.getRecordsList()) {
start = r.getFirst();
stop = r.getLast();
if ((dataStart == INVALID_INSTANT) || (start < dataStart))
dataStart = start;
if ((dataStop == INVALID_INSTANT) || (stop > dataStop))
dataStop = stop;
recCount++;
loadCount++;
}
}
use of org.yamcs.protobuf.Yamcs.ArchiveRecord in project yamcs-studio by yamcs.
the class IndexBox method receiveArchiveRecords.
public void receiveArchiveRecords(List<ArchiveRecord> records) {
String[] nameparts;
synchronized (tmData) {
for (ArchiveRecord r : records) {
// debugLog(r.packet+"\t"+r.num+"\t"+new Date(r.first)+"\t"+new Date(r.last));
NamedObjectId id = r.getId();
String grpName = null;
String shortName = null;
// split the id into group->name
if (!id.hasNamespace()) {
int idx = id.getName().lastIndexOf("/");
if (idx != -1) {
grpName = id.getName().substring(0, idx + 1);
shortName = id.getName().substring(idx + 1);
}
}
if (grpName == null) {
nameparts = id.getName().split("[_\\.]", 2);
if (nameparts.length > 1) {
grpName = nameparts[0];
shortName = nameparts[1].replaceFirst("INST_", "").replaceFirst("Tlm_Pkt_", "");
} else {
grpName = "";
shortName = id.getName();
}
}
if (!tmData.containsKey(id.getName())) {
tmData.put(id.getName(), new TreeSet<IndexChunkSpec>());
}
TreeSet<IndexChunkSpec> al = tmData.get(id.getName());
String info = r.hasInfo() ? r.getInfo() : null;
IndexChunkSpec tnew = new IndexChunkSpec(r.getFirst(), r.getLast(), r.getNum(), info);
IndexChunkSpec told = al.floor(tnew);
if ((told == null) || (mergeTime == -1) || (!told.merge(tnew, mergeTime))) {
al.add(tnew);
}
if (!allPackets.containsKey(id.getName())) {
IndexLineSpec pkt = new IndexLineSpec(id.getName(), grpName, shortName);
allPackets.put(id.getName(), pkt);
ArrayList<IndexLineSpec> plvec;
if ((plvec = groups.get(grpName)) == null) {
plvec = new ArrayList<>();
groups.put(grpName, plvec);
}
plvec.add(pkt);
}
}
titleLabel.setText(name);
}
}
Aggregations