Skip to content

Commit

Permalink
refactor: Optimize common library module[500211]
Browse files Browse the repository at this point in the history
  • Loading branch information
Greedysky committed Jan 19, 2023
1 parent ce8dcd3 commit ed03f2b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 15 deletions.
10 changes: 6 additions & 4 deletions TTKCommon/ttknumberdefine.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#define MT_D2M (MT_D2H * MT_H2M)
#define MT_D2S qint64(MT_D2M * MT_M2S)
#define MT_D2MS qint64(MT_D2S * MT_S2MS)
//


#define MH_BS 1

Expand Down Expand Up @@ -71,7 +71,7 @@
#define MH_TB2KB qint64(MH_TB2MB * MH_MB2KB)
#define MH_TB2B qint64(MH_TB2KB * MH_KB2B)
#define MH_TB2BS qint64(MH_TB2B * MH_B2BS)
//


#define MA_0 0
#define MA_30 30
Expand All @@ -82,7 +82,7 @@
#define MA_180 180
#define MA_270 270
#define MA_360 360
//


#define MB_0 0
#define MB_32 32
Expand All @@ -95,7 +95,9 @@
#define MB_500 500
#define MB_750 750
#define MB_1000 1000
//


#define MV_MIN 0
#define MV_MAX 100

#endif // TTKNUMBERDEFINE_H
1 change: 1 addition & 0 deletions TTKModule/TTKCore/ocrCoreKits/OCRCoreKits.pri
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ INCLUDEPATH += $$PWD
HEADERS += \
$$PWD/ocrbackgroundmanager.h \
$$PWD/ocrobject.h \
$$PWD/ocrotherdefine.h \
$$PWD/ocrruntimemanager.h

SOURCES += \
Expand Down
15 changes: 4 additions & 11 deletions TTKModule/TTKCore/ocrCoreKits/ocrobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@
#include "ttkglobal.h"

//
#define DOWNLOAD_DIR TTK_STRCAT("Downloads", TTK_SEPARATOR)
#define LANGUAGE_DIR TTK_STRCAT("GLanguage", TTK_SEPARATOR)


#define DIR_PREFIX "dir"

#define JPG_FILE_SUFFIX "jpg"
#define EXE_FILE_SUFFIX "exe"
#define COM_FILE_SUFFIX "com"


#define JPG_FILE TTK_STRCAT(TTK_DOT, JPG_FILE_SUFFIX)
#define EXE_FILE TTK_STRCAT(TTK_DOT, EXE_FILE_SUFFIX)
#define COM_FILE TTK_STRCAT(TTK_DOT, COM_FILE_SUFFIX)
Expand All @@ -45,19 +42,15 @@
#define APP_EXE_NAME TTK_STRCAT(APP_NAME, EXE_FILE)


#define DOWNLOAD_DIR TTK_STRCAT("Downloads", TTK_SEPARATOR)
#define LANGUAGE_DIR TTK_STRCAT("GLanguage", TTK_SEPARATOR)

#define DOWNLOAD_DIR_FULL OCRObject::applicationPath() + TTK_PDIR + DOWNLOAD_DIR
#define LANGUAGE_DIR_FULL OCRObject::applicationPath() + LANGUAGE_DIR


#define WINDOW_WIDTH_MIN 850
#define WINDOW_HEIGHT_MIN 550
//
#define DEFAULT_INDEX_LEVEL0 -1
#define DEFAULT_INDEX_LEVEL1 -999
#define DEFAULT_INDEX_LEVEL2 -888
#define DEFAULT_INDEX_LEVEL3 -777
#define DEFAULT_INDEX_LEVEL4 -666
#define DEFAULT_INDEX_LEVEL5 -555


/*! @brief The namespace of the application object.
Expand Down
39 changes: 39 additions & 0 deletions TTKModule/TTKCore/ocrCoreKits/ocrotherdefine.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#ifndef OCROTHERDEFINE_H
#define OCROTHERDEFINE_H

/***************************************************************************
* This file is part of the TTK OCR project
* Copyright (C) 2015 - 2023 Greedysky Studio
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along
* with this program; If not, see <http://www.gnu.org/licenses/>.
***************************************************************************/

#include <QObject>

#define TTK_TIME_FORMAT "hh:mm"
#define TTK_STIME_FORMAT "hh:mm:ss"
#define TTK_YEAR_FORMAT "yyyy-MM-dd"
#define TTK_YEAR_TIME_FORMAT "yyyy-MM-dd hh:mm"
#define TTK_YEAR_STIME_FORMAT "yyyy-MM-dd hh:mm:ss"

#define TTK_ITEM_SIZE_S 25
#define TTK_ITEM_SIZE_M 30
#define TTK_ITEM_SIZE_L 40
#define TTK_ITEM_SIZE_XL 60

#define TTK_LOW_LEVEL -999
#define TTK_NORMAL_LEVEL -1
#define TTK_HIGH_LEVEL 999

#endif // OCROTHERDEFINE_H

0 comments on commit ed03f2b

Please sign in to comment.