From db2e32dfa324dcf8fe5178a88c08ee68533b8ab8 Mon Sep 17 00:00:00 2001 From: Sebastian Krings <sebastian@krin.gs> Date: Mon, 20 Apr 2015 11:49:54 +0200 Subject: [PATCH] improve error message --- .../core/command/LoadEventBModelCommand.java | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/de.prob.core/src/de/prob/core/command/LoadEventBModelCommand.java b/de.prob.core/src/de/prob/core/command/LoadEventBModelCommand.java index 7a95e7d7..0c3c055d 100644 --- a/de.prob.core/src/de/prob/core/command/LoadEventBModelCommand.java +++ b/de.prob.core/src/de/prob/core/command/LoadEventBModelCommand.java @@ -6,15 +6,24 @@ package de.prob.core.command; -import java.util.*; - -import org.eventb.core.*; -import org.osgi.service.prefs.*; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import org.eventb.core.IContextRoot; +import org.eventb.core.IEventBRoot; +import org.eventb.core.IMachineRoot; +import org.osgi.service.prefs.BackingStoreException; +import org.osgi.service.prefs.Preferences; import org.rodinp.core.RodinDBException; -import de.prob.core.*; +import de.prob.core.Animator; +import de.prob.core.LanguageDependendAnimationPart; import de.prob.core.command.internal.InternalLoadCommand; -import de.prob.core.domainobjects.*; +import de.prob.core.domainobjects.MachineDescription; +import de.prob.core.domainobjects.Operation; +import de.prob.core.domainobjects.ProBPreference; +import de.prob.core.domainobjects.State; import de.prob.core.langdep.EventBAnimatorPart; import de.prob.exceptions.ProBException; import de.prob.logging.Logger; @@ -88,7 +97,19 @@ public final class LoadEventBModelCommand { Operation.NULL_OPERATION); if (commandResult.isTimeoutOccured() && context) { - final String message = "A timeout occured when finding constants. Typically this means, that your axioms are too complicated for automatical solving. You might create an animation refinement using the context menu to help ProB finding a solution."; + final String message; + int solsFound = explore.getState().getEnabledOperations().size(); + if (solsFound > 0) { + message = "A timeout occured when finding constants after finding " + + solsFound + + " solution(s)." + + " Typically this means, that your axioms are too complicated for automatical solving. " + + "You might create an animation refinement using the context menu to help ProB finding all solutions."; + } else { + message = "A timeout occured when finding constants." + + " Typically this means, that your axioms are too complicated for automatical solving. " + + "You might create an animation refinement using the context menu to help ProB finding a solution."; + } Logger.notifyUserWithoutBugreport(message); } -- GitLab