Example #1
0
            button_layout.addWidget(button)

        layout.addLayout(button_layout)
        text_layout = QVBoxLayout()
        text_layout.addWidget(fn_text_widget)
        text_layout.addWidget(self.progress_bar)
        layout.addLayout(text_layout)

    def iterate(self):
        try:
            self.iterator.next()
            self.progress_bar.setValue(self.progress_bar.value() + 1)
        except StopIteration:
            self.timer.stop()
            self.progress_bar.setValue(0)


if __name__ == "__main__":
    app = QApplication([])
    c = LivePlotClient(size=2**28)
    win = TestWindow()
    win.show()

    def clean():
        c.close()
        sys.exit()

    signal.signal(signal.SIGINT, lambda sig, frame: clean())
    app.exec_()
    clean()
Example #2
0
 def __init__(self, spacing=1):
     super(liveplot_prop, self).__init__(spacing)
     from liveplot import LivePlotClient
     self.client = LivePlotClient()
     self.client.clear()
Example #3
0
            last_raw_weight_stable -= 1

        if raw_weight > 0 and last_raw_weight_stable == 0:
            if data[2] == DATA_MODE_OUNCES:
                ounces = raw_weight * 0.1
                weight = math.ceil(ounces)
                print_weight = "%s oz" % ounces
            elif data[2] == DATA_MODE_GRAMS:
                grams = raw_weight
                weight = math.ceil(grams)
                print_weight = "%s g" % grams

        #print "stable weight: " + print_weight
        lp.append_y("scale", raw_weight)


lp = LivePlotClient()

VENDOR_ID = 0x0922
PRODUCT_ID = 0x8009

#print usb.core.find()
# find the USB device
dev = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID)

# use the first/default configuration
dev.set_configuration()
# first endpoint

listen()
Example #4
0
 def __init__(self, wave_names, spacing=1):
     super(liveplot_waves, self).__init__(spacing)
     from liveplot import LivePlotClient
     self.client = LivePlotClient()
     self.client.clear()
     self.wave_names = wave_names