Commits

iorodeo  committed 03aa562 Draft

Added host side gui. Organized project a bit.

  • Participants
  • Parent commits be57671

Comments (0)

Files changed (6)

File firmware/firmware.pde

+#define __STDC_LIMIT_MACROS
+#include <util/atomic.h>
+#include <stdint.h>
+#include <Streaming.h>
+
+// Constants
+enum {
+    DISPLAY_BINARY = 0, 
+    DISPLAY_NUMBER = 1
+    };
+const int PULSE_INPUT_PIN = 2;
+const int PULSE_OUTPUT_PIN = 3;
+const int INTERRUPT_NUMBER = 0;
+
+enum {NUM_COUNTER_BITS=8};
+const int COUNTER_OUTPUT_PINS[NUM_COUNTER_BITS] = {5,6,7,8,9,10,11,12};
+
+const unsigned long MAX_PERIOD = 40000; 
+const unsigned long PULSE_HIGH_FRAC = 3;
+
+// Global variables
+bool pulseHigh = false;
+bool skipPulse = false;
+unsigned long pulseCount = 0;
+unsigned long pulseTime = 0;
+unsigned long pulseTimeLast = 0;
+unsigned int displayMode = DISPLAY_NUMBER;
+
+// Function prototypes
+void onPulseInterrupt();
+void resetOutpuPulse();
+void setOuputCounterBits(unsigned short count);
+
+void setup() {
+    Serial.begin(9600);
+    pinMode(PULSE_INPUT_PIN,INPUT);
+    pinMode(PULSE_OUTPUT_PIN,OUTPUT);
+    for (int i=0; i<NUM_COUNTER_BITS; i++) {
+        pinMode(COUNTER_OUTPUT_PINS[i],OUTPUT);
+    }
+    digitalWrite(PULSE_INPUT_PIN, LOW);
+    digitalWrite(PULSE_OUTPUT_PIN, LOW);
+    attachInterrupt(INTERRUPT_NUMBER,onPulseInterrupt,RISING);
+}
+
+void loop() {
+    int cmd;
+    unsigned long pulseCountCopy;
+
+    resetOutputPulse();
+
+    while(Serial.available() > 0) {
+
+        cmd = Serial.read();
+        switch (cmd) {
+
+            case 's':
+                // Skip a pulse
+                ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
+                    skipPulse = true;
+                }
+                break;
+
+            case 'r':
+                // Reset pulse count 
+                ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
+                    pulseCount = 0;
+                }
+                break;
+
+            case 'c':
+                // Return pulse count
+                ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
+                    pulseCountCopy = pulseCount;
+                }
+                Serial << pulseCountCopy << ", ";
+                Serial << pulseCountCopy%(1<<NUM_COUNTER_BITS) << endl;
+                break;
+
+            case 'b':
+                displayMode = DISPLAY_BINARY;
+                break;
+
+            case 'n':
+                displayMode = DISPLAY_NUMBER;
+                break;
+                
+            default:
+                break;
+        }
+    }
+}
+
+
+
+void resetOutputPulse() {
+    unsigned long dt;
+    unsigned long period;
+    unsigned long currentTime; 
+    unsigned short pulseCount8Bit;
+
+    if (pulseHigh) {
+        period = pulseTime - pulseTimeLast;
+        if (period > MAX_PERIOD) {
+            period = MAX_PERIOD;
+        }
+        ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
+            currentTime = micros();
+            // Note, need to change to handle wrap around
+            dt = currentTime - pulseTime;
+            if (dt > period/PULSE_HIGH_FRAC) {
+                digitalWrite(PULSE_OUTPUT_PIN, LOW);
+                pulseHigh = false;
+                pulseCount8Bit = pulseCount%(1<<NUM_COUNTER_BITS);
+                setCounterOutputBits(pulseCount8Bit);
+            }
+        }
+    }
+}
+
+void setCounterOutputBits(unsigned short count) {
+    if (displayMode == DISPLAY_BINARY) {
+        for (int i=0; i<NUM_COUNTER_BITS; i++) {
+            digitalWrite(COUNTER_OUTPUT_PINS[i], 0x01 &(count>>i));
+        }
+    }
+    else {
+        for (int i=0; i<NUM_COUNTER_BITS; i++) {
+            if ( i < count%(NUM_COUNTER_BITS+1) ) {
+                //Serial << COUNTER_OUTPUT_PINS[i] << " hi" << endl;
+                digitalWrite(COUNTER_OUTPUT_PINS[i], HIGH);
+            }
+            else {
+                //Serial << COUNTER_OUTPUT_PINS[i] << " lo" << endl;
+                digitalWrite(COUNTER_OUTPUT_PINS[i], LOW); 
+            } 
+        }
+    }
+}
+
+void onPulseInterrupt() {
+    if (skipPulse) {
+        skipPulse = false;
+    }
+    else {
+        digitalWrite(PULSE_OUTPUT_PIN, HIGH);
+        pulseHigh = true;
+        pulseTimeLast = pulseTime;
+        pulseTime = micros();
+    }
+    pulseCount += 1;
+}
+

