softwareschneiderei / bwinpro

FVA-BW-Fork of the tree growth simulator BWINPro
GNU General Public License v2.0
3 stars 1 forks source link

Climate-sensitive simulation in dynamic mode sometimes not works #6

Closed simschul closed 5 years ago

simschul commented 5 years ago

BWIN-Pro 7.8-0.7

Describe the bug

The climate-sensitive simulation in the dynamic mode does not work when program has just been started. However, if simulations in the batch mode have been run before, everything works fine

To Reproduce Steps to reproduce the behavior:

  1. Start BWIN
  2. Stand --> New --> Create Stand ....
  3. Check the box "Climate-Sensitive"
  4. Start Simulation (--> Nothing happens, output in the IDE see below)
  5. Also not working: Edit --> Stand Data

However, if I load a stand from an access database, run simulations on this, and THEN follow again steps 2 - 5 the problem does not occur anymore.

Desktop (please complete the following information):


Output IDE

Create area0.2 2018-09-12 14:44:57 FINE forestsimulator.util.StopWatch printElapsedTime Update view: 0 ms passed. 2018-09-12 14:44:59 FINE forestsimulator.util.StopWatch printElapsedTime Update view: 85 ms passed. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at forestsimulator.dbaccess.DatabaseEnvironmentalDataProvider.environmentalDataFor(DatabaseEnvironmentalDataProvider.java:46) at forestsimulator.standsimulation.TgTreatmentMan3.startSimulationButtonActionPerformed(TgTreatmentMan3.java:388) at forestsimulator.standsimulation.TgTreatmentMan3.access$000(TgTreatmentMan3.java:54) at forestsimulator.standsimulation.TgTreatmentMan3$1.actionPerformed(TgTreatmentMan3.java:192) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6533) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6298) at java.awt.Container.processEvent(Container.java:2237) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2295) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467) at java.awt.Container.dispatchEventImpl(Container.java:2281) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

miq commented 5 years ago

Currently, a new stand does not have a location. That is why the climate data cannot be obtained. How/where should we enter the location information?

miq commented 5 years ago

Currently the location can be updated in the stand data dialog.

miq commented 5 years ago

There is no GUI for setting the federal state, so for interactive simulations BW is assumed.

miq commented 5 years ago

I have added controls to the new stand dialog to select a stand location from the values in the climate database. So this location can be used in the interactive simulation.