9 changed files with 126 additions and 28 deletions
-
3.vscode/settings.json
-
1CMakeLists.txt
-
2src/mainwindow.cpp
-
4src/tab/board_ext_tab.cpp
-
4src/tab/code_scaner_tab.cpp
-
4src/tab/mini_servo_tab.cpp
-
68src/tab/pipette_ctrl_tab.cpp
-
43src/tab/pipette_ctrl_tab.hpp
-
25src/tab/step_motor_ctrl_tab.cpp
@ -0,0 +1,68 @@ |
|||||
|
#include "pipette_ctrl_tab.hpp"
|
||||
|
|
||||
|
#include "iflytop_canbus/iflytop_canbus_master.hpp"
|
||||
|
#include "logger.hpp"
|
||||
|
#include "qt_serial_datachannel.hpp"
|
||||
|
#include "zexception.hpp"
|
||||
|
#include "zui/z_function_list_box.hpp"
|
||||
|
#include "zui/z_reg_table_list_box.hpp"
|
||||
|
#include "zui/zq_vtab_page.hpp"
|
||||
|
//
|
||||
|
#include "./mainwindow.h"
|
||||
|
#include "zui\zqui.hpp"
|
||||
|
//
|
||||
|
using namespace iflytop; |
||||
|
using namespace std; |
||||
|
|
||||
|
extern Ui::MainWindow *main_ui; |
||||
|
|
||||
|
extern int getDeviceId(); |
||||
|
|
||||
|
PipetteCtrlTab *PipetteCtrlTab::inst() { |
||||
|
static PipetteCtrlTab *ins = new PipetteCtrlTab(); |
||||
|
return ins; |
||||
|
} |
||||
|
|
||||
|
void PipetteCtrlTab::construct(QTabWidget *fathertab) { |
||||
|
/***********************************************************************************************************************
|
||||
|
* 模块操作 * |
||||
|
***********************************************************************************************************************/ |
||||
|
// kpipette_ctrl_init_device
|
||||
|
// kpipette_ctrl_put_tip
|
||||
|
// kpipette_ctrl_move_to_ul
|
||||
|
|
||||
|
ZQVTabPage *tab = new ZQVTabPage(fathertab, "移液枪操作"); |
||||
|
|
||||
|
{ |
||||
|
ZQFunctionListBox *box = new ZQFunctionListBox(tab, "移液枪操作", 4); |
||||
|
// box->newFunc("使能", {"enable"}, [this](int argn, const char **args) { ICM->step_motor_enable(getDeviceId(), atoi(args[0])); });
|
||||
|
// box->newFunc("停止", {}, [this](int argn, const char **args) { ICM->step_motor_stop(getDeviceId(), 0); });
|
||||
|
// box->newFunc("激活配置", {}, [this](int argn, const char **args) { ICM->step_motor_active_cfg(getDeviceId()); });
|
||||
|
box->newFunc("初始化操作", {}, [this](int argn, const char **args) { ICM->callcmd0(getDeviceId(), kpipette_ctrl_init_device); }); |
||||
|
box->newFunc("推出吸头", {}, [this](int argn, const char **args) { ICM->callcmd0(getDeviceId(), kpipette_ctrl_put_tip); }); |
||||
|
box->newFunc("移动到指定位置", {"ul"}, [this](int argn, const char **args) { ICM->callcmd1(getDeviceId(), kpipette_ctrl_move_to_ul, atoi(args[0])); }); |
||||
|
} |
||||
|
|
||||
|
tab->addSpacer(); |
||||
|
|
||||
|
{ |
||||
|
ZRegTableList *tableBox = new ZRegTableList(tab, "寄存器操作"); |
||||
|
tableBox->initializeRegOperation( |
||||
|
[this](int32_t add, int32_t val) { //
|
||||
|
ICM->writereg(getDeviceId(), add, val); |
||||
|
return true; |
||||
|
}, |
||||
|
[this](int32_t add, int32_t *val) { //
|
||||
|
ICM->readreg(getDeviceId(), add, val); |
||||
|
return true; |
||||
|
}); |
||||
|
|
||||
|
tableBox->addReg("reg_pipette_pos_ul", kreg_pipette_pos_ul, ZRegItem::krw | ZRegItem::kdec); |
||||
|
tableBox->addReg("reg_pipette_capactitance_val", kreg_pipette_capactitance_val, ZRegItem::krw | ZRegItem::kdec); |
||||
|
tableBox->addReg("reg_pipette_tip_state", kreg_pipette_tip_state, ZRegItem::krw | ZRegItem::kdec); |
||||
|
tableBox->addReg("reg_pipette_limit_ul", kreg_pipette_limit_ul, ZRegItem::krw | ZRegItem::kdec); |
||||
|
|
||||
|
tableBox->addSpacer(); |
||||
|
tab->addSpacer(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
#pragma once
|
||||
|
|
||||
|
#include <QDateTime>
|
||||
|
#include <QMainWindow>
|
||||
|
#include <QMessageBox>
|
||||
|
#include <QObject>
|
||||
|
#include <QtConcurrent>
|
||||
|
#include <QtCore/QVariant>
|
||||
|
#include <QtSerialPort/QSerialPort>
|
||||
|
#include <QtSerialPort/QSerialPortInfo>
|
||||
|
#include <QtWidgets/QAction>
|
||||
|
#include <QtWidgets/QApplication>
|
||||
|
#include <QtWidgets/QComboBox>
|
||||
|
#include <QtWidgets/QFormLayout>
|
||||
|
#include <QtWidgets/QGridLayout>
|
||||
|
#include <QtWidgets/QGroupBox>
|
||||
|
#include <QtWidgets/QHBoxLayout>
|
||||
|
#include <QtWidgets/QLabel>
|
||||
|
#include <QtWidgets/QLineEdit>
|
||||
|
#include <QtWidgets/QMainWindow>
|
||||
|
#include <QtWidgets/QMenu>
|
||||
|
#include <QtWidgets/QMenuBar>
|
||||
|
#include <QtWidgets/QPushButton>
|
||||
|
#include <QtWidgets/QSpacerItem>
|
||||
|
#include <QtWidgets/QStatusBar>
|
||||
|
#include <QtWidgets/QTabWidget>
|
||||
|
#include <QtWidgets/QTextBrowser>
|
||||
|
#include <QtWidgets/QTextEdit>
|
||||
|
#include <QtWidgets/QVBoxLayout>
|
||||
|
#include <QtWidgets/QWidget>
|
||||
|
//
|
||||
|
#include <functional>
|
||||
|
|
||||
|
namespace iflytop { |
||||
|
using namespace std; |
||||
|
|
||||
|
class PipetteCtrlTab { |
||||
|
public: |
||||
|
static PipetteCtrlTab *inst(); |
||||
|
|
||||
|
void construct(QTabWidget *fathertab); |
||||
|
}; |
||||
|
} // namespace iflytop
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue