{"id":86,"date":"2009-03-01T17:16:34","date_gmt":"2009-03-02T01:16:34","guid":{"rendered":"http:\/\/sambaker.net\/neattools\/?p=86"},"modified":"2009-03-01T17:16:34","modified_gmt":"2009-03-02T01:16:34","slug":"roadblock-ahead","status":"publish","type":"post","link":"https:\/\/sambaker.net\/neattools\/?p=86","title":{"rendered":"Roadblock Ahead"},"content":{"rendered":"<p>Few more changes brings me closer to actual NeatTools behavior, and data flow.\u00c2\u00a0 When evoking a module&#8217;s engine() method, the module is now passed the incoming port number.  Every module has three arrays:mom, kid, and connectionList.  When a connection is created the arrays are updated. Both kid and mom are arrays of modules, connectionList is a list of outputs to inputs.  A connection is made like this:<\/p>\n<pre name=\"code\" class=\"AS3:nocontrols:nogutter\">\r\ncon1.drawConn (button1, led1, 0, 0);\r\n<\/pre>\n<p>which means draw a connection from button1 to led1 from output port 0 to input port 0 (I&#8217;m only using left and right ports for now).  In the constructor for the connection, the arrays I mentioned are updated.  So assuming there were no previous connections the result of the connection above would be:<\/p>\n<pre name=\"code\" class=\"AS3:nocontrols:nogutter\">\r\nbutton1.kid[0] == led1\r\nled1.mom[0] == button1\r\n\/\/and\r\nbutton1.connectList[0] == 0\r\n<\/pre>\n<p>So when you press button1, it envokes led1&#8217;s engine method like this:<\/p>\n<pre name=\"code\" class=\"AS3:nocontrols:nogutter\">\r\nfor (var i:int = 0; i < kid.length;i++)\r\n{\r\n     kid[i].engine(connectList[i]);\r\n}\r\n<\/pre>\n<p>And for now, that works.  But it assumes a few things. First that the connectList length will match the total number of ports.  If I connect something to 0 and 2, the code above will tell the first module that the connection came from port 0 and will fail to connect to the second module, because it will be trying kid[1] instead of kid[2].  I'll have to puzzle that one out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Few more changes brings me closer to actual NeatTools behavior, and data flow.\u00c2\u00a0 When evoking a module&#8217;s engine() method, the module is now passed the incoming port number. Every module has three arrays:mom, kid, and connectionList. When a connection is created the arrays are updated. Both kid and mom are arrays of modules, connectionList is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=\/wp\/v2\/posts\/86"}],"collection":[{"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=86"}],"version-history":[{"count":10,"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=\/wp\/v2\/posts\/86\/revisions\/96"}],"wp:attachment":[{"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sambaker.net\/neattools\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}