Esempio n. 1
0
 def __init__(self, name):
     Node.__init__(self,
                   name,
                   allowAddOutput=False,
                   terminals={
                       'path': {
                           'io': 'in'
                       },
                       'datadict': {
                           'io': 'out'
                       },
                       'coords': {
                           'io': 'out'
                       },
                       'normals': {
                           'io': 'out'
                       },
                       'colors': {
                           'io': 'out'
                       },
                       'clusters': {
                           'io': 'out'
                       },
                       'segment_graph': {
                           'io': 'out'
                       },
                       'seg_link_flip': {
                           'io': 'out'
                       },
                       'ma_segment_lidx': {
                           'io': 'out'
                       },
                   })
Esempio n. 2
0
 def __init__(self, name):
     terminals = {
         'dataInX': dict(io='in'),
         'dataOutX': dict(io='out')
     }
     self._dataInX = np.array([])
     Node.__init__(self, name, terminals=terminals)
Esempio n. 3
0
 def __init__(self, name):
     terminals = {
         'accelX': dict(io='in'),
         'accelY': dict(io='in'),
         'accelZ': dict(io='in')
     }
     Node.__init__(self, name, terminals=terminals)
Esempio n. 4
0
    def __init__(self, name, proto=None, weightsFile=None, filePath=None):
        Node.__init__(self, name, allowAddInput=True, allowAddOutput=True, allowRemove=True)

        solverFD = SolverProto.DESCRIPTOR

        self.param = LParameter.create(repeated=False, fieldDescriptor=solverFD, expanded=True)
        for param in self.param.children():
            param.setToDefault()
        t = ptree.ParameterTree()
        t.addParameters(self.param, depth=1, showTop=False)
        t.setMinimumHeight(325)
        t.setVerticalScrollBarPolicy(pg.QtCore.Qt.ScrollBarAlwaysOff)
        self.ui = t
        self.proto = SolverProto()
        self.trainLoss, self.testLoss, self.testAcc = None, None, None
        self.niter, self.testInterval = None, None
        if proto is not None:
            self.setProto(proto)
        # if a filePath is given, we use it regardless of the directory of the solver prototxt, and will write a
        # temporary file in that directory for training purposes. otherwise we give the path of the solver file,
        # and hope the train file is in that directory, or else crash!
        if filePath is None:
            if proto is not None:
                filePath = os.path.dirname(proto)
            else:
                filePath = os.curdir
        self.filePath = filePath
        self.weights = weightsFile
Esempio n. 5
0
 def __init__(self, name, n=100):
     Node.__init__(self,
                   name,
                   terminals={
                       'xDataIn': {
                           'io': 'in'
                       },
                       'yDataIn': {
                           'io': 'in'
                       },
                       'zDataIn': {
                           'io': 'in'
                       },
                       'xDataOut': {
                           'io': 'out'
                       },
                       'yDataOut': {
                           'io': 'out'
                       },
                       'zDataOut': {
                           'io': 'out'
                       }
                   })
     self.values = {'x': [], 'y': [], 'z': []}
     self.limit = n
Esempio n. 6
0
        def __init__(self, name):
            Node.__init__(self,
                          name,
                          terminals={
                              'input': {
                                  'io': 'in',
                                  'renamable': True,
                                  'multiable': True
                              },
                              'output': {
                                  'io': 'out',
                                  'renamable': True,
                                  'multiable': True
                              },
                          },
                          allowAddInput=True,
                          allowAddOutput=True)

            self.ui = QtGui.QWidget()
            self.layout = QtGui.QGridLayout()
            self.text = QtGui.QTextEdit()
            self.text.setTabStopWidth(30)
            self.text.setPlainText(
                "# Access inputs as args['input_name']\nreturn {'output': None} ## one key per output terminal"
            )
            self.layout.addWidget(self.text, 1, 0, 1, 2)
            self.ui.setLayout(self.layout)

            #QtCore.QObject.connect(self.addInBtn, QtCore.SIGNAL('clicked()'), self.addInput)
            #self.addInBtn.clicked.connect(self.addInput)
            #QtCore.QObject.connect(self.addOutBtn, QtCore.SIGNAL('clicked()'), self.addOutput)
            #self.addOutBtn.clicked.connect(self.addOutput)
            self.text.focusOutEvent = self.focusOutEvent
            self.lastText = None
    def __init__(self, name):
        terminals = {"data": dict(io="out"), "categories": dict(io="out")}

        self.ui = QtGui.QWidget()
        self.layout = QtGui.QGridLayout()

        label = QtGui.QLabel("Textfile Input:")
        self.layout.addWidget(label)
        self.text = QtGui.QLineEdit()
        self.layout.addWidget(self.text)
        self.reload_button = QtGui.QPushButton("read")
        self.layout.addWidget(self.reload_button)
        self.ui.setLayout(self.layout)
        self.reload_button.clicked.connect(self._add_file)
        self.text.setText("example_1.csv")

        self.files = {
            "walk": ["walk_1.csv", "walk_2.csv", "walk_3.csv", "walk_4.csv"],
            "hop": ["hop_1.csv", "hop_2.csv", "hop_3.csv", "hop_4.csv"],
            "stand": ["stand_1.csv", "stand_2.csv", "stand_3.csv", "stand_4.csv"],
        }

        self.output = []
        self.categories = []

        self._compute_files()

        Node.__init__(self, name, terminals=terminals)
    def __init__(self, name):
        terminals = {
            'data': dict(io='out'),
            'categories': dict(io='out'),
        }

        self.ui = QtGui.QWidget()
        self.layout = QtGui.QGridLayout()

        label = QtGui.QLabel("Textfile Input:")
        self.layout.addWidget(label)
        self.text = QtGui.QLineEdit()
        self.layout.addWidget(self.text)
        self.reload_button = QtGui.QPushButton("read")
        self.layout.addWidget(self.reload_button)
        self.ui.setLayout(self.layout)
        self.reload_button.clicked.connect(self._add_file)
        self.text.setText("example_1.csv")

        self.files = {
            'walk': ['walk_1.csv', 'walk_2.csv',
                     'walk_3.csv', 'walk_4.csv'],
            'hop': ['hop_1.csv', 'hop_2.csv',
                    'hop_3.csv', 'hop_4.csv'],
            'stand': ['stand_1.csv', 'stand_2.csv',
                      'stand_3.csv', 'stand_4.csv']
        }

        self.output = []
        self.categories = []

        self._compute_files()

        Node.__init__(self, name, terminals=terminals)
Esempio n. 9
0
 def __init__(self, name):
     Node.__init__(self, name, allowAddOutput=False, terminals={
         'mah': {'io':'in'},
         'ma_idx': {'io':'in'},
         'triangulation_3': {'io':'out'},
         'info_map': {'io':'out'}
     })
 def __init__(self, name):
     self.plot = None
     ## Init node with single input terminal
     Node.__init__(self, name, terminals={
         'dataIn': {'io': 'in'}
         #'dataOut'
     })
Esempio n. 11
0
    def __init__(self, name):
        terminals = {
            'accelX': dict(io='out'),
            'accelY': dict(io='out'),
            'accelZ': dict(io='out'),
        }
        self.wiimote = None
        self._acc_vals = []
        self.ui = QtGui.QWidget()
        self.layout = QtGui.QGridLayout()

        label = QtGui.QLabel("Bluetooth MAC address:")
        self.layout.addWidget(label)
        self.text = QtGui.QLineEdit()
        self.layout.addWidget(self.text)
        label2 = QtGui.QLabel("Update rate (Hz)")
        self.layout.addWidget(label2)
        self.update_rate_input = QtGui.QSpinBox()
        self.update_rate_input.setMinimum(0)
        self.update_rate_input.setMaximum(60)
        self.update_rate_input.setValue(20)
        self.update_rate_input.valueChanged.connect(self.set_update_rate)
        self.layout.addWidget(self.update_rate_input)

        self.connect_button = QtGui.QPushButton("connect")
        self.layout.addWidget(self.connect_button)
        self.ui.setLayout(self.layout)
        self.connect_button.clicked.connect(self.connect_wiimote)
        self.btaddr = "b8:ae:6e:18:5d:ab"  # for ease of use
        self.text.setText(self.btaddr)
        self.update_timer = QtCore.QTimer()
        self.update_timer.timeout.connect(self.update_all_sensors)

        Node.__init__(self, name, terminals=terminals)
Esempio n. 12
0
    def __init__(self, name):
        terminals = {
            'categoryIn': dict(io='in')
        }
        Node.__init__(self, name, terminals)

        self.recog = []
