Commit 51f6d7cb authored by Raman's avatar Raman

HotFixes for use at WITec microscope,

Hotfix for importing spectra when only a fraction of particles was measured
parent 25423ad8
......@@ -243,7 +243,7 @@ class SpectraPlot(QtWidgets.QGroupBox):
def loadSpectraAndInitializeSpecPlot(self):
self.spectra = self.dataset.particleContainer.getSpectraFromDisk()
self.canvas.draw()
def updateParticleSpectrum(self, specIndex, assignment, hqi):
#draw Sample Spectrum
self.spec_axis.axis("on")
......@@ -265,6 +265,10 @@ class SpectraPlot(QtWidgets.QGroupBox):
self.spec_axis.set_ybound(0.9*y_min, 1.1*y_max)
self.canvas.draw()
def clearParticleSpectrum(self):
self.reference_axis.clear()
self.canvas.draw()
def updateReferenceSpectrum(self, ref_wavenumber, ref_intensity):
#draw Reference
......
......@@ -354,9 +354,13 @@ class ParticleAnalysis(QtWidgets.QMainWindow):
self.sizeHistogramPlot.drawHistograms(listOfSizeHistograms)
def updateSpecPlot(self):
hqi = self.particleContainer.getHQIOfSpectrumIndex(self.currentSpectrumIndex)
assignment = self.particleContainer.getParticleAssignmentByIndex(self.currentParticleIndex)
self.specPlot.updateParticleSpectrum(self.currentSpectrumIndex, assignment, hqi)
particle = self.particleContainer.getParticleOfIndex(self.currentParticleIndex)
if len(particle.measurements) > 0:
hqi = self.particleContainer.getHQIOfSpectrumIndex(self.currentSpectrumIndex)
assignment = self.particleContainer.getParticleAssignmentByIndex(self.currentParticleIndex)
self.specPlot.updateParticleSpectrum(self.currentSpectrumIndex, assignment, hqi)
else:
self.specPlot.clearParticleSpectrum()
if self.refSelector.isEnabled():
if self.refSelector.currentText() != '':
......
......@@ -29,8 +29,8 @@ except ImportError:
from time import sleep, time
try: #when running the witectesting, the paths have to be differently, as it is in the same directory as the other raman com modules
from ramancom.ramanbase import RamanBase
from ramancom.configRaman import RamanSettingParam
from .ramanbase import RamanBase
from .configRaman import RamanSettingParam
except:
from ramanbase import RamanBase
from configRaman import RamanSettingParam
......
......@@ -60,17 +60,19 @@ class SampleView(QtWidgets.QGraphicsView):
self.setResizeAnchor(QtWidgets.QGraphicsView.AnchorViewCenter)
self.ramanctrl = RamanControl()
self.simulatedRaman = simulatedRaman
#determine, if ramanSwitch is needed:
self.ramanctrl.connect()
if not self.ramanctrl.connected:
QtWidgets.QMessageBox.warning(self, 'Error', 'Please enable Raman Connection')
return
if self.ramanctrl.getImageDimensions(mode='bf')[0] == self.ramanctrl.getImageDimensions(mode='df')[0]:
self.ramanSwitchNeeded = False
else:
self.ramanSwitchNeeded = True
self.ramanctrl.disconnect()
self.simulatedRaman = simulatedRaman
self.ramanSwitchNeeded = False
if self.ramanctrl.name == 'RenishawCOM':
#determine, if ramanSwitch is needed:
self.ramanctrl.connect()
if not self.ramanctrl.connected:
QtWidgets.QMessageBox.warning(self, 'Error', 'Please enable Raman Connection')
return
if self.ramanctrl.getImageDimensions(mode='bf')[0] == self.ramanctrl.getImageDimensions(mode='df')[0]:
self.ramanSwitchNeeded = False
else:
self.ramanSwitchNeeded = True
self.ramanctrl.disconnect()
self.drag = None
self.mode = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment