summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-22 15:48:51 +0000
committerPaul Buetow <paul@buetow.org>2008-05-22 15:48:51 +0000
commit99fa4e29da7c3fa9df012378640442b59ebd1724 (patch)
tree3f316bf86837830aa5242ef0d99a2c0fd67b6709
parent68ca748737bbf5af57888872a9c072415e609d23 (diff)
Bugfix
-rw-r--r--sources/core/VSTask.java14
-rw-r--r--sources/simulator/VSSimulation.java9
-rw-r--r--sources/simulator/VSSimulatorFrame.java3
3 files changed, 22 insertions, 4 deletions
diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java
index 8f1e634..131cede 100644
--- a/sources/core/VSTask.java
+++ b/sources/core/VSTask.java
@@ -16,6 +16,8 @@ public class VSTask implements Comparable {
private VSPrefs prefs;
private boolean isProgrammed;
private boolean isGlobalTimed;
+ private static int taskCounter;
+ private int taskNum;
public VSTask(long taskTime, VSProcess process, VSEvent event, boolean isLocal) {
this.process = process;
@@ -23,8 +25,13 @@ public class VSTask implements Comparable {
this.event = event;
this.prefs = process.getPrefs();
this.isGlobalTimed = !isLocal;
+ this.taskNum = ++taskCounter;
}
+ public int getTaskNum() {
+ return taskNum;
+ }
+
public void isProgrammed(boolean isProgrammed) {
this.isProgrammed = isProgrammed;
}
@@ -34,11 +41,11 @@ public class VSTask implements Comparable {
}
public boolean isMessageReceiveEvent() {
- return event instanceof events.internal.MessageReceiveEvent;
+ return event instanceof MessageReceiveEvent;
}
public boolean isProcessRecoverEvent() {
- return event instanceof events.implementations.ProcessRecoverEvent;
+ return event instanceof ProcessRecoverEvent;
}
public boolean isProtocol(VSProtocol protocol) {
@@ -56,10 +63,13 @@ public class VSTask implements Comparable {
}
public boolean equals(VSTask task) {
+ return taskNum == task.getTaskNum();
+ /*
return event.equals(task.getEvent())
&& taskTime == task.getTaskTime()
&& isGlobalTimed == task.isGlobalTimed()
&& isProgrammed == task.isProgrammed;
+ */
}
public boolean isProcess(VSProcess process) {
diff --git a/sources/simulator/VSSimulation.java b/sources/simulator/VSSimulation.java
index 4da367b..4751f4a 100644
--- a/sources/simulator/VSSimulation.java
+++ b/sources/simulator/VSSimulation.java
@@ -896,12 +896,19 @@ public class VSSimulation extends JPanel {
/* addPanel */
localAddPanel.remove(2);
}
-
tabbedPane.setSelectedIndex(selectedIndex);
+ /* Update the 'Variables tab' */
+
+
+
/* Update the tools panel */
loggingPanel.remove(1);
loggingPanel.add(createToolsPanel(), BorderLayout.SOUTH);
updateUI();
}
+
+ public VSPrefs getPrefs() {
+ return prefs;
+ }
}
diff --git a/sources/simulator/VSSimulatorFrame.java b/sources/simulator/VSSimulatorFrame.java
index ee6f189..ea67bcf 100644
--- a/sources/simulator/VSSimulatorFrame.java
+++ b/sources/simulator/VSSimulatorFrame.java
@@ -161,8 +161,9 @@ public class VSSimulatorFrame extends VSFrame implements ActionListener {
JMenuItem globalPrefsItem = new JMenuItem(prefs.getString("lang.prefs"));
globalPrefsItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
+ VSPrefs simulationPrefs = currentSimulation.getPrefs();
new VSEditorFrame(prefs, VSSimulatorFrame.this,
- new VSSimulationEditor(prefs, VSSimulatorFrame.this,
+ new VSSimulationEditor(simulationPrefs, VSSimulatorFrame.this,
currentSimulation));
}
});