File pulse_skipper.pde

-#define __STDC_LIMIT_MACROS
-#include <util/atomic.h>
-#include <stdint.h>
-#include <Streaming.h>
-
-// Constants
-enum {
-    DISPLAY_BINARY = 0, 
-    DISPLAY_NUMBER = 1
-    };
-const int PULSE_INPUT_PIN = 2;
-const int PULSE_OUTPUT_PIN = 3;
-const int INTERRUPT_NUMBER = 0;
-
-enum {NUM_COUNTER_BITS=8};
-const int COUNTER_OUTPUT_PINS[NUM_COUNTER_BITS] = {5,6,7,8,9,10,11,12};
-
-const unsigned long MAX_PERIOD = 500000; 
-const unsigned long PULSE_HIGH_FRAC = 10;
-
-// Global variables
-bool pulseHigh = false;
-bool skipPulse = false;
-unsigned long pulseCount = 0;
-unsigned long pulseTime = 0;
-unsigned long pulseTimeLast = 0;
-unsigned int displayMode = DISPLAY_NUMBER;
-
-// Function prototypes
-void onPulseInterrupt();
-void resetOutpuPulse();
-void setOuputCounterBits(unsigned short count);
-
-void setup() {
-    Serial.begin(9600);
-    pinMode(PULSE_INPUT_PIN,INPUT);
-    pinMode(PULSE_OUTPUT_PIN,OUTPUT);
-    for (int i=0; i<NUM_COUNTER_BITS; i++) {
-        pinMode(COUNTER_OUTPUT_PINS[i],OUTPUT);
-    }
-    digitalWrite(PULSE_INPUT_PIN, LOW);
-    digitalWrite(PULSE_OUTPUT_PIN, LOW);
-    attachInterrupt(INTERRUPT_NUMBER,onPulseInterrupt,RISING);
-}
-
-void loop() {
-    int cmd;
-    unsigned long pulseCountCopy;
-
-    resetOutputPulse();
-
-    while(Serial.available() > 0) {
-
-        cmd = Serial.read();
-        switch (cmd) {
-
-            case 's':
-                // Skip a pulse
-                ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
-                    skipPulse = true;
-                }
-                break;
-
-            case 'r':
-                // Reset pulse count 
-                ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
-                    pulseCount = 0;
-                }
-                break;
-
-            case 'c':
-                // Return pulse count
-                ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
-                    pulseCountCopy = pulseCount;
-                }
-                Serial << pulseCountCopy << ", ";
-                Serial << pulseCountCopy%(1<<NUM_COUNTER_BITS) << endl;
-                break;
-
-            case 'b':
-                displayMode = DISPLAY_BINARY;
-                break;
-
-            case 'n':
-                displayMode = DISPLAY_NUMBER;
-                break;
-                
-            default:
-                break;
-        }
-    }
-}
-
-
-
-void resetOutputPulse() {
-    unsigned long dt;
-    unsigned long period;
-    unsigned long currentTime; 
-    unsigned short pulseCount8Bit;
-
-    if (pulseHigh) {
-        period = pulseTime - pulseTimeLast;
-        if (period > MAX_PERIOD) {
-            period = MAX_PERIOD;
-        }
-        ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
-            currentTime = micros();
-            // Note, need to change to handle wrap around
-            dt = currentTime - pulseTime;
-            if (dt > period/PULSE_HIGH_FRAC) {
-                digitalWrite(PULSE_OUTPUT_PIN, LOW);
-                pulseHigh = false;
-                pulseCount8Bit = pulseCount%(1<<NUM_COUNTER_BITS);
-                setCounterOutputBits(pulseCount8Bit);
-            }
-        }
-    }
-}
-
-void setCounterOutputBits(unsigned short count) {
-    if (displayMode == DISPLAY_BINARY) {
-        for (int i=0; i<NUM_COUNTER_BITS; i++) {
-            digitalWrite(COUNTER_OUTPUT_PINS[i], 0x01 &(count>>i));
-        }
-    }
-    else {
-        for (int i=0; i<NUM_COUNTER_BITS; i++) {
-            if ( i <= (count%NUM_COUNTER_BITS) ) {
-                digitalWrite(COUNTER_OUTPUT_PINS[i], HIGH);
-            }
-            else {
-                digitalWrite(COUNTER_OUTPUT_PINS[i], LOW);
-            }
-        }
-    }
-}
-
-void onPulseInterrupt() {
-    if (skipPulse) {
-        skipPulse = false;
-    }
-    else {
-        digitalWrite(PULSE_OUTPUT_PIN, HIGH);
-        pulseHigh = true;
-        pulseTimeLast = pulseTime;
-        pulseTime = micros();
-    }
-    pulseCount += 1;
-}
-

