Browse Source

update

master
zhaohe 1 year ago
parent
commit
72c45e43d8
  1. 2
      CMakeLists.txt
  2. 2
      a8000_protocol
  3. 60
      src/tab/fan_ctrl_tab.cpp
  4. 43
      src/tab/fan_ctrl_tab.hpp
  5. 19
      src/tab/module_opera_tab.cpp
  6. 69
      src/tab/water_cooling_temperature_tab.cpp
  7. 43
      src/tab/water_cooling_temperature_tab.hpp

2
CMakeLists.txt

@ -53,6 +53,8 @@ set(PROJECT_SOURCES
src/tab/mini_servo_tab.cpp src/tab/mini_servo_tab.cpp
src/tab/code_scaner_tab.cpp src/tab/code_scaner_tab.cpp
src/tab/fan_ctrl_tab.cpp
src/tab/water_cooling_temperature_tab.cpp
a8000_protocol/api/apibasic/errorcode.cpp a8000_protocol/api/apibasic/errorcode.cpp
src/tab/pipette_ctrl_tab.cpp src/tab/pipette_ctrl_tab.cpp

2
a8000_protocol

@ -1 +1 @@
Subproject commit 82688278acc674cf0ad6a3a5f9017b93cc45a670
Subproject commit 8fa3934e833a116d68d4c32ebba8352ce1b8746f

60
src/tab/fan_ctrl_tab.cpp

@ -0,0 +1,60 @@
#include "fan_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();
FanCtrlTab *FanCtrlTab::inst() {
static FanCtrlTab *ins = new FanCtrlTab();
return ins;
}
void FanCtrlTab::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("控制风扇转速", {"speed"}, [this](int argn, const char **args) { ICM->callcmd0(getDeviceId(), kfan_controler_set_speed, 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->addSpacer();
tab->addSpacer();
}
}

43
src/tab/fan_ctrl_tab.hpp

@ -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 FanCtrlTab {
public:
static FanCtrlTab *inst();
void construct(QTabWidget *fathertab);
};
} // namespace iflytop

19
src/tab/module_opera_tab.cpp

@ -17,21 +17,6 @@ extern Ui::MainWindow *main_ui;
extern int getDeviceId(); extern int getDeviceId();
// typedef enum {
// kuniversal_module = 0, // 通用模块
// khbot_module = 1, // hbot模块
// kmotor_module = 2, // 电机控制
// ktemperature_ctrl_module = 3, // 温度控制
// kfan_ctrl_module = 5, // 风扇控制
// kcode_scaner = 6, // 风扇控制
// kpipette_ctrl_module = 7, // 移液体枪控制
// ka8000_optical_module = 8, // a8000光学模组
// klaster_scaner_module = 9, // a8000光学模组
// ktmc_step_motor = 10, // 步进电机
// kmini_servo_motor_module = 11, // 舵机
// kboard = 12, // 舵机
// } module_type_t;
static const char *module_type2_str(int id) { static const char *module_type2_str(int id) {
switch (id) { switch (id) {
@ -42,7 +27,7 @@ static const char *module_type2_str(int id) {
case kmotor_module: case kmotor_module:
return "电机控制"; return "电机控制";
case ktemperature_ctrl_module: case ktemperature_ctrl_module:
return "温度控制";
return "水冷温度控制";
case kfan_ctrl_module: case kfan_ctrl_module:
return "风扇控制"; return "风扇控制";
case kcode_scaner: case kcode_scaner:
@ -92,7 +77,7 @@ void ModuleOperaTab::construct(QWidget *parent) {
if (i % 10 == 0) { if (i % 10 == 0) {
ZQUI::ins()->ishow(""); ZQUI::ins()->ishow("");
} }
ZQUI::ins()->ishow("module :%d isOnline type:%10s v(%d)", i, module_type2_str(moduleType),moduleVersion);
ZQUI::ins()->ishow("module :%d isOnline type:%10s v(%d)", i, module_type2_str(moduleType), moduleVersion);
} catch (const zexception &e) { } catch (const zexception &e) {
if (e.ecode() != ke_overtime) { if (e.ecode() != ke_overtime) {
ZQUI::ins()->ishow("%s", e.what()); ZQUI::ins()->ishow("%s", e.what());

69
src/tab/water_cooling_temperature_tab.cpp

@ -0,0 +1,69 @@
#include "water_cooling_temperature_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();
WaterCoolingTemperatureControlerTab *WaterCoolingTemperatureControlerTab::inst() {
static WaterCoolingTemperatureControlerTab *ins = new WaterCoolingTemperatureControlerTab();
return ins;
}
void WaterCoolingTemperatureControlerTab::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("开始控温", {"temperature"}, [this](int argn, const char **args) { ICM->callcmd0(getDeviceId(), ktemp_controler_start_hearting, atoi(args[0])); });
box->newFunc("停止控温", {}, [this](int argn, const char **args) { ICM->callcmd0(getDeviceId(), ktemp_controler_stop_hearting); });
box->newFunc("测试-帕尔贴-控制功率", {"level[-100,100]"}, [this](int argn, const char **args) { ICM->callcmd0(getDeviceId(), ktemp_controler_set_peltier_power_level, atoi(args[0])); });
box->newFunc("测试-水泵-控制转速", {"speed[0,100]"}, [this](int argn, const char **args) { ICM->callcmd0(getDeviceId(), ktemp_controler_set_pump_level, atoi(args[0])); });
box->newFunc("测试-风扇-控制转速", {"speed[0,100]"}, [this](int argn, const char **args) { ICM->callcmd0(getDeviceId(), ktemp_controler_set_fan_level, atoi(args[0])); });
box->newFunc("测试-日志-开关", {"enable[0,1]"}, [this](int argn, const char **args) { ICM->callcmd0(getDeviceId(), ktemp_controler_enable_log, 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();
}
}

43
src/tab/water_cooling_temperature_tab.hpp

@ -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 WaterCoolingTemperatureControlerTab {
public:
static WaterCoolingTemperatureControlerTab *inst();
void construct(QTabWidget *fathertab);
};
} // namespace iflytop
Loading…
Cancel
Save