[update] electron-forge によるパッケージング,新ブロック i2c_read_word_data

This commit is contained in:
ocogeclub 2021-12-30 23:11:01 +09:00
parent 7c545f8825
commit 6e5a45b6fb
6 changed files with 9460 additions and 208 deletions

2
.gitignore vendored
View File

@ -6,3 +6,5 @@ build/
*.bak
*.old
out/

View File

@ -1,6 +1,6 @@
# ocoge
"大岩産 Code Generator" は、Google Blockly ライブラリを使用した、Raspberry Pi 上で動作するブロックプログラム開発・実行環境です。
インストール方法・操作・サンプルなどは、『[おこげ倶楽部](https://ocoge.club)』または『[おこげはてな倶楽部](https://ocogeclub.hatenablog.jp)』にて公開予定です。
インストール方法・操作・サンプルなどは、『[PI.ICHIJU.IN](https://pi.ichiju.in)』にて公開予定です。
### 免責
このアプリケーションは特定の環境下で使用する目的で、専門知識を持たない日曜プログラマによって無計画に開発されています。アドバイス・ご意見・ご要望は有難く承りますが、対応の保証はいたしかねます。

View File

@ -441,6 +441,13 @@
</shadow>
</value>
</block>
<block type="ugj_i2c_read_word_data">
<value name="reg">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
</value>
</block>
<block type="ugj_i2c_write_i2c_block_data">
<value name="reg">
<shadow type="math_number">

9485
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,15 @@
{
"name": "ocoge",
"version": "0.1.3",
"description": "\"大岩産 Code Generator\" は、Google Blockly ライブラリを使用した、Raspberry Pi 上で動作するブロックプログラム開発・実行環境です。",
"description": "ブロックベースビジュアルプログラム開発・実行環境",
"main": "main.js",
"scripts": {
"build": "npm install --legacy-peer-deps",
"start": "electron .",
"rebuild": "electron-rebuild"
"start": "electron-forge start",
"rebuild": "electron-rebuild",
"package": "electron-forge package",
"make": "electron-forge make",
"launch": "electron ."
},
"repository": {
"type": "git",
@ -20,7 +23,12 @@
},
"homepage": "https://github.com/ocogeclub/ocoge#readme",
"devDependencies": {
"electron": "^16.0.2",
"@electron-forge/cli": "^6.0.0-beta.61",
"@electron-forge/maker-deb": "^6.0.0-beta.61",
"@electron-forge/maker-rpm": "^6.0.0-beta.61",
"@electron-forge/maker-squirrel": "6.0.0-beta.33",
"@electron-forge/maker-zip": "^6.0.0-beta.61",
"electron": "^16.0.5",
"electron-rebuild": "^3.2.5"
},
"dependencies": {
@ -30,10 +38,44 @@
"@ocogeclub/pigpio": "file:local_modules/@ocogeclub/pigpio",
"@tensorflow-models/knn-classifier": "^1.2.2",
"@tensorflow-models/mobilenet": "^2.1.0",
"@tensorflow/tfjs-node": "^3.11.0",
"@vladmandic/face-api": "^1.5.7",
"@tensorflow/tfjs-converter": "^3.12.0",
"@tensorflow/tfjs-core": "^3.12.0",
"@tensorflow/tfjs-node": "^3.12.0",
"@vladmandic/face-api": "^1.6.1",
"axios": "^0.24.0",
"electron-squirrel-startup": "^1.0.0",
"nodemailer": "^6.7.2",
"tensorset": "^1.2.9"
},
"config": {
"forge": {
"packagerConfig": {},
"makers": [
{
"name": "@electron-forge/maker-squirrel",
"config": {
"name": "ocoge"
}
},
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "@electron-forge/maker-deb",
"config": {
"options": {
"categories": [
"Development"
],
"icon": "./icon.png",
"maintainer": "ICHIJU-INN <pi@ichiju.in>"
}
}
}
]
}
}
}

View File

@ -927,7 +927,7 @@ Blockly.Blocks['ugj_i2c_read_byte_data'] = {
};
Blockly.JavaScript['ugj_i2c_read_byte_data'] = function (block) {
var value_reg = Blockly.JavaScript.valueToCode(block, 'reg', Blockly.JavaScript.ORDER_ATOMIC);
var code = `await _pi.i2c_read_byte_data(${value_reg})\n`;
var code = `await _pi.i2c_read_byte_data(${value_reg})`;
return [code, Blockly.JavaScript.ORDER_ATOMIC];
};
Blockly.Python['ugj_i2c_read_byte_data'] = function (block) {
@ -936,6 +936,26 @@ Blockly.Python['ugj_i2c_read_byte_data'] = function (block) {
return [code, Blockly.Python.ORDER_ATOMIC];
};
Blockly.Blocks['ugj_i2c_read_word_data'] = {
init: function () {
this.appendValueInput("reg")
.setCheck("Number")
.appendField("レジスタ");
this.appendDummyInput()
.appendField("のワード値");
this.setInputsInline(true);
this.setOutput(true, "Number");
this.setStyle('gpio_blocks');
this.setTooltip("デバイスの指定レジスタからワードデータを読み出します。");
this.setHelpUrl("");
}
};
Blockly.JavaScript['ugj_i2c_read_word_data'] = function (block) {
var value_reg = Blockly.JavaScript.valueToCode(block, 'reg', Blockly.JavaScript.ORDER_ATOMIC);
var code = `await _pi.i2c_read_word_data(${value_reg})`;
return [code, Blockly.JavaScript.ORDER_ATOMIC];
};
var ugjI2cWriteI2cBlockDataDefinition = {
"type": "ugj_i2c_write_i2c_block_data",
"message0": "%{BKY_I2C_WRITE_I2C_BLOCK_DATA_TITLE}",
@ -2113,7 +2133,7 @@ Blockly.Blocks['ugj_event_key'] = {
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setStyle('multimedia_blocks')
this.setStyle('multimedia_blocks');
this.setTooltip("キーボードを押したり離したりした時のアクションです。");
this.setHelpUrl("https://developer.mozilla.org/ja/docs/Web/API/KeyboardEvent/key/Key_Values");
}