Esempio n. 13
0
    def __init__(self, name):
        terminals = {
            'categoryOut': dict(io='out'),
            'dataOut': dict(io='out'),
        }

        self.trainingData = []
        self.categories = []
        self.directory = '/trainingdata/'

        # get current directory
        self.curdir = os.path.dirname(os.path.realpath("__file__"))

        self.ui = QtGui.QWidget()
        self.layout = QtGui.QGridLayout()

        label = QtGui.QLabel("Filename:")
        self.layout.addWidget(label)
        self.text = QtGui.QLineEdit()
        self.layout.addWidget(self.text)

        self.read_file_button = QtGui.QPushButton("read")
        self.layout.addWidget(self.read_file_button)
        self.ui.setLayout(self.layout)
        self.read_file_button.clicked.connect(self.readFiles)

        Node.__init__(self, name, terminals=terminals)
Esempio n. 14
0
    def __init__(self, name):
        terminals = {
            'accelX': dict(io='out'),
            'accelY': dict(io='out'),
            'accelZ': dict(io='out'),
        }
        self.wiimote = None
        self._acc_vals = []
        self.ui = QtGui.QWidget()
        self.layout = QtGui.QGridLayout()

        label = QtGui.QLabel("Bluetooth MAC address:")
        self.layout.addWidget(label)
        self.text = QtGui.QLineEdit()
        self.layout.addWidget(self.text)
        label2 = QtGui.QLabel("Update rate (Hz)")
        self.layout.addWidget(label2)
        self.update_rate_input = QtGui.QSpinBox()
        self.update_rate_input.setMinimum(0)
        self.update_rate_input.setMaximum(60)
        self.update_rate_input.setValue(20)
        self.update_rate_input.valueChanged.connect(self.set_update_rate)
        self.layout.addWidget(self.update_rate_input)

        self.connect_button = QtGui.QPushButton("connect")
        self.layout.addWidget(self.connect_button)
        self.ui.setLayout(self.layout)
        self.connect_button.clicked.connect(self.connect_wiimote)
        self.btaddr = "b8:ae:6e:1b:ad:a0"  # for ease of use
        self.text.setText(self.btaddr)
        self.update_timer = QtCore.QTimer()
        self.update_timer.timeout.connect(self.update_all_sensors)

        Node.__init__(self, name, terminals=terminals)
Esempio n. 15
0
 def __init__(self, name):
     self.view = None
     self.para = None
     self.thisname = name
     self.para_showed = False
     terminals = {'dataOut': dict(io='out')}
     Node.__init__(self, name, terminals=terminals, allowAddInput=True)
Esempio n. 16
0
 def __init__(self, name):
     terminals = {
         'dataInX': dict(io='in'),
         'dataInY': dict(io='in'),
         'dataInZ': dict(io='in'),
     }
     Node.__init__(self, name, terminals=terminals)
Esempio n. 17
0
 def __init__(self, name):
     terminals = {
         'categories': dict(io='in'),
         'trainigData': dict(io='in'),
         'classifyData': dict(io='in'),
         'classification': dict(io='out'),
     }
     Node.__init__(self, name, terminals=terminals)
Esempio n. 18
0
    def removeTerminal(self, term):
        """Remove the specified terminal from this Node. May specify either the
        terminal's name or the terminal itself.

        Causes sigTerminalRemoved to be emitted."""
        if isinstance(term, NetTerminal):
            name = term._name
        Node.removeTerminal(self, name)
Esempio n. 19
0
 def __init__(self, name):
     terminals = {
         'accelXIn': dict(io='in'),
         'accelZIn': dict(io='in'),
         'normalVectorX': dict(io='out'),
         'normalVectorZ': dict(io='out'),
     }
     Node.__init__(self, name, terminals=terminals)
Esempio n. 20
0
    def __init__(self, name):
        terminals = {
            'inX': dict(io='in'),
            'inY': dict(io='in'),
            'inZ': dict(io='in'),
            'fft': dict(io='out')
        }

        Node.__init__(self, name, terminals=terminals)
    def __init__(self, name):
        terminals = {
            'irVals': dict(io='in'),
            'irX': dict(io='out'),
            'irY': dict(io='out')
        }
        self._ir_vals = []

        Node.__init__(self, name, terminals=terminals)