File python/pulse_skipper.py

+from __future__ import print_function
+import sys
+import serial
+import functools
+from PyQt4 import QtCore
+from PyQt4 import QtGui
+from pulse_skipper_ui import Ui_MainWindow 
+from pulse_skipper_serial import PulseSkipperSerial
+
+
+class PulseSkipper(QtGui.QMainWindow, Ui_MainWindow):
+
+    DEFAULT_PORT = '/dev/ttyUSB8'
+
+    def __init__(self, parent=None):
+        super(PulseSkipper,self).__init__(parent)
+        self.setupUi(self)
+        self.connectActions()
+        self.initialize()
+
+    def main(self):
+        self.show()
+
+    def connectActions(self):
+        self.connectPushButton.pressed.connect(self.connectPressed)
+        self.connectPushButton.clicked.connect(self.connectClicked)
+        self.skipPushButton.clicked.connect(self.skipClicked)
+        self.resetPushButton.clicked.connect(self.resetClicked)
+        numberToggledCallback = functools.partial(self.displayToggled,'number')
+        self.numberRadioButton.toggled.connect(numberToggledCallback)
+        binaryToggledCallback = functools.partial(self.displayToggled,'binary')
+        self.binaryRadioButton.toggled.connect(binaryToggledCallback)
+
+    def initialize(self):
+        self.dev = None
+        self.port = PulseSkipper.DEFAULT_PORT
+        self.portLineEdit.setText(self.port)
+        self.setEnabledOnDisconnect()
+        self.numberRadioButton.setChecked(True)
+        self.binaryRadioButton.setChecked(False)
+
+
+    def connectPressed(self):
+        self.portLineEdit.setEnabled(False)
+        self.connectPushButton.setText('Disconnect')
+
+    def connectClicked(self):
+        if self.dev is None:
+            try:
+                self.dev = PulseSkipperSerial(self.port)
+                #self.dev = True
+            except serial.serialutil.SerialException, e: 
+                errMsg = '{0}'.format(str(e)) 
+                QtGui.QMessageBox.critical(self,'Error',errMsg) 
+                self.portLineEdit.setEnabled(True) 
+                self.connectPushButton.setText('Connect')
+                self.dev = None
+            if self.dev is not None:
+                self.setEnabledOnConnect()
+                self.setDisplay()
+
+        else: 
+            self.portLineEdit.setEnabled(True) 
+            self.connectPushButton.setText('Connect') 
+            self.setEnabledOnDisconnect()
+            self.dev.close() 
+            #self.dev = None 
+
+
+    def skipClicked(self):
+        self.dev.skipPulse()
+
+    def resetClicked(self):
+        self.dev.resetCount()
+
+    def displayToggled(self, name):
+        if self.dev is not None:
+            self.setDisplay()
+
+    def setDisplay(self):
+        if self.binaryRadioButton.isChecked():
+            self.dev.setDisplayBinary()
+        else:
+            self.dev.setDisplayNumber()
+
+    def setEnabledOnDisconnect(self):
+        self.pulseGroupBox.setEnabled(False)
+        self.displayGroupBox.setEnabled(False)
+
+    def setEnabledOnConnect(self):
+        self.pulseGroupBox.setEnabled(True)
+        self.displayGroupBox.setEnabled(True)
+
+def runApp():
+    app = QtGui.QApplication(sys.argv)
+    win = PulseSkipper()
+    win.main()
+    app.exec_()
+
+
+# -----------------------------------------------------------------------------
+if __name__ == '__main__':
+    runApp()
+

