From e52406bc886ddaab10a49b4a513facb9dc38209d Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Tue, 22 Nov 2022 18:02:36 +0100 Subject: [PATCH] only display info message if the system uses ARM64 achitecture --- .../DeepLearningVersionSelector.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main/java/plugins/danyfel80/deeplearningdownloader/DeepLearningVersionSelector.java b/src/main/java/plugins/danyfel80/deeplearningdownloader/DeepLearningVersionSelector.java index 2b6d9c3..7dbf7c0 100644 --- a/src/main/java/plugins/danyfel80/deeplearningdownloader/DeepLearningVersionSelector.java +++ b/src/main/java/plugins/danyfel80/deeplearningdownloader/DeepLearningVersionSelector.java @@ -6,6 +6,7 @@ import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; +import org.bioimageanalysis.icy.deeplearning.system.PlatformDetection; import org.bioimageanalysis.icy.deeplearning.utils.Constants; import org.bioimageanalysis.icy.deeplearning.versionmanagement.AvailableDeepLearningVersions; import org.bioimageanalysis.icy.deeplearning.versionmanagement.DeepLearningVersion; @@ -72,15 +73,20 @@ public class DeepLearningVersionSelector extends EzPlug implements EzStoppable, @Override protected void initialize() { - MessageDialog.showDialog("ARM64 chips and compatiblity with Deep Learnign engines", - "This computer uses the ARM64 chip architecture. This architecture" + System.lineSeparator() - + "is relatively recent, therefore many of the existing Deep Learning" + System.lineSeparator() - + "engines will not be available on your computer." + System.lineSeparator() - + "ARM64 chips also provide the possibility of running some x86_64" + System.lineSeparator() - + "compiled programs using Rosetta. In order to enable Rosetta, change" + System.lineSeparator() - + "the JAVA_HOME variable to a Java 8 or lower. Using Rosetta will" + System.lineSeparator() - + "enable more Deep Learning engines, but there will be some still missing." + System.lineSeparator() - + "For more information, go to the Wiki: " + System.lineSeparator() + Constants.WIKI_LINK, MessageDialog.INFORMATION_MESSAGE); + if (new PlatformDetection().getOs().equals(PlatformDetection.ARCH_ARM64)) { + MessageDialog.showDialog("ARM64 chips and compatiblity with Deep Learnign engines", + "This computer uses the ARM64 chip architecture. This architecture" + System.lineSeparator() + + "is relatively recent, therefore many of the existing Deep Learning" + System.lineSeparator() + + "engines will not be available on your computer." + System.lineSeparator() + + "ARM64 chips also provide the possibility of running some x86_64" + System.lineSeparator() + + "compiled programs using Rosetta. In order to enable Rosetta, change" + System.lineSeparator() + + "the JAVA_HOME variable to a Java 8 or lower. Currently, the JAVA_HOME" + System.lineSeparator() + + "points to:" + System.lineSeparator() + System.getProperty("java.home") + System.lineSeparator() + + "Using Rosetta will enable more Deep Learning engines, although some" + System.lineSeparator() + + "will still be missing." + System.lineSeparator() + + "For more information, go to the Wiki: " + System.lineSeparator() + Constants.WIKI_LINK, + MessageDialog.INFORMATION_MESSAGE); + } String[] versionStrings = versions.keySet().stream().sorted().toArray(String[]::new); varInVersion = new EzVarText("Version", versionStrings, getDefaultVersionIndex(versionStrings), false); addEzComponent(varInVersion); -- GitLab