|
@@ -1,12 +1,19 @@
|
|
package holeg.ui;
|
|
package holeg.ui;
|
|
|
|
|
|
|
|
+import ui.controller.SimulationManager;
|
|
|
|
+import ui.controller.SingletonControl;
|
|
import ui.model.Model;
|
|
import ui.model.Model;
|
|
|
|
|
|
import javax.swing.*;
|
|
import javax.swing.*;
|
|
|
|
+import java.awt.event.ActionEvent;
|
|
|
|
+import java.awt.event.ActionListener;
|
|
|
|
|
|
public class PowerFlowAnalysisMenu extends JMenu {
|
|
public class PowerFlowAnalysisMenu extends JMenu {
|
|
private JMenuItem settingsMenu;
|
|
private JMenuItem settingsMenu;
|
|
private JMenuItem showFlow;
|
|
private JMenuItem showFlow;
|
|
|
|
+ private JMenuItem clearCache;
|
|
|
|
+ private JMenuItem solve;
|
|
|
|
+ private JCheckBoxMenuItem disableUpdates;
|
|
private JCheckBoxMenuItem showResultMessageBox;
|
|
private JCheckBoxMenuItem showResultMessageBox;
|
|
private JCheckBoxMenuItem showDebugMessageBox;
|
|
private JCheckBoxMenuItem showDebugMessageBox;
|
|
|
|
|
|
@@ -17,12 +24,25 @@ public class PowerFlowAnalysisMenu extends JMenu {
|
|
|
|
|
|
settingsMenu = add(new JMenuItem("Settings"));
|
|
settingsMenu = add(new JMenuItem("Settings"));
|
|
showFlow = add(new JMenuItem("Show flow table"));
|
|
showFlow = add(new JMenuItem("Show flow table"));
|
|
|
|
+ addSeparator();
|
|
|
|
+ clearCache = add(new JMenuItem("Clear cache"));
|
|
|
|
+ solve = add(new JMenuItem("Solve"));
|
|
|
|
+ addSeparator();
|
|
|
|
+ disableUpdates = (JCheckBoxMenuItem) add(new JCheckBoxMenuItem("Disable updates"));
|
|
showResultMessageBox = (JCheckBoxMenuItem) add(new JCheckBoxMenuItem("Show result message"));
|
|
showResultMessageBox = (JCheckBoxMenuItem) add(new JCheckBoxMenuItem("Show result message"));
|
|
showDebugMessageBox = (JCheckBoxMenuItem) add(new JCheckBoxMenuItem("Show debug message"));
|
|
showDebugMessageBox = (JCheckBoxMenuItem) add(new JCheckBoxMenuItem("Show debug message"));
|
|
|
|
|
|
|
|
+ clearCache.addActionListener((e) -> {
|
|
|
|
+ SingletonControl.getInstance().getControl().getSimManager().getHolegPowerFlowContext().clearCache();
|
|
|
|
+ });
|
|
|
|
+
|
|
instance = this;
|
|
instance = this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public boolean areUpdatesDisabled() {
|
|
|
|
+ return disableUpdates.getState();
|
|
|
|
+ }
|
|
|
|
+
|
|
public boolean shouldShowResult() {
|
|
public boolean shouldShowResult() {
|
|
return showResultMessageBox.getState();
|
|
return showResultMessageBox.getState();
|
|
}
|
|
}
|