Esempio n. 22
0
 def __init__(self, name):
     print("Acceleration Values:")
     terminals = {
         'accelXIn': dict(io='in'),
         'accelYIn': dict(io='in'),
         'accelZIn': dict(io='in'),
     }
     self._acc_vals = []
     Node.__init__(self, name, terminals=terminals)
    def __init__(self, name):
        terminals = {
            'irVals': dict(io='in'),
            'irX': dict(io='out'),
            'irY': dict(io='out')
        }
        self._ir_vals = []

        Node.__init__(self, name, terminals=terminals)
Esempio n. 24
0
    def __init__(self, name):
        terminals = {
            'dataIn': dict(io='in'),
            'dataOut': dict(io='out'),
        }

        self.bufferSize = bufferSize

        Node.__init__(self, name, terminals=terminals)
Esempio n. 25
0
 def __init__(self, name):
     terminals = {
         'Znormal': dict(io='in'),
         'Xnormal': dict(io='in'),
         'VectorX': dict(io='out'),
         'VectorY': dict(io='out'),
     }
     self._stuff = np.array([])
     Node.__init__(self, name, terminals=terminals)
    def __init__(self, name):
        terminals = {
            "trainingData": dict(io="in"),
            "testData": dict(io="in"),
            "categories": dict(io="in"),
            "category": dict(io="out"),
        }

        Node.__init__(self, name, terminals=terminals)
    def __init__(self, name):
        terminals = {
            'trainingData': dict(io='in'),
            'testData': dict(io='in'),
            'categories': dict(io='in'),
            'category': dict(io='out'),
        }

        Node.__init__(self, name, terminals=terminals)
Esempio n. 28
0
 def __init__(self, name):
     terminals = {
         'dataIn': dict(io='in'),
         'X': dict(io='out'),
         'Y': dict(io='out'),
     }
     self._dataIn = [0 in range(100)]
     self.frequency_array = [0 in range(100)]
     Node.__init__(self, name, terminals=terminals)
 def __init__(self, name):
     terminals = {
         'Znormal': dict(io='in'),
         'Xnormal': dict(io='in'),
         'VectorX': dict(io='out'),
         'VectorY': dict(io='out'),
     }
     self._stuff = np.array([])
     Node.__init__(self, name, terminals=terminals)
Esempio n. 30
0
    def __init__(self, name):
        terminals = {
            'In': dict(io='in'),
            'Out': dict(io='out'),
        }
        self._ir_vals = []
        self._xy_vals = []
        self.avg_val = None

        Node.__init__(self, name, terminals=terminals)
Esempio n. 31
0
    def __init__(self, name):
        terminals = {
            'xIn': dict(io='in'),
            'yIn': dict(io='in'),
            'zIn': dict(io='in'),
            'dataOut': dict(io='out'),
        }
        self._size = []

        Node.__init__(self, name, terminals=terminals)
Esempio n. 32
0
 def __init__(self, name):
     '''terminals = { 
         #'In1': {'io':'in'}, 'In2': {'io':'in'},
         'In1': dict(io='in'), 'In2': dict(io='in'),
         'Out': dict(io='out'),
     }
     CtrlNode.__init__(self, name, terminals=terminals)
     Node.__init__(self, name, terminals={'In1': {'io':'in'}, 'In2': {'io':'in'}})'''
     Node.__init__(self, name, terminals={'In1': {'io':'in'}, 'In2': {'io':'in'},
         'Out': {'io':'out'}})
Esempio n. 33
0
 def __init__(self, name):
     Node.__init__(self, name, allowAddOutput=False, terminals={
         'info_map': {'io':'in'},
         'triangulation_3i': {'io':'in'},
         'triangulation_3o': {'io':'out'},
         'interior_cells': {'io':'out'},
         'boundary_triangles': {'io':'out'},
         'interior_triangles': {'io':'out'},
         'exterior_triangles': {'io':'out'}
     })
    def __init__(self, name):
        terminals = {
            'samples': dict(io='in'),
            'accelX': dict(io='in'),
            'accelY': dict(io='in'),
            'accelZ': dict(io='in'),
            'samplesFrequencies': dict(io='out'),
            'testFrequencies': dict(io='out'),
        }

        Node.__init__(self, name, terminals=terminals)
Esempio n. 35
0
    def __init__(self, name):
        terminals = {
            'irData': dict(io='in'),
        }
        self._ir_vals = []
        self._xy_vals = []
        self.plot = None
        self.spi = None
        self.avg_val = (0, 0)

        Node.__init__(self, name, terminals=terminals)
Esempio n. 36
0
 def __init__(self, name):
     terminals = {
         'rawIn': dict(io='in'),
         'filterIn': dict(io='in'),
     }
     self.once = 0  # control var (deletable)
     self.bufferSize = 10  # fft buffer size
     self.plotWidget = None
     self.curveRaw = None
     self.curveFilter = None
     Node.__init__(self, name, terminals)
 def __init__(self, name, n=100):
     Node.__init__(self, name, terminals={
         'xDataIn': {'io': 'in'},
         'yDataIn': {'io': 'in'},
         'zDataIn': {'io': 'in'},
         'xDataOut': {'io': 'out'},
         'yDataOut': {'io': 'out'},
         'zDataOut': {'io': 'out'}
     })
     self.values = {'x': [], 'y': [], 'z': []}
     self.limit = n
    def __init__(self, name):
        terminals = {
            "samples": dict(io="in"),
            "accelX": dict(io="in"),
            "accelY": dict(io="in"),
            "accelZ": dict(io="in"),
            "samplesFrequencies": dict(io="out"),
            "testFrequencies": dict(io="out"),
        }

        Node.__init__(self, name, terminals=terminals)
Esempio n. 39
0
 def __init__(self, name):
     self.MAX_LENGTH = 200
     self.xData = []
     self.yData = []
     self.zData = []
     ## Init node with single input terminal
     Node.__init__(self, name, terminals={
         'dataIn': {'io': 'in'},
         'xOut': dict(io='out'),
         'yOut': dict(io='out'),
         'zOut': dict(io='out')
     })
    def __init__(self, name):
        terminals = {"classification": dict(io="in")}

        self.ui = QtGui.QWidget()
        self.layout = QtGui.QGridLayout()

        self.label_desc = QtGui.QLabel("Current Activity:")
        self.layout.addWidget(self.label_desc)
        self.label_activity = QtGui.QLabel("No activity...")
        self.layout.addWidget(self.label_activity)
        self.ui.setLayout(self.layout)

        Node.__init__(self, name, terminals=terminals)
Esempio n. 41
0
    def __init__(self, name):
        terminals = {
            'dataIn': dict(io='in'),
            'categoryIn': dict(io='in'),
            'classifyIn': dict(io='in'),
            'prediction': dict(io='out'),
        }

        self.classifier = svm.SVC()
        self.prediction = []
        self.oldData = []

        Node.__init__(self, name, terminals=terminals)
Esempio n. 42
0
    def __init__(self, name):
        terminals = {
            'irData': dict(io='in'),
        }
        self._ir_vals = []
        self._xy_vals = []
        self.plot = None
        self.spi = None
        self.avg_vals = []
        self.THETA_FOV = 0.04020182291
        self.DISTANCE = 1000
        # at ~20 cm distance between candles in test setup

        Node.__init__(self, name, terminals=terminals)
Esempio n. 43
0
 def __init__(self, name):
     Node.__init__(self,
                   name,
                   terminals={
                       'values': {
                           'io': 'in'
                       },
                       'colors': {
                           'io': 'out'
                       },
                       'colormap': {
                           'io': 'out'
                       }
                   })
Esempio n. 44
0
 def __init__(self, name):
     Node.__init__(self,
                   name,
                   terminals={
                       'mah': {
                           'io': 'in'
                       },
                       'seg_id_range': {
                           'io': 'out'
                       },
                       'stats': {
                           'io': 'out'
                       }
                   })
    def __init__(self, name):
        Node.__init__(self, name, terminals={'In1': {'io':'in'}, 'In2': {'io':'in'}})

        #Create an oscilloscope
        self.osc_widget = Oscilloscope()

        # Create and and a new dock on top of tools and add oscilloscope to it
        self.dock = Dock(name)
        global_data.area.addDock(self.dock, 'above', global_data.tool_dock)
        self.dock.addWidget(self.osc_widget)

        # Create plots for both inputs
        self.plot_item_1 = self.osc_widget.pwidget.plot()
        self.plot_item_2 = self.osc_widget.pwidget2.plot()
Esempio n. 46
0
 def __init__(self, name):
     Node.__init__(self,
                   name,
                   terminals={
                       'gi': {
                           'io': 'in'
                       },
                       'mah': {
                           'io': 'in'
                       },
                       'go': {
                           'io': 'out'
                       }
                   })
