Skip to content

Commit

Permalink
fix negative scan direction stage scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon committed May 1, 2024
1 parent 87b03a9 commit a89b2e0
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ public boolean prepareControllerForAcquisition(

xyStage_.setScanPattern(isStageScan2Sided ?
ASIXYStage.ScanPattern.SERPENTINE : ASIXYStage.ScanPattern.RASTER);
xyStage_.setScanSettlingTime(acqSettings_.volumeSettings().delayBeforeView());

if (xyStage_.getAxisPolarityX() != ASIXYStage.AxisPolarity.NORMAL) {
studio_.logs().showError(
Expand Down Expand Up @@ -351,7 +352,7 @@ public boolean prepareStageScanForAcquisition(final double x, final double y, De
xyStage_.setSlowAxisStop(y / 1000);

zSpeedZero_ = true; // will turn false if we are doing planar correction
return false;
return true;
// return preparePlanarCorrectionForAcquisition(); TODO: add planar correction later
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.io.IOException;
import java.util.ArrayList;


public class AcquisitionEngineSCAPE extends AcquisitionEngine {

private double origSpeedX_;
Expand Down Expand Up @@ -149,29 +150,33 @@ boolean run() {
}

// --- testing code below ---
// String plcName = "Scanner:AB:33";
// StrVector propertyNames;
// try {
// propertyNames = core_.getDevicePropertyNames(plcName);
// } catch (Exception e) {
// propertyNames = null;
// }
//
// Gson gsonObj = new Gson();
// HashMap<String, String> deviceProps = new HashMap<>();
// for (String propName : propertyNames) {
// String propValue;
// StrVector deviceNames = core_.getLoadedDevices();
// for (String deviceName : deviceNames) {
// System.out.println("deviceName: " + deviceName);
// StrVector propertyNames;
// try {
// propValue = core_.getProperty(plcName, propName);
// propertyNames = core_.getDevicePropertyNames(deviceName);
// } catch (Exception e) {
// propValue = "";
// System.out.println("failed!");
// propertyNames = null;
// }
// deviceProps.put(propName, propValue);
// //System.out.println(propName);
//
// Gson gsonObj = new Gson();
// HashMap<String, String> deviceProps = new HashMap<>();
// for (String propName : propertyNames) {
// String propValue;
// try {
// propValue = core_.getProperty(deviceName, propName);
// } catch (Exception e) {
// propValue = "";
// System.out.println("failed!");
// }
// deviceProps.put(propName, propValue);
// //System.out.println(propName);
// }
//
// String jsonStr = gsonObj.toJson(deviceProps);
// System.out.println(jsonStr);
// }
// String jsonStr = gsonObj.toJson(deviceProps);
// System.out.println(jsonStr);

setAcquisitionSettings(asb_.build());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ public ScanState getScanState() {
return ScanState.fromString(getProperty(Properties.SCAN_STATE));
}

public void setScanSettlingTime(final double milliseconds) {
setPropertyFloat(Properties.SCAN_SETTLING_TIME, milliseconds);
}

public double getScanSettlingTime() {
return getPropertyFloat(Properties.SCAN_SETTLING_TIME);
}

public static class Properties {
public static final String AXIS_POLARITY_X = "AxisPolarityX";
public static final String AXIS_POLARITY_Y = "AxisPolarityY";
Expand All @@ -173,6 +181,7 @@ public static class Properties {
public static final String SCAN_NUM_LINES = "ScanNumLines";
public static final String SCAN_PATTERN = "ScanPattern";
public static final String SCAN_STATE = "ScanState";
public static final String SCAN_SETTLING_TIME = "ScanSettlingTime(ms)";

public static final String SCAN_FAST_AXIS_START_POSITION = "ScanFastAxisStartPosition(mm)";
public static final String SCAN_FAST_AXIS_STOP_POSITION = "ScanFastAxisStopPosition(mm)";
Expand Down

0 comments on commit a89b2e0

Please sign in to comment.