1、实现了光谱仪简单的采集功能:曝光、调焦、暗电流、采集影像、保存影像;
2、设置光谱仪帧率、曝光时间、gain; 3、在页面中嵌入了rgb相机图传(通过opencv实现); 4、平台的相机位置模拟、x/y马达的分别控制、x/y马达的量程检测; 5、轨迹规划; 6、加入了张卓的自动调焦模块; 7、加入了自动电源控制;
This commit is contained in:
401
.gitignore
vendored
Normal file
401
.gitignore
vendored
Normal file
@ -0,0 +1,401 @@
|
|||||||
|
# tc
|
||||||
|
GeneratedFiles/
|
||||||
|
|
||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
##
|
||||||
|
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.rsuser
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.userosscache
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
|
*.userprefs
|
||||||
|
|
||||||
|
# Mono auto generated files
|
||||||
|
mono_crash.*
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
[Dd]ebug/
|
||||||
|
[Dd]ebugPublic/
|
||||||
|
[Rr]elease/
|
||||||
|
[Rr]eleases/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
[Ww][Ii][Nn]32/
|
||||||
|
[Aa][Rr][Mm]/
|
||||||
|
[Aa][Rr][Mm]64/
|
||||||
|
bld/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Ll]og/
|
||||||
|
[Ll]ogs/
|
||||||
|
|
||||||
|
# Visual Studio 2015/2017 cache/options directory
|
||||||
|
.vs/
|
||||||
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
|
#wwwroot/
|
||||||
|
|
||||||
|
# Visual Studio 2017 auto generated files
|
||||||
|
Generated\ Files/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
# NUnit
|
||||||
|
*.VisualState.xml
|
||||||
|
TestResult.xml
|
||||||
|
nunit-*.xml
|
||||||
|
|
||||||
|
# Build Results of an ATL Project
|
||||||
|
[Dd]ebugPS/
|
||||||
|
[Rr]eleasePS/
|
||||||
|
dlldata.c
|
||||||
|
|
||||||
|
# Benchmark Results
|
||||||
|
BenchmarkDotNet.Artifacts/
|
||||||
|
|
||||||
|
# .NET Core
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
|
||||||
|
# ASP.NET Scaffolding
|
||||||
|
ScaffoldingReadMe.txt
|
||||||
|
|
||||||
|
# StyleCop
|
||||||
|
StyleCopReport.xml
|
||||||
|
|
||||||
|
# Files built by Visual Studio
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*_h.h
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.iobj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.ipdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*_wpftmp.csproj
|
||||||
|
*.log
|
||||||
|
*.tlog
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.svclog
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Chutzpah Test files
|
||||||
|
_Chutzpah*
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opendb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
*.VC.db
|
||||||
|
*.VC.VC.opendb
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
*.sap
|
||||||
|
|
||||||
|
# Visual Studio Trace Files
|
||||||
|
*.e2e
|
||||||
|
|
||||||
|
# TFS 2012 Local Workspace
|
||||||
|
$tf/
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
*.DotSettings.user
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# AxoCover is a Code Coverage Tool
|
||||||
|
.axoCover/*
|
||||||
|
!.axoCover/settings.json
|
||||||
|
|
||||||
|
# Coverlet is a free, cross platform Code Coverage Tool
|
||||||
|
coverage*.json
|
||||||
|
coverage*.xml
|
||||||
|
coverage*.info
|
||||||
|
|
||||||
|
# Visual Studio code coverage results
|
||||||
|
*.coverage
|
||||||
|
*.coveragexml
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
_NCrunch_*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
nCrunchTemp_*
|
||||||
|
|
||||||
|
# MightyMoose
|
||||||
|
*.mm.*
|
||||||
|
AutoTest.Net/
|
||||||
|
|
||||||
|
# Web workbench (sass)
|
||||||
|
.sass-cache/
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.azurePubxml
|
||||||
|
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||||
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
|
*.pubxml
|
||||||
|
*.publishproj
|
||||||
|
|
||||||
|
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||||
|
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||||
|
# in these scripts will be unencrypted
|
||||||
|
PublishScripts/
|
||||||
|
|
||||||
|
# NuGet Packages
|
||||||
|
*.nupkg
|
||||||
|
# NuGet Symbol Packages
|
||||||
|
*.snupkg
|
||||||
|
# The packages folder can be ignored because of Package Restore
|
||||||
|
**/[Pp]ackages/*
|
||||||
|
# except build/, which is used as an MSBuild target.
|
||||||
|
!**/[Pp]ackages/build/
|
||||||
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
|
#!**/[Pp]ackages/repositories.config
|
||||||
|
# NuGet v3's project.json files produces more ignorable files
|
||||||
|
*.nuget.props
|
||||||
|
*.nuget.targets
|
||||||
|
|
||||||
|
# Microsoft Azure Build Output
|
||||||
|
csx/
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Microsoft Azure Emulator
|
||||||
|
ecf/
|
||||||
|
rcf/
|
||||||
|
|
||||||
|
# Windows Store app package directories and files
|
||||||
|
AppPackages/
|
||||||
|
BundleArtifacts/
|
||||||
|
Package.StoreAssociation.xml
|
||||||
|
_pkginfo.txt
|
||||||
|
*.appx
|
||||||
|
*.appxbundle
|
||||||
|
*.appxupload
|
||||||
|
|
||||||
|
# Visual Studio cache files
|
||||||
|
# files ending in .cache can be ignored
|
||||||
|
*.[Cc]ache
|
||||||
|
# but keep track of directories ending in .cache
|
||||||
|
!?*.[Cc]ache/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
ClientBin/
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.dbproj.schemaview
|
||||||
|
*.jfm
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
orleans.codegen.cs
|
||||||
|
|
||||||
|
# Including strong name files can present a security risk
|
||||||
|
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||||
|
#*.snk
|
||||||
|
|
||||||
|
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||||
|
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||||
|
#bower_components/
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file
|
||||||
|
# to a newer Visual Studio version. Backup files are not needed,
|
||||||
|
# because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
ServiceFabricBackup/
|
||||||
|
*.rptproj.bak
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
*.mdf
|
||||||
|
*.ldf
|
||||||
|
*.ndf
|
||||||
|
|
||||||
|
# Business Intelligence projects
|
||||||
|
*.rdl.data
|
||||||
|
*.bim.layout
|
||||||
|
*.bim_*.settings
|
||||||
|
*.rptproj.rsuser
|
||||||
|
*- [Bb]ackup.rdl
|
||||||
|
*- [Bb]ackup ([0-9]).rdl
|
||||||
|
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||||
|
|
||||||
|
# Microsoft Fakes
|
||||||
|
FakesAssemblies/
|
||||||
|
|
||||||
|
# GhostDoc plugin setting file
|
||||||
|
*.GhostDoc.xml
|
||||||
|
|
||||||
|
# Node.js Tools for Visual Studio
|
||||||
|
.ntvs_analysis.dat
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Visual Studio 6 build log
|
||||||
|
*.plg
|
||||||
|
|
||||||
|
# Visual Studio 6 workspace options file
|
||||||
|
*.opt
|
||||||
|
|
||||||
|
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||||
|
*.vbw
|
||||||
|
|
||||||
|
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
|
||||||
|
*.vbp
|
||||||
|
|
||||||
|
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
|
||||||
|
*.dsw
|
||||||
|
*.dsp
|
||||||
|
|
||||||
|
# Visual Studio 6 technical files
|
||||||
|
*.ncb
|
||||||
|
*.aps
|
||||||
|
|
||||||
|
# Visual Studio LightSwitch build output
|
||||||
|
**/*.HTMLClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/ModelManifest.xml
|
||||||
|
**/*.Server/GeneratedArtifacts
|
||||||
|
**/*.Server/ModelManifest.xml
|
||||||
|
_Pvt_Extensions
|
||||||
|
|
||||||
|
# Paket dependency manager
|
||||||
|
.paket/paket.exe
|
||||||
|
paket-files/
|
||||||
|
|
||||||
|
# FAKE - F# Make
|
||||||
|
.fake/
|
||||||
|
|
||||||
|
# CodeRush personal settings
|
||||||
|
.cr/personal
|
||||||
|
|
||||||
|
# Python Tools for Visual Studio (PTVS)
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Cake - Uncomment if you are using it
|
||||||
|
# tools/**
|
||||||
|
# !tools/packages.config
|
||||||
|
|
||||||
|
# Tabs Studio
|
||||||
|
*.tss
|
||||||
|
|
||||||
|
# Telerik's JustMock configuration file
|
||||||
|
*.jmconfig
|
||||||
|
|
||||||
|
# BizTalk build output
|
||||||
|
*.btp.cs
|
||||||
|
*.btm.cs
|
||||||
|
*.odx.cs
|
||||||
|
*.xsd.cs
|
||||||
|
|
||||||
|
# OpenCover UI analysis results
|
||||||
|
OpenCover/
|
||||||
|
|
||||||
|
# Azure Stream Analytics local run output
|
||||||
|
ASALocalRun/
|
||||||
|
|
||||||
|
# MSBuild Binary and Structured Log
|
||||||
|
*.binlog
|
||||||
|
|
||||||
|
# NVidia Nsight GPU debugger configuration file
|
||||||
|
*.nvuser
|
||||||
|
|
||||||
|
# MFractors (Xamarin productivity tool) working folder
|
||||||
|
.mfractor/
|
||||||
|
|
||||||
|
# Local History for Visual Studio
|
||||||
|
.localhistory/
|
||||||
|
|
||||||
|
# Visual Studio History (VSHistory) files
|
||||||
|
.vshistory/
|
||||||
|
|
||||||
|
# BeatPulse healthcheck temp database
|
||||||
|
healthchecksdb
|
||||||
|
|
||||||
|
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||||
|
MigrationBackup/
|
||||||
|
|
||||||
|
# Ionide (cross platform F# VS Code tools) working folder
|
||||||
|
.ionide/
|
||||||
|
|
||||||
|
# Fody - auto-generated XML schema
|
||||||
|
FodyWeavers.xsd
|
||||||
|
|
||||||
|
# VS Code files for those working on multiple tools
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
*.code-workspace
|
||||||
|
|
||||||
|
# Local History for Visual Studio Code
|
||||||
|
.history/
|
||||||
|
|
||||||
|
# Windows Installer files from build outputs
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msix
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# JetBrains Rider
|
||||||
|
*.sln.iml
|
||||||
25
HPPA.sln
Normal file
25
HPPA.sln
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 15
|
||||||
|
VisualStudioVersion = 15.0.28307.1267
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HPPA", "HPPA\HPPA.vcxproj", "{E7886664-B69E-4781-BCBE-804574FB4033}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{E7886664-B69E-4781-BCBE-804574FB4033}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{E7886664-B69E-4781-BCBE-804574FB4033}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{E7886664-B69E-4781-BCBE-804574FB4033}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{E7886664-B69E-4781-BCBE-804574FB4033}.Release|x64.Build.0 = Release|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {FE57463D-FBEC-4B67-B97A-695B244BC71C}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
183
HPPA/FocusDialog.ui
Normal file
183
HPPA/FocusDialog.ui
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>focusDialog</class>
|
||||||
|
<widget class="QDialog" name="focusDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>453</width>
|
||||||
|
<height>339</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Dialog</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="HPPA.qrc">
|
||||||
|
<normaloff>:/HPPA/HPPA.ico</normaloff>:/HPPA/HPPA.ico</iconset>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<item row="0" column="0" rowspan="2">
|
||||||
|
<widget class="QGroupBox" name="connectFocusModule_groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>连接调焦模块</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>线性平台</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="motorPort_comboBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>超声</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QComboBox" name="ultrasoundPort_comboBox">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QRadioButton" name="ultrasound_radioButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>超声</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QPushButton" name="connectMotor_btn">
|
||||||
|
<property name="text">
|
||||||
|
<string>连接线性平台</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QGroupBox" name="controlMotor_groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>调整线性平台</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QPushButton" name="logicZero_btn">
|
||||||
|
<property name="text">
|
||||||
|
<string>LogicZero</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QPushButton" name="add_btn">
|
||||||
|
<property name="text">
|
||||||
|
<string>+</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QLineEdit" name="addStepSize_lineEdit">
|
||||||
|
<property name="text">
|
||||||
|
<string>50</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QPushButton" name="max_btn">
|
||||||
|
<property name="text">
|
||||||
|
<string>max</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QPushButton" name="subtract_btn">
|
||||||
|
<property name="text">
|
||||||
|
<string>-</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QLineEdit" name="subtractStepSize_lineEdit">
|
||||||
|
<property name="text">
|
||||||
|
<string>50</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QGroupBox" name="controlFocus_groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>调焦</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QProgressBar" name="autoFocusProgress_progressBar">
|
||||||
|
<property name="value">
|
||||||
|
<number>24</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QPushButton" name="autoFocus_btn">
|
||||||
|
<property name="text">
|
||||||
|
<string>自动调焦</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>171</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QPushButton" name="manualFocus_btn">
|
||||||
|
<property name="text">
|
||||||
|
<string>手动调焦</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="HPPA.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
1976
HPPA/HPPA.cpp
Normal file
1976
HPPA/HPPA.cpp
Normal file
File diff suppressed because it is too large
Load Diff
324
HPPA/HPPA.h
Normal file
324
HPPA/HPPA.h
Normal file
@ -0,0 +1,324 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
#include <iostream>
|
||||||
|
#include <exception>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <cmath>
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
|
#include <QtWidgets/QMainWindow>
|
||||||
|
#include <QThread>
|
||||||
|
#include <QLineSeries>
|
||||||
|
#include <QChart>
|
||||||
|
#include <QChartView>
|
||||||
|
#include <QFileDialog>
|
||||||
|
|
||||||
|
#include <QNetworkRequest>
|
||||||
|
#include <QNetworkReply>
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
|
|
||||||
|
#include "ui_HPPA.h"
|
||||||
|
#include "resononImager.h"
|
||||||
|
#include "ImageViewer.h"
|
||||||
|
#include "vincecontrol.h"
|
||||||
|
#include "ImagerPositionSimulation.h"
|
||||||
|
#include "fileOperation.h"
|
||||||
|
#include "RgbCameraOperation.h"
|
||||||
|
#include "imageProcessor.h"
|
||||||
|
|
||||||
|
#include "focusWindow.h"
|
||||||
|
|
||||||
|
#define PI 3.1415926
|
||||||
|
|
||||||
|
QT_CHARTS_USE_NAMESPACE//QChartView ʹ<><CAB9> <20><>Ҫ<EFBFBD>Ӻ꣬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
|
||||||
|
|
||||||
|
class WorkerThread : public QThread
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
ResononImager *m_Imager;
|
||||||
|
|
||||||
|
WorkerThread(ResononImager * Imager)
|
||||||
|
{
|
||||||
|
m_Imager = Imager;
|
||||||
|
}
|
||||||
|
|
||||||
|
//void run() override
|
||||||
|
//{
|
||||||
|
// while (true)
|
||||||
|
// {
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// //double x = m_Imager->get_framerate();
|
||||||
|
//
|
||||||
|
// //double x = m_Imager->m_ResononImager.get_framerate();
|
||||||
|
// int x = m_Imager->m_ResononImager.get_band_count();
|
||||||
|
|
||||||
|
// std::cout << "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>slopeΪ<65><CEAA>" << x << std::endl;
|
||||||
|
// }
|
||||||
|
// catch (std::runtime_error *e)//CException *e
|
||||||
|
// {
|
||||||
|
// std::cout << "<22><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ӣ<EFBFBD>" << e->what() << std::endl;
|
||||||
|
// }
|
||||||
|
// Sleep(1000);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// QString result;
|
||||||
|
// emit resultReady(result);
|
||||||
|
//}
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void resultReady(const QString &s);
|
||||||
|
};
|
||||||
|
|
||||||
|
class WorkerThread3 : public QThread
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
WorkerThread3(CFocusMotorControl * ctrlFocusMotor);
|
||||||
|
CFocusMotorControl *m_ctrlFocusMotor;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void run();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void AutoFocusFinishedSignal();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class myClocks : public QThread
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
myClocks(QObject *parent = 0);
|
||||||
|
public:
|
||||||
|
void setCallback(void(*func)(QString));
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void run();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::function<void(QString)> m_func;
|
||||||
|
signals:
|
||||||
|
void threadSignal(QString s);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class ForLoopControl :public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ForLoopControl();
|
||||||
|
~ForLoopControl();
|
||||||
|
|
||||||
|
void setLoopCount(int loopCount);
|
||||||
|
int getLoopCount() const;
|
||||||
|
|
||||||
|
bool m_boolRecordNextLine;
|
||||||
|
bool m_boolQuitLoop;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
int m_loopCount;
|
||||||
|
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void startLoop();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
//<2F><><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD>źţ<C5BA>
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>źŷ<C5BA><C5B7><EFBFBD><EFBFBD><EFBFBD>ֵʱ<D6B5><CAB1>intֵ<74><D6B5><EFBFBD><EFBFBD><EFBFBD>òɼ<C3B2><C9BC>ڼ<EFBFBD><DABC><EFBFBD><EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD>ˣ<EFBFBD>
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>źŷ<C5BA><C5B7>为ֵʱ<D6B5><CAB1>-1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>ֹ<EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>-2<><32><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>ֹ<EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
void recordSignal(int);
|
||||||
|
};
|
||||||
|
|
||||||
|
class HPPA : public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
HPPA(QWidget *parent = Q_NULLPTR);
|
||||||
|
~HPPA();
|
||||||
|
|
||||||
|
void CalculateIntegratioinTimeRange();//ͨ<><CDA8>֡<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>䷶Χ<E4B7B6><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>slider<65><72><EFBFBD><EFBFBD>ֵ
|
||||||
|
|
||||||
|
WorkerThread * m_TestImagerStausThread;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD>߳<EFBFBD>
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::HPPAClass ui;
|
||||||
|
QLineEdit * frame_number;
|
||||||
|
QLineEdit * m_FilenameLineEdit;
|
||||||
|
QLabel * xmotor_state_label1;
|
||||||
|
QLabel * ymotor_state_label1;
|
||||||
|
|
||||||
|
ForLoopControl * m_ForLoopControl;
|
||||||
|
ResononImager * m_Imager;//
|
||||||
|
|
||||||
|
int m_RecordState;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
QThread * m_ForLoopControlThread;//
|
||||||
|
QThread * m_RecordThread;//Ӱ<><D3B0><EFBFBD>ɼ<EFBFBD><C9BC>߳<EFBFBD>
|
||||||
|
QThread * m_RgbCameraThread;//rgb<67><62><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡͼ<C8A1><CDBC><EFBFBD>߳<EFBFBD>
|
||||||
|
QThread * m_CopyFileThread;//Ӱ<><D3B0><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
|
||||||
|
FileOperation * m_FileOperation;
|
||||||
|
|
||||||
|
QChartView * m_chartView;
|
||||||
|
|
||||||
|
//QLineSeries *series;
|
||||||
|
//QChart *chart;
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD>
|
||||||
|
VinceControl *m_yMotor;
|
||||||
|
VinceControl *m_xMotor;
|
||||||
|
|
||||||
|
long m_lXmotorLocationOfStartRecord;//<2F><>ʼ<EFBFBD>ɼ<EFBFBD>ǰx<C7B0><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
||||||
|
long m_lYmotorLocationOfStartRecord;//<2F><>ʼ<EFBFBD>ɼ<EFBFBD>ǰy<C7B0><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
||||||
|
|
||||||
|
unsigned long m_lManualSpeedOfXMotor;//X<><58><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD><CBB6>ٶȣ<D9B6>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+X<><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̲<EFBFBD><CCB2><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٶȣ<D9B6>12000*0.00052734375=6.328125cm/s
|
||||||
|
unsigned long m_lManualSpeedOfYMotor;//Y<><59><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X<EFBFBD><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ͬ<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y<EFBFBD><59><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>װ<EFBFBD>ã<EFBFBD>ʵ<EFBFBD><CAB5>Y<EFBFBD><59><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD>=X<><58><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD>/5
|
||||||
|
|
||||||
|
int m_xConnectCount;//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC>0<EFBFBD><30><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD>1<EFBFBD><31><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>״̬Ϊ1ʱ<31><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>
|
||||||
|
int m_yConnectCount;
|
||||||
|
|
||||||
|
QTimer *m_timerMoveXmotor;
|
||||||
|
QTimer *m_timerMoveYmotor;
|
||||||
|
|
||||||
|
QTimer *m_timerTestRangeOfxMotor;//<2F><><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>x<EFBFBD><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
QTimer *m_timerTestRangeOfyMotor;//<2F><><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>y<EFBFBD><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
QTimer *m_timerLocationFeedBackOfMotor_x_y;//<2F><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD>ƣ<EFBFBD>x/y<><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>Զ<EFBFBD><D4B6>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD>slider<65><72>
|
||||||
|
QTimer *m_timerYmotorLocationFeedBackAfterRecord;//<2F>ɼ<EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD><EFBFBD><EFBFBD>ɺ<C9BA><F3A3ACBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>ʵʱ<CAB5><CAB1><EFBFBD>ص<EFBFBD>slider<65><72>
|
||||||
|
|
||||||
|
QString operateWidget;//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>Ŀؼ<C4BF><D8BC><EFBFBD>
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD>
|
||||||
|
bool isMotorConnected(VinceControl *motor);//<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD><EFBFBD>true<75><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>false
|
||||||
|
void SetXMotorWidgetEnable(bool enable);
|
||||||
|
void SetYMotorWidgetEnable(bool enable);
|
||||||
|
void setMotorRange();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̷<EFBFBD>Χ
|
||||||
|
|
||||||
|
//ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
||||||
|
double widthScale;//QGraphicsView<65><77>viewport<72><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>widthScale = rect.width() / maxDistance;
|
||||||
|
double heightScale;//QGraphicsView<65><77>viewport<72>ߺ<EFBFBD><DFBA><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>heightScale = rect.height() / maxDistance;
|
||||||
|
void setImagerSimulationPos(double x, double y);//ui.graphicsView->imager->setPos(x, y);
|
||||||
|
|
||||||
|
//<2F>ɼ<EFBFBD><C9BC>߹滮
|
||||||
|
int m_numberOfRecording;//<2F><>ʾui.recordLine_tableWidget<65>еĵڼ<C4B5><DABC><EFBFBD> <20><> <20><><EFBFBD>ڲɼ<DAB2><C9BC>ڼ<EFBFBD><DABC><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
//
|
||||||
|
int m_TabWidgetCurrentIndex;//<2F><><EFBFBD>ֶ<EFBFBD>ѡ<EFBFBD><D1A1>TabWidget<65>ı<EFBFBD>ǩʱ<C7A9><CAB1><EFBFBD><EFBFBD>¼<EFBFBD>仯<EFBFBD><E4BBAF><EFBFBD><EFBFBD>tab index
|
||||||
|
RgbCameraOperation *m_RgbCamera;
|
||||||
|
|
||||||
|
void getRequest(QString str);
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void onPlotHyperspectralImageRgbImage();
|
||||||
|
void PlotSpectral(int state);
|
||||||
|
void onRecordFinishedSignal_WhenFrameNumberMeet();
|
||||||
|
void onRecordFinishedSignal_WhenFrameNumberNotMeet();
|
||||||
|
|
||||||
|
void onExit();
|
||||||
|
void onconnect();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
void testImagerStatus();//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
void onAutoExposure();
|
||||||
|
void onFocus1();
|
||||||
|
void onFocus2(int command);
|
||||||
|
void onDark();
|
||||||
|
void onReference();
|
||||||
|
void onStartRecordStep1();
|
||||||
|
void onStartRecordStep2(int lineNumber);
|
||||||
|
void onCreateTab(int trackNumber);
|
||||||
|
void onTabWidgetCurrentChanged(int index);
|
||||||
|
void onActionOpenDirectory();
|
||||||
|
|
||||||
|
void OnFramerateLineeditEditingFinished();//
|
||||||
|
void OnFramerateSliderChanged(double framerate);//
|
||||||
|
|
||||||
|
void OnIntegratioinTimeEditingFinished();//
|
||||||
|
void OnIntegratioinTimeSliderChanged(double IntegratioinTime);//
|
||||||
|
void OnGainEditingFinished();//
|
||||||
|
void OnGainSliderChanged(double Gain);//
|
||||||
|
|
||||||
|
void onLeftMouseButtonPressed(int x, int y);//<2F><><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD><EFBFBD>Ԫ<EFBFBD><D4AA>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD>
|
||||||
|
void timerEvent(QTimerEvent *event);
|
||||||
|
|
||||||
|
|
||||||
|
void onxMotorLeft();
|
||||||
|
void onxMotorRight();
|
||||||
|
void onxMotorStop();
|
||||||
|
|
||||||
|
void onyMotorForward();
|
||||||
|
void onyMotorBackward();
|
||||||
|
void onyMotorStop();
|
||||||
|
|
||||||
|
void onMotorReset();
|
||||||
|
|
||||||
|
void OnXmotorSpeedEditingFinished();
|
||||||
|
|
||||||
|
void ontimerLocationFeedBackOfMotor_x_y();
|
||||||
|
void ontimerYmotorLocationFeedBackAfterRecord();
|
||||||
|
|
||||||
|
void OnXmotorSpeedLineeditEditingFinished();
|
||||||
|
void OnXmotorSpeedSliderChanged(double speed);
|
||||||
|
void OnXmotorLocationLineeditEditingFinished();
|
||||||
|
void OnXmotorLocationSliderChanged(double location);
|
||||||
|
void OnXmotorLocationSliderReleased();
|
||||||
|
|
||||||
|
|
||||||
|
void OnYmotorLocationLineeditEditingFinished();
|
||||||
|
void OnYmotorLocationSliderChanged(double location);
|
||||||
|
void OnYmotorLocationSliderReleased();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ontestRangeOfMotor_x_y();
|
||||||
|
void ontimerTestRangeOfxMotor();
|
||||||
|
void ontimerTestRangeOfyMotor();
|
||||||
|
|
||||||
|
//<2F>ɼ<EFBFBD><C9BC>߹滮
|
||||||
|
void onAddRecordLine_btn();
|
||||||
|
void onRemoveRecordLine_btn();
|
||||||
|
void onGenerateRecordLine_btn();
|
||||||
|
void onDeleteRecordLine_btn();
|
||||||
|
void onSaveRecordLine2File_btn();
|
||||||
|
void onReadRecordLineFile_btn();
|
||||||
|
|
||||||
|
void ontimerMoveXmotor();
|
||||||
|
void ontimerMoveYmotor();
|
||||||
|
|
||||||
|
//
|
||||||
|
void onimagerSimulatorMove(int x, int y);
|
||||||
|
void OnSendLogToCallClass(QString str);
|
||||||
|
|
||||||
|
void onPlotRgbImage();
|
||||||
|
void onCloseRgbCamera();
|
||||||
|
void onClearLabel();
|
||||||
|
|
||||||
|
void onCopyFinished();
|
||||||
|
|
||||||
|
void onLampPowerOpen_btn();
|
||||||
|
void onLampPowerClose_btn();
|
||||||
|
|
||||||
|
void onMotorPowerOpen_btn();
|
||||||
|
void onMotorPowerClose_btn();
|
||||||
|
|
||||||
|
void requestFinished(QNetworkReply* reply);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void StartFocusSignal();
|
||||||
|
void StartLoopSignal();
|
||||||
|
void StartRecordSignal();
|
||||||
|
void CopyFileThreadSignal(QString, QString);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
BIN
HPPA/HPPA.ico
Normal file
BIN
HPPA/HPPA.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
5
HPPA/HPPA.qrc
Normal file
5
HPPA/HPPA.qrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/HPPA">
|
||||||
|
<file>HPPA.ico</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
||||||
BIN
HPPA/HPPA.rc
Normal file
BIN
HPPA/HPPA.rc
Normal file
Binary file not shown.
1765
HPPA/HPPA.ui
Normal file
1765
HPPA/HPPA.ui
Normal file
File diff suppressed because it is too large
Load Diff
166
HPPA/HPPA.vcxproj
Normal file
166
HPPA/HPPA.vcxproj
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{E7886664-B69E-4781-BCBE-804574FB4033}</ProjectGuid>
|
||||||
|
<Keyword>QtVS_v304</Keyword>
|
||||||
|
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||||
|
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||||
|
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||||
|
<QtInstall>qt5.9.0_vs2017</QtInstall>
|
||||||
|
<QtModules>core;network;gui;widgets;serialport;websockets;charts</QtModules>
|
||||||
|
<QtBuildConfig>debug</QtBuildConfig>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||||
|
<QtInstall>qt5.9.0_vs2017</QtInstall>
|
||||||
|
<QtModules>core;network;gui;widgets;serialport;websockets;charts</QtModules>
|
||||||
|
<QtBuildConfig>release</QtBuildConfig>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||||
|
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||||
|
</Target>
|
||||||
|
<ImportGroup Label="ExtensionSettings" />
|
||||||
|
<ImportGroup Label="Shared" />
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<IncludePath>D:\software\Qt5.9.0\5.9\msvc2017_64\include;D:\cpp_library\vincecontrol_vs2017;D:\cpp_library\gdal2.2.3_vs2017\include;C:\Program Files\ResononAPI\include;D:\cpp_library\opencv3.4.11\opencv\build\include;D:\cpp_library\opencv3.4.11\opencv\build\include\opencv;D:\cpp_library\opencv3.4.11\opencv\build\include\opencv2;D:\cpp_vs2017\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL\SDKs\PCOMM\Include;D:\cpp_vs2017\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL\SDKs\PortControl;D:\cpp_vs2017\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL;D:\cpp_vs2017\HPPA\HPPA;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>D:\cpp_library\opencv3.4.11\opencv\build\x64\vc15\lib;D:\cpp_library\vincecontrol_vs2017;D:\cpp_library\gdal2.2.3_vs2017\lib;C:\Program Files\ResononAPI\lib64;D:\cpp_vs2017\AutoFocus_InspireLinearMotor_DLL\x64\Debug;D:\software\Qt5.9.0\5.9\msvc2017_64\lib;$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<IncludePath>D:\cpp_library\vincecontrol_vs2017;D:\cpp_library\gdal2.2.3_vs2017\include;C:\Program Files\ResononAPI\include;D:\cpp_library\opencv3.4.11\opencv\build\include;D:\cpp_library\opencv3.4.11\opencv\build\include\opencv;D:\cpp_library\opencv3.4.11\opencv\build\include\opencv2;D:\cpp_vs2017\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL\SDKs\PCOMM\Include;D:\cpp_vs2017\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL\SDKs\PortControl;D:\cpp_vs2017\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL;D:\cpp_vs2017\HPPA\HPPA;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>D:\cpp_library\opencv3.4.11\opencv\build\x64\vc15\lib;D:\cpp_library\vincecontrol_vs2017_release;D:\cpp_library\gdal2.2.3_vs2017\lib;C:\Program Files\ResononAPI\lib64;D:\cpp_vs2017\AutoFocus_InspireLinearMotor_DLL\x64\Release;D:\software\Qt5.9.0\5.9\msvc2017_64\lib;$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>opencv_world3411.lib;opencv_world3411d.lib;vincecontrol.lib;gdal_i.lib;resonon-basler.lib;qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;Qt5SerialPortd.lib;Qt5WebSocketsd.lib;Qt5Networkd.lib;Qt5Chartsd.lib;AutoFocus_InspireLinearMotor_DLL.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ClCompile>
|
||||||
|
<PreprocessorDefinitions>_AMD64_;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>opencv_world3411.lib;vincecontrol.lib;gdal_i.lib;resonon-basler.lib;qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5SerialPort.lib;Qt5WebSockets.lib;Qt5Network.lib;Qt5Charts.lib;AutoFocus_InspireLinearMotor_DLL.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<DebugInformationFormat>None</DebugInformationFormat>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="QDoubleSlider.cpp" />
|
||||||
|
<ClCompile Include="QMotorDoubleSlider.cpp" />
|
||||||
|
<ClCompile Include="QYMotorDoubleSlider.cpp" />
|
||||||
|
<ClCompile Include="resononImager.cpp" />
|
||||||
|
<ClCompile Include="RgbCameraOperation.cpp" />
|
||||||
|
<ClCompile Include="stdafx.cpp">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||||
|
</ClCompile>
|
||||||
|
<QtRcc Include="HPPA.qrc" />
|
||||||
|
<QtUic Include="FocusDialog.ui" />
|
||||||
|
<QtUic Include="HPPA.ui" />
|
||||||
|
<QtMoc Include="HPPA.h" />
|
||||||
|
<ClCompile Include="fileOperation.cpp" />
|
||||||
|
<ClCompile Include="focusWindow.cpp" />
|
||||||
|
<ClCompile Include="HPPA.cpp" />
|
||||||
|
<ClCompile Include="image2display.cpp" />
|
||||||
|
<ClCompile Include="imageProcessor.cpp" />
|
||||||
|
<ClCompile Include="ImageReaderWriter.cpp" />
|
||||||
|
<ClCompile Include="ImagerPositionSimulation.cpp" />
|
||||||
|
<ClCompile Include="imagerSimulatioin.cpp" />
|
||||||
|
<ClCompile Include="ImageViewer.cpp" />
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtMoc Include="fileOperation.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtMoc Include="focusWindow.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtMoc Include="image2display.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="imageProcessor.h" />
|
||||||
|
<ClInclude Include="ImageReaderWriter.h" />
|
||||||
|
<ClInclude Include="resource.h" />
|
||||||
|
<ClInclude Include="stdafx.h" />
|
||||||
|
<QtMoc Include="RgbCameraOperation.h" />
|
||||||
|
<QtMoc Include="resononImager.h" />
|
||||||
|
<QtMoc Include="QYMotorDoubleSlider.h" />
|
||||||
|
<QtMoc Include="QMotorDoubleSlider.h" />
|
||||||
|
<QtMoc Include="QDoubleSlider.h" />
|
||||||
|
<QtMoc Include="ImageViewer.h" />
|
||||||
|
<QtMoc Include="imagerSimulatioin.h" />
|
||||||
|
<QtMoc Include="ImagerPositionSimulation.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="cpp.hint" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="HPPA.rc" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="HPPA.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||||
|
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
153
HPPA/HPPA.vcxproj.filters
Normal file
153
HPPA/HPPA.vcxproj.filters
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Form Files">
|
||||||
|
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||||
|
<Extensions>ui</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Translation Files">
|
||||||
|
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||||
|
<Extensions>ts</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtRcc Include="HPPA.qrc">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</QtRcc>
|
||||||
|
<QtUic Include="HPPA.ui">
|
||||||
|
<Filter>Form Files</Filter>
|
||||||
|
</QtUic>
|
||||||
|
<QtMoc Include="HPPA.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<ClCompile Include="HPPA.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="fileOperation.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="focusWindow.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="image2display.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="imageProcessor.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="ImageReaderWriter.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="ImagerPositionSimulation.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="imagerSimulatioin.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="ImageViewer.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="QDoubleSlider.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="QMotorDoubleSlider.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="QYMotorDoubleSlider.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="resononImager.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="RgbCameraOperation.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="stdafx.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtMoc Include="fileOperation.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="focusWindow.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="image2display.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="ImagerPositionSimulation.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="imagerSimulatioin.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="ImageViewer.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="QDoubleSlider.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="QMotorDoubleSlider.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="QYMotorDoubleSlider.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="resononImager.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="RgbCameraOperation.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="imageProcessor.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="ImageReaderWriter.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="stdafx.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="resource.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtUic Include="FocusDialog.ui">
|
||||||
|
<Filter>Form Files</Filter>
|
||||||
|
</QtUic>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="cpp.hint" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="HPPA.rc">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="HPPA.ico">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</Image>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
87
HPPA/ImageReaderWriter.cpp
Normal file
87
HPPA/ImageReaderWriter.cpp
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "ImageReaderWriter.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ImageReaderWriter::ImageReaderWriter(const char * fileName)
|
||||||
|
{
|
||||||
|
GDALAllRegister();
|
||||||
|
m_poDataset = (GDALDataset *)GDALOpen(fileName, GA_ReadOnly);
|
||||||
|
if (m_poDataset == NULL)
|
||||||
|
{
|
||||||
|
std::cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӱ<EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>" << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//<2F><>ȡӰ<C8A1><D3B0><EFBFBD><EFBFBD>Ϣ
|
||||||
|
m_DataType = m_poDataset->GetRasterBand(1)->GetRasterDataType();
|
||||||
|
m_iBands = m_poDataset->GetRasterCount();
|
||||||
|
m_iXCount = m_poDataset->GetRasterXSize();
|
||||||
|
m_iYCount = m_poDataset->GetRasterYSize();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageReaderWriter::ImageReaderWriter()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
float * ImageReaderWriter::ReadImage(int nXOff, int nYOff, int nXSize, int nYSize)
|
||||||
|
{
|
||||||
|
int xBuff = nXSize;
|
||||||
|
int yBuff = nYSize;
|
||||||
|
|
||||||
|
|
||||||
|
if (m_DataType == GDT_Byte)
|
||||||
|
{
|
||||||
|
unsigned char *pDataBuffer = (unsigned char*)CPLMalloc(sizeof(unsigned int)*(1)*(1)*(m_iBands));//unsigned char=BYTE
|
||||||
|
memset(pDataBuffer, 0, 1 * 1 * m_iBands * sizeof(unsigned char));
|
||||||
|
}
|
||||||
|
else if (m_DataType == GDT_UInt16)
|
||||||
|
{
|
||||||
|
//WORD *pDataBuffer = new WORD[1 * 1 * m_iBands];//WORD=unsigned short
|
||||||
|
//memset(pDataBuffer, 0, 1 * 1 * m_iBands*sizeof(WORD));
|
||||||
|
|
||||||
|
float *pDataBuffer = (float*)CPLMalloc(sizeof(float)*(1)*(1)*(m_iBands));
|
||||||
|
memset(pDataBuffer, 0, 1 * 1 * m_iBands * sizeof(float));
|
||||||
|
|
||||||
|
CPLErr status = m_poDataset->RasterIO(GF_Read, nXOff, nYOff, nXSize, nYSize, pDataBuffer, xBuff, yBuff, GDT_Float32, m_iBands, NULL, 0, 0, 0); //<2F>ȸߺ<C8B8><DFBA><EFBFBD>
|
||||||
|
|
||||||
|
if (status != CE_None)
|
||||||
|
{
|
||||||
|
std::cout << "<EFBFBD><EFBFBD>ȡӰ<EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>" << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*for (size_t i = 0; i < m_iBands; i++)
|
||||||
|
{
|
||||||
|
std::cout << *pDataBuffer << std::endl;
|
||||||
|
pDataBuffer++;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
return pDataBuffer;
|
||||||
|
}
|
||||||
|
else if (m_DataType == GDT_UInt32)
|
||||||
|
{
|
||||||
|
unsigned int *pDataBuffer = (unsigned int*)CPLMalloc(sizeof(unsigned int)*(1)*(1)*(m_iBands));
|
||||||
|
memset(pDataBuffer, 0, 1 * 1 * m_iBands * sizeof(unsigned int));
|
||||||
|
}
|
||||||
|
else if (m_DataType == GDT_Float32)
|
||||||
|
{
|
||||||
|
float *pDataBuffer = (float*)CPLMalloc(sizeof(float)*(1)*(1)*(m_iBands));
|
||||||
|
memset(pDataBuffer, 0, 1 * 1 * m_iBands * sizeof(float));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int ImageReaderWriter::getXCount() const
|
||||||
|
{
|
||||||
|
return m_iXCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ImageReaderWriter::getyCount() const
|
||||||
|
{
|
||||||
|
return m_iYCount;
|
||||||
|
}
|
||||||
28
HPPA/ImageReaderWriter.h
Normal file
28
HPPA/ImageReaderWriter.h
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#ifndef IMAGE_READER_WRITER
|
||||||
|
#define IMAGE_READER_WRITER
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "gdal_priv.h"
|
||||||
|
#include "cpl_conv.h"
|
||||||
|
|
||||||
|
class ImageReaderWriter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ImageReaderWriter();
|
||||||
|
ImageReaderWriter(const char * fileName);
|
||||||
|
float * ReadImage(int nXOff, int nYOff, int nXSize, int nYSize);
|
||||||
|
//void WriteImage();
|
||||||
|
|
||||||
|
int getXCount() const;
|
||||||
|
int getyCount() const;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
GDALDataset *m_poDataset;
|
||||||
|
GDALDataType m_DataType;
|
||||||
|
|
||||||
|
int m_iBands;
|
||||||
|
int m_iXCount;
|
||||||
|
int m_iYCount;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
227
HPPA/ImageViewer.cpp
Normal file
227
HPPA/ImageViewer.cpp
Normal file
@ -0,0 +1,227 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <QWheelEvent>
|
||||||
|
#include <QPoint>
|
||||||
|
|
||||||
|
#include "ImageViewer.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define VIEW_CENTER viewport()->rect().center()
|
||||||
|
#define VIEW_WIDTH viewport()->rect().width()
|
||||||
|
#define VIEW_HEIGHT viewport()->rect().height()
|
||||||
|
|
||||||
|
|
||||||
|
ImageViewer::ImageViewer(QWidget* pParent) :QGraphicsView(pParent)
|
||||||
|
{
|
||||||
|
m_qtGraphicsScene = new QGraphicsScene(this);
|
||||||
|
this->setScene(m_qtGraphicsScene);
|
||||||
|
|
||||||
|
m_framNumberLabel = new QLabel(this);
|
||||||
|
m_framNumberLabel->setAlignment(Qt::AlignHCenter);
|
||||||
|
m_framNumberLabel->setAlignment(Qt::AlignVCenter);
|
||||||
|
|
||||||
|
QFont ft;
|
||||||
|
ft.setPointSize(14);
|
||||||
|
m_framNumberLabel->setFont(ft);
|
||||||
|
m_framNumberLabel->setText("0");
|
||||||
|
|
||||||
|
|
||||||
|
m_GraphicsPixmapItemHandle = nullptr;
|
||||||
|
|
||||||
|
m_scale = 1.0;
|
||||||
|
m_zoomDelta = 0.1;
|
||||||
|
m_translateSpeed = 1.0;
|
||||||
|
m_bMouseTranslate = false;
|
||||||
|
|
||||||
|
|
||||||
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageViewer::~ImageViewer()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::DisplayFrameNumber(int frameNumber)
|
||||||
|
{
|
||||||
|
m_framNumberLabel->setText(QString::number(frameNumber));
|
||||||
|
m_framNumberLabel->adjustSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::SetImage(QPixmap *image)
|
||||||
|
{
|
||||||
|
if (!HasImage())
|
||||||
|
{
|
||||||
|
m_GraphicsPixmapItemHandle = m_qtGraphicsScene->addPixmap(*image);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_GraphicsPixmapItemHandle->setPixmap(*image);
|
||||||
|
}
|
||||||
|
|
||||||
|
setSceneRect(QRectF(image->rect()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ImageViewer::HasImage()
|
||||||
|
{
|
||||||
|
if (m_GraphicsPixmapItemHandle == nullptr)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::wheelEvent(QWheelEvent *event)
|
||||||
|
{
|
||||||
|
//qDebug() << "---------------+++++++++++++++++++++++++++++++++++++++++++++++++++ ";
|
||||||
|
if (true)//HasImage()
|
||||||
|
{
|
||||||
|
//Χ<><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD>https://blog.csdn.net/GoForwardToStep/article/details/77035287?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param
|
||||||
|
// <20><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>view<65><77>λ<EFBFBD><CEBB>;
|
||||||
|
QPointF cursorPoint = event->pos();
|
||||||
|
// <20><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>scene<6E><65>λ<EFBFBD><CEBB>;
|
||||||
|
QPointF scenePos = this->mapToScene(QPoint(cursorPoint.x(), cursorPoint.y()));
|
||||||
|
|
||||||
|
// <20><>ȡview<65>Ŀ<EFBFBD><C4BF><EFBFBD>;
|
||||||
|
qreal viewWidth = this->viewport()->width();
|
||||||
|
qreal viewHeight = this->viewport()->height();
|
||||||
|
|
||||||
|
// <20><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>൱<EFBFBD><E0B5B1>view<65><77>С<EFBFBD>ĺ<EFBFBD><C4BA>ݱ<EFBFBD><DDB1><EFBFBD>;
|
||||||
|
qreal hScale = cursorPoint.x() / viewWidth;
|
||||||
|
qreal vScale = cursorPoint.y() / viewHeight;
|
||||||
|
|
||||||
|
|
||||||
|
// <20><><EFBFBD>ֵĹ<D6B5><C4B9><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
QPoint scrollAmount = event->angleDelta();
|
||||||
|
// <20><>ֵ<EFBFBD><D6B5>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6>ʹ<EFBFBD><CAB9><EFBFBD>߷Ŵ<DFB7><C5B4><EFBFBD>ֵ<EFBFBD><D6B5>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
||||||
|
scrollAmount.y() > 0 ? zoomIn() : zoomOut();
|
||||||
|
|
||||||
|
|
||||||
|
// <20><>scene<6E><65><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊ<EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||||
|
QPointF viewPoint = this->matrix().map(scenePos);
|
||||||
|
// ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>view<65>Ŵ<EFBFBD><C5B4><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD>չʾscene<6E><65>λ<EFBFBD><CEBB>;
|
||||||
|
horizontalScrollBar()->setValue(int(viewPoint.x() - viewWidth * hScale));
|
||||||
|
verticalScrollBar()->setValue(int(viewPoint.y() - viewHeight * vScale));
|
||||||
|
}
|
||||||
|
|
||||||
|
QGraphicsView::wheelEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::scaling(qreal scaleFactor)
|
||||||
|
{
|
||||||
|
//qDebug() << this->sceneRect();
|
||||||
|
scale(scaleFactor, scaleFactor);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::mousePressEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
if (event->button()==Qt::LeftButton)
|
||||||
|
{
|
||||||
|
m_bMouseTranslate = true;
|
||||||
|
m_lastMousePos = event->pos();
|
||||||
|
|
||||||
|
//qDebug() << mapToScene(m_lastMousePos);
|
||||||
|
|
||||||
|
emit leftMouseButtonPressed(mapToScene(m_lastMousePos).x(), mapToScene(m_lastMousePos).y());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//If you do not perform all the necessary work in your implementation of the virtual function, you may need to call the base class's implementation.
|
||||||
|
QGraphicsView::mousePressEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::mouseMoveEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
if (m_bMouseTranslate){
|
||||||
|
QPointF mouseDelta = mapToScene(event->pos()) - mapToScene(m_lastMousePos);
|
||||||
|
translate(mouseDelta);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_lastMousePos = event->pos();
|
||||||
|
QGraphicsView::mousePressEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::mouseReleaseEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
m_bMouseTranslate = false;
|
||||||
|
QGraphicsView::mouseReleaseEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::mouseDoubleClickEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
QGraphicsView::mouseDoubleClickEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::zoomIn()
|
||||||
|
{
|
||||||
|
zoom(1 + m_zoomDelta);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::zoomOut()
|
||||||
|
{
|
||||||
|
zoom(1 - m_zoomDelta);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::zoom(float scaleFactor)
|
||||||
|
{
|
||||||
|
// <20><>ֹ<EFBFBD><D6B9>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
qreal factor = transform().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width();
|
||||||
|
if (factor < 0.07 || factor > 100)
|
||||||
|
return;
|
||||||
|
|
||||||
|
scale(scaleFactor, scaleFactor);
|
||||||
|
m_scale *= scaleFactor;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::translate(QPointF delta)
|
||||||
|
{
|
||||||
|
// <20><><EFBFBD>ݵ<EFBFBD>ǰ zoom <20><><EFBFBD><EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD>
|
||||||
|
delta *= m_scale;
|
||||||
|
delta *= m_translateSpeed;
|
||||||
|
|
||||||
|
////<2F><><EFBFBD><EFBFBD>1<EFBFBD><31>
|
||||||
|
//scene()->setSceneRect(scene()->sceneRect().x() - delta.x(), scene()->sceneRect().y() - delta.y(),
|
||||||
|
// scene()->sceneRect().width(), scene()->sceneRect().height());
|
||||||
|
//scene()->update();
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD>2<EFBFBD><32>
|
||||||
|
// view <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µĵ<C2B5><C4B5><EFBFBD>Ϊê<CEAA><C3AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ scene
|
||||||
|
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
|
||||||
|
QPoint newCenter(VIEW_WIDTH / 2 - delta.x(), VIEW_HEIGHT / 2 - delta.y());
|
||||||
|
centerOn(mapToScene(newCenter));
|
||||||
|
|
||||||
|
// scene <20><> view <20><><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊê<CEAA><C3AA>
|
||||||
|
setTransformationAnchor(QGraphicsView::AnchorViewCenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::setTranslateSpeed(qreal speed)
|
||||||
|
{
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ٶȷ<D9B6>Χ
|
||||||
|
Q_ASSERT_X(speed >= 0.0 && speed <= 2.0,
|
||||||
|
"InteractiveView::setTranslateSpeed", "Speed should be in range [0.0, 2.0].");
|
||||||
|
m_translateSpeed = speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
qreal ImageViewer::translateSpeed() const
|
||||||
|
{
|
||||||
|
return m_translateSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageViewer::setZoomDelta(qreal delta)
|
||||||
|
{
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ
|
||||||
|
Q_ASSERT_X(delta >= 0.0 && delta <= 1.0,
|
||||||
|
"InteractiveView::setZoomDelta", "Delta should be in range [0.0, 1.0].");
|
||||||
|
m_zoomDelta = delta;
|
||||||
|
}
|
||||||
|
|
||||||
|
qreal ImageViewer::zoomDelta() const
|
||||||
|
{
|
||||||
|
return m_zoomDelta;
|
||||||
|
}
|
||||||
58
HPPA/ImageViewer.h
Normal file
58
HPPA/ImageViewer.h
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#ifndef IMAGE_VIEWER
|
||||||
|
#define IMAGE_VIEWER
|
||||||
|
|
||||||
|
#include "QGraphicsView"
|
||||||
|
#include "qlabel.h"
|
||||||
|
class ImageViewer :public QGraphicsView
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ImageViewer(QWidget* pParent = NULL);
|
||||||
|
~ImageViewer();
|
||||||
|
|
||||||
|
|
||||||
|
void DisplayFrameNumber(int frameNumber);
|
||||||
|
|
||||||
|
|
||||||
|
void mousePressEvent(QMouseEvent *event);
|
||||||
|
void mouseMoveEvent(QMouseEvent *event);
|
||||||
|
void mouseReleaseEvent(QMouseEvent *event);
|
||||||
|
void mouseDoubleClickEvent(QMouseEvent *event);
|
||||||
|
|
||||||
|
void SetImage(QPixmap *image);
|
||||||
|
bool HasImage();
|
||||||
|
|
||||||
|
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
|
||||||
|
void scaling(qreal scaleFactor);
|
||||||
|
|
||||||
|
void zoomIn(); // <20>Ŵ<EFBFBD>
|
||||||
|
void zoomOut(); // <20><>С
|
||||||
|
void zoom(float scaleFactor); // <20><><EFBFBD><EFBFBD> - scaleFactor<6F><72><EFBFBD>ŵı<C5B5><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
void translate(QPointF delta); // ƽ<><C6BD>
|
||||||
|
|
||||||
|
// ƽ<><C6BD><EFBFBD>ٶ<EFBFBD>
|
||||||
|
void setTranslateSpeed(qreal speed);
|
||||||
|
qreal translateSpeed() const;
|
||||||
|
|
||||||
|
// <20><><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
void setZoomDelta(qreal delta);
|
||||||
|
qreal zoomDelta() const;
|
||||||
|
protected:
|
||||||
|
QGraphicsScene *m_qtGraphicsScene;
|
||||||
|
private:
|
||||||
|
QGraphicsPixmapItem *m_GraphicsPixmapItemHandle;
|
||||||
|
QLabel *m_framNumberLabel;//<2F><>ʾʵʱ<CAB5>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><D6A1>
|
||||||
|
|
||||||
|
|
||||||
|
qreal m_translateSpeed; // ƽ<><C6BD><EFBFBD>ٶ<EFBFBD>
|
||||||
|
qreal m_zoomDelta; // <20><><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
bool m_bMouseTranslate; // ƽ<>Ʊ<EFBFBD>ʶ
|
||||||
|
QPoint m_lastMousePos; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>λ<EFBFBD><CEBB>
|
||||||
|
qreal m_scale; // <20><><EFBFBD><EFBFBD>ֵ
|
||||||
|
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void leftMouseButtonPressed(int, int);
|
||||||
|
};
|
||||||
|
#endif
|
||||||
103
HPPA/ImagerPositionSimulation.cpp
Normal file
103
HPPA/ImagerPositionSimulation.cpp
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
#include "ImagerPositionSimulation.h"
|
||||||
|
|
||||||
|
|
||||||
|
ImagerPositionSimulation::ImagerPositionSimulation(QWidget *parent) :
|
||||||
|
QGraphicsView(parent)
|
||||||
|
{
|
||||||
|
this->resize(1000, 500);
|
||||||
|
|
||||||
|
topLeftToLowerRight = nullptr;
|
||||||
|
topRightToLowerLeft = nullptr;
|
||||||
|
|
||||||
|
m_Scene = new QGraphicsScene(this);
|
||||||
|
this->setScene(m_Scene);
|
||||||
|
|
||||||
|
setSceneRect();
|
||||||
|
|
||||||
|
|
||||||
|
imager = new imagerSimulatioin();
|
||||||
|
m_Scene->addItem(imager);
|
||||||
|
//imager->setPos(-100, -100);
|
||||||
|
|
||||||
|
QBrush redBrush(Qt::red);
|
||||||
|
QPen outlinePen(Qt::black);
|
||||||
|
|
||||||
|
/*m_rectangle = m_Scene->addRect(0, 0, 100, 100, outlinePen, redBrush);
|
||||||
|
m_rectangle->setFlag(QGraphicsRectItem::ItemIsMovable);*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ImagerPositionSimulation::~ImagerPositionSimulation()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImagerPositionSimulation::setSceneRect()
|
||||||
|
{
|
||||||
|
QRectF graphicsViewSize = viewport()->rect();
|
||||||
|
|
||||||
|
m_Scene->setSceneRect(-graphicsViewSize.width(), -graphicsViewSize.height(), graphicsViewSize.width(), graphicsViewSize.height());
|
||||||
|
|
||||||
|
drawX();
|
||||||
|
}
|
||||||
|
|
||||||
|
QRectF ImagerPositionSimulation::sceneRect()
|
||||||
|
{
|
||||||
|
return m_Scene->sceneRect();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImagerPositionSimulation::mousePressEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
QPoint viewPos = event->pos();
|
||||||
|
|
||||||
|
|
||||||
|
QGraphicsView::mousePressEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImagerPositionSimulation::mouseReleaseEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
QPoint viewPos = event->pos();
|
||||||
|
|
||||||
|
////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
//const type_info &x = typeid(imager);
|
||||||
|
//qDebug() << "---------------type_info: " << x.name() << x.raw_name() << x.hash_code();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//qDebug() << "---------------ImagerPositionSimulation view coordinate: " << viewPos;
|
||||||
|
//qDebug() << "---------------ImagerPositionSimulation scene coordinate: " << this->mapToScene(viewPos);
|
||||||
|
|
||||||
|
|
||||||
|
QGraphicsView::mouseReleaseEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImagerPositionSimulation::drawX()
|
||||||
|
{
|
||||||
|
QRectF rect = m_Scene->sceneRect();
|
||||||
|
|
||||||
|
QPen outlinePen(Qt::black);
|
||||||
|
|
||||||
|
if (topLeftToLowerRight == nullptr)
|
||||||
|
{
|
||||||
|
topLeftToLowerRight = m_Scene->addLine(rect.left(), rect.top(), rect.right(), rect.bottom(), outlinePen);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
topLeftToLowerRight->setLine(rect.left(), rect.top(), rect.right(), rect.bottom());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (topRightToLowerLeft == nullptr)
|
||||||
|
{
|
||||||
|
topRightToLowerLeft = m_Scene->addLine(rect.right(), rect.top(), rect.left(), rect.bottom(), outlinePen);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
topRightToLowerLeft->setLine(rect.right(), rect.top(), rect.left(), rect.bottom());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
35
HPPA/ImagerPositionSimulation.h
Normal file
35
HPPA/ImagerPositionSimulation.h
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
#ifndef IMAGER_POSITION_SIMULATION
|
||||||
|
#define IMAGER_POSITION_SIMULATION
|
||||||
|
#include <QGraphicsView>
|
||||||
|
#include <QGraphicsScene>
|
||||||
|
|
||||||
|
#include "imagerSimulatioin.h"
|
||||||
|
|
||||||
|
class ImagerPositionSimulation :public QGraphicsView
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
ImagerPositionSimulation(QWidget* pParent = NULL);
|
||||||
|
~ImagerPositionSimulation();
|
||||||
|
|
||||||
|
imagerSimulatioin *imager;
|
||||||
|
|
||||||
|
void drawX();
|
||||||
|
|
||||||
|
void setSceneRect();//<2F><>QGraphicsView<65><77>viewport<72><74><EFBFBD><EFBFBD>ΪsceneRect
|
||||||
|
|
||||||
|
QRectF sceneRect();
|
||||||
|
|
||||||
|
void mousePressEvent(QMouseEvent *event);
|
||||||
|
|
||||||
|
void mouseReleaseEvent(QMouseEvent *event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QGraphicsScene *m_Scene;
|
||||||
|
QGraphicsRectItem *m_rectangle;
|
||||||
|
|
||||||
|
QGraphicsLineItem *topLeftToLowerRight;
|
||||||
|
QGraphicsLineItem *topRightToLowerLeft;
|
||||||
|
|
||||||
|
};
|
||||||
|
#endif
|
||||||
69
HPPA/QDoubleSlider.cpp
Normal file
69
HPPA/QDoubleSlider.cpp
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "qDoubleSlider.h"
|
||||||
|
QDoubleSlider::QDoubleSlider(QWidget* pParent /*= NULL*/) :
|
||||||
|
QSlider(pParent),
|
||||||
|
m_Multiplier(100.0)
|
||||||
|
{
|
||||||
|
connect(this, SIGNAL(valueChanged(int)), this, SLOT(notifyValueChanged(int)));
|
||||||
|
|
||||||
|
setSingleStep(1);
|
||||||
|
|
||||||
|
setOrientation(Qt::Horizontal);
|
||||||
|
setFocusPolicy(Qt::NoFocus);
|
||||||
|
}
|
||||||
|
|
||||||
|
//<2F><><EFBFBD>ⷢ<EFBFBD><E2B7A2>
|
||||||
|
void QDoubleSlider::notifyValueChanged(int Value)
|
||||||
|
{
|
||||||
|
emit valueChanged((double)Value / m_Multiplier);
|
||||||
|
}
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
void QDoubleSlider::setValue(double Value, bool BlockSignals)
|
||||||
|
{
|
||||||
|
QSlider::blockSignals(BlockSignals);
|
||||||
|
|
||||||
|
QSlider::setValue(Value * m_Multiplier);
|
||||||
|
|
||||||
|
if (!BlockSignals)
|
||||||
|
emit valueChanged(Value);
|
||||||
|
|
||||||
|
QSlider::blockSignals(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QDoubleSlider::setRange(double Min, double Max)
|
||||||
|
{
|
||||||
|
QSlider::setRange(Min * m_Multiplier, Max * m_Multiplier);
|
||||||
|
|
||||||
|
emit rangeChanged(Min, Max);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QDoubleSlider::setMinimum(double Min)
|
||||||
|
{
|
||||||
|
QSlider::setMinimum(Min * m_Multiplier);
|
||||||
|
|
||||||
|
emit rangeChanged(minimum(), maximum());
|
||||||
|
}
|
||||||
|
|
||||||
|
double QDoubleSlider::minimum() const
|
||||||
|
{
|
||||||
|
return QSlider::minimum() / m_Multiplier;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QDoubleSlider::setMaximum(double Max)
|
||||||
|
{
|
||||||
|
QSlider::setMaximum(Max * m_Multiplier);
|
||||||
|
|
||||||
|
emit rangeChanged(minimum(), maximum());
|
||||||
|
}
|
||||||
|
|
||||||
|
double QDoubleSlider::maximum() const
|
||||||
|
{
|
||||||
|
return QSlider::maximum() / m_Multiplier;
|
||||||
|
}
|
||||||
|
|
||||||
|
double QDoubleSlider::value() const
|
||||||
|
{
|
||||||
|
int Value = QSlider::value();
|
||||||
|
return (double)Value / m_Multiplier;
|
||||||
|
}
|
||||||
32
HPPA/QDoubleSlider.h
Normal file
32
HPPA/QDoubleSlider.h
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#ifndef Q_DOUBLE_SLIDER_H
|
||||||
|
#define Q_DOUBLE_SLIDER_H
|
||||||
|
#include <QtGui/QtGui>
|
||||||
|
#include <QSlider>
|
||||||
|
class QDoubleSlider : public QSlider
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QDoubleSlider(QWidget* pParent = NULL);
|
||||||
|
|
||||||
|
void setRange(double Min, double Max);
|
||||||
|
void setMinimum(double Min);
|
||||||
|
double minimum() const;
|
||||||
|
void setMaximum(double Max);
|
||||||
|
double maximum() const;
|
||||||
|
double value() const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void notifyValueChanged(int value);//<2F>ź<EFBFBD>valueChanged(int)<29><>wrap
|
||||||
|
void setValue(double Value, bool BlockSignals = true);//QSlider::setValue<75><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>wrap
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
signals :
|
||||||
|
void valueChanged(double Value);
|
||||||
|
void rangeChanged(double Min, double Max);
|
||||||
|
|
||||||
|
private:
|
||||||
|
double m_Multiplier;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
87
HPPA/QMotorDoubleSlider.cpp
Normal file
87
HPPA/QMotorDoubleSlider.cpp
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "QMotorDoubleSlider.h"
|
||||||
|
QMotorDoubleSlider::QMotorDoubleSlider(QWidget* pParent /*= NULL*/) :
|
||||||
|
QSlider(pParent),
|
||||||
|
//m_Multiplier(0.00054496986),//<2F>Ϻ<EFBFBD>ũ<EFBFBD><C5A9>Ժ<EFBFBD><D4BA><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>0.00052734375/5=0.00010546875<EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD>ȷֵΪ0.000544969862759644<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0.00054496986/5=0.000108993972<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>и<EFBFBD><EFBFBD><EFBFBD>еװ<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>5<EFBFBD><EFBFBD>
|
||||||
|
m_Multiplier(0.00054496986),//<2F>˰<EFBFBD><CBB0><EFBFBD>ũ<EFBFBD><C5A9><EFBFBD><EFBFBD>
|
||||||
|
m_yMultiplier(0.000108993972)//
|
||||||
|
{
|
||||||
|
connect(this, SIGNAL(valueChanged(int)), this, SLOT(notifyValueChanged(int)));
|
||||||
|
|
||||||
|
setSingleStep(1);
|
||||||
|
|
||||||
|
setOrientation(Qt::Horizontal);
|
||||||
|
setFocusPolicy(Qt::NoFocus);
|
||||||
|
}
|
||||||
|
|
||||||
|
//<2F><><EFBFBD>ⷢ<EFBFBD><E2B7A2>
|
||||||
|
void QMotorDoubleSlider::notifyValueChanged(int Value)
|
||||||
|
{
|
||||||
|
emit valueChanged((double)Value * m_Multiplier);//////////
|
||||||
|
}
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
void QMotorDoubleSlider::setValue(double Value, bool BlockSignals)
|
||||||
|
{
|
||||||
|
QSlider::blockSignals(BlockSignals);
|
||||||
|
|
||||||
|
QSlider::setValue(Value / m_Multiplier);////////////
|
||||||
|
|
||||||
|
if (!BlockSignals)
|
||||||
|
emit valueChanged(Value);
|
||||||
|
|
||||||
|
QSlider::blockSignals(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QMotorDoubleSlider::setRange(double Min, double Max)
|
||||||
|
{
|
||||||
|
QSlider::setRange(Min / m_Multiplier, Max / m_Multiplier);//////
|
||||||
|
|
||||||
|
emit rangeChanged(Min, Max);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QMotorDoubleSlider::setMinimum(double Min)
|
||||||
|
{
|
||||||
|
QSlider::setMinimum(Min / m_Multiplier);//////
|
||||||
|
|
||||||
|
emit rangeChanged(minimum(), maximum());
|
||||||
|
}
|
||||||
|
|
||||||
|
double QMotorDoubleSlider::minimum() const
|
||||||
|
{
|
||||||
|
return QSlider::minimum() * m_Multiplier;/////
|
||||||
|
}
|
||||||
|
|
||||||
|
void QMotorDoubleSlider::setMaximum(double Max)
|
||||||
|
{
|
||||||
|
QSlider::setMaximum(Max / m_Multiplier);//////
|
||||||
|
|
||||||
|
emit rangeChanged(minimum(), maximum());
|
||||||
|
}
|
||||||
|
|
||||||
|
double QMotorDoubleSlider::maximum() const
|
||||||
|
{
|
||||||
|
return QSlider::maximum() * m_Multiplier;///////
|
||||||
|
}
|
||||||
|
|
||||||
|
double QMotorDoubleSlider::value() const
|
||||||
|
{
|
||||||
|
int Value = QSlider::value();
|
||||||
|
return (double)Value * m_Multiplier;//////
|
||||||
|
}
|
||||||
|
|
||||||
|
double QMotorDoubleSlider::OriginalValue() const
|
||||||
|
{
|
||||||
|
int Value = QSlider::value();
|
||||||
|
return (double)Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
long QMotorDoubleSlider::getPositionPulse(double position)
|
||||||
|
{
|
||||||
|
return position / m_Multiplier;
|
||||||
|
}
|
||||||
|
|
||||||
|
double QMotorDoubleSlider::getDistanceFromPulse(int pulse)
|
||||||
|
{
|
||||||
|
return pulse * m_Multiplier;
|
||||||
|
}
|
||||||
38
HPPA/QMotorDoubleSlider.h
Normal file
38
HPPA/QMotorDoubleSlider.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#ifndef Q_MOTOR_DOUBLE_SLIDER_H
|
||||||
|
#define Q_MOTOR_DOUBLE_SLIDER_H
|
||||||
|
#include <QtGui/QtGui>
|
||||||
|
#include <QSlider>
|
||||||
|
class QMotorDoubleSlider : public QSlider
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QMotorDoubleSlider(QWidget* pParent = NULL);
|
||||||
|
|
||||||
|
double m_Multiplier;//<2F><><EFBFBD>ݹ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>廻<EFBFBD><E5BBBB>Ϊ<EFBFBD><CEAA><EFBFBD>룺1<EBA3BA><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(m_Multiplier)=<3D><><EFBFBD><EFBFBD>/(360/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*ϸ<>ֱ<EFBFBD><D6B1><EFBFBD>)<29><><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>https://wenku.baidu.com/view/4b2ea88bd0d233d4b14e69b8.html
|
||||||
|
double m_yMultiplier;//<2F><><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>1.8<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>135mm
|
||||||
|
|
||||||
|
void setRange(double Min, double Max);
|
||||||
|
void setMinimum(double Min);
|
||||||
|
double minimum() const;
|
||||||
|
void setMaximum(double Max);
|
||||||
|
double maximum() const;
|
||||||
|
double value() const;
|
||||||
|
double OriginalValue() const;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫʵ<D2AA>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD><C7BE><EFBFBD>
|
||||||
|
long getPositionPulse(double position);//<2F><><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE>뷵<EFBFBD><EBB7B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
||||||
|
double getDistanceFromPulse(int pulse);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void notifyValueChanged(int value);//<2F>ź<EFBFBD>valueChanged(int)<29><>wrap
|
||||||
|
void setValue(double Value, bool BlockSignals = true);//QSlider::setValue<75><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>wrap
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
signals :
|
||||||
|
void valueChanged(double Value);
|
||||||
|
void rangeChanged(double Min, double Max);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
|
#endif
|
||||||
87
HPPA/QYMotorDoubleSlider.cpp
Normal file
87
HPPA/QYMotorDoubleSlider.cpp
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "QYMotorDoubleSlider.h"
|
||||||
|
QYMotorDoubleSlider::QYMotorDoubleSlider(QWidget* pParent /*= NULL*/) :
|
||||||
|
QSlider(pParent),
|
||||||
|
//m_Multiplier(0.000108993972),//<2F>Ϻ<EFBFBD>ũ<EFBFBD><C5A9>Ժ<EFBFBD><D4BA><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>0.00052734375/5=0.00010546875<EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD>ȷֵΪ0.000544969862759644<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0.00054496986/5=0.000108993972<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>и<EFBFBD><EFBFBD><EFBFBD>еװ<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>5<EFBFBD><EFBFBD>
|
||||||
|
m_Multiplier(0.000108993972),//<2F>˰<EFBFBD><CBB0><EFBFBD>ũ<EFBFBD><C5A9><EFBFBD><EFBFBD>
|
||||||
|
m_yMultiplier(0.000108993972)//
|
||||||
|
{
|
||||||
|
connect(this, SIGNAL(valueChanged(int)), this, SLOT(notifyValueChanged(int)));
|
||||||
|
|
||||||
|
setSingleStep(1);
|
||||||
|
|
||||||
|
setOrientation(Qt::Horizontal);
|
||||||
|
setFocusPolicy(Qt::NoFocus);
|
||||||
|
}
|
||||||
|
|
||||||
|
//<2F><><EFBFBD>ⷢ<EFBFBD><E2B7A2>
|
||||||
|
void QYMotorDoubleSlider::notifyValueChanged(int Value)
|
||||||
|
{
|
||||||
|
emit valueChanged((double)Value * m_Multiplier);//////////
|
||||||
|
}
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
void QYMotorDoubleSlider::setValue(double Value, bool BlockSignals)
|
||||||
|
{
|
||||||
|
QSlider::blockSignals(BlockSignals);
|
||||||
|
|
||||||
|
QSlider::setValue(Value / m_Multiplier);////////////
|
||||||
|
|
||||||
|
if (!BlockSignals)
|
||||||
|
emit valueChanged(Value);
|
||||||
|
|
||||||
|
QSlider::blockSignals(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QYMotorDoubleSlider::setRange(double Min, double Max)
|
||||||
|
{
|
||||||
|
QSlider::setRange(Min / m_Multiplier, Max / m_Multiplier);//////
|
||||||
|
|
||||||
|
emit rangeChanged(Min, Max);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QYMotorDoubleSlider::setMinimum(double Min)
|
||||||
|
{
|
||||||
|
QSlider::setMinimum(Min / m_Multiplier);//////
|
||||||
|
|
||||||
|
emit rangeChanged(minimum(), maximum());
|
||||||
|
}
|
||||||
|
|
||||||
|
double QYMotorDoubleSlider::minimum() const
|
||||||
|
{
|
||||||
|
return QSlider::minimum() * m_Multiplier;/////
|
||||||
|
}
|
||||||
|
|
||||||
|
void QYMotorDoubleSlider::setMaximum(double Max)
|
||||||
|
{
|
||||||
|
QSlider::setMaximum(Max / m_Multiplier);//////
|
||||||
|
|
||||||
|
emit rangeChanged(minimum(), maximum());
|
||||||
|
}
|
||||||
|
|
||||||
|
double QYMotorDoubleSlider::maximum() const
|
||||||
|
{
|
||||||
|
return QSlider::maximum() * m_Multiplier;///////
|
||||||
|
}
|
||||||
|
|
||||||
|
double QYMotorDoubleSlider::value() const
|
||||||
|
{
|
||||||
|
int Value = QSlider::value();
|
||||||
|
return (double)Value * m_Multiplier;//////
|
||||||
|
}
|
||||||
|
|
||||||
|
double QYMotorDoubleSlider::OriginalValue() const
|
||||||
|
{
|
||||||
|
int Value = QSlider::value();
|
||||||
|
return (double)Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
long QYMotorDoubleSlider::getPositionPulse(double position)
|
||||||
|
{
|
||||||
|
return position / m_Multiplier;
|
||||||
|
}
|
||||||
|
|
||||||
|
double QYMotorDoubleSlider::getDistanceFromPulse(int pulse)
|
||||||
|
{
|
||||||
|
return pulse * m_Multiplier;
|
||||||
|
}
|
||||||
38
HPPA/QYMotorDoubleSlider.h
Normal file
38
HPPA/QYMotorDoubleSlider.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#ifndef Q_YMOTOR_DOUBLE_SLIDER_H
|
||||||
|
#define Q_YMOTOR_DOUBLE_SLIDER_H
|
||||||
|
#include <QtGui/QtGui>
|
||||||
|
#include <QSlider>
|
||||||
|
class QYMotorDoubleSlider : public QSlider//QYMotorDoubleSlider
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QYMotorDoubleSlider(QWidget* pParent = NULL);
|
||||||
|
|
||||||
|
double m_Multiplier;//<2F><><EFBFBD>ݹ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>廻<EFBFBD><E5BBBB>Ϊ<EFBFBD><CEAA><EFBFBD>룺1<EBA3BA><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(m_Multiplier)=<3D><><EFBFBD><EFBFBD>/(360/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*ϸ<>ֱ<EFBFBD><D6B1><EFBFBD>)<29><><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>https://wenku.baidu.com/view/4b2ea88bd0d233d4b14e69b8.html
|
||||||
|
double m_yMultiplier;//<2F><><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>1.8<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>135mm
|
||||||
|
|
||||||
|
void setRange(double Min, double Max);
|
||||||
|
void setMinimum(double Min);
|
||||||
|
double minimum() const;
|
||||||
|
void setMaximum(double Max);
|
||||||
|
double maximum() const;
|
||||||
|
double value() const;
|
||||||
|
double OriginalValue() const;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫʵ<D2AA>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD><C7BE><EFBFBD>
|
||||||
|
long getPositionPulse(double position);//<2F><><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE>뷵<EFBFBD><EBB7B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
||||||
|
double getDistanceFromPulse(int pulse);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void notifyValueChanged(int value);//<2F>ź<EFBFBD>valueChanged(int)<29><>wrap
|
||||||
|
void setValue(double Value, bool BlockSignals = true);//QSlider::setValue<75><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>wrap
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
signals :
|
||||||
|
void valueChanged(double Value);
|
||||||
|
void rangeChanged(double Min, double Max);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
|
#endif
|
||||||
68
HPPA/RgbCameraOperation.cpp
Normal file
68
HPPA/RgbCameraOperation.cpp
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "RgbCameraOperation.h"
|
||||||
|
|
||||||
|
RgbCameraOperation::RgbCameraOperation()
|
||||||
|
{
|
||||||
|
cam = nullptr;
|
||||||
|
m_ImageProcessor = new ImageProcessor();
|
||||||
|
m_func = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
RgbCameraOperation::~RgbCameraOperation()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void RgbCameraOperation::OpenCamera()
|
||||||
|
{
|
||||||
|
std::cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ+++++++++++++++++++++++++++++++++++++++++++" << std::endl;
|
||||||
|
cam = new cv::VideoCapture(0);
|
||||||
|
|
||||||
|
record = true;
|
||||||
|
|
||||||
|
while (record)
|
||||||
|
{
|
||||||
|
//std::cout << "<22>ɼ<EFBFBD>Ӱ<EFBFBD><D3B0>+++++++++++++++++++++++++++++++++++++++++++" << std::endl;
|
||||||
|
cam->read(frame);
|
||||||
|
m_qImage = m_ImageProcessor->Mat2QImage(frame);
|
||||||
|
|
||||||
|
emit PlotSignal();
|
||||||
|
}
|
||||||
|
|
||||||
|
cam->release();
|
||||||
|
|
||||||
|
emit CamClosed();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void RgbCameraOperation::OpenCamera_callback()
|
||||||
|
{
|
||||||
|
std::cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ+++++++++++++++++++++++++++++++++++++++++++" << std::endl;
|
||||||
|
cam = new cv::VideoCapture(0);
|
||||||
|
|
||||||
|
record = true;
|
||||||
|
|
||||||
|
while (record)
|
||||||
|
{
|
||||||
|
//std::cout << "<22>ɼ<EFBFBD>Ӱ<EFBFBD><D3B0>+++++++++++++++++++++++++++++++++++++++++++" << std::endl;
|
||||||
|
cam->read(frame);
|
||||||
|
m_qImage = m_ImageProcessor->Mat2QImage(frame);
|
||||||
|
|
||||||
|
if(m_func)
|
||||||
|
m_func();
|
||||||
|
}
|
||||||
|
|
||||||
|
cam->release();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RgbCameraOperation::setCallback(void(*func)())
|
||||||
|
{
|
||||||
|
m_func = func;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RgbCameraOperation::CloseCamera()
|
||||||
|
{
|
||||||
|
std::cout << "<EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ+++++++++++++++++++++++++++++++++++++++++++" << std::endl;
|
||||||
|
|
||||||
|
record = false;
|
||||||
|
}
|
||||||
47
HPPA/RgbCameraOperation.h
Normal file
47
HPPA/RgbCameraOperation.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
#pragma once
|
||||||
|
#ifndef RGBCAMERAOPERATION_H
|
||||||
|
#define RGBCAMERAOPERATION_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <opencv2/opencv.hpp>
|
||||||
|
#include <QImage>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
#include "imageProcessor.h"
|
||||||
|
|
||||||
|
typedef void(*func)();
|
||||||
|
|
||||||
|
class RgbCameraOperation:public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
RgbCameraOperation();
|
||||||
|
~RgbCameraOperation();
|
||||||
|
|
||||||
|
QImage m_qImage;
|
||||||
|
void setCallback(void(*func)());
|
||||||
|
|
||||||
|
private:
|
||||||
|
cv::Mat frame;
|
||||||
|
cv::VideoCapture *cam;
|
||||||
|
|
||||||
|
func m_func;
|
||||||
|
|
||||||
|
ImageProcessor* m_ImageProcessor;
|
||||||
|
|
||||||
|
bool record;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void OpenCamera();
|
||||||
|
void OpenCamera_callback();//<2F><>ʹ<EFBFBD><CAB9><EFBFBD>źŶ<C5BA>ʹ<EFBFBD>ûص<C3BB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ˢ<EFBFBD><CBA2><EFBFBD><EFBFBD>Ƶ
|
||||||
|
void CloseCamera();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void PlotSignal();
|
||||||
|
|
||||||
|
void CamClosed();
|
||||||
|
};
|
||||||
|
#endif // !RGBCAMERAOPERATION_H
|
||||||
5
HPPA/cpp.hint
Normal file
5
HPPA/cpp.hint
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
// 提示文件帮助 Visual Studio IDE 解释 Visual C++ 标识符,
|
||||||
|
// 如函数和宏的名称。
|
||||||
|
// 有关详细信息,请参见 https://go.microsoft.com/fwlink/?linkid=865984
|
||||||
|
#define Q_OBJECT public: QT_WARNING_PUSH Q_OBJECT_NO_OVERRIDE_WARNING static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); QT_TR_FUNCTIONS private: Q_OBJECT_NO_ATTRIBUTES_WARNING Q_DECL_HIDDEN_STATIC_METACALL static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); QT_WARNING_POP struct QPrivateSignal {}; QT_ANNOTATE_CLASS(qt_qobject, "")
|
||||||
|
#define Q_OBJECT
|
||||||
69
HPPA/fileOperation.cpp
Normal file
69
HPPA/fileOperation.cpp
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "fileOperation.h"
|
||||||
|
|
||||||
|
FileOperation::FileOperation()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
FileOperation::~FileOperation()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
string FileOperation::getDirectoryOfExe()
|
||||||
|
{
|
||||||
|
string exeName = _pgmptr;
|
||||||
|
|
||||||
|
string directory;
|
||||||
|
const size_t last_slash_idx = exeName.rfind('\\');
|
||||||
|
if (std::string::npos != last_slash_idx)
|
||||||
|
{
|
||||||
|
directory = exeName.substr(0, last_slash_idx);
|
||||||
|
}
|
||||||
|
|
||||||
|
return directory;
|
||||||
|
}
|
||||||
|
|
||||||
|
string FileOperation::getDirectoryFromString(string directory)
|
||||||
|
{
|
||||||
|
QString tmp = QString::fromStdString(directory);
|
||||||
|
QDir dir;
|
||||||
|
if (!dir.exists(tmp))
|
||||||
|
{
|
||||||
|
bool res = dir.mkpath(tmp);
|
||||||
|
//qDebug() << "<22>½<EFBFBD>Ŀ¼<C4BF>Ƿ<EFBFBD><C7B7>ɹ<EFBFBD>" << res;
|
||||||
|
}
|
||||||
|
return directory;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FileOperation::copyFile(QString source, QString target)
|
||||||
|
{
|
||||||
|
string source1 = source.toStdString();
|
||||||
|
string target1 = target.toStdString();
|
||||||
|
|
||||||
|
char buffer[256];
|
||||||
|
int n;
|
||||||
|
|
||||||
|
ifstream in(source1, ios_base::in | ios_base::binary);
|
||||||
|
ofstream out(target1, ios_base::out | ios_base::binary);
|
||||||
|
|
||||||
|
if (!in || !out){ cerr << "Open File Failure,Please Try Again!"; exit(1); }
|
||||||
|
|
||||||
|
while (!in.eof())
|
||||||
|
{
|
||||||
|
in.read(buffer, 256); //<2F><><EFBFBD>ļ<EFBFBD><C4BC>ж<EFBFBD>ȡ256<35><36><EFBFBD>ֽڵ<D6BD><DAB5><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
n = in.gcount(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>в<EFBFBD>֪<EFBFBD><D6AA>ȡ<EFBFBD>˶<EFBFBD><CBB6><EFBFBD><EFBFBD>ֽڵ<D6BD><DAB5><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>¡<EFBFBD>
|
||||||
|
out.write(buffer, n); //д<><D0B4><EFBFBD>Ǹ<EFBFBD><C7B8>ֽڵ<D6BD><DAB5><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
}
|
||||||
|
in.close();
|
||||||
|
out.close();
|
||||||
|
|
||||||
|
string::size_type idx;
|
||||||
|
|
||||||
|
idx = source1.find("hdr");
|
||||||
|
if (idx == string::npos) //<2F><><EFBFBD><EFBFBD><EFBFBD>ڡ<EFBFBD>
|
||||||
|
emit CopyFinishedSignal();
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
41
HPPA/fileOperation.h
Normal file
41
HPPA/fileOperation.h
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#ifndef FILE_OPERATIOIN_H
|
||||||
|
#define FILE_OPERATIOIN_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include<iostream>
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
class FileOperation :public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
FileOperation();
|
||||||
|
~FileOperation();
|
||||||
|
|
||||||
|
string getDirectoryOfExe();//getDirectoryOfExe
|
||||||
|
string getDirectoryFromString(string directory="C:/HPPA_image");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
bool copyFile(QString source, QString target);
|
||||||
|
|
||||||
|
/*bool moveFile(const string& source, const string& target);
|
||||||
|
bool deleteFile(const string& path);
|
||||||
|
bool hasFile(const string& path);
|
||||||
|
|
||||||
|
bool copyDirectory(const string& source, const string& target);
|
||||||
|
bool moveDirectory(const string& source, const string& target);
|
||||||
|
bool deleteDirectory(const string& path);*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void CopyFinishedSignal();//<2F><><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD>ź<EFBFBD>
|
||||||
|
};
|
||||||
|
#endif
|
||||||
297
HPPA/focusWindow.cpp
Normal file
297
HPPA/focusWindow.cpp
Normal file
@ -0,0 +1,297 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "focusWindow.h"
|
||||||
|
|
||||||
|
focusWindow::focusWindow(QWidget *parent, ResononImager * imager)
|
||||||
|
{
|
||||||
|
ui.setupUi(this);
|
||||||
|
|
||||||
|
disableBeforeConnect(true);
|
||||||
|
|
||||||
|
setAttribute(Qt::WA_DeleteOnClose);//<2F><><EFBFBD>ùرմ<D8B1><D5B4><EFBFBD><EFBFBD>͵<EFBFBD><CDB5>ô<EFBFBD><C3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
m_Imager = imager;
|
||||||
|
m_FocusState = 0;
|
||||||
|
m_ctrlFocusMotor = nullptr;
|
||||||
|
|
||||||
|
m_AutoFocusThread = new QThread();
|
||||||
|
|
||||||
|
connect(this->ui.connectMotor_btn, SIGNAL(clicked()), this, SLOT(onConnectMotor()));
|
||||||
|
connect(this->ui.logicZero_btn, SIGNAL(clicked()), this, SLOT(onMove2MotorLogicZero()));
|
||||||
|
connect(this->ui.max_btn, SIGNAL(clicked()), this, SLOT(onMove2MotorMax()));
|
||||||
|
connect(this->ui.add_btn, SIGNAL(clicked()), this, SLOT(onAdd()));
|
||||||
|
connect(this->ui.subtract_btn, SIGNAL(clicked()), this, SLOT(onSubtract()));
|
||||||
|
connect(this->ui.ultrasound_radioButton, SIGNAL(released()), this, SLOT(onUltrasound_radioButton()));
|
||||||
|
connect(this->ui.autoFocus_btn, SIGNAL(clicked()), this, SLOT(onAutoFocus()));
|
||||||
|
connect(this->ui.manualFocus_btn, SIGNAL(clicked()), this, SLOT(onManualFocus()));
|
||||||
|
|
||||||
|
//<2F><><EFBFBD>ҿ<EFBFBD><D2BF>ô<EFBFBD><C3B4>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD>ʾ
|
||||||
|
foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
|
||||||
|
{
|
||||||
|
QSerialPort serial;
|
||||||
|
serial.setPort(info);
|
||||||
|
if (serial.open(QIODevice::ReadWrite))
|
||||||
|
{
|
||||||
|
ui.motorPort_comboBox->addItem(serial.portName());
|
||||||
|
ui.ultrasoundPort_comboBox->addItem(serial.portName());
|
||||||
|
serial.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
ui.autoFocusProgress_progressBar->setMinimum(0);
|
||||||
|
ui.autoFocusProgress_progressBar->setMaximum(100);
|
||||||
|
ui.autoFocusProgress_progressBar->reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
focusWindow::~focusWindow()
|
||||||
|
{
|
||||||
|
printf("destroy focusWindow-------------------------\n");
|
||||||
|
|
||||||
|
delete m_ctrlFocusMotor;
|
||||||
|
//delete thread1, progressThread;
|
||||||
|
}
|
||||||
|
|
||||||
|
void focusWindow::disableBeforeConnect(bool disable)
|
||||||
|
{
|
||||||
|
ui.controlMotor_groupBox->setDisabled(disable);
|
||||||
|
ui.autoFocus_btn->setDisabled(disable);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool test(void *pCaller, int *x, int *y, void **pvdata)
|
||||||
|
{
|
||||||
|
focusWindow *p = (focusWindow *)pCaller;
|
||||||
|
|
||||||
|
p->m_Imager->GetImageSize(*x, *y);
|
||||||
|
USHORT *pusData = new USHORT[(*x)*(*y)];
|
||||||
|
|
||||||
|
p->m_Imager->m_ResononImager.start();
|
||||||
|
p->m_Imager->m_ResononImager.get_frame(pusData);
|
||||||
|
p->m_Imager->m_ResononImager.stop();
|
||||||
|
|
||||||
|
|
||||||
|
BYTE *pbData = (BYTE*)pusData;
|
||||||
|
*pvdata = pbData;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void focusWindow::onConnectMotor()
|
||||||
|
{
|
||||||
|
if (m_ctrlFocusMotor != nullptr)
|
||||||
|
{
|
||||||
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-------------------------\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isUltrasound = ui.ultrasound_radioButton->isChecked();
|
||||||
|
|
||||||
|
QString motorPortTmp = ui.motorPort_comboBox->currentText();
|
||||||
|
QString ultrasoundPortTmp = ui.ultrasoundPort_comboBox->currentText();
|
||||||
|
|
||||||
|
QRegExp rx("\\d+$");
|
||||||
|
rx.indexIn(motorPortTmp, 0);
|
||||||
|
int motorPort = rx.cap(0).toInt();
|
||||||
|
rx.indexIn(ultrasoundPortTmp, 0);
|
||||||
|
int ultrasoundPort = rx.cap(0).toInt();
|
||||||
|
|
||||||
|
int minPos = 120;
|
||||||
|
int maxPos = 1000;
|
||||||
|
|
||||||
|
if (isUltrasound)
|
||||||
|
{
|
||||||
|
PortInfo motor;
|
||||||
|
motor.iPortType = 0;
|
||||||
|
motor.indexParity = 0;
|
||||||
|
|
||||||
|
motor.iPortNumber = motorPort;
|
||||||
|
motor.indexBaudRate = 0x13;
|
||||||
|
motor.indexBytesize = 3;
|
||||||
|
motor.indexStopBits = 0;
|
||||||
|
|
||||||
|
PortInfo ultrasound;
|
||||||
|
ultrasound.iPortType = 0;
|
||||||
|
ultrasound.indexParity = 0;
|
||||||
|
ultrasound.iPortNumber = ultrasoundPort;
|
||||||
|
ultrasound.indexBaudRate = 0x0C;
|
||||||
|
ultrasound.indexBytesize = 3;
|
||||||
|
ultrasound.indexStopBits = 0;
|
||||||
|
|
||||||
|
m_ctrlFocusMotor = new CFocusMotorControl();
|
||||||
|
|
||||||
|
m_ctrlFocusMotor->SetLogicZero(minPos);
|
||||||
|
m_ctrlFocusMotor->SetLimit(minPos, maxPos);
|
||||||
|
m_iMotorMaxPos = maxPos;
|
||||||
|
m_ctrlFocusMotor->InitSystem(motor, ultrasound, test, this);
|
||||||
|
m_ctrlFocusMotor->MoveToLogicZero();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PortInfo motor;
|
||||||
|
motor.iPortType = 0;
|
||||||
|
motor.indexParity = 0;
|
||||||
|
motor.iPortNumber = motorPort;
|
||||||
|
motor.indexBaudRate = 0x13;
|
||||||
|
motor.indexBytesize = 3;
|
||||||
|
motor.indexStopBits = 0;
|
||||||
|
|
||||||
|
m_ctrlFocusMotor = new CFocusMotorControl();
|
||||||
|
|
||||||
|
m_ctrlFocusMotor->SetLogicZero(minPos);
|
||||||
|
m_ctrlFocusMotor->SetLimit(minPos, maxPos);
|
||||||
|
m_iMotorMaxPos = maxPos;
|
||||||
|
m_ctrlFocusMotor->InitSystem(motor, test, this);
|
||||||
|
m_ctrlFocusMotor->MoveToLogicZero();
|
||||||
|
}
|
||||||
|
|
||||||
|
disableBeforeConnect(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void focusWindow::onMove2MotorLogicZero()
|
||||||
|
{
|
||||||
|
m_ctrlFocusMotor->MoveToLogicZero();
|
||||||
|
}
|
||||||
|
|
||||||
|
void focusWindow::onMove2MotorMax()
|
||||||
|
{
|
||||||
|
m_ctrlFocusMotor->MoveToPos(m_iMotorMaxPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
void focusWindow::onAdd()
|
||||||
|
{
|
||||||
|
DriverInfo di;
|
||||||
|
m_ctrlFocusMotor->GetDriverStatus(di);
|
||||||
|
|
||||||
|
int stepSize = ui.addStepSize_lineEdit->text().toInt();
|
||||||
|
|
||||||
|
m_ctrlFocusMotor->MoveToPos(di.iAbsPosition + stepSize);
|
||||||
|
|
||||||
|
m_ctrlFocusMotor->GetDriverStatus(di);
|
||||||
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ã<EFBFBD>%d", di.iAbsPosition);
|
||||||
|
std::cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><EFBFBD>" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void focusWindow::onSubtract()
|
||||||
|
{
|
||||||
|
DriverInfo di;
|
||||||
|
m_ctrlFocusMotor->GetDriverStatus(di);
|
||||||
|
|
||||||
|
int stepSize = ui.subtractStepSize_lineEdit->text().toInt();
|
||||||
|
|
||||||
|
m_ctrlFocusMotor->MoveToPos(di.iAbsPosition - stepSize);
|
||||||
|
|
||||||
|
m_ctrlFocusMotor->GetDriverStatus(di);
|
||||||
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ã<EFBFBD>%d", di.iAbsPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
void focusWindow::onAutoFocus()
|
||||||
|
{
|
||||||
|
bool isUltrasound = ui.ultrasound_radioButton->isChecked();
|
||||||
|
WorkerThread2 *thread1 = new WorkerThread2(m_ctrlFocusMotor, isUltrasound);
|
||||||
|
|
||||||
|
connect(thread1, SIGNAL(AutoFocusFinishedSignal()), this, SLOT(onAutoFocusFinished()));
|
||||||
|
|
||||||
|
thread1->start();
|
||||||
|
this->setDisabled(true);
|
||||||
|
|
||||||
|
WorkerThread4 *progressThread = new WorkerThread4(m_ctrlFocusMotor);
|
||||||
|
connect(progressThread, SIGNAL(AutoFocusProgressSignal(int)), this, SLOT(onAutoFocusProgress(int)));
|
||||||
|
progressThread->start();
|
||||||
|
ui.autoFocusProgress_progressBar->reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void focusWindow::onManualFocus()
|
||||||
|
{
|
||||||
|
m_FocusState += 1;
|
||||||
|
std::cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><EFBFBD>" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
if (m_FocusState % 2 == 1)
|
||||||
|
{
|
||||||
|
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
||||||
|
emit StartManualFocusSignal(1);
|
||||||
|
ui.manualFocus_btn->setText(QString::fromLocal8Bit("ֹͣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||||
|
|
||||||
|
ui.manualFocus_btn->setStyleSheet("QWidget{background-color:rgb(255,0,0);}");
|
||||||
|
|
||||||
|
//std::cout << "------------------------------------------<2D><>" << m_FocusState << std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
emit StartManualFocusSignal(0);
|
||||||
|
m_Imager->setFocusControlState(false);
|
||||||
|
|
||||||
|
ui.manualFocus_btn->setText(QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||||
|
|
||||||
|
ui.manualFocus_btn->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void focusWindow::onAutoFocusFinished()
|
||||||
|
{
|
||||||
|
this->setDisabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void focusWindow::onAutoFocusProgress(int progress)
|
||||||
|
{
|
||||||
|
//std::cout << "<22><><EFBFBD>ȣ<EFBFBD>" << progress << std::endl;
|
||||||
|
|
||||||
|
ui.autoFocusProgress_progressBar->setValue(progress);
|
||||||
|
}
|
||||||
|
|
||||||
|
void focusWindow::onUltrasound_radioButton()
|
||||||
|
{
|
||||||
|
bool isUltrasound = ui.ultrasound_radioButton->isChecked();
|
||||||
|
|
||||||
|
if (isUltrasound)
|
||||||
|
{
|
||||||
|
ui.ultrasoundPort_comboBox->setEnabled(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui.ultrasoundPort_comboBox->setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WorkerThread2::WorkerThread2(CFocusMotorControl * ctrlFocusMotor, bool isUltrasound)
|
||||||
|
{
|
||||||
|
m_ctrlFocusMotor = ctrlFocusMotor;
|
||||||
|
m_bIsUltrasound = isUltrasound;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WorkerThread2::run()
|
||||||
|
{
|
||||||
|
if (m_bIsUltrasound)
|
||||||
|
{
|
||||||
|
m_ctrlFocusMotor->SetFitParams(0.0017, 0.3277);
|
||||||
|
m_ctrlFocusMotor->StartAutoFocus(5, 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_ctrlFocusMotor->StartAutoFocus(820, 910, 10, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
emit AutoFocusFinishedSignal();
|
||||||
|
}
|
||||||
|
|
||||||
|
WorkerThread4::WorkerThread4(CFocusMotorControl * ctrlFocusMotor)
|
||||||
|
{
|
||||||
|
m_ctrlFocusMotor = ctrlFocusMotor;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WorkerThread4::run()
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
int progress = m_ctrlFocusMotor->GetProgressIndex();
|
||||||
|
|
||||||
|
//std::cout << "WorkerThread4::run----<2D>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ<EFBFBD>" << progress << std::endl;
|
||||||
|
|
||||||
|
emit AutoFocusProgressSignal(progress);
|
||||||
|
if (progress == 100)
|
||||||
|
{
|
||||||
|
//std::cout << "<22>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>" << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
msleep(200);
|
||||||
|
}
|
||||||
|
}
|
||||||
96
HPPA/focusWindow.h
Normal file
96
HPPA/focusWindow.h
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "windows.h"
|
||||||
|
#include <cstdio>
|
||||||
|
#include <iostream>
|
||||||
|
#include <exception>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <cmath>
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
|
#include <QtWidgets/QMainWindow>
|
||||||
|
#include <QThread>
|
||||||
|
#include <QLineSeries>
|
||||||
|
#include <QChart>
|
||||||
|
#include <QChartView>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QtSerialPort/QSerialPort>
|
||||||
|
#include <QtSerialPort/QSerialPortInfo>
|
||||||
|
|
||||||
|
#include "ui_FocusDialog.h"
|
||||||
|
#include "AbstractPortMiscDefines.h"
|
||||||
|
#include "CFocusMotorControl.h"
|
||||||
|
|
||||||
|
#include "resononImager.h"
|
||||||
|
|
||||||
|
class focusWindow:public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
focusWindow(QWidget *parent = Q_NULLPTR);
|
||||||
|
focusWindow(QWidget *parent, ResononImager * imager);
|
||||||
|
~focusWindow();
|
||||||
|
|
||||||
|
ResononImager * m_Imager;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::focusDialog ui;
|
||||||
|
QThread *m_AutoFocusThread;
|
||||||
|
int m_FocusState;
|
||||||
|
|
||||||
|
int m_iMotorMaxPos;
|
||||||
|
|
||||||
|
CFocusMotorControl* m_ctrlFocusMotor;
|
||||||
|
|
||||||
|
void disableBeforeConnect(bool disable);
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void onConnectMotor();
|
||||||
|
void onMove2MotorLogicZero();
|
||||||
|
void onMove2MotorMax();
|
||||||
|
void onAdd();
|
||||||
|
void onSubtract();
|
||||||
|
void onAutoFocus();
|
||||||
|
void onManualFocus();
|
||||||
|
void onAutoFocusFinished();
|
||||||
|
void onAutoFocusProgress(int progress);
|
||||||
|
void onUltrasound_radioButton();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void StartManualFocusSignal(int);//1<><31><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
};
|
||||||
|
|
||||||
|
class WorkerThread2 : public QThread
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
private:
|
||||||
|
bool m_bIsUltrasound;
|
||||||
|
|
||||||
|
public:
|
||||||
|
WorkerThread2(CFocusMotorControl * ctrlFocusMotor,bool isUltrasound);
|
||||||
|
CFocusMotorControl *m_ctrlFocusMotor;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void run();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void AutoFocusFinishedSignal();
|
||||||
|
};
|
||||||
|
|
||||||
|
class WorkerThread4 : public QThread
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
private:
|
||||||
|
|
||||||
|
public:
|
||||||
|
WorkerThread4(CFocusMotorControl * ctrlFocusMotor);
|
||||||
|
CFocusMotorControl *m_ctrlFocusMotor;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void run();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void AutoFocusProgressSignal(int);
|
||||||
|
};
|
||||||
193
HPPA/image2display.cpp
Normal file
193
HPPA/image2display.cpp
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "image2display.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
CImage::CImage(QWidget* pParent) :QObject(pParent)
|
||||||
|
{
|
||||||
|
m_QRgbImage = nullptr;
|
||||||
|
m_matRgbImage = nullptr;
|
||||||
|
m_matFocusGrayImage = nullptr;
|
||||||
|
m_qimageFocusGrayImage = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CImage::SetRgbImageWidthAndHeight(int BandCount, int Sample, int FrameNumber)
|
||||||
|
{
|
||||||
|
using namespace cv;
|
||||||
|
|
||||||
|
if (m_QRgbImage != nullptr)
|
||||||
|
{
|
||||||
|
delete m_QRgbImage;//<2F><><EFBFBD><EFBFBD><EFBFBD>⣿<EFBFBD><E2A3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
}
|
||||||
|
//m_QRgbImage = new QImage(Sample, FrameNumber, QImage::Format_RGB888);
|
||||||
|
|
||||||
|
|
||||||
|
if (m_matRgbImage != nullptr)
|
||||||
|
{
|
||||||
|
delete m_matRgbImage;
|
||||||
|
}
|
||||||
|
m_matRgbImage = new Mat(FrameNumber, Sample, CV_16UC3, Scalar(0, 0, 0));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (m_qimageFocusGrayImage == nullptr)
|
||||||
|
{
|
||||||
|
m_qimageFocusGrayImage = new QImage(Sample, BandCount, QImage::Format_RGB32);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (m_matFocusGrayImage == nullptr)
|
||||||
|
{
|
||||||
|
m_matFocusGrayImage = new Mat(BandCount, Sample, CV_16U, Scalar(0));
|
||||||
|
|
||||||
|
//cv::Mat matAdjustPreview = Mat::zeros(BandCount, Sample, CV_16U);
|
||||||
|
}
|
||||||
|
|
||||||
|
//cv::Mat matAdjustPreview = Mat::zeros(BandCount, Sample, CV_16U);
|
||||||
|
//m_matFocusGrayImage = matAdjustPreview;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << FrameNumber << std::endl;
|
||||||
|
|
||||||
|
m_iFrameCounter = 0;//ÿ<>ζ<EFBFBD><CEB6><EFBFBD><EFBFBD><EFBFBD>Ϊ0
|
||||||
|
m_iSampleNumber = Sample;
|
||||||
|
m_iBandNumber = BandCount;
|
||||||
|
m_iFrameNumber = FrameNumber;
|
||||||
|
|
||||||
|
//std::cout << "rgbӰ<62><D3B0><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>ַΪ<D6B7><CEAA>" << m_QRgbImage << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CImage::FillRgbImage(unsigned short *datacube)
|
||||||
|
{
|
||||||
|
//uchar==unsigned char<61><72><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>С<EFBFBD><D0A1>1<EFBFBD><31><EFBFBD>ֽڣ<D6BD><DAA3><EFBFBD>ΧΪ0-255
|
||||||
|
//uchar * imagebits24 = m_QRgbImage->bits();
|
||||||
|
|
||||||
|
//uchar * imagebits24 = m_QRgbImage->scanLine(m_iFrameCounter);//??????????????????????????????????????????????????????????????????????
|
||||||
|
|
||||||
|
unsigned short r, g, b;
|
||||||
|
|
||||||
|
for (int j = 0; j < m_iSampleNumber; j++)
|
||||||
|
{
|
||||||
|
//std::cout << "rgbͼ<62><CDBC>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD>" << j << std::endl;
|
||||||
|
|
||||||
|
//ȡֵ<C8A1><D6B5>һ֡Ӱ<D6A1><D3B0><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD>rgb<67><62>Ԫֵ
|
||||||
|
r = *(datacube + 121 * m_iSampleNumber + j);
|
||||||
|
g = *(datacube + 79 * m_iSampleNumber + j);
|
||||||
|
b = *(datacube + 40 * m_iSampleNumber + j);
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD>Ԫֵ<D4AA><D6B5>ֵ<EFBFBD><D6B5>cv::Mat<61>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫֵ<D4AA><D6B5>https://zhuanlan.zhihu.com/p/51842288
|
||||||
|
//int dataType = m_matRgbImage->type();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪCV_16UC3ʱ<33><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>18
|
||||||
|
//std::cout << "m_matRgbImage<67><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>" << dataType << std::endl;
|
||||||
|
if (m_matRgbImage->type() == CV_16UC3)
|
||||||
|
{
|
||||||
|
//std::cout << "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>" << std::endl;
|
||||||
|
m_matRgbImage->at<cv::Vec3w>(m_iFrameCounter, j)[2] = r;
|
||||||
|
m_matRgbImage->at<cv::Vec3w>(m_iFrameCounter, j)[1] = g;
|
||||||
|
m_matRgbImage->at<cv::Vec3w>(m_iFrameCounter, j)[0] = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////<2F><><EFBFBD><EFBFBD>Ԫֵ<D4AA><D6B5>4095<39><35>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>255<35>ķ<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>QImage<67><65>
|
||||||
|
//imagebits24[j * 3] = uchar(r * 255 / 4095);
|
||||||
|
//imagebits24[j * 3 + 1] = uchar(g * 255 / 4095);
|
||||||
|
//imagebits24[j * 3 + 2] = uchar(b * 255 / 4095);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_iFrameCounter++;
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD>rgbͼƬ
|
||||||
|
if (m_iFrameCounter % m_iFramerate == 0 || m_iFrameCounter == m_iFrameNumber - 1)
|
||||||
|
{
|
||||||
|
////<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||||
|
//FileOperation * fileOperation = new FileOperation();
|
||||||
|
//string directory = fileOperation->getDirectoryOfExe();
|
||||||
|
//string rgbFilePathStrech = directory + "\\tmp_image_strech.png";//û<><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼƬ
|
||||||
|
//string rgbFilePathNoStrech = directory + "\\tmp_image_no_strech.png";//<2F><><EFBFBD><EFBFBD>ͼƬ
|
||||||
|
|
||||||
|
//m_QRgbImage->save(QString::fromStdString(rgbFilePathNoStrech), "PNG");
|
||||||
|
|
||||||
|
//cv::imwrite(rgbFilePathNoStrech, *m_matRgbImage);
|
||||||
|
//cv::imwrite(rgbFilePathStrech, CStretch(*m_matRgbImage, 0.01));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CImage::FillFocusGrayImage(unsigned short * datacube)
|
||||||
|
{
|
||||||
|
int rowCount = m_matFocusGrayImage->rows;
|
||||||
|
int colCount = m_matFocusGrayImage->cols;
|
||||||
|
for (unsigned short i = 0; i < m_matFocusGrayImage->rows; i++)
|
||||||
|
{
|
||||||
|
for (unsigned short j = 0; j < m_matFocusGrayImage->cols; j++)
|
||||||
|
{
|
||||||
|
//m_matFocusGrayImage->at<ushort>(i, j) = *(datacube + m_matFocusGrayImage->cols*i + j);
|
||||||
|
m_matFocusGrayImage->at<ushort>(i, j) = datacube[m_matFocusGrayImage->cols*i + j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//int rowCount = m_matFocusGrayImage.rows;
|
||||||
|
//int colCount = m_matFocusGrayImage.cols;
|
||||||
|
////memcpy(m_matFocusGrayImage.data, datacube, rowCount*colCount);
|
||||||
|
//for (unsigned short i = 0; i < m_matFocusGrayImage.rows; i++)
|
||||||
|
//{
|
||||||
|
// for (unsigned short j = 0; j < m_matFocusGrayImage.cols; j++)
|
||||||
|
// {
|
||||||
|
// m_matFocusGrayImage.at<ushort>(i, j) = *(datacube + m_matFocusGrayImage.cols*i + j);
|
||||||
|
// //m_matFocusGrayImage.at<ushort>(i, j) = datacube[colCount*i + j];
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//<2F><>mat<61><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||||
|
//cv::imwrite("D:/delete/2222222222/test.bmp", m_matFocusGrayImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CImage::FillFocusGrayQImage(unsigned short * datacube)
|
||||||
|
{
|
||||||
|
float two_eight = pow(2.0, 8);
|
||||||
|
float two_sixteen = pow(2.0, 12);
|
||||||
|
|
||||||
|
int width = m_qimageFocusGrayImage->width();
|
||||||
|
int height = m_qimageFocusGrayImage->height();
|
||||||
|
for (unsigned short i = 0; i < height; i++)
|
||||||
|
{
|
||||||
|
for (unsigned short j = 0; j < width; j++)
|
||||||
|
{
|
||||||
|
//uint tmp = (two_eight* *(datacube + width * i + j)) / two_sixteen;
|
||||||
|
uint tmp = (two_eight* datacube[width*i + j]) / two_sixteen;
|
||||||
|
//uint tmp = datacube[width*i + j];
|
||||||
|
|
||||||
|
|
||||||
|
//m_qimageFocusGrayImage->setPixel(j, i, tmp);
|
||||||
|
m_qimageFocusGrayImage->setPixel(j, i, qRgb((unsigned char)tmp, (unsigned char)tmp, (unsigned char)tmp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_qimageFocusGrayImage->save("D:/delete/2222222222/test.bmp");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*float two_eight = pow(2.0, 8);
|
||||||
|
float two_sixteen = pow(2.0, 16);
|
||||||
|
QImage *qi = new QImage(imwidth, imheight, QImage::Format_RGB32);
|
||||||
|
for (int i = 0; i < imheight; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < imwidth; j++)
|
||||||
|
{
|
||||||
|
floatData[i*imwidth + j] = (two_eight* floatData[i*imwidth + j]) / two_sixteen;
|
||||||
|
qi->setPixel(j, i, qRgb((unsigned char)floatData[i*imwidth + j], (unsigned char)floatData[i*imwidth + j], (unsigned char)floatData[i*imwidth + j]));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
}
|
||||||
58
HPPA/image2display.h
Normal file
58
HPPA/image2display.h
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#ifndef CIMAGE
|
||||||
|
#define CIMAGE
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
|
#include <opencv2/opencv.hpp>//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
//#include <opencv2/core/core.hpp>
|
||||||
|
//#include <opencv2/highgui/highgui.hpp>
|
||||||
|
|
||||||
|
#include "QObject"
|
||||||
|
#include "QImage"
|
||||||
|
|
||||||
|
#include "fileOperation.h"
|
||||||
|
|
||||||
|
|
||||||
|
class CImage :public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
CImage(QWidget* pParent = NULL);
|
||||||
|
//~CImage();
|
||||||
|
void SetRgbImageWidthAndHeight(int BandCount, int Sample, int FrameNumber);
|
||||||
|
void FillRgbImage(unsigned short *datacube);
|
||||||
|
void FillFocusGrayImage(unsigned short *datacube);
|
||||||
|
void FillFocusGrayQImage(unsigned short * datacube);
|
||||||
|
|
||||||
|
QImage *m_QRgbImage;
|
||||||
|
cv::Mat *m_matRgbImage;
|
||||||
|
|
||||||
|
QImage *m_qimageFocusGrayImage;
|
||||||
|
cv::Mat *m_matFocusGrayImage;//<2F><><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʾһ֡<D2BB>ĻҶ<C4BB>ͼ
|
||||||
|
//cv::Mat m_matFocusGrayImage;//<2F><><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʾһ֡<D2BB>ĻҶ<C4BB>ͼ
|
||||||
|
|
||||||
|
|
||||||
|
//<2F><><EFBFBD>Ƹ<EFBFBD><C6B8><EFBFBD><EFBFBD><EFBFBD>rgbͼ<62><CDBC><EFBFBD>ڼ<EFBFBD>֡<EFBFBD><D6A1><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>Ϊ0<CEAA><30>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><C3BA><EFBFBD>SetRgbImageWidthAndHeight<68><74>2<EFBFBD><32>ÿ<EFBFBD>ο<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ
|
||||||
|
int m_iFrameCounter;
|
||||||
|
|
||||||
|
|
||||||
|
int m_iFramerate;//
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_iSampleNumber;//
|
||||||
|
int m_iBandNumber;//
|
||||||
|
|
||||||
|
int m_iFrameNumber;//
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
signals :
|
||||||
|
void sendstr(QString str);
|
||||||
|
void sendstr1(QString str);
|
||||||
|
void refreslabelimg(QImage* img1);
|
||||||
|
};
|
||||||
|
#endif
|
||||||
169
HPPA/imageProcessor.cpp
Normal file
169
HPPA/imageProcessor.cpp
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "imageProcessor.h"
|
||||||
|
|
||||||
|
ImageProcessor::ImageProcessor()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageProcessor::~ImageProcessor()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<cv::Point2f> ImageProcessor::CHistogram(const cv::Mat img)
|
||||||
|
{
|
||||||
|
cv::Mat mimg = img.clone();
|
||||||
|
int rows = mimg.rows;
|
||||||
|
int cols = mimg.cols;
|
||||||
|
//ͳ<><CDB3>ÿ<EFBFBD><C3BF><EFBFBD>Ҷȳ<D2B6><C8B3>ֵĴ<D6B5><C4B4><EFBFBD>
|
||||||
|
std::vector<long int> hisnum(4096, 0);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
for (int i(0); i < rows; ++i)
|
||||||
|
{
|
||||||
|
//std::cout << "i<><69>" << i << std::endl;
|
||||||
|
for (int j(0); j < cols; ++j)
|
||||||
|
{
|
||||||
|
//std::cout << "j<><6A>" << j << std::endl;
|
||||||
|
unsigned short gv = mimg.at<unsigned short>(i, j);
|
||||||
|
//std::cout << "gvֵ<76><D6B5>" << gv << std::endl;
|
||||||
|
|
||||||
|
//<2F>Է<EFBFBD><D4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>Ǹ<EFBFBD><C7B8><EFBFBD><EFBFBD>ڿ۳<DABF><DBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>п<EFBFBD><D0BF><EFBFBD>Ϊ<EFBFBD><CEAA>ֵ
|
||||||
|
//<2F><><EFBFBD><EFBFBD>mat<61><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪCV_16UC3<43><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD>ֵʱ<D6B5><CAB1><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>Ϊ65535
|
||||||
|
if (gv > 4096)
|
||||||
|
{
|
||||||
|
++hisnum[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
++hisnum[gv];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>Ҷ<EFBFBD>Ƶ<EFBFBD><C6B5>
|
||||||
|
long int pnum = rows * cols;
|
||||||
|
std::vector<cv::Point2f> hisp;
|
||||||
|
for (int i(0); i < hisnum.size(); ++i)
|
||||||
|
{
|
||||||
|
float p = (float)hisnum[i] / pnum;
|
||||||
|
hisp.push_back(cv::Point2f(i, p));
|
||||||
|
}
|
||||||
|
return hisp;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint ImageProcessor::MaxRatio(const std::vector<cv::Point2f> data, const float ratio)
|
||||||
|
{
|
||||||
|
float maxp(0);
|
||||||
|
uint outnum(0);
|
||||||
|
for (int i(data.size() - 1); i >= 0; --i)
|
||||||
|
{
|
||||||
|
maxp += data[i].y;
|
||||||
|
if (maxp >= ratio)
|
||||||
|
{
|
||||||
|
outnum = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return outnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint ImageProcessor::MinRatio(const std::vector<cv::Point2f> data, const float ratio)
|
||||||
|
{
|
||||||
|
float minp(0);
|
||||||
|
uint outnum(0);
|
||||||
|
for (int i(0); i < data.size(); ++i)
|
||||||
|
{
|
||||||
|
minp += data[i].y;
|
||||||
|
if (minp >= ratio)
|
||||||
|
{
|
||||||
|
outnum = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return outnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
QImage ImageProcessor::Mat2QImage(cv::Mat cvImg)//https://www.cnblogs.com/annt/p/ant003.html
|
||||||
|
{
|
||||||
|
QImage qImg;
|
||||||
|
if (cvImg.channels() == 3) //3 channels color image
|
||||||
|
{
|
||||||
|
cv::cvtColor(cvImg, cvImg, CV_BGR2RGB);
|
||||||
|
qImg = QImage((const unsigned char*)(cvImg.data),
|
||||||
|
cvImg.cols, cvImg.rows,
|
||||||
|
cvImg.cols*cvImg.channels(),
|
||||||
|
QImage::Format_RGB888);
|
||||||
|
}
|
||||||
|
else if (cvImg.channels() == 1) //grayscale image
|
||||||
|
{
|
||||||
|
qImg = QImage((const unsigned char*)(cvImg.data),
|
||||||
|
cvImg.cols, cvImg.rows,
|
||||||
|
cvImg.cols*cvImg.channels(),
|
||||||
|
QImage::Format_Indexed8);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qImg = QImage((const unsigned char*)(cvImg.data),
|
||||||
|
cvImg.cols, cvImg.rows,
|
||||||
|
cvImg.cols*cvImg.channels(),
|
||||||
|
QImage::Format_RGB888);
|
||||||
|
}
|
||||||
|
|
||||||
|
return qImg;
|
||||||
|
}
|
||||||
|
|
||||||
|
cv::Mat ImageProcessor::CStretchDeal(const cv::Mat img, const uint minnum, const uint maxnum)
|
||||||
|
{
|
||||||
|
cv::Mat mimg = img.clone();
|
||||||
|
int rows = mimg.rows;
|
||||||
|
int cols = mimg.cols;
|
||||||
|
cv::Mat nimg = cv::Mat::zeros(rows, cols, CV_8U);
|
||||||
|
//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
float dertnum = maxnum - minnum;
|
||||||
|
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
||||||
|
for (int i(0); i < rows; ++i)
|
||||||
|
{
|
||||||
|
for (int j(0); j < cols; ++j)
|
||||||
|
{
|
||||||
|
unsigned short a = mimg.at<unsigned short>(i, j);
|
||||||
|
//С<><D0A1>ratio<69><6F>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>ֵȡ0
|
||||||
|
if (a <= minnum)
|
||||||
|
nimg.at<uchar>(i, j) = 0;
|
||||||
|
//<2F><><EFBFBD><EFBFBD>ratioֵ<6F><D6B5>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>ֵȡ255
|
||||||
|
else if (a >= maxnum)
|
||||||
|
nimg.at<uchar>(i, j) = 255;
|
||||||
|
//<2F>м<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>쵽0-255
|
||||||
|
else
|
||||||
|
nimg.at<uchar>(i, j) = 255 * (mimg.at<unsigned short>(i, j) - minnum) / dertnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nimg;
|
||||||
|
}
|
||||||
|
|
||||||
|
cv::Mat ImageProcessor::CStretch(const cv::Mat img, const float ratio)
|
||||||
|
{
|
||||||
|
//Ӱ<><D3B0><EFBFBD><EFBFBD>RGB<47><42><EFBFBD><EFBFBD><EFBFBD>Ҷ<EFBFBD>ֱ<EFBFBD><D6B1>ͼ
|
||||||
|
cv::Mat mimg = img.clone();
|
||||||
|
cv::Mat bgr[3];
|
||||||
|
split(mimg, bgr);
|
||||||
|
std::vector<cv::Point2f> hb = CHistogram(bgr[0]);
|
||||||
|
std::vector<cv::Point2f> hg = CHistogram(bgr[1]);
|
||||||
|
std::vector<cv::Point2f> hr = CHistogram(bgr[2]);
|
||||||
|
//ͳ<><CDB3>ֱ<EFBFBD><D6B1>ͼ<EFBFBD>ۼ<EFBFBD>Ƶ<EFBFBD><C6B5>ratioֵ<6F><D6B5>Ӧ<EFBFBD>ĻҶ<C4BB>
|
||||||
|
uint minb = MinRatio(hb, ratio);
|
||||||
|
uint ming = MinRatio(hg, ratio);
|
||||||
|
uint minr = MinRatio(hr, ratio);
|
||||||
|
uint maxb = MaxRatio(hb, ratio);
|
||||||
|
uint maxg = MaxRatio(hg, ratio);
|
||||||
|
uint maxr = MaxRatio(hr, ratio);
|
||||||
|
//<2F><>ʼ<EFBFBD><CABC><EFBFBD>칤<EFBFBD><ECB9A4>
|
||||||
|
cv::Mat b, g, r;
|
||||||
|
b = CStretchDeal(bgr[0], minb, maxb);
|
||||||
|
g = CStretchDeal(bgr[1], ming, maxg);
|
||||||
|
r = CStretchDeal(bgr[2], minr, maxr);
|
||||||
|
//<2F>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
cv::Mat newbgr;
|
||||||
|
newbgr.create(img.rows, img.cols, CV_32FC3);
|
||||||
|
cv::Mat nbgr[3] = { b, g, r };
|
||||||
|
merge(nbgr, 3, newbgr);
|
||||||
|
return newbgr;
|
||||||
|
}
|
||||||
41
HPPA/imageProcessor.h
Normal file
41
HPPA/imageProcessor.h
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#pragma once
|
||||||
|
#ifndef IMAGEPROCESSOR
|
||||||
|
#define IMAGEPROCESSOR
|
||||||
|
|
||||||
|
#include <opencv2/opencv.hpp>//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
//#include <opencv2/core/core.hpp>
|
||||||
|
//#include <opencv2/highgui/highgui.hpp>
|
||||||
|
|
||||||
|
#include "QObject"
|
||||||
|
#include "QImage"
|
||||||
|
|
||||||
|
|
||||||
|
class ImageProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ImageProcessor();
|
||||||
|
~ImageProcessor();
|
||||||
|
|
||||||
|
QImage Mat2QImage(cv::Mat cvImg);//https://www.cnblogs.com/annt/p/ant003.html
|
||||||
|
|
||||||
|
//envi 2%<25><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>
|
||||||
|
//gdal<61>汾 <20><> https://blog.csdn.net/HB_Programmer/article/details/82020703?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control
|
||||||
|
//opencv<63>汾 <20><> https://blog.csdn.net/qq_41824159/article/details/105469986
|
||||||
|
cv::Mat CStretchDeal(const cv::Mat img, const uint minnum, const uint maxnum);
|
||||||
|
uint MaxRatio(const std::vector<cv::Point2f> data, const float ratio);
|
||||||
|
uint MinRatio(const std::vector<cv::Point2f> data, const float ratio);
|
||||||
|
std::vector<cv::Point2f> CHistogram(const cv::Mat img);
|
||||||
|
cv::Mat CStretch(const cv::Mat img, const float ratio);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
};
|
||||||
|
#endif
|
||||||
130
HPPA/imagerSimulatioin.cpp
Normal file
130
HPPA/imagerSimulatioin.cpp
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "imagerSimulatioin.h"
|
||||||
|
|
||||||
|
imagerSimulatioin::imagerSimulatioin(QGraphicsItem *parent) :QGraphicsItem(parent)
|
||||||
|
{
|
||||||
|
/*this->setFlag(QGraphicsItem::ItemIsSelectable);
|
||||||
|
this->setFlag(QGraphicsItem::ItemIsMovable);*/
|
||||||
|
|
||||||
|
setFlags(ItemIsSelectable | ItemIsMovable);
|
||||||
|
|
||||||
|
//itemChange<67><65>Ҫ<EFBFBD><D2AA>ItemSendsGeometryChanges flag is needed to capture the change in position of QGraphicsItem
|
||||||
|
this->setFlag(QGraphicsItem::ItemSendsScenePositionChanges);
|
||||||
|
m_height = 50;
|
||||||
|
m_width = 50;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
imagerSimulatioin::~imagerSimulatioin()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QRectF imagerSimulatioin::boundingRect() const
|
||||||
|
{
|
||||||
|
qreal penWidth = 1;
|
||||||
|
return QRectF(-10 - penWidth / 2, -10 - penWidth / 2,
|
||||||
|
20 + penWidth, 20 + penWidth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void imagerSimulatioin::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
|
{
|
||||||
|
QBrush blueBrush(Qt::green);
|
||||||
|
QColor blue(32, 159, 223);
|
||||||
|
blueBrush.setColor(blue);
|
||||||
|
|
||||||
|
QPen outlinePen(Qt::black);
|
||||||
|
|
||||||
|
painter->setPen(outlinePen);
|
||||||
|
painter->setBrush(blueBrush);
|
||||||
|
|
||||||
|
painter->drawRect(-m_width / 2, -m_height / 2, m_width, m_height);//<2F><><EFBFBD>Ըı<D4B8>item<65><6D><EFBFBD><EFBFBD>ԭ<EFBFBD>㣬<EFBFBD><E3A3AC>setSceneRect(qreal x, qreal y, qreal w, qreal h)һ<><D2BB>
|
||||||
|
|
||||||
|
|
||||||
|
//QPen outlinePen(Qt::red);
|
||||||
|
|
||||||
|
painter->drawPoint(0, 0);
|
||||||
|
painter->drawEllipse(QPoint(0, 0), 10, 10);
|
||||||
|
|
||||||
|
//painter->drawRoundedRect(-10, -10, 100, 100, 5, 5);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void imagerSimulatioin::setPos(qreal x, qreal y)
|
||||||
|
{
|
||||||
|
if (x>0)
|
||||||
|
{
|
||||||
|
x = -x;
|
||||||
|
}
|
||||||
|
if (y>0)
|
||||||
|
{
|
||||||
|
y = -y;
|
||||||
|
}
|
||||||
|
|
||||||
|
x = floor(x);
|
||||||
|
y = floor(y);
|
||||||
|
|
||||||
|
QGraphicsItem::setPos(x, y);//<2F><><EFBFBD>ø<EFBFBD><C3B8>౻<EFBFBD><E0B1BB><EFBFBD>ǵĺ<C7B5><C4BA><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
scene()->update();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant imagerSimulatioin::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
|
{
|
||||||
|
if (change == ItemPositionChange && scene())
|
||||||
|
{
|
||||||
|
// value is the new position.
|
||||||
|
QPointF newPos = value.toPointF();
|
||||||
|
|
||||||
|
QRectF rect = scene()->sceneRect();
|
||||||
|
if (!rect.contains(newPos))
|
||||||
|
{
|
||||||
|
// Keep the item inside the scene rect.
|
||||||
|
newPos.setX(qMin(rect.right(), qMax(newPos.x(), rect.left())));
|
||||||
|
newPos.setY(qMin(rect.bottom(), qMax(newPos.y(), rect.top())));
|
||||||
|
//qDebug() << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
|
||||||
|
return newPos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//qDebug() << "---------------";
|
||||||
|
|
||||||
|
return QGraphicsItem::itemChange(change, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void imagerSimulatioin::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||||
|
{
|
||||||
|
scene()->update();
|
||||||
|
|
||||||
|
QPointF originOfItem = this->scenePos();//<2F><><EFBFBD><EFBFBD>item<65><6D><EFBFBD>Ͻ<EFBFBD><CFBD><EFBFBD>scene<6E>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
//qDebug() << originOfItem;
|
||||||
|
|
||||||
|
QGraphicsItem::mouseMoveEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void imagerSimulatioin::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
|
{
|
||||||
|
QPointF x = pos();//<2F><><EFBFBD><EFBFBD>itemԭ<6D>㣨0<E3A3A8><30>0<EFBFBD><30><EFBFBD><EFBFBD>scene<6E>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
QPointF originOfItem = this->scenePos();//<2F><><EFBFBD><EFBFBD>itemԭ<6D>㣨0<E3A3A8><30>0<EFBFBD><30><EFBFBD><EFBFBD>scene<6E>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
QPointF viewPos = event->pos();
|
||||||
|
|
||||||
|
|
||||||
|
//qDebug() << "---------------event coordinate: " << x;
|
||||||
|
//qDebug() << "---------------event coordinate: " << viewPos;
|
||||||
|
//qDebug() << "---------------event scene coordinate: " << this->mapToScene(viewPos);
|
||||||
|
|
||||||
|
//qDebug() << "---------------imagerSimulatioin origin coordinate: " << originOfItem;
|
||||||
|
//qDebug() << "---------------imagerSimulatioin center coordinate: " << centerOfItem;
|
||||||
|
|
||||||
|
qDebug() << "---------------imagerSimulatioin origin coordinate: " << originOfItem;
|
||||||
|
|
||||||
|
emit leftMouseButtonPressed(originOfItem.x(), originOfItem.y());
|
||||||
|
|
||||||
|
|
||||||
|
//update();//<2F><><EFBFBD><EFBFBD>ʵʱ<CAB5><CAB1><EFBFBD><EFBFBD>
|
||||||
|
scene()->update();
|
||||||
|
|
||||||
|
QGraphicsItem::mouseReleaseEvent(event);
|
||||||
|
}
|
||||||
34
HPPA/imagerSimulatioin.h
Normal file
34
HPPA/imagerSimulatioin.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#ifndef IMAGER_SIMULATIOIN
|
||||||
|
#define IMAGER_SIMULATIOIN
|
||||||
|
|
||||||
|
#include <QGraphicsItem>
|
||||||
|
|
||||||
|
class imagerSimulatioin :public QObject,public QGraphicsItem
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_INTERFACES(QGraphicsItem)
|
||||||
|
public:
|
||||||
|
imagerSimulatioin(QGraphicsItem *parent = Q_NULLPTR);
|
||||||
|
~imagerSimulatioin();
|
||||||
|
|
||||||
|
QRectF boundingRect() const;
|
||||||
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||||
|
void setPos(qreal x, qreal y);
|
||||||
|
|
||||||
|
//<2F><>QGraphicsScene<6E><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼԪ<CDBC><D4AA><EFBFBD>϶<EFBFBD><CFB6><EFBFBD>Χ<EFBFBD><CEA7>https://www.cnblogs.com/sfy5848/p/6611824.html
|
||||||
|
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
||||||
|
|
||||||
|
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);//<2F><><EFBFBD>϶<EFBFBD>itemʱ<6D><CAB1>ͣ<EFBFBD><CDA3><EFBFBD>Ļ<EFBFBD><C4BB>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><CFB6><EFBFBD>Ӱ
|
||||||
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);//<2F><><EFBFBD>ſ<EFBFBD><C5BF><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱͼԪ<CDBC><D4AA>scene<6E>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
protected:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_width;
|
||||||
|
int m_height;
|
||||||
|
|
||||||
|
signals :
|
||||||
|
void leftMouseButtonPressed(int, int);
|
||||||
|
};
|
||||||
|
#endif
|
||||||
10
HPPA/main.cpp
Normal file
10
HPPA/main.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include "HPPA.h"
|
||||||
|
#include <QtWidgets/QApplication>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
QApplication a(argc, argv);
|
||||||
|
HPPA w;
|
||||||
|
w.show();
|
||||||
|
return a.exec();
|
||||||
|
}
|
||||||
435
HPPA/resononImager.cpp
Normal file
435
HPPA/resononImager.cpp
Normal file
@ -0,0 +1,435 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <exception>
|
||||||
|
#include "resononImager.h"
|
||||||
|
|
||||||
|
ResononImager::ResononImager()
|
||||||
|
{
|
||||||
|
m_iFrameCounter = 1;
|
||||||
|
m_bRecordControlState = true;
|
||||||
|
|
||||||
|
m_FileName2Save = "tmp_image";
|
||||||
|
m_FileSavedCounter = 1;
|
||||||
|
|
||||||
|
m_RgbImage = new CImage();
|
||||||
|
|
||||||
|
buffer = nullptr;
|
||||||
|
dark = nullptr;
|
||||||
|
white = nullptr;
|
||||||
|
|
||||||
|
m_HasDark = false;
|
||||||
|
m_HasWhite = false;
|
||||||
|
m_bFocusControlState = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ResononImager::~ResononImager()
|
||||||
|
{
|
||||||
|
if (buffer != nullptr)
|
||||||
|
{
|
||||||
|
std::cout << "<EFBFBD>ͷŶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>" << std::endl;
|
||||||
|
free(buffer);
|
||||||
|
free(dark);
|
||||||
|
free(white);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CImage * ResononImager::getRgbImage() const
|
||||||
|
{
|
||||||
|
return m_RgbImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
cv::Mat * ResononImager::getMatRgbImage() const
|
||||||
|
{
|
||||||
|
return m_RgbImage->m_matRgbImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
cv::Mat * ResononImager::getMatFocusGrayImage() const
|
||||||
|
{
|
||||||
|
return m_RgbImage->m_matFocusGrayImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
QImage ResononImager::getQImageFocusGrayImage() const
|
||||||
|
{
|
||||||
|
return *m_RgbImage->m_qimageFocusGrayImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ResononImager::getRecordControlState() const
|
||||||
|
{
|
||||||
|
return m_bRecordControlState;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::setRecordControlState(bool RecordControlState)
|
||||||
|
{
|
||||||
|
m_bRecordControlState = RecordControlState;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ResononImager::getFrameCounter() const
|
||||||
|
{
|
||||||
|
return m_iFrameCounter;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ResononImager::getFocusFrameCounter() const
|
||||||
|
{
|
||||||
|
return m_iFocusFrameCounter;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::WriteHdr()
|
||||||
|
{
|
||||||
|
//write an ENVI compatible header file
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
FileOperation * fileOperation = new FileOperation();
|
||||||
|
string directory = fileOperation->getDirectoryFromString();
|
||||||
|
|
||||||
|
string hdrPath = directory + "\\" + m_FileName2Save + "_" + std::to_string(m_FileSavedCounter) + ".hdr";
|
||||||
|
|
||||||
|
std::ofstream outfile(hdrPath.c_str());
|
||||||
|
outfile << "ENVI\n";
|
||||||
|
outfile << "interleave = bil\n";
|
||||||
|
outfile << "data type = 12\n";
|
||||||
|
outfile << "bit depth = 12\n";
|
||||||
|
outfile << "samples = " << m_ResononImager.get_sample_count() << "\n";
|
||||||
|
outfile << "bands = " << m_ResononImager.get_band_count() << "\n";
|
||||||
|
outfile << "lines = " << m_iFrameCounter << "\n";
|
||||||
|
outfile << "framerate = " << m_ResononImager.get_framerate() << "\n";
|
||||||
|
outfile << "shutter = " << m_ResononImager.get_integration_time() << "\n";
|
||||||
|
outfile << "gain = " << m_ResononImager.get_gain() << "\n";
|
||||||
|
outfile << "wavelength = {";
|
||||||
|
outfile << std::setprecision(5);
|
||||||
|
|
||||||
|
int start = m_ResononImager.get_start_band();
|
||||||
|
int end = m_ResononImager.get_end_band();
|
||||||
|
for (int i = start; i < end - 1; i++)
|
||||||
|
{
|
||||||
|
outfile << m_ResononImager.get_wavelength_at_band(i) << ", ";
|
||||||
|
}
|
||||||
|
outfile << m_ResononImager.get_wavelength_at_band(end - 1) << "}\n";
|
||||||
|
outfile.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned short ResononImager::GetMaxValue(unsigned short * dark, int number)
|
||||||
|
{
|
||||||
|
unsigned short max = 0;
|
||||||
|
for (size_t i = 0; i < number; i++)
|
||||||
|
{
|
||||||
|
if (dark[i]>max)
|
||||||
|
{
|
||||||
|
max = dark[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//std::cout << "<22><>֡<EFBFBD><D6A1><EFBFBD><EFBFBD>ֵΪ" << max << std::endl;
|
||||||
|
return max;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::connect_imager(int frameNumber)
|
||||||
|
{
|
||||||
|
m_ResononImager.connect();
|
||||||
|
set_framerate(30.0);
|
||||||
|
set_integration_time(1);
|
||||||
|
set_gain(0);
|
||||||
|
|
||||||
|
m_ResononImager.set_spectral_bin(2);
|
||||||
|
//m_ResononImager.set_spatial_bin(2);
|
||||||
|
|
||||||
|
set_buffer();
|
||||||
|
m_RgbImage->SetRgbImageWidthAndHeight(getBandCount(), getSampleCount(), frameNumber);
|
||||||
|
m_iFrameNumber = frameNumber;
|
||||||
|
|
||||||
|
emit testImagerStatus();
|
||||||
|
|
||||||
|
//std::cout << "------------------------------------------------------" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::start_record()
|
||||||
|
{
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
//std::cout << "------------------------------------------------------" << std::endl;
|
||||||
|
|
||||||
|
m_iFrameCounter = 0;
|
||||||
|
m_RgbImage->m_iFrameCounter = 0;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>rgbͼ<62><CDBC><EFBFBD>ĵ<EFBFBD>0<EFBFBD><30>
|
||||||
|
m_bRecordControlState = true;
|
||||||
|
|
||||||
|
//<2F>ж<EFBFBD><D0B6>ڴ<EFBFBD>buffer<65>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
if (buffer == 0)
|
||||||
|
{
|
||||||
|
std::cerr << "Error: memory could not be allocated for datacube";
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
FileOperation * fileOperation = new FileOperation();
|
||||||
|
string directory = fileOperation->getDirectoryFromString();
|
||||||
|
string imgPath = directory + "\\" + m_FileName2Save + "_" + std::to_string(m_FileSavedCounter);
|
||||||
|
|
||||||
|
m_fImage = fopen(imgPath.c_str(), "w+b");
|
||||||
|
|
||||||
|
|
||||||
|
size_t x;
|
||||||
|
double pixelValueTmp;
|
||||||
|
|
||||||
|
m_ResononImager.start();
|
||||||
|
while (m_bRecordControlState)
|
||||||
|
{
|
||||||
|
m_iFrameCounter++;
|
||||||
|
|
||||||
|
m_ResononImager.get_frame(buffer);
|
||||||
|
|
||||||
|
//<2F><>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӦΪbuffer<65><72>dark<72><6B><EFBFBD><EFBFBD>unsigned short<72><74><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>dark>bufferʱ<72><CAB1>buffer-dark=65535
|
||||||
|
if (m_HasDark)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < m_FrameSize; i++)
|
||||||
|
{
|
||||||
|
buffer[i] = buffer[i] - dark[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//ת<><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
if (m_HasWhite)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < m_FrameSize; i++)
|
||||||
|
{
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ壩Ϊ0<CEAA><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
if (white[i] != 0)
|
||||||
|
{
|
||||||
|
pixelValueTmp = buffer[i];
|
||||||
|
buffer[i] = (pixelValueTmp / white[i]) * 10000;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
buffer[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
x = fwrite(buffer, 2, m_FrameSize, m_fImage);
|
||||||
|
|
||||||
|
//<2F><>rgb<67><62><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
||||||
|
m_RgbImage->FillRgbImage(buffer);//??????????????????????????????????????????????????????????????????????????????????????????????????????
|
||||||
|
|
||||||
|
//std::cout << "<22><>" << m_iFrameCounter << "֡д<D6A1><D0B4>" << x << "<22><>unsigned short<72><74>" << std::endl;
|
||||||
|
|
||||||
|
//ÿ<><C3BF>1s<31><73><EFBFBD><EFBFBD>һ<EFBFBD>ν<EFBFBD><CEBD><EFBFBD>ͼ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD>
|
||||||
|
if (m_iFrameCounter % (int)m_ResononImager.get_framerate() == 0)
|
||||||
|
{
|
||||||
|
emit PlotSignal();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_iFrameCounter >= m_iFrameNumber)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
m_ResononImager.stop();
|
||||||
|
|
||||||
|
m_bRecordControlState = false;
|
||||||
|
WriteHdr();
|
||||||
|
m_FileSavedCounter++;
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>λ<EFBFBD>ͼǰ<CDBC><C7B0>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
//m_RgbImage
|
||||||
|
emit PlotSignal();//<2F>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>λ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>Է<EFBFBD><D4B7>ɼ<EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD>ʵı<CAB5><C4B1><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>ȫ
|
||||||
|
|
||||||
|
if (m_iFrameCounter >= m_iFrameNumber)
|
||||||
|
{
|
||||||
|
emit RecordFinishedSignal_WhenFrameNumberMeet();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
emit RecordFinishedSignal_WhenFrameNumberNotMeet();
|
||||||
|
}
|
||||||
|
|
||||||
|
//QThread::msleep(1001);
|
||||||
|
fclose(m_fImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::record_dark()
|
||||||
|
{
|
||||||
|
std::cout << "<EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << std::endl;
|
||||||
|
m_ResononImager.start();
|
||||||
|
m_ResononImager.get_frame(dark);
|
||||||
|
m_ResononImager.stop();
|
||||||
|
|
||||||
|
m_HasDark = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::record_white()
|
||||||
|
{
|
||||||
|
std::cout << "<EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ壡<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << std::endl;
|
||||||
|
m_ResononImager.start();
|
||||||
|
m_ResononImager.get_frame(white);
|
||||||
|
m_ResononImager.stop();
|
||||||
|
|
||||||
|
m_HasWhite = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
double ResononImager::get_framerate()
|
||||||
|
{
|
||||||
|
return m_ResononImager.get_framerate();
|
||||||
|
}
|
||||||
|
|
||||||
|
double ResononImager::get_integration_time()
|
||||||
|
{
|
||||||
|
return m_ResononImager.get_integration_time();
|
||||||
|
}
|
||||||
|
|
||||||
|
double ResononImager::get_gain()
|
||||||
|
{
|
||||||
|
return m_ResononImager.get_gain();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::set_framerate(const double frames_per_second)
|
||||||
|
{
|
||||||
|
|
||||||
|
m_ResononImager.set_framerate(frames_per_second);
|
||||||
|
m_RgbImage->m_iFramerate = frames_per_second;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::set_integration_time(const double milliseconds)
|
||||||
|
{
|
||||||
|
m_ResononImager.set_integration_time(milliseconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::set_gain(const double gain)
|
||||||
|
{
|
||||||
|
m_ResononImager.set_gain(gain);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::set_buffer()
|
||||||
|
{
|
||||||
|
//<2F><><EFBFBD><EFBFBD>
|
||||||
|
if (buffer != nullptr)
|
||||||
|
{
|
||||||
|
std::cout << "<EFBFBD>ͷŶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>" << std::endl;
|
||||||
|
free(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_FrameSize = m_ResononImager.get_band_count()*m_ResononImager.get_sample_count();
|
||||||
|
//std::cout << "m_FrameSize<7A><65>СΪ" << m_FrameSize << std::endl;
|
||||||
|
|
||||||
|
buffer = new unsigned short[m_FrameSize];
|
||||||
|
dark = new unsigned short[m_FrameSize];
|
||||||
|
white = new unsigned short[m_FrameSize];
|
||||||
|
|
||||||
|
std::cout << "buffer<EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>ַ" << buffer << std::endl;
|
||||||
|
std::cout << "dark<EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>ַ" << dark << std::endl;
|
||||||
|
std::cout << "white<EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>ַ" << white << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::setFrameNumber(int FrameNumber)
|
||||||
|
{
|
||||||
|
m_iFrameNumber = FrameNumber;
|
||||||
|
m_RgbImage->SetRgbImageWidthAndHeight(getBandCount(), getSampleCount(), FrameNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
double ResononImager::auto_exposure()
|
||||||
|
{
|
||||||
|
//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD>ʱ<EFBFBD><CAB1>Ϊ<EFBFBD>ڵ<EFBFBD>ǰ֡<C7B0><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
double x = 1 / m_ResononImager.get_framerate()*1000;//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD>ʱ<EFBFBD><CAB1>
|
||||||
|
m_ResononImager.set_integration_time(x);
|
||||||
|
|
||||||
|
//<2F>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>ѭ<EFBFBD><D1AD>Ѱ<EFBFBD><D1B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD>ʱ<EFBFBD><CAB1>
|
||||||
|
m_ResononImager.start();
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
m_ResononImager.get_frame(buffer);
|
||||||
|
if (GetMaxValue(buffer, m_FrameSize) >= 4095)
|
||||||
|
{
|
||||||
|
set_integration_time(get_integration_time()*0.8);
|
||||||
|
std::cout << "<EFBFBD>Զ<EFBFBD><EFBFBD>ع<EFBFBD>-----------" << std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ResononImager.stop();
|
||||||
|
|
||||||
|
//std::cout << "<22>Զ<EFBFBD><D4B6>ع⣺" << get_integration_time() << std::endl;
|
||||||
|
|
||||||
|
return get_integration_time();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::setFocusControlState(bool FocusControlState)
|
||||||
|
{
|
||||||
|
m_bFocusControlState = FocusControlState;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::setFileName2Save(string FileName)
|
||||||
|
{
|
||||||
|
m_FileName2Save = FileName;
|
||||||
|
m_FileSavedCounter = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
double ResononImager::getWavelengthAtBand(int band)
|
||||||
|
{
|
||||||
|
return m_ResononImager.get_wavelength_at_band(band);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ResononImager::getBandCount()
|
||||||
|
{
|
||||||
|
return m_ResononImager.get_band_count();
|
||||||
|
}
|
||||||
|
|
||||||
|
int ResononImager::getSampleCount()
|
||||||
|
{
|
||||||
|
return m_ResononImager.get_sample_count();
|
||||||
|
}
|
||||||
|
|
||||||
|
int ResononImager::GetImageSize(int &iWidth, int &iHeight)
|
||||||
|
{
|
||||||
|
/*using namespace GENAPI_NAMESPACE;
|
||||||
|
using namespace std;
|
||||||
|
INodeMap& nodemap = m_phCamera->GetNodeMap();
|
||||||
|
|
||||||
|
iWidth = (int)CIntegerPtr(nodemap.GetNode("Width"))->GetValue();
|
||||||
|
iHeight = (int)CIntegerPtr(nodemap.GetNode("Height"))->GetValue();*/
|
||||||
|
|
||||||
|
iWidth = getSampleCount();
|
||||||
|
iHeight = getBandCount();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResononImager::focus()
|
||||||
|
{
|
||||||
|
m_iFocusFrameCounter = 1;
|
||||||
|
//std::cout << "<22><><EFBFBD><EFBFBD>-----------" << std::endl;
|
||||||
|
|
||||||
|
double tmpFrmerate = m_ResononImager.get_framerate();
|
||||||
|
double tmpIntegrationTime = m_ResononImager.get_integration_time();
|
||||||
|
|
||||||
|
|
||||||
|
m_ResononImager.set_framerate(5);
|
||||||
|
auto_exposure();
|
||||||
|
std::cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><EFBFBD>ع<EFBFBD>ʱ<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>" << m_ResononImager.get_integration_time() << std::endl;
|
||||||
|
|
||||||
|
m_ResononImager.start();
|
||||||
|
|
||||||
|
//emit SpectralSignal(1);
|
||||||
|
m_bFocusControlState = true;
|
||||||
|
while (m_bFocusControlState)
|
||||||
|
{
|
||||||
|
m_ResononImager.get_frame(buffer);
|
||||||
|
//m_RgbImage->FillFocusGrayImage(buffer);
|
||||||
|
m_RgbImage->FillFocusGrayQImage(buffer);
|
||||||
|
|
||||||
|
emit SpectralSignal(1);
|
||||||
|
|
||||||
|
++m_iFocusFrameCounter;
|
||||||
|
}
|
||||||
|
emit SpectralSignal(0);
|
||||||
|
|
||||||
|
m_ResononImager.stop();
|
||||||
|
|
||||||
|
m_ResononImager.set_framerate(tmpFrmerate);
|
||||||
|
m_ResononImager.set_integration_time(tmpIntegrationTime);
|
||||||
|
}
|
||||||
97
HPPA/resononImager.h
Normal file
97
HPPA/resononImager.h
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
#ifndef RESONON_IMAGER
|
||||||
|
#define RESONON_IMAGER
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <opencv2/core/core.hpp>
|
||||||
|
|
||||||
|
#include "resonon_imager_basler.h"
|
||||||
|
#include "image2display.h"
|
||||||
|
#include "fileOperation.h"
|
||||||
|
|
||||||
|
class ResononImager:public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ResononImager();
|
||||||
|
~ResononImager();
|
||||||
|
|
||||||
|
Resonon::PikaBasler m_ResononImager;//
|
||||||
|
|
||||||
|
CImage* getRgbImage() const;
|
||||||
|
cv::Mat * getMatRgbImage() const;
|
||||||
|
cv::Mat * getMatFocusGrayImage() const;
|
||||||
|
QImage getQImageFocusGrayImage() const;
|
||||||
|
|
||||||
|
bool getRecordControlState() const;
|
||||||
|
void setRecordControlState(bool RecordControlState);
|
||||||
|
|
||||||
|
int getFrameCounter() const;
|
||||||
|
int getFocusFrameCounter() const;
|
||||||
|
|
||||||
|
unsigned short * buffer;//<2F>洢<EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>д<EFBFBD>뵽Ӳ<EBB5BD><D3B2><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
void set_buffer();
|
||||||
|
void setFrameNumber(int FrameNumber);
|
||||||
|
double auto_exposure();
|
||||||
|
|
||||||
|
|
||||||
|
void setFocusControlState(bool FocusControlState);
|
||||||
|
|
||||||
|
void setFileName2Save(string FileName);
|
||||||
|
|
||||||
|
double getWavelengthAtBand(int band);
|
||||||
|
int getBandCount();
|
||||||
|
int getSampleCount();
|
||||||
|
|
||||||
|
int GetImageSize(int &iWidth, int &iHeight);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
CImage* m_RgbImage;//<2F><>ʾ<EFBFBD><CABE>rgbͼ<62><CDBC>
|
||||||
|
int m_iFrameNumber;//<2F><>Ҫ<EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><D6A1>
|
||||||
|
int m_iFrameCounter;//<2F><>¼<EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD>֡<EFBFBD><D6A1>
|
||||||
|
int m_iFocusFrameCounter;//<2F><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>ʱ<EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD>֡<EFBFBD><D6A1>
|
||||||
|
bool m_bRecordControlState;//<2F>ɼ<EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>ֹͣ<CDA3>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
bool m_bFocusControlState;//<2F><><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD><DAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
string m_FileName2Save;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
||||||
|
int m_FileSavedCounter;//<2F><><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD><CBBC><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD>ļ<EFBFBD>
|
||||||
|
|
||||||
|
unsigned short * dark;//<2F>洢<EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
unsigned short * white;//<2F>洢<EFBFBD>װ<EFBFBD>
|
||||||
|
|
||||||
|
FILE *m_fImage;//<2F><><EFBFBD><EFBFBD>д<EFBFBD><D0B4>Ӳ<EFBFBD>̵<EFBFBD><CCB5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
int m_FrameSize;//<2F><>ʾһ֡<D2BB><D6A1><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>ٸ<EFBFBD><D9B8><EFBFBD>ֵ<EFBFBD><D6B5>m_FrameSize = m_imager.get_band_count()*m_imager.get_sample_count();
|
||||||
|
bool m_HasDark;//<2F><><EFBFBD>ɼ<EFBFBD><C9BC>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊtrue
|
||||||
|
bool m_HasWhite;//<2F><><EFBFBD>ɼ<EFBFBD><C9BC>˰װ<CBB0>֮<EFBFBD><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊtrue
|
||||||
|
|
||||||
|
void WriteHdr();
|
||||||
|
unsigned short GetMaxValue(unsigned short * dark, int number);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void connect_imager(int frameNumber);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٻ<EFBFBD><D9BB><EFBFBD>
|
||||||
|
void start_record();
|
||||||
|
void record_dark();
|
||||||
|
void record_white();
|
||||||
|
void focus();
|
||||||
|
|
||||||
|
double get_framerate();
|
||||||
|
double get_integration_time();
|
||||||
|
double get_gain();
|
||||||
|
|
||||||
|
void set_framerate(const double frames_per_second);
|
||||||
|
void set_integration_time(const double milliseconds);
|
||||||
|
void set_gain(const double gain);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void PlotSignal();//<2F><><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD>ź<EFBFBD>
|
||||||
|
void RecordFinishedSignal_WhenFrameNumberMeet();//<2F>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>źţ<C5BA><C5A3><EFBFBD>Ҫ<EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD>m_iFrameNumber<65><72><EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
void RecordFinishedSignal_WhenFrameNumberNotMeet();//<2F>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>źţ<C5BA><C5A3><EFBFBD>Ҫ<EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD>m_iFrameNumber<65><72>û<EFBFBD>вɼ<D0B2><C9BC><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD>;ֹͣ<CDA3>ɼ<EFBFBD>
|
||||||
|
void SpectralSignal(int);//<2F><><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƹ<EFBFBD><C6B9>ף<EFBFBD><D7A3><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>
|
||||||
|
|
||||||
|
|
||||||
|
void testImagerStatus();//<2F><>ʾ<EFBFBD><CABE><EFBFBD>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
};
|
||||||
|
#endif
|
||||||
16
HPPA/resource.h
Normal file
16
HPPA/resource.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft Visual C++ <20><><EFBFBD>ɵİ<C9B5><C4B0><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
||||||
|
// <20><> HPPA.rc ʹ<><CAB9>
|
||||||
|
//
|
||||||
|
#define IDI_ICON1 101
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
1
HPPA/stdafx.cpp
Normal file
1
HPPA/stdafx.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
3
HPPA/stdafx.h
Normal file
3
HPPA/stdafx.h
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#include <QtWidgets>
|
||||||
|
#include <Windows.h>
|
||||||
|
#include <minwindef.h>
|
||||||
Reference in New Issue
Block a user