Esempio n. 47
0
    def __init__(self, name):
        Node.__init__(self, name, terminals={'In1': {'io':'in'}, 'In2': {'io':'in'}})

        #Create an oscilloscope
        self.osc_widget = Oscilloscope()

        # Create and and a new dock on top of tools and add oscilloscope to it
        self.dock = Dock(name)
        global_data.area.addDock(self.dock, 'above', global_data.tool_dock)
        self.dock.addWidget(self.osc_widget)

        # Create plots for both inputs
        self.plot_item_1 = self.osc_widget.pwidget.plot()
        self.plot_item_2 = self.osc_widget.pwidget2.plot()
Esempio n. 48
0
 def __init__(self, name):
     Node.__init__(
         self,
         name,
         allowAddOutput=False,
         terminals={
             'path': {
                 'io': 'in'
             },
             'datadict': {
                 'io': 'in'
             }
             # 'clusters': {'io':'in'},
             # 'segment_graph': {'io':'out'}
         })
Esempio n. 49
0
    def __init__(self, name):
        terminals = {
            'accelX': dict(io='out'),
            'accelY': dict(io='out'),
            'accelZ': dict(io='out'),
        }
        self.wiimote = None
        self._acc_vals = []

        # update timer
        self.update_timer = QtCore.QTimer()
        self.update_timer.timeout.connect(self.update_all_sensors)

        # super()
        Node.__init__(self, name, terminals=terminals)
    def __init__(self, name):
        terminals = {
            'classification': dict(io='in'),
        }

        self.ui = QtGui.QWidget()
        self.layout = QtGui.QGridLayout()

        self.label_desc = QtGui.QLabel("Current Activity:")
        self.layout.addWidget(self.label_desc)
        self.label_activity = QtGui.QLabel("No activity...")
        self.layout.addWidget(self.label_activity)
        self.ui.setLayout(self.layout)

        Node.__init__(self, name, terminals=terminals)
    def __init__(self, name):
        terminals = {
            'irVals': dict(io='in'),
            'irX0': dict(io='out'),
            'irY0': dict(io='out'),
            'irX1': dict(io='out'),
            'irY1': dict(io='out'),
            'irX2': dict(io='out'),
            'irY2': dict(io='out'),
            'irX3': dict(io='out'),
            'irY3': dict(io='out')
        }
        self._ir_vals = []

        Node.__init__(self, name, terminals=terminals)
Esempio n. 52
0
    def __init__(self, name, **kwargs):
        self.plot = None
        self.plots = {}  # list of available plots user may select from
        self.ui = None
        self.imageItem = None
        self.plotItem = None
        self.scatterDefaults = dict(symbol='+', symbolPen='r', symbolSize=8, symbolBrush='r', pen=None)
        self.curveDefaults = dict(pen='w')

        opts = dict(allowAddInput=True,
                       terminals=dict(image={'io': 'in'}, points={'io': 'in'}, curves={'io': 'in'}, rois={'io': 'in'}))
        opts.update(**kwargs)

        ## Initialize node with only a single input terminal
        Node.__init__(self, name, **opts)
 def __init__(self, name):
     self.plot = None
     self.curveOrig = None
     self.curveNoise = None
     self.curveKernel = None
     self.curveConv = None
     
     self.kernel = [ 0 for i in range(0,100) ]
     for i in range(45,55):
         self.kernel[i] = 0.1  # range von 45 bis 55 = 10 --> 0.1 (ein zehntel!)
     
     Node.__init__(self, name, terminals={
         'origIn': dict(io='in'),
         'noiseIn': dict(io='in'),
         'convData': dict(io='out'),
     })
Esempio n. 54
0
 def __init__(self, name):
     self.view = None
     Node.__init__(self,
                   name,
                   terminals=OrderedDict([('X', dict(io='in')),
                                          ('Y', dict(io='in')),
                                          ('dY',
                                           dict(io='in',
                                                optional=True))]))
     self.txt = addWidget(self.graphicsItem(), 'plotText')
     self.curveName = self._name
     self.curve = self.addCurve(
         self.plot, self.curveName
     )  #self.plot is set by the parent prior to initialization
     self.txt.curve = self.curve
     self.sigRenamed.connect(self.renamed)
Esempio n. 55
0
    def __init__(self, name):
        terminals = {'fft': dict(io='in'), 'gesture': dict(io='out')}

        print("initialized SVM NODE")

        self.training_mode = False
        self.recognition_mode = False

        self.saved_gestures = {}
        self.current_recording = []

        self.category_to_gesture = {}

        self.classifier = svm.SVC()

        Node.__init__(self, name, terminals=terminals)
