10 changed files with 212 additions and 61 deletions
-
1CMakeLists.txt
-
88src/app/syncbox16ch/syncbox16ch.cpp
-
2src/app/syncbox16ch/syncbox16ch.ui
-
31src/app/syncbox16ch/syncbox16ch_sdk.cpp
-
27src/app/syncbox16ch/syncbox16ch_sdk.hpp
-
32src/qtutils/enummap.cpp
-
29src/qtutils/enummap.hpp
-
12src/qtutils/qtutils.cpp
-
29src/qtutils/qtutils.hpp
-
4src/zqui/zqui/mainwindow.cpp
@ -1,6 +1,31 @@ |
|||||
#include "syncbox16ch_sdk.hpp"
|
#include "syncbox16ch_sdk.hpp"
|
||||
using namespace iflytop; |
|
||||
|
|
||||
void SyncBox16ChSDK::initialize() { |
|
||||
|
#include "protocol/zfpga_commander/zfpga_commander.hpp"
|
||||
|
#include "qtutils/enummap.hpp"
|
||||
|
|
||||
|
/***********************************************************************************************************************
|
||||
|
* ENUMMAP * |
||||
|
***********************************************************************************************************************/ |
||||
|
namespace iflytop { |
||||
|
namespace syncbox16chsdk { |
||||
|
|
||||
|
enummap_iterm_t output_mode_enummap[] = { |
||||
|
{kWorkMode_extCpyMode, "信号拷贝模式"}, |
||||
|
{kWorkMode_extTriMode, "外部触发模式"}, |
||||
|
{kWorkMode_manualTriMode, "手动触发模式"}, |
||||
|
{-1, "null", true}, |
||||
|
}; |
||||
|
|
||||
} |
|
||||
|
const char* WorkModeToStr(uint32_t mode) { return EnumMapValue2Str(output_mode_enummap, mode); } |
||||
|
WorkMode_t WorkModeValueOf(const char* str) { return (WorkMode_t)EnumMapStr2Value(output_mode_enummap, str); } |
||||
|
list<string> WorkModeStrList() { return EnumMapStrList(output_mode_enummap); } |
||||
|
|
||||
|
} // namespace syncbox16chsdk
|
||||
|
} // namespace iflytop
|
||||
|
|
||||
|
/***********************************************************************************************************************
|
||||
|
* SyncBox16ChSDK * |
||||
|
***********************************************************************************************************************/ |
||||
|
using namespace iflytop; |
||||
|
using namespace syncbox16chsdk; |
||||
|
void SyncBox16ChSDK::initialize() { ZFPGACommander::ins()->initialize(); } |
@ -0,0 +1,32 @@ |
|||||
|
#include "enummap.hpp"
|
||||
|
|
||||
|
#include <string.h>
|
||||
|
using namespace std; |
||||
|
|
||||
|
namespace iflytop { |
||||
|
const char* EnumMapValue2Str(const enummap_iterm_t* map, int val) { |
||||
|
for (int i = 0; !map[i].end; i++) { |
||||
|
if (map[i].val == val) { |
||||
|
return map[i].chname; |
||||
|
} |
||||
|
} |
||||
|
return nullptr; |
||||
|
} |
||||
|
int EnumMapStr2Value(const enummap_iterm_t* map, const char* str) { |
||||
|
for (int i = 0; !map[i].end; i++) { |
||||
|
if (strcmp(map[i].chname, str) == 0) { |
||||
|
return map[i].val; |
||||
|
} |
||||
|
} |
||||
|
return -1; |
||||
|
} |
||||
|
|
||||
|
list<string> EnumMapStrList(const enummap_iterm_t* map) { |
||||
|
list<string> strlist; |
||||
|
for (int i = 0; !map[i].end; i++) { |
||||
|
if (map[i].chname) strlist.push_back(map[i].chname); |
||||
|
} |
||||
|
return strlist; |
||||
|
} |
||||
|
|
||||
|
} // namespace iflytop
|
@ -0,0 +1,29 @@ |
|||||
|
#pragma once
|
||||
|
#include <fstream>
|
||||
|
#include <functional>
|
||||
|
#include <iostream>
|
||||
|
#include <list>
|
||||
|
#include <map>
|
||||
|
#include <memory>
|
||||
|
#include <mutex>
|
||||
|
#include <set>
|
||||
|
#include <sstream>
|
||||
|
#include <string>
|
||||
|
#include <thread>
|
||||
|
#include <vector>
|
||||
|
|
||||
|
namespace iflytop { |
||||
|
using namespace std; |
||||
|
typedef struct { |
||||
|
int val; |
||||
|
const char* chname; |
||||
|
bool end; |
||||
|
} enummap_iterm_t; |
||||
|
|
||||
|
const char* EnumMapValue2Str(const enummap_iterm_t* map, int val); |
||||
|
int EnumMapStr2Value(const enummap_iterm_t* map, const char* str); |
||||
|
list<string> EnumMapStrList(const enummap_iterm_t* map); |
||||
|
|
||||
|
|
||||
|
|
||||
|
} // namespace iflytop
|
@ -0,0 +1,12 @@ |
|||||
|
#include "qtutils.hpp"
|
||||
|
using namespace iflytop; |
||||
|
|
||||
|
namespace iflytop { |
||||
|
QStringList QStringListValueOf(list<string> strlist) { |
||||
|
QStringList qstrlist; |
||||
|
for (auto str : strlist) { |
||||
|
qstrlist.append(QString::fromStdString(str)); |
||||
|
} |
||||
|
return qstrlist; |
||||
|
} |
||||
|
} // namespace iflytop
|
@ -0,0 +1,29 @@ |
|||||
|
#pragma once
|
||||
|
#include <fstream>
|
||||
|
#include <functional>
|
||||
|
#include <iostream>
|
||||
|
#include <list>
|
||||
|
#include <map>
|
||||
|
#include <memory>
|
||||
|
#include <mutex>
|
||||
|
#include <set>
|
||||
|
#include <sstream>
|
||||
|
#include <string>
|
||||
|
#include <thread>
|
||||
|
#include <vector>
|
||||
|
//
|
||||
|
#include <QtCore/QVariant>
|
||||
|
#include <QtWidgets/QApplication>
|
||||
|
#include <QtWidgets/QComboBox>
|
||||
|
#include <QtWidgets/QGridLayout>
|
||||
|
#include <QtWidgets/QLabel>
|
||||
|
#include <QtWidgets/QLineEdit>
|
||||
|
#include <QtWidgets/QPushButton>
|
||||
|
#include <QtWidgets/QSpacerItem>
|
||||
|
#include <QtWidgets/QWidget>
|
||||
|
|
||||
|
namespace iflytop { |
||||
|
using namespace std; |
||||
|
QStringList QStringListValueOf(list<string> strlist); |
||||
|
|
||||
|
} // namespace iflytop
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue