First day of work on implementing dark current correction complete!
Second day of working on implementing dark current correction complete. David and I created two new actions (with corresponding infos): AMControlWaitAction and AMDetectorSetAsDarkCurrentCorrectionAction. AMDSADCCA sets a detector measurement to be the dark current value for that detector. AMCWA will wait until a control has reached a certain setpoint value (ie waits until the detector has finished taking a dark current measurement). We are in the middle of creating and using instances of these actions in CLSBasicScalerChannelDetector. We also had to reimplement some of the code written from the first day that didn't appear to be saved with that commit (?).
Created and implemented class AMControlWaitAction. This class will allow us to wait for a detector to take a dark current measurement.
David and I wrote CLSSIS3820Scaler::createWaitForDwellFinishedAction(), which creates and returns an instance of our new action AMControlWaitAction. We call this function in CLSBasicScalerChannelDetector::createDarkCurrentCorrectionActions(...), which should now have everything it needs to take a dark current measurement. We also went through and changed all versions of createDarkCurrentCorrectionActions(...) to take a 'double dwellTime' argument, which is used to define the dwell time. (this wasn't there before.)
David and I made some small adjustments yesterday during initial testing of dark current implementation. So far, everything works okay!
Built dark current correction analysis block, compiles but not tested. Added dwell time detector emulator to SGM, works.
Added the timeUnitMultiplier to AMDCCAB, added teyCorrected dark current correction AB for SGM XAS scans, fixed AMDetector setAsDarkCurrent to scale for the dwell time. Tested, basic functionality okay.
Committing changes made working on DarkCurrents yesterday, to switch branches today.
In the list of actions to perform for a dark current correction (CLSBasicScalerChannelDetector) we added saving a dark current dwell time. Created new action/action info AMDoingDarkCurrentCorrectionAction to make this happen.
Moved action creation for dark current correction from BasicScalerChannelDetector to within the CLSSIS3820Scaler class. Created a new action class to perform the dark current correction--AMDoDarkCurrentCorrectionAction/Info. Tested, works.
Implemented new bool field in AMDetector that will indicate whether or not a new dark current correction measurement is needed for a particular detector--requiresNewDarkCurrentCorrection. Getters and setters: requiresNewDarkCurrentCorrection() and setRequiresNewDarkCurrentCorrection(bool). In the latter, if the requires... bool is set to true, a signal requiresNewDarkCurrentCorrection() is emitted.
Implemented logic for some cases that would require new dark current correction measurement: when the AMDetector::setLastDarkCurrentDwellTime(double) argument is greater than the previous value, and when the sensitivity of scaler channel SR570 changes. First was taken care of by calling setRequiresNewDarkCurrentCorrection(true) if the condition is fulfilled. Second involved ferrying signal from SR570 through CLSSIS3820ScalerChannel, CLSSIS3820Scaler, to CLSBasicScalerChannelDetector::onScalerSensitivityChanged(), where setRequiresNewDakrCurrentCorrection(true) is called.
Made minor changes to the code, to fix what I've already written today. Changed the signal emitted from AMDetector::setRequiresNewDarkCurrentCorrection(bool) to have a boolean argument, indicating the new state of the detector's dark current measurement.
Changed AMDetector::requiresNewDarkCurrentCorrection_ boolean to initialize to true in the AMDetector constructor. Added AMDoDarkCurrentCorrectionActionInfo and AMDoingDarkCurrentCorrectionActionInfo classes to the database. Made some changes to SGMXASScanActionController::initializationActions() to reflect that some dark current correction measurements are for detectors with shared sources (will need to be changed to incorporate different detector requirements, but is fine for the detectors that have dark current correction enabled).
Made new class for displaying Dark Current measurement information, extending CLSSIS3820ScalerView. It adds a widget to the ScalerView main layout, and this widget is shown or hidden depending on the DarkCurrentViewMode. The widget displays the most recent dark current value only (no time), color-coded for status: blue indicates that the latest measurement is still valid, red that it isn't. The status and value are communicated to this class via new signals in CLSBasicScalerChannelDetector and CLSSIS3820Scaler. Builds successfully, but untested.
Tried cleaning up some of the language used for dark current measurement and correction--function and variable names--to try and make a little clearer exactly what's going on.
Alright! I saw that I had made a mistake previously, I had extended CLSIS3820ScalerView for my new view class incorporating dark current information, instead of CLSSIS3820ScalerChannelView. Now I think I've correctly implemented a class that provides display information about dark current measurement value and measurement state upon request. The old (mistake) class still exists, but header and class file contents are entirely commented out. Also fixed some issues with dark current dwell time being passed as an integer instead of a double. Builds and runs without error, but the class itself hasn't been instantiated/tested yet.
Removed old (mistake) class: CLSSIS3820ScalerViewWithDarkCurrent.
First stab at writing a AM1DDarkCurrentCorrectionABEditor class. Acquaman builds and runs, but this class is untested.
First stab at making some design modifications. To simplify the communication that has to happen between an instance of AMDetector (tey detector, in our case) and the scaler channels for displaying dark current information, we're thinking that it may be best to introduce a pointer to AMDetector as a member variable of CLSSIS3820ScalerChannel, complete with setter. Project builds but new features introduced are untested.