Skip to content

Commit

Permalink
Rearranged UI to make it easier to find dev tools. Also gived them mo…
Browse files Browse the repository at this point in the history
…re vertical space.
  • Loading branch information
vedderb committed Oct 9, 2023
1 parent 32c8317 commit 8587c6e
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 28 deletions.
3 changes: 3 additions & 0 deletions display_tool/dispeditor.ui
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
Expand Down
36 changes: 17 additions & 19 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1574,39 +1574,41 @@ void MainWindow::reloadPages()
ui->pageWidget->addWidget(mPageLogAnalysis);
addPageItem(tr("Log Analysis"), theme + "icons/Waypoint Map-96.png", "", false, true);

mPageVESCDev = new QTabWidget(this);
mPageVESCDev->setTabShape(QTabWidget::Triangular);
VTextBrowser *vt = new VTextBrowser(this);
ConfigParam *p = mVesc->infoConfig()->getParam("dev_tools_description");
if (p) {
vt->setText(p->description);
}
ui->pageWidget->addWidget(vt);
addPageItem(tr("VESC Dev Tools"), theme + "icons/v_icon-96.png", "", true);

mPageTerminal = new PageTerminal(this);
mPageTerminal->setVesc(mVesc);
ui->pageWidget->addWidget(mPageTerminal);
mPageVESCDev->addTab(mPageTerminal, Utility::getIcon("icons/Console-96.png"), tr("VESC Terminal"));
addPageItem(tr("Terminal"), theme + "icons/Console-96.png", "", false, true);

mPageScripting = new PageScripting(this);
mPageScripting->setVesc(mVesc);
ui->pageWidget->addWidget(mPageScripting);
mPageVESCDev->addTab(mPageScripting, Utility::getIcon("icons_textedit/Outdent-96.png"), tr("QML"));
addPageItem(tr("QML Scripting"), theme + "icons_textedit/Outdent-96.png", "", false, true);

mPageLisp = new PageLisp(this);
mPageLisp->setVesc(mVesc);
ui->pageWidget->addWidget(mPageLisp);
mPageVESCDev->addTab(mPageLisp, Utility::getIcon("icons_textedit/Outdent-96.png"), tr("Lisp"));
addPageItem(tr("LispBM Scripting"), theme + "icons_textedit/Outdent-96.png", "", false, true);

mPageCanAnalyzer = new PageCanAnalyzer(this);
mPageCanAnalyzer->setVesc(mVesc);
ui->pageWidget->addWidget(mPageCanAnalyzer);
mPageVESCDev->addTab(mPageCanAnalyzer, Utility::getIcon("icons/can_off.png"), tr("CAN Analyzer"));
addPageItem(tr("CAN Analyzer"), theme + "icons/can_off.png", "", false, true);

mPageDisplayTool = new PageDisplayTool(this);
ui->pageWidget->addWidget(mPageDisplayTool);
mPageVESCDev->addTab(mPageDisplayTool, Utility::getIcon("icons/Calculator-96.png"), tr("Display Tool"));
addPageItem(tr("Display Tool"), theme + "icons/Calculator-96.png", "", false, true);

mPageDebugPrint = new PageDebugPrint(this);
ui->pageWidget->addWidget(mPageDebugPrint);
mPageVESCDev->addTab(mPageDebugPrint, Utility::getIcon("icons/Bug-96.png"), tr("Debug Console"));

ui->pageWidget->addWidget(mPageVESCDev);
addPageItem(tr("VESC Dev Tools"), theme + "icons/Console-96.png", "", true);
addPageItem(tr("Debug Console"), theme + "icons/Bug-96.png", "", false, true);

mPageSwdProg = new PageSwdProg(this);
mPageSwdProg->setVesc(mVesc);
Expand Down Expand Up @@ -1883,29 +1885,25 @@ void MainWindow::on_actionSaveAppConfigurationHeaderWrap_triggered()
void MainWindow::on_actionTerminalPrintFaults_triggered()
{
mVesc->commands()->sendTerminalCmd("faults");
showPage("VESC Dev Tools");
mPageVESCDev->setCurrentIndex(0);
showPage("Terminal");
}

