Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ interface Builder<T extends AcquisitionSettings.Builder<T>> extends AcquisitionS
*
* @param timePointInterval the time point interval in seconds.
*/
T timePointInterval(final int timePointInterval);
T timePointInterval(final double timePointInterval);

/**
* Sets the delay after a move when using multiple positions.
Expand Down Expand Up @@ -278,7 +278,7 @@ interface Builder<T extends AcquisitionSettings.Builder<T>> extends AcquisitionS
*
* @return the time point interval in seconds.
*/
int timePointInterval();
double timePointInterval();

/**
* Returns the post move delay in milliseconds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static class Builder extends DefaultAcquisitionSettings.Builder<Builder>
private boolean useAdvancedTiming_ = false;

private int numTimePoints_ = 1;
private int timePointInterval_ = 0;
private double timePointInterval_ = 0.0;
private int postMoveDelay_ = 0;

private int numChannels_ = 0;
Expand Down Expand Up @@ -199,7 +199,7 @@ public Builder numTimePoints(final int numTimePoints) {
* @param timePointInterval the time point interval in seconds.
*/
@Override
public Builder timePointInterval(final int timePointInterval) {
public Builder timePointInterval(final double timePointInterval) {
timePointInterval_ = timePointInterval;
return this;
}
Expand Down Expand Up @@ -342,7 +342,7 @@ public String toString() {
private final boolean useAdvancedTiming_;

private final int numTimePoints_;
private final int timePointInterval_;
private final double timePointInterval_;
private final int postMoveDelay_;

private final int numChannels_;
Expand Down Expand Up @@ -606,7 +606,7 @@ public int numTimePoints() {
* @return the time point interval in seconds.
*/
@Override
public int timePointInterval() {
public double timePointInterval() {
return timePointInterval_;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,15 @@ private void createUserInterface() {
final Panel pnlCenter = new Panel();
pnlRight_ = new Panel();

// durations
pnlDurations_ = new VolumeDurationPanel(model_);

pnlVolumeSettings_ = new VolumeSettingsPanel(model_);

// switch between these two panels
pnlSliceSettings_ = new SliceSettingsPanel(model_);
pnlAdvancedTiming_ = new AdvancedTimingPanel(model_);

// durations
pnlDurations_ = new VolumeDurationPanel(model_);

// multiple positions
cbxUseMultiplePositions_ = new CheckBox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ private void createUserInterface() {
lblTimePointInterval_ = new Label("Interval [s]:");
spnNumTimePoints_ = Spinner.createIntegerSpinner(
acqSettings.numTimePoints(), 1, Integer.MAX_VALUE,1);
spnTimePointInterval_ = Spinner.createIntegerSpinner(
acqSettings.timePointInterval(), 0, Integer.MAX_VALUE, 1);
spnTimePointInterval_ = Spinner.createDoubleSpinner(
acqSettings.timePointInterval(), 0.1, Double.MAX_VALUE, 0.1);

add(lblNumTimePoints_, "");
add(spnNumTimePoints_, "wrap");
Expand All @@ -54,13 +54,13 @@ private void createEventHandlers() {

spnNumTimePoints_.registerListener(e -> {
model_.acquisitions().settingsBuilder().numTimePoints(spnNumTimePoints_.getInt());
//updateDurationLabels();
model_.acquisitions().updateDurationLabels();
//System.out.println("getNumTimePoints: " + model_.acquisitions().getAcquisitionSettings().getNumTimePoints());
});

spnTimePointInterval_.registerListener(e -> {
model_.acquisitions().settingsBuilder().timePointInterval(spnTimePointInterval_.getInt());
//updateDurationLabels();
model_.acquisitions().settingsBuilder().timePointInterval(spnTimePointInterval_.getDouble());
model_.acquisitions().updateDurationLabels();
//System.out.println("getTimePointInterval: " + model_.acquisitions().getAcquisitionSettings().getTimePointInterval());
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.micromanager.lightsheetmanager.gui.components.Panel;
import org.micromanager.lightsheetmanager.LightSheetManager;

import javax.swing.JLabel;
import java.util.Objects;

public class VolumeDurationPanel extends Panel {
Expand All @@ -16,23 +17,21 @@ public class VolumeDurationPanel extends Panel {
private Label lblVolumeTimeValue_;
private Label lblTotalTimeValue_;

private final LightSheetManager model_;

public VolumeDurationPanel(final LightSheetManager model) {
super("Durations");
model_ = Objects.requireNonNull(model);
Objects.requireNonNull(model)
.acquisitions().setVolumeDurationPanel(this);
createUserInterface();
createEventHandlers();
}

private void createUserInterface() {
lblSliceTime_ = new Label("Slice");
lblSliceTime_ = new Label("Slice:");
lblVolumeTime_ = new Label("Volume:");
lblTotalTime_ = new Label("Total:");

lblSliceTimeValue_ = new Label("0.0");
lblVolumeTimeValue_ = new Label("0.0");
lblTotalTimeValue_ = new Label("0.0");
lblSliceTimeValue_ = new Label("0.000 ms");
lblVolumeTimeValue_ = new Label("0.000 ms");
lblTotalTimeValue_ = new Label("0.000 s");

add(lblSliceTime_, "");
add(lblSliceTimeValue_, "wrap");
Expand All @@ -42,7 +41,21 @@ private void createUserInterface() {
add(lblTotalTimeValue_, "");
}

private void createEventHandlers() {
public void setDurationText(final String sliceTime, final String volumeTime, final String totalTime) {
lblSliceTimeValue_.setText(sliceTime);
lblVolumeTimeValue_.setText(volumeTime);
lblTotalTimeValue_.setText(totalTime);
}

public JLabel getSliceDurationLabel() {
return lblSliceTimeValue_;
}

public JLabel getVolumeDurationLabel() {
return lblVolumeTimeValue_;
}

public JLabel getTotalDurationLabel() {
return lblTotalTimeValue_;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class VolumeSettingsPanel extends Panel {
private Spinner spnSliceStepSize_;
private Spinner spnNumSlices_;

private LightSheetManager model_;
private final LightSheetManager model_;

public VolumeSettingsPanel(final LightSheetManager model) {
super("Volume Settings");
Expand Down Expand Up @@ -50,7 +50,7 @@ private void createUserInterface() {
final Label lblFirstView = new Label("First view:");
final Label lblViewDelay = new Label("Delay before view [ms]:");
final Label lblSlicesPerView = new Label("Slices per view:");
final Label lblSliceStepSize = new Label("Slice step size [\u00B5m]:");
final Label lblSliceStepSize = new Label("Slice step size [µm]:");

// if the number of sides has changed and the firstView or numViews is larger
// than the number of sides, default to 1.
Expand All @@ -71,7 +71,7 @@ private void createUserInterface() {
spnSliceStepSize_ = Spinner.createDoubleSpinner(
volumeSettings.sliceStepSize(), 0.0, Double.MAX_VALUE, 0.1);
spnNumSlices_ = Spinner.createIntegerSpinner(
volumeSettings.slicesPerView(), 0, Integer.MAX_VALUE, 1);
volumeSettings.slicesPerView(), 1, Integer.MAX_VALUE, 1);

switch (geometryType) {
case DISPIM:
Expand Down Expand Up @@ -114,11 +114,13 @@ private void createEventHandlers() {
spnViewDelay_.registerListener(e -> {
model_.acquisitions().settingsBuilder().volumeSettingsBuilder()
.delayBeforeView(spnViewDelay_.getDouble());
model_.acquisitions().updateDurationLabels();
});

spnNumSlices_.registerListener(e -> {
model_.acquisitions().settingsBuilder().volumeSettingsBuilder()
.slicesPerView(spnNumSlices_.getInt());
model_.acquisitions().updateDurationLabels();
});

spnSliceStepSize_.registerListener(e -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.micromanager.lightsheetmanager.api.AcquisitionManager;
import org.micromanager.lightsheetmanager.api.internal.DefaultAcquisitionSettingsSCAPE;
import org.micromanager.lightsheetmanager.LightSheetManagerFrame;
import org.micromanager.lightsheetmanager.gui.tabs.acquisition.VolumeDurationPanel;
import org.micromanager.lightsheetmanager.model.autofocus.AutofocusMM;
import org.micromanager.lightsheetmanager.model.DataStorage;
import org.micromanager.lightsheetmanager.LightSheetManager;
Expand Down Expand Up @@ -49,6 +50,7 @@ public abstract class AcquisitionEngine implements AcquisitionManager, MMAcquist
protected Pipeline curPipeline_;
protected long nextWakeTime_ = -1;

protected VolumeDurationPanel pnlVolumeDurations_;

// TODO: remove later, hacky method to stop position updater for now
protected LightSheetManagerFrame frame_;
Expand Down Expand Up @@ -80,6 +82,12 @@ public AcquisitionEngine(final LightSheetManager model) {

public abstract void recalculateSliceTiming();

public abstract void updateDurationLabels();

public void setVolumeDurationPanel(final VolumeDurationPanel panel) {
pnlVolumeDurations_ = panel;
}

public void setFrame(final LightSheetManagerFrame frame) {
frame_ = Objects.requireNonNull(frame);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,12 @@ public void recalculateSliceTiming() {
// TODO: update gui (but not in the model)
}

public DefaultTimingSettings.Builder getTimingFromPeriodAndLightExposure() {
@Override
public void updateDurationLabels() {

}

public DefaultTimingSettings.Builder getTimingFromPeriodAndLightExposure() {
// uses algorithm Jon worked out in Octave code; each slice period goes like this:
// 1. camera readout time (none if in overlap mode, 0.25ms in pseudo-overlap)
// 2. any extra delay time
Expand Down
Loading
Loading