Пример #1
0
  public void acceleratorChanged() {
    ArrayList<AcceleratorSeq> sclSeqs = new ArrayList<AcceleratorSeq>();
    List<AcceleratorSeq> scl;
    if (accelerator != null) {
      sclSeqs.add(accelerator.getSequence("SCLMed"));
      sclSeqs.add(accelerator.getSequence("SCLHigh"));

      scl = AcceleratorSeq.orderSequences(sclSeqs);

      setSelectedSequence(AcceleratorSeqCombo.getInstance("scl", scl));

      rfCavs = getSelectedSequence().getAllNodesOfType("SCLCavity");

      if (myWindow() != null) myWindow().createRFPane();

      // setHasChanges(true);

      if (snapAction != null) snapAction.setEnabled(true);
    }

    // initialize PVLogger
    ConnectionDictionary dict = PVLogger.newLoggingConnectionDictionary();
    if (dict != null) {
      pvLogger = new PVLogger(dict);
    } else {
      ConnectionPreferenceController.displayPathPreferenceSelector();
      dict = PVLogger.newLoggingConnectionDictionary();
      pvLogger = new PVLogger(dict);
    }
  }
Пример #2
0
  private synchronized void saveSnapshot() {
    while (!finished2) {
      try {
        this.wait();
      } catch (InterruptedException ie) {
        // do nothing
      }
    }

    try {
      LoggerSession loggerSession = pvLogger.requestLoggerSession("SCL HOM");

      // give 5 seconds for channel connection
      try {
        Thread.sleep(5000);
      } catch (InterruptedException ie) {
        // do nothing
      }

      snapshot = loggerSession.takeSnapshot();
      startTime = new Date();

      // attach the date to the snapshot comment field
      String comments = startTime.toString();
      comments = comments + "\n" + "For SCL Monitor Application";
      snapshot.setComment(comments);
      loggerSession.publishSnapshot(snapshot);
    } catch (Exception exception) {
      throw new RuntimeException(exception);
    }

    finished2 = false;
    finished3 = true;
    this.notify();
  }