mirror of
https://github.com/xodio/xod.git
synced 2026-02-20 02:01:20 +01:00
feat(workspace): add table-log node
This commit is contained in:
30
workspace/__lib__/xod/debug/table-log/patch.cpp
Normal file
30
workspace/__lib__/xod/debug/table-log/patch.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
node {
|
||||
void printPrefix(Context ctx) {
|
||||
TimeMs tNow = transactionTime();
|
||||
XOD_DEBUG_SERIAL.print(F("+XOD:"));
|
||||
XOD_DEBUG_SERIAL.print(tNow);
|
||||
XOD_DEBUG_SERIAL.print(':');
|
||||
XOD_DEBUG_SERIAL.print(getNodeId(ctx));
|
||||
XOD_DEBUG_SERIAL.print(':');
|
||||
}
|
||||
void printEOL() {
|
||||
XOD_DEBUG_SERIAL.print('\r');
|
||||
XOD_DEBUG_SERIAL.print('\n');
|
||||
XOD_DEBUG_SERIAL.flush();
|
||||
}
|
||||
void evaluate(Context ctx) {
|
||||
if (isInputDirty<input_PUSH>(ctx)) {
|
||||
printPrefix(ctx);
|
||||
auto data = getValue<input_IN>(ctx);
|
||||
for (auto it = data.iterate(); it; ++it)
|
||||
XOD_DEBUG_SERIAL.print((char)*it);
|
||||
printEOL();
|
||||
}
|
||||
if (isInputDirty<input_NEW>(ctx)) {
|
||||
printPrefix(ctx);
|
||||
// Page break character -> new page
|
||||
XOD_DEBUG_SERIAL.print((char)0xC);
|
||||
printEOL();
|
||||
}
|
||||
}
|
||||
}
|
||||
49
workspace/__lib__/xod/debug/table-log/patch.xodp
Normal file
49
workspace/__lib__/xod/debug/table-log/patch.xodp
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"description": "Collects values as table rows and tables as sheets. Useful to conduct measurement sessions and then analyze the data gathered in spreadsheet software.",
|
||||
"nodes": [
|
||||
{
|
||||
"id": "B1iYZOzoZ",
|
||||
"position": {
|
||||
"units": "slots",
|
||||
"x": 1,
|
||||
"y": 1
|
||||
},
|
||||
"type": "xod/patch-nodes/not-implemented-in-xod"
|
||||
},
|
||||
{
|
||||
"description": "Adds values to the latest sheet.",
|
||||
"id": "rkWILuNyu",
|
||||
"label": "PUSH",
|
||||
"position": {
|
||||
"units": "slots",
|
||||
"x": 3,
|
||||
"y": 0
|
||||
},
|
||||
"type": "xod/patch-nodes/input-pulse"
|
||||
},
|
||||
{
|
||||
"boundLiterals": {
|
||||
"__out__": "Never"
|
||||
},
|
||||
"description": "Creates a new sheet.",
|
||||
"id": "B1RI8OEyO",
|
||||
"label": "NEW",
|
||||
"position": {
|
||||
"units": "slots",
|
||||
"x": 1,
|
||||
"y": 0
|
||||
},
|
||||
"type": "xod/patch-nodes/input-pulse"
|
||||
},
|
||||
{
|
||||
"description": "Values to add as a new table row. All values should be separated with tab character `\\t`.",
|
||||
"id": "rkvDUOV1O",
|
||||
"position": {
|
||||
"units": "slots",
|
||||
"x": 5,
|
||||
"y": 0
|
||||
},
|
||||
"type": "xod/patch-nodes/input-string"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user