Skip to content

Commit

Permalink
Made simulation manual start only
Browse files Browse the repository at this point in the history
  • Loading branch information
MauveCloud committed Jul 9, 2015
1 parent e8edd99 commit 9fafaa2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ private
.idea
.project
.settings
composer.lock
composer.lock
nbproject/private/private.xml
4 changes: 0 additions & 4 deletions nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/E:/GitHub/Ic2ExpReactorPlanner/src/Ic2ExpReactorPlanner/TextureFactory.java</file>
<file>file:/E:/GitHub/Ic2ExpReactorPlanner/src/Ic2ExpReactorPlanner/ReactorPlannerFrame.java</file>
<file>file:/E:/GitHub/Ic2ExpReactorPlanner/src/Ic2ExpReactorPlanner/FuelRodMox.java</file>
<file>file:/E:/GitHub/Ic2ExpReactorPlanner/src/Ic2ExpReactorPlanner/ReactorComponent.java</file>
<file>file:/E:/GitHub/Ic2ExpReactorPlanner/src/Ic2ExpReactorPlanner/ComponentFactory.java</file>
<file>file:/E:/GitHub/Ic2ExpReactorPlanner/src/Ic2ExpReactorPlanner/CoolantCell360kNak.java</file>
</group>
</open-files>
</project-private>
6 changes: 3 additions & 3 deletions src/Ic2ExpReactorPlanner/ReactorPlannerFrame.form
Original file line number Diff line number Diff line change
Expand Up @@ -571,12 +571,12 @@
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="refrfeshSimulationButton">
<Component class="javax.swing.JButton" name="simulateButton">
<Properties>
<Property name="text" type="java.lang.String" value="Refresh Simulation"/>
<Property name="text" type="java.lang.String" value="Simulate"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="refreshSimulationButtonActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="simulateButtonActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
Expand Down
21 changes: 8 additions & 13 deletions src/Ic2ExpReactorPlanner/ReactorPlannerFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public void actionPerformed(ActionEvent e) {
}
reactorButtons[finalRow][finalCol].setBackground(Color.LIGHT_GRAY);
}
refreshSimulationButtonActionPerformed(null);
changingCode = true;
codeField.setText(reactor.getCode());
changingCode = false;
Expand All @@ -104,7 +103,6 @@ public void mouseClicked(MouseEvent e) {
reactorButtons[finalRow][finalCol].setIcon(null);
reactorButtons[finalRow][finalCol].setToolTipText(null);
reactorButtons[finalRow][finalCol].setBackground(Color.LIGHT_GRAY);
refreshSimulationButtonActionPerformed(null);
changingCode = true;
codeField.setText(reactor.getCode());
changingCode = false;
Expand Down Expand Up @@ -207,7 +205,7 @@ private void initComponents() {
euReactorRadio = new javax.swing.JRadioButton();
fluidReactorRadio = new javax.swing.JRadioButton();
clearGridButton = new javax.swing.JButton();
refrfeshSimulationButton = new javax.swing.JButton();
simulateButton = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
heatSpinner = new javax.swing.JSpinner();
maxHeatLabel = new javax.swing.JLabel();
Expand Down Expand Up @@ -510,17 +508,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
gridBagConstraints.insets = new java.awt.Insets(6, 6, 6, 6);
jPanel1.add(clearGridButton, gridBagConstraints);

refrfeshSimulationButton.setText("Refresh Simulation");
refrfeshSimulationButton.addActionListener(new java.awt.event.ActionListener() {
simulateButton.setText("Simulate");
simulateButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
refreshSimulationButtonActionPerformed(evt);
simulateButtonActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
gridBagConstraints.insets = new java.awt.Insets(6, 6, 6, 6);
jPanel1.add(refrfeshSimulationButton, gridBagConstraints);
jPanel1.add(simulateButton, gridBagConstraints);

jLabel1.setText("Initial Reactor Heat:");
gridBagConstraints = new java.awt.GridBagConstraints();
Expand Down Expand Up @@ -720,7 +718,7 @@ private void clearGridButtonActionPerformed(java.awt.event.ActionEvent evt) {//G
changingCode = false;
}//GEN-LAST:event_clearGridButtonActionPerformed

private void refreshSimulationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshSimulationButtonActionPerformed
private void simulateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_simulateButtonActionPerformed
SpinnerModel model = heatSpinner.getModel();
if (model instanceof SpinnerNumberModel) {
((SpinnerNumberModel) model).setMaximum(reactor.getMaxHeat());
Expand All @@ -738,16 +736,14 @@ private void refreshSimulationButtonActionPerformed(java.awt.event.ActionEvent e
tempReactor.setFluid(reactor.isFluid());
simulator = new Simulator(tempReactor, outputArea, reactorButtons, initialHeat, ((Number)timeSpinner.getValue()).intValue(), ((Number)nuclearControlSpinner.getValue()).intValue());
simulator.execute();
}//GEN-LAST:event_refreshSimulationButtonActionPerformed
}//GEN-LAST:event_simulateButtonActionPerformed

private void euReactorRadioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_euReactorRadioActionPerformed
reactor.setFluid(false);
refreshSimulationButtonActionPerformed(null);
}//GEN-LAST:event_euReactorRadioActionPerformed

private void fluidReactorRadioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fluidReactorRadioActionPerformed
reactor.setFluid(true);
refreshSimulationButtonActionPerformed(null);
}//GEN-LAST:event_fluidReactorRadioActionPerformed

private Simulator simulator;
Expand Down Expand Up @@ -781,7 +777,6 @@ private void updateReactorButtons() {
if (model instanceof SpinnerNumberModel) {
((SpinnerNumberModel) model).setMaximum(reactor.getMaxHeat());
}
refreshSimulationButtonActionPerformed(null);
}

/**
Expand Down Expand Up @@ -863,10 +858,10 @@ public void run() {
private javax.swing.JPanel reactorPanel;
private javax.swing.JToggleButton reactorPlatingButton;
private javax.swing.ButtonGroup reactorStyleGroup;
private javax.swing.JButton refrfeshSimulationButton;
private javax.swing.JMenuItem resourcePackItem;
private javax.swing.JToggleButton rshCondensatorButton;
private javax.swing.JLabel secondsLabel;
private javax.swing.JButton simulateButton;
private javax.swing.JPanel temperatureAndComponentsPanel;
private javax.swing.JLabel temperatureEffectsLabel;
private javax.swing.JToggleButton thickNeutronReflectorButton;
Expand Down

0 comments on commit 9fafaa2

Please sign in to comment.