Difference between revisions of "Wiring Editor"

From Open Source Controls Wiki
Jump to navigation Jump to search
Line 49: Line 49:
</pre>
</pre>


<pre class="wikidiagram" id="Controllers" style="display:none">
{ "class": "GraphLinksModel",
  "copiesArrays": true,
  "copiesArrayObjects": true,
  "linkFromPortIdProperty": "fromPort",
  "linkToPortIdProperty": "toPort",
  "nodeDataArray": [
{"key":"BEMS","name":"BEMS Hat","fill":"#98fb98","image":"/images/c/c1/C2a.svg","leftArray":[{"portId":"left0","portColor":"#000000","figure":"Output"},{"portId":"left1","portColor":"#00ff00","figure":"Input"},{"portId":"left2","portColor":"#000000","figure":"Output"},{"portId":"left3","portColor":"#00ff00","figure":"Input"},{"portId":"left4","portColor":"#000000","figure":"Output"},{"portId":"left5","portColor":"#00ff00","figure":"Input"},{"portId":"left6","portColor":"#000000","figure":"Output"},{"portId":"left7","portColor":"#00ff00","figure":"Input"},{"portId":"left8","portColor":"#000000","figure":"Output"},{"portId":"left9","portColor":"#fffffe","figure":"Input"},{"portId":"left10","portColor":"#000000","figure":"Output"},{"portId":"left11","portColor":"#fffffe","figure":"Input"},{"portId":"left12","portColor":"#000000","figure":"Output"},{"portId":"left13","portColor":"#fffffe","figure":"Input"},{"portId":"left14","portColor":"#000000","figure":"Output"},{"portId":"left15","portColor":"#fffffe","figure":"Input"},{"portId":"left16","portColor":"#000000","figure":"Output"},{"portId":"left17","portColor":"#00ff00","figure":"Input"},{"portId":"left18","portColor":"#000000","figure":"Output"},{"portId":"left19","portColor":"#00ff00","figure":"Input"},{"portId":"left20","portColor":"#000000","figure":"Output"},{"portId":"left21","portColor":"#00ff00","figure":"Input"},{"portId":"left22","portColor":"#000000","figure":"Output"},{"portId":"left23","portColor":"#00ff00","figure":"Input"}],"topArray":[{"portColor":"#ffc900","portId":"top01","figure":"Output"},{"portColor":"#ffc900","portId":"top02","figure":"Output"},{"portColor":"#ffc900","portId":"top03","figure":"Output"},{"portId":"top1","portColor":"#000000","figure":"Output"},{"portId":"top2","portColor":"#e88600","figure":"Input"},{"portId":"top3","portColor":"#000002","figure":"Input"},{"portColor":"#ffffff","portId":"top4"},{"portColor":"#ffffff","portId":"top5"}],"bottomArray":[{"portColor":"#000000","portId":"bottom0","figure":"Output"},{"portId":"bottom1","portColor":"#00ffff","figure":"Input"},{"portId":"bottom2","portColor":"#000000","figure":"Output"},{"portId":"bottom3","portColor":"#00ffff","figure":"Input"},{"portId":"bottom4","portColor":"#000000","figure":"Output"},{"portId":"bottom5","portColor":"#00ffff","figure":"Input"},{"portId":"bottom6","portColor":"#000000","figure":"Output"},{"portId":"bottom7","portColor":"#00ffff","figure":"Input"},{"portId":"bottom8","portColor":"#000000","figure":"Output"},{"portId":"bottom9","portColor":"#40aceb","figure":"Input"},{"portId":"bottom10","portColor":"#000000","figure":"Output"},{"portId":"bottom11","portColor":"#40aceb","figure":"Input"},{"portId":"bottom12","portColor":"#000000","figure":"Output"},{"portId":"bottom13","portColor":"#40aceb","figure":"Input"},{"portId":"bottom14","portColor":"#000000","figure":"Output"},{"portId":"bottom15","portColor":"#40aceb","figure":"Input"},{"portId":"bottom16","portColor":"#ff8abd","figure":"Output"},{"portId":"bottom17","portColor":"#bf6ae3","figure":"Input"},{"portId":"bottom18","portColor":"#ffa3a3","figure":"Output"},{"portId":"bottom19","portColor":"#ff8abd","figure":"Output"},{"portId":"bottom20","portColor":"#bf6ae3","figure":"Input"},{"portId":"bottom21","portColor":"#ffa3a3","figure":"Output"}],"rightArray":[{"portColor":"#000000","portId":"right0","figure":"Circle"},{"portColor":"#888891","figure":"Circle","portId":"right1"},{"portId":"right2","portColor":"#888890","figure":"Circle"},{"portId":"right3","portColor":"#000000","figure":"Circle"},{"portId":"right4","portColor":"#888889","figure":"Circle"},{"portId":"right5","portColor":"#888888","figure":"Circle"},{"portId":"right6","portColor":"#ddddba","figure":"Circle"},{"portId":"right7","portColor":"#ddddbb","figure":"Circle"},{"portId":"right8","portColor":"#ffff00","figure":"Output"},{"portId":"right9","portColor":"#000000","figure":"Output"},{"portId":"right10","portColor":"#ffff00","figure":"Output"},{"portId":"right11","portColor":"#000000","figure":"Output"},{"portId":"right12","portColor":"#ffff00","figure":"Output"},{"portId":"right13","portColor":"#000000","figure":"Output"},{"portId":"right14","portColor":"#ffff00","figure":"Output"},{"portId":"right15","portColor":"#000000","figure":"Output"},{"portId":"right16","portColor":"#40aceb","figure":"Output"},{"portId":"right17","portColor":"#ff0000","figure":"Output"},{"portId":"right18","portColor":"#40aceb","figure":"Output"},{"portId":"right19","portColor":"#ff0000","figure":"Output"},{"portId":"right20","portColor":"#40aceb","figure":"Output"},{"portId":"right21","portColor":"#ff0000","figure":"Output"},{"portId":"right22","portColor":"#40aceb","figure":"Output"},{"portId":"right23","portColor":"#ff0000","figure":"Output"}],"loc":"-725.9973940588787 -222.93468342927153","size":"231 250.5","thickness":2,"color":"#98fb98","group":-5,"notes":"","textColor":"#484848"},
{"name":"Raspberry Pi 4","fill":"#ffffff","background":"/images/9/99/Raspberry-pi-4-model-b.jpg","leftArray":[],"rightArray":[],"topArray":[],"bottomArray":[],"key":"pi4","size":"247 203","loc":"-388.891516079893 20.19858112729105","notes":"","textColor":"#484848","thickness":2,"group":-11},
{"name":"reTerminal","fill":"#ffffff","background":"/images/5/52/Reterminal.png","leftArray":[],"rightArray":[],"topArray":[],"bottomArray":[],"key":"reTerminal","size":"347 236","loc":"-339.4486878639144 -231.33598246445115","notes":"","textColor":"#484848","thickness":0,"group":-11},
{"key":"BEMSJ","name":"BEMS Junior Hat","fill":"#98fb98","image":" ","leftArray":[{"portId":"left0","portColor":"#000000","figure":"Output"},{"portId":"left1","portColor":"#fffffe","figure":"Input"},{"portId":"left2","portColor":"#000000","figure":"Output"},{"portId":"left3","portColor":"#fffffe","figure":"Input"},{"portId":"left4","portColor":"#000000","figure":"Output"},{"portId":"left5","portColor":"#fffffe","figure":"Input"},{"portId":"left6","portColor":"#000000","figure":"Output"},{"portId":"left7","portColor":"#fffffe","figure":"Input"},{"portId":"left8","portColor":"#000000","figure":"Output"},{"portId":"left9","portColor":"#fffffe","figure":"Input"},{"portId":"left10","portColor":"#000000","figure":"Output"},{"portId":"left11","portColor":"#fffffe","figure":"Input"},{"portId":"left12","portColor":"#000000","figure":"Output"},{"portId":"left13","portColor":"#fffffe","figure":"Input"},{"portId":"left14","portColor":"#000000","figure":"Output"},{"portId":"left15","portColor":"#fffffe","figure":"Input"}],"topArray":[{"portColor":"#ffffff","portId":"top0"},{"portId":"top1","portColor":"#ffc900","figure":"Output"},{"portId":"top2","portColor":"#ffc900","figure":"Output"},{"portId":"top3","portColor":"#ffc900","figure":"Output"},{"portId":"top4","portColor":"#ffc900","figure":"Output"},{"portId":"top5","portColor":"#ffffff"},{"portId":"top6","portColor":"#ffffff"},{"portId":"top7","portColor":"#ffffff"},{"portId":"top8","portColor":"#ffffff"},{"portId":"top9","portColor":"#ffffff"},{"portId":"top10","portColor":"#ffffff"},{"portId":"top11","portColor":"#ffffff"},{"portId":"top12","portColor":"#ffffff"},{"portId":"top13","portColor":"#ffffff"},{"portId":"top14","portColor":"#ffffff"},{"portId":"top15","portColor":"#ffffff"},{"portId":"top16","portColor":"#ffffff"},{"portId":"top17","portColor":"#ffffff"},{"portId":"top18","portColor":"#ffffff"},{"portId":"top19","portColor":"#ffffff"},{"portId":"top20","portColor":"#ff0000","figure":"Input"},{"portId":"top21","portColor":"#000001","figure":"Input"}],"bottomArray":[{"portColor":"#888888","portId":"bottom0"},{"portId":"bottom1","portColor":"#888889"},{"portId":"bottom2","portColor":"#888890"},{"portId":"bottom11","portColor":"#888891"},{"portId":"bottom12","portColor":"#ffffff"},{"portId":"bottom13","portColor":"#ffffff"},{"portId":"bottom14","portColor":"#ffffff"},{"portId":"bottom15","portColor":"#ffffff"},{"portId":"bottom16","portColor":"#ffffff"},{"portId":"bottom17","portColor":"#ffffff"},{"portId":"bottom18","portColor":"#ff0000","figure":"Output"},{"portId":"bottom19","portColor":"#ff0000","figure":"Output"},{"portId":"bottom20","portColor":"#ff0000","figure":"Output"},{"portId":"bottom21","portColor":"#ff0000","figure":"Output"}],"rightArray":[{"portId":"right8","portColor":"#ffff00","figure":"Output"},{"portId":"right9","portColor":"#000000","figure":"Output"},{"portId":"right10","portColor":"#ffff00","figure":"Output"},{"portId":"right11","portColor":"#000000","figure":"Output"},{"portId":"right12","portColor":"#ffff00","figure":"Output"},{"portId":"right13","portColor":"#000000","figure":"Output"},{"portId":"right14","portColor":"#ffff00","figure":"Output"},{"portId":"right15","portColor":"#000000","figure":"Output"},{"portId":"right0","portColor":"#f6beb6","figure":"Output"},{"portId":"right1","portColor":"#000001","figure":"Output"},{"portId":"right2","portColor":"#f6beb6","figure":"Output"},{"portId":"right3","portColor":"#000001","figure":"Output"},{"portId":"right4","portColor":"#f6beb6","figure":"Output"},{"portId":"right5","portColor":"#000001","figure":"Output"},{"portId":"right6","portColor":"#f6beb6","figure":"Output"},{"portId":"right7","portColor":"#000001","figure":"Output"}],"textColor":"#000000","notes":"","size":"234 170","loc":"-727.580144058879 31.15731657072851","color":"#000000","thickness":1,"group":-5},
{"isGroup":true,"text":"I/O Boards","key":-5,"loc":"-723.8691401526289 -211.04545686677108","dash":[4,4],"thickness":1},
{"name":"ESP-32","fill":"#ffffff","background":"/images/8/8f/Esp32.PNG","leftArray":[],"rightArray":[],"topArray":[],"bottomArray":[],"key":"esp32","size":"89 156","loc":"104.13140775226543 20.29863089029908","notes":"","textColor":"#484848","thickness":2,"group":-11},
{"name":"I/O is drive via one of two\ncircuits, the BEMS Hat,\nand the BEMS Junior Hat.\nThese plug in to a main \nprocessor unit.","fill":"#ffffff00","background":"/images/thumb/3/3f/Sticky.png/597px-Sticky.png","leftArray":[],"rightArray":[],"topArray":[],"bottomArray":[],"key":"note","size":"275 150","loc":"-723.8691401526289 -471.49823030427063","group":-5},
{"name":"The reTerminal is a Compute \ndriven screen controller running\nthe full Open Control \nSoftware Stack, including \nNode-RED and MQTT. \n It uses FLASH memory and\ncomplies to industrial standards,\n with Microsoft Azure certification.","fill":"#ffffff00","background":"/images/thumb/3/3f/Sticky.png/597px-Sticky.png","leftArray":[],"rightArray":[],"topArray":[],"bottomArray":[],"key":"The reTerminal","size":"298 200","loc":"-2.639558957664349 -249.04802933945126","group":-11},
{"name":"The Raspberry Pi 4 is a standard \ncontroller running the full\nOpen Control Software Stack,\nincluding Node-RED and MQTT ","fill":"#ffffff00","background":"/images/thumb/3/3f/Sticky.png/597px-Sticky.png","leftArray":[],"rightArray":[],"topArray":[],"bottomArray":[],"key":"The Raspberry Pi 4","size":"250 157","loc":"-130.0618871736433 21.26740925229103","group":-11},
{"name":"The ESP-32 is a compact WiFi\ncontroller running specific\ncontrol applications for\nOEM applications. ","fill":"#ffffff00","background":"/images/thumb/3/3f/Sticky.png/597px-Sticky.png","leftArray":[],"rightArray":[],"topArray":[],"bottomArray":[],"key":"The ESP-32","size":"250 157","loc":"291.4697866585151 18.242084015298985","group":-11},
{"isGroup":true,"text":"Processor Units","key":-11,"loc":"-48.08586471068895 -210.19346275707045","dash":[4,4],"thickness":1},
{"name":"Processor Units drive the system logic control as\nwell as communications and local data storage","fill":"#ffffff00","background":"/images/thumb/3/3f/Sticky.png/597px-Sticky.png","leftArray":[],"rightArray":[],"topArray":[],"bottomArray":[],"key":"Processor Units","size":"385 130","loc":"-319.8005552508498 -477.33550664143195","group":-11}
],
  "linkDataArray": []}
</pre>


<pre class="wikidiagram" id="BEMS_Hat" style="display:none">
<pre class="wikidiagram" id="BEMS_Hat" style="display:none">

Revision as of 13:53, 29 June 2022

Concons1.png

Data

Contains invisible JSON data driving this page.




See Also

Ports and Colours

Diagrams are based around nodes (devices) with ports for making connections.

To enable automatic wiring, port types are required as well as rules about how they can be connected.

Colours tend to be the most commonly used identifier for types of connections, with in computer language is a hex value representing red, green and blue. #000000 is black, #ff0000 is red, #00ff00 is green, #ffffff is white, and so on.

However we require another level of distinction as we may desire to wire to a particular GND for example, or to give communications a plus and minus. This is achieved by using the last digit of the colour as a variation, providing 1,048,576 colours (or signal levels), each with 16 variations.

Taking GND (black) for example. #000000 is the default black and used for ground connections. We may however use #00000f for a power supply ground, or #000001 for a less popular ground that can be used if needed in preference to a popular ground.

Compareblk.png

One can take this to an extreme and give every signal level a unique colour value. This may well feature in future live wiring systems.

By default, ports connect to ports of the same colour. However, a 0-10V OUT cannot connect to another 0-10V OUT so we specify compatible ports with:

  1. A port figure, which can be either an "Input", "Output" (shown by a direction arrow), or any other standard shape figure including "Rectangle", "Circle", "TriangleUp", etc. Inputs cannot be wired to outputs.
  2. An optional list of compatible colours called signalTypes, in order of preference. If a preferred port type is free it will be used, if not then the next in the list will be tried, and so on. You can see this in use in the following data for a room thermostat, where it is used to allow connection to both a dry contact #00ffffff and a universal input #fffffe.
{"name":"Room Thermostat","color":"#dbf6cb","leftArray":[],"rightArray":[{"portId":"right0","portColor":"#000000"},{"portId":"right1","portColor":"#00ffff","signalTypes":["#00ffff","#fffffe"]}],"topArray":[],"bottomArray":[],"key":"roomstat","size":"78.78515625 47"}

Rststwire.png Rststwire2.png

Buttons

This power supply contains additional buttons for performing actions, such as opening a web page or PDF.

12vdcicons.png

{"name":"12VDC Power","buttonArray":[{"href":"https://hwwiki.ddns.net/","color":"#000000","fill":"#0000ff","figure":"ElectricalHazard"},{"text":"Open","href":"https://hwwiki.ddns.net/","color":"#000000","fill":"#0000ff"}],"fill":"#ebebeb","leftArray":[{"portId":"left0","portColor":"#e88600","figure":"Output"},{"portId":"left2","portColor":"#000002","figure":"Output"}],"rightArray":[],"topArray":[],"bottomArray":[],"key":"12VDC22","size":"67 76","loc":"709.4688121714489 -308.66453398276076","figure":"Procedure","color":"#000000","thickness":1,"notes":"","textColor":"#484848"}

The buttons are created by adding a buttonArray (shown below). Buttons have either text or an icon (figure). The array below has one of each.

"buttonArray":[{"href":"https://hwwiki.ddns.net/","color":"#000000","fill":"#0000ff","figure":"ElectricalHazard"},{"text":"Open","href":"https://hwwiki.ddns.net/","color":"#000000","fill":"#0000ff"}]

How to Use in Articles

The following two elements have been given an id (view in the source) that can then be passed to a diagram using an iframe tag.

The second element has also been hidden from view.

This way it is possible to create a design on this page and then include it into articles using pure JSON.

Versions

Version
wiring14
  • Button to save to IPFS
  • Loads from IPFS CID
wiring13
  • Node icons refined to allow both figures and text
  • Node icons arranged vertically
wiring12
  • Node icons changed to buttons with option for text
  • Icon buttons open web pages in a target window
wiring11
  • Port directions (figures) added, so inputs and outputs can share the same identity colour
  • Autowiring updated to account for compatible directions
  • Node icons added
wiring10
  • Node shapes added to context menu
wiring9
  • Port selection added to port context menu
wiring8
  • Context menus for links
  • Context menus for changing node and link line type, colour, and thickness
  • Grouping on nodes using Ctrl+G with group context menus
wiring7
  • Port labels shown on hover
wiring6
  • Palette reduced in width
  • Download PNG
wiringFrame basic view with download SVG button

Improvements

  • Number terminals
  • Fix widths with top/bottom terminals
  • Hover text over terminals
  • Change colour of blocks
  • Position terminals (drag along sides)
  • Menu to change line thickness, type, colour, arrows.
  • Optional wire labels = controller number + terminal number (e.g. 101)