void MainWindow::on_actionTerminalShowHelp_triggered()
{
mVesc->commands()->sendTerminalCmd("help");
showPage("VESC Dev Tools");
mPageVESCDev->setCurrentIndex(0);
showPage("Terminal");
}

void MainWindow::on_actionTerminalClear_triggered()
{
mPageTerminal->clearTerminal();
showPage("VESC Dev Tools");
mPageVESCDev->setCurrentIndex(0);
showPage("Terminal");
}

void MainWindow::on_actionTerminalPrintThreads_triggered()
{
mVesc->commands()->sendTerminalCmd("threads");
showPage("VESC Dev Tools");
mPageVESCDev->setCurrentIndex(0);
showPage("Terminal");
}

void MainWindow::on_actionTerminalDRVResetLatchedFaults_triggered()
Expand Down
1 change: 0 additions & 1 deletion mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ private slots:
PageScripting *mPageScripting;
PageLisp *mPageLisp;
PageEspProg *mPageEspProg;
QTabWidget *mPageVESCDev;
PageDisplayTool *mPageDisplayTool;
Preferences *mPreferences;

Expand Down
10 changes: 3 additions & 7 deletions pages/pageappsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,14 @@ void PageAppSettings::reloadParams()
QStringList imgs = {"app_up", "app_default" , "app_down","Upload-96","Data Backup-96","Help-96"};
QString theme = "<img src=\"" + Utility::getThemePath() + "icons/";
QString out;
if(imgs.length() > htmls.length()/2 - 1)
{
for(int i =0; i < htmls.length()-1; i+=2)
{
if(imgs.length() > htmls.length()/2 - 1) {
for(int i =0; i < htmls.length()-1; i+=2) {
out.append(htmls[i] + theme + imgs[i/2]);
out.append(".png\" width=");
}
out.append(htmls.last());
ui->textEdit->setHtml(out);
}
else
{
} else {
ui->textEdit->setHtml(p->description);
}
} else {
Expand Down
3 changes: 3 additions & 0 deletions pages/pagedisplaytool.ui
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
Expand Down
2 changes: 1 addition & 1 deletion pages/pagelisp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ PageLisp::PageLisp(QWidget *parent) :
removeEditor(mainEditor);
});

ui->splitter->setSizes(QList<int>({1000, 600}));
ui->splitter->setSizes(QList<int>({1000, 100}));
ui->splitter_2->setSizes(QList<int>({1000, 600}));

mPollTimer.start(1000 / ui->pollRateBox->value());
Expand Down
30 changes: 30 additions & 0 deletions res/config/6.05/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,36 @@ X+zYP8lfgOHlZEKN7DBYwAAAABJRU5ErkJggg==&quot; width=&quot;20&quot; height=&quot;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Notice that uploading new firmware to the VESC will reset all its settings to their default values for that firmware. This means that after uploading firmware to the VESC you have to perform the app configuration again.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description>
<cDefine></cDefine>
</app_setting_description>
<dev_tools_description>
<longName> Development Tool Description</longName>
<type>0</type>
<transmittable>1</transmittable>
<description>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Roboto'; ; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; ; font-weight:600;&quot;&gt;VESC Development Tools&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ; font-weight:600;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Terminal&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This is a text command interface to some advanced and debug-functions of the hardware. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Qml Scripting&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Qml is an extension of javascript that is used to make mobile applications in Qt. The mobile version of VESC Tool as well as the wizards in the desktop version are written in Qml. The Qml-editor in VESC Tool can be used to write custom user interface pages that are loaded and run in VESC Tool. There are many examples available that can be used as a starting point.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Lisp Scripting&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The VESC motor control firmware as well as the VESC Express firmware have a built-in version of LispBM, which is a modern embedded scripting language based on lisp. Code written in LispBM runs directly on the hardware and can be used for custom functionality not covered by the basic applications. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;CAN Analyzer&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Simple CAN-bus tool that can read and send messages on the CAN-bus. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Display Tool&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Graphic and font generation tool for displays supported by the VESC display driver, which is part of the Express firmware. &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Debug Console&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Debug messages from VESC Tool are printed here. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description>
<cDefine></cDefine>
</dev_tools_description>
<data_analysis_description>
<longName>Data Analysis Description</longName>
<type>0</type>
Expand Down

0 comments on commit 8587c6e

Please sign in to comment.