You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
3.8 KiB
C

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QString>
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void on_openDirBtn_clicked();
void on_startModifyBtn_clicked();
private:
void CreateDir();
void ReadDat(QString fileName);
uint8_t IntToHex(int data);
quint16 GetCrcSum(quint8 *dataptr, quint16 len);
quint8 GetDataCheckCRC(quint8 *dataptr, quint16 len);
bool isLeapYear(int year);
bool isValidDay(int year, int month, int day);
QString GetOutputFileName(QString fileName,int year,int month,int day);
private:
Ui::MainWindow *ui;
QString folderPath;
QString outputDir;
const quint8 CRCLIST[512]=
{
0x0,0x0,0x89,0x11,0x12,0x23,0x9b,0x32,0x24,0x46,0xad,0x57,0x36,0x65,0xbf,0x74,
0x48,0x8c,0xc1,0x9d,0x5a,0xaf,0xd3,0xbe,0x6c,0xca,0xe5,0xdb,0x7e,0xe9,0xf7,0xf8,
0x81,0x10,0x8,0x1,0x93,0x33,0x1a,0x22,0xa5,0x56,0x2c,0x47,0xb7,0x75,0x3e,0x64,
0xc9,0x9c,0x40,0x8d,0xdb,0xbf,0x52,0xae,0xed,0xda,0x64,0xcb,0xff,0xf9,0x76,0xe8,
0x2,0x21,0x8b,0x30,0x10,0x2,0x99,0x13,0x26,0x67,0xaf,0x76,0x34,0x44,0xbd,0x55,
0x4a,0xad,0xc3,0xbc,0x58,0x8e,0xd1,0x9f,0x6e,0xeb,0xe7,0xfa,0x7c,0xc8,0xf5,0xd9,
0x83,0x31,0xa,0x20,0x91,0x12,0x18,0x3,0xa7,0x77,0x2e,0x66,0xb5,0x54,0x3c,0x45,
0xcb,0xbd,0x42,0xac,0xd9,0x9e,0x50,0x8f,0xef,0xfb,0x66,0xea,0xfd,0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