Add timebase controls to scope part

Build debug symbols package
master
Timothy Pearson 11 years ago
parent 31f91d555b
commit 55e9906b78

@ -12,3 +12,13 @@ Depends: ${shlibs:Depends}, ${misc:Depends}
Recommends: kerberostray-trinity Recommends: kerberostray-trinity
Description: remote laboratory client [Trinity] Description: remote laboratory client [Trinity]
Remote Laboratory Client for Trinity Remote Laboratory Client for Trinity
Package: remote-laboratory-client-trinity-dbg
Section: devel
Architecture: any
Priority: extra
Depends: remote-laboratory-client-trinity (= ${binary:Version}), tdelibs-trinity-dbg
Description: debugging symbols for the Remote Laboratory Client [Trinity]
This package contains the debugging symbols associated with remote-laboratory-client-trinity.
They will automatically be used by gdb for debugging remote-laboratory-client-trinity-related
issues.

@ -7,6 +7,7 @@
include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/rules/debhelper.mk
include debian/cdbs/kde.mk include debian/cdbs/kde.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk include /usr/share/cdbs/1/rules/patchsys-quilt.mk
include /usr/share/cdbs/1/rules/utils.mk
DEB_CONFIGURE_INCLUDEDIR := /opt/trinity/include/tde DEB_CONFIGURE_INCLUDEDIR := /opt/trinity/include/tde
DEB_CONFIGURE_MANDIR := /opt/trinity/share/man DEB_CONFIGURE_MANDIR := /opt/trinity/share/man
@ -17,7 +18,7 @@ cdbs_configure_flags := --with-qt-dir=/usr/share/tqt3 --disable-rpath --with-xin
DEB_DH_ALWAYS_EXCLUDE=.svn DEB_DH_ALWAYS_EXCLUDE=.svn
DEB_CONFIGURE_EXTRA_FLAGS := --prefix=/opt/trinity --with-extra-libs=/opt/trinity/lib --disable-debug DEB_CONFIGURE_EXTRA_FLAGS := --prefix=/opt/trinity --with-extra-libs=/opt/trinity/lib
post-patches:: debian/stamp-bootstrap post-patches:: debian/stamp-bootstrap

