Skip to content
Snippets Groups Projects
Select Git revision
  • 7969b31d980ac52af3e7970382eb680bf3999463
  • master default protected
2 results

tf.min.js

Blame
  • main.js 1.15 KiB
    //
    //
    // new node controller / HEAP 
    //
    // main.js
    //
    //
    // Jake Read at the Center for Bits and Atoms
    // (c) Massachusetts Institute of Technology 2018
    //
    // This work may be reproduced, modified, distributed, performed, and
    // displayed for any purpose, but must acknowledge the mods
    // project. Copyright is retained and must be preserved. The work is
    // provided as is; no warranty is provided, and users accept all
    // liability.
    
    /*
    
    RULES:
    
    modules are objects having inputs, outputs, and state 
    programs are assemblies of modules 
    
    */
    
    // business 
    const Reps = require('./reps.js')
    const Programs = require('./programs.js')
    
    var program = Programs.new('hw unit test')
    
    var link = Programs.loadModuleFromSource(program, './modules/hardware/atkseriallink.js')
    var atkbbs = Programs.loadModuleFromSource(program, './modules/hardware/atkbbs.js')
    
    atkbbs.description.position = {
    	left: 10,
    	top: 200
    }
    
    link.description.position = {
    	left:475,
    	top: 100
    }
    
    link.attach(atkbbs.route)
    
    //program = Programs.open('programs/default.json')
    
    // UI 
    const View = require('./views.js')
    View.startHttp() 
    View.startWs() 
    
    Programs.assignSocket(View.uiSocket)
    View.assignProgram(program)