NestDAQ control commands

  • init.sh で web-daqctl プロセスを立ち上げ、http://localhost:8080 というページをブラウザで開き、ソースコード内の JavaScript を見ると、ws:/ /localhost:8080 という web socket を作り、そこに redis-get, redis-publish というようなメッセージを送っているように見える。さらに、これらのメッセージは web-daqctl プロセスに送られている模様。web-daqctl では、 nestdaq/controller/WebGUI.cxx 内でメッセージに応じて処理が行われているようだ。処理されたメッセージはここから redis に投げられている模様。このメッセージを確認するには、WebGUI.cxx のソースコードを読めばわかるはずであるが、それは辛いので、以下のように、redis の monitor コマンドを使う。
  • NestDAQの control command を確認
    • まず、redis のコマンドとして何が打たれているか確認。redis-cli monitor というコマンドを打つと、以下のようにだらだらとメッセージが流れる。
      [nestdaq@e50server03 ~]$ redis-cli monitor
      OK
      1713537985.502736 [0 127.0.0.1:40012] "SCAN" "0" "MATCH" "daq_service:*:*:fair-mq-state" "COUNT" "10"
      1713537985.502940 [0 127.0.0.1:40012] "SCAN" "14" "MATCH" "daq_service:*:*:fair-mq-state" "COUNT" "10"
      1713537986.002429 [0 127.0.0.1:40012] "SCAN" "0" "MATCH" "daq_service:*:*:fair-mq-state" "COUNT" "10"
      ...
    • この状態で、ブラウザ上で ボタンをぽちぽち打つと、redis に入力されるコマンドが表示される。以下のようなもの。
      < Send button >
      1713539529.809137 [0 127.0.0.1:47006] "SET" "run_info:run_number" "263"
      1713539529.809520 [0 127.0.0.1:47006] "GET" "run_info:run_number"
      1713539529.809805 [0 127.0.0.1:47006] "GET" "run_info:latest_run_number"
      
      < +1 button >
      1713539534.315874 [0 127.0.0.1:47006] "INCR" "run_info:run_number"
      
      < Get button >
      1713539536.085239 [0 127.0.0.1:47006] "GET" "run_info:run_number"
      1713539536.085596 [0 127.0.0.1:47006] "GET" "run_info:latest_run_number"
      
      
      1713539722.530079 [0 127.0.0.1:47006] "GET" "run_info:run_number"
      1713539722.530226 [0 127.0.0.1:47006] "SET" "run_info:latest_run_number" "265"
      1713539722.530416 [0 127.0.0.1:47006] "GET" "run_info:wait-device-ready"
      1713539722.530479 [0 127.0.0.1:47006] "GET" "run_info:wait-ready"
      1713539722.530663 [0 127.0.0.1:47006] "PUBLISH" "daqctl" "{\n    \"command\": \"change_state\",\n    \"value\": \"CONNECT\",\n    \"services\": [\n        \"all\"\n    ],\n    \"instances\": [\n        \"all\"\n    ]\n}\n"
      
      
      1713539722.530951 [0 127.0.0.1:47006] "PUBLISH" "daqctl" "{\n    \"command\": \"change_state\",\n    \"value\": \"INIT TASK\",\n    \"services\": [\n        \"all\"\n    ],\n    \"instances\": [\n        \"all\"\n    ]\n}\n"
      
      1713539722.533006 [0 127.0.0.1:47006] "PUBLISH" "daqctl" "{\n    \"command\": \"change_state\",\n    \"value\": \"RUN\",\n    \"services\": [\n        \"all\"\n    ],\n    \"instances\": [\n        \"all\"\n    ]\n}\n"
      
      1713539724.671244 [0 127.0.0.1:47006] "INCR" "run_info:run_number"
      1713539724.671820 [0 127.0.0.1:47006] "GET" "run_info:wait-device-ready"
      1713539724.671970 [0 127.0.0.1:47006] "GET" "run_info:wait-ready"
      1713539724.674011 [0 127.0.0.1:47006] "PUBLISH" "daqctl" "{\n    \"command\": \"change_state\",\n    \"value\": \"STOP\",\n    \"services\": [\n        \"all\"\n    ],\n    \"instances\": [\n        \"all\"\n    ]\n}\n"
      
      1713539725.845758 [0 127.0.0.1:47006] "GET" "run_info:wait-device-ready"
      1713539725.845906 [0 127.0.0.1:47006] "GET" "run_info:wait-ready"
      1713539725.846201 [0 127.0.0.1:47006] "PUBLISH" "daqctl" "{\n    \"command\": \"change_state\",\n    \"value\": \"RESET TASK\",\n    \"services\": [\n        \"all\"\n    ],\n    \"instances\": [\n        \"all\"\n    ]\n}\n"
      
      1713539727.075753 [0 127.0.0.1:47006] "GET" "run_info:wait-device-ready"
      1713539727.075913 [0 127.0.0.1:47006] "GET" "run_info:wait-ready"
      1713539727.076159 [0 127.0.0.1:47006] "PUBLISH" "daqctl" "{\n    \"command\": \"change_state\",\n    \"value\": \"RESET DEVICE\",\n    \"services\": [\n        \"all\"\n    ],\n    \"instances\": [\n        \"all\"\n    ]\n}\n"
      
      1713540107.224486 [0 127.0.0.1:47006] "GET" "run_info:wait-device-ready"
      1713540107.224659 [0 127.0.0.1:47006] "GET" "run_info:wait-ready"
      1713540107.224931 [0 127.0.0.1:47006] "PUBLISH" "daqctl" "{\n    \"command\": \"change_state\",\n    \"value\": \"END\",\n    \"services\": [\n        \"all\"\n    ],\n    \"instances\": [\n        \"all\"\n    ]\n}\n"
softwares/nestdaq/web_control.txt · 最終更新: 2024/04/20 01:22 by kobayash
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0