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
10 changes: 8 additions & 2 deletions how-to-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ C:\Program Files\Micro-Manager-2.0\plugins\Micro-Manager\MMJ_.jar

The jar is not tracked by this repository, so it is not updated for you. Copy it again after upgrading Micro-Manager, or the plugin will be built against an older java layer than the one it runs in. A Micro-Manager 1.4 installation also contains an `MMJ_.jar`; it is a different artifact and will not work here.

To build, run `mvn clean package` from the `LightSheetManager`. The resultant jar will be available in the `LightSheetManager/target` folder, and then must be manually copied into the `Micro-manager/mmplugins`. Currently, the automated tests are throwing an error. In the case the tests can be skipped adnt the plugin built with `mvn clean package -Dmaven.test.skip`.
Building requires JDK 11: the pom's enforcer plugin fails the build on any other JDK, so a jar cannot silently be produced by the wrong toolchain. If the `java` on your PATH or your `JAVA_HOME` is newer, point `JAVA_HOME` at a JDK 11 for the build shell, for example on Windows PowerShell:

Doing this requires having Maven installed. Most IDEs have a Maven plugin that can accomplish the same thing as the manual way above.
```
$env:JAVA_HOME = 'C:\Program Files\Eclipse Adoptium\jdk-11.0.31.11-hotspot'
```

To build, run `mvn clean package` from the `LightSheetManager` directory. The resultant jar will be available in the `LightSheetManager/target` folder, and then must be manually copied into the `Micro-manager/mmplugins`. The build runs no automated tests. The first build on a machine must be run online so Maven can download the build plugins; after that `mvn -o clean package` works offline.

Doing this requires having Maven installed. Most IDEs have a Maven plugin that can accomplish the same thing as the manual way above.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class LightSheetManagerPlugin implements MenuPlugin, SciJavaPlugin {
public static final String copyright = "Applied Scientific Instrumentation (ASI), 2022-2026";
public static final String description = "A plugin to control various types of light sheet microscopes.";
public static final String menuName = "Light Sheet Manager";
public static final String version = "0.8.11";
public static final String version = "0.8.12";

private Studio studio_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ public ChannelTable(final LightSheetManager model) {

// set the channel group first to get the correct channel array
final String channelGroup = model_.acquisitions().settings().channels().group();
final ChannelSpec[] channels = model_.acquisitions().settings().channels().used();
final ChannelSpec[] channels = model_.acquisitions().settings().channels().data();

tableData_ = new ChannelTableData(channelGroup, channels);
tableModel_ = new ChannelTableModel(tableData_,
() -> model_.acquisitions().updateDurationLabels());
tableModel_ = new ChannelTableModel(tableData_, () -> {
// Push every row, used and unused, so the edit reaches the builder. The table's rows are
// not always the objects the builder holds, so an unpushed edit can be lost.
model_.acquisitions().settingsBuilder()
.channelBuilder().data(tableData_.getChannels());
model_.acquisitions().updateDurationLabels();
});
table_ = new JTable(tableModel_);

// init presets combo box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ public class ChannelTableModel extends AbstractTableModel {
};

private final ChannelTableData data_;
private final Runnable onUseToggled_;

public ChannelTableModel(final ChannelTableData tableData, final Runnable onUseToggled) {
/** Runs after any accepted cell edit, to commit the table into the settings. */
private final Runnable onEdit_;

public ChannelTableModel(final ChannelTableData tableData, final Runnable onEdit) {
data_ = Objects.requireNonNull(tableData);
onUseToggled_ = Objects.requireNonNull(onUseToggled);
onEdit_ = Objects.requireNonNull(onEdit);
}

public void addEmptyChannel() {
Expand Down Expand Up @@ -99,7 +101,6 @@ public void setValueAt(Object value, int row, int col) {
case COLUMN_USE:
if (value instanceof Boolean) {
channelSpec.setUsed((boolean) value);
onUseToggled_.run(); // update durations
} else {
return; // early exit => wrong type
}
Expand All @@ -122,6 +123,9 @@ public void setValueAt(Object value, int row, int col) {
throw new IllegalArgumentException("Invalid column index: " + col);
}

// commit the edit; the wrong type cases above return before reaching this
onEdit_.run();

// update the table ui
fireTableCellUpdated(row, col);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void createEventHandlers() {
model_.acquisitions().settingsBuilder().channelBuilder().group(channelGroup);
model_.acquisitions().updateSettings();
// update the table data model and refresh ui
table_.getData().setChannels(channelGroup, model_.acquisitions().settings().channels().used());
table_.getData().setChannels(channelGroup, model_.acquisitions().settings().channels().data());
table_.getData().setChannelGroup(channelGroup);
table_.refreshData();
// a different group can select a different number of channels, which changes the duration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ public enum Preset {
BNC3_SOURCE_CELL_11("35 - BNC3 source = cell 11", 35),
CELL_10_EQ_CELL_8("36 - cell 10 = cell 8", 36),
BNC1_8_ON_17_24("51 - cells 17-24 on BNC1-8", 51),
BNC3_SOURCE_TTL5("52 - BNC3 source = TTL5", 52);
BNC3_SOURCE_TTL5("52 - BNC3 source = TTL5", 52),
MOD3_COUNTER_RESETTABLE("60 - mod3 counter", 60);

private final String text_;
private final int code_;
Expand Down
Loading