-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
234 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>MainWindow</class> | ||
<widget class="QMainWindow" name="MainWindow"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>803</width> | ||
<height>623</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>MainWindow</string> | ||
</property> | ||
<widget class="QWidget" name="centralwidget"> | ||
<widget class="QPushButton" name="btnSnap"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>20</x> | ||
<y>280</y> | ||
<width>271</width> | ||
<height>31</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>snap</string> | ||
</property> | ||
</widget> | ||
<widget class="QPushButton" name="btnLive"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>300</x> | ||
<y>280</y> | ||
<width>261</width> | ||
<height>31</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>live</string> | ||
</property> | ||
</widget> | ||
<widget class="QGroupBox" name="groupBox"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>580</x> | ||
<y>20</y> | ||
<width>201</width> | ||
<height>261</height> | ||
</rect> | ||
</property> | ||
<property name="title"> | ||
<string>Spectrometer - Integration Time</string> | ||
</property> | ||
<widget class="QRadioButton" name="radio1"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>10</x> | ||
<y>60</y> | ||
<width>82</width> | ||
<height>17</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>5 ms</string> | ||
</property> | ||
</widget> | ||
<widget class="QRadioButton" name="radio2"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>10</x> | ||
<y>130</y> | ||
<width>82</width> | ||
<height>17</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>10 ms</string> | ||
</property> | ||
</widget> | ||
<widget class="QRadioButton" name="radio3"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>10</x> | ||
<y>200</y> | ||
<width>82</width> | ||
<height>17</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>60 ms</string> | ||
</property> | ||
</widget> | ||
</widget> | ||
<widget class="PlotInfoDObject" name="plot1"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>20</x> | ||
<y>10</y> | ||
<width>541</width> | ||
<height>261</height> | ||
</rect> | ||
</property> | ||
</widget> | ||
<widget class="PlotInfoDObject" name="plotInfoDObject_2"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>20</x> | ||
<y>320</y> | ||
<width>541</width> | ||
<height>261</height> | ||
</rect> | ||
</property> | ||
</widget> | ||
<widget class="QPushButton" name="pushButton_3"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>580</x> | ||
<y>370</y> | ||
<width>81</width> | ||
<height>41</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>RUN ALL</string> | ||
</property> | ||
</widget> | ||
<widget class="QPushButton" name="pushButton_4"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>680</x> | ||
<y>370</y> | ||
<width>81</width> | ||
<height>41</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>STOP</string> | ||
</property> | ||
</widget> | ||
</widget> | ||
<widget class="QMenuBar" name="menubar"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>803</width> | ||
<height>21</height> | ||
</rect> | ||
</property> | ||
</widget> | ||
<widget class="QStatusBar" name="statusbar"/> | ||
</widget> | ||
<customwidgets> | ||
<customwidget> | ||
<class>PlotInfoDObject</class> | ||
<extends>QPlainTextEdit</extends> | ||
<header>plotInfoDObject.h</header> | ||
</customwidget> | ||
</customwidgets> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |