@BartButenaers ,,
Actually, SVG Editor
appending some extra character to my object ID. When I creating new pipe, I have edited/added name as bp-1
for my pipes using Abode Illustrator.
But I am observing bp-1-4
in SVG Editor
.
I don't know how extra character is appended.
As of now, I removed the extra character in object ID. I am not seeing issue. Still, my node-red inject node is not able to locate the animation ID. I am getting error like this.
FYR, new updated code Paste.ee - code flow 1
I have created animation for my hydraulic cylinder using node-red Flow.
[
{
"id": "7b5dc595967afb31",
"type": "debug",
"z": "dd6662b64540bd5f",
"name": "debug 3",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 420,
"y": 640,
"wires": []
},
{
"id": "460b749017bbec94",
"type": "ui_svg_graphics",
"z": "dd6662b64540bd5f",
"group": "5dd24274.e5a58c",
"order": 2,
"width": "24",
"height": "14",
"svgString": "<svg xmlns:osb=\"http://www.openswatchbook.org/uri/2009/osb\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" id=\"Layer_1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 595.280029296875 841.8900146484375\" style=\"enable-background:new 0 0 595.28 841.89;\" xml:space=\"preserve\" sodipodi:docname=\"vector_cylinder2.svg\" inkscape:version=\"0.92.1 r15371\" width=\"100%\" height=\"100%\" preserveAspectRatio=\"xMidYMid meet\">\n <rect id=\"svgEditorBackground\" x=\"0\" y=\"0\" width=\"595.280029296875\" height=\"841.8900146484375\" style=\"fill:none;stroke:none;\" />\n <metadata id=\"metadata19\">\n <rdf:RDF>\n <cc:Work rdf:about=\"\">\n <dc:format>image/svg+xml</dc:format>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\" />\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs id=\"defs17\">\n <linearGradient id=\"linearGradient936\" osb:paint=\"solid\">\n <stop style=\"stop-color:#8d3092;stop-opacity:1;\" offset=\"0\" id=\"stop934\" />\n </linearGradient>\n </defs>\n <sodipodi:namedview pagecolor=\"#ffffff\" bordercolor=\"#666666\" borderopacity=\"1\" objecttolerance=\"10\" gridtolerance=\"10\" guidetolerance=\"10\" inkscape:pageopacity=\"0\" inkscape:pageshadow=\"2\" inkscape:window-width=\"1366\" inkscape:window-height=\"705\" id=\"namedview15\" showgrid=\"false\" inkscape:zoom=\"0.28032165\" inkscape:cx=\"-282.0512\" inkscape:cy=\"420.94501\" inkscape:window-x=\"-8\" inkscape:window-y=\"-8\" inkscape:window-maximized=\"1\" inkscape:current-layer=\"g12\" />\n <style type=\"text/css\" id=\"style2\">\n .st0\n {}\n\n .st1\n {\n fill: #414042;\n }\n </style>\n <g id=\"g12\" transform=\"matrix(3.299456,0,0,2.1672893,-617.67818,-416.58455)\">\n <path id=\"piston-head\" class=\"st0\" d=\"m326.19,338.11h-74.76v-19.66h74.76v19.66m4.79,3.96V314.5h-84.34v27.57Z\" inkscape:connector-curvature=\"0\" style=\"fill-opacity: 1;\" fill=\"#963092\" />\n <path id=\"piston-tail\" class=\"st0\" d=\"M298.47,502.67H282.04V342.55h16.43v160.12m4.79,3.95V338.6h-26.01v168.03h26.01Z\" inkscape:connector-curvature=\"0\" style=\"fill-opacity: 1;\" fill=\"#963092\" />\n <polygon class=\"st1\" points=\"240.72,470.15 273.38,470.15 273.38,466.24 245.45,466.24 245.45,284.39 332.15,284.39 332.15,466.24 307.12,466.24 307.12,470.15 336.88,470.15 336.88,280.48 240.72,280.48 \" id=\"polygon6\" style=\"fill:#414042\" />\n <rect x=\"223.39999\" y=\"441.09\" transform=\"rotate(90,225.8111,455.6814)\" class=\"st1\" width=\"4.8200002\" height=\"29.18\" id=\"rect8\" style=\"fill:#414042\" />\n <rect x=\"223.39999\" y=\"280.25\" transform=\"rotate(90,225.81105,294.83715)\" class=\"st1\" width=\"4.8200002\" height=\"29.18\" id=\"rect10\" style=\"fill:#414042\" />\n </g>\n</svg>",
"clickableShapes": [],
"javascriptHandlers": [],
"smilAnimations": [
{
"id": "move_head",
"targetId": "piston-head",
"classValue": "",
"attributeName": "transform",
"transformType": "translate",
"fromValue": "0,2",
"toValue": "0,50",
"trigger": "msg",
"duration": "7",
"durationUnit": "s",
"repeatCount": "1",
"end": "restore",
"delay": "1",
"delayUnit": "s",
"custom": ""
},
{
"id": "move_tail",
"targetId": "piston-tail",
"classValue": "",
"attributeName": "transform",
"transformType": "translate",
"fromValue": "0,0",
"toValue": "0,50",
"trigger": "msg",
"duration": "7",
"durationUnit": "s",
"repeatCount": "1",
"end": "restore",
"delay": "1",
"delayUnit": "s",
"custom": ""
}
],
"bindings": [],
"showCoordinates": false,
"autoFormatAfterEdit": true,
"showBrowserErrors": true,
"showBrowserEvents": false,
"enableJsDebugging": true,
"sendMsgWhenLoaded": false,
"noClickWhenDblClick": false,
"outputField": "payload",
"editorUrl": "http://127.0.0.1:1880/drawsvg_local/edrawsvg.html",
"directory": "",
"panning": "disabled",
"zooming": "disabled",
"panOnlyWhenZoomed": false,
"doubleClickZoomEnabled": false,
"mouseWheelZoomEnabled": false,
"dblClickZoomPercentage": 150,
"cssString": "div.ui-svg svg{\n color: var(--nr-dashboard-widgetColor);\n fill: currentColor;\n}\ndiv.ui-svg path {\n fill: inherit;\n}",
"name": "",
"x": 440,
"y": 560,
"wires": [
[]
]
},
{
"id": "0b767bc1d6f02a33",
"type": "ui_button",
"z": "dd6662b64540bd5f",
"name": "",
"group": "5dd24274.e5a58c",
"order": 3,
"width": 0,
"height": 0,
"passthru": false,
"label": "Start Cylinder",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "[{\"command\":\"update_style\",\"selector\":\"#piston\",\"attributeName\":\"fill\",\"attributeValue\":\"#3AF000\"},{\"command\":\"trigger_animation\",\"selector\":\"#move_head\",\"action\":\"start\"},{\"command\":\"trigger_animation\",\"selector\":\"#move_tail\",\"action\":\"start\"}]",
"payloadType": "json",
"topic": "topic",
"topicType": "msg",
"x": 80,
"y": 560,
"wires": [
[
"460b749017bbec94"
]
]
},
{
"id": "ee8c8551ac7b51f7",
"type": "inject",
"z": "dd6662b64540bd5f",
"name": "Trigger the cylinder ",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "[{\"command\":\"update_style\",\"selector\":\"#piston-head\",\"attributeName\":\"fill\",\"attributeValue\":\"#3AF000\"},{\"command\":\"update_style\",\"selector\":\"#piston-tail\",\"attributeName\":\"fill\",\"attributeValue\":\"#3AF000\"},{\"command\":\"trigger_animation\",\"selector\":\"#move_head\",\"action\":\"start\"},{\"command\":\"trigger_animation\",\"selector\":\"#move_tail\",\"action\":\"start\"},{\"command\":\"trigger_animation\",\"selector\":\"#move_head\",\"action\":\"start\"}]",
"payloadType": "json",
"x": 110,
"y": 640,
"wires": [
[
"460b749017bbec94",
"7b5dc595967afb31"
]
]
},
{
"id": "5dd24274.e5a58c",
"type": "ui_group",
"name": "dj_dashboard_group",
"tab": "c07e0049.90e8a",
"order": 1,
"disp": true,
"width": "24",
"collapse": false,
"className": ""
},
{
"id": "c07e0049.90e8a",
"type": "ui_tab",
"name": "dj_sample",
"icon": "dashboard",
"order": 19,
"disabled": false,
"hidden": false
}
]
Animation is working perfectly in above svg code/image. When I included this svg image in my main wire diagram, animation is not working.