// update the datalogger control buttons private void refreshDatloggerButton(YSensor s) { if (s != null) { YModule m = s.get_module(); // get the module harboring the sensor YDataLogger dtl = YDataLogger.FindDataLogger(m.get_serialNumber() + ".dataLogger"); if (dtl.isOnline()) { if (dtl.get_recording() == YDataLogger.RECORDING_ON) { RecordButton.Enabled = false; PauseButton.Enabled = true; DeleteButton.Enabled = false; return; } else { RecordButton.Enabled = true; PauseButton.Enabled = false; DeleteButton.Enabled = true; return; } } } RecordButton.Enabled = false; PauseButton.Enabled = false; DeleteButton.Enabled = false; }
/** * <summary> * Returns the current activation state of the data logger. * <para> * </para> * <para> * </para> * </summary> * <returns> * a value among <c>YDataLogger.RECORDING_OFF</c>, <c>YDataLogger.RECORDING_ON</c> and * <c>YDataLogger.RECORDING_PENDING</c> corresponding to the current activation state of the data logger * </returns> * <para> * On failure, throws an exception or returns <c>YDataLogger.RECORDING_INVALID</c>. * </para> */ public int get_recording() { if (_func == null) { throw new YoctoApiProxyException("No DataLogger connected"); } // our enums start at 0 instead of the 'usual' -1 for invalid return(_func.get_recording() + 1); }