Differences between revisions 3 and 4
Revision 3 as of 2019-10-08 12:00:53
Size: 1639
Editor: AyakaShoda
Comment:
Revision 4 as of 2019-10-08 13:21:14
Size: 2393
Editor: AyakaShoda
Comment:
Deletions are marked like this. Additions are marked like this.
Line 40: Line 40:
 The web app is written in Django powered by python. <<BR>
 The server is run by python3 in k1script. <<BR>

 The directory where the web app script exit is
 The web app is written in Django powered by python. <<BR>>
 The server is run by python3 in k1script. <<BR>>
<<BR>>
 The directory where the web app script (manage.py for Django) exit is
Line 46: Line 46:
=== 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}}}.<<BR>>
   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}}}.<<BR>>
   It will import matlab engine to access MATLAB function. (It is planned to be converted to full python script.)<<BR>>
   The space state model is read from {{{/kagra/Dropbox/Subsystems/VIS/Scripts/SuspensionControlModel/script/SUS}}}.

VIS Model Plotter

Quick manual

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

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.

KAGRA/Subgroups/VIS/ModelPlotter (last edited 2021-02-19 10:11:34 by TakahiroYamamoto)