Compare commits

..

4 Commits
main ... KWH

Author SHA1 Message Date
KWH
ebaf64b034 *) SPI已经在FPGAv5.0中调通 2025-08-02 15:28:41 +08:00
leo
acd3441922 加入命令生成逻辑,测试通过; 2025-08-01 22:25:49 +08:00
KWH
f96b1eb169 +) spi初始化的界面逻辑 2025-08-01 22:22:19 +08:00
KWH
8dc807662a +) 新加对SPI参数改动的能力 2025-08-01 22:21:43 +08:00
17 changed files with 166 additions and 970 deletions

View File

@ -10,27 +10,24 @@ CONFIG += c++17
SOURCES += \
dialogcalibrate.cpp \
dialogtest.cpp \
src/sources/dachandler.cpp \
src/sources/framehandler.cpp \
main.cpp \
mainwindow.cpp \
src/sources/crc.cpp \
src/sources/drv_spi.cpp \
src/sources/drv_uart.cpp
HEADERS += \
dialogcalibrate.h \
dialogtest.h \
src/headers/dachandler.h \
src/headers/framehandler.h \
mainwindow.h \
src/headers/CH347DLL.H \
src/headers/crc.h \
src/headers/drv_spi.h \
src/headers/drv_uart.h
FORMS += \
dialogcalibrate.ui \
dialogtest.ui \
mainwindow.ui
LIBS += -L$$PWD/lib -lCH347DLLA64

View File

@ -15,7 +15,6 @@ public:
explicit DialogCalibrate(QWidget *parent = nullptr);
~DialogCalibrate();
private slots:
void on_pushButton_clicked();

View File

@ -1,45 +0,0 @@
#include "dialogtest.h"
#include "ui_dialogtest.h"
DialogTest::DialogTest(QWidget *parent)
: QDialog(parent)
, ui(new Ui::DialogTest)
{
ui->setupUi(this);
}
DialogTest::~DialogTest()
{
delete ui;
}
void DialogTest::on_pushButton_clicked()
{
deleteLater();
}
void DialogTest::on_pushButton_2_clicked()
{
QByteArray data(4,0);
data[0]=ui->lineEdit->text().toUInt();
data[1]=ui->lineEdit_2->text().toUInt();
data[2]=ui->lineEdit_3->text().toUInt();
data[3]=ui->lineEdit_4->text().toUInt();
emit testSendRegSPI(data);
}
void DialogTest::on_pushButton_3_clicked()
{
emit testSendSPI0();
}
void DialogTest::on_pushButton_4_clicked()
{
QByteArray data;
data.append(ui->lineEdit->text().toUInt());
emit testReadRegSPI(data);
}

View File

@ -1,36 +0,0 @@
#ifndef DIALOGTEST_H
#define DIALOGTEST_H
#include <QDialog>
namespace Ui {
class DialogTest;
}
class DialogTest : public QDialog
{
Q_OBJECT
public:
explicit DialogTest(QWidget *parent = nullptr);
~DialogTest();
private slots:
void on_pushButton_clicked();
void on_pushButton_2_clicked();
void on_pushButton_3_clicked();
void on_pushButton_4_clicked();
signals:
void testSendRegSPI(QByteArray data);
void testReadRegSPI(QByteArray data);
void testSendSPI0();
private:
Ui::DialogTest *ui;
};
#endif // DIALOGTEST_H

View File

