mirror of
https://gitee.com/nikolan/keil_development_assistant.git
synced 2025-02-05 03:58:22 +08:00
添加打包脚本
This commit is contained in:
parent
f9d3c7e0a0
commit
5ff51144ec
243
KDAv1.nsi
Normal file
243
KDAv1.nsi
Normal file
@ -0,0 +1,243 @@
|
||||
; Script generated by the HM NIS Edit Script Wizard.
|
||||
|
||||
; HM NIS Edit Wizard helper defines
|
||||
!define PRODUCT_NAME "KDA_v1.0"
|
||||
!define PRODUCT_VERSION "1.0"
|
||||
!define PRODUCT_PUBLISHER "һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ageek"
|
||||
!define PRODUCT_WEB_SITE "https://gitee.com/nikolan"
|
||||
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\KDA.exe"
|
||||
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
||||
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
||||
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
|
||||
|
||||
; MUI 1.67 compatible ------
|
||||
!include "MUI.nsh"
|
||||
|
||||
; MUI Settings
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_ICON "KDA_Logo.ico"
|
||||
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
|
||||
|
||||
; Language Selection Dialog Settings
|
||||
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
|
||||
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
|
||||
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
|
||||
|
||||
; Welcome page
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
; License page
|
||||
!define MUI_LICENSEPAGE_CHECKBOX
|
||||
!insertmacro MUI_PAGE_LICENSE "GPLv2.txt"
|
||||
; Directory page
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
; Start menu page
|
||||
var ICONS_GROUP
|
||||
!define MUI_STARTMENUPAGE_NODISABLE
|
||||
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "KDA_v1.0"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
|
||||
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
|
||||
; Instfiles page
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
!include "WordFunc.nsh"
|
||||
!define PATH_KEY "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" ;//path<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD>HKLM<EFBFBD>µ<EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Section -Post
|
||||
;<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>ϵͳԭ<EFBFBD>еĻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
|
||||
;<EFBFBD><EFBFBD>ԭ<EFBFBD>еĻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> D:\test Ŀ¼
|
||||
WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$0;$INSTDIR"
|
||||
;ˢ<EFBFBD>»<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=500
|
||||
SectionEnd
|
||||
; Finish page
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR\KDA.exe"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
; Uninstaller pages
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
; Language files
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
!insertmacro MUI_LANGUAGE "SimpChinese"
|
||||
|
||||
; MUI end ------
|
||||
|
||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
||||
OutFile "KDA_v1.0.exe"
|
||||
InstallDir "$PROGRAMFILES\KDA_v1.0"
|
||||
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
|
||||
ShowInstDetails show
|
||||
ShowUnInstDetails show
|
||||
|
||||
Function .onInit
|
||||
!insertmacro MUI_LANGDLL_DISPLAY
|
||||
FunctionEnd
|
||||
|
||||
Section "MainSection" SEC01
|
||||
SetOutPath "$INSTDIR"
|
||||
SetOverwrite try
|
||||
File "..\Winx64\D3Dcompiler_47.dll"
|
||||
SetOutPath "$INSTDIR\iconengines"
|
||||
File "..\Winx64\iconengines\qsvgicon.dll"
|
||||
SetOutPath "$INSTDIR\imageformats"
|
||||
File "..\Winx64\imageformats\qgif.dll"
|
||||
File "..\Winx64\imageformats\qicns.dll"
|
||||
File "..\Winx64\imageformats\qico.dll"
|
||||
File "..\Winx64\imageformats\qjpeg.dll"
|
||||
File "..\Winx64\imageformats\qsvg.dll"
|
||||
File "..\Winx64\imageformats\qtga.dll"
|
||||
File "..\Winx64\imageformats\qtiff.dll"
|
||||
File "..\Winx64\imageformats\qwbmp.dll"
|
||||
File "..\Winx64\imageformats\qwebp.dll"
|
||||
SetOutPath "$INSTDIR"
|
||||
File "..\Winx64\KDA.exe"
|
||||
File "..\Winx64\libEGL.dll"
|
||||
File "..\Winx64\libgcc_s_seh-1.dll"
|
||||
File "..\Winx64\libGLESV2.dll"
|
||||
File "..\Winx64\libstdc++-6.dll"
|
||||
File "..\Winx64\libwinpthread-1.dll"
|
||||
File "..\Winx64\opengl32sw.dll"
|
||||
SetOutPath "$INSTDIR\platforms"
|
||||
File "..\Winx64\platforms\qwindows.dll"
|
||||
SetOutPath "$INSTDIR"
|
||||
File "..\Winx64\Qt5Charts.dll"
|
||||
File "..\Winx64\Qt5Core.dll"
|
||||
File "..\Winx64\Qt5Gui.dll"
|
||||
File "..\Winx64\Qt5Svg.dll"
|
||||
File "..\Winx64\Qt5Widgets.dll"
|
||||
SetOutPath "$INSTDIR\styles"
|
||||
File "..\Winx64\styles\qwindowsvistastyle.dll"
|
||||
SetOutPath "$INSTDIR\translations"
|
||||
File "..\Winx64\translations\qt_ar.qm"
|
||||
File "..\Winx64\translations\qt_bg.qm"
|
||||
File "..\Winx64\translations\qt_ca.qm"
|
||||
File "..\Winx64\translations\qt_cs.qm"
|
||||
File "..\Winx64\translations\qt_da.qm"
|
||||
File "..\Winx64\translations\qt_de.qm"
|
||||
File "..\Winx64\translations\qt_en.qm"
|
||||
File "..\Winx64\translations\qt_es.qm"
|
||||
File "..\Winx64\translations\qt_fi.qm"
|
||||
File "..\Winx64\translations\qt_fr.qm"
|
||||
File "..\Winx64\translations\qt_gd.qm"
|
||||
File "..\Winx64\translations\qt_he.qm"
|
||||
File "..\Winx64\translations\qt_hu.qm"
|
||||
File "..\Winx64\translations\qt_it.qm"
|
||||
File "..\Winx64\translations\qt_ja.qm"
|
||||
File "..\Winx64\translations\qt_ko.qm"
|
||||
File "..\Winx64\translations\qt_lv.qm"
|
||||
File "..\Winx64\translations\qt_pl.qm"
|
||||
File "..\Winx64\translations\qt_ru.qm"
|
||||
File "..\Winx64\translations\qt_sk.qm"
|
||||
File "..\Winx64\translations\qt_uk.qm"
|
||||
File "..\Winx64\translations\qt_zh_TW.qm"
|
||||
|
||||
; Shortcuts
|
||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
||||
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
|
||||
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\KDA_v1.0.lnk" "$INSTDIR\KDA.exe"
|
||||
CreateShortCut "$DESKTOP\KDA_v1.0.lnk" "$INSTDIR\KDA.exe"
|
||||
!insertmacro MUI_STARTMENU_WRITE_END
|
||||
SectionEnd
|
||||
|
||||
Section -AdditionalIcons
|
||||
SetOutPath $INSTDIR
|
||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
||||
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
|
||||
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
|
||||
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
|
||||
!insertmacro MUI_STARTMENU_WRITE_END
|
||||
SectionEnd
|
||||
|
||||
Section -Post
|
||||
WriteUninstaller "$INSTDIR\uninst.exe"
|
||||
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\KDA.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\KDA.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
|
||||
SectionEnd
|
||||
|
||||
|
||||
Function un.onUninstSuccess
|
||||
HideWindow
|
||||
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) <20>ѳɹ<D1B3><C9B9>ش<EFBFBD><D8B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD><C6B3><EFBFBD>"
|
||||
FunctionEnd
|
||||
|
||||
Function un.onInit
|
||||
!insertmacro MUI_UNGETLANGUAGE
|
||||
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "<EFBFBD><EFBFBD>ȷʵҪ<EFBFBD><EFBFBD>ȫ<EFBFBD>Ƴ<EFBFBD> $(^Name) <20><><EFBFBD>估<EFBFBD><E4BCB0><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" IDYES +2
|
||||
Abort
|
||||
FunctionEnd
|
||||
|
||||
Section Uninstall
|
||||
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
|
||||
Delete "$INSTDIR\${PRODUCT_NAME}.url"
|
||||
Delete "$INSTDIR\uninst.exe"
|
||||
Delete "$INSTDIR\translations\qt_zh_TW.qm"
|
||||
Delete "$INSTDIR\translations\qt_uk.qm"
|
||||
Delete "$INSTDIR\translations\qt_sk.qm"
|
||||
Delete "$INSTDIR\translations\qt_ru.qm"
|
||||
Delete "$INSTDIR\translations\qt_pl.qm"
|
||||
Delete "$INSTDIR\translations\qt_lv.qm"
|
||||
Delete "$INSTDIR\translations\qt_ko.qm"
|
||||
Delete "$INSTDIR\translations\qt_ja.qm"
|
||||
Delete "$INSTDIR\translations\qt_it.qm"
|
||||
Delete "$INSTDIR\translations\qt_hu.qm"
|
||||
Delete "$INSTDIR\translations\qt_he.qm"
|
||||
Delete "$INSTDIR\translations\qt_gd.qm"
|
||||
Delete "$INSTDIR\translations\qt_fr.qm"
|
||||
Delete "$INSTDIR\translations\qt_fi.qm"
|
||||
Delete "$INSTDIR\translations\qt_es.qm"
|
||||
Delete "$INSTDIR\translations\qt_en.qm"
|
||||
Delete "$INSTDIR\translations\qt_de.qm"
|
||||
Delete "$INSTDIR\translations\qt_da.qm"
|
||||
Delete "$INSTDIR\translations\qt_cs.qm"
|
||||
Delete "$INSTDIR\translations\qt_ca.qm"
|
||||
Delete "$INSTDIR\translations\qt_bg.qm"
|
||||
Delete "$INSTDIR\translations\qt_ar.qm"
|
||||
Delete "$INSTDIR\styles\qwindowsvistastyle.dll"
|
||||
Delete "$INSTDIR\Qt5Widgets.dll"
|
||||
Delete "$INSTDIR\Qt5Svg.dll"
|
||||
Delete "$INSTDIR\Qt5Gui.dll"
|
||||
Delete "$INSTDIR\Qt5Core.dll"
|
||||
Delete "$INSTDIR\Qt5Charts.dll"
|
||||
Delete "$INSTDIR\platforms\qwindows.dll"
|
||||
Delete "$INSTDIR\opengl32sw.dll"
|
||||
Delete "$INSTDIR\libwinpthread-1.dll"
|
||||
Delete "$INSTDIR\libstdc++-6.dll"
|
||||
Delete "$INSTDIR\libGLESV2.dll"
|
||||
Delete "$INSTDIR\libgcc_s_seh-1.dll"
|
||||
Delete "$INSTDIR\libEGL.dll"
|
||||
Delete "$INSTDIR\KDA.exe"
|
||||
Delete "$INSTDIR\imageformats\qwebp.dll"
|
||||
Delete "$INSTDIR\imageformats\qwbmp.dll"
|
||||
Delete "$INSTDIR\imageformats\qtiff.dll"
|
||||
Delete "$INSTDIR\imageformats\qtga.dll"
|
||||
Delete "$INSTDIR\imageformats\qsvg.dll"
|
||||
Delete "$INSTDIR\imageformats\qjpeg.dll"
|
||||
Delete "$INSTDIR\imageformats\qico.dll"
|
||||
Delete "$INSTDIR\imageformats\qicns.dll"
|
||||
Delete "$INSTDIR\imageformats\qgif.dll"
|
||||
Delete "$INSTDIR\iconengines\qsvgicon.dll"
|
||||
Delete "$INSTDIR\D3Dcompiler_47.dll"
|
||||
|
||||
Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
|
||||
Delete "$SMPROGRAMS\$ICONS_GROUP\Website.lnk"
|
||||
Delete "$DESKTOP\KDA_v1.0.lnk"
|
||||
Delete "$SMPROGRAMS\$ICONS_GROUP\KDA_v1.0.lnk"
|
||||
|
||||
RMDir "$SMPROGRAMS\$ICONS_GROUP"
|
||||
RMDir "$INSTDIR\translations"
|
||||
RMDir "$INSTDIR\styles"
|
||||
RMDir "$INSTDIR\platforms"
|
||||
RMDir "$INSTDIR\imageformats"
|
||||
RMDir "$INSTDIR\iconengines"
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
|
||||
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
|
||||
SetAutoClose true
|
||||
SectionEnd
|
@ -9,14 +9,14 @@ find_path::find_path()
|
||||
{
|
||||
|
||||
}
|
||||
QString find_path::find_file_path(const QString& dir_path,const QString& key_world)
|
||||
{
|
||||
QString find_path::find_file_path(const QString& dir_path,const QString& key_world)
|
||||
{
|
||||
QFileInfoList fileInfoList;
|
||||
QString file_path="";
|
||||
QDir dir(dir_path);
|
||||
foreach(QFileInfo info,dir.entryInfoList(QDir::NoDotAndDotDot | QDir::Dirs)){
|
||||
|
||||
// qDebug()<<"dir:"<<info.filePath();
|
||||
// qDebug()<<"dir:"<<info.filePath();
|
||||
|
||||
file_path=find_file_path(info.filePath(),key_world);
|
||||
if(file_path!="")
|
||||
@ -31,10 +31,10 @@ find_path::find_path()
|
||||
|
||||
|
||||
file_path=info.path()+"/"+info.fileName();
|
||||
// qDebug()<<info.path()+"/"+info.fileName();
|
||||
// qDebug()<<info.path()+"/"+info.fileName();
|
||||
return file_path;
|
||||
}
|
||||
|
||||
}
|
||||
return file_path;
|
||||
}
|
||||
}
|
||||
|
4
flatui.h
4
flatui.h
@ -25,9 +25,9 @@ class QScrollBar;
|
||||
|
||||
#ifdef quc
|
||||
class Q_DECL_EXPORT FlatUI
|
||||
#else
|
||||
#else
|
||||
class FlatUI
|
||||
#endif
|
||||
#endif
|
||||
|
||||
{
|
||||
public:
|
||||
|
8
main.cpp
8
main.cpp
@ -66,10 +66,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Execute the cmd command and get the output
|
||||
// QString result = executeCmdCommand("cd ");
|
||||
// QString result = executeCmdCommand("cd ");
|
||||
|
||||
// Display the output
|
||||
// qDebug() << "Output:" << result;
|
||||
// qDebug() << "Output:" << result;
|
||||
|
||||
|
||||
for(int i=0;i<argc;i++)
|
||||
@ -109,8 +109,8 @@ int main(int argc, char *argv[])
|
||||
QApplication a(argc, argv);
|
||||
|
||||
|
||||
// only_run_by_file programController;
|
||||
// QObject::connect(&programController, &only_run_by_file::runFileDeleted, &a, &QCoreApplication::quit);
|
||||
// only_run_by_file programController;
|
||||
// QObject::connect(&programController, &only_run_by_file::runFileDeleted, &a, &QCoreApplication::quit);
|
||||
// 注册程序退出的处理函数
|
||||
QObject::connect(&a, &QCoreApplication::aboutToQuit, onAppExit);
|
||||
|
||||
|
109
mainwindow.cpp
109
mainwindow.cpp
@ -25,7 +25,7 @@ MainWindow::MainWindow(QWidget *parent) : FramelessMainWindow(parent), ui(new Ui
|
||||
ui->setupUi(this);
|
||||
this->initForm();
|
||||
winow_on_top(true);
|
||||
// winow_on_top(false);
|
||||
// winow_on_top(false);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
@ -69,8 +69,8 @@ void MainWindow::initForm()
|
||||
main_window=this;
|
||||
|
||||
|
||||
//map_path="./";
|
||||
//project_path="./";
|
||||
//map_path="./";
|
||||
//project_path="./";
|
||||
|
||||
ui->map_path->setText(map_path);
|
||||
ui->project_path->setText(project_path);
|
||||
@ -87,34 +87,34 @@ void MainWindow::initForm()
|
||||
|
||||
|
||||
|
||||
//QChartView
|
||||
//QChartView
|
||||
|
||||
|
||||
ram_chart->addSeries(ram_pieseries);
|
||||
ram_chart->setTitle("文件内存分布饼图");
|
||||
ram_chart->legend()->hide();
|
||||
// Set the theme to one of the predefined themes
|
||||
ram_chart->setTheme(QChart::ChartThemeQt);
|
||||
ram_chart->setBackgroundBrush(QBrush(Qt::gray));
|
||||
ram_chart->addSeries(ram_pieseries);
|
||||
ram_chart->setTitle("文件内存分布饼图");
|
||||
ram_chart->legend()->hide();
|
||||
// Set the theme to one of the predefined themes
|
||||
ram_chart->setTheme(QChart::ChartThemeQt);
|
||||
ram_chart->setBackgroundBrush(QBrush(Qt::gray));
|
||||
|
||||
ram_chart->setTitleBrush(Qt::white);; // 数据集分类标题文字颜色
|
||||
flash_chart->addSeries(flash_pieseries);
|
||||
flash_chart->setTitle("文件flash分布饼图");
|
||||
flash_chart->legend()->hide();
|
||||
// Set the theme to one of the predefined themes
|
||||
flash_chart->setTheme(QChart::ChartThemeQt);
|
||||
flash_chart->setBackgroundBrush(QBrush(Qt::gray));
|
||||
flash_chart->setTitleBrush(Qt::white);
|
||||
ram_chart->setTitleBrush(Qt::white);; // 数据集分类标题文字颜色
|
||||
flash_chart->addSeries(flash_pieseries);
|
||||
flash_chart->setTitle("文件flash分布饼图");
|
||||
flash_chart->legend()->hide();
|
||||
// Set the theme to one of the predefined themes
|
||||
flash_chart->setTheme(QChart::ChartThemeQt);
|
||||
flash_chart->setBackgroundBrush(QBrush(Qt::gray));
|
||||
flash_chart->setTitleBrush(Qt::white);
|
||||
|
||||
ui->ram_chart_view->setChart(ram_chart);
|
||||
ui->ram_chart_view->setRubberBand(QChartView::RectangleRubberBand);
|
||||
ui->ram_chart_view->setChart(ram_chart);
|
||||
ui->ram_chart_view->setRubberBand(QChartView::RectangleRubberBand);
|
||||
|
||||
ui->flash_chart_view->setChart(flash_chart);
|
||||
ui->flash_chart_view->setRubberBand(QChartView::RectangleRubberBand);
|
||||
ui->flash_chart_view->setChart(flash_chart);
|
||||
ui->flash_chart_view->setRubberBand(QChartView::RectangleRubberBand);
|
||||
|
||||
|
||||
if(map_path.length()>1&&project_path.length()>1)
|
||||
{
|
||||
if(map_path.length()>1&&project_path.length()>1)
|
||||
{
|
||||
cpu= new parse_keil_project(ui->project_path->text());
|
||||
if(cpu->to_parse_keil_project(ui->project_path->text()))
|
||||
{
|
||||
@ -149,9 +149,9 @@ if(map_path.length()>1&&project_path.length()>1)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
fflush(stdout);
|
||||
|
||||
}
|
||||
|
||||
@ -297,7 +297,7 @@ void MainWindow::on_update_info_clicked()
|
||||
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
fflush(stdout);
|
||||
|
||||
|
||||
}
|
||||
@ -315,7 +315,7 @@ void MainWindow::on_ram_table_itemSelectionChanged()
|
||||
}
|
||||
foreach (QTableWidgetItem* item, selectedItems) {
|
||||
int row = item->row();
|
||||
// qDebug() << row;
|
||||
// qDebug() << row;
|
||||
|
||||
QPieSlice *slice = ram_pieseries->slices().at(row);
|
||||
slice->setExploded();//突出这一块
|
||||
@ -339,7 +339,7 @@ void MainWindow::on_flash_table_itemSelectionChanged()
|
||||
}
|
||||
foreach (QTableWidgetItem* item, selectedItems) {
|
||||
int row = item->row();
|
||||
// qDebug() << row;
|
||||
// qDebug() << row;
|
||||
|
||||
QPieSlice *slice = flash_pieseries->slices().at(row);
|
||||
slice->setExploded();//突出这一块
|
||||
@ -437,7 +437,7 @@ void MainWindow::update_m51_info(void)
|
||||
ui->ram_used->setText(QString().sprintf("占用:%.2f B / (%.2f KB)",ram_all_used_size/1024.0,ram_all_max_size/10.0/1024.0));
|
||||
}
|
||||
|
||||
set_bar_style(ui->ram_used_bar,ram_all_used_size/1.0/ram_all_max_size/1.0);
|
||||
set_bar_style(ui->ram_used_bar,ram_all_used_size/1.0/ram_all_max_size/1.0);
|
||||
|
||||
for(i=0;i<m51->flash_list.size();i++)
|
||||
{
|
||||
@ -459,12 +459,12 @@ set_bar_style(ui->ram_used_bar,ram_all_used_size/1.0/ram_all_max_size/1.0);
|
||||
{
|
||||
ui->flash_used->setText(QString().sprintf("占用:%.2f B / (%.2f KB)",flash_all_used_size/1024.0,flash_all_max_size/10.0/1024.0));
|
||||
}
|
||||
set_bar_style(ui->flash_used_bar,ram_all_used_size/1.0/ram_all_max_size/1.0);
|
||||
set_bar_style(ui->flash_used_bar,ram_all_used_size/1.0/ram_all_max_size/1.0);
|
||||
|
||||
if(ui->ram_scrollArea->verticalScrollBar()!=nullptr)
|
||||
if(ui->ram_scrollArea->verticalScrollBar()!=nullptr)
|
||||
FlatUI::setScrollBarQss(ui->ram_scrollArea->verticalScrollBar(), 8, 120, 20, "##E5E5E5", "#D0D0D0", "#1ABC9C", "#E74C3C");
|
||||
if(ui->ram_scrollArea->verticalScrollBar()!=nullptr)
|
||||
FlatUI::setScrollBarQss(ui->flash_scrollArea->verticalScrollBar(), 8, 120, 20, "#E5E5E5", "#D0D0D0", "#1ABC9C", "#E74C3C");
|
||||
if(ui->ram_scrollArea->verticalScrollBar()!=nullptr)
|
||||
FlatUI::setScrollBarQss(ui->flash_scrollArea->verticalScrollBar(), 8, 120, 20, "#E5E5E5", "#D0D0D0", "#1ABC9C", "#E74C3C");
|
||||
|
||||
|
||||
}
|
||||
@ -513,23 +513,23 @@ void MainWindow::update_map_info(void)
|
||||
|
||||
|
||||
clearLayout(ui->ram_scrollAreaWidgetContents->layout());
|
||||
// // 移除并释放布局中的所有小部件
|
||||
// // 移除并释放布局中的所有小部件
|
||||
clearLayout(ui->flash_scrollAreaWidgetContents->layout());
|
||||
// // 移除并释放布局中的所有小部件
|
||||
for(uint64_t row_cnt=0;row_cnt<ui->ram_table->rowCount();row_cnt++)
|
||||
{
|
||||
// // 移除并释放布局中的所有小部件
|
||||
for(uint64_t row_cnt=0;row_cnt<ui->ram_table->rowCount();row_cnt++)
|
||||
{
|
||||
|
||||
ui->ram_table->removeRow(row_cnt);
|
||||
}
|
||||
}
|
||||
ui->ram_table->clear();
|
||||
ram_pieseries->clear();
|
||||
ram_pieseries->clear();
|
||||
|
||||
for(uint64_t row_cnt=0;row_cnt<ui->flash_table->rowCount();row_cnt++)
|
||||
{
|
||||
for(uint64_t row_cnt=0;row_cnt<ui->flash_table->rowCount();row_cnt++)
|
||||
{
|
||||
ui->flash_table->removeRow(row_cnt);
|
||||
}
|
||||
}
|
||||
ui->flash_table->clear();
|
||||
flash_pieseries->clear();
|
||||
flash_pieseries->clear();
|
||||
|
||||
|
||||
|
||||
@ -557,7 +557,7 @@ flash_pieseries->clear();
|
||||
ui->ram_used->setText(QString().sprintf("占用:%.4f MB / (%.4f MB)",ram_all_used_size/1024.0/1024.0,ram_all_max_size/1024.0/1024.0));
|
||||
}
|
||||
|
||||
set_bar_style(ui->ram_used_bar,ram_all_used_size/1.0/ram_all_max_size/1.0);
|
||||
set_bar_style(ui->ram_used_bar,ram_all_used_size/1.0/ram_all_max_size/1.0);
|
||||
|
||||
|
||||
for(i=0;i<map->flash_list.size();i++)
|
||||
@ -685,7 +685,7 @@ set_bar_style(ui->ram_used_bar,ram_all_used_size/1.0/ram_all_max_size/1.0);
|
||||
|
||||
|
||||
QString MainWindow::readTableData(ui_table_t table,int row, int column)
|
||||
{
|
||||
{
|
||||
QString data;
|
||||
QTableWidget* tableWidget ;
|
||||
if( table==ram_table)tableWidget=ui->ram_table;
|
||||
@ -695,15 +695,15 @@ QString MainWindow::readTableData(ui_table_t table,int row, int column)
|
||||
QTableWidgetItem *item =tableWidget->item(row, column);
|
||||
if (item) {
|
||||
data = item->text();
|
||||
// qDebug() << "Data at (" << row << ", " << column << "): " << data;
|
||||
// qDebug() << "Data at (" << row << ", " << column << "): " << data;
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::writeTableData(ui_table_t table,int row, int column, const QString &data)
|
||||
{
|
||||
void MainWindow::writeTableData(ui_table_t table,int row, int column, const QString &data)
|
||||
{
|
||||
|
||||
|
||||
QTableWidget* tableWidget=nullptr;
|
||||
@ -747,7 +747,7 @@ QString MainWindow::readTableData(ui_table_t table,int row, int column)
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -812,6 +812,11 @@ void MainWindow::on_btnMenu_Close_clicked()
|
||||
|
||||
void MainWindow::on_gitee_index_clicked()
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl("https://gitee.com/nikolan")); // Change the URL to the desired webpage
|
||||
QDesktopServices::openUrl(QUrl("https://gitee.com/nikolan"));
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_icon_clicked()
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl("https://gitee.com/nikolan/keil_development_assistant"));
|
||||
}
|
||||
|
27
mainwindow.h
27
mainwindow.h
@ -26,25 +26,25 @@ public:
|
||||
~MainWindow();
|
||||
void winow_on_top(bool is_top);
|
||||
void setPieSliceStyle(QPieSlice* slice, qreal percentage, qreal maxPercentage);
|
||||
void set_bar_style(QProgressBar *bar,float per);
|
||||
void update_cpu_info(void);
|
||||
void update_map_info(void);
|
||||
void update_m51_info(void);
|
||||
QString readTableData(ui_table_t table,int row, int column);
|
||||
void writeTableData(ui_table_t table,int row, int column, const QString &data);
|
||||
void map_calculate_size_by_address(parse_map_from_keil* map);
|
||||
Ui::MainWindow *ui;
|
||||
void set_bar_style(QProgressBar *bar,float per);
|
||||
void update_cpu_info(void);
|
||||
void update_map_info(void);
|
||||
void update_m51_info(void);
|
||||
QString readTableData(ui_table_t table,int row, int column);
|
||||
void writeTableData(ui_table_t table,int row, int column, const QString &data);
|
||||
void map_calculate_size_by_address(parse_map_from_keil* map);
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
QPieSeries *ram_pieseries=nullptr;
|
||||
QPieSeries *flash_pieseries=nullptr;
|
||||
QChart* ram_chart=nullptr;
|
||||
QChart* flash_chart=nullptr;
|
||||
QPieSeries *ram_pieseries=nullptr;
|
||||
QPieSeries *flash_pieseries=nullptr;
|
||||
QChart* ram_chart=nullptr;
|
||||
QChart* flash_chart=nullptr;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
void clearLayout(QLayout* layout);
|
||||
void clearLayout(QLayout* layout);
|
||||
parse_keil_project* cpu=nullptr;
|
||||
parse_map_from_keil* map=nullptr;
|
||||
parse_m51_from_keil* m51=nullptr;
|
||||
@ -64,6 +64,7 @@ private slots:
|
||||
void on_ram_table_itemSelectionChanged();
|
||||
void on_flash_table_itemSelectionChanged();
|
||||
void on_gitee_index_clicked();
|
||||
void on_icon_clicked();
|
||||
};
|
||||
extern MainWindow* main_window;
|
||||
#endif // MAINWINDOW_H
|
||||
|
@ -460,7 +460,7 @@ color: rgb(255, 255, 255);
|
||||
</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="bulid_info">
|
||||
<attribute name="title">
|
||||
|
@ -14,7 +14,7 @@
|
||||
QString parse_keil_project::find_project_path(const QString& dir_path)
|
||||
{
|
||||
|
||||
return find_path::find_file_path(dir_path,".uvproj");
|
||||
return find_path::find_file_path(dir_path,".uvproj");
|
||||
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ parse_keil_project::parse_keil_project(QString path)
|
||||
XRAM.setName("XRAM");
|
||||
IROM.setName("IROM");
|
||||
|
||||
// to_parse_keil_project(path);
|
||||
// to_parse_keil_project(path);
|
||||
|
||||
|
||||
|
||||
@ -157,7 +157,7 @@ bool parse_keil_project::parse_info_item_storage(const QString& info_item,use_pe
|
||||
}
|
||||
|
||||
|
||||
qDebug()<<QString().sprintf("%s base:%#x size:%.2f KB",storage.getName().toStdString().data(), storage.getBase_addr(),storage.getMax_size()/1024.0);
|
||||
qDebug()<<QString().sprintf("%s base:%#x size:%.2f KB",storage.getName().toStdString().data(), storage.getBase_addr(),storage.getMax_size()/1024.0);
|
||||
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ bool parse_keil_project::parse_cpu_info(const QString& cpu_info)
|
||||
|
||||
for(auto info_item:cpu_info_list)
|
||||
{
|
||||
// qDebug()<<info_item;
|
||||
// qDebug()<<info_item;
|
||||
if(info_item.contains("IRAM"))//包含"IRAM"字段
|
||||
{
|
||||
parse_info_item_storage(info_item,IRAM);
|
||||
@ -218,7 +218,7 @@ bool parse_keil_project::parse_project_file(QString path)
|
||||
|
||||
if(reader.isStartElement())
|
||||
{
|
||||
// qDebug()<<"<"<<reader.name();
|
||||
// qDebug()<<"<"<<reader.name();
|
||||
|
||||
if("Cpu"==reader.name())
|
||||
{
|
||||
@ -243,7 +243,7 @@ bool parse_keil_project::parse_project_file(QString path)
|
||||
}
|
||||
if(reader.isEndElement())
|
||||
{
|
||||
// qDebug()<<">"<<reader.name();
|
||||
// qDebug()<<">"<<reader.name();
|
||||
}
|
||||
|
||||
reader.readNext();
|
||||
|
@ -37,12 +37,12 @@ public:
|
||||
private:
|
||||
QString project_path;
|
||||
// uint64_t iram_base;
|
||||
// uint64_t xram_base;
|
||||
// uint64_t irom_base;
|
||||
// uint64_t iram_size;
|
||||
// uint64_t xram_size;
|
||||
// uint64_t irom_size;
|
||||
QString cpu_name;
|
||||
// uint64_t xram_base;
|
||||
// uint64_t irom_base;
|
||||
// uint64_t iram_size;
|
||||
// uint64_t xram_size;
|
||||
// uint64_t irom_size;
|
||||
QString cpu_name;
|
||||
QString cpu_core_name;
|
||||
uint64_t cpu_max_clock;
|
||||
|
||||
|
@ -12,9 +12,9 @@ parse_m51_from_keil::parse_m51_from_keil(QString path,uint64_t iram_max_size,uin
|
||||
uint64_t irom_max_size)
|
||||
{
|
||||
|
||||
iram_max=iram_max_size;
|
||||
xram_max=xram_max_size;
|
||||
irom_max=irom_max_size;
|
||||
iram_max=iram_max_size;
|
||||
xram_max=xram_max_size;
|
||||
irom_max=irom_max_size;
|
||||
|
||||
|
||||
}
|
||||
@ -24,7 +24,7 @@ bool parse_m51_from_keil::to_parse_m51_from_keil(QString path)
|
||||
|
||||
|
||||
QString file_path=find_m51_path(path);
|
||||
qDebug()<<file_path;
|
||||
qDebug()<<file_path;
|
||||
if(file_path.length()>3){
|
||||
|
||||
parse_m51_file(file_path);
|
||||
@ -83,7 +83,7 @@ bool parse_m51_from_keil::parse_m51_file(QString path)
|
||||
bool is_Image_component_sizes=false;
|
||||
bool is_Totals=false;
|
||||
|
||||
// info_list.clear();
|
||||
// info_list.clear();
|
||||
|
||||
for(auto ram:ram_list)
|
||||
{
|
||||
@ -114,14 +114,14 @@ bool parse_m51_from_keil::parse_m51_file(QString path)
|
||||
if(str.contains("Program Size"))
|
||||
{
|
||||
|
||||
// qDebug() << str;
|
||||
// parse_excution_region_info(str);
|
||||
// qDebug() << str;
|
||||
// parse_excution_region_info(str);
|
||||
|
||||
QStringList str_list= str.split(" ");
|
||||
|
||||
for(int i=0;i<str_list.length();i++)
|
||||
{
|
||||
// qDebug() << str_list[i];
|
||||
// qDebug() << str_list[i];
|
||||
if(str_list[i].contains("xdata"))
|
||||
{
|
||||
xram->setUsed_size((str_list[i].split("=")[1].toFloat())*10.0);
|
||||
@ -154,11 +154,11 @@ bool parse_m51_from_keil::parse_m51_file(QString path)
|
||||
|
||||
|
||||
}
|
||||
// else if(str.contains("Image component sizes"))
|
||||
// {
|
||||
// is_Image_component_sizes=true;
|
||||
//// qDebug()<<str;
|
||||
// }
|
||||
// else if(str.contains("Image component sizes"))
|
||||
// {
|
||||
// is_Image_component_sizes=true;
|
||||
//// qDebug()<<str;
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,14 +30,14 @@ QString parse_map_from_keil::find_map_path(const QString& dir_path)
|
||||
bool parse_map_from_keil::parse_excution_region_info(QString info_string)
|
||||
{
|
||||
|
||||
// storage_type_t storage=ram;
|
||||
// storage_type_t storage=ram;
|
||||
use_percentage_bar* storage=new use_percentage_bar(nullptr);
|
||||
storage->setStorage(flash);
|
||||
for(auto keyword:ram_keyword)
|
||||
{
|
||||
if(info_string.contains(keyword))
|
||||
{
|
||||
// qDebug()<<info_string;
|
||||
// qDebug()<<info_string;
|
||||
storage->setStorage(ram);
|
||||
}
|
||||
}
|
||||
@ -65,7 +65,7 @@ bool parse_map_from_keil::parse_excution_region_info(QString info_string)
|
||||
info_value =info.split(":");
|
||||
info_value[1].remove(QChar('x'), Qt::CaseInsensitive);//去除"x"
|
||||
storage->setBase_addr(info_value[1].toUInt(nullptr,16));
|
||||
// qDebug()<<info_value[1];
|
||||
// qDebug()<<info_value[1];
|
||||
|
||||
if(storage->getBase_addr()>iram_base&&storage->getBase_addr()<iram_base+iram_max_size)
|
||||
storage->setStorage(ram);
|
||||
@ -79,7 +79,7 @@ bool parse_map_from_keil::parse_excution_region_info(QString info_string)
|
||||
info_value[1].remove(QChar('x'), Qt::CaseInsensitive);//去除"x"
|
||||
|
||||
storage->setUsed_size(info_value[1].toUInt(nullptr,16));
|
||||
// qDebug()<<info_value[1];
|
||||
// qDebug()<<info_value[1];
|
||||
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ bool parse_map_from_keil::parse_excution_region_info(QString info_string)
|
||||
info_value =info.split(":");
|
||||
info_value[1].remove(QChar('x'), Qt::CaseInsensitive);//去除"x"
|
||||
storage->setMax_size(info_value[1].toUInt(nullptr,16));
|
||||
// qDebug()<<info_value[1];
|
||||
// qDebug()<<info_value[1];
|
||||
|
||||
}
|
||||
|
||||
@ -150,12 +150,12 @@ bool parse_map_from_keil::parse_map_file(QString path){
|
||||
if(str.contains("Execution Region"))
|
||||
{
|
||||
|
||||
// qDebug() << str;
|
||||
// qDebug() << str;
|
||||
parse_excution_region_info(str);
|
||||
}else if(str.contains("Image component sizes"))
|
||||
{
|
||||
is_Image_component_sizes=true;
|
||||
// qDebug()<<str;
|
||||
// qDebug()<<str;
|
||||
}
|
||||
|
||||
if(is_Image_component_sizes)
|
||||
@ -186,7 +186,7 @@ bool parse_map_from_keil::parse_map_file(QString path){
|
||||
QString csv_row = str.trimmed().replace(QRegExp("\\s+"), ",");
|
||||
csv_row+="\n";
|
||||
// 输出修改后的数据
|
||||
// qDebug() << csv_row;
|
||||
// qDebug() << csv_row;
|
||||
|
||||
QStringList item_data= csv_row.split(",");
|
||||
|
||||
@ -328,6 +328,6 @@ parse_map_from_keil::parse_map_from_keil(QString path, uint64_t to_iram_base,
|
||||
irom_base=to_irom_base;
|
||||
irom_max_size= to_irom_max_size;
|
||||
|
||||
//to_parse_map_from_keil(path);
|
||||
//to_parse_map_from_keil(path);
|
||||
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
uint64_t to_iram_max_size,
|
||||
uint64_t to_irom_base,
|
||||
uint64_t to_irom_max_size
|
||||
);
|
||||
);
|
||||
QString find_map_path(const QString& dir_path);
|
||||
bool parse_excution_region_info(QString info_string);
|
||||
bool parse_map_file(QString path);
|
||||
@ -63,7 +63,7 @@ private:
|
||||
|
||||
uint64_t all_ram_size=0;
|
||||
uint64_t all_flash_size=0;
|
||||
//,"HEAP","STACK","heap","stack"
|
||||
//,"HEAP","STACK","heap","stack"
|
||||
QList<QString> ram_keyword={"ER$$","RW_","ER_RW","ER_ZI"};
|
||||
QList<QString> flash_keyword={"RO","FLASH","flash","ro","text","TEXT"};
|
||||
|
||||
|
@ -37,11 +37,11 @@ use_percentage_bar::~use_percentage_bar()
|
||||
void use_percentage_bar::print_bar_8051(void)
|
||||
{
|
||||
|
||||
if(max_size==0)
|
||||
{
|
||||
if(max_size==0)
|
||||
{
|
||||
qDebug()<<"erro:max=0";
|
||||
return;
|
||||
}
|
||||
}
|
||||
uint8_t i;
|
||||
QString bar_str;
|
||||
qDebug()<<name<<":0";//<<QString().sprintf("%#x",base_addr);
|
||||
@ -82,7 +82,7 @@ if(max_size==0)
|
||||
|
||||
|
||||
bar_str+=QString().sprintf(" [%u B]", max_size/10.0 - used_size/10.0);
|
||||
qDebug()<< bar_str;
|
||||
qDebug()<< bar_str;
|
||||
|
||||
}
|
||||
void use_percentage_bar::print_bar(void)
|
||||
@ -127,7 +127,7 @@ void use_percentage_bar::print_bar(void)
|
||||
|
||||
|
||||
bar_str+=QString().sprintf(" [%u B]", max_size - used_size);
|
||||
qDebug()<< bar_str;
|
||||
qDebug()<< bar_str;
|
||||
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ void use_percentage_bar::setUsed_size(const uint64_t &value)
|
||||
}
|
||||
setRemain_size(max_size-used_size);
|
||||
}
|
||||
set_bar_style(ui->used_bar,used_size/1.0/max_size/1.0);
|
||||
set_bar_style(ui->used_bar,used_size/1.0/max_size/1.0);
|
||||
|
||||
|
||||
}
|
||||
@ -275,7 +275,7 @@ void use_percentage_bar::setMax_size(const uint64_t &value)
|
||||
}
|
||||
setRemain_size(max_size-used_size);
|
||||
}
|
||||
set_bar_style(ui->used_bar,used_size/1.0/max_size/1.0);
|
||||
set_bar_style(ui->used_bar,used_size/1.0/max_size/1.0);
|
||||
|
||||
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ public:
|
||||
|
||||
|
||||
void print_bar(void);
|
||||
void print_bar_8051(void);
|
||||
void print_bar_8051(void);
|
||||
|
||||
QString getName() const;
|
||||
void setName(const QString &value);
|
||||
@ -55,7 +55,7 @@ private:
|
||||
uint64_t used_size;
|
||||
uint64_t max_size;
|
||||
uint64_t remain_size;
|
||||
void set_bar_style(QProgressBar *bar,float per);
|
||||
void set_bar_style(QProgressBar *bar,float per);
|
||||
};
|
||||
|
||||
#endif // USE_PERCENTAGE_BAR_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user