@ -1,10 +1,10 @@
# Makefile.in generated by automake 1.11.6 from Makefile.am. # Makefile.in generated by automake 1.11 from Makefile.am.
# KDE tags expanded automatically by am_edit - $Revision$ # KDE tags expanded automatically by am_edit - $Revision$
# @configure_input@ # @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Foundation, Inc. # Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
@ -17,23 +17,6 @@
@SET_MAKE@ @SET_MAKE@
VPATH = @srcdir@ VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
@ -85,12 +68,6 @@ am__nobase_list = $(am__nobase_strip_setup); \
am__base_list = \ am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(kde_moduledir)" am__installdirs = "$(DESTDIR)$(kde_moduledir)"
LTLIBRARIES = $(kde_module_LTLIBRARIES) LTLIBRARIES = $(kde_module_LTLIBRARIES)
am__DEPENDENCIES_1 = am__DEPENDENCIES_1 =
@ -141,11 +118,6 @@ CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
$(LDFLAGS) -o $@ $(LDFLAGS) -o $@
SOURCES = $(libremotelab_logicanalyzer_la_SOURCES) SOURCES = $(libremotelab_logicanalyzer_la_SOURCES)
DIST_SOURCES = $(libremotelab_logicanalyzer_la_SOURCES) DIST_SOURCES = $(libremotelab_logicanalyzer_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
ETAGS = etags ETAGS = etags
CTAGS = ctags CTAGS = ctags
#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) #>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@ -177,7 +149,6 @@ DCOPIDLNG = @DCOPIDLNG@
DCOP_DEPENDENCIES = @DCOP_DEPENDENCIES@ DCOP_DEPENDENCIES = @DCOP_DEPENDENCIES@
DEFS = @DEFS@ DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOXYGEN = @DOXYGEN@ DOXYGEN = @DOXYGEN@
DOXYGEN_PROJECT_NAME = @DOXYGEN_PROJECT_NAME@ DOXYGEN_PROJECT_NAME = @DOXYGEN_PROJECT_NAME@
DOXYGEN_PROJECT_NUMBER = @DOXYGEN_PROJECT_NUMBER@ DOXYGEN_PROJECT_NUMBER = @DOXYGEN_PROJECT_NUMBER@
@ -276,7 +247,6 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MAKETDEWIDGETS = @MAKETDEWIDGETS@ MAKETDEWIDGETS = @MAKETDEWIDGETS@
MANIFEST_TOOL = @MANIFEST_TOOL@
MCOPIDL = @MCOPIDL@ MCOPIDL = @MCOPIDL@
MEINPROC = @MEINPROC@ MEINPROC = @MEINPROC@
MKDIR_P = @MKDIR_P@ MKDIR_P = @MKDIR_P@
@ -295,7 +265,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@ PERL = @PERL@
@ -336,7 +305,6 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@ abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@ ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@ ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@ -394,6 +362,7 @@ libdir = @libdir@
libexecdir = @libexecdir@ libexecdir = @libexecdir@
localedir = @localedir@ localedir = @localedir@
localstatedir = @localstatedir@ localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@ mandir = @mandir@
mkdir_p = @mkdir_p@ mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@ oldincludedir = @oldincludedir@
@ -487,6 +456,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
install-kde_moduleLTLIBRARIES: $(kde_module_LTLIBRARIES) install-kde_moduleLTLIBRARIES: $(kde_module_LTLIBRARIES)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
test -z "$(kde_moduledir)" || $(MKDIR_P) "$(DESTDIR)$(kde_moduledir)"
@list='$(kde_module_LTLIBRARIES)'; test -n "$(kde_moduledir)" || list=; \ @list='$(kde_module_LTLIBRARIES)'; test -n "$(kde_moduledir)" || list=; \
list2=; for p in $$list; do \ list2=; for p in $$list; do \
if test -f $$p; then \ if test -f $$p; then \
@ -494,8 +464,6 @@ install-kde_moduleLTLIBRARIES: $(kde_module_LTLIBRARIES)
else :; fi; \ else :; fi; \
done; \ done; \
test -z "$$list2" || { \ test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(kde_moduledir)'"; \
$(MKDIR_P) "$(DESTDIR)$(kde_moduledir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(kde_moduledir)'"; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(kde_moduledir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(kde_moduledir)"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(kde_moduledir)"; \
} }
@ -517,7 +485,7 @@ clean-kde_moduleLTLIBRARIES:
echo "rm -f \"$${dir}/so_locations\""; \ echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \ rm -f "$${dir}/so_locations"; \
done done
libremotelab_logicanalyzer.la: $(libremotelab_logicanalyzer_la_OBJECTS) $(libremotelab_logicanalyzer_la_DEPENDENCIES) $(EXTRA_libremotelab_logicanalyzer_la_DEPENDENCIES) libremotelab_logicanalyzer.la: $(libremotelab_logicanalyzer_la_OBJECTS) $(libremotelab_logicanalyzer_la_DEPENDENCIES)
$(libremotelab_logicanalyzer_la_LINK) -rpath $(kde_moduledir) $(libremotelab_logicanalyzer_la_OBJECTS) $(libremotelab_logicanalyzer_la_LIBADD) $(LIBS) $(libremotelab_logicanalyzer_la_LINK) -rpath $(kde_moduledir) $(libremotelab_logicanalyzer_la_OBJECTS) $(libremotelab_logicanalyzer_la_LIBADD) $(LIBS)
mostlyclean-compile: mostlyclean-compile:
@ -654,15 +622,10 @@ install-am: all-am
installcheck: installcheck-am installcheck: installcheck-am
install-strip: install-strip:
if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \
install; \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic: mostlyclean-generic:
clean-generic: clean-generic:

@ -103,6 +103,11 @@
</property> </property>
</widget> </widget>
<widget class="TQWidget" row="1" column="0" colspan="2"> <widget class="TQWidget" row="1" column="0" colspan="2">
<property name="name">
<cstring>timebaseControlLayoutWidget</cstring>
</property>
</widget>
<widget class="TQWidget" row="2" column="0" colspan="2">
<property name="name"> <property name="name">
<cstring>traceControlLayoutWidget</cstring> <cstring>traceControlLayoutWidget</cstring>
</property> </property>
@ -151,6 +156,24 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="TQGroupBox" row="2" column="1">
<property name="name">
<cstring>groupOscilloscopeTestNotes</cstring>
</property>
<property name="title">
<string>Notes</string>
</property>
<grid>
<widget class="KTextEdit" row="0" column="0" colspan="1">
<property name="name">
<cstring>userNotes</cstring>
</property>
<property name="text">
<string></string>
</property>
</widget>
</grid>
</widget>
</grid> </grid>
</widget> </widget>
</grid> </grid>

@ -30,6 +30,7 @@
#include <tdefiledialog.h> #include <tdefiledialog.h>
#include <tdeparts/genericfactory.h> #include <tdeparts/genericfactory.h>
#include <kstatusbar.h> #include <kstatusbar.h>
#include <ktextedit.h>
#include <kstdaction.h> #include <kstdaction.h>
#include <tqfile.h> //encodeName() #include <tqfile.h> //encodeName()
#include <tqtimer.h> #include <tqtimer.h>
@ -64,23 +65,28 @@ enum connectionStates {
ScopeState_ResetRequest = 2, ScopeState_ResetRequest = 2,
ScopeState_HorizontalDivCountRequest = 4, ScopeState_HorizontalDivCountRequest = 4,
ScopeState_VerticalDivCountRequest = 6, ScopeState_VerticalDivCountRequest = 6,
ScopeState_ChannelCountRequest = 8, ScopeState_PermittedSecondsDivRequest = 8,
ScopeState_ChannelActiveStateRequest = 10, ScopeState_ChannelCountRequest = 10,
ScopeState_TraceSampleCountRequest = 12, ScopeState_ChannelActiveStateRequest = 12,
ScopeState_TracePermittedVoltsDivRequest = 14, ScopeState_TraceSampleCountRequest = 14,
ScopeState_TraceVoltsDivRequest = 16, ScopeState_TracePermittedVoltsDivRequest = 16,
ScopeState_TraceSecondsDivRequest = 18, ScopeState_TraceVoltsDivRequest = 18,
ScopeState_TriggerChannelRequest = 20, ScopeState_TraceSecondsDivRequest = 20,
ScopeState_TriggerLevelRequest = 22, ScopeState_HorizontalTimebaseRequest = 22,
ScopeState_RunningRequest = 24, ScopeState_TriggerChannelRequest = 24,
ScopeState_TriggerLevelRequest = 26,
ScopeState_RunningRequest = 28,
ScopeState_TraceRequest = 50, ScopeState_TraceRequest = 50,
ScopeState_ChannelActiveStateUpdate = 100, ScopeState_ChannelActiveStateUpdate = 100,
ScopeState_TraceVoltsDivUpdate = 102, ScopeState_TraceVoltsDivUpdate = 102,
ScopeState_TriggerLevelUpdate = 104, ScopeState_TriggerLevelUpdate = 104,
ScopeState_RunningUpdate = 106, ScopeState_HorizontalTimebaseUpdate = 106,
ScopeState_RunningUpdate = 108,
ScopeState_ExternalCommandRequest = 255 ScopeState_ExternalCommandRequest = 255
}; };
#define ScopeState_ReloadSettings ScopeState_ChannelActiveStateRequest
namespace RemoteLab { namespace RemoteLab {
typedef KParts::GenericFactory<RemoteLab::ScopePart> Factory; typedef KParts::GenericFactory<RemoteLab::ScopePart> Factory;
@ -162,9 +168,64 @@ void TraceControlWidget::vdivChanged(int index) {
emit(voltsPerDivChanged(value)); emit(voltsPerDivChanged(value));
} }
TimebaseControlWidget::TimebaseControlWidget(TQWidget *parent, const char *name)
: TQWidget(parent, name)
{
TQGridLayout *topGrid = new TQGridLayout(this);
m_groupBox = new TQGroupBox(this);
m_groupBox->setColumnLayout(0, TQt::Vertical);
topGrid->addMultiCellWidget(m_groupBox, 0, 0, 0, 0);
m_groupBox->setTitle(i18n("Timebase"));
m_primaryLayout = new TQGridLayout(m_groupBox->layout(), 1, 1, KDialog::spacingHint());
m_secondsDivComboBox = new TQComboBox(m_groupBox);
connect(m_secondsDivComboBox, SIGNAL(activated(int)), this, SLOT(sdivChanged(int)));
m_primaryLayout->addMultiCellWidget(m_secondsDivComboBox, 0, 0, 0, 0);
TQLabel* label = new TQLabel(m_groupBox);
label->setText(i18n("/div"));
m_primaryLayout->addMultiCellWidget(label, 0, 0, 1, 1);
}
TimebaseControlWidget::~TimebaseControlWidget() {
//
}
void TimebaseControlWidget::setSecondsPerDivList(TQDoubleList list) {
m_secondsDivList = list;
// Update drop down list
double prevValue = m_secondsDivComboBox->currentText().toDouble();
m_secondsDivComboBox->clear();
TQDoubleList::iterator it;
int i = 0;
for (it = m_secondsDivList.begin(); it != m_secondsDivList.end(); ++it) {
m_secondsDivComboBox->insertItem(TQString("%1").arg(TraceWidget::prettyFormat(*it, *it, "s", 3)), i);
if (prevValue == (*it)) {
m_secondsDivComboBox->setCurrentItem(i);
}
i++;
}
}
void TimebaseControlWidget::setSelectedSecondsPerDiv(double sdiv) {
int i = 0;
for (i=0;i<m_secondsDivComboBox->count();i++) {
if (m_secondsDivComboBox->text(i) == TraceWidget::prettyFormat(sdiv, sdiv, "s", 3)) {
m_secondsDivComboBox->setCurrentItem(i);
}
}
}
void TimebaseControlWidget::sdivChanged(int index) {
Q_UNUSED(index)
double value = m_secondsDivList[m_secondsDivComboBox->currentItem()];
emit(secondsPerDivChanged(value));
}
ScopePart::ScopePart( TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, const TQStringList& ) ScopePart::ScopePart( TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, const TQStringList& )
: RemoteInstrumentPart( parent, name ), m_traceWidget(0), m_commHandlerState(-1), m_commHandlerMode(0), m_commHandlerCommandState(0), m_connectionActiveAndValid(false), : RemoteInstrumentPart( parent, name ), m_traceWidget(0), m_commHandlerState(-1), m_commHandlerMode(0), m_commHandlerCommandState(0), m_connectionActiveAndValid(false),
m_triggerChannel(-1), m_base(0), stopTraceUpdate(false) m_triggerChannel(-1), m_settingsChanged(false), m_base(0), stopTraceUpdate(false)
{ {
// Initialize important base class variables // Initialize important base class variables
m_clientLibraryName = CLIENT_LIBRARY; m_clientLibraryName = CLIENT_LIBRARY;
@ -196,11 +257,16 @@ ScopePart::ScopePart( TQWidget *parentWidget, const char *widgetName, TQObject *
m_channelActiveSet[traceno] = false; m_channelActiveSet[traceno] = false;
} }
m_triggerLevelSet = false; m_triggerLevelSet = false;
m_horizontalTimebaseSet = false;
m_runningSet = false; m_runningSet = false;
// Create widgets // Create widgets
m_base = new ScopeBase(widget()); m_base = new ScopeBase(widget());
m_traceControlWidgetGrid = new TQGridLayout(m_base->traceControlLayoutWidget); m_traceControlWidgetGrid = new TQGridLayout(m_base->traceControlLayoutWidget);
m_timebaseControlWidgetGrid = new TQGridLayout(m_base->timebaseControlLayoutWidget);
m_timebaseControlWidget = new TimebaseControlWidget(m_base->timebaseControlLayoutWidget);
connect(m_timebaseControlWidget, SIGNAL(secondsPerDivChanged(double)), this, SLOT(traceControlSDivChanged(double)));
m_timebaseControlWidgetGrid->addMultiCellWidget(m_timebaseControlWidget, 0, 0, 0, 0);
m_traceWidget = m_base->traceScrollWidget->traceWidget(); m_traceWidget = m_base->traceScrollWidget->traceWidget();
connect(m_traceWidget, SIGNAL(cursorDragged(uint, double)), this, SLOT(cursorLevelChanged(uint, double))); connect(m_traceWidget, SIGNAL(cursorDragged(uint, double)), this, SLOT(cursorLevelChanged(uint, double)));
m_base->traceScrollWidget->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding)); m_base->traceScrollWidget->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding));
@ -359,6 +425,7 @@ void ScopePart::setTickerMessage(TQString message) {
if (m_channelActiveSet[i]) updatesPending = true; if (m_channelActiveSet[i]) updatesPending = true;
if (m_voltsDivSet[i]) updatesPending = true; if (m_voltsDivSet[i]) updatesPending = true;
if (m_triggerLevelSet) updatesPending = true; if (m_triggerLevelSet) updatesPending = true;
if (m_horizontalTimebaseSet) updatesPending = true;
if (m_runningSet) updatesPending = true; if (m_runningSet) updatesPending = true;
} }
@ -600,6 +667,55 @@ void ScopePart::mainEventLoop() {
} }
m_socket->clearFrameTail(); m_socket->clearFrameTail();
if (result == "ACK") {
SET_NEXT_STATE(ScopeState_PermittedSecondsDivRequest)
EXEC_NEXT_STATE_IMMEDIATELY
}
else {
if (stopTraceUpdate == false) {
COMMUNICATIONS_FAILED
}
else {
setTickerMessage(i18n("Data acquisition stopped"));
}
}
}
else {
if (!m_updateTimeoutTimer->isActive()) {
if (stopTraceUpdate == false) {
UPDATEDISPLAY_TIMEOUT
}
else {
setTickerMessage(i18n("Data acquisition stopped"));
}
}
}
}
else if (m_commHandlerState == ScopeState_PermittedSecondsDivRequest) {
// Get permitted seconds/div settings, step 1
ds << TQString("GETPERMITTEDSDIVS");
ds << m_currentOpChannel;
m_socket->writeEndOfFrame();
SET_NEXT_STATE_DATA_WAITING(ScopeState_PermittedSecondsDivRequest+1)
EXEC_NEXT_STATE_IMMEDIATELY
}
else if (m_commHandlerState == ScopeState_PermittedSecondsDivRequest+1) {
// Get response data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
setTickerMessage(i18n("Loading [Received allowed seconds/div list]"));
// Get permitted seconds/div settings, step 2
TQString result;
ds >> result;
if (result == "ACK") {
TQDoubleList list;
ds >> list;
m_timebaseControlWidget->setSecondsPerDivList(list);
}
m_socket->clearFrameTail();
if (result == "ACK") { if (result == "ACK") {
SET_NEXT_STATE(ScopeState_ChannelCountRequest) SET_NEXT_STATE(ScopeState_ChannelCountRequest)
EXEC_NEXT_STATE_IMMEDIATELY EXEC_NEXT_STATE_IMMEDIATELY
@ -932,7 +1048,7 @@ void ScopePart::mainEventLoop() {
SET_NEXT_STATE(ScopeState_TraceSecondsDivRequest) SET_NEXT_STATE(ScopeState_TraceSecondsDivRequest)
} }
else { else {
SET_NEXT_STATE(ScopeState_TriggerChannelRequest) SET_NEXT_STATE(ScopeState_HorizontalTimebaseRequest)
} }
EXEC_NEXT_STATE_IMMEDIATELY EXEC_NEXT_STATE_IMMEDIATELY
} }
@ -956,6 +1072,54 @@ void ScopePart::mainEventLoop() {
} }
} }
} }
else if (m_commHandlerState == ScopeState_HorizontalTimebaseRequest) {
// Get horizontal timebase, step 1
ds << TQString("GETHORIZTIMEBASE");
m_socket->writeEndOfFrame();
SET_NEXT_STATE_DATA_WAITING(ScopeState_HorizontalTimebaseRequest+1)
EXEC_NEXT_STATE_IMMEDIATELY
}
else if (m_commHandlerState == ScopeState_HorizontalTimebaseRequest+1) {
// Get response data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
setTickerMessage(i18n("Loading [Received horizontal timebase]"));
// Get horizontal timebase, step 2
TQString result;
ds >> result;
if (result == "ACK") {
ds >> m_horizontalTimebase;
m_timebaseControlWidget->setSelectedSecondsPerDiv(m_horizontalTimebase);
}
m_socket->clearFrameTail();
if (result == "ACK") {
m_currentOpChannel = 1;
SET_NEXT_STATE(ScopeState_TriggerChannelRequest)
EXEC_NEXT_STATE_IMMEDIATELY
}
else {
if (stopTraceUpdate == false) {
COMMUNICATIONS_FAILED
}
else {
setTickerMessage(i18n("Data acquisition stopped"));
}
}
}
else {
if (!m_updateTimeoutTimer->isActive()) {
if (stopTraceUpdate == false) {
UPDATEDISPLAY_TIMEOUT
}
else {
setTickerMessage(i18n("Data acquisition stopped"));
}
}
}
}
else if (m_commHandlerState == ScopeState_TriggerChannelRequest) { else if (m_commHandlerState == ScopeState_TriggerChannelRequest) {
// Get trigger channel, step 1 // Get trigger channel, step 1
ds << TQString("GETTRIGGERCHANNEL"); ds << TQString("GETTRIGGERCHANNEL");
@ -1116,7 +1280,6 @@ void ScopePart::mainEventLoop() {
ds << m_currentOpChannel; ds << m_currentOpChannel;
m_socket->writeEndOfFrame(); m_socket->writeEndOfFrame();
m_lastChangesRequireFullUpdate = false;
SET_NEXT_STATE_DATA_WAITING(ScopeState_TraceRequest+1) SET_NEXT_STATE_DATA_WAITING(ScopeState_TraceRequest+1)
EXEC_NEXT_STATE_IMMEDIATELY EXEC_NEXT_STATE_IMMEDIATELY
} }
@ -1154,12 +1317,13 @@ void ScopePart::mainEventLoop() {
&& (m_channelActiveSet[m_currentOpChannel] == false) && (m_channelActiveSet[m_currentOpChannel] == false)
&& (m_voltsDivSet[m_currentOpChannel] == false) && (m_voltsDivSet[m_currentOpChannel] == false)
&& (m_triggerLevelSet == false) && (m_triggerLevelSet == false)
&& (m_horizontalTimebaseSet == false)
&& (m_runningSet == false) && (m_runningSet == false)
) { ) {
SET_NEXT_STATE(ScopeState_TraceRequest) SET_NEXT_STATE(ScopeState_TraceRequest)
} }
else { else {
m_currentOpChannel = getNextActiveChannel(0, m_channelActive, m_maxNumberOfTraces); m_currentOpChannel = 1;
SET_NEXT_STATE(ScopeState_ChannelActiveStateUpdate) SET_NEXT_STATE(ScopeState_ChannelActiveStateUpdate)
} }
EXEC_NEXT_STATE_IMMEDIATELY EXEC_NEXT_STATE_IMMEDIATELY
@ -1193,28 +1357,23 @@ void ScopePart::mainEventLoop() {
ds << active; ds << active;
m_socket->writeEndOfFrame(); m_socket->writeEndOfFrame();
m_lastChangesRequireFullUpdate = true;
m_channelActiveSet[m_currentOpChannel] = false; m_channelActiveSet[m_currentOpChannel] = false;
SET_NEXT_STATE_DATA_WAITING(ScopeState_ChannelActiveStateUpdate+1) SET_NEXT_STATE_DATA_WAITING(ScopeState_ChannelActiveStateUpdate+1)
} }
else { else {
m_currentOpChannel = m_currentOpChannel + 1;
if (m_currentOpChannel < m_maxNumberOfTraces) { if (m_currentOpChannel < m_maxNumberOfTraces) {
m_currentOpChannel++;
SET_NEXT_STATE(ScopeState_ChannelActiveStateUpdate) SET_NEXT_STATE(ScopeState_ChannelActiveStateUpdate)
} }
else { else {
m_currentOpChannel = getNextActiveChannel(0, m_channelActive, m_maxNumberOfTraces); m_currentOpChannel = getNextActiveChannel(0, m_channelActive, m_maxNumberOfTraces);
if (m_lastChangesRequireFullUpdate) { SET_NEXT_STATE(ScopeState_TraceVoltsDivUpdate)
SET_NEXT_STATE(ScopeState_TraceVoltsDivRequest)
}
else {
SET_NEXT_STATE(ScopeState_TraceVoltsDivUpdate)
}
} }
} }
EXEC_NEXT_STATE_IMMEDIATELY EXEC_NEXT_STATE_IMMEDIATELY
} }
else if (m_commHandlerState == ScopeState_ChannelActiveStateUpdate+1) { else if (m_commHandlerState == ScopeState_ChannelActiveStateUpdate+1) {
m_settingsChanged = true;
// Get response data // Get response data
if (m_socket->canReadFrame()) { if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER PAT_WATCHDOG_TIMER
@ -1231,11 +1390,12 @@ void ScopePart::mainEventLoop() {
SET_NEXT_STATE(ScopeState_ChannelActiveStateUpdate) SET_NEXT_STATE(ScopeState_ChannelActiveStateUpdate)
} }
else { else {
m_currentOpChannel = getNextActiveChannel(0, m_channelActive, m_maxNumberOfTraces); m_currentOpChannel = m_currentOpChannel + 1;
if (m_lastChangesRequireFullUpdate) { if (m_currentOpChannel < m_maxNumberOfTraces) {
SET_NEXT_STATE(ScopeState_TraceVoltsDivRequest) SET_NEXT_STATE(ScopeState_ChannelActiveStateUpdate)
} }
else { else {
m_currentOpChannel = getNextActiveChannel(0, m_channelActive, m_maxNumberOfTraces);
SET_NEXT_STATE(ScopeState_TraceVoltsDivUpdate) SET_NEXT_STATE(ScopeState_TraceVoltsDivUpdate)
} }
} }
@ -1284,6 +1444,7 @@ void ScopePart::mainEventLoop() {
EXEC_NEXT_STATE_IMMEDIATELY EXEC_NEXT_STATE_IMMEDIATELY
} }
else if (m_commHandlerState == ScopeState_TraceVoltsDivUpdate+1) { else if (m_commHandlerState == ScopeState_TraceVoltsDivUpdate+1) {
m_settingsChanged = true;
// Get response data // Get response data
if (m_socket->canReadFrame()) { if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER PAT_WATCHDOG_TIMER
@ -1325,7 +1486,7 @@ void ScopePart::mainEventLoop() {
} }
} }
else if (m_commHandlerState == ScopeState_TriggerLevelUpdate) { else if (m_commHandlerState == ScopeState_TriggerLevelUpdate) {
if (m_voltsDivSet[m_currentOpChannel]) { if (m_triggerLevelSet) {
// Set trigger level, step 1 // Set trigger level, step 1
ds << TQString("SETTRIGGERLEVEL"); ds << TQString("SETTRIGGERLEVEL");
ds << m_triggerLevel; ds << m_triggerLevel;
@ -1335,12 +1496,12 @@ void ScopePart::mainEventLoop() {
SET_NEXT_STATE_DATA_WAITING(ScopeState_TriggerLevelUpdate+1) SET_NEXT_STATE_DATA_WAITING(ScopeState_TriggerLevelUpdate+1)
} }
else { else {
m_currentOpChannel = getNextActiveChannel(0, m_channelActive, m_maxNumberOfTraces); SET_NEXT_STATE(ScopeState_HorizontalTimebaseUpdate)
SET_NEXT_STATE(ScopeState_TraceRequest)
} }
EXEC_NEXT_STATE_IMMEDIATELY EXEC_NEXT_STATE_IMMEDIATELY
} }
else if (m_commHandlerState == ScopeState_TriggerLevelUpdate+1) { else if (m_commHandlerState == ScopeState_TriggerLevelUpdate+1) {
m_settingsChanged = true;
// Get response data // Get response data
if (m_socket->canReadFrame()) { if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER PAT_WATCHDOG_TIMER
@ -1351,6 +1512,57 @@ void ScopePart::mainEventLoop() {
ds >> result; ds >> result;
m_socket->clearFrameTail(); m_socket->clearFrameTail();
if (result == "ACK") {
SET_NEXT_STATE(ScopeState_HorizontalTimebaseUpdate)
EXEC_NEXT_STATE_IMMEDIATELY
}
else {
if (stopTraceUpdate == false) {
COMMUNICATIONS_FAILED
}
else {
setTickerMessage(i18n("Data acquisition stopped"));
}
}
}
else {
if (!m_updateTimeoutTimer->isActive()) {
if (stopTraceUpdate == false) {
UPDATEDISPLAY_TIMEOUT
}
else {
setTickerMessage(i18n("Data acquisition stopped"));
}
}
}
}
else if (m_commHandlerState == ScopeState_HorizontalTimebaseUpdate) {
if (m_horizontalTimebaseSet) {
// Set horizontal timebase, step 1
ds << TQString("SETHORIZTIMEBASE");
ds << m_horizontalTimebase;
m_socket->writeEndOfFrame();
m_horizontalTimebaseSet = false;
SET_NEXT_STATE_DATA_WAITING(ScopeState_HorizontalTimebaseUpdate+1)
}
else {
SET_NEXT_STATE(ScopeState_RunningUpdate)
}
EXEC_NEXT_STATE_IMMEDIATELY
}
else if (m_commHandlerState == ScopeState_HorizontalTimebaseUpdate+1) {
m_settingsChanged = true;
// Get response data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
setTickerMessage(i18n("Updating [Set horizontal timebase]"));
// Set horizontal timebase, step 2
TQString result;
ds >> result;
m_socket->clearFrameTail();
if (result == "ACK") { if (result == "ACK") {
SET_NEXT_STATE(ScopeState_RunningUpdate) SET_NEXT_STATE(ScopeState_RunningUpdate)
EXEC_NEXT_STATE_IMMEDIATELY EXEC_NEXT_STATE_IMMEDIATELY
@ -1388,11 +1600,19 @@ void ScopePart::mainEventLoop() {
} }
else { else {
m_currentOpChannel = getNextActiveChannel(0, m_channelActive, m_maxNumberOfTraces); m_currentOpChannel = getNextActiveChannel(0, m_channelActive, m_maxNumberOfTraces);
SET_NEXT_STATE(ScopeState_TraceRequest) if (m_settingsChanged) {
m_settingsChanged = false;
SET_NEXT_STATE(ScopeState_ReloadSettings)
}
else {
SET_NEXT_STATE(ScopeState_TraceRequest)
}
} }
EXEC_NEXT_STATE_IMMEDIATELY EXEC_NEXT_STATE_IMMEDIATELY
} }
else if (m_commHandlerState == ScopeState_RunningUpdate+1) { else if (m_commHandlerState == ScopeState_RunningUpdate+1) {
m_settingsChanged = true;
// Get response data // Get response data
if (m_socket->canReadFrame()) { if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER PAT_WATCHDOG_TIMER
@ -1405,7 +1625,13 @@ void ScopePart::mainEventLoop() {
if (result == "ACK") { if (result == "ACK") {
m_currentOpChannel = getNextActiveChannel(0, m_channelActive, m_maxNumberOfTraces); m_currentOpChannel = getNextActiveChannel(0, m_channelActive, m_maxNumberOfTraces);
SET_NEXT_STATE(ScopeState_TraceRequest) if (m_settingsChanged) {
m_settingsChanged = false;
SET_NEXT_STATE(ScopeState_ReloadSettings)
}
else {
SET_NEXT_STATE(ScopeState_TraceRequest)
}
EXEC_NEXT_STATE_IMMEDIATELY EXEC_NEXT_STATE_IMMEDIATELY
} }
else { else {
@ -1526,6 +1752,7 @@ void ScopePart::stopDAQ() {
m_voltsDivSet[i] = false; m_voltsDivSet[i] = false;
} }
m_triggerLevelSet = false; m_triggerLevelSet = false;
m_horizontalTimebaseSet = false;
m_runningSet = false; m_runningSet = false;
m_commHandlerMode = 1; m_commHandlerMode = 1;
m_commHandlerCommandState = 3; m_commHandlerCommandState = 3;
@ -1534,7 +1761,7 @@ void ScopePart::stopDAQ() {
} }
#define WAVEFORM_MAGIC_NUMBER 1 #define WAVEFORM_MAGIC_NUMBER 1
#define WAVEFORM_FILE_VERSION 1 #define WAVEFORM_FILE_VERSION 2
void ScopePart::saveWaveforms() { void ScopePart::saveWaveforms() {
TQString saveFileName = KFileDialog::getSaveFileName(TQString::null, "*.wfm|Waveform Files (*.wfm)", 0, i18n("Save waveforms...")); TQString saveFileName = KFileDialog::getSaveFileName(TQString::null, "*.wfm|Waveform Files (*.wfm)", 0, i18n("Save waveforms..."));
@ -1563,6 +1790,7 @@ void ScopePart::saveWaveforms() {
for (int cursorno=0; cursorno<5; cursorno++) { for (int cursorno=0; cursorno<5; cursorno++) {
ds << m_traceWidget->cursorPosition(cursorno); ds << m_traceWidget->cursorPosition(cursorno);
} }
ds << m_base->userNotes->text();
} }
} }
@ -1577,7 +1805,7 @@ void ScopePart::recallWaveforms() {
ds >> magicNumber; ds >> magicNumber;
if (magicNumber == WAVEFORM_MAGIC_NUMBER) { if (magicNumber == WAVEFORM_MAGIC_NUMBER) {
ds >> version; ds >> version;
if (version == WAVEFORM_FILE_VERSION) { if ((version >= 1) && (version <= WAVEFORM_FILE_VERSION)) {
ds >> m_hdivs; ds >> m_hdivs;
ds >> m_vdivs; ds >> m_vdivs;
ds >> m_maxNumberOfTraces; ds >> m_maxNumberOfTraces;
@ -1607,6 +1835,14 @@ void ScopePart::recallWaveforms() {
ds >> cursorPos; ds >> cursorPos;
m_traceWidget->setCursorPosition(cursorno, cursorPos); m_traceWidget->setCursorPosition(cursorno, cursorPos);
} }
if (version < 2) {
m_base->userNotes->setText(TQString::null);
}
else {
TQString notes;
ds >> notes;
m_base->userNotes->setText(notes);
}
m_triggerChannel = -1; m_triggerChannel = -1;
m_triggerLevel = 0; m_triggerLevel = 0;
updateGraticule(); updateGraticule();
@ -1616,7 +1852,7 @@ void ScopePart::recallWaveforms() {
updateTraceControlWidgets(); updateTraceControlWidgets();
} }
else { else {
KMessageBox::error(0, i18n("<qt>The selected waveform file version does not match this client</qt>"), i18n("Invalid File")); KMessageBox::error(0, i18n("<qt>The selected waveform file version (%1) is not compatible with this client, which only understands versions %2-%3</qt>").arg(version).arg(1).arg(WAVEFORM_FILE_VERSION), i18n("Invalid File"));
} }
} }
else { else {
@ -1756,6 +1992,11 @@ void ScopePart::traceControlVDivChanged(double vdiv) {
updateTraceControlWidgets(); updateTraceControlWidgets();
} }
void ScopePart::traceControlSDivChanged(double sdiv) {
m_horizontalTimebase = sdiv;
m_horizontalTimebaseSet = true;
}
void ScopePart::cursorLevelChanged(uint cursor, double level) { void ScopePart::cursorLevelChanged(uint cursor, double level) {
if (cursor == 0) { if (cursor == 0) {
// Trigger level changed // Trigger level changed

@ -77,6 +77,32 @@ namespace RemoteLab
TQDoubleList m_voltsDivList; TQDoubleList m_voltsDivList;
}; };
class TimebaseControlWidget : public TQWidget
{
Q_OBJECT
public:
TimebaseControlWidget(TQWidget *parent=0, const char *name=0);
~TimebaseControlWidget();
public:
void setSecondsPerDivList(TQDoubleList list);
void setSelectedSecondsPerDiv(double sdiv);
signals:
void secondsPerDivChanged(double sdiv);
private slots:
void sdivChanged(int index);
private:
TQGroupBox* m_groupBox;
TQGridLayout* m_primaryLayout;
TQComboBox* m_secondsDivComboBox;
TQDoubleList m_secondsDivList;
};
class ScopePart : public KParts::RemoteInstrumentPart class ScopePart : public KParts::RemoteInstrumentPart
{ {
Q_OBJECT Q_OBJECT
@ -107,6 +133,7 @@ namespace RemoteLab
void updateTraceControlWidgets(); void updateTraceControlWidgets();
void traceControlEnableChanged(bool enabled); void traceControlEnableChanged(bool enabled);
void traceControlVDivChanged(double vdiv); void traceControlVDivChanged(double vdiv);
void traceControlSDivChanged(double sdiv);
void cursorLevelChanged(uint cursor, double level); void cursorLevelChanged(uint cursor, double level);
void startScope(); void startScope();
void stopScope(); void stopScope();
@ -117,6 +144,7 @@ namespace RemoteLab
private: private:
TraceWidget* m_traceWidget; TraceWidget* m_traceWidget;
TQGridLayout* m_traceControlWidgetGrid; TQGridLayout* m_traceControlWidgetGrid;
TQGridLayout* m_timebaseControlWidgetGrid;
int m_commHandlerState; int m_commHandlerState;
int m_commHandlerMode; int m_commHandlerMode;
int m_commHandlerCommandState; int m_commHandlerCommandState;
@ -133,16 +161,19 @@ namespace RemoteLab
TQ_INT16 m_triggerChannel; TQ_INT16 m_triggerChannel;
bool m_running; bool m_running;
double m_triggerLevel; double m_triggerLevel;
double m_horizontalTimebase;
TQ_INT32 m_samplesInTrace[MAXTRACES+1]; TQ_INT32 m_samplesInTrace[MAXTRACES+1];
bool m_channelActive[MAXTRACES+1]; bool m_channelActive[MAXTRACES+1];
double m_voltsDiv[MAXTRACES+1]; double m_voltsDiv[MAXTRACES+1];
double m_secsDiv[MAXTRACES+1]; double m_secsDiv[MAXTRACES+1];
TraceControlWidget* m_traceControlWidgetList[MAXTRACES]; TraceControlWidget* m_traceControlWidgetList[MAXTRACES];
TimebaseControlWidget* m_timebaseControlWidget;
bool m_triggerLevelSet; bool m_triggerLevelSet;
bool m_horizontalTimebaseSet;
bool m_runningSet; bool m_runningSet;
bool m_voltsDivSet[MAXTRACES+1]; bool m_voltsDivSet[MAXTRACES+1];
bool m_channelActiveSet[MAXTRACES+1]; bool m_channelActiveSet[MAXTRACES+1];
bool m_lastChangesRequireFullUpdate; bool m_settingsChanged;
ScopeBase* m_base; ScopeBase* m_base;
TQMutex* m_instrumentMutex; TQMutex* m_instrumentMutex;
bool stopTraceUpdate; bool stopTraceUpdate;

@ -1509,6 +1509,7 @@ TraceWidget::TraceWidget(TQWidget* parent, const char* name) : TQWidget(parent,
TraceWidget::~TraceWidget() { TraceWidget::~TraceWidget() {
for (uint i=0;i<m_traceArray.count();i++) { for (uint i=0;i<m_traceArray.count();i++) {
delete m_traceArray[i]; delete m_traceArray[i];
m_traceArray[i] = NULL;
} }
} }
@ -1743,7 +1744,12 @@ void TraceWidget::updateCursorText() {
} }
} }
m_traceArray[trace]->leftCursorLabel->setText(TQString("<qt><nobr>%2</qt>").arg((m_traceArray[trace]->sampleArray[closest]==0)?"0":"1")); if (m_traceArray[trace]->sampleArray.count() > 0) {
m_traceArray[trace]->leftCursorLabel->setText(TQString("<qt><nobr>%2</qt>").arg((m_traceArray[trace]->sampleArray[closest]==0)?"0":"1"));
}
else {
m_traceArray[trace]->leftCursorLabel->setText(TQString("<qt><nobr></qt>"));
}
} }
else { else {
// Find closest data point // Find closest data point
@ -1751,14 +1757,21 @@ void TraceWidget::updateCursorText() {
unsigned int closest = 0; unsigned int closest = 0;
double diff; double diff;
double distance = DBL_MAX; double distance = DBL_MAX;
for (n=0; n<m_traceArray[trace]->numberOfSamples; n++) { if (m_traceArray[trace]->positionArray.count() >= m_traceArray[trace]->numberOfSamples) {
diff = fabs(m_traceArray[trace]->positionArray[n] - realCursorPosition); for (n=0; n<m_traceArray[trace]->numberOfSamples; n++) {
if (diff < distance) { diff = fabs(m_traceArray[trace]->positionArray[n] - realCursorPosition);
distance = diff; if (diff < distance) {
closest = n; distance = diff;
closest = n;
}
} }
} }
m_traceArray[trace]->leftCursorLabel->setText(TQString("<qt><nobr>%2</qt>").arg(TraceWidget::prettyFormat(m_traceArray[trace]->sampleArray[closest], m_traceArray[trace]->sampleArray[closest], m_traceArray[trace]->verticalUnits))); if (m_traceArray[trace]->sampleArray.count() > 0) {
m_traceArray[trace]->leftCursorLabel->setText(TQString("<qt><nobr>%2</qt>").arg(TraceWidget::prettyFormat(m_traceArray[trace]->sampleArray[closest], m_traceArray[trace]->sampleArray[closest], m_traceArray[trace]->verticalUnits)));
}
else {
m_traceArray[trace]->leftCursorLabel->setText(TQString("<qt><nobr></qt>"));
}
} }
} }
} }
@ -2479,8 +2492,7 @@ void TraceWidget::resizeTraceArray(uint newsize) {
} }
} }
} }
else { else if (newsize < oldcount) {
m_traceArray.resize(newsize);
for (uint i=newsize;i<oldcount;i++) { for (uint i=newsize;i<oldcount;i++) {
if (m_traceArray[i]->paramLabel) { if (m_traceArray[i]->paramLabel) {
m_traceLabelLayout->remove(m_traceArray[i]->paramLabel); m_traceLabelLayout->remove(m_traceArray[i]->paramLabel);
@ -2494,7 +2506,9 @@ void TraceWidget::resizeTraceArray(uint newsize) {
m_statusLabelLayoutInner->remove(m_traceArray[i]->graphStatusLabelInner); m_statusLabelLayoutInner->remove(m_traceArray[i]->graphStatusLabelInner);
} }
delete m_traceArray[i]; delete m_traceArray[i];
m_traceArray[i] = NULL;
} }
m_traceArray.resize(newsize);
} }
} }

@ -253,7 +253,7 @@ int scope_set_timebase(float desired_timebase,const char * scopeType, int gpibDe
} }
} }
else if (strcmp("TDS744AOS", scopeType) == 0) { else if (strcmp("TDS744AOS", scopeType) == 0) {
sprintf(falpha, "HORIZONTAL:MAIN:SCALE %E", desired_timebase/10); sprintf(falpha, "HORIZONTAL:MAIN:SCALE %E", desired_timebase);
#ifdef ENABLE_EXTRA_DEBUGGING #ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Writing: %s\n\r", falpha); printf("[DEBG] Writing: %s\n\r", falpha);
#endif #endif
@ -308,7 +308,7 @@ int scope_get_timebase(double * retval, const char * scopeType, int gpibDevice)
} }
else { else {
floatstring[ai]=0; floatstring[ai]=0;
*retval = atof(floatstring)*10; *retval = floatstring;
} }
#ifdef ENABLE_EXTRA_DEBUGGING #ifdef ENABLE_EXTRA_DEBUGGING

Loading…
Cancel
Save