achim1 / muonic

A python gui for QNet DAQ card experiments
http://achim1.github.io/muonic/
1 stars 9 forks source link

ZeroDivisionError in Rate Calculation #49

Closed achim1 closed 9 years ago

achim1 commented 9 years ago

Traceback (most recent call last): File "/home/achim/virtenvs/muonic_dev/local/lib/python2.7/site-packages/muonic-2.0.10-py2.7.egg/muonic/gui/MainWindow.py", line 724, in widgetUpdate widg.update() File "/home/achim/virtenvs/muonic_dev/local/lib/python2.7/site-packages/muonic-2.0.10-py2.7.egg/muonic/gui/MuonicWidgets.py", line 190, in update self.rates['edit_ch0'].setText('%.2f' %(self.scalers['scalers_buffer']['ch0']/self.timewindow)) ZeroDivisionError: integer division or modulo by zero

achim1 commented 9 years ago

Probably related to #35

achim1 commented 9 years ago

This is fixed now: MuonicWidgets.py:

def update(self):
    """
    Display newly available data
    """
    if self.run:
        self.query_daq_for_scalars()

-> if self.timewindow == 0: return