// genesis -- tutorial 8 -- net_out.g function make_xview(path, field, form, label, xorig, yorig, min, max) str path, field, form, label int xorig, yorig float min, max create xform {form} [{xorig}, {yorig}, 450, 450] create xlabel {form}/label [5%, 5%, 90%, 30 ] \ -label {label} create xdraw {form}/drawsquare [5%, 15%, 90%, 80%] setfield ^ wx 1.0 wy 1.0 create xview {form}/drawsquare/cells [5%, 15%, 90%, 80%] setfield ^ \ path {path} \ field {field} \ autoscale 0 \ value_min[0] {min} \ value_max[0] {max} \ viewmode colorview \ sizescale 0.07 useclock {form}/drawsquare/cells 1 // xviews chew up a lot of time, // so use a slower clock xshow {form} end // Make the view for the input cells: make_xview /in/input[] state \ /xin "Inputs" \ 300 0 \ 0.0 1.6 // Make the view for the network cells: make_xview /network/cell[]/soma Vm \ /xout "Network" \ 700 0 \ -0.100 0.050 // Make a simple control panel: function step_for(dialog) str dialog step {getfield {dialog} value} -t end create xform /xcontrol [0, 0, 300, 192] create xdialog /xcontrol/go -script "step_for " -value 0.5 \ -label "step for (secs): " create xbutton /xcontrol/step -script "step" create xbutton /xcontrol/stop -script "stop" create xbutton /xcontrol/reset -script "reset" create xbutton /xcontrol/quit -script "quit" create xdialog /xcontrol/current_time -value 0.000 \ -label "current time (secs): " xshow /xcontrol function set_current_time floatformat %.3f // three decimal places setfield /xcontrol/current_time value {getstat -time} floatformat %g end create script_out /timer setfield /timer command set_current_time useclock /timer 2