Exemplo n.º 1
0
 public synchronized void setAsyncMode(final String dataRecorderName, final boolean asyncMode)
     throws DevFailed {
   final TangoAttribute att = new TangoAttribute(dataRecorderName + "/asynchronousWrite");
   // PASSERELLE-79 : conversion is not useful
   /*double val = 0;
   if (asyncMode) {
       val = 1;
   }
   att.write(val);*/
   att.write(asyncMode);
   DataRecorder.asyncMode = asyncMode;
 }
Exemplo n.º 2
0
  public synchronized void setNxEntryNameAndSaveContext(final Actor actor, final String suffix)
      throws DevFailed {
    final Director dir = actor.getDirector();
    if (dir instanceof RecordingDirector) {
      if (isRecordingStarted(actor)) {
        final String dataRecorderName =
            ((RecordingDirector) actor.getDirector()).getDataRecorderName();
        final TangoCommand commandState = new TangoCommand(dataRecorderName, "State");
        /*
         * ExecutionTracerService.trace(actor, "incrementing experiment
         * and acquisition indexes");
         */

        if (!firstRecord) {
          // write post technical data after the first loop
          logger.debug("write post technical data");
          final TangoCommand commandWritePostTechnicalData =
              new TangoCommand(dataRecorderName, "WritePostTechnicalData");
          commandWritePostTechnicalData.execute();
          if (DataRecorder.asyncMode) {
            logger.debug(
                "DR state :"
                    + TangoConst.Tango_DevStateName[
                        TangoAccess.getCurrentState(commandState).value()]);
            waitEndMoving(commandWritePostTechnicalData.getDeviceProxy());
            logger.debug(
                "DR state :"
                    + TangoConst.Tango_DevStateName[
                        TangoAccess.getCurrentState(commandState).value()]);
          }
        } else {
          firstRecord = false;
        }

        if (cancel) {
          cancel = false;
          return;
        }

        // increment indexes
        logger.debug("incrementing experiment and acquisition indexes");
        final TangoCommand commandIncAcq =
            new TangoCommand(dataRecorderName, "IncAcquisitionIndex");
        commandIncAcq.execute();

        final TangoCommand commandExpAcq = new TangoCommand(dataRecorderName, "IncExperimentIndex");
        commandExpAcq.execute();

        // change acquisition name
        final TangoAttribute acqName = new TangoAttribute(dataRecorderName + "/acquisitionName");
        acqName.write(suffix);

        if (cancel) {
          cancel = false;
          return;
        }

        // write user data
        logger.debug("user data ");
        final TangoCommand commandWriteUserData =
            new TangoCommand(dataRecorderName, "WriteUserData");
        commandWriteUserData.execute();
        if (DataRecorder.asyncMode) {
          waitEndMoving(commandWriteUserData.getDeviceProxy());
        }

        if (cancel) {
          cancel = false;
          return;
        }

        // write pre technical data
        logger.debug("write pre technical data");
        final TangoCommand commandWritePreTechnicalData =
            new TangoCommand(dataRecorderName, "WritePreTechnicalData");
        commandWritePreTechnicalData.execute();
        if (DataRecorder.asyncMode) {
          logger.debug(
              "DR state :"
                  + TangoConst.Tango_DevStateName[
                      TangoAccess.getCurrentState(commandState).value()]);
          waitEndMoving(commandWritePreTechnicalData.getDeviceProxy());
          logger.debug(
              "DR state :"
                  + TangoConst.Tango_DevStateName[
                      TangoAccess.getCurrentState(commandState).value()]);
        }
      }
    }
  }