diff --git a/README.md b/README.md index e90dd27..d05a9a5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# VILLASweb +# VILLASweb ## Description @@ -22,3 +22,37 @@ Additional libraries are used, for a complete list see package.json. To start the website locally run `npm start`. This will open a local webserver serving the _frontend_. To make the website work, you still need to start at least the VILLASweb-backend (See repository for information). +## Copyright + +2017, Institute for Automation of Complex Power Systems, EONERC + +## License + +This project is released under the terms of the [GPL version 3](COPYING.md). + +``` +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +``` + +For other licensing options please consult [Prof. Antonello Monti](mailto:amonti@eonerc.rwth-aachen.de). + +## Contact + +[![EONERC ACS Logo](doc/pictures/eonerc_logo.png)](http://www.acs.eonerc.rwth-aachen.de) + + - Markus Grigull + +[Institute for Automation of Complex Power Systems (ACS)](http://www.acs.eonerc.rwth-aachen.de) +[EON Energy Research Center (EONERC)](http://www.eonerc.rwth-aachen.de) +[RWTH University Aachen, Germany](http://www.rwth-aachen.de) \ No newline at end of file diff --git a/doc/pictures/eonerc_logo.png b/doc/pictures/eonerc_logo.png new file mode 100644 index 0000000..81c3ad0 Binary files /dev/null and b/doc/pictures/eonerc_logo.png differ diff --git a/doc/villasweb.png b/doc/pictures/villas_web.png similarity index 100% rename from doc/villasweb.png rename to doc/pictures/villas_web.png diff --git a/doc/villasweb.svg b/doc/pictures/villas_web.svg similarity index 100% rename from doc/villasweb.svg rename to doc/pictures/villas_web.svg diff --git a/src/stores/simulator-store.js b/src/stores/simulator-store.js index 69303b3..9f430ef 100644 --- a/src/stores/simulator-store.js +++ b/src/stores/simulator-store.js @@ -20,8 +20,30 @@ class SimulatorStore extends ArrayStore { var simulator; switch (action.type) { + + case 'simulators/added': + SimulatorsDataManager.startRunningDetection(action.data); + + return super.reduce(state, action); + + case 'simulators/removed': + SimulatorsDataManager.stopRunningDetection(action.original); + + return super.reduce(state, action); + + case 'simulators/start-edit': + // An update will be requested, stop the 'runningDetection' already + SimulatorsDataManager.stopRunningDetection(action.data); + + return super.reduce(state, action); + + case 'simulators/edited': + // The update was done, resume the 'runningDetection' + SimulatorsDataManager.startRunningDetection(action.data); + + return super.reduce(state, action); + case 'simulators/loaded': - //case 'simulators/is-running': // get simulator running state if (Array.isArray(action.data)) { action.data.forEach((simulator) => { @@ -35,12 +57,10 @@ class SimulatorStore extends ArrayStore { case 'simulators/running': // check if simulator running state changed - simulator = state.find(element => { - return element._id === action.simulator._id; - }); + simulator = state.find(element => element._id === action.simulator._id ); - // only update if state changed - if (simulator.running == null || simulator.running !== action.simulator.running) { + // is this simulator still in the state? update it only if state changed + if (simulator && simulator.running !== action.simulator.running) { state = this.updateElements(state, [ action.simulator ]); }