Skip to content

chirimenPanel.html

Akihiko.KIgure edited this page Nov 22, 2025 · 4 revisions

画面

root

スクリーンショット 2025-11-22 16 31 22

setup chirimen

スクリーンショット 2025-11-22 16 36 01 スクリーンショット 2025-11-22 16 35 23

i2cdetect

スクリーンショット 2025-11-22 16 34 27

get Example

スクリーンショット 2025-11-22 16 36 45

Resident App Conf.

スクリーンショット 2025-11-22 16 37 35

onload

  • 各種定義
    window.addEventListener("message", receiveMessage, false);
    portWritelnWaitfor = window.opener.portWritelnWaitfor;
    getOutputLines = function (inp) {
      var ret = window.opener.getOutputLines(inp);
      console.log(ret);
      return ret;
    };
    cmdPrompt = window.opener.cmdPrompt;
    mv = window.opener.mv;
    cp = window.opener.cp;
    showDir = window.opener.showDir;
    

sleep

  • スリープ関数定義

setupChirimen

  • getOutputLines
    • ディレクトリ変更
    • セットアップ用ディレクトリ作成
    • セットアップ用ディレクトリ移動
    • Node 関連
      • Node バージョン指定
      • インストールディストリビューション指定
      • 上記指定の Node の tar.xz を wget で、取得
      • 取得した Node インストーラーのディレクトリに移動
      • .profile に Node のバージョンを書き込み
      • ルートに移動
      • Node のバージョンを確認
    • カメラ関連
      • カメラのセットアップ
      • forever で、Node.js アプリを Linux 環境で常駐化させる

buildChirimenDevDir

  • getOutputLines
    • CHIRIMEN App 用ディレクトリ作成
    • CHIRIMEN App 用ディレクトリ移動
    • Pi Zero 用 package.json を wget で、取得
    • Pi Zero 用 /RelayServer.js を wget で、取得
    • npm install

i2cdetect

  • getOutputLines
    • i2c 検出コマンド実行

examplePanel

  • getOutputLines
    • CHIRIMEN example ページを iframe で、表示

receiveMessage

  • getOutputLines
    • CHIRIMEN example ページのサンプルのソースの tar.xz を wget で、取得
  • showDir
    • showDir = window.opener.showDir;

getJsApps

  • getOutputLines
    • CHIRIMEN App 用ディレクトリ移動
  • showDir
    • showDir = window.opener.showDir;
  • ファイルを取得

stopAllForeverApp

  • getOutputLines
    • forever で、常駐化したアプリの停止

setForeverApp

  • getOutputLines
    • forever で、常駐化するアプリの設定

changeForeverApp

  • getOutputLines
    • CHIRIMEN App 用ディレクトリ移動
    • StopAllApps の場合
      • stopAllForeverApp
      • delForeverRebootCron
    • StopAllApps 以外の場合
      • stopAllForeverApp
      • setForeverApp
      • setForeverRebootCron
      • sleep
      • foreverPanel

setForeverRebootCron

  • getOutputLines
    • forever で、cron に登録、起動、chirimenCronSetting.txt に常駐アプリを記載・保存
    • crontab に chirimenCronSetting.txt に記載されている常駐アプリを登録
    • chirimenCronSetting.txt を削除

delForeverRebootCron

  • getOutputLines
    • touch で、chirimenCronSetting.txt を開く
    • crontab に chirimenCronSetting.txt に記載されている常駐アプリを登録
    • chirimenCronSetting.txt を削除

disableForeverAppTable

  • UI 上の常駐アプリが表示されている DOM を非活性にする

foreverPanel

  • getJsApps
    • UI に常駐アプリを表示する為に DOM (表)を作成する

showForeverApp

  • getOutputLines
    • forever で、cron に登録されている常駐アプリリストを取得
    • 動作中と停止中のアプリを取得
    • 起動中の常駐アプリには、チェック状態にする
  • disableForeverAppTable

escapePath

  • JSON.stringify
    • パス文字列の Bash のためのエスケープ処理

Clone this wiki locally