|
|
@ -285,23 +285,43 @@ void MainWindow::processException(const zexception &e) { // |
|
|
|
|
|
|
|
int32_t MainWindow::getDeviceId() { return PublicState_DeviceIDVal; } |
|
|
|
|
|
|
|
map<int, int> moduleTypes; |
|
|
|
|
|
|
|
void MainWindow::constructAppUI() { |
|
|
|
ModuleOperaTab::inst()->construct(ui->moduleOpera); |
|
|
|
// khbot_module
|
|
|
|
// ktemperature_ctrl_module
|
|
|
|
// kfan_ctrl_module
|
|
|
|
// kcode_scaner
|
|
|
|
// kpipette_ctrl_module
|
|
|
|
// ka8000_optical_module
|
|
|
|
// ktmc_step_motor
|
|
|
|
// kmini_servo_motor_module
|
|
|
|
// kboard
|
|
|
|
// ka8000_idcard_reader
|
|
|
|
// ka8000_plate_code_scaner
|
|
|
|
|
|
|
|
int32_t tabindex = 2; |
|
|
|
BoardExtTab::inst()->construct(ui->buttonTabWidget); |
|
|
|
|
|
|
|
moduleTypes[kboard] = tabindex++; |
|
|
|
StepMotorCtrlTab::inst()->construct(ui->buttonTabWidget); |
|
|
|
StepMotorCtrlTab::inst()->constructRegTab(ui->buttonTabWidget); |
|
|
|
|
|
|
|
moduleTypes[ktmc_step_motor] = tabindex++; |
|
|
|
MiniServoTab::inst()->construct(ui->buttonTabWidget); |
|
|
|
moduleTypes[kmini_servo_motor_module] = tabindex++; |
|
|
|
CodeScanerTab::inst()->construct(ui->buttonTabWidget); |
|
|
|
moduleTypes[kcode_scaner] = tabindex++; |
|
|
|
PipetteCtrlTab::inst()->construct(ui->buttonTabWidget); |
|
|
|
|
|
|
|
moduleTypes[kpipette_ctrl_module] = tabindex++; |
|
|
|
WaterCoolingTemperatureControlerTab::inst()->construct(ui->buttonTabWidget); |
|
|
|
moduleTypes[ktemperature_ctrl_module] = tabindex++; |
|
|
|
FanCtrlTab::inst()->construct(ui->buttonTabWidget); |
|
|
|
moduleTypes[kfan_ctrl_module] = tabindex++; |
|
|
|
XYRobotTab::inst()->construct(ui->buttonTabWidget); |
|
|
|
|
|
|
|
moduleTypes[khbot_module] = tabindex++; |
|
|
|
IDCardReaderTab::inst()->construct(ui->buttonTabWidget); |
|
|
|
moduleTypes[ka8000_idcard_reader] = tabindex++; |
|
|
|
PlateCodeScanerTab::inst()->construct(ui->buttonTabWidget); |
|
|
|
moduleTypes[ka8000_plate_code_scaner] = tabindex++; |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::on_PublicState_ConfirmKey_clicked() {} |
|
|
@ -337,3 +357,20 @@ void MainWindow::on_dumpRegListButton_clicked() { |
|
|
|
ZQUI::ins()->ishow("%-50s %d", regtable[i].regname, regtable[i].index); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::on_boardId_tableWidget_cellDoubleClicked(int row, int column) { |
|
|
|
try { |
|
|
|
// row
|
|
|
|
int32_t moduleType; |
|
|
|
// ui->boardId_tableWidget->get
|
|
|
|
|
|
|
|
QString id = ui->boardId_tableWidget->item(row, 1)->text(); |
|
|
|
ui->PublicState_DeviceID->setText(id); |
|
|
|
ui->ModuleNameText->setText(ui->boardId_tableWidget->item(row, 2)->text()); |
|
|
|
ICM->readreg(id.toInt(), kreg_module_type, &moduleType); |
|
|
|
ui->buttonTabWidget->setCurrentIndex(moduleTypes[moduleType]); |
|
|
|
|
|
|
|
} catch (const std::exception &e) { |
|
|
|
ZQUI::ins()->ishow("Error:%s", e.what()); |
|
|
|
} |
|
|
|
} |