feat: sync all remaining python source board configurations
This commit is contained in:
36
mixly/boards/default_src/python_pyodide/blocks/sklearn.js
Normal file
36
mixly/boards/default_src/python_pyodide/blocks/sklearn.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @typedef {import('@mixly/python-mixpy').PythonMixpySKLearnBlocks} PythonMixpySKLearnBlocks
|
||||
*/
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
const SKLEARN_HUE = 80;
|
||||
|
||||
|
||||
/**
|
||||
* @override Override {@link PythonMixpySKLearnBlocks.sklearn_LinearRegression}
|
||||
*/
|
||||
//sklearn 初始化线性回归
|
||||
export const sklearn_LinearRegression = {
|
||||
init: function () {
|
||||
this.appendDummyInput()
|
||||
.appendField('sklearn ' + Blockly.Msg.SKLEARN_LINEARREGRESSION_INIT);
|
||||
this.appendValueInput('model_name')
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MODEL_NAME);
|
||||
this.appendValueInput('fit_intercept')
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT);
|
||||
this.appendValueInput('n_jobs')
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.SKLEARN_THREADS);
|
||||
this.setInputsInline(false);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(SKLEARN_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_effect_add = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_SET_TO)
|
||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.MIXLY_SOUND_EFFECT_PITCH, "pitch"], [Blockly.Msg.MIXLY_SOUND_EFFECT_PAN, "pan"]]), "EFFECT")
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_EFFECT_ADD_BY);
|
||||
this.appendValueInput("VALUE")
|
||||
.setCheck(null)
|
||||
this.appendDummyInput();
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_EFFECT_ADD_TOOLTIP);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_effect_clear = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_catSoundSOUND_CLEAR_EFFECTS);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_EFFECT_CLEAR_TOOLTIP);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_effect_set = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_SET_TO)
|
||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.MIXLY_SOUND_EFFECT_PITCH, "pitch"], [Blockly.Msg.MIXLY_SOUND_EFFECT_PAN, "pan"]]), "EFFECT")
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_EFFECT_SET_TO);
|
||||
this.appendValueInput("VALUE")
|
||||
.setCheck(null)
|
||||
this.appendDummyInput();
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_EFFECT_SET_TOOLTIP);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_play = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_PLAY)
|
||||
.appendField(new Blockly.FieldDropdown(this.getSoundOptions), "SOUND");
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_PLAY_TOOLTIP);
|
||||
},
|
||||
|
||||
getSoundOptions: function() {
|
||||
const options = [["Meow", "Meow"], [Blockly.Msg.MIXLY_SOUND_RECORD_OPTION, "record"]];
|
||||
|
||||
if (window.sound && window.sound.builtin) {
|
||||
const recordings = Object.keys(window.sound.builtin).filter(k => k.startsWith('recording'));
|
||||
recordings.forEach(recording => {
|
||||
options.push([recording, recording]);
|
||||
});
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_play_frequency = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_PLAY)
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_FREQUENCY);
|
||||
this.appendValueInput("FREQUENCY")
|
||||
.setCheck(Number)
|
||||
.setAlign(Blockly.ALIGN_RIGHT);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_DURATION);
|
||||
this.appendValueInput("DURATION")
|
||||
.setCheck(Number)
|
||||
.setAlign(Blockly.ALIGN_RIGHT);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_PLAY_FREQUENCY_TOOLTIP);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_play_frequency_no_duration = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendValueInput("FREQUENCY")
|
||||
.setCheck(Number)
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_PLAY_FREQUENCY_NO_DURATION);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_PLAY_FREQUENCY_NO_DURATION_TOOLTIP);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_play_note_list = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_PLAY_NOTE_LIST)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
["DADADADUM", "DADADADUM"],
|
||||
["BIRTHDAY", "BIRTHDAY"],
|
||||
["BA_DING", "BA_DING"],
|
||||
["JUMP_UP", "JUMP_UP"],
|
||||
["JUMP_DOWN", "JUMP_DOWN"],
|
||||
["POWER_UP", "POWER_UP"],
|
||||
["POWER_DOWN", "POWER_DOWN"]
|
||||
]), "NOTE_LIST");
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_PLAY_NOTE_LIST_TOOLTIP);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_play_wait = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_PLAY)
|
||||
.appendField(new Blockly.FieldDropdown(this.getSoundOptions), "SOUND")
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_WAIT_FINISH);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_PLAY_WAIT_TOOLTIP);
|
||||
},
|
||||
|
||||
getSoundOptions: function() {
|
||||
const options = [["Meow", "Meow"], [Blockly.Msg.MIXLY_SOUND_RECORD_OPTION, "record"]];
|
||||
|
||||
if (window.sound && window.sound.builtin) {
|
||||
const recordings = Object.keys(window.sound.builtin).filter(k => k.startsWith('recording'));
|
||||
recordings.forEach(recording => {
|
||||
options.push([recording, recording]);
|
||||
});
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_record = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_SOUND_RECORD);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_RECORD_TOOLTIP);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_note = {
|
||||
init: function () {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
["NOTE_A4", "440"],
|
||||
["NOTE_B3", "247"],
|
||||
["NOTE_C4", "262"],
|
||||
["NOTE_D4", "294"],
|
||||
["NOTE_E4", "330"],
|
||||
["NOTE_F4", "349"],
|
||||
["NOTE_G4", "392"],
|
||||
["NOTE_A4", "440"],
|
||||
["NOTE_B4", "494"],
|
||||
["NOTE_C5", "523"],
|
||||
["NOTE_D5", "587"],
|
||||
["NOTE_E5", "659"],
|
||||
["NOTE_F5", "698"],
|
||||
["NOTE_G5", "784"]
|
||||
]), "NOTE");
|
||||
this.setOutput(true, null);
|
||||
this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_NOTE_TOOLTIP);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_stop_all = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_catSoundSOUND_STOP_ALL);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_STOP_ALL_TOOLTIP);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_volume_add = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_catSoundSOUND_VOLUME_INCREASE);
|
||||
this.appendValueInput("VALUE")
|
||||
.setCheck(null);
|
||||
this.appendDummyInput();
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_VOLUME_ADD_TOOLTIP);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_volume_get = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_catSoundSOUND_VOLUME_GET);
|
||||
this.setOutput(true, "Volume");
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_VOLUME_GET_TOOLTIP);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
export const sound_volume_set = {
|
||||
init: function() {
|
||||
this.setColour('#acc159');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_catSoundSOUND_VOLUME_SET);
|
||||
this.appendValueInput("VALUE")
|
||||
.setCheck(null);
|
||||
this.appendDummyInput();
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SOUND_VOLUME_SET_TOOLTIP);
|
||||
}
|
||||
};
|
||||
230
mixly/boards/default_src/python_pyodide/blocks/tensorflow.js
Normal file
230
mixly/boards/default_src/python_pyodide/blocks/tensorflow.js
Normal file
@@ -0,0 +1,230 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
const TENSORFLOW_HUE = '#1216ab';
|
||||
|
||||
Blockly.Blocks.tensorflow_init_tensor = {
|
||||
init: function () {
|
||||
this.appendValueInput("VAR")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_INIT_TENSOR);
|
||||
this.setOutput(true, null);
|
||||
this.setColour(TENSORFLOW_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks.tensorflow_sequential = {
|
||||
init: function () {
|
||||
this.appendDummyInput()
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_SEQUENTIAL);
|
||||
this.setOutput(true, null);
|
||||
this.setColour(TENSORFLOW_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks.tensorflow_layers_dense = {
|
||||
init: function () {
|
||||
this.appendDummyInput()
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_INIT_LAYERS_DENSE_LAYER);
|
||||
this.appendValueInput("VAR1")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_OUTPUT_DIMENSION);
|
||||
this.appendValueInput("VAR2")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_INPUT_SHAPE);
|
||||
this.setOutput(true, null);
|
||||
this.setColour(TENSORFLOW_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks.tensorflow_add = {
|
||||
init: function () {
|
||||
this.appendValueInput("VAR1")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_MODEL);
|
||||
this.appendValueInput("VAR2")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_ADD_LAYER);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(TENSORFLOW_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks.tensorflow_compile = {
|
||||
init: function () {
|
||||
this.appendValueInput("VAR1")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_COMPILE_MODEL);
|
||||
this.appendDummyInput()
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_LOSS_FUNCTION_TYPE)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_TENSORFLOW_MEAN_SQUARED_ERROR, "meanSquaredError"]
|
||||
]), "VAR2");
|
||||
this.appendDummyInput()
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_OPTIMIZER)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_TENSORFLOW_SGD, "sgd"]
|
||||
]), "VAR3");
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(TENSORFLOW_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks.tensorflow_fit = {
|
||||
init: function () {
|
||||
this.appendValueInput("VAR1")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_FIT_MODEL);
|
||||
this.appendValueInput("VAR2")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_FIT_INPUT_DATA);
|
||||
this.appendValueInput("VAR3")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_FIT_TARGET_DATA);
|
||||
this.appendValueInput("VAR4")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_FIT_EPOCHS);
|
||||
this.appendValueInput("VAR5")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_FIT_VERBOSE);
|
||||
this.appendDummyInput()
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_FIT_RETURN_HISTORY);
|
||||
this.setInputsInline(false);
|
||||
this.setOutput(true, null);
|
||||
this.setColour(TENSORFLOW_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks.tensorflow_get_loss = {
|
||||
init: function () {
|
||||
this.appendValueInput("VAR")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_GET_LOSS_FROM_HISTORY);
|
||||
this.appendDummyInput()
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_GET_LOSS_FROM_HISTORY_2);
|
||||
this.setOutput(true, null);
|
||||
this.setColour(TENSORFLOW_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks.tensorflow_predict = {
|
||||
init: function () {
|
||||
this.appendValueInput("VAR1")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_PREDICT);
|
||||
this.appendValueInput("VAR2")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_PREDICT_INPUT_DATA);
|
||||
this.appendDummyInput()
|
||||
.setAlign(Blockly.ALIGN_RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_PREDICT_RETURN_RESULT);
|
||||
this.setInputsInline(false);
|
||||
this.setOutput(true, null);
|
||||
this.setColour(TENSORFLOW_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks.tensorflow_get_tensor_data = {
|
||||
init: function () {
|
||||
this.appendValueInput("VAR")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_GET_TENSOR_DATA);
|
||||
this.setOutput(true, null);
|
||||
this.setColour(TENSORFLOW_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks.tensorflow_save_or_export_model = {
|
||||
init: function () {
|
||||
this.appendValueInput("NAME1")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_MODEL);
|
||||
this.appendValueInput("NAME2")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_TENSORFLOW_SAVE_MODEL, "save"],
|
||||
[Blockly.Msg.MIXLY_TENSORFLOW_EXPORT_MODEL, "export"]
|
||||
]), "NAME")
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_SAVE_MODEL_NAME);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setColour(TENSORFLOW_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks.tensorflow_use_load_model = {
|
||||
init: function () {
|
||||
this.appendValueInput("NAME")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_LOAD_MODEL)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_MODEL_NAME);
|
||||
this.setInputsInline(true);
|
||||
this.setOutput(true, null);
|
||||
this.setColour(TENSORFLOW_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks.tensorflow_prepare_picture = {
|
||||
init: function () {
|
||||
this.appendValueInput("NAME")
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.ALIGN_LEFT)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_PREPARE_PICTURE_TO_TENSOR)
|
||||
.appendField(Blockly.Msg.MIXLY_TENSORFLOW_PREPARE_PICTURE_READ_PICTURE);
|
||||
this.setInputsInline(true);
|
||||
this.setOutput(true, null);
|
||||
this.setColour(TENSORFLOW_HUE);
|
||||
this.setTooltip('');
|
||||
this.setHelpUrl('');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user