summaryrefslogtreecommitdiffstats
path: root/src/progs/icd1/base/icd1_prog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
commitf508189682b6fba62e08feeb1596f682bad5fff9 (patch)
tree28aeb0e6c19386c385c1ce5edf8a92c1bca15281 /src/progs/icd1/base/icd1_prog.cpp
downloadpiklab-f508189682b6fba62e08feeb1596f682bad5fff9.tar.gz
piklab-f508189682b6fba62e08feeb1596f682bad5fff9.zip
Added KDE3 version of PikLab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/progs/icd1/base/icd1_prog.cpp')
-rw-r--r--src/progs/icd1/base/icd1_prog.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/progs/icd1/base/icd1_prog.cpp b/src/progs/icd1/base/icd1_prog.cpp
new file mode 100644
index 0000000..13d0d4c
--- /dev/null
+++ b/src/progs/icd1/base/icd1_prog.cpp
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2006 Nicolas Hadacek <[email protected]> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ ***************************************************************************/
+#include "icd1_prog.h"
+
+#include <qdir.h>
+
+#include "progs/base/prog_config.h"
+#include "devices/list/device_list.h"
+#include "icd1_serial.h"
+
+//-----------------------------------------------------------------------------
+void Icd1::ProgrammerBase::clear()
+{
+ Icd::ProgrammerBase::clear();
+ _selfTestResult = ::Programmer::Nb_ResultTypes;
+}
+
+bool Icd1::ProgrammerBase::selfTest(bool ask)
+{
+ log(Log::DebugLevel::Normal, " Self-test");
+ _selfTestResult = (hardware().selfTest() ? ::Programmer::Pass : ::Programmer::Fail);
+ if ( _selfTestResult==::Programmer::Fail ) {
+ if ( ask && !askContinue(i18n("Self-test failed. Do you want to continue anyway?")) ) {
+ logUserAbort();
+ return false;
+ }
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
+Programmer::Properties Icd1::Group::properties() const
+{
+ return ::Programmer::Programmer | ::Programmer::HasFirmware | ::Programmer::CanUploadFirmware | ::Programmer::HasSelfTest | ::Programmer::CanReadMemory | ::Programmer::HasConnectedState;
+}
+
+Programmer::Hardware *Icd1::Group::createHardware(::Programmer::Base &base, const ::Programmer::HardwareDescription &hd) const
+{
+ return new Hardware(base, hd.port.device);
+}
+
+Programmer::DeviceSpecific *Icd1::Group::createDeviceSpecific(::Programmer::Base &base) const
+{
+ return new Icd::DeviceSpecific(base);
+}