Skip to content

Commit

Permalink
Merge pull request micro-manager#1975 from nicost/mdaSettings
Browse files Browse the repository at this point in the history
Studio: now actually saves MDA Settings in file.
  • Loading branch information
nicost authored Jun 17, 2024
2 parents 7d8d042 + e0406d6 commit 09d0f12
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,20 @@ protected JsonElement convertToGson(PropertyMap pmap) {
}
},

MDA_SETTINGS("MdaSettings", SequenceSettings.class),
MDA_SETTINGS("MdaSettings", SequenceSettings.class) {
@Override
protected void convertFromGson(JsonElement je, PropertyMap.Builder dest) {
dest.putString(key(), je.getAsString());
}

@Override
protected JsonElement convertToGson(PropertyMap pmap) {
if (pmap.containsKey(key())) {
return new JsonPrimitive(pmap.getString(key(), null));
}
return null;
}
},

METADATA_VERSION("MetadataVersion", SummaryMetadata.class) {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import static org.micromanager.data.internal.PropertyKey.INTERVAL_MS;
import static org.micromanager.data.internal.PropertyKey.KEEP_SHUTTER_OPEN_CHANNELS;
import static org.micromanager.data.internal.PropertyKey.KEEP_SHUTTER_OPEN_SLICES;
import static org.micromanager.data.internal.PropertyKey.MDA_SETTINGS;
import static org.micromanager.data.internal.PropertyKey.METADATA_VERSION;
import static org.micromanager.data.internal.PropertyKey.MICRO_MANAGER_VERSION;
import static org.micromanager.data.internal.PropertyKey.MULTI_STAGE_POSITION__DEFAULT_XY_STAGE;
Expand Down Expand Up @@ -275,6 +276,7 @@ public PropertyMap fromGson(JsonElement je) {
STAGE_POSITIONS,
KEEP_SHUTTER_OPEN_SLICES,
KEEP_SHUTTER_OPEN_CHANNELS,
MDA_SETTINGS,
PIXEL_TYPE, // Needed due to MultipageTiffReader design
USER_DATA)) {
key.extractFromGsonObject(je.getAsJsonObject(), builder);
Expand Down Expand Up @@ -309,6 +311,7 @@ public void addToGson(JsonObject jo, PropertyMap pmap) {
STAGE_POSITIONS,
KEEP_SHUTTER_OPEN_SLICES,
KEEP_SHUTTER_OPEN_CHANNELS,
MDA_SETTINGS,
PIXEL_TYPE, // compat
WIDTH, // compat
HEIGHT, // compat
Expand Down

0 comments on commit 09d0f12

Please sign in to comment.