= VIS Model Plotter = == Quick manual == [[http://klog.icrr.u-tokyo.ac.jp/osl/?r=9875|klog9875]] == Software management == Model plotter is managed by {{{supervisord}}} on {{{k1script}}}. Basically, applications managed by {{{supervisor}}} are automatically launched when {{{k1script}}} boots up and they are automatically re-launched when they hang up. * If you update vis_plotter code, please restart the process by following command. {{{ k1script> sudo supervisorctl restart vis_plotter }}} * Configuration file for supervisord (Maybe it is not needed to touch for many people.) {{{ k1script> cat /etc/supervisor/conf.d/k1vis.conf [program:vis_plotter] user=controls command=bash -c 'cd /kagra/Drobbox/Subsystems/VIS/Scripts/VISapp && /usr/bin/python3 manage.py 0.0.0.0:8000' autorestart=true autostart=true redirect_stderr=true stdout_logfile=/tmp/vis_plotter.log }}} * Management commands {{{ k1script> sudo supervisorctl start vis_plotter # <- Start model plotter k1script> sudo supervisorctl stop vis_plotter # <- Stop model plotter k1script> sudo supervisorctl restart vis_plotter # <- Restart model plotter k1script> sudo supervisorctl status vis_plotter # <- Check run status k1script> sudo supervisorctl tail vis_plotter # <- Check error log }}} === Trouble shooting === * If model_plotter returns some error, please check application processes on k1script. * Running only 3 processes is the correct situation. {{{ k1script> ps -ef | grep [m]anage controls 26477 1212 0 09:48 ? 00:00:00 bash -c cd /kagra/Dropbox/Subsystems/VIS/Scripts/VISapp && /usr/bin/python3 manage.py runserver 0.0.0.0:8000 controls 26478 26477 0 09:48 ? 00:00:00 /usr/bin/python3 manage.py runserver 0.0.0.0:8000 controls 26486 26478 1 09:48 ? 00:00:13 /usr/bin/python3 manage.py runserver 0.0.0.0:8000 }}} * If more than 3 processes are running, please kill all once and relaunch. {{{ k1script> sudo supervisorctl stop vis_plotter k1script> pkill -KILL manage.py k1script> sudo supervisorctl start vis_plotter }}} == Developer manual == === Script to activate the web app === The web app is written in Django powered by python. <
> The server is run by python3 in k1script. <
> The directory where the web app script (manage.py for Django) exit is {{{ /kagra/Dropbox/Subsystems/VIS/Scripts/VISapp }}} === Script for Model Plotter === The script for model plotter is in {{{./ModelPlotter}}} and {{{./lib}}}. * ./ModelPlotter There are the script to define the web app functions. The html script is {{{./ModelPlotter/templates/index.html}}}.<
> The script to define the function of the button in the web page is {{{./ModelPlotter/views.py}}}. * ./lib The function to call zpk expression, and to plot the figure is defined in {{{./lib/plotter.py}}}.<
> It will import matlab engine to access MATLAB function. (It is planned to be converted to full python script.)<
> The space state model is read from {{{/kagra/Dropbox/Subsystems/VIS/Scripts/SuspensionControlModel/script/SUS}}}.