Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
bdb57f19
Commit
bdb57f19
authored
Jul 17, 2017
by
Tatiana Chuprina
Browse files
Bug in StepBack button is solved.
refs 2991
parent
4641cabb
Changes
3
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.component.ui/trunk/src/org/fortiss/af3/component/ui/simulator/SimulationManager.java
View file @
bdb57f19
...
...
@@ -263,12 +263,14 @@ public class SimulationManager extends Observable {
if
(
currentSimulation
==
null
)
{
return
;
}
fireSimulationEvent
(
SIMULATION_ABOUT_TO_STEP_BACK_EVENT
);
performingStep
=
true
;
try
{
currentSimulation
.
restoreState
();
}
catch
(
ExecutionException
ex
)
{
lastException
=
ex
;
if
(
simulationThread
!=
null
)
{
fireSimulationEvent
(
SIMULATION_ABOUT_TO_STEP_BACK_EVENT
);
performingStep
=
true
;
try
{
currentSimulation
.
restoreState
();
}
catch
(
ExecutionException
ex
)
{
lastException
=
ex
;
}
}
performingStep
=
false
;
fireSimulationEvent
(
SIMULATION_STEPPED_BACK_EVENT
);
...
...
org.fortiss.af3.component.ui/trunk/src/org/fortiss/af3/component/ui/simulator/SimulationView.java
View file @
bdb57f19
...
...
@@ -183,6 +183,9 @@ public class SimulationView extends ViewPart implements IPropertyListener, Event
updateActions
();
}
else
if
(
propId
==
SimulationManager
.
SIMULATION_INITIALIZED_EVENT
)
{
((
StepCounterContributionItem
)
SimulationView
.
this
.
stepCounter
).
resetCounter
();
updateActions
();
}
else
if
(
propId
==
SimulationManager
.
SIMULATION_STEPPED_BACK_EVENT
)
{
updateActions
();
}
}
}
...
...
@@ -267,7 +270,9 @@ public class SimulationView extends ViewPart implements IPropertyListener, Event
}
else
{
simulationViewActionsInstance
.
pause
.
setEnabled
(
false
);
simulationViewActionsInstance
.
performStep
.
setEnabled
(
true
);
simulationViewActionsInstance
.
performStepBack
.
setEnabled
(
true
);
boolean
enableBack
=
((
StepCounterContributionItem
)
SimulationView
.
this
.
stepCounter
).
stepCount
==
0
;
simulationViewActionsInstance
.
performStepBack
.
setEnabled
(!
enableBack
);
simulationViewActionsInstance
.
run
.
setEnabled
(
true
);
}
simulationViewActionsInstance
.
initialize
.
setEnabled
(
true
);
...
...
@@ -313,8 +318,9 @@ public class SimulationView extends ViewPart implements IPropertyListener, Event
performStep
=
new
Action
()
{
@Override
public
void
run
()
{
SimulationManager
.
INSTANCE
.
performStep
();
((
StepCounterContributionItem
)
SimulationView
.
this
.
stepCounter
).
incCounter
();
SimulationManager
.
INSTANCE
.
performStep
();
SimulationManager
.
INSTANCE
.
showLastErrorMessage
();
}
};
...
...
@@ -325,8 +331,8 @@ public class SimulationView extends ViewPart implements IPropertyListener, Event
performStepBack
=
new
Action
()
{
@Override
public
void
run
()
{
SimulationManager
.
INSTANCE
.
performStepBack
();
((
StepCounterContributionItem
)
SimulationView
.
this
.
stepCounter
).
decCounter
();
SimulationManager
.
INSTANCE
.
performStepBack
();
SimulationManager
.
INSTANCE
.
showLastErrorMessage
();
}
};
...
...
@@ -502,12 +508,9 @@ public class SimulationView extends ViewPart implements IPropertyListener, Event
public
void
incCounter
()
{
stepCount
++;
if
(!
stepCounterText
.
isDisposed
())
{
stepCounterText
.
getDisplay
().
syncExec
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(!
stepCounterText
.
isDisposed
())
{
stepCounterText
.
setText
(
String
.
valueOf
(
stepCount
));
}
stepCounterText
.
getDisplay
().
syncExec
(()
->
{
if
(!
stepCounterText
.
isDisposed
())
{
stepCounterText
.
setText
(
String
.
valueOf
(
stepCount
));
}
});
}
...
...
@@ -518,12 +521,9 @@ public class SimulationView extends ViewPart implements IPropertyListener, Event
if
(
stepCount
!=
0
)
{
stepCount
--;
if
(!
stepCounterText
.
isDisposed
())
{
stepCounterText
.
getDisplay
().
syncExec
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(!
stepCounterText
.
isDisposed
())
{
stepCounterText
.
setText
(
String
.
valueOf
(
stepCount
));
}
stepCounterText
.
getDisplay
().
syncExec
(()
->
{
if
(!
stepCounterText
.
isDisposed
())
{
stepCounterText
.
setText
(
String
.
valueOf
(
stepCount
));
}
});
}
...
...
org.fortiss.af3.component/trunk/src/org/fortiss/af3/component/simulator/ExecutableComponent.java
View file @
bdb57f19
...
...
@@ -592,7 +592,6 @@ public abstract class ExecutableComponent<S extends IModelElementSpecification>
extendedDataHistory
.
addLast
(
new
HashMap
<>(
extendedData
));
externalStateHistory
.
addLast
(
new
HashMap
<>(
externalState
));
externallySetHistory
.
addLast
(
new
HashSet
<>(
externallySet
));
// System.out.println(modelElement.getName() + ": " + externallySet.size() + " backuped.");
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment