public synchronized void saveDevice(final Actor actor, final String deviceName) throws DevFailed { final Director dir = actor.getDirector(); if (dir instanceof RecordingDirector) { if (isRecordingStarted(actor)) { final boolean autoChangeNX = ((RecordingDirector) actor.getDirector()).isAutoChangeNxEntry(); if (autoChangeNX) { incNxEntryNameAndSaveContext(actor); } final String dataRecorderName = ((RecordingDirector) actor.getDirector()).getDataRecorderName(); ExecutionTracerService.trace( actor, "saving device " + deviceName + " on datarecorder " + dataRecorderName); final TangoCommand command = new TangoCommand(dataRecorderName, "WriteTangoDeviceData"); command.execute(deviceName); if (DataRecorder.asyncMode) { // Bug 22954 final TangoCommand commandState = new TangoCommand(dataRecorderName, "State"); logger.debug( "DR state :" + TangoConst.Tango_DevStateName[ TangoAccess.getCurrentState(commandState).value()]); waitEndMoving(command.getDeviceProxy()); logger.debug( "DR state :" + TangoConst.Tango_DevStateName[ TangoAccess.getCurrentState(commandState).value()]); } } } }
public synchronized void startRecording(final Actor actor) throws DevFailed { firstRecord = true; final Director dir = actor.getDirector(); if (dir instanceof RecordingDirector) { final String deviceName = ((RecordingDirector) actor.getDirector()).getDataRecorderName(); final TangoCommand comHelp = new TangoCommand(deviceName, "StartRecording"); comHelp.execute(); startRecording = true; } else { ExecutionTracerService.trace(actor, "WARNING - there is no Recording director"); } }
/** * does not exist anymore on datarecorder * * @param actor * @param scanDeviceName * @param scan1DDeviceName * @param scan2DDeviceName * @throws DevFailed */ @Deprecated public synchronized void saveScan( final Actor actor, final String scanDeviceName, final String scan1DDeviceName, final String scan2DDeviceName) throws DevFailed { final Director dir = actor.getDirector(); if (dir instanceof RecordingDirector) { if (isRecordingStarted(actor)) { final String dataRecorderName = ((RecordingDirector) actor.getDirector()).getDataRecorderName(); ExecutionTracerService.trace(actor, "saving scan data on datarecorder " + dataRecorderName); final TangoCommand command = new TangoCommand(dataRecorderName, "WriteScanData"); final Object[] devicesNames = {scanDeviceName, scan1DDeviceName, scan2DDeviceName}; command.execute(devicesNames); if (DataRecorder.asyncMode) { waitEndMoving(command.getDeviceProxy()); } logger.debug("saved scan data"); } } }