Esempio n. 56
0
    def __init__(self, name):
        terminals = {
            'irData': dict(io='in'),
        }
        self._ir_vals = []
        self._xy_vals = []
        self.plot = None
        self.spi = None
        self.spi2 = None
        self.avg_val = (0, 0)
        self.path = []
        self.true = False
        self.wiimote = None
        self.aPressed = False

        Node.__init__(self, name, terminals=terminals)
Esempio n. 57
0
    def __init__(self, name):
        terminals = {
            'accelX': dict(io='out'),
            'accelY': dict(io='out'),
            'accelZ': dict(io='out'),
        }
        self.wiimote = None
        self._acc_vals = []

        # Configuration UI
        self.ui = QtGui.QWidget()
        self.layout = QtGui.QGridLayout()

        label = QtGui.QLabel("Bluetooth MAC address:")
        self.layout.addWidget(label)
        self.text = QtGui.QLineEdit()
        self.layout.addWidget(self.text)

        label2 = QtGui.QLabel("Update rate (Hz)")
        self.layout.addWidget(label2)

        self.update_rate_input = QtGui.QSpinBox()
        self.update_rate_input.setMinimum(0)
        self.update_rate_input.setMaximum(60)
        self.update_rate_input.setValue(20)
        self.update_rate_input.valueChanged.connect(self.set_update_rate)
        self.layout.addWidget(self.update_rate_input)

        self.connect_button = QtGui.QPushButton("connect")
        self.connect_button.clicked.connect(self.connect_wiimote)
        self.layout.addWidget(self.connect_button)
        self.ui.setLayout(self.layout)

        # update timer
        self.update_timer = QtCore.QTimer()
        self.update_timer.timeout.connect(self.update_all_sensors)

        # super()
        Node.__init__(self, name, terminals=terminals)

        try:
            self.btaddr = sys.argv[1]  # set given value
            self.text.setText(self.btaddr)
            self.connect_wiimote()
        except IndexError:
            self.btaddr = "B8:AE:6E:EF:D2:D0"  # set some example
            self.text.setText(self.btaddr)
Esempio n. 58
0
    def __init__(self, terminals=None, name=None, filePath=None):
        pg.setConfigOption('background', 'w')
        pg.setConfigOption('foreground', 'k')

        if name is None:
            name = "Flowchart"
        if terminals is None:
            terminals = {}
        self.filePath = filePath
        Node.__init__(
            self, name, allowAddInput=True, allowAddOutput=True
        )  ## create node without terminals; we'll add these later

        self.inputWasSet = False  ## flag allows detection of changes in the absence of input change.
        self._nodes = {}
        self.nextZVal = 10
        #self.connects = []
        #self._chartGraphicsItem = FlowchartGraphicsItem(self)
        self._widget = None
        self._scene = None
        self.processing = False  ## flag that prevents recursive node updates

        self.widget()

        self.inputNode = Node('Input', allowRemove=False, allowAddOutput=True)
        self.outputNode = Node('Output', allowRemove=False, allowAddInput=True)
        self.addNode(self.inputNode, 'Input', [-150, 0])
        self.addNode(self.outputNode, 'Output', [300, 0])

        self.outputNode.sigOutputChanged.connect(self.outputChanged)
        self.outputNode.sigTerminalRenamed.connect(
            self.internalTerminalRenamed)
        self.inputNode.sigTerminalRenamed.connect(self.internalTerminalRenamed)
        self.outputNode.sigTerminalRemoved.connect(
            self.internalTerminalRemoved)
        self.inputNode.sigTerminalRemoved.connect(self.internalTerminalRemoved)
        self.outputNode.sigTerminalAdded.connect(self.internalTerminalAdded)
        self.inputNode.sigTerminalAdded.connect(self.internalTerminalAdded)

        self.viewBox.autoRange(padding=0.04)

        for name, opts in terminals.items():
            self.addTerminal(name, **opts)
Esempio n. 59
0
 def __init__(self, name):
     Node.__init__(self,
                   name,
                   terminals={
                       'vpairs': {
                           'io': 'in'
                       },
                       'gi': {
                           'io': 'in'
                       },
                       'start': {
                           'io': 'out'
                       },
                       'end': {
                           'io': 'out'
                       },
                       'count': {
                           'io': 'out'
                       }
                   })