diff --git a/index_elutil.js b/index_elutil.js index bdae0ed..12f0396 100644 --- a/index_elutil.js +++ b/index_elutil.js @@ -8,7 +8,7 @@ const ugj_const = { mascot_path: './img/', mascot_defname: 'tamachee.png', library_path: './lib/', - executable_path: './bin/', + // executable_path: './bin/', localStorage_fname: 'ocoge.json', error_ja_all: 'エラーが発生しました。\n『おこげ倶楽部』までお問い合わせください。', pig: 'pigpio', @@ -32,6 +32,7 @@ class elUtil { this.gpio_backend = ugj_const.pig; this.i2c_bus = ugj_const.i2c_defbus; this.doc_current = process.env["HOME"] + '/Documents'; + this.executable_path = process.env["HOME"] + '/.local/lib/ocogeclub/' } // 0で数値の桁合わせ : NUM=値 LEN=桁数 zeroPadding(NUM, LEN) { diff --git a/ugj_blocks.js b/ugj_blocks.js index 3f3a606..643b09c 100644 --- a/ugj_blocks.js +++ b/ugj_blocks.js @@ -2889,7 +2889,7 @@ Blockly.Blocks['aquestalk_pi'] = { }; Blockly.JavaScript['aquestalk_pi'] = function (block) { var value_talk = Blockly.JavaScript.valueToCode(block, 'talk', Blockly.JavaScript.ORDER_ATOMIC); - var code = `'${ugj_const.executable_path}aquestalkpi/AquesTalkPi -g 50 ' + ${value_talk} + ' | aplay', { shell: true }`; + var code = `'${elutil.executable_path}aquestalkpi/AquesTalkPi -g 50 ' + ${value_talk} + ' | aplay', { shell: true }`; return [code, Blockly.JavaScript.ORDER_NONE]; }; @@ -2929,7 +2929,7 @@ Blockly.Blocks['ugj_child_julius'] = { } }; Blockly.JavaScript['ugj_child_julius'] = function (block) { - var code = `'${ugj_const.executable_path}julius/julius-simple', ['-C', '${ugj_const.executable_path}julius/dictation-kit/am-gmm.jconf', '-gram', '${ugj_const.executable_path}julius/dic/assistant', '-nostrip']`; + var code = `'${elutil.executable_path}julius/julius-simple', ['-C', '${elutil.executable_path}julius/dictation-kit/am-gmm.jconf', '-gram', '${elutil.executable_path}julius/dic/assistant', '-nostrip']`; return [code, Blockly.JavaScript.ORDER_NONE]; }; // irrp.py - pigpioによる赤外線リモコンの学習 @@ -2997,7 +2997,7 @@ Blockly.Blocks['ugj_child_irrcvr'] = { Blockly.JavaScript['ugj_child_irrcvr'] = function (block) { var value_gpio = Blockly.JavaScript.valueToCode(block, 'gpio', Blockly.JavaScript.ORDER_ATOMIC); // var code = `'python3', ['./scripts/irrcvr.py', '-g', '${value_gpio}']`; - var code = `'${ugj_const.executable_path}ir_hash/ir_hash', ['${value_gpio}']`; + var code = `'${elutil.executable_path}ir_hash/ir_hash', ['${value_gpio}']`; return [code, Blockly.JavaScript.ORDER_NONE]; };