From fc65e6fe40f03c5961e7853a677529102476232c Mon Sep 17 00:00:00 2001 From: urvi2107 <70818579+urvi2107@users.noreply.github.com> Date: Wed, 31 Aug 2022 18:55:22 +0100 Subject: [PATCH] Add files via upload --- completeInterface.ui | 163 +++++++++++++++++++++++++++++++++++++++++++ diagnostic.py | 71 +++++++++++++++++++ 2 files changed, 234 insertions(+) create mode 100644 completeInterface.ui create mode 100644 diagnostic.py diff --git a/completeInterface.ui b/completeInterface.ui new file mode 100644 index 0000000..d2e88ed --- /dev/null +++ b/completeInterface.ui @@ -0,0 +1,163 @@ + + + MainWindow + + + + 0 + 0 + 803 + 623 + + + + MainWindow + + + + + + 20 + 280 + 271 + 31 + + + + snap + + + + + + 300 + 280 + 261 + 31 + + + + live + + + + + + 580 + 20 + 201 + 261 + + + + Spectrometer - Integration Time + + + + + 10 + 60 + 82 + 17 + + + + 5 ms + + + + + + 10 + 130 + 82 + 17 + + + + 10 ms + + + + + + 10 + 200 + 82 + 17 + + + + 60 ms + + + + + + + 20 + 10 + 541 + 261 + + + + + + + 20 + 320 + 541 + 261 + + + + + + + 580 + 370 + 81 + 41 + + + + RUN ALL + + + + + + 680 + 370 + 81 + 41 + + + + STOP + + + + + + + 0 + 0 + 803 + 21 + + + + + + + + PlotInfoDObject + QPlainTextEdit +
plotInfoDObject.h
+
+
+ + +
diff --git a/diagnostic.py b/diagnostic.py new file mode 100644 index 0000000..d995f2e --- /dev/null +++ b/diagnostic.py @@ -0,0 +1,71 @@ +from itom import dataIO +from itom import ui +from itom import dataObject +from itom import * +import numpy as np +import matplotlib.pyplot as plt +from itomUi import ItomUi + +spectrometer = dataIO("AvantesAvaSpec", 6546, 1641) +camera = dataIO("OpenCVGrabber") #change the camera depending on which ones we are using +win = ui("completeInterface.ui", ui.TYPEWINDOW, childOfMainWindow=True) + + +def show(self, modalLevel=0): + self.gui.show(modalLevel) + +def integrationTime_changed(): + time =win.timelineEdit["text"] + spectrometer.setParam("integration_time",time) + # if win.radio1["checked"]: + # spectrometer.setParam("integration_time", 0.005) + # elif win.radio2["checked"]: + # spectrometer.setParam("integration_time", 0.010) +# + # spectrometer.setParam("integration_time", 0.060) + + +def snap(): + data = dataObject() + spectrometer.startDevice() + spectrometer.acquire() + spectrometer.getVal(data) + dataCopy = data.copy() + + + plot(data, properties={"title": "Spectrometer snapshot","valueLabel":'Counts',"axisLabel":"Wavelength / nm"}) + + data2 = dataObject() + camera.startDevice() + camera.acquire() + camera.getVal(data2) + dataCopy2 = data2.copy() + plot(data2) + +def live(): + d = dataObject() + spectrometer.startDevice() + spectrometer.acquire() + spectrometer.getVal(d) + liveImage(spectrometer) + # properties={"title": "Spectrometer snapshot","valueLabel":'Counts',"axisLabel":'Wavelength / nm'} ) + + d2 = dataObject() + camera.startDevice() + camera.acquire() + camera.getVal(d2) + liveImage(camera)# properties={"title": "Camera snapshot","valueLabel":'y position',"axisLabel":"x position"}) + + + +# initialize all signal/slots +# win.radio1.connect("clicked()", integrationTime_changed) +# win.radio2.connect("clicked()", integrationTime_changed) +# win.radio3.connect("clicked()", integrationTime_changed) + +win.btnSnap.connect("clicked()", snap) +win.btnLive.connect("clicked()", live) +win.connectBtn.connect("clicked()", integrationTime_changed) + + +win.show(0) \ No newline at end of file