File python/pulse_skipper.ui

+<?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>345</width>
+    <height>263</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Pulse Skipper</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QVBoxLayout" name="verticalLayout_3">
+    <item>
+     <widget class="QGroupBox" name="deviceGroupBox">
+      <property name="title">
+       <string>Device</string>
+      </property>
+      <layout class="QHBoxLayout" name="horizontalLayout">
+       <item>
+        <widget class="QLabel" name="label">
+         <property name="text">
+          <string>Port</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLineEdit" name="portLineEdit">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Fixed</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>15</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QPushButton" name="connectPushButton">
+         <property name="text">
+          <string>Connect</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>189</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+    </item>
+    <item>
+     <widget class="Line" name="line_2">
+      <property name="orientation">
+       <enum>Qt::Horizontal</enum>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QWidget" name="widget" native="true">
+      <layout class="QHBoxLayout" name="horizontalLayout_2">
+       <item>
+        <widget class="QGroupBox" name="pulseGroupBox">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="title">
+          <string>Pulse</string>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout_2">
+          <item>
+           <widget class="QPushButton" name="skipPushButton">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="minimumSize">
+             <size>
+              <width>100</width>
+              <height>0</height>
+             </size>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>100</width>
+              <height>16777215</height>
+             </size>
+            </property>
+            <property name="text">
+             <string>Skip</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QPushButton" name="resetPushButton">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="minimumSize">
+             <size>
+              <width>100</width>
+              <height>0</height>
+             </size>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>100</width>
+              <height>16777215</height>
+             </size>
+            </property>
+            <property name="text">
+             <string>Reset Count</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <spacer name="verticalSpacer_2">
+            <property name="orientation">
+             <enum>Qt::Vertical</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>20</width>
+              <height>0</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="Line" name="line">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="displayGroupBox">
+         <property name="title">
+          <string>Display</string>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout">
+          <item>
+           <widget class="QRadioButton" name="numberRadioButton">
+            <property name="text">
+             <string>Number</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QRadioButton" name="binaryRadioButton">
+            <property name="text">
+             <string>Binary</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <spacer name="verticalSpacer">
+            <property name="orientation">
+             <enum>Qt::Vertical</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>20</width>
+              <height>7</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+         </layout>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>345</width>
+     <height>25</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

File python/pulse_skipper_serial.py

+from __future__ import print_function
+import serial
+import time
+
+class PulseSkipperSerial(serial.Serial):
+
+    def __init__(self,port='/dev/ttyUSB8'):
+        super(PulseSkipperSerial,self).__init__(port=port,baudrate=9600,timeout=5.0)
+        time.sleep(2.0)
+
+    def skipPulse(self):
+        self.write('s')
+
+    def resetCount(self):
+        self.write('r')
+
+    def getCount(self):
+        self.write('c')
+        value = self.readline()
+        value = value.split(',')
+        value = int(value[0])
+        return value 
+
+    def setDisplayBinary(self):
+        self.write('b')
+
+    def setDisplayNumber(self):
+        self.write('n')
+
+
+# ---------------------------------------------------------------
+if __name__ == '__main__':
+
+    dev = PulseSkipperSerial(port='/dev/ttyUSB8')
+    for i in range(5):
+        count = dev.getCount()
+        print('{0} count: {1}'.format(i, count))
+        time.sleep(2)
+
+
+
+

File python/pulse_skipper_ui.py