@ -1,98 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogTest</class>
<widget class="QDialog" name="DialogTest">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>493</width>
<height>443</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>SPI</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Fun2:</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="3">
<widget class="QLineEdit" name="lineEdit_4"/>
</item>
<item row="2" column="1" colspan="3">
<widget class="QLineEdit" name="lineEdit_3"/>
</item>
<item row="1" column="1" colspan="3">
<widget class="QLineEdit" name="lineEdit_2"/>
</item>
<item row="0" column="1" colspan="3">
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item row="4" column="3">
<widget class="QPushButton" name="pushButton_3">
<property name="text">
<string>Send 0</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="pushButton_2">
<property name="text">
<string>Set Reg</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>DAC Channel</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>DAC #</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Fun1:</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QPushButton" name="pushButton_4">
<property name="text">
<string>Read Reg</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Back</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -7,25 +7,9 @@ MainWindow::MainWindow(QWidget *parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
dacHandler= new DACHandler(this);
drvUart = new DRV_Uart(this);
drvSPI = new DRV_Spi(this);
drvUart = new DRV_Uart(this);
fHandler = new FrameHandler(this);
connect(dacHandler,&DACHandler::logMsg,this,&MainWindow::onLogPrint);
for (int i = 0; i < 16; ++i) {
for (int j = 0; j < 16; ++j) {
// 将 int 转换为 QString
QString data = QString::number(0);
// 创建 QTableWidgetItem 并设置数据
QTableWidgetItem *item = new QTableWidgetItem(data);
// 将 item 放入指定的单元格
ui->tableWidget->setItem(i, j, item);
}
}
}
MainWindow::~MainWindow()
@ -42,33 +26,6 @@ void MainWindow::onLogPrint(QString msg){
}
void MainWindow::handleTestSendRegSPI(QByteArray data)
{
QByteArray tmp = fHandler->genREGWrite(data[0],data[1],data[2],data[3]);
QByteArray tmp1=tmp;
drvSPI->spi_Write(tmp1);
onLogPrint(" [SPI] --> Send data success, data is (hex) :" + tmp.toHex(' '));
}
void MainWindow::handleTestSendSPI0()
{
QByteArray tmp(7,0);
QByteArray tmp1=tmp;
drvSPI->spi_Write(tmp1);
onLogPrint(" [SPI] --> Send data success, data is (hex) :" + tmp.toHex(' '));
onLogPrint(" [SPI] <-- Read Reg data data is (hex) :" + tmp1.toHex(' '));
}
void MainWindow::handleTestReadRegSPI(QByteArray data)
{
QByteArray tmp = fHandler->genREGRead(data[0]);
QByteArray tmp1=tmp;
drvSPI->spi_Write(tmp1);
onLogPrint(" [SPI] --> Send data success, data is (hex) :" + tmp.toHex(' '));
}
void MainWindow::on_pushButton_14_clicked()
{
dc= new DialogCalibrate(this);
@ -92,7 +49,7 @@ void MainWindow::on_pushButton_6_clicked()
for(int i = 0; i < drvUart->m_DRV_Uart_Infors.ulDevCnt; i++)
ui->comboBox_7->addItem(drvUart->m_DRV_Uart_Infors.bDeviceName[i]);
}else{
onLogPrint("No UART devices");
onLogPrint("No devices");
}
}
@ -114,9 +71,9 @@ void MainWindow::on_pushButton_7_clicked()
ui->lineEdit->setEnabled(true);
ui->pushButton_5->setEnabled(true);
ui->pushButton_7->setEnabled(false);
onLogPrint("Open UART device success");
onLogPrint("Open device success");
}else{
onLogPrint("Fail to open UART device");
onLogPrint("Open device failed");
}
}
@ -131,9 +88,9 @@ void MainWindow::on_pushButton_8_clicked()
UCHAR Timeout = this->ui->lineEdit->text().toUInt();
// 调用配置参数函数进行配置
if(drvUart->Uart_setPara(Baudrate, StopBits, Parity, DataBits, Timeout)){
onLogPrint("Set UART parameters success");
onLogPrint("Set parameters success");
}else{
onLogPrint("Fail to set UART parameters");
onLogPrint("Fail to set parameters");
}
}
@ -152,9 +109,9 @@ void MainWindow::on_pushButton_5_clicked()
ui->pushButton_5->setEnabled(false);
ui->pushButton_7->setEnabled(true);
ui->btnSpiSaveSetting->setEnabled(false);
onLogPrint("Close UART device success");
onLogPrint("Close device success");
}else{
onLogPrint("Fail to close UART device ");
onLogPrint("Close device failed");
}
}
@ -167,7 +124,7 @@ void MainWindow::on_pushButton_clicked()
// 将串口设备的名称添加至列表中
ui->comboBox_2->addItem(drvSPI->m_DRV_Spi_Infors.bDeviceName);
}else{
onLogPrint("No SPI devices");
onLogPrint("No devices");
}
}
@ -175,10 +132,10 @@ void MainWindow::on_pushButton_clicked()
void MainWindow::on_pushButton_2_clicked()
{
ULONG index = ui->comboBox_2->currentIndex();
// 调用打开函数
// 调用串口打开函数
BOOL status = drvSPI->spi_openDevice(index);
// 判断打开设备是否成功
// 判断打开串口设备是否成功
if(status == TRUE){
ui->comboSpiMode->setEnabled(true);
ui->comboSpiClock->setEnabled(true);
@ -189,13 +146,15 @@ void MainWindow::on_pushButton_2_clicked()
ui->pushButton_3->setEnabled(true);
ui->pushButton_2->setEnabled(false);
ui->btnSpiSaveSetting->setEnabled(true);
onLogPrint("Open SPI device success");
onLogPrint("Open device success");
on_btnSpiSaveSetting_clicked(); // 初始化SPI参数
}else{
onLogPrint("Fail to open SPI device.");
onLogPrint("Open device failed");
}
}
void MainWindow::on_pushButton_3_clicked()
{
@ -212,9 +171,9 @@ void MainWindow::on_pushButton_3_clicked()
ui->pushButton_3->setEnabled(false);
ui->pushButton_2->setEnabled(true);
onLogPrint("Close SPI device success");
onLogPrint("Close device success");
}else{
onLogPrint("Fail to close device.");
onLogPrint("Close device failed");
}
}
@ -279,22 +238,23 @@ void MainWindow::on_pushButton_9_clicked() {
for (auto i : REG) {
sendRegData += "0x" + QString::number(i, 16) + " ";
}
onLogPrint("Ready to set DAC REG[1] - REG[4] is :"+sendRegData);
qDebug()<<"parameter is "<<Qt::hex <<ucDAC<<ucChannel<<ucFun1<<ucFun2;
QByteArray tmp1 = fHandler->genREGWrite(ucDAC, ucChannel, ucFun1, ucFun2);
onLogPrint("Ready to write REG[1] - REG[4] : " + sendRegData);
QByteArray tmp1 = fHandler->genREGWrite(ucDAC, ucChannel, ucFun1, ucFun2);
switch (ui->comboBox->currentIndex()) {
case 0:
if (!dacHandler->setDACReg(drvUart,tmp1))
{
return;
if (drvUart->Uart_Write(tmp1)) {
onLogPrint("Send data success");
} else {
onLogPrint("Send data fail");
}
break;
case 1:
if (!dacHandler->setDACReg(drvSPI,tmp1))
{
return;
onLogPrint("write data is " + tmp1.toHex());
if (drvSPI->spi_Write(tmp1)) {
onLogPrint("Send data success");
} else {
onLogPrint("Send data failed");
}
break;
}
@ -303,80 +263,34 @@ void MainWindow::on_pushButton_9_clicked() {
}
void MainWindow::on_pushButton_10_clicked() {
unsigned char ucDAC = ui->comboBox_15->currentText().toUInt(NULL, 10);
QByteArray tmp = fHandler->genREGRead(ucDAC);
QByteArray revDatatmp;
unsigned char ucDAC = ui->comboBox_15->currentText().toUInt(NULL, 10);
QByteArray tmp = fHandler->genREGRead(ucDAC);
switch (ui->comboBox->currentIndex()) {
case 0:
{
QByteArray ba = dacHandler->getDACReg(drvUart,tmp);
revDatatmp = ba;
revDatatmp.detach();
onLogPrint(" [UART] <-- Read Reg data is :"+ ba.toHex(' '));
break;
}
case 0:
if (drvUart->Uart_Write(tmp)) {
onLogPrint("Send data success");
} else {
onLogPrint("Send data fail");
}
break;
case 1:
{
revDatatmp= dacHandler->getDACReg(drvSPI,tmp);
onLogPrint(" [SPI] <-- Read Reg data is :"+revDatatmp.toHex(' '));
break;
}
onLogPrint("write data is " + tmp.toHex());
if (drvSPI->spi_Write(tmp)) {
onLogPrint("Send data success");
QTimer::singleShot(1000, [this]() {
QByteArray ba;
drvSPI->spi_Read(ba);
ui->textBrowser->append("SPI read: " + ba.toHex());
});
} else {
onLogPrint("Send data fail");
}
break;
}
// revDatatmp.append(static_cast<char>(0x00));
// revDatatmp.append(static_cast<char>(0x81));
// revDatatmp.append(static_cast<char>(0x11));
// revDatatmp.append(static_cast<char>(0x01));
// revDatatmp.append(static_cast<char>(0x21));
// revDatatmp.append(static_cast<char>(0xa0));
// revDatatmp.append(static_cast<char>(0x00));
// onLogPrint(" [UART] <-- Read Reg data is :"+revDatatmp.toHex(' '));
// for(int i=0;i<revDatatmp.length();i++){
// QString hexString = QString::asprintf("0x%x", static_cast<unsigned char>(revDatatmp[i])); // 正确
// onLogPrint("DEBUG: revDatatmp is "+hexString);
// }
if(revDatatmp.length()>=7){
QByteArray tempHexArray;
// 设置第一个 lineEdit_3
tempHexArray = revDatatmp.mid(0, 1);
ui->lineEdit_3->setText("0x" + tempHexArray.toHex());
// 设置 lineEdit_8
tempHexArray = revDatatmp.mid(1, 1);
ui->lineEdit_8->setText("0x" + tempHexArray.toHex());
// 设置 lineEdit_13
tempHexArray = revDatatmp.mid(2, 1);
ui->lineEdit_13->setText("0x" + tempHexArray.toHex());
// 设置 lineEdit_10
tempHexArray = revDatatmp.mid(3, 1);
ui->lineEdit_10->setText("0x" + tempHexArray.toHex());
// 设置 lineEdit_12
tempHexArray = revDatatmp.mid(4, 1);
ui->lineEdit_12->setText("0x" + tempHexArray.toHex());
// 设置 lineEdit_9
tempHexArray = revDatatmp.mid(5, 1);
ui->lineEdit_9->setText("0x" + tempHexArray.toHex());
// 设置 lineEdit_11
tempHexArray = revDatatmp.mid(6, 1);
ui->lineEdit_11->setText("0x" + tempHexArray.toHex());
}
}
void MainWindow::on_btnSpiSaveSetting_clicked() {
BOOL ret = false;
ret= drvSPI->spi_Init(
drvSPI->spi_Init(
ui->comboSpiMode->currentIndex(),
ui->comboSpiClock->currentIndex(),
ui->comboSpiByteOrder->currentIndex(),
@ -384,296 +298,31 @@ void MainWindow::on_btnSpiSaveSetting_clicked() {
ui->comboSpiCS1Pol->currentIndex(),
ui->comboSpiCS2Pol->currentIndex()
);
if(ret){
onLogPrint("Save SPI parameters success");
}else{
onLogPrint("Fail to set SPI parameters.");
}
}
void MainWindow::on_pushButton_11_clicked()
{
// 弹出“打开文件”对话框
QString filePath = QFileDialog::getOpenFileName(
this,
tr("Choose csv file"),
QDir::homePath(),
tr("csv文件 (*.csv);")
);
if(filePath.isEmpty()){
onLogPrint("Empty file.");
return;
}
int voltageValue[16][16]={0};
const int rows = 16;
const int cols = 16;
QFile file(filePath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qWarning() << "Can't open file" << file.errorString();
return ;
}
QTextStream in(&file);
int rowCount = 0;
// 逐行读取文件,直到文件末尾或达到最大行数
while (!in.atEnd() && rowCount < rows) {
QString line = in.readLine();
QStringList fields = line.split(',');
// 遍历当前行的所有字段,并将其转换为整数
for (int colCount = 0; colCount < cols; ++colCount) {
bool ok;
int value = fields.at(colCount).toInt(&ok);
if (ok) {
voltageValue[rowCount][colCount] = value;
} else {
onLogPrint("Row is "+QString::number(rowCount + 1)+" Column is "+QString::number(colCount + 1)+" has invalid data");
voltageValue[rowCount][colCount] = 0; // 或者设置为其他默认值
}
}
rowCount++;
}
file.close();
ui->tableWidget->clearContents();
for (int i = 0; i < 16; ++i) {
for (int j = 0; j < 16; ++j) {
// 将 int 转换为 QString
QString data = QString::number(voltageValue[i][j]);
// 创建 QTableWidgetItem 并设置数据
QTableWidgetItem *item = new QTableWidgetItem(data);
// 将 item 放入指定的单元格
ui->tableWidget->setItem(i, j, item);
}
}
ui->label_13->setText("Ready to write : ");
void MainWindow::onWriteRegButtonClicked() {
QByteArray tmp = fHandler->genREGWrite(0x01, 0x01, 0x09, 0x81);
ui->textBrowser->append("SPI write: " + tmp.toHex());
drvSPI->spi_Write(tmp);
}
void MainWindow::on_pushButton_12_clicked()
{
// // 从1至256通道依次读取电压值
// for(ch_index = 1; ch_index <= 256; ch_index++)
// {
// // 设置配置项
// this->ui->comboBox_icdDacCh->setCurrentIndex(0); // 设置通道值为全0
// this->ui->checkBox_icdTRIG_TADC->setCheckState(Qt::Unchecked); // 关闭TADC
// this->ui->pushButton_icdRegConfig->click(); // 触发配置寄存器按钮
// QThread::msleep(10); // 延时10毫秒
// this->ui->checkBox_icdTRIG_TADC->setCheckState(Qt::Checked); // 开启TADC
// this->ui->comboBox_icdDacCh->setCurrentIndex(ch_index); //设置当前通道
// this->ui->pushButton_icdRegConfig->click(); // 触发配置寄存器按钮
// QThread::msleep(10); // 延时10毫秒
// this->ui->pushButton_icdRegConfig->click(); // 再次触发配置寄存器按钮
// QThread::msleep(10); // 延时10毫秒
// this->ui->pushButton_icdRegRead->click(); // 读取寄存器值
// QThread::msleep(10); // 延时10毫秒
// }
int voltage[256]={0};
#if 1
QByteArray regData[256];
unsigned char ucDAC = ui->comboBox_15->currentText().toUInt(NULL, 10);
QByteArray cmd1 = fHandler->genREGWrite(ucDAC,0x00,0x09,0x11); //关闭TADC
QByteArray cmd3 = fHandler->genREGRead(ucDAC); // 读取寄存器值
int mode = ui->comboBox->currentIndex();
for(int i=1;i<=256;i++){
// ui->lineEdit_2->setText(QString::number(0));
// ui->checkBox_5->setCheckState(Qt::Unchecked);
// on_pushButton_9_clicked();
// QThread::msleep(10); // 延时10毫秒
// ui->checkBox_5->setCheckState(Qt::Checked);
// ui->lineEdit_2->setText(QString::number(i));
// on_pushButton_9_clicked();
// QThread::msleep(10); // 延时10毫秒
// on_pushButton_9_clicked();
// QThread::msleep(10); // 延时10毫秒
// on_pushButton_10_clicked(); //读取寄存器的值
QByteArray cmd2;
if(i!=256){
cmd2= fHandler->genREGWrite(ucDAC,(unsigned char)i,0x19,0x11); //开启TADC
}else{
cmd2 =fHandler->genREGWrite(ucDAC|0x80,0x00,0x19,0x11);
}
switch(mode){
case 0:{
dacHandler->setDACReg(drvUart,cmd1);
QThread::msleep(10); // 延时10毫秒
dacHandler->setDACReg(drvUart,cmd2);
QThread::msleep(10); // 延时10毫秒
dacHandler->setDACReg(drvUart,cmd2);
QThread::msleep(10); // 延时10毫秒
QByteArray tmp = dacHandler->getDACReg(drvUart,cmd3);
QByteArray revData = tmp;
revData.detach();
onLogPrint(" [UART] <-- Read Reg data is :"+tmp.toHex(' '));
if(revData.length()>=7){
regData[i-1]=revData;
}else{
QByteArray tmp(7,0);
regData[i-1]=tmp;
}
break;
}
case 1:
{
dacHandler->setDACReg(drvSPI,cmd1);
QThread::msleep(10); // 延时10毫秒
dacHandler->setDACReg(drvSPI,cmd2);
QThread::msleep(10); // 延时10毫秒
dacHandler->setDACReg(drvSPI,cmd2);
QThread::msleep(10); // 延时10毫秒
regData[i-1]=dacHandler->getDACReg(drvSPI,cmd3);
onLogPrint(" [SPI] <-- Read Reg data is :"+regData[i-1].toHex(' '));
break;
}
}
// qDebug()<<"index is "+QString::number(i);
}
//再次关闭TADC
switch(mode){
case 0 :{
dacHandler->setDACReg(drvUart,cmd1);
break;
}
case 1:{
dacHandler->setDACReg(drvSPI,cmd1);
break;
}
}
#endif
for(int j=0;j<256;j++){
// voltage[j]=((regData[j].at(1)&0x3)<<8)|regData[j].at(2);
voltage[j]=((static_cast<unsigned int>((regData[j].at(1))&0x03))<<8)|(static_cast<unsigned char>((regData[j].at(2))&0xff));;
}
for (int i = 0; i < 16; ++i) {
for (int j = 0; j < 16; ++j) {
// 将 int 转换为 QString
QString data = QString::number(voltage[i*16+j]);
// qDebug()<<voltage[i*16+j];
// 创建 QTableWidgetItem 并设置数据
QTableWidgetItem *item = new QTableWidgetItem(data);
// 将 item 放入指定的单元格
ui->tableWidget->setItem(i, j, item);
}
}
ui->label_13->setText("Read voltage from chip : ");
void MainWindow::onReadRegButtonClicked() {
QByteArray tmp = fHandler->genREGRead(0x01);
ui->textBrowser->append("SPI write: " + tmp.toHex());
QTimer::singleShot(2000, [this]() {
QByteArray ba;
drvSPI->spi_Read(ba);
ui->textBrowser->append("SPI read: " + ba.toHex());
});
}
void MainWindow::on_pushButton_4_clicked()
{
unsigned int voltageValue[16][16]={0};
// 遍历表格的每一行和每一列
for (int row = 0; row < 16; ++row) {
for (int col = 0; col < 16; ++col) {
// 检查单元格是否存在
if (QTableWidgetItem *item = ui->tableWidget->item(row, col)) {
// 获取单元格文本并转换为整数
bool ok;
unsigned int value = item->text().toUInt(&ok);
if (ok) {
// 转换成功,将值存入数组
voltageValue[row][col] = value;
} else {
// 转换失败(例如单元格为空或包含非数字字符),
// 在这里可以处理错误,比如设置一个默认值
voltageValue[row][col] = 0; // 默认值
}
} else {
// 单元格不存在,也设置一个默认值
voltageValue[row][col] = 0; // 默认值
}
}
}
unsigned char ucDAC = ui->comboBox_15->currentText().toUInt(NULL, 10);
QByteArray tmp = fHandler->genVoltage(ucDAC,voltageValue);
switch (ui->comboBox->currentIndex()) {
case 0:{
if(!dacHandler->setDACVoltage(drvUart,tmp))
{
return;
}
break;
}
case 1:
{
if(!dacHandler->setDACVoltage(drvSPI,tmp))
{
return;
}
break;
}
}
}
void MainWindow::on_pushButton_13_clicked()
{
ui->textBrowser->clear();
}
void MainWindow::on_pushButton_16_clicked()
{
// 1. 获取当前时间并格式化
QString currentDateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss");
// 2. 构建完整的文件名
QString fileName = currentDateTime + ".txt";
// 3. 创建 QFileDialog 并打开文件
QFile file(fileName);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
// 4. 使用 QTextStream 写入文本内容
QTextStream out(&file);
// 获取 QTextBrowser 的纯文本内容
out << ui->textBrowser->toPlainText();
file.close();
onLogPrint("Save log success, filename is "+fileName);
}else{
onLogPrint("Fail to save log.");
}
}
void MainWindow::on_pushButton_15_clicked()
{
dt = new DialogTest(this);
connect(dt,&DialogTest::testReadRegSPI,this,&MainWindow::handleTestReadRegSPI);
connect(dt,&DialogTest::testSendRegSPI,this,&MainWindow::handleTestSendRegSPI);
connect(dt,&DialogTest::testSendSPI0,this,&MainWindow::handleTestSendSPI0);
dt->show();
void MainWindow::on_comboBox_currentTextChanged(const QString& text) {
// if (text.toLower() == "spi") {
// connect(ui->pushButton_4, &QPushButton::clicked, this, &MainWindow::onWriteRegButtonClicked);
// connect(ui->pushButton_10, &QPushButton::clicked, this, &MainWindow::onReadRegButtonClicked);
// } else {
// disconnect(ui->pushButton_4, &QPushButton::clicked, this, &MainWindow::onWriteRegButtonClicked);
// disconnect(ui->pushButton_10, &QPushButton::clicked, this, &MainWindow::onReadRegButtonClicked);
// }
}

View File

@ -3,12 +3,12 @@
#include <QMainWindow>
#include "dialogcalibrate.h"
#include "src/headers/drv_uart.h"
#include "src/headers/drv_spi.h"
#include "QDateTime"
#include "QFile"
#include "QFileDialog"
#include "QTextStream"
#include "dachandler.h"
#include "dialogtest.h"
#include "src/headers/framehandler.h"
QT_BEGIN_NAMESPACE
namespace Ui {
@ -28,9 +28,6 @@ public:
public slots:
void onLogPrint(QString msg);
void handleTestSendRegSPI(QByteArray data);
void handleTestReadRegSPI(QByteArray data);
void handleTestSendSPI0();
private slots:
void on_pushButton_14_clicked();
@ -57,30 +54,18 @@ private slots:
void on_pushButton_10_clicked();
void on_btnSpiSaveSetting_clicked();
void onWriteRegButtonClicked();
void onReadRegButtonClicked();
void on_pushButton_11_clicked();
void on_pushButton_12_clicked();
void on_pushButton_4_clicked();
void on_pushButton_13_clicked();
void on_pushButton_16_clicked();
void on_pushButton_15_clicked();
public :
DRV_Uart *drvUart;
DRV_Spi *drvSPI;
FrameHandler *fHandler;
void on_comboBox_currentTextChanged(const QString& text);
private:
Ui::MainWindow *ui;
DialogCalibrate *dc;
DACHandler *dacHandler;
DRV_Uart *drvUart;
DRV_Spi *drvSPI;
FrameHandler *fHandler;
DialogTest *dt;
};
#endif // MAINWINDOW_H

View File

@ -90,7 +90,7 @@
<string>Timeout(ms):</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
@ -149,7 +149,7 @@
<string>Data Bits</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
@ -159,7 +159,7 @@
<string>Stop Bits</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
@ -258,7 +258,7 @@
<string>Baud Rate</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
@ -268,7 +268,7 @@
<string>Parity Bits:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
@ -288,7 +288,7 @@
<string>UART Device List</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter</set>
</property>
</widget>
</item>
@ -311,7 +311,7 @@
<string>SPI Device List</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
@ -358,7 +358,7 @@
<string>SPI Mode:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
@ -444,7 +444,7 @@
<string>Clock:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
@ -454,7 +454,7 @@
<string>LSB/MSB</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
@ -491,7 +491,7 @@
<string>DataBits:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
@ -572,35 +572,21 @@
<string>Voltage Check</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="2" column="0" colspan="2">
<item row="0" column="0">
<widget class="QPushButton" name="pushButton_11">
<property name="text">
<string>Import Voltage From File</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButton_12">
<property name="text">
<string>Read Voltage From Chip</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="pushButton_4">
<property name="text">
<string>Send Voltage</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QPushButton" name="pushButton_14">
<property name="text">
<string>Start Calibrate</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Ready to write:</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item row="2" column="0">
<widget class="QTableWidget" name="tableWidget">
<property name="rowCount">
<number>16</number>
@ -642,10 +628,10 @@
<column/>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QPushButton" name="pushButton_11">
<item row="3" column="0">
<widget class="QPushButton" name="pushButton_14">
<property name="text">
<string>Import Voltage From File</string>
<string>Start Calibrate</string>
</property>
</widget>
</item>
@ -655,10 +641,10 @@
<item row="0" column="6">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@ -680,13 +666,6 @@
<string>Log</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="2" column="0">
<widget class="QPushButton" name="pushButton_13">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QTextBrowser" name="textBrowser">
<property name="enabled">
@ -701,9 +680,9 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButton_16">
<widget class="QPushButton" name="pushButton_13">
<property name="text">
<string>Save</string>
<string>Clear</string>
</property>
</widget>
</item>
@ -749,52 +728,9 @@
<string>Reg Value</string>
</property>
<layout class="QGridLayout" name="gridLayout_11">
<item row="3" column="1">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Reg 4:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLineEdit" name="lineEdit_11"/>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_23">
<property name="text">
<string>Reg 6:</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLineEdit" name="lineEdit_13"/>
</item>
<item row="5" column="2">
<widget class="QLineEdit" name="lineEdit_8"/>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="lineEdit_10"/>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Reg 2:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="lineEdit_9"/>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_24">
<property name="text">
<string>Reg 1:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="lineEdit_12"/>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_26">
<property name="text">
@ -802,6 +738,32 @@
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_23">
<property name="text">
<string>Reg 6:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="lineEdit_12"/>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="lineEdit_9"/>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Reg 2:</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLineEdit" name="lineEdit_8"/>
</item>
<item row="4" column="2">
<widget class="QLineEdit" name="lineEdit_13"/>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_22">
<property name="text">
@ -809,15 +771,22 @@
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_16">
<item row="0" column="2">
<widget class="QLineEdit" name="lineEdit_11"/>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Reg 7:</string>
<string>Reg 4:</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLineEdit" name="lineEdit_3"/>
<item row="0" column="1">
<widget class="QLabel" name="label_24">
<property name="text">
<string>Reg 1:</string>
</property>
</widget>
</item>
</layout>
</widget>
@ -1123,13 +1092,6 @@
</layout>
</widget>
</item>
<item row="0" column="7">
<widget class="QPushButton" name="pushButton_15">
<property name="text">
<string>Test Mode</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
@ -1138,7 +1100,7 @@
<x>0</x>
<y>0</y>
<width>839</width>
<height>21</height>
<height>33</height>
</rect>
</property>
</widget>

10
src/headers/crc.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef CRC_H
#define CRC_H
#include <QByteArray>
// 直接计算反射型CRC16-CCITT输出低字节在前的QByteArray
QByteArray crc16Reverse(const QByteArray& data);
// void generate_crc16_reverse_table(quint16 table[256]);
#endif // CRC_H

View File

@ -1,41 +0,0 @@
#ifndef DACHANDLER_H
#define DACHANDLER_H
#include <QObject>
#include "src/headers/framehandler.h"
#include "src/headers/drv_uart.h"
#include "src/headers/drv_spi.h"
#include "QThread"
class DACHandler : public QObject
{
Q_OBJECT
public:
explicit DACHandler(QObject *parent = nullptr);
//UART
bool setDACVoltage(DRV_Uart *drvUart, QByteArray &data); //发送一个DAC的电压,done
bool setVoltage(DRV_Uart *drvUart, QByteArray &data); //发送所有DAC的电压
bool setDACReg(DRV_Uart *drvUart, QByteArray &data); //设置DAC寄存器,done
QByteArray getDACReg(DRV_Uart *drvUart, QByteArray &data); // 回读DAC寄存器,done
bool getChannelVoltage(DRV_Uart *drvUart,QByteArray &data); //回读指定通道的电压值
bool getDACVoltage(DRV_Uart *drvUart, QByteArray &data); //回读指定DAC的所有电压值
//SPI
bool setDACVoltage(DRV_Spi *drvSPI, QByteArray &data); //发送一个DAC的电压,done
bool setVoltage(DRV_Spi *drvSPI,QByteArray &data); //发送所有DAC的电压
bool setDACReg(DRV_Spi *drvSPI, QByteArray &data); //设置DAC寄存器,done
QByteArray getDACReg(DRV_Spi *drvSPI, QByteArray &data); // 回读DAC寄存器,done
bool getChannelVoltage(DRV_Spi *drvSPI,QByteArray &data); //回读指定通道的电压值
bool getDACVoltage(DRV_Spi *drvSPI, QByteArray &data); //回读指定DAC的所有电压值
signals:
void logMsg(QString msg);
};
#endif // DACHANDLER_H

View File

@ -12,7 +12,6 @@ public:
explicit FrameHandler(QObject *parent = nullptr);
QByteArray genREGWrite(unsigned char ucDAC,unsigned char ucChannel,unsigned char ucFun1,unsigned char ucFun2);
QByteArray genREGRead(unsigned char ucDAC);
QByteArray genVoltage(unsigned char ucDAC, unsigned int (*voltage)[16]); //fixed lenth is 16*16;
QByteArray genCrc16(const QByteArray& data);
QByteArray genSum(const QByteArray& data);
static void genCrc16table(quint16 table[256], quint16 poly);

7
src/sources/crc.cpp Normal file
View File

@ -0,0 +1,7 @@
#include "crc.h"
// 函数声明
// void generate_crc16_reverse_table(quint16 *table);
// QByteArray crc16Reverse(const QByteArray& data);

View File

@ -1,91 +0,0 @@
#include "dachandler.h"
#include "dachandler.h"
DACHandler::DACHandler(QObject *parent)
: QObject{parent}
{
}
bool DACHandler::setDACVoltage(DRV_Uart *drvUart, QByteArray &data)
{
if (drvUart->Uart_Write(data)) {
emit logMsg(" [UART] --> Send data success, data is (hex) :" + data.toHex(' '));
return true;
} else {
emit logMsg(" [UART] Send data fail");
return false;
}
}
bool DACHandler::setDACReg(DRV_Uart *drvUart, QByteArray &data)
{
if(drvUart->Uart_Write(data)){
emit logMsg(" [UART] --> Send data success, data is (hex) :" + data.toHex(' '));
return true;
}else{
emit logMsg(" [UART] Send data failed");
return false;
}
}
QByteArray DACHandler::getDACReg(DRV_Uart *drvUart, QByteArray &data)
{
if (drvUart->Uart_Write(data)) {
emit logMsg(" [UART] --> Send data success, data is (hex) :" + data.toHex(' '));
} else {
emit logMsg(" [UART] Send data failed");
}
QThread::msleep(2);
QByteArray revDatatmp;
drvUart->Uart_Read(revDatatmp);
return revDatatmp;
}
bool DACHandler::setDACVoltage(DRV_Spi *drvSPI, QByteArray &data)
{
QByteArray data1= data;
if (drvSPI->spi_Write(data1)) {
emit logMsg(" [SPI] --> Send data success, data is (hex) :" + data.toHex(' '));
return true;
} else {
emit logMsg(" [SPI] Send data fail");
return false;
}
}
bool DACHandler::setDACReg(DRV_Spi *drvSPI, QByteArray &data)
{
QByteArray data1= data;
if(drvSPI->spi_Write(data1)){
emit logMsg(" [SPI] --> Send data success, data is (hex) :" + data.toHex(' '));
return true;
}else{
emit logMsg(" [SPI] Send data failed");
return false;
}
}
QByteArray DACHandler::getDACReg(DRV_Spi *drvSPI, QByteArray &data)
{
QByteArray revData(7,0);
QByteArray data1= data;
if(drvSPI->spi_Write(data1)){
emit logMsg(" [SPI] --> Send data success, data is (hex) :" + data.toHex(' '));
QThread::msleep(2);
if(drvSPI->spi_Write(revData)){
emit logMsg(" [SPI] --> Send data success, data is (hex) :" + revData.toHex(' '));
}else{
emit logMsg(" [SPI] Send data failed");
}
}else{
emit logMsg(" [SPI] Send data failed");
}
return revData;
}

View File

@ -91,56 +91,3 @@ QByteArray FrameHandler::genREGRead(unsigned char ucDAC)
nFrameCount++;
return cmd1;
}
QByteArray FrameHandler::genVoltage(unsigned char ucDAC, unsigned int (*voltage)[16])
{
QByteArray cmd1(17,0);
cmd1[0]=0x9F;
cmd1[1]=0xE4;
cmd1[2]=0x03;
cmd1[3]=0x03;
cmd1[4]=ucDAC;
cmd1[14]=nFrameCount;
QByteArray sumResult = genSum(cmd1);
cmd1[15]=static_cast<char>(sumResult.at(0));
cmd1[16]=0x02;
uint16_t data_in[256]; // 16x16=256个元素
for(int i = 0; i < 16; i++) {
for(int j = 0; j < 16; j++) {
// 确保10bit数据在0-1023范围内
data_in[i*16 + j] = static_cast<uint16_t>(voltage[i][j] & 0x3FF);
}
}
// 2. 准备输出缓冲区
QByteArray data_out;
data_out.resize(320); // 64*5=320字节
// 3. 执行原始的数据转换,已经顺序交换
// for(uint16_t i = 0; i < 64; i++) {
// data_out[i*5] = static_cast<char>(data_in[i*4+3] >> 2);
// data_out[i*5+1] = static_cast<char>((data_in[i*4+3] << 6) | (data_in[i*4+2] >> 4));
// data_out[i*5+2] = static_cast<char>((data_in[i*4+2] << 4) | (data_in[i*4+1] >> 6));
// data_out[i*5+3] = static_cast<char>((data_in[i*4+1] << 2) | (data_in[i*4] >> 8));
// data_out[i*5+4] = static_cast<char>(data_in[i*4] & 0xFF);
// }
for(uint16_t i = 0; i < 64; i++) {
data_out[i*5] = static_cast<char>(data_in[i*4] & 0xFF);
data_out[i*5+1] = static_cast<char>((data_in[i*4+1] << 2) | (data_in[i*4] >> 8));
data_out[i*5+2] = static_cast<char>((data_in[i*4+2] << 4) | (data_in[i*4+1] >> 6));
data_out[i*5+3] = static_cast<char>((data_in[i*4+3] << 6) | (data_in[i*4+2] >> 4));
data_out[i*5+4] = static_cast<char>(data_in[i*4+3] >> 2);
}
QByteArray crcRes= genCrc16(data_out);
QByteArray cmd = cmd1+data_out+crcRes;
cmd.append(genSum(cmd));
nFrameCount++;
return cmd;
}

View File

@ -1,16 +0,0 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

View File

@ -1,16 +0,0 @@
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
13 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
15 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
16 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

View File

@ -1,16 +0,0 @@
291,147,51,117,295,144,54,7,270,81,106,163,18,79,45,244
170,20,292,109,222,298,184,276,249,163,35,141,99,301,148,80
106,215,5,77,264,239,111,242,145,50,316,118,2,134,204,228
133,33,240,317,85,32,90,318,275,247,0,234,155,153,216,145
235,257,73,162,249,42,249,41,23,49,199,104,259,55,103,240
163,58,212,255,306,186,192,168,317,199,196,213,192,131,178,310
231,3,262,95,146,14,154,212,251,76,38,147,19,186,142,170
56,67,296,21,313,93,48,272,302,28,176,27,145,46,296,272
77,94,311,50,74,275,78,267,151,226,264,191,1,27,141,233
253,114,2,170,149,46,109,154,212,150,307,65,194,281,134,0
237,240,185,65,160,287,275,204,91,107,164,300,187,287,107,213
160,136,114,175,93,77,255,69,217,9,310,59,85,106,275,173
66,19,126,263,284,72,61,234,225,273,286,34,300,268,177,205
24,52,165,242,95,79,72,288,224,198,149,313,12,266,149,126
273,34,55,189,292,139,136,98,288,160,29,232,225,164,197,107
146,310,19,24,11,118,92,181,283,107,52,122,253,8,87,286
1 291 147 51 117 295 144 54 7 270 81 106 163 18 79 45 244
2 170 20 292 109 222 298 184 276 249 163 35 141 99 301 148 80
3 106 215 5 77 264 239 111 242 145 50 316 118 2 134 204 228
4 133 33 240 317 85 32 90 318 275 247 0 234 155 153 216 145
5 235 257 73 162 249 42 249 41 23 49 199 104 259 55 103 240
6 163 58 212 255 306 186 192 168 317 199 196 213 192 131 178 310
7 231 3 262 95 146 14 154 212 251 76 38 147 19 186 142 170
8 56 67 296 21 313 93 48 272 302 28 176 27 145 46 296 272
9 77 94 311 50 74 275 78 267 151 226 264 191 1 27 141 233
10 253 114 2 170 149 46 109 154 212 150 307 65 194 281 134 0
11 237 240 185 65 160 287 275 204 91 107 164 300 187 287 107 213
12 160 136 114 175 93 77 255 69 217 9 310 59 85 106 275 173
13 66 19 126 263 284 72 61 234 225 273 286 34 300 268 177 205
14 24 52 165 242 95 79 72 288 224 198 149 313 12 266 149 126
15 273 34 55 189 292 139 136 98 288 160 29 232 225 164 197 107
16 146 310 19 24 11 118 92 181 283 107 52 122 253 8 87 286