Changeset - d52402a7de11
[Not reviewed]
Merge add-textview
0 11 3
Hasan Yavuz ÖZDERYA - 10 years ago 2015-07-05 20:27:02
hy@ozderya.net
Merge
14 files changed with 199 insertions and 38 deletions:
0 comments (0 inline, 0 general)
.hgtags
Show inline comments
 
cdddeef73834c62a8ba5f3ac4c000cd4cb059e06 v0.1
 
73524cc41d6c6f4a664b39a74ae202be21b58eaf v0.2
 
1332b87e543fd947b57d45ccf62e9a0886e09cb5 v0.3
CMakeLists.txt
Show inline comments
 
@@ -52,8 +52,8 @@ include_directories(${QWT_INCLUDE_DIR})
 
qt5_wrap_ui(UI_FILES mainwindow.ui portcontrol.ui about_dialog.ui)
 

	
 
# Tell CMake to create the helloworld executable
 
add_executable(serialplot main.cpp mainwindow.cpp portcontrol.cpp
 
  customcheckablebutton.cpp ${UI_FILES})
 
add_executable(serialplot WIN32 main.cpp mainwindow.cpp portcontrol.cpp
 
  customcheckablebutton.cpp ${UI_FILES} misc/windows_icon.rc)
 

	
 
# Use the Widgets module from Qt 5.
 
target_link_libraries(serialplot ${QWT_LIBRARY})
 
@@ -76,7 +76,7 @@ endif()
 

	
 
# version number
 
set(MAJOR_VERSION 0)
 
set(MINOR_VERSION 2)
 
set(MINOR_VERSION 3)
 
set(PATCH_VERSION 0)
 
