예제 #1
0
  public double[][] getMeasurementGraphData(
      String name, int period, Spacecraft fox, int fromReset, long fromUptime) {

    int start = 0;
    int end = 0;

    if (fromReset == 0.0 && fromUptime == 0.0) { // then we take rtRecords nearest the end
      start = rtRecords.size() - period;
      end = rtRecords.size();
    } else {
      // we need to find the start point
      start = rtRecords.getNearestFrameIndex(fox.foxId, fromUptime, fromReset);
      if (start == -1) start = rtRecords.size() - period;
      end = start + period;
    }
    if (end > rtRecords.size()) end = rtRecords.size();
    if (end < start) end = start;
    if (start < 0) start = 0;
    if (start > rtRecords.size()) start = rtRecords.size();
    double[] results = new double[end - start];
    double[] upTime = new double[end - start];
    double[] resets = new double[end - start];
    double[] dates = new double[end - start];

    int j = results.length - 1;
    for (int i = end - 1; i >= start; i--) {
      // System.out.println(rtrtRecords.size());
      results[j] = ((RtMeasurement) rtRecords.get(i)).getRawValue(name);
      upTime[j] = rtRecords.get(i).uptime;
      resets[j] = rtRecords.get(i).reset;
      dates[j--] = rtRecords.get(i).date.getTime();
    }

    double[][] resultSet = new double[4][end - start];
    resultSet[PayloadStore.DATA_COL] = results;
    resultSet[PayloadStore.UPTIME_COL] = upTime;
    resultSet[PayloadStore.RESETS_COL] = resets;
    resultSet[PayloadStore.UTC_COL] = dates;
    return resultSet;
  }
예제 #2
0
 public PassMeasurement getLatestPassMeasurement() {
   if (passRecords.size() == 0) return null;
   return (PassMeasurement) passRecords.get(passRecords.size() - 1);
 }
예제 #3
0
 public RtMeasurement getLatestMeasurement() {
   if (rtRecords.size() == 0) return null;
   return (RtMeasurement) rtRecords.get(rtRecords.size() - 1);
 }