+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'pulse_skipper.ui'
+#
+# Created: Mon Oct  1 15:43:04 2012
+#      by: PyQt4 UI code generator 4.8.3
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+try:
+    _fromUtf8 = QtCore.QString.fromUtf8
+except AttributeError:
+    _fromUtf8 = lambda s: s
+
+class Ui_MainWindow(object):
+    def setupUi(self, MainWindow):
+        MainWindow.setObjectName(_fromUtf8("MainWindow"))
+        MainWindow.resize(345, 263)
+        self.centralwidget = QtGui.QWidget(MainWindow)
+        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
+        self.verticalLayout_3 = QtGui.QVBoxLayout(self.centralwidget)
+        self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
+        self.deviceGroupBox = QtGui.QGroupBox(self.centralwidget)
+        self.deviceGroupBox.setObjectName(_fromUtf8("deviceGroupBox"))
+        self.horizontalLayout = QtGui.QHBoxLayout(self.deviceGroupBox)
+        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
+        self.label = QtGui.QLabel(self.deviceGroupBox)
+        self.label.setObjectName(_fromUtf8("label"))
+        self.horizontalLayout.addWidget(self.label)
+        self.portLineEdit = QtGui.QLineEdit(self.deviceGroupBox)
+        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        sizePolicy.setHorizontalStretch(0)
+        sizePolicy.setVerticalStretch(0)
+        sizePolicy.setHeightForWidth(self.portLineEdit.sizePolicy().hasHeightForWidth())
+        self.portLineEdit.setSizePolicy(sizePolicy)
+        self.portLineEdit.setObjectName(_fromUtf8("portLineEdit"))
+        self.horizontalLayout.addWidget(self.portLineEdit)
+        spacerItem = QtGui.QSpacerItem(15, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
+        self.horizontalLayout.addItem(spacerItem)
+        self.connectPushButton = QtGui.QPushButton(self.deviceGroupBox)
+        self.connectPushButton.setObjectName(_fromUtf8("connectPushButton"))
+        self.horizontalLayout.addWidget(self.connectPushButton)
+        spacerItem1 = QtGui.QSpacerItem(189, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        self.horizontalLayout.addItem(spacerItem1)
+        self.verticalLayout_3.addWidget(self.deviceGroupBox)
+        self.line_2 = QtGui.QFrame(self.centralwidget)
+        self.line_2.setFrameShape(QtGui.QFrame.HLine)
+        self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
+        self.line_2.setObjectName(_fromUtf8("line_2"))
+        self.verticalLayout_3.addWidget(self.line_2)
+        self.widget = QtGui.QWidget(self.centralwidget)
+        self.widget.setObjectName(_fromUtf8("widget"))
+        self.horizontalLayout_2 = QtGui.QHBoxLayout(self.widget)
+        self.horizontalLayout_2.setMargin(0)
+        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
+        self.pulseGroupBox = QtGui.QGroupBox(self.widget)
+        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
+        sizePolicy.setHorizontalStretch(0)
+        sizePolicy.setVerticalStretch(0)
+        sizePolicy.setHeightForWidth(self.pulseGroupBox.sizePolicy().hasHeightForWidth())
+        self.pulseGroupBox.setSizePolicy(sizePolicy)
+        self.pulseGroupBox.setObjectName(_fromUtf8("pulseGroupBox"))
+        self.verticalLayout_2 = QtGui.QVBoxLayout(self.pulseGroupBox)
+        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
+        self.skipPushButton = QtGui.QPushButton(self.pulseGroupBox)
+        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        sizePolicy.setHorizontalStretch(0)
+        sizePolicy.setVerticalStretch(0)
+        sizePolicy.setHeightForWidth(self.skipPushButton.sizePolicy().hasHeightForWidth())
+        self.skipPushButton.setSizePolicy(sizePolicy)
+        self.skipPushButton.setMinimumSize(QtCore.QSize(100, 0))
+        self.skipPushButton.setMaximumSize(QtCore.QSize(100, 16777215))
+        self.skipPushButton.setObjectName(_fromUtf8("skipPushButton"))
+        self.verticalLayout_2.addWidget(self.skipPushButton)
+        self.resetPushButton = QtGui.QPushButton(self.pulseGroupBox)
+        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        sizePolicy.setHorizontalStretch(0)
+        sizePolicy.setVerticalStretch(0)
+        sizePolicy.setHeightForWidth(self.resetPushButton.sizePolicy().hasHeightForWidth())
+        self.resetPushButton.setSizePolicy(sizePolicy)
+        self.resetPushButton.setMinimumSize(QtCore.QSize(100, 0))
+        self.resetPushButton.setMaximumSize(QtCore.QSize(100, 16777215))
+        self.resetPushButton.setObjectName(_fromUtf8("resetPushButton"))
+        self.verticalLayout_2.addWidget(self.resetPushButton)
+        spacerItem2 = QtGui.QSpacerItem(20, 0, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
+        self.verticalLayout_2.addItem(spacerItem2)
+        self.horizontalLayout_2.addWidget(self.pulseGroupBox)
+        self.line = QtGui.QFrame(self.widget)
+        self.line.setFrameShape(QtGui.QFrame.VLine)
+        self.line.setFrameShadow(QtGui.QFrame.Sunken)
+        self.line.setObjectName(_fromUtf8("line"))
+        self.horizontalLayout_2.addWidget(self.line)
+        self.displayGroupBox = QtGui.QGroupBox(self.widget)
+        self.displayGroupBox.setObjectName(_fromUtf8("displayGroupBox"))
+        self.verticalLayout = QtGui.QVBoxLayout(self.displayGroupBox)
+        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
+        self.numberRadioButton = QtGui.QRadioButton(self.displayGroupBox)
+        self.numberRadioButton.setObjectName(_fromUtf8("numberRadioButton"))
+        self.verticalLayout.addWidget(self.numberRadioButton)
+        self.binaryRadioButton = QtGui.QRadioButton(self.displayGroupBox)
+        self.binaryRadioButton.setObjectName(_fromUtf8("binaryRadioButton"))
+        self.verticalLayout.addWidget(self.binaryRadioButton)
+        spacerItem3 = QtGui.QSpacerItem(20, 7, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
+        self.verticalLayout.addItem(spacerItem3)
+        self.horizontalLayout_2.addWidget(self.displayGroupBox)
+        self.verticalLayout_3.addWidget(self.widget)
+        MainWindow.setCentralWidget(self.centralwidget)
+        self.menubar = QtGui.QMenuBar(MainWindow)
+        self.menubar.setGeometry(QtCore.QRect(0, 0, 345, 25))
+        self.menubar.setObjectName(_fromUtf8("menubar"))
+        MainWindow.setMenuBar(self.menubar)
+        self.statusbar = QtGui.QStatusBar(MainWindow)
+        self.statusbar.setObjectName(_fromUtf8("statusbar"))
+        MainWindow.setStatusBar(self.statusbar)
+
+        self.retranslateUi(MainWindow)
+        QtCore.QMetaObject.connectSlotsByName(MainWindow)
+
+    def retranslateUi(self, MainWindow):
+        MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Pulse Skipper", None, QtGui.QApplication.UnicodeUTF8))
+        self.deviceGroupBox.setTitle(QtGui.QApplication.translate("MainWindow", "Device", None, QtGui.QApplication.UnicodeUTF8))
+        self.label.setText(QtGui.QApplication.translate("MainWindow", "Port", None, QtGui.QApplication.UnicodeUTF8))
+        self.connectPushButton.setText(QtGui.QApplication.translate("MainWindow", "Connect", None, QtGui.QApplication.UnicodeUTF8))
+        self.pulseGroupBox.setTitle(QtGui.QApplication.translate("MainWindow", "Pulse", None, QtGui.QApplication.UnicodeUTF8))
+        self.skipPushButton.setText(QtGui.QApplication.translate("MainWindow", "Skip", None, QtGui.QApplication.UnicodeUTF8))
+        self.resetPushButton.setText(QtGui.QApplication.translate("MainWindow", "Reset Count", None, QtGui.QApplication.UnicodeUTF8))
+        self.displayGroupBox.setTitle(QtGui.QApplication.translate("MainWindow", "Display", None, QtGui.QApplication.UnicodeUTF8))
+        self.numberRadioButton.setText(QtGui.QApplication.translate("MainWindow", "Number", None, QtGui.QApplication.UnicodeUTF8))
+        self.binaryRadioButton.setText(QtGui.QApplication.translate("MainWindow", "Binary", None, QtGui.QApplication.UnicodeUTF8))
+