set(VERSION_STRING "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
 

	
 
@@ -113,25 +113,34 @@ add_custom_target(run
 
# installing
 
install(TARGETS serialplot DESTINATION bin)
 

	
 
# for windows put libraries to install directory
 
if (WIN32)
 
  file(GLOB WINDOWS_INSTALL_LIBRARIES
 
    "${CMAKE_BINARY_DIR}/windows_install_libraries/*.*")
 
  install(FILES ${WINDOWS_INSTALL_LIBRARIES} DESTINATION bin)
 
endif (WIN32)
 

	
 
# install menu item and icon
 
find_program(XDG-DESKTOP-MENU xdg-desktop-menu)
 
find_program(XDG-ICON-RESOURCE xdg-icon-resource)
 

	
 
# first copy files to share/serialplot/
 
install(FILES
 
  ${CMAKE_SOURCE_DIR}/misc/serialplot.desktop
 
  ${CMAKE_SOURCE_DIR}/misc/serialplot.png
 
  DESTINATION share/serialplot)
 
if (UNIX)
 
  # first copy files to share/serialplot/
 
  install(FILES
 
    ${CMAKE_SOURCE_DIR}/misc/serialplot.desktop
 
    ${CMAKE_SOURCE_DIR}/misc/serialplot.png
 
    DESTINATION share/serialplot)
 

	
 
# install copyright file (in debian format)
 
install(FILES
 
  ${CMAKE_SOURCE_DIR}/debian/copyright
 
  DESTINATION share/doc/serialplot/)
 
  # install copyright file (in debian format)
 
  install(FILES
 
    ${CMAKE_SOURCE_DIR}/debian/copyright
 
    DESTINATION share/doc/serialplot/)
 

	
 
install(CODE "
 
  install(CODE "
 
  execute_process(COMMAND ${XDG-DESKTOP-MENU} install --novendor ${CMAKE_INSTALL_PREFIX}/share/serialplot/serialplot.desktop)
 
  execute_process(COMMAND ${XDG-ICON-RESOURCE} install --novendor --size 256 ${CMAKE_INSTALL_PREFIX}/share/serialplot/serialplot.png)
 
")
 
endif (UNIX)
 

	
 
# uninstalling
 
configure_file(
 
@@ -139,13 +148,19 @@ configure_file(
 
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
 
  IMMEDIATE @ONLY)
 

	
 
add_custom_target(uninstall
 
  COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
 
  COMMAND ${XDG-DESKTOP-MENU} uninstall --novendor serialplot.desktop
 
  COMMAND ${XDG-ICON-RESOURCE} uninstall --novendor --size 256 serialplot)
 
if (UNIX)
 
  add_custom_target(uninstall
 
    COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
 
    COMMAND ${XDG-DESKTOP-MENU} uninstall --novendor serialplot.desktop
 
    COMMAND ${XDG-ICON-RESOURCE} uninstall --novendor --size 256 serialplot)
 
endif (UNIX)
 

	
 
# packaging
 
set(CPACK_GENERATOR "DEB")
 
if (UNIX)
 
  set(CPACK_GENERATOR "DEB")
 
elseif (WIN32)
 
  set(CPACK_GENERATOR "NSIS")
 
endif (UNIX)
 

	
 
include(InstallRequiredSystemLibraries)
 

	
 
@@ -156,26 +171,40 @@ set(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_
 
set(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION})
 
set(CPACK_PACKAGE_VERSION_PATCH ${PATCH_VERSION})
 
set(CPACK_STRIP_FILES TRUE)
 
set(CPACK_PACKAGE_EXECUTABLES "serialplot")
 
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5widgets5 (>= 5.2.1), libqt5serialport5 (>= 5.2.1), libc6 (>= 2.19)")
 
if (NOT QWT_USE_STATIC)
 
  set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libqwt6-qt5 (>= 6.1.1)")
 
endif (NOT QWT_USE_STATIC)
 
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/debian/postinst" "${CMAKE_SOURCE_DIR}/debian/postrm")
 

	
 
# set debian package name
 
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE)
 
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
 
if(DPKG_PROGRAM)
 
  execute_process(
 
    COMMAND ${DPKG_PROGRAM} --print-architecture
 
    OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
 
    OUTPUT_STRIP_TRAILING_WHITESPACE)
 
  set(CPACK_PACKAGE_FILE_NAME
 
	"${CPACK_PACKAGE_NAME_LOWERCASE}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
 
else(DPKG_PROGRAM)
 
  set(CPACK_PACKAGE_FILE_NAME
 
	"${CPACK_PACKAGE_NAME_LOWERCASE}_${PROJECT_VERSION}-${PROJECT_VERSION_REVISION}_${CMAKE_SYSTEM_NAME}")
 
endif(DPKG_PROGRAM)
 
if (UNIX)
 
  set(CPACK_PACKAGE_EXECUTABLES "serialplot")
 
elseif (WIN32)
 
  set(CPACK_PACKAGE_EXECUTABLES "serialplot;SerialPlot")
 
  set(CPACK_CREATE_DESKTOP_LINKS "serialplot")
 
  set(CPACK_NSIS_MODIFY_PATH "ON")
 
  set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/misc/serialplot.bmp")
 
  string(REPLACE "/" "\\\\" CPACK_PACKAGE_ICON ${CPACK_PACKAGE_ICON})
 
  set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
 
  set(CPACK_NSIS_MENU_LINKS
 
    "https://bitbucket.org/hyOzd/serialplot" "SerialPlot source code on bitbucket.org")
 
endif (UNIX)
 

	
 
if (UNIX)
 
  # set debian package name
 
  string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE)
 
  find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
 
  if(DPKG_PROGRAM)
 
    execute_process(
 
      COMMAND ${DPKG_PROGRAM} --print-architecture
 
      OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
 
      OUTPUT_STRIP_TRAILING_WHITESPACE)
 
    set(CPACK_PACKAGE_FILE_NAME
 
      "${CPACK_PACKAGE_NAME_LOWERCASE}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
 
  else(DPKG_PROGRAM)
 
    set(CPACK_PACKAGE_FILE_NAME
 
      "${CPACK_PACKAGE_NAME_LOWERCASE}_${PROJECT_VERSION}-${PROJECT_VERSION_REVISION}_${CMAKE_SYSTEM_NAME}")
 
  endif(DPKG_PROGRAM)
 
endif (UNIX)
 

	
 
include(CPack)
README.md
Show inline comments
 
@@ -10,6 +10,12 @@ Small and simple software for plotting d
 
* ASCII input (Comma Separated Values)
 
* Synchronized multi channel plotting
 

	
 
## Installation
 

	
 
You can obtain installation packages from
 
[downloads](https://bitbucket.org/hyOzd/serialplot/downloads). As of
 
moment there is only Debian and Windows 64 bits packages.
 

	
 
## Dependencies
 
- Qt 5, including SerialPort module
 
- Qwt 6.1
 
@@ -59,4 +65,4 @@ You can also build with QtCreator IDE us
 
  to not happen with Qt 5.4.1 . Not fatal.
 

	
 
## License
 
This software is licensed under GPLv3. See file COPYING for details.
 
\ No newline at end of file
 
This software is licensed under GPLv3. See file COPYING for details.
about_dialog.ui
Show inline comments
 
@@ -17,7 +17,7 @@
 
   <item>
 
    <widget class="QLabel" name="lbAbout">
 
     <property name="text">
 
      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt;&quot;&gt;SerialPlot&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;$VERSION_STRING$&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Developed by Hasan Yavuz Özderya&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Using Qt and Qwt (&lt;a href=&quot;http://qwt.sf.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://qwt.sf.net&lt;/span&gt;&lt;/a&gt;)&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;This software is GPL licensed. You can obtain source code from &lt;a href=&quot;https://bitbucket.org/hyOzd/serialplot&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://bitbucket.org/hyOzd/serialplot&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p align=&quot;right&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;RevID: $VERSION_REVISION$&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
 
      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt;&quot;&gt;SerialPlot&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;$VERSION_STRING$&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Developed by Hasan Yavuz Özderya&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Using Qt (&lt;a href=&quot;https://www.qt.io/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://www.qt.io/&lt;/span&gt;&lt;/a&gt;) and Qwt (&lt;a href=&quot;http://qwt.sf.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://qwt.sf.net&lt;/span&gt;&lt;/a&gt;)&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;This software is GPL licensed. You can obtain source code from &lt;a href=&quot;https://bitbucket.org/hyOzd/serialplot&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://bitbucket.org/hyOzd/serialplot&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p align=&quot;right&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;RevID: $VERSION_REVISION$&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
 
     </property>
 
     <property name="wordWrap">
 
      <bool>true</bool>
cmake/modules/FindQwt.cmake
Show inline comments
 
@@ -22,7 +22,7 @@
 
# /usr/local/qwt-VERSION directories.
 
#
 

	
 
file(GLOB qwt_glob_dir "/usr/local/qwt*/")
 
file(GLOB qwt_glob_dir "/usr/local/qwt*/" "c:/Qwt*")
 

	
 
if(qwt_glob_dir)
 
  foreach(qwt_path ${qwt_glob_dir})
floatswap.h
Show inline comments
 
#include <byteswap.h>
 
#include <QtGlobal>
 

	
 
template <> inline float qbswap<float>(float source)
mainwindow.cpp
Show inline comments
 
@@ -36,6 +36,11 @@
 
#include "version.h"
 
#include "floatswap.h"
 

	
 
#if defined(Q_OS_WIN) && defined(QT_STATIC)
 
#include <QtPlugin>
 
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
 
#endif
 

	
 
MainWindow::MainWindow(QWidget *parent) :
 
    QMainWindow(parent),
 
    ui(new Ui::MainWindow),
 
@@ -56,6 +61,9 @@ MainWindow::MainWindow(QWidget *parent) 
 
    QObject::connect(ui->actionExportCsv, &QAction::triggered,
 
                     this, &MainWindow::onExportCsv);
 

	
 
    QObject::connect(ui->actionQuit, &QAction::triggered,
 
                     this, &MainWindow::close);
 

	
 
    QObject::connect(&portControl, &PortControl::portToggled,
 
                     this, &MainWindow::onPortToggled);
 

	
 
@@ -137,6 +145,7 @@ MainWindow::MainWindow(QWidget *parent) 
 
        selectNumberFormat(NumberFormat_uint8);
 
    }
 

	
 

	
 
    // init text view
 
    ui->ptTextView->setEnabled(ui->cbEnableTextView->isChecked());
 
    // TODO: does this work in binary mode? (no new lines)
 
@@ -146,6 +155,16 @@ MainWindow::MainWindow(QWidget *parent) 
 
    QObject::connect(ui->pbClearTextView, &QPushButton::clicked,
 
                     ui->ptTextView, &QPlainTextEdit::clear);
 

	
 

	
 
    // Init sps (sample per second) counter
 
    sampleCount = 0;
 
    spsLabel.setText("0sps");
 
    spsLabel.setToolTip("samples per second (total of all channels)");
 
    ui->statusBar->addPermanentWidget(&spsLabel);
 
    spsTimer.start(SPS_UPDATE_TIMEOUT * 1000);
 
    QObject::connect(&spsTimer, &QTimer::timeout,
 
                     this, &MainWindow::spsTimerTimeout);
 

	
 
    // Init demo mode
 
    demoCount = 0;
 
    demoTimer.setInterval(100);
 
@@ -153,6 +172,18 @@ MainWindow::MainWindow(QWidget *parent) 
 
                     this, &MainWindow::demoTimerTimeout);
 
    QObject::connect(ui->actionDemoMode, &QAction::toggled,
 
                     this, &MainWindow::enableDemo);
 

	
 
    {   // init demo indicator
 
        QwtText demoText(" DEMO RUNNING ");  // looks better with spaces
 
        demoText.setColor(QColor("white"));
 
        demoText.setBackgroundBrush(Qt::darkRed);
 
        demoText.setBorderRadius(4);
 
        demoText.setRenderFlags(Qt::AlignLeft | Qt::AlignTop);
 
        demoIndicator.setText(demoText);
 
        demoIndicator.hide();
 
        demoIndicator.attach(ui->plot);
 
    }
 

	
 
}
 

	
 
MainWindow::~MainWindow()
 
@@ -246,6 +277,13 @@ void MainWindow::onDataReadyASCII()
 
    while(serialPort.canReadLine())
 
    {
 
        QByteArray line = serialPort.readLine();
 

	
 
        // discard data if paused
 
        if (ui->actionPause->isChecked())
 
        {
 
            return;
 
        }
 

	
 
        line = line.trimmed();
 

	
 
        if (ui->cbEnableTextView->isChecked())
 
@@ -372,6 +410,8 @@ void MainWindow::addChannelData(unsigned
 
    // update plot
 
    curves[channel]->setSamples(dataX, (*channelDataArray));
 
    ui->plot->replot(); // TODO: replot after all channel data updated
 

	
 
    sampleCount += data.size();
 
}
 

	
 
void MainWindow::clearPlot()
 
@@ -564,6 +604,12 @@ bool MainWindow::isDemoRunning()
 
    return ui->actionDemoMode->isChecked();
 
}
 

	
 
void MainWindow::spsTimerTimeout()
 
{
 
    spsLabel.setText(QString::number(sampleCount/SPS_UPDATE_TIMEOUT) + "sps");
 
    sampleCount = 0;
 
}
 

	
 
void MainWindow::demoTimerTimeout()
 
{
 
    demoCount++;
 
@@ -588,6 +634,8 @@ void MainWindow::enableDemo(bool enabled
 
        {
 
            demoTimer.start();
 
            ui->actionDemoMode->setChecked(true);
 
            demoIndicator.show();
 
            ui->plot->replot();
 
        }
 
        else
 
        {
 
@@ -598,6 +646,8 @@ void MainWindow::enableDemo(bool enabled
 
    {
 
        demoTimer.stop();
 
        ui->actionDemoMode->setChecked(false);
 
        demoIndicator.hide();
 
        ui->plot->replot();
 
    }
 
}
 

	
mainwindow.h
Show inline comments
 
@@ -22,6 +22,7 @@
 

	
 
#include <QMainWindow>
 
#include <QButtonGroup>
 
#include <QLabel>
 
#include <QString>
 
#include <QVector>
 
#include <QList>
 
@@ -31,6 +32,7 @@
 
#include <QColor>
 
#include <QtGlobal>
 
#include <qwt_plot_curve.h>
 
#include <qwt_plot_textlabel.h>
 

	
 
#include "portcontrol.h"
 
#include "ui_about_dialog.h"
 
@@ -80,7 +82,7 @@ private:
 
    DataArray dataX;   // array that simply contains numbers 0..numberOfSamples
 
    QList<DataArray> channelsData;
 

	
 
    // `data` contains channel specific data
 
    // `data` contains i th channels data
 
    void addChannelData(unsigned int channel, DataArray data);
 

	
 
    NumberFormat numberFormat;
 
@@ -92,10 +94,16 @@ private:
 

	
 
    bool skipByteRequested;
 

	
 
    const int SPS_UPDATE_TIMEOUT = 1;  // second
 
    QLabel spsLabel;
 
    unsigned int sampleCount;
 
    QTimer spsTimer;
 

	
 
    // demo
 
    QTimer demoTimer;
 
    int demoCount;
 
    bool isDemoRunning();
 
    QwtPlotTextLabel demoIndicator;
 

	
 
    QColor makeColor(unsigned int channelIndex);
 

	
 
@@ -117,6 +125,8 @@ private slots:
 

	
 
    void clearPlot();
 

	
 
    void spsTimerTimeout();
 

	
 
    void demoTimerTimeout();
 
    void enableDemo(bool enabled);
 

	
mainwindow.ui
Show inline comments
 
@@ -106,6 +106,9 @@
 
            <layout class="QGridLayout" name="gridLayout_2">
 
             <item row="2" column="0">
 
              <widget class="QRadioButton" name="rbUint32">
 
               <property name="toolTip">
 
                <string>unsigned 4 bytes integer</string>
 
               </property>
 
               <property name="text">
 
                <string>uint32</string>
 
               </property>
 
@@ -113,6 +116,9 @@
 
             </item>
 
             <item row="0" column="1">
 
              <widget class="QRadioButton" name="rbInt8">
 
               <property name="toolTip">
 
                <string>signed 1 byte integer</string>
 
               </property>
 
               <property name="text">
 
                <string>int8</string>
 
               </property>
 
@@ -120,6 +126,9 @@
 
             </item>
 
             <item row="0" column="0">
 
              <widget class="QRadioButton" name="rbUint8">
 
               <property name="toolTip">
 
                <string>unsigned 1 byte integer</string>
 
               </property>
 
               <property name="text">
 
                <string>uint8</string>
 
               </property>
 
@@ -140,6 +149,9 @@
 
             </item>
 
             <item row="1" column="1">
 
              <widget class="QRadioButton" name="rbInt16">
 
               <property name="toolTip">
 
                <string>signed 2 bytes integer</string>
 
               </property>
 
               <property name="text">
 
                <string>int16</string>
 
               </property>
 
@@ -147,6 +159,9 @@
 
             </item>
 
             <item row="2" column="1">
 
              <widget class="QRadioButton" name="rbInt32">
 
               <property name="toolTip">
 
                <string>signed 4 bytes integer</string>
 
               </property>
 
               <property name="text">
 
                <string>int32</string>
 
               </property>
 
@@ -154,6 +169,9 @@
 
             </item>
 
             <item row="3" column="0">
 
              <widget class="QRadioButton" name="rbFloat">
 
               <property name="toolTip">
 
                <string>4 bytes floating point number</string>
 
               </property>
 
               <property name="text">
 
                <string>float</string>
 
               </property>
 
@@ -161,6 +179,9 @@
 
             </item>
 
             <item row="1" column="0">
 
              <widget class="QRadioButton" name="rbUint16">
 
               <property name="toolTip">
 
                <string>unsigned 2 bytes integer</string>
 
               </property>
 
               <property name="text">
 
                <string>uint16</string>
 
               </property>
 
@@ -203,6 +224,9 @@
 
            <layout class="QVBoxLayout" name="verticalLayout">
 
             <item>
 
              <widget class="QRadioButton" name="rbLittleE">
 
               <property name="toolTip">
 
                <string>least significant byte first</string>
 
               </property>
 
               <property name="text">
 
                <string>Little Endian</string>
 
               </property>
 
@@ -213,6 +237,9 @@
 
             </item>
 
             <item>
 
              <widget class="QRadioButton" name="rbBigE">
 
               <property name="toolTip">
 
                <string>most significant byte first</string>
 
               </property>
 
               <property name="text">
 
                <string>Big Endian</string>
 
               </property>
 
@@ -295,6 +322,9 @@
 
              <height>16777215</height>
 
             </size>
 
            </property>
 
            <property name="toolTip">
 
             <string>lower limit of Y axis</string>
 
            </property>
 
            <property name="value">
 
             <double>0.000000000000000</double>
 
            </property>
 
@@ -302,6 +332,9 @@
 
          </item>
 
          <item row="0" column="1">
 
           <widget class="QSpinBox" name="spNumOfSamples">
 
            <property name="toolTip">
 
             <string>length of X axis</string>
 
            </property>
 
            <property name="keyboardTracking">
 
             <bool>false</bool>
 
            </property>
 
@@ -364,6 +397,9 @@
 
              <height>16777215</height>
 
             </size>
 
            </property>
 
            <property name="toolTip">
 
             <string>upper limit of Y axis</string>
 
            </property>
 
            <property name="maximum">
 
             <double>1000.000000000000000</double>
 
            </property>
 
@@ -492,6 +528,8 @@
 
     <string>File</string>
 
    </property>
 
    <addaction name="actionExportCsv"/>
 
    <addaction name="separator"/>
 
    <addaction name="actionQuit"/>
 
   </widget>
 
   <addaction name="menuFile"/>
 
   <addaction name="menuHelp"/>
 
@@ -550,6 +588,14 @@
 
    <string>Export plot data to CSV</string>
 
   </property>
 
  </action>
 
  <action name="actionQuit">
 
   <property name="text">
 
    <string>Quit</string>
 
   </property>
 
   <property name="shortcut">
 
    <string>Ctrl+Q</string>
 
   </property>
 
  </action>
 
 </widget>
 
 <layoutdefault spacing="6" margin="11"/>
 
 <customwidgets>
misc/pseudo_device.py
Show inline comments
 
@@ -61,6 +61,16 @@ def float_sine(port):
 
        i = (i + 1) % period
 
        time.sleep(0.1)
 

	
 
def uint32_test(port, little):
 
    """Puts 32 bit unsigned integer data through pseudo terminal"""
 
    i = 0
 
    maxi = 200
 
    while True:
 
        data = struct.pack('>I', i)
 
        os.write(port, data)
 
        time.sleep(0.05)
 
        i = i+1 if i <= maxi else 0
 

	
 
def run():
 
    # create the pseudo terminal
 
    master, slave = pty.openpty()
misc/serialplot.bmp
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
misc/serialplot.ico
Show inline comments
 
new file 100644
 
binary diff not shown
misc/windows_icon.rc
Show inline comments
 
new file 100644
 
IDI_ICON1               ICON    DISCARDABLE     "serialplot.ico"
 
\ No newline at end of file
portcontrol.ui
Show inline comments
 
@@ -69,6 +69,9 @@
 
           <height>16777215</height>
 
          </size>
 
         </property>
 
         <property name="toolTip">
 
          <string>Reload port list</string>
 
         </property>
 
         <property name="text">
 
          <string>↺</string>
 
         </property>
 
@@ -280,6 +283,9 @@
 
         <height>50</height>
 
        </size>
 
       </property>
 
       <property name="toolTip">
 
        <string>Toggle port status</string>
 
       </property>
 
       <property name="text">
 
        <string>Open</string>
 
       </property>
 
@@ -290,6 +296,9 @@
 
     </item>
 
     <item>
 
      <widget class="QPushButton" name="pbSkipByte">
 
       <property name="toolTip">
 
        <string>Skip reading 1 byte to correct the alignment</string>
 
       </property>
 
       <property name="text">
 
        <string>Skip Byte</string>
 
       </property>
0 comments (0 inline, 0 general)