Skip to content

Commit

Permalink
fix stuck
Browse files Browse the repository at this point in the history
Signed-off-by: huangziyi <huangziyi@canaan-creative.com>
  • Loading branch information
MrThanlon committed Dec 10, 2024
1 parent 9e4c968 commit 089cd78
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 37 deletions.
4 changes: 2 additions & 2 deletions share/qtcreator/translations/qtcreator_zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7541,8 +7541,8 @@ Would you like to register your OpenMV Cam now?</source>
</message>
<message>
<location line="+16"/>
<source>Installation Sucessful! Please restart OpenMV IDE.</source>
<translation>安装成功!请重新启动OpenMV IDE。</translation>
<source>Installation Sucessful! Please restart CanMV IDE.</source>
<translation>安装成功!请重新启动CanMV IDE。</translation>
</message>
<message>
<location line="+10"/>
Expand Down
38 changes: 19 additions & 19 deletions src/plugins/openmv/openmvplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4035,25 +4035,25 @@ void OpenMVPlugin::setPortPath(bool silent)
{
QStringList drives;

foreach(const QStorageInfo &info, QStorageInfo::mountedVolumes())
{
if(info.isValid()
&& info.isReady()
&& (!info.isRoot())
&& (!info.isReadOnly())
&& (QString::fromUtf8(info.fileSystemType()).contains(QStringLiteral("fat"), Qt::CaseInsensitive) || QString::fromUtf8(info.fileSystemType()).contains(QStringLiteral("msdos"), Qt::CaseInsensitive) || QString::fromUtf8(info.fileSystemType()).contains(QStringLiteral("fuseblk"), Qt::CaseInsensitive))
&& ((!Utils::HostOsInfo::isMacHost()) || info.rootPath().startsWith(QStringLiteral("/volumes/"), Qt::CaseInsensitive))
&& ((!Utils::HostOsInfo::isLinuxHost()) || info.rootPath().startsWith(QStringLiteral("/media/"), Qt::CaseInsensitive) || info.rootPath().startsWith(QStringLiteral("/mnt/"), Qt::CaseInsensitive) || info.rootPath().startsWith(QStringLiteral("/run/"), Qt::CaseInsensitive)))
{
if(((m_major < OPENMV_DISK_ADDED_MAJOR)
|| ((m_major == OPENMV_DISK_ADDED_MAJOR) && (m_minor < OPENMV_DISK_ADDED_MINOR))
|| ((m_major == OPENMV_DISK_ADDED_MAJOR) && (m_minor == OPENMV_DISK_ADDED_MINOR) && (m_patch < OPENMV_DISK_ADDED_PATCH)))
|| QFile::exists(info.rootPath() + QStringLiteral(OPENMV_DISK_ADDED_NAME)))
{
drives.append(info.rootPath());
}
}
}
// foreach(const QStorageInfo &info, QStorageInfo::mountedVolumes())
// {
// if(info.isValid()
// && info.isReady()
// && (!info.isRoot())
// && (!info.isReadOnly())
// && (QString::fromUtf8(info.fileSystemType()).contains(QStringLiteral("fat"), Qt::CaseInsensitive) || QString::fromUtf8(info.fileSystemType()).contains(QStringLiteral("msdos"), Qt::CaseInsensitive) || QString::fromUtf8(info.fileSystemType()).contains(QStringLiteral("fuseblk"), Qt::CaseInsensitive))
// && ((!Utils::HostOsInfo::isMacHost()) || info.rootPath().startsWith(QStringLiteral("/volumes/"), Qt::CaseInsensitive))
// && ((!Utils::HostOsInfo::isLinuxHost()) || info.rootPath().startsWith(QStringLiteral("/media/"), Qt::CaseInsensitive) || info.rootPath().startsWith(QStringLiteral("/mnt/"), Qt::CaseInsensitive) || info.rootPath().startsWith(QStringLiteral("/run/"), Qt::CaseInsensitive)))
// {
// if(((m_major < OPENMV_DISK_ADDED_MAJOR)
// || ((m_major == OPENMV_DISK_ADDED_MAJOR) && (m_minor < OPENMV_DISK_ADDED_MINOR))
// || ((m_major == OPENMV_DISK_ADDED_MAJOR) && (m_minor == OPENMV_DISK_ADDED_MINOR) && (m_patch < OPENMV_DISK_ADDED_PATCH)))
// || QFile::exists(info.rootPath() + QStringLiteral(OPENMV_DISK_ADDED_NAME)))
// {
// drives.append(info.rootPath());
// }
// }
// }

QSettings *settings = ExtensionSystem::PluginManager::settings();
settings->beginGroup(QStringLiteral(SERIAL_PORT_SETTINGS_GROUP));
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/openmv/openmvplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,8 @@ public slots: // private
OpenMVPluginHistogram *m_histogram;

Utils::ElidingLabel *m_boardLabel;
Utils::ElidingLabel *m_sensorLabel;
Utils::ElidingToolButton *m_versionButton;
Utils::ElidingLabel *m_portLabel;
Utils::ElidingToolButton *m_pathButton;
Utils::ElidingLabel *m_fpsLabel;

///////////////////////////////////////////////////////////////////////////
Expand Down
19 changes: 6 additions & 13 deletions src/plugins/openmv/openmvpluginconnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void OpenMVPlugin::packageUpdate()
{
QMessageBox::critical(Core::ICore::dialogParent(),
QString(),
error + Tr::tr("\n\nPlease close any programs that are viewing/editing OpenMV IDE's application data and then restart CanMV IDE!"));
error + Tr::tr("\n\nPlease close any programs that are viewing/editing CanMV IDE's application data and then restart CanMV IDE!"));

QApplication::quit();
ok = false;
Expand All @@ -125,7 +125,7 @@ void OpenMVPlugin::packageUpdate()
{
QMessageBox::critical(Core::ICore::dialogParent(),
QString(),
Tr::tr("Please close any programs that are viewing/editing OpenMV IDE's application data and then restart CanMV IDE!"));
Tr::tr("Please close any programs that are viewing/editing CanMV IDE's application data and then restart CanMV IDE!"));

QApplication::quit();
ok = false;
Expand All @@ -141,7 +141,7 @@ void OpenMVPlugin::packageUpdate()

QMessageBox::information(Core::ICore::dialogParent(),
QString(),
Tr::tr("Installation Sucessful! Please restart OpenMV IDE."));
Tr::tr("Installation Sucessful! Please restart CanMV IDE."));

Core::ICore::restart();
}
Expand Down Expand Up @@ -3229,9 +3229,9 @@ void OpenMVPlugin::connectClicked(bool forceBootloader, QString forceFirmwarePat

QString boardTypeLabel = Tr::tr("Unknown");

if(((major2 > OLD_API_MAJOR)
/*if(((major2 > OLD_API_MAJOR)
|| ((major2 == OLD_API_MAJOR) && (minor2 > OLD_API_MINOR))
|| ((major2 == OLD_API_MAJOR) && (minor2 == OLD_API_MINOR) && (patch2 >= OLD_API_PATCH))))
|| ((major2 == OLD_API_MAJOR) && (minor2 == OLD_API_MINOR) && (patch2 >= OLD_API_PATCH)))) */
{
QString arch2 = QString();
QString *arch2Ptr = &arch2;
Expand Down Expand Up @@ -3502,14 +3502,10 @@ void OpenMVPlugin::connectClicked(bool forceBootloader, QString forceFirmwarePat

m_boardLabel->setEnabled(true);
m_boardLabel->setText(Tr::tr("Board: %L1").arg(boardTypeLabel));
m_sensorLabel->setEnabled(true);
m_sensorLabel->setText(Tr::tr("Sensor: %L1").arg(m_sensorType));
m_versionButton->setEnabled(true);
m_versionButton->setText(Tr::tr("Firmware Version: %L1.%L2.%L3").arg(major2).arg(minor2).arg(patch2));
m_portLabel->setEnabled(true);
m_portLabel->setText(Tr::tr("Serial Port: %L1").arg(m_portName));
m_pathButton->setEnabled(true);
m_pathButton->setText(Tr::tr("Drive:"));
m_fpsLabel->setEnabled(true);
m_fpsLabel->setText(Tr::tr("FPS: 0"));

Expand Down Expand Up @@ -3763,14 +3759,10 @@ void OpenMVPlugin::disconnectClicked(bool reset)

m_boardLabel->setDisabled(true);
m_boardLabel->setText(Tr::tr("Board:"));
m_sensorLabel->setDisabled(true);
m_sensorLabel->setText(Tr::tr("Sensor:"));
m_versionButton->setDisabled(true);
m_versionButton->setText(Tr::tr("Firmware Version:"));
m_portLabel->setDisabled(true);
m_portLabel->setText(Tr::tr("Serial Port:"));
m_pathButton->setDisabled(true);
m_pathButton->setText(Tr::tr("Drive:"));
m_fpsLabel->setDisabled(true);
m_fpsLabel->setText(Tr::tr("FPS:"));

Expand Down Expand Up @@ -4007,6 +3999,7 @@ void OpenMVPlugin::stopClicked()
///////////////////////////////////////////////////////////////////////

m_fpsLabel->setText(Tr::tr("FPS: 0"));
m_frameBuffer->rotation = 0;

///////////////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/openmv/openmvpluginfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class OpenMVPluginFB : public QGraphicsView
bool beginImageWriter();
void endImageWriter();
void enableInteraction(bool enable) { m_enableInteraction = enable; }
qreal rotation;

public slots:

Expand Down Expand Up @@ -69,7 +70,6 @@ public slots:
QElapsedTimer m_elaspedTimer;
QQueue<qint64> m_previousElaspedTimers;

qreal rotation;
};

} // namespace Internal
Expand Down

0 comments on commit 089cd78

Please sign in to comment.