mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Fix merge conflicts on i18n
This commit is contained in:
@@ -19,21 +19,21 @@
|
||||
<input type="text" id="node-input-arduino">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-pin"><i class="fa fa-circle"></i> Pin</label>
|
||||
<label for="node-input-pin"><i class="fa fa-circle"></i> <span data-i18n="arduino.label.pin"></span></label>
|
||||
<input type="text" id="node-input-pin" placeholder="2">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-state"><i class="fa fa-wrench"></i> Type</label>
|
||||
<label for="node-input-state"><i class="fa fa-wrench"></i> <span data-i18n="arduino.label.type"></span></label>
|
||||
<select type="text" id="node-input-state" style="width: 150px;">
|
||||
<option value="INPUT">Digital pin</option>
|
||||
<option value="ANALOG">Analogue pin</option>
|
||||
<option value="INPUT" data-i18n="arduino.state.in.digital"></option>
|
||||
<option value="ANALOG" data-i18n="arduino.state.in.analogue"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||
</div>
|
||||
<div class="form-tips"><b>Note:</b> You cannot use the same pin for both output and input.</div>
|
||||
<div class="form-tips"><span data-i18n="[html]arduino.tip.io"></span></div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="arduino in">
|
||||
@@ -70,26 +70,26 @@
|
||||
|
||||
<script type="text/x-red" data-template-name="arduino out">
|
||||
<div class="form-row">
|
||||
<label for="node-input-arduino"><i class="fa fa-tasks"></i> Arduino</label>
|
||||
<label for="node-input-arduino"><i class="fa fa-tasks"></i> <span data-i18n="arduino.label.arduino"></span></label>
|
||||
<input type="text" id="node-input-arduino">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-pin"><i class="fa fa-circle"></i> Pin</label>
|
||||
<label for="node-input-pin"><i class="fa fa-circle"></i> <span data-i18n="arduino.label.pin"></span></label>
|
||||
<input type="text" id="node-input-pin" placeholder="13">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-state"><i class="fa fa-wrench"></i> Type</label>
|
||||
<label for="node-input-state"><i class="fa fa-wrench"></i> <span data-i18n="arduino.label.type"></span></label>
|
||||
<select type="text" id="node-input-state" style="width: 200px;">
|
||||
<option value="OUTPUT">Digital (0/1)</option>
|
||||
<option value="PWM">Analogue (0-255)</option>
|
||||
<option value="SERVO">Servo (0-180)</option>
|
||||
<option value="OUTPUT" data-i18n="arduino.state.out.digital"></option>
|
||||
<option value="PWM" data-i18n="arduino.state.out.analogue"></option>
|
||||
<option value="SERVO" data-i18n="arduino.state.out.servo"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||
</div>
|
||||
<div class="form-tips"><b>Note:</b> You cannot use the same pin for both output and input.</div>
|
||||
<div class="form-tips"><span data-i18n="[html]arduino.tip.io"></span></div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="arduino out">
|
||||
@@ -124,11 +124,11 @@
|
||||
|
||||
<script type="text/x-red" data-template-name="arduino-board">
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-device"><i class="fa fa-random"></i> Port</label>
|
||||
<input type="text" id="node-config-input-device" style="width:60%;" placeholder="e.g. /dev/ttyUSB0 COM1"/>
|
||||
<label for="node-config-input-device"><i class="fa fa-random"></i> <span data-i18n="arduino.label.port"></span></label>
|
||||
<input type="text" id="node-config-input-device" style="width:60%;" data-i18n="[placeholder]arduino.placeholder.port"/>
|
||||
<a id="node-config-lookup-serial" class="btn"><i id="node-config-lookup-serial-icon" class="fa fa-search"></i></a>
|
||||
</div>
|
||||
<div class="form-tips"><b>Tip:</b> Use search to list serial ports, or leave blank to connect to first device found.</div>
|
||||
<div class="form-tips"><span data-i18n="[html]arduino.tip.conf"></span></div>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
@@ -23,28 +23,30 @@ module.exports = function(RED) {
|
||||
RED.nodes.createNode(this,n);
|
||||
this.device = n.device || null;
|
||||
this.repeat = n.repeat||25;
|
||||
//node.log("opening connection "+this.device);
|
||||
var node = this;
|
||||
node.board = new ArduinoFirmata();
|
||||
// TODO: nls
|
||||
ArduinoFirmata.list(function (err, ports) {
|
||||
if (!node.device) {
|
||||
node.log("connecting to first board found.");
|
||||
node.log(RED._("arduino.status.connectfirst"));
|
||||
node.board.connect();
|
||||
}
|
||||
else {
|
||||
if (ports.indexOf(node.device) === -1) {
|
||||
node.warn(node.device + " not found. Trying to find board.");
|
||||
node.warn(RED._("arduino.errors.devnotfound",{dev:node.device}));
|
||||
node.board.connect();
|
||||
}
|
||||
else {
|
||||
node.log("connecting to "+node.device);
|
||||
node.log(RED._("arduino.status.connect",{device:node.device}));
|
||||
node.board.connect(node.device);
|
||||
}
|
||||
}
|
||||
|
||||
node.board.on('boardReady', function() {
|
||||
node.log("connected to "+node.board.serialport_name);
|
||||
if (RED.settings.verbose) { node.log("version "+node.board.boardVersion); }
|
||||
node.log(RED._("arduino.status.connected",{device:node.board.serialport_name}));
|
||||
if (RED.settings.verbose) {
|
||||
node.log(RED._("arduino.status.version",{version:node.board.boardVersion}));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -53,7 +55,7 @@ module.exports = function(RED) {
|
||||
try {
|
||||
node.board.close(function() {
|
||||
done();
|
||||
if (RED.settings.verbose) { node.log("port closed"); }
|
||||
if (RED.settings.verbose) { node.log(RED._("arduino.status.portclosed")); }
|
||||
});
|
||||
} catch(e) { done(); }
|
||||
} else { done(); }
|
||||
@@ -73,9 +75,9 @@ module.exports = function(RED) {
|
||||
if (typeof this.serverConfig === "object") {
|
||||
this.board = this.serverConfig.board;
|
||||
var node = this;
|
||||
node.status({fill:"red",shape:"ring",text:"connecting"});
|
||||
node.status({fill:"red",shape:"ring",text:"node-red:common.status.connecting"});
|
||||
node.board.on('connect', function() {
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
node.status({fill:"green",shape:"dot",text:"node-red:common.status.connected"});
|
||||
//console.log("i",node.state,node.pin);
|
||||
if (node.state == "ANALOG") {
|
||||
node.board.on('analogChange', function(e) {
|
||||
@@ -103,7 +105,7 @@ module.exports = function(RED) {
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.warn("port not configured");
|
||||
this.warn(RED._("arduino.errors.portnotconf"));
|
||||
}
|
||||
}
|
||||
RED.nodes.registerType("arduino in",DuinoNodeIn);
|
||||
@@ -120,10 +122,10 @@ module.exports = function(RED) {
|
||||
if (typeof this.serverConfig === "object") {
|
||||
this.board = this.serverConfig.board;
|
||||
var node = this;
|
||||
node.status({fill:"red",shape:"ring",text:"connecting"});
|
||||
node.status({fill:"red",shape:"ring",text:"node-red:common.status.connecting"});
|
||||
|
||||
node.board.on('connect', function() {
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
node.status({fill:"green",shape:"dot",text:"node-red:common.status.connected"});
|
||||
//console.log("o",node.state,node.pin);
|
||||
node.board.pinMode(node.pin, node.state);
|
||||
node.on("input", function(msg) {
|
||||
@@ -154,7 +156,7 @@ module.exports = function(RED) {
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.warn("port not configured");
|
||||
this.warn(RED._("arduino.errors.portnotconf"));
|
||||
}
|
||||
}
|
||||
RED.nodes.registerType("arduino out",DuinoNodeOut);
|
||||
|
38
hardware/Arduino/locales/en-US/35-arduino.json
Normal file
38
hardware/Arduino/locales/en-US/35-arduino.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"arduino": {
|
||||
"label": {
|
||||
"pin": "Pin",
|
||||
"type": "Type",
|
||||
"port": "Port"
|
||||
},
|
||||
"placeholder": {
|
||||
"port": "e.g. /dev/ttyUSB0 COM1"
|
||||
},
|
||||
"status": {
|
||||
"connectfirst": "connecting to first board found",
|
||||
"connect": "connecting to __device__",
|
||||
"connected": "connected to __device__",
|
||||
"version": "version: __version__",
|
||||
"portclosed": "port closed"
|
||||
},
|
||||
"state": {
|
||||
"in": {
|
||||
"digital": "Digital pin",
|
||||
"analogue": "Analogue pin"
|
||||
},
|
||||
"out": {
|
||||
"digital": "Digital (0/1)",
|
||||
"analogue": "Analogue (0-255)",
|
||||
"servo": "Servo (0-180)"
|
||||
}
|
||||
},
|
||||
"tip": {
|
||||
"io": "<b>Note:</b> You cannot use the same pin for both output and input.",
|
||||
"conf": "<b>Tip:</b> Use search to try to auto-detect serial port."
|
||||
},
|
||||
"errors": {
|
||||
"portnotconf": "port not configured",
|
||||
"devnotfound": "device __dev__ not found. Trying to find board."
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user