Search in sources :

Example 1 with ArchiveRecord

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++;
    }
}
Also used : ArchiveRecord(org.yamcs.protobuf.Yamcs.ArchiveRecord)

Example 2 with ArchiveRecord

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);
    }
}
Also used : IndexChunkSpec(org.yamcs.studio.archive.ArchivePanel.IndexChunkSpec) ArchiveRecord(org.yamcs.protobuf.Yamcs.ArchiveRecord) NamedObjectId(org.yamcs.protobuf.Yamcs.NamedObjectId) GradientPaint(java.awt.GradientPaint)

Aggregations

ArchiveRecord (org.yamcs.protobuf.Yamcs.ArchiveRecord)2 GradientPaint (java.awt.GradientPaint)1 NamedObjectId (org.yamcs.protobuf.Yamcs.NamedObjectId)1 IndexChunkSpec (org.yamcs.studio.archive.ArchivePanel.IndexChunkSpec)1