Merge pull request 'Release-dev2' (#15) from Release-dev2 into Release
Reviewed-on: http://172.16.0.12:5000/LAMPSARToolSoftware/RasterProcessTool/pulls/15Release
commit
b88b3b2f24
|
|
@ -101,6 +101,7 @@ StyleCopReport.xml
|
||||||
**.tlog
|
**.tlog
|
||||||
*.tlog
|
*.tlog
|
||||||
*.idb
|
*.idb
|
||||||
|
*.sqlite
|
||||||
# Chutzpah Test files
|
# Chutzpah Test files
|
||||||
_Chutzpah*
|
_Chutzpah*
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "BaseCommonLibrary"]
|
||||||
|
path = BaseCommonLibrary
|
||||||
|
url = http://172.16.0.12:5000/LAMPSARToolSoftware/BaseCommonLibrary.git
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 1f8567dcc3220156be3416efbd75fbc18be691b2
|
||||||
|
|
@ -1,429 +0,0 @@
|
||||||
<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" FontFamily="Segoe UI" FontSize="12">
|
|
||||||
<FlowDocument.Tag><![CDATA[{
|
|
||||||
"timestamp": "2025-02-02 17:23:02",
|
|
||||||
"files": {
|
|
||||||
"C:\\Users\\30453\\Desktop\\RasterTool\\RasterProcessTool\\BaseCommonLibrary\\BaseCommonLibrary.vcxproj": {
|
|
||||||
"before": "7Vpbb9s2FO7zgP0HQ8iQ5CFWHHdJscgqEjnJjDmX2blsQIGClmhbqyQKFJUmW/d39jt3KF5kOVItIW2yFelDUZPnO6QOv3Mj+8/aq1fW27swaN1imvgk6hmd9rbRwpFLPD+a9YyUTbfeGG/t77+zLij5A7us1cdTlAbsEtEZZknPOEz9wDNaoCWCX3PG4p9MM3HnOERJO/RdShIyZW2XhKaHb3FAYkzNMJlwmLmzvd01QHurZQ0YDk8oSePWEE1w0DPkgg6Jpv4spYjBBhMhDOJls61B5Aaph3tGH0/S2acbP+ruKARgCqrsTMYyi4N8K/yPdREgNiU0tDMllql/CwkYEPYog6/Y3AgHGCV4xfak1HNsUFjvbvf1Y20HKr6K5T63tdp2a7g5y9QMFYQFAgCV2X2BtCcBmaAgp+m1I3lyLTzM7uy1ty3zwbBk1S/4/iOhniAdR1qmGpISUt1J6nv2X2/2drDr7U63utu4u/UadSZbk86eu9X5Eb/Z87p73el0929N1Qwj1YwIYWcoxEmMXGwfAh0dEoYkGvoTiui9ZRYFJAp8wSMfE+H7yiP0l23zL/usCFeTbSc3nHT+MCaUteTH9Yy1jWtHRpgLxOab7051IHHiuC1jUDuGI0iMlll2IOCYns9jRs9YX9souOnmp7UNtfvN9V5vfSFcrBsq/hQgyhOKMeTyPsZ2/z5CEOe05Qq4TEJa7yrB2UJC0seJzWiKLfPhuASoPV4SEiSY2bed193cn9SoFHbmiCKXYToGyavIhxAOugujleYHu+cn0mpiuUIse1LbTcHNvpjxbuYkwGCFGUXhecz80P8zyzfyhCqnn9X2Okw/qd2/Hc5CAnhSy30rjB00C9bFIC3AhZx5dMdwxMtPiFwMyk6ZPSHhZgtlsotpogAeQ9jDngjP9RAq2I3nGApYo1G4KySKbE+Q0B7aAyI65Qm079Pl1LWQedopiKkcthB08Z2fsGQDslZjPeubOn0NiYuCgzjuI4ZUItGpspZpH2OopbzwYirdwlQUH1kwejFTtZkUo749Qyk/K8Q17vqniHfP2mmLcgsBY2V9W2470Szz+tpum7wF4BXl/tqG7KKzwhtC6oJYZQHJWyMoyv0oq7jFhzTZYGlcdQLoSWI/wNItINTeIBpBhhjyiwQ7+xsK4sKgqMhAdNwfOnPsfpAlnP6pBS4ojilxcZIQmu89sW8GZ92d/ff9o8Ork/3Dg/GRc356en42HByODka/vz/67eJ8dDnefw9y/fMb+MfVeNQfDvd/2KjQuMlbnvK19GbAWPy2AUUuPoXCXW56eVSLgz64UOG28X7GyMPUBr5kyywNVyOOuWFjd96el+CySYGFHmLpHKyhH33Iz2ScTsb3CRCAd628PbTMfEivf4IjDHc4ogMaiI/l3Zn80sppreAoQpMAXx04tqyj8gG1Ub0v0avnh7pYQjySqcqVsmuh9bwtXLJRM64ep5HLjZExmn8FcFwapnRKG2UQMepD7eQqMdVTlkxokHYFUcrrn1qgiq3CM85ePEMR7ot4huAxBJn+weUxCfjFqzz7shl9SLJNxSM8xRRubPV1QsmEBlW6maBC5bRWkDvds3rhQuuraqbls2jmgdoJmvrES55QB/CSJ+STQXalqPJEoVx9HEdVjP+PZ4n/W344I+wqgaBbUgblRc6DguuJy6eyVCBCVdmMDtcluUCgSiY0qDILPEOSyCs3iOdOIJuR/KFPtS3vxBNGlLBrRH1eKbbnqnGqgeSdT23AkTsn/FblmBfsrDaMM+YcrtkRI7Q26ASTxphBiGZ6JW6X2qsNyYyX5k6Q1Ib8yk0HnSnvow4R7fsoILPa6BGCxoFyFY32OT4Yjf0whXgLRXP2ucNO7TUT5qHp3SrxKbwEYHiL+7BKMGuhFNVE45GTNn/VVllSp4AKDmdMdONYaczIK/vgEsgSF+sDC2ysD1vkY33UQ0bWxy5wsj6onJX18Uu8rA8sZWZ9uOTmSoAXBCHyo/ZKQc5OLvSZTNboArxY1jgUQ0vfLHE2Wq54L/REy4mS7asvpkypbhJWLbh8EbM61pyRCJfEjHLnSH0Vch4qbvbgw8R/DdLqFp5x1Nu6fvKRj/zl7zecWNl/OrL/BQ==",
|
|
||||||
"after": "7Vpbb9s2FO7zgP0HTciQZFisJO6aorFVJHaSGrNzsXPZgAABLdG2VknUKCqNt+59P3uH4sWWLcXy0qTXPXQxec4hefidK/XvT8+e1V7fBb5xi2nskbBublU2TQOHDnG9cFg3EzbYeGm+tr//rnZKyR/YYUYTD1Dis3NEh5jFdXM/8XzXNEBKCL9GjEWvLCt2RjhAcSXwHEpiMmAVhwSWi2+xTyJMrSDuczZre3OzaoJ0w6i1GA6OKEkio4362K+bcsEGCQfeMKGIwQZjQQzkebNGK3T8xMV1s4n7yfD9lRdWtxUH8GRE2SlNzcoO8q3w/2qnPmIDQgM7FVKz9G9BAQNCH3nsCzbXxT5GMV6wPUn1MTYotHf34vlDdQciHkVz922ttN6W3FzN0ggVgAUAAJTZOAPaI5/0kT+B6WVD4uRSWJi9tVPZrFlzwxJVv+LxO0JdATrOWbPUkKSQ4o4Sz7X/frmzjR33xWCjuomrG8/RVn+jv7XjbGz9gl/uuNWd6mDw4h8N1ZRHiukSwo5RgOMIOdjeBzg2SBCQsO31KaLjmpUlkFxgCy55FwvbVxahT7bJT3Yvycwpz9hl7+a2ugkgmTnlGevEqWMxwL5cj5t+3VxdWdPj66v1+uqqcdI1fji482IWr2Vmr/9kFSY81Oq6aa+sdXqpOKm9pkfBlRE6Xr/WEmuW/lPcL7fwyQVLJxVEhDJDiqmbK2uXDekJTxEbrV93tMNrRFFF+spKBJJi07DygJM9YMadrL9fWVNaTg885dZWTeUnMyzKYrO+7nwcYbs5DhH4Y33DGb6UQl7PRYzThQSlh2Ob0QTXrPlxyaD2eE6IH2Nm3249r07sXo1K4sYIUeQwTHtAeRF6EGpAdmaUU6aonVV/5kZmoJE5zpzmMj73SXU3AHfwwZR3NSI+Bi0MKQpOIuYF3l9pXJQ3VDj9UXWvw8mT6v3LwSwEqifV3JeC2NZyzjrrpOeZdXhYh+hy44o0OFa+HdyPilMFAWmGBeJSfkCQ6e8ZAwfJIAuHwDElHMLc/Z4uGyNyQ84DV5j1pY+xxrTPeAz56gzCtuQKIpIbPC+qm/q6jwk7JEkINc4+hooAy3hfNxtJzEiQ5hW7DR/yp8jzceayFucmxRnMGRPQ4vmLdN8dHMdoiA2BTRQ6sM033nBkGuf4jk1t+ZXhkMR3jZAwwycOYtiYJEQ/879TsO8a8L+0qAvQOCVOqzJgpjw/8scVDVFLnHo6C8rkvQd3DIe8hNSgtSFhTg0wpStk7EE6gF2zJDWEvjQn6I0wFJ8ZXS9nGEql82YOWQ7lyS/kiLPp3FQ2VkmALMf2sU5Gl5bDHYK0zDbcmb8XRU3EkEqu1FVAajS/aQ1WntCqbUlUl7qGhyhW2VJaKa9qtM7vcmmVZC74a1TtlBv8hliW8TgfArGp9/+qFau0mFEtt9MO4p075XR4R2tSjC2VjyjvkNW1aNTxmtmuWLz9wKvE3ZU12cFLi2kIIFNkhUUhb8tAoe2FaZtAHOR/J0wKDDqeywHwuleIhpCOtXkT007/hSI3MyjCNJD2mu3GCDtvZVmmf2qCU4ojShyI54RO9h7bV63j6vbuTfNg/+Jod3+vd9A46XROjtut/e5e9/ebg99OT7rnvd0boGueXMEfF71us93e/XGtQOI6r6Pz19Kb4fkkdDp5PtGBYlxuenZUk4M8aObyXMd9g5GLqQ14SZeZGS7mOARmO3JGlVEOXzqpeTvQa/YAfUJXIsmaLnmL54UIaC2o1EzdbdsL306utZf0e+MYMMSbbry7VbMmQ3obRzjE0IIWjZGW0BfvSkllFU5rAQch6vv4Yq9hy/JqMqA2qvclWo0TXExnUA8Eu7LGmVg9q6Pl4H6YhA5XRmoU/BRgJlIxuVNaKa2QUQ/SRkeRqVZTzoRm0tYkKnz9UxMUAV4Y1/E349KaKjYeodvieSHiAxmXMAVwdc2980Pi86cnCZ+8Gb172QDDXTzAFN6sdKMyZ0IzFVqqOHHhtBYwsduPasg5meHDjFjb0bJm9S1aTYJJscE8qUEVovgzA7mKVpnc8WEwV5HmE49Vn1uUgibZRQx+Oyefm1jHXOb4+eWBeQFJGFXejA4aORFJcOVMaKZPyYonKSikhg1fFmaTDy5UCXctnpLDmF0i6vGUtwLtSdGJKsHJq8DSDAfOiPAO2SEvXlhpNg66EyhmETwAl2Y6wmRpnlYAzVrFxfVSerU2GfIao+HHpVnOuOpknbSPaNNDPhmW5u4iqIAoF7HUPnt73Z4XJPCpDGT/6XHbW6XXjJmLBneLyAfw0onhm4i3iwjTclJBbe5jjey3GykSZcO+AMMpEp0oUhIXsMxgsTxjBo3l2abxWJ5rHpHleacwWZ4pH5Xl+WdwWZ4xF5nl2SU2FzK4vh8gL6wsJOTo5ET3BMMHdNUaFENvYrnYu9RymUdF+4mWE1nfoy+mkkzVElm04GzRu9jXHJMQHu1ELxM+mJTdzut840g85XLmBS/3oM3EB1Ba3PyDzNSz0eR9MPPoUvCWPfVxlXrEFtIzfWT9KCifTOdf+Thk0xdI+z8="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]]></FlowDocument.Tag>
|
|
||||||
<Section Margin="0,24" TextAlignment="Center">
|
|
||||||
<Paragraph FontSize="24" FontWeight="Bold" Margin="12,0">
|
|
||||||
<LineBreak />
|
|
||||||
<Span Foreground="Gray">Qt Visual Studio Tools</Span>
|
|
||||||
</Paragraph>
|
|
||||||
<Paragraph FontSize="42" Margin="12,0" FontWeight="Bold">
|
|
||||||
<Span TextDecorations="Underline">Project Format Conversion</Span>
|
|
||||||
</Paragraph>
|
|
||||||
<Paragraph Margin="12,8" FontSize="18">
|
|
||||||
<Span>Report generated on 2025-02-02 17:23:02</Span>
|
|
||||||
</Paragraph>
|
|
||||||
</Section>
|
|
||||||
<Section>
|
|
||||||
<Paragraph FontSize="32" FontWeight="Bold" Margin="12,0">
|
|
||||||
<Span>Files</Span>
|
|
||||||
</Paragraph>
|
|
||||||
<Paragraph Margin="24,12,0,0">
|
|
||||||
<Span FontFamily="Consolas" FontSize="14" Background="WhiteSmoke"><![CDATA[C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj]]></Span>
|
|
||||||
<LineBreak />
|
|
||||||
<Hyperlink NavigateUri="file://C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj?before">[Before]</Hyperlink>
|
|
||||||
<Hyperlink NavigateUri="file://C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj?after">[After]</Hyperlink>
|
|
||||||
<Hyperlink NavigateUri="file://C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj?diff&before&after">
|
|
||||||
[Diff before/after]
|
|
||||||
</Hyperlink>
|
|
||||||
<Hyperlink NavigateUri="file://C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj?diff&before&current">
|
|
||||||
[Diff before/current]
|
|
||||||
</Hyperlink>
|
|
||||||
<Hyperlink NavigateUri="file://C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj?diff&after&current">
|
|
||||||
[Diff after/current]
|
|
||||||
</Hyperlink>
|
|
||||||
<LineBreak />
|
|
||||||
</Paragraph>
|
|
||||||
</Section>
|
|
||||||
<Section>
|
|
||||||
<Paragraph FontSize="32" FontWeight="Bold" Margin="12,0">
|
|
||||||
<Span>Changes</Span>
|
|
||||||
</Paragraph>
|
|
||||||
<Paragraph FontSize="20" FontWeight="Bold" Margin="12">
|
|
||||||
<Span><![CDATA[🡺 Enabling multi-processor compilation]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
<Table CellSpacing="0" BorderBrush="Gray" BorderThickness="0.5">
|
|
||||||
<Table.Columns>
|
|
||||||
<TableColumn />
|
|
||||||
<TableColumn />
|
|
||||||
</Table.Columns>
|
|
||||||
<TableRowGroup>
|
|
||||||
<TableRow Background="Orange">
|
|
||||||
<TableCell ColumnSpan="2" BorderThickness="0.5" BorderBrush="Gray">
|
|
||||||
<Paragraph Margin="10,5" FontWeight="Bold">
|
|
||||||
<Span><![CDATA[C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <MultiProcessorCompilation>true</MultiProcessorCompilation>]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <MultiProcessorCompilation>true</MultiProcessorCompilation>]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <MultiProcessorCompilation>true</MultiProcessorCompilation>]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <MultiProcessorCompilation>true</MultiProcessorCompilation>]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</TableRowGroup>
|
|
||||||
</Table>
|
|
||||||
<Paragraph FontSize="20" FontWeight="Bold" Margin="12">
|
|
||||||
<Span><![CDATA[🡺 Project format version]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
<Table CellSpacing="0" BorderBrush="Gray" BorderThickness="0.5">
|
|
||||||
<Table.Columns>
|
|
||||||
<TableColumn />
|
|
||||||
<TableColumn />
|
|
||||||
</Table.Columns>
|
|
||||||
<TableRowGroup>
|
|
||||||
<TableRow Background="Orange">
|
|
||||||
<TableCell ColumnSpan="2" BorderThickness="0.5" BorderBrush="Gray">
|
|
||||||
<Paragraph Margin="10,5" FontWeight="Bold">
|
|
||||||
<Span><![CDATA[C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <Keyword>QtVS_v304</Keyword>]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</TableRowGroup>
|
|
||||||
</Table>
|
|
||||||
<Paragraph FontSize="20" FontWeight="Bold" Margin="12">
|
|
||||||
<Span><![CDATA[🡺 Fallback for QTMSBUILD environment variable]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
<Table CellSpacing="0" BorderBrush="Gray" BorderThickness="0.5">
|
|
||||||
<Table.Columns>
|
|
||||||
<TableColumn />
|
|
||||||
<TableColumn />
|
|
||||||
</Table.Columns>
|
|
||||||
<TableRowGroup>
|
|
||||||
<TableRow Background="Orange">
|
|
||||||
<TableCell ColumnSpan="2" BorderThickness="0.5" BorderBrush="Gray">
|
|
||||||
<Paragraph Margin="10,5" FontWeight="Bold">
|
|
||||||
<Span><![CDATA[C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</TableRowGroup>
|
|
||||||
</Table>
|
|
||||||
<Paragraph FontSize="20" FontWeight="Bold" Margin="12">
|
|
||||||
<Span><![CDATA[🡺 Default Qt properties]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
<Table CellSpacing="0" BorderBrush="Gray" BorderThickness="0.5">
|
|
||||||
<Table.Columns>
|
|
||||||
<TableColumn />
|
|
||||||
<TableColumn />
|
|
||||||
</Table.Columns>
|
|
||||||
<TableRowGroup>
|
|
||||||
<TableRow Background="Orange">
|
|
||||||
<TableCell ColumnSpan="2" BorderThickness="0.5" BorderBrush="Gray">
|
|
||||||
<Paragraph Margin="10,5" FontWeight="Bold">
|
|
||||||
<Span><![CDATA[C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <Import Project="$(QtMsBuild)\qt_defaults.props" Condition="Exists('$(QtMsBuild)\qt_defaults.props')" />]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</TableRowGroup>
|
|
||||||
</Table>
|
|
||||||
<Paragraph FontSize="20" FontWeight="Bold" Margin="12">
|
|
||||||
<Span><![CDATA[🡺 Qt build settings]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
<Table CellSpacing="0" BorderBrush="Gray" BorderThickness="0.5">
|
|
||||||
<Table.Columns>
|
|
||||||
<TableColumn />
|
|
||||||
<TableColumn />
|
|
||||||
</Table.Columns>
|
|
||||||
<TableRowGroup>
|
|
||||||
<TableRow Background="Orange">
|
|
||||||
<TableCell ColumnSpan="2" BorderThickness="0.5" BorderBrush="Gray">
|
|
||||||
<Paragraph Margin="10,5" FontWeight="Bold">
|
|
||||||
<Span><![CDATA[C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</TableRowGroup>
|
|
||||||
</Table>
|
|
||||||
<Paragraph FontSize="20" FontWeight="Bold" Margin="12">
|
|
||||||
<Span><![CDATA[🡺 Warn if Qt/MSBuild is not found]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
<Table CellSpacing="0" BorderBrush="Gray" BorderThickness="0.5">
|
|
||||||
<Table.Columns>
|
|
||||||
<TableColumn />
|
|
||||||
<TableColumn />
|
|
||||||
</Table.Columns>
|
|
||||||
<TableRowGroup>
|
|
||||||
<TableRow Background="Orange">
|
|
||||||
<TableCell ColumnSpan="2" BorderThickness="0.5" BorderBrush="Gray">
|
|
||||||
<Paragraph Margin="10,5" FontWeight="Bold">
|
|
||||||
<Span><![CDATA[C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') OR !Exists('$(QtMsBuild)\Qt.props')">]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ </Target>]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</TableRowGroup>
|
|
||||||
</Table>
|
|
||||||
<Paragraph FontSize="20" FontWeight="Bold" Margin="12">
|
|
||||||
<Span><![CDATA[🡺 Qt property sheet]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
<Table CellSpacing="0" BorderBrush="Gray" BorderThickness="0.5">
|
|
||||||
<Table.Columns>
|
|
||||||
<TableColumn />
|
|
||||||
<TableColumn />
|
|
||||||
</Table.Columns>
|
|
||||||
<TableRowGroup>
|
|
||||||
<TableRow Background="Orange">
|
|
||||||
<TableCell ColumnSpan="2" BorderThickness="0.5" BorderBrush="Gray">
|
|
||||||
<Paragraph Margin="10,5" FontWeight="Bold">
|
|
||||||
<Span><![CDATA[C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <Import Project="$(QtMsBuild)\Qt.props" />]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <Import Project="$(QtMsBuild)\Qt.props" />]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <Import Project="$(QtMsBuild)\Qt.props" />]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <Import Project="$(QtMsBuild)\Qt.props" />]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</TableRowGroup>
|
|
||||||
</Table>
|
|
||||||
<Paragraph FontSize="20" FontWeight="Bold" Margin="12">
|
|
||||||
<Span><![CDATA[🡺 Qt targets]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
<Table CellSpacing="0" BorderBrush="Gray" BorderThickness="0.5">
|
|
||||||
<Table.Columns>
|
|
||||||
<TableColumn />
|
|
||||||
<TableColumn />
|
|
||||||
</Table.Columns>
|
|
||||||
<TableRowGroup>
|
|
||||||
<TableRow Background="Orange">
|
|
||||||
<TableCell ColumnSpan="2" BorderThickness="0.5" BorderBrush="Gray">
|
|
||||||
<Paragraph Margin="10,5" FontWeight="Bold">
|
|
||||||
<Span><![CDATA[C:\Users\30453\Desktop\RasterTool\RasterProcessTool\BaseCommonLibrary\BaseCommonLibrary.vcxproj]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell ColumnSpan="2" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.5" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0" />
|
|
||||||
</TableCell>
|
|
||||||
<TableCell BorderThickness="0, 0, 0.5, 0" BorderBrush="Gray">
|
|
||||||
<Paragraph FontFamily="Consolas" Margin="4, 0">
|
|
||||||
<Span Background="LightGreen"><![CDATA[ <Import Project="$(QtMsBuild)\qt.targets" Condition="Exists('$(QtMsBuild)\qt.targets')" />]]></Span>
|
|
||||||
</Paragraph>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</TableRowGroup>
|
|
||||||
</Table>
|
|
||||||
</Section>
|
|
||||||
<Section>
|
|
||||||
<Paragraph />
|
|
||||||
</Section>
|
|
||||||
</FlowDocument>
|
|
||||||
<!--tt6O+8R3ZB6prOXbquQ12IXqTLK9S8iJYIu6TuYJVVk=-->
|
|
||||||
|
|
@ -1,324 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|ARM">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|ARM">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<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">
|
|
||||||
<VCProjectVersion>17.0</VCProjectVersion>
|
|
||||||
<Keyword>Win32Proj</Keyword>
|
|
||||||
<ProjectGuid>{872ecd6f-30e3-4a1b-b17c-15e87d373ff6}</ProjectGuid>
|
|
||||||
<RootNamespace>BaseCommonLibrary</RootNamespace>
|
|
||||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
|
||||||
<Keyword>QtVS_v304</Keyword>
|
|
||||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<Import Project="$(QtMsBuild)\qt_defaults.props" Condition="Exists('$(QtMsBuild)\qt_defaults.props')" />
|
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<QtModules>core;gui;widgets</QtModules>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<QtModules>core;gui;widgets</QtModules>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<QtModules>core;gui;widgets</QtModules>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="QtSettings">
|
|
||||||
<QtModules>core;gui;widgets</QtModules>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<QtModules>core;xml;sql;opengl;gui;svg;xmlpatterns;widgets;location;positioning;openglextensions;charts</QtModules>
|
|
||||||
<QtPlugin>false</QtPlugin>
|
|
||||||
<QtInstall>tools_qt5</QtInstall>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="QtSettings">
|
|
||||||
<QtModules>core;xml;sql;opengl;gui;svg;xmlpatterns;widgets;location;positioning;openglextensions;charts</QtModules>
|
|
||||||
<QtPlugin>false</QtPlugin>
|
|
||||||
<QtInstall>tools_qt5</QtInstall>
|
|
||||||
</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>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<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|Win32'">
|
|
||||||
<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)'=='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 Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
|
||||||
<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>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
|
||||||
<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)'=='Release|x64'">
|
|
||||||
<IncludePath>./BaseTool;$(IncludePath)</IncludePath>
|
|
||||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
|
||||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<IncludePath>./BaseTool;$(IncludePath)</IncludePath>
|
|
||||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
|
||||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;BASECOMMONLIBRARY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<EnableUAC>false</EnableUAC>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;BASECOMMONLIBRARY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<EnableUAC>false</EnableUAC>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>_DEBUG;BASECOMMONLIBRARY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<EnableUAC>false</EnableUAC>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>_DEBUG;BASECOMMONLIBRARY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<EnableUAC>false</EnableUAC>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>NDEBUG;BASECOMMONLIBRARY_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;BASECONSTVARIABLE_API;_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
||||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
|
||||||
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
|
||||||
<OpenMPSupport>true</OpenMPSupport>
|
|
||||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
|
||||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
|
||||||
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
|
||||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
|
||||||
<Optimization>MaxSpeed</Optimization>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
|
||||||
<EnableUAC>false</EnableUAC>
|
|
||||||
</Link>
|
|
||||||
<CudaCompile>
|
|
||||||
<GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
|
|
||||||
<CodeGeneration>compute_82,sm_82</CodeGeneration>
|
|
||||||
</CudaCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>NDEBUG;BASECOMMONLIBRARY_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;BASECONSTVARIABLE_API;_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
||||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
|
||||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
|
||||||
<OpenMPSupport>true</OpenMPSupport>
|
|
||||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
|
||||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
|
||||||
<EnableUAC>false</EnableUAC>
|
|
||||||
</Link>
|
|
||||||
<CudaCompile>
|
|
||||||
<GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
|
|
||||||
<CodeGeneration>compute_82,sm_82</CodeGeneration>
|
|
||||||
</CudaCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="BaseTool\BaseConstVariable.h" />
|
|
||||||
<ClInclude Include="BaseTool\BaseTool.h" />
|
|
||||||
<ClInclude Include="BaseTool\EchoDataFormat.h" />
|
|
||||||
<ClInclude Include="BaseTool\FileOperator.h" />
|
|
||||||
<ClInclude Include="BaseTool\GeoOperator.h" />
|
|
||||||
<ClInclude Include="BaseTool\ImageOperatorBase.h" />
|
|
||||||
<ClInclude Include="BaseTool\LogInfoCls.h" />
|
|
||||||
<QtMoc Include="BaseTool\QToolProcessBarDialog.h" />
|
|
||||||
<ClInclude Include="BaseTool\SARSimulationImageL1.h" />
|
|
||||||
<ClInclude Include="ShowProessAbstract.h" />
|
|
||||||
<QtMoc Include="ToolAbstract\QToolAbstract.h" />
|
|
||||||
<ClInclude Include="BaseTool\PrintMsgToQDebug.h" />
|
|
||||||
<ClInclude Include="BaseTool\RasterToolBase.h" />
|
|
||||||
<ClInclude Include="BaseTool\stdafx.h" />
|
|
||||||
<ClInclude Include="framework.h" />
|
|
||||||
<ClInclude Include="pch.h" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="BaseTool\BaseTool.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\EchoDataFormat.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\FileOperator.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\gdalImageComplexOperator.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\gdalImageOperator.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\GeoOperator.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\LogInfoCls.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\MergeRasterOperator.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\PrintMsgToQDebug.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\QToolProcessBarDialog.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\RasterToolBase.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\SARSimulationImageL1.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\ShowProessAbstract.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\stdafx.cpp" />
|
|
||||||
<ClCompile Include="BaseTool\TestImageOperator.cpp" />
|
|
||||||
<ClCompile Include="dllmain.cpp" />
|
|
||||||
<ClCompile Include="ImageOperatorFuntion.cpp" />
|
|
||||||
<ClCompile Include="pch.cpp">
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ToolAbstract\QToolAbstract.cpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<QtUic Include="BaseTool\QToolProcessBarDialog.ui" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<Import Project="$(QtMsBuild)\qt.targets" Condition="Exists('$(QtMsBuild)\qt.targets')" />
|
|
||||||
<ImportGroup Label="ExtensionTargets" />
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,139 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup>
|
|
||||||
<Filter Include="源文件">
|
|
||||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
|
||||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="头文件">
|
|
||||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
|
||||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="资源文件">
|
|
||||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
|
||||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="BaseTool">
|
|
||||||
<UniqueIdentifier>{bf5c3550-65f6-4dad-9908-26690551ffad}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="ToolAbstract">
|
|
||||||
<UniqueIdentifier>{4233f4e2-0d0f-4cf9-8722-367d80339b2c}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="framework.h">
|
|
||||||
<Filter>头文件</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="pch.h">
|
|
||||||
<Filter>头文件</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BaseTool\BaseConstVariable.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BaseTool\BaseTool.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BaseTool\FileOperator.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BaseTool\GeoOperator.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BaseTool\LogInfoCls.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BaseTool\RasterToolBase.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BaseTool\stdafx.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BaseTool\PrintMsgToQDebug.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ShowProessAbstract.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BaseTool\ImageOperatorBase.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BaseTool\EchoDataFormat.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BaseTool\SARSimulationImageL1.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="dllmain.cpp">
|
|
||||||
<Filter>源文件</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="pch.cpp">
|
|
||||||
<Filter>源文件</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\BaseTool.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\FileOperator.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\GeoOperator.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\LogInfoCls.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\RasterToolBase.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\stdafx.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ToolAbstract\QToolAbstract.cpp">
|
|
||||||
<Filter>ToolAbstract</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\PrintMsgToQDebug.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\ShowProessAbstract.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\gdalImageOperator.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\gdalImageComplexOperator.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ImageOperatorFuntion.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\QToolProcessBarDialog.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\EchoDataFormat.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\SARSimulationImageL1.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\TestImageOperator.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BaseTool\MergeRasterOperator.cpp">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<QtMoc Include="ToolAbstract\QToolAbstract.h">
|
|
||||||
<Filter>ToolAbstract</Filter>
|
|
||||||
</QtMoc>
|
|
||||||
<QtMoc Include="BaseTool\QToolProcessBarDialog.h">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</QtMoc>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<QtUic Include="BaseTool\QToolProcessBarDialog.ui">
|
|
||||||
<Filter>BaseTool</Filter>
|
|
||||||
</QtUic>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,361 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#ifndef BASECONSTVARIABLE_H
|
|
||||||
#define BASECONSTVARIABLE_H
|
|
||||||
//#define EIGEN_USE_MKL_ALL
|
|
||||||
//#define EIGEN_NO_DEBUG
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef BASECONSTVARIABLE_API
|
|
||||||
#define BASECONSTVARIABLEAPI __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
#define BASECONSTVARIABLEAPI __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 定义常见文件格式*********/
|
|
||||||
#define ENVI_FILE_FORMAT_FILTER u8"ALL File(*.*);;ENVI Bin(*.bin);;ENVI Data(*.dat);;ENVI Data(*.data);;tiff影像(*.tif);;tiff影像(*.tiff)"
|
|
||||||
#define XML_FILE_FORMAT_FILTER u8"ALL File(*.*);;XML File(*.xml);;tiff影像(*.tiff)"
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
//#define EIGEN_USE_BLAS
|
|
||||||
//#define EIGEN_USE_LAPACK
|
|
||||||
//#define EIGEN_VECTORIZE_SSE2
|
|
||||||
|
|
||||||
//#define DEBUGSHOWDIALOG
|
|
||||||
|
|
||||||
#define __CUDANVCC___ // 定义CUDA函数
|
|
||||||
|
|
||||||
#define __PRFDEBUG__
|
|
||||||
//#define __PRFDEBUG_PRFINF__
|
|
||||||
//#define __ECHOTIMEDEBUG__
|
|
||||||
|
|
||||||
#define __TBPIMAGEDEBUG__
|
|
||||||
|
|
||||||
//#include <mkl.h>
|
|
||||||
#include <complex>
|
|
||||||
#include <math.h>
|
|
||||||
#include <complex>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
/** 打印时间 ***************************************************************/
|
|
||||||
inline char* get_cur_time() {
|
|
||||||
static char s[20];
|
|
||||||
time_t t;
|
|
||||||
struct tm* ltime;
|
|
||||||
time(&t);
|
|
||||||
ltime = localtime(&t);
|
|
||||||
strftime(s, 20, "%Y-%m-%d %H:%M:%S", ltime);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define PRINT(fmt, ...) printf("%s " fmt, get_cur_time(), ##__VA_ARGS__);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define MATPLOTDRAWIMAGE
|
|
||||||
|
|
||||||
|
|
||||||
#define r2d 180/3.141592653589793238462643383279
|
|
||||||
#define d2r 3.141592653589793238462643383279/180
|
|
||||||
#define LIGHTSPEED 299792458
|
|
||||||
#define PRECISIONTOLERANCE 1e-6
|
|
||||||
#define Radians2Degrees(Radians) Radians*PI_180
|
|
||||||
#define Degrees2Radians(Degrees) Degrees*T180_PI
|
|
||||||
#define EARTHWE 0.000072292115
|
|
||||||
#define PI 3.141592653589793238462643383279
|
|
||||||
|
|
||||||
#define WGS84_A 6378137.0 // 长半轴 (m)
|
|
||||||
#define WGS84_F (1.0/298.257223563)
|
|
||||||
#define WGS84_B (WGS84_A*(1-WGS84_F)) // 短半轴 (m)
|
|
||||||
|
|
||||||
|
|
||||||
#define earthRoute 0.000072292115
|
|
||||||
#define Memory1GB 1073741824
|
|
||||||
#define Memory1MB 1048576
|
|
||||||
#define Memory1KB 1024
|
|
||||||
|
|
||||||
const std::complex<double> imagI(0, 1);
|
|
||||||
|
|
||||||
|
|
||||||
const double epsilon = 0.000000000000001;
|
|
||||||
const double pi = 3.14159265358979323846;
|
|
||||||
|
|
||||||
|
|
||||||
const double a = 6378137.0; //椭球长半轴
|
|
||||||
const double ae = 6378137.0; //椭球长半轴
|
|
||||||
const double ee = 0.0818191910428;// 第一偏心率
|
|
||||||
const double f_inverse = 298.257223563; //扁率倒数
|
|
||||||
const double b = a - a / f_inverse;
|
|
||||||
const double eSquare = (a * a - b * b) / (a * a);
|
|
||||||
const double e = sqrt(eSquare);
|
|
||||||
const double earth_Re = 6378136.49;
|
|
||||||
const double earth_Rp = (1 - 1 / f_inverse) * earth_Re;
|
|
||||||
const double earth_We = 0.000072292115;
|
|
||||||
|
|
||||||
/*********************************************** openMap参数 ********************************************************************/
|
|
||||||
static long Paral_num_thread = 14;
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************** 基础枚举 ********************************************************************/
|
|
||||||
|
|
||||||
enum POLARTYPEENUM { // 极化类型
|
|
||||||
POLARHH,
|
|
||||||
POLARHV,
|
|
||||||
POLARVH,
|
|
||||||
POLARVV,
|
|
||||||
POLARUNKOWN
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************** 基础结构体区域 ********************************************************************/
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 地理坐标点
|
|
||||||
/// </summary>
|
|
||||||
struct Landpoint // 点 SAR影像的像素坐标;
|
|
||||||
{
|
|
||||||
double lon; // 经度x lon pixel_col
|
|
||||||
double lat; // 纬度y lat pixel_row
|
|
||||||
double ati; // 高程z ati pixel_time
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Point2 {
|
|
||||||
double x = 0;
|
|
||||||
double y = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct Point3 {
|
|
||||||
double x = 0;
|
|
||||||
double y = 0;
|
|
||||||
double z = 0;
|
|
||||||
void setX(double ix) { x = ix; }
|
|
||||||
void setY(double iy) { y = iy; }
|
|
||||||
void setZ(double iz) { z = iz; }
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Point_3d {
|
|
||||||
double x;
|
|
||||||
double y;
|
|
||||||
double z;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct DemBox {
|
|
||||||
double min_lon;
|
|
||||||
double max_lon;
|
|
||||||
double min_lat;
|
|
||||||
double max_lat;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Vector3 {
|
|
||||||
double x, y, z;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct Vector3_single {
|
|
||||||
float x, y, z;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************** FEKO仿真参数 ********************************************************************/
|
|
||||||
extern "C" struct SatellitePos {
|
|
||||||
double time;
|
|
||||||
double Px ;
|
|
||||||
double Py ;
|
|
||||||
double Pz ;
|
|
||||||
double Vx ;
|
|
||||||
double Vy ;
|
|
||||||
double Vz ;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" struct SatelliteAntPos {
|
|
||||||
double time; // 0
|
|
||||||
double Px;
|
|
||||||
double Py;
|
|
||||||
double Pz;
|
|
||||||
double Vx;
|
|
||||||
double Vy;
|
|
||||||
double Vz; //7
|
|
||||||
double AntDirectX;
|
|
||||||
double AntDirectY;
|
|
||||||
double AntDirectZ;
|
|
||||||
double AVx;
|
|
||||||
double AVy;
|
|
||||||
double AVz;//13
|
|
||||||
double ZeroAntDiectX;
|
|
||||||
double ZeroAntDiectY;
|
|
||||||
double ZeroAntDiectZ;
|
|
||||||
double lon;
|
|
||||||
double lat;
|
|
||||||
double ati; // 19
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" struct PatternImageDesc {
|
|
||||||
long phinum;
|
|
||||||
long thetanum;
|
|
||||||
double startTheta;
|
|
||||||
double startPhi;
|
|
||||||
double dtheta;
|
|
||||||
double dphi;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct CUDA_AntSate_PtrList {
|
|
||||||
long PRF_len = 0;
|
|
||||||
double* h_antpx = nullptr, * d_antpx = nullptr;
|
|
||||||
double* h_antpy = nullptr, * d_antpy = nullptr;
|
|
||||||
double* h_antpz = nullptr, * d_antpz = nullptr;
|
|
||||||
double* h_antvx = nullptr, * d_antvx = nullptr;
|
|
||||||
double* h_antvy = nullptr, * d_antvy = nullptr;
|
|
||||||
double* h_antvz = nullptr, * d_antvz = nullptr;
|
|
||||||
double* h_antdirectx = nullptr, * d_antdirectx = nullptr;
|
|
||||||
double* h_antdirecty = nullptr, * d_antdirecty = nullptr;
|
|
||||||
double* h_antdirectz = nullptr, * d_antdirectz = nullptr;
|
|
||||||
double* h_antXaxisX = nullptr, * d_antXaxisX = nullptr;
|
|
||||||
double* h_antXaxisY = nullptr, * d_antXaxisY = nullptr;
|
|
||||||
double* h_antXaxisZ = nullptr, * d_antXaxisZ = nullptr;
|
|
||||||
double* h_antYaxisX = nullptr, * d_antYaxisX = nullptr;
|
|
||||||
double* h_antYaxisY = nullptr, * d_antYaxisY = nullptr;
|
|
||||||
double* h_antYaxisZ = nullptr, * d_antYaxisZ = nullptr;
|
|
||||||
double* h_antZaxisX = nullptr, * d_antZaxisX = nullptr;
|
|
||||||
double* h_antZaxisY = nullptr, * d_antZaxisY = nullptr;
|
|
||||||
double* h_antZaxisZ = nullptr, * d_antZaxisZ = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*********************************************** 卫星轨道坐标 ********************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 轨道节点,坐标系统为WGS84
|
|
||||||
/// </summary>
|
|
||||||
struct SatelliteOribtNode {
|
|
||||||
double time;
|
|
||||||
|
|
||||||
double Px;// 位置
|
|
||||||
double Py;
|
|
||||||
double Pz;
|
|
||||||
|
|
||||||
double Vx;// 速度
|
|
||||||
double Vy;
|
|
||||||
double Vz;
|
|
||||||
|
|
||||||
double AVx; // 加速度
|
|
||||||
double AVy;
|
|
||||||
double AVz;
|
|
||||||
|
|
||||||
double AntXaxisX; // X天线指向,对应翻滚角等参数
|
|
||||||
double AntXaxisY; //
|
|
||||||
double AntXaxisZ; //
|
|
||||||
|
|
||||||
double AntYaxisX; // Y天线指向,对应翻滚角等参数
|
|
||||||
double AntYaxisY; //
|
|
||||||
double AntYaxisZ; //
|
|
||||||
|
|
||||||
double AntZaxisX; // Z天线指向,对应翻滚角等参数
|
|
||||||
double AntZaxisY; //
|
|
||||||
double AntZaxisZ; //
|
|
||||||
|
|
||||||
|
|
||||||
double AntDirecX; // 天线指向,对应翻滚角等参数
|
|
||||||
double AntDirecY;
|
|
||||||
double AntDirecZ;
|
|
||||||
|
|
||||||
double zeroDopplerDirectX; // 0 多普勒方向
|
|
||||||
double zeroDopplerDirectY;
|
|
||||||
double zeroDopplerDirectZ;
|
|
||||||
|
|
||||||
double beamAngle; // 波位角
|
|
||||||
double AzAngle;// 摆动角
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct SatelliteAntDirect {
|
|
||||||
double Xst; // 地面-->卫星矢量
|
|
||||||
double Yst;
|
|
||||||
double Zst;
|
|
||||||
double Vxs; // 卫星速度
|
|
||||||
double Vys;
|
|
||||||
double Vzs;
|
|
||||||
|
|
||||||
double Xant; // 天线坐标系下的 矢量坐标
|
|
||||||
double Yant;
|
|
||||||
double Zant;
|
|
||||||
|
|
||||||
double Norm;
|
|
||||||
|
|
||||||
double ThetaAnt; // 天线坐标系下的 theta 坐标系
|
|
||||||
double PhiAnt;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct RadiationPatternGainPoint {
|
|
||||||
double theta;
|
|
||||||
double phi;
|
|
||||||
double GainValue;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************** 指针回收区域 ********************************************************************/
|
|
||||||
|
|
||||||
inline void delArrPtr(void* p)
|
|
||||||
{
|
|
||||||
if (nullptr == p || NULL == p) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
delete[] p;
|
|
||||||
p = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline void delPointer(void* p)
|
|
||||||
{
|
|
||||||
if (nullptr == p || NULL == p) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
delete p;
|
|
||||||
p = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline void PrintTime() {
|
|
||||||
time_t current_time;
|
|
||||||
time(¤t_time);
|
|
||||||
printf("Current timestamp in seconds: %ld\n", (long)current_time);
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 计算分块 ******************************************************************/
|
|
||||||
|
|
||||||
inline long getBlockRows(long sizeMB, long cols, long sizeMeta, long maxRows) {
|
|
||||||
long rownum = (round(Memory1MB * 1.0 / sizeMeta / cols * sizeMB) + cols - 1);
|
|
||||||
rownum = rownum < 0 ? 1 : rownum;
|
|
||||||
rownum = rownum < maxRows ? rownum : maxRows;
|
|
||||||
return rownum;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
inline long nextpow2(long n) {
|
|
||||||
long en = ceil(log2(n));
|
|
||||||
return pow(2, en);
|
|
||||||
};
|
|
||||||
|
|
||||||
inline void releaseVoidArray(void* a)
|
|
||||||
{
|
|
||||||
free(a);
|
|
||||||
a = NULL;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,775 +0,0 @@
|
||||||
#include "stdafx.h"
|
|
||||||
//#define EIGEN_USE_BLAS
|
|
||||||
#define EIGEN_VECTORIZE_SSE4_2
|
|
||||||
//#include <mkl.h>
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <Eigen/Core>
|
|
||||||
#include <Eigen/Dense>
|
|
||||||
#include <time.h>
|
|
||||||
////#include <mkl.h>
|
|
||||||
|
|
||||||
#include <omp.h>
|
|
||||||
#include <QDir>
|
|
||||||
#include < io.h >
|
|
||||||
#include < stdio.h >
|
|
||||||
#include < stdlib.h >
|
|
||||||
#include <gdal.h>
|
|
||||||
#include <gdal_priv.h>
|
|
||||||
#include <gdalwarper.h>
|
|
||||||
//#include <ogr_geos.h>
|
|
||||||
#include <ogrsf_frmts.h> //#include "ogrsf_frmts.h"
|
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
#include <proj.h>
|
|
||||||
#include "GeoOperator.h"
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
|
||||||
#include "baseTool.h"
|
|
||||||
|
|
||||||
#include <gsl/gsl_fit.h> // 多项式拟合
|
|
||||||
#include <gsl/gsl_cdf.h> /* 提供了 gammaq 函数 */
|
|
||||||
#include <gsl/gsl_vector.h> /* 提供了向量结构*/
|
|
||||||
#include <gsl/gsl_matrix.h>
|
|
||||||
#include <gsl/gsl_multifit.h>
|
|
||||||
#include <qcoreapplication.h>
|
|
||||||
|
|
||||||
#include <xmmintrin.h> // 包含SSE指令集头文件
|
|
||||||
#include <emmintrin.h> // 包含SSE2指令集头文件
|
|
||||||
#include <omp.h> // 包含OpenMP头文件
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
|
||||||
#include <boost/date_time/posix_time/conversion.hpp>
|
|
||||||
|
|
||||||
QString longDoubleToQStringScientific(long double value) {
|
|
||||||
std::ostringstream stream;
|
|
||||||
|
|
||||||
// 设置流的精度为35位有效数字,并使用科学计数法
|
|
||||||
stream << std::scientific << std::setprecision(35) << value;
|
|
||||||
|
|
||||||
// 将标准字符串转换为 QString
|
|
||||||
return QString::fromStdString(stream.str());
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getCurrentTimeString() {
|
|
||||||
struct tm ConversionTime;
|
|
||||||
std::time_t t = std::time(NULL);
|
|
||||||
char mbstr[100];
|
|
||||||
_localtime64_s(&ConversionTime, &t);
|
|
||||||
std::strftime(mbstr, sizeof(mbstr), "%Y-%m-%d %H:%M:%S", &ConversionTime);
|
|
||||||
QString strTime = mbstr;
|
|
||||||
return strTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getCurrentShortTimeString() {
|
|
||||||
struct tm ConversionTime;
|
|
||||||
std::time_t t = std::time(NULL);
|
|
||||||
char mbstr[100];
|
|
||||||
_localtime64_s(&ConversionTime, &t);
|
|
||||||
std::strftime(mbstr, sizeof(mbstr), "%Y-%m-%d %H:%M:%S", &ConversionTime);
|
|
||||||
QString strTime = mbstr;
|
|
||||||
return strTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<QString> splitString(const QString& str, char delimiter)
|
|
||||||
{
|
|
||||||
QStringList tokens = str.split(delimiter);
|
|
||||||
return convertQStringListToStdVector(tokens);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::complex<double> Cubic_Convolution_interpolation(double u, double v, Eigen::MatrixX<std::complex<double>> img)
|
|
||||||
{
|
|
||||||
if (img.rows() != 4 || img.cols() != 4) {
|
|
||||||
throw std::exception("the size of img's block is not right");
|
|
||||||
}
|
|
||||||
// 斤拷锟斤拷模锟斤拷
|
|
||||||
Eigen::MatrixX<std::complex<double>> wrc(1, 4);// 使锟斤拷 complex<double> 斤拷锟斤拷要原斤拷为锟剿伙拷取值
|
|
||||||
Eigen::MatrixX<std::complex<double>> wcr(4, 1);//
|
|
||||||
for (int i = 0; i < 4; i++) {
|
|
||||||
wrc(0, i) = Cubic_kernel_weight(u + 1 - i); // u+1,u,u-1,u-2
|
|
||||||
wcr(i, 0) = Cubic_kernel_weight(v + 1 - i);
|
|
||||||
}
|
|
||||||
|
|
||||||
Eigen::MatrixX<std::complex<double>> interValue = wrc * img * wcr;
|
|
||||||
return interValue(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::complex<double> Cubic_kernel_weight(double s)
|
|
||||||
{
|
|
||||||
s = abs(s);
|
|
||||||
if (s <= 1) {
|
|
||||||
return std::complex<double>(1.5 * s * s * s - 2.5 * s * s + 1, 0);
|
|
||||||
}
|
|
||||||
else if (s <= 2) {
|
|
||||||
return std::complex<double>(-0.5 * s * s * s + 2.5 * s * s - 4 * s + 2, 0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return std::complex<double>(0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// p11 p12 -- x
|
|
||||||
/// p0(u,v)
|
|
||||||
/// p21 p22
|
|
||||||
/// |
|
|
||||||
/// y
|
|
||||||
/// p11(0,0)
|
|
||||||
/// p21(0,1)
|
|
||||||
/// P12(1,0)
|
|
||||||
/// p22(1,1)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="p0">x,y,z</param>
|
|
||||||
/// <param name="p1">x,y,z</param>
|
|
||||||
/// <param name="p2">x,y,z</param>
|
|
||||||
/// <param name="p3">x,y,z</param>
|
|
||||||
/// <param name="p4">x,y,z</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
double Bilinear_interpolation(Landpoint p0, Landpoint p11, Landpoint p21, Landpoint p12, Landpoint p22)
|
|
||||||
{
|
|
||||||
return p11.ati * (1 - p0.lon) * (1 - p0.lat) +
|
|
||||||
p12.ati * p0.lon * (1 - p0.lat) +
|
|
||||||
p21.ati * (1 - p0.lon) * p0.lat +
|
|
||||||
p22.ati * p0.lon * p0.lat;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool onSegment(Point3 Pi, Point3 Pj, Point3 Q)
|
|
||||||
{
|
|
||||||
if ((Q.x - Pi.x) * (Pj.y - Pi.y) == (Pj.x - Pi.x) * (Q.y - Pi.y) //叉乘
|
|
||||||
//保证Q点坐标在pi,pj之间
|
|
||||||
&& std::min(Pi.x, Pj.x) <= Q.x && Q.x <= std::max(Pi.x, Pj.x)
|
|
||||||
&& std::min(Pi.y, Pj.y) <= Q.y && Q.y <= std::max(Pi.y, Pj.y))
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Point3 invBilinear(Point3 p, Point3 a, Point3 b, Point3 c, Point3 d)
|
|
||||||
{
|
|
||||||
Point3 res;
|
|
||||||
|
|
||||||
Point3 e = b - a;
|
|
||||||
Point3 f = d - a;
|
|
||||||
Point3 g = a - b + c - d;
|
|
||||||
Point3 h = p - a;
|
|
||||||
|
|
||||||
double k2 = cross2d(g, f);
|
|
||||||
double k1 = cross2d(e, f) + cross2d(h, g);
|
|
||||||
double k0 = cross2d(h, e);
|
|
||||||
double u, v;
|
|
||||||
// if edges are parallel, this is a linear equation
|
|
||||||
if (abs(k2) < 0.001)
|
|
||||||
{
|
|
||||||
v = -k0 / k1;
|
|
||||||
u = (h.x - f.x * v) / (e.x + g.x * v);
|
|
||||||
p.z = a.z + (b.z - a.z) * u + (d.z - a.z) * v + (a.z - b.z + c.z - d.z) * u * v;
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
// otherwise, it's a quadratic
|
|
||||||
else
|
|
||||||
{
|
|
||||||
float w = k1 * k1 - 4.0 * k0 * k2;
|
|
||||||
if (w < 0.0) {
|
|
||||||
// 可能在边界上
|
|
||||||
if (onSegment(a, b, p)) {
|
|
||||||
Point3 tt = b - a;
|
|
||||||
Point3 ttpa = p - a;
|
|
||||||
double scater = ttpa / tt;
|
|
||||||
if (scater < 0 || scater>1) { return { -9999,-9999,-9999 }; }
|
|
||||||
p.z = a.z + scater * tt.z;
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
else if (onSegment(b, c, p)) {
|
|
||||||
Point3 tt = c - b;
|
|
||||||
Point3 ttpa = p - b;
|
|
||||||
double scater = ttpa / tt;
|
|
||||||
if (scater < 0 || scater>1) { return { -9999,-9999,-9999 }; }
|
|
||||||
p.z = b.z + scater * tt.z;
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
else if (onSegment(c, d, p)) {
|
|
||||||
Point3 tt = d - c;
|
|
||||||
Point3 ttpa = p - c;
|
|
||||||
double scater = ttpa / tt;
|
|
||||||
if (scater < 0 || scater>1) { return { -9999,-9999,-9999 }; }
|
|
||||||
p.z = c.z + scater * tt.z;
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
else if (onSegment(d, a, p)) {
|
|
||||||
Point3 tt = a - d;
|
|
||||||
Point3 ttpa = p - d;
|
|
||||||
double scater = ttpa / tt;
|
|
||||||
if (scater < 0 || scater>1) { return { -9999,-9999,-9999 }; }
|
|
||||||
p.z = d.z + scater * tt.z;
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
return { -9999,-9999,-9999 };
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
w = sqrt(w);
|
|
||||||
|
|
||||||
float ik2 = 0.5 / k2;
|
|
||||||
float v = (-k1 - w) * ik2;
|
|
||||||
float u = (h.x - f.x * v) / (e.x + g.x * v);
|
|
||||||
|
|
||||||
if (u < 0.0 || u>1.0 || v < 0.0 || v>1.0)
|
|
||||||
{
|
|
||||||
v = (-k1 + w) * ik2;
|
|
||||||
u = (h.x - f.x * v) / (e.x + g.x * v);
|
|
||||||
}
|
|
||||||
p.z = a.z + (b.z - a.z) * u + (d.z - a.z) * v + (a.z - b.z + c.z - d.z) * u * v;
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p.z = a.z + (b.z - a.z) * u + (d.z - a.z) * v + (a.z - b.z + c.z - d.z) * u * v;
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
double sind(double degree)
|
|
||||||
{
|
|
||||||
return sin(degree * d2r);
|
|
||||||
}
|
|
||||||
|
|
||||||
double cosd(double d)
|
|
||||||
{
|
|
||||||
return cos(d * d2r);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::string Convert(float Num)
|
|
||||||
{
|
|
||||||
std::ostringstream oss;
|
|
||||||
oss << Num;
|
|
||||||
std::string str(oss.str());
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString JoinPath(const QString& path, const QString& filename)
|
|
||||||
{
|
|
||||||
QDir dir(path);
|
|
||||||
|
|
||||||
// Ensure the path ends with the appropriate separator
|
|
||||||
if (!QDir::isAbsolutePath(path))
|
|
||||||
dir.makeAbsolute();
|
|
||||||
|
|
||||||
return dir.filePath(filename);
|
|
||||||
}
|
|
||||||
std::vector<QString> convertQStringListToStdVector(const QStringList& qStringList)
|
|
||||||
{
|
|
||||||
std::vector<QString> stdVector;
|
|
||||||
|
|
||||||
for (const QString& str : qStringList) {
|
|
||||||
stdVector.push_back(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
return stdVector;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ErrorCode polyfit(const double* x, const double* y, int xyLength, int poly_n, std::vector<double>& out_factor, double& out_chisq) {
|
|
||||||
/*
|
|
||||||
* x:自变量,视差
|
|
||||||
* y:因变量,距离
|
|
||||||
* xyLength: x、y长度
|
|
||||||
* poly_n:拟合的阶次
|
|
||||||
* out_factor:拟合的系数结果,从0阶到poly_n阶的系数
|
|
||||||
* out_chisq:拟合曲线与数据点的优值函数最小值 ,χ2 检验
|
|
||||||
*/
|
|
||||||
|
|
||||||
gsl_matrix* XX = gsl_matrix_alloc(xyLength, poly_n + 1);
|
|
||||||
gsl_vector* c = gsl_vector_alloc(poly_n + 1);
|
|
||||||
gsl_matrix* cov = gsl_matrix_alloc(poly_n + 1, poly_n + 1);
|
|
||||||
gsl_vector* vY = gsl_vector_alloc(xyLength);
|
|
||||||
|
|
||||||
for (size_t i = 0; i < xyLength; i++)
|
|
||||||
{
|
|
||||||
gsl_matrix_set(XX, i, 0, 1.0);
|
|
||||||
gsl_vector_set(vY, i, y[i]);
|
|
||||||
for (int j = 1; j <= poly_n; j++)
|
|
||||||
{
|
|
||||||
gsl_matrix_set(XX, i, j, pow(x[i], j));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gsl_multifit_linear_workspace* workspace = gsl_multifit_linear_alloc(xyLength, poly_n + 1);
|
|
||||||
int r = gsl_multifit_linear(XX, vY, c, cov, &out_chisq, workspace);
|
|
||||||
gsl_multifit_linear_free(workspace);
|
|
||||||
out_factor.resize(c->size, 0);
|
|
||||||
for (size_t i = 0; i < c->size; ++i)
|
|
||||||
{
|
|
||||||
out_factor[i] = gsl_vector_get(c, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
gsl_vector_free(vY);
|
|
||||||
gsl_matrix_free(XX);
|
|
||||||
gsl_matrix_free(cov);
|
|
||||||
gsl_vector_free(c);
|
|
||||||
|
|
||||||
return GSLState2ErrorCode(r);
|
|
||||||
}
|
|
||||||
|
|
||||||
Point3 crossProduct(const Point3& a, const Point3& b)
|
|
||||||
{
|
|
||||||
return Point3{
|
|
||||||
a.y * b.z - a.z * b.y, // C_x
|
|
||||||
a.z * b.x - a.x * b.z, // C_y
|
|
||||||
a.x * b.y - a.y * b.x // C_z
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 计算绕任意轴旋转的旋转矩阵
|
|
||||||
Eigen::Matrix3d rotationMatrix(const Eigen::Vector3d& axis, double angle) {
|
|
||||||
// 确保旋转轴是单位向量
|
|
||||||
Eigen::Vector3d u = axis.normalized();
|
|
||||||
|
|
||||||
double cos_theta = cos(angle);
|
|
||||||
double sin_theta = sin(angle);
|
|
||||||
|
|
||||||
// 计算旋转矩阵
|
|
||||||
Eigen::Matrix3d R;
|
|
||||||
R <<
|
|
||||||
cos_theta + u.x() * u.x() * (1 - cos_theta), u.x()* u.y()* (1 - cos_theta) - u.z() * sin_theta, u.x()* u.z()* (1 - cos_theta) + u.y() * sin_theta,
|
|
||||||
u.y()* u.x()* (1 - cos_theta) + u.z() * sin_theta, cos_theta + u.y() * u.y() * (1 - cos_theta), u.y()* u.z()* (1 - cos_theta) - u.x() * sin_theta,
|
|
||||||
u.z()* u.x()* (1 - cos_theta) - u.y() * sin_theta, u.z()* u.y()* (1 - cos_theta) + u.x() * sin_theta, cos_theta + u.z() * u.z() * (1 - cos_theta);
|
|
||||||
|
|
||||||
return R;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
long double convertToMilliseconds(const std::string& dateTimeStr) {
|
|
||||||
// 定义日期时间字符串
|
|
||||||
std::string dateTimeString = dateTimeStr;
|
|
||||||
// 使用 Boost.Date_Time 解析日期时间字符串
|
|
||||||
boost::posix_time::ptime dateTime = boost::posix_time::time_from_string(dateTimeString);
|
|
||||||
|
|
||||||
// 将 ptime 转换为自 epoch (1970年1月1日) 以来的毫秒数
|
|
||||||
boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
|
|
||||||
boost::posix_time::time_duration duration = dateTime - epoch;
|
|
||||||
long double milliseconds = duration.total_milliseconds() / 1000.0;
|
|
||||||
return milliseconds;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
long FindValueInStdVector(std::vector<double>& list, double& findv)
|
|
||||||
{
|
|
||||||
if (list.size() == 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else if (list.size() == 1) {
|
|
||||||
if (abs(list[0] - findv) < 1e-9) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
|
|
||||||
if (abs(list[0] - findv) < 1e-9) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else if (abs(list[list.size() - 1] - findv) < 1e-9) {
|
|
||||||
return list.size() - 1;
|
|
||||||
}
|
|
||||||
else if (list[0] > findv) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else if (list[list.size() - 1] < findv) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
long low = 0;
|
|
||||||
long high = list.size() - 1;
|
|
||||||
while (low <= high) {
|
|
||||||
long mid = (low + high) / 2;
|
|
||||||
if (abs(list[mid] - findv) < 1e-9) {
|
|
||||||
return mid;
|
|
||||||
}
|
|
||||||
else if (list[mid] < findv) {
|
|
||||||
low = mid + 1;
|
|
||||||
}
|
|
||||||
else if (list[mid] > findv) {
|
|
||||||
high = mid - 1;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
long InsertValueInStdVector(std::vector<double>& list, double insertValue, bool repeatValueInsert)
|
|
||||||
{
|
|
||||||
if (list.size() == 0) {
|
|
||||||
list.insert(list.begin(), insertValue);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else if (list.size() == 1) {
|
|
||||||
if (std::abs(list[0] - insertValue) < PRECISIONTOLERANCE) {
|
|
||||||
if (repeatValueInsert) {
|
|
||||||
list.push_back(insertValue);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (insertValue > list[0]) {
|
|
||||||
list.push_back(insertValue);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else if (insertValue < list[0]) {
|
|
||||||
list.push_back(insertValue);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
long low = 0;
|
|
||||||
long high = list.size() - 1;
|
|
||||||
long mid = -1;
|
|
||||||
// 处理边界
|
|
||||||
if (list[high] <= insertValue)
|
|
||||||
{
|
|
||||||
if (std::abs(list[high] - insertValue) < PRECISIONTOLERANCE) {
|
|
||||||
if (repeatValueInsert) {
|
|
||||||
list.push_back(insertValue);
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
list.push_back(insertValue);
|
|
||||||
}
|
|
||||||
return list.size() - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (list[low] >= insertValue) {
|
|
||||||
|
|
||||||
if (std::abs(list[low] - insertValue) < PRECISIONTOLERANCE) {
|
|
||||||
if (repeatValueInsert) {
|
|
||||||
list.insert(list.begin(), insertValue);
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
list.insert(list.begin(), insertValue);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
// low<insertValue < high
|
|
||||||
while ((high - low) > 1) {
|
|
||||||
mid = (low + high) / 2;
|
|
||||||
if (std::abs(list[mid] - insertValue) < PRECISIONTOLERANCE) {
|
|
||||||
if (repeatValueInsert) {
|
|
||||||
list.insert(list.begin() + mid, insertValue);
|
|
||||||
}
|
|
||||||
return mid;
|
|
||||||
}
|
|
||||||
else if (insertValue < list[mid]) {
|
|
||||||
high = mid;
|
|
||||||
}
|
|
||||||
else if (list[mid] < insertValue) {
|
|
||||||
low = mid;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (list[low] <= insertValue && insertValue <= list[high])
|
|
||||||
{
|
|
||||||
|
|
||||||
if (std::abs(list[high] - insertValue) < PRECISIONTOLERANCE) {
|
|
||||||
if (repeatValueInsert) {
|
|
||||||
list.insert(list.begin() + high, insertValue);
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
list.insert(list.begin() + high, insertValue);
|
|
||||||
}
|
|
||||||
return low;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
long FindValueInStdVectorLast(std::vector<double>& list, double& insertValue)
|
|
||||||
{
|
|
||||||
if (list.size() == 0 || list.size() == 1) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
long low = 0;
|
|
||||||
long high = list.size() - 1;
|
|
||||||
long mid = -1;
|
|
||||||
// 处理边界
|
|
||||||
if (list[high]+ PRECISIONTOLERANCE < insertValue)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else if (std::abs(list[high] - insertValue) < PRECISIONTOLERANCE)
|
|
||||||
{
|
|
||||||
return high;
|
|
||||||
}
|
|
||||||
else if (list[low] > insertValue) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else if (std::abs(list[low] - insertValue) < PRECISIONTOLERANCE) {
|
|
||||||
return low;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
// low<insertValue < high
|
|
||||||
while ((high - low) > 1) {
|
|
||||||
mid = (low + high) / 2;
|
|
||||||
if (insertValue < list[mid]) {
|
|
||||||
high = mid;
|
|
||||||
}
|
|
||||||
else if (list[mid] < insertValue) {
|
|
||||||
low = mid;
|
|
||||||
}
|
|
||||||
else {// insertValue==list[mid] , list[mid]===insertValue
|
|
||||||
return mid;//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (list[low] <= insertValue && insertValue <= list[high])
|
|
||||||
{
|
|
||||||
return low;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ErrorCode polynomial_fit(const std::vector<double>& x, const std::vector<double>& y, int degree, std::vector<double>& out_factor, double& out_chisq) {
|
|
||||||
int xyLength = x.size();
|
|
||||||
double* xdata = new double[xyLength];
|
|
||||||
double* ydata = new double[xyLength];
|
|
||||||
for (long i = 0; i < xyLength; i++) {
|
|
||||||
xdata[i] = x[i];
|
|
||||||
ydata[i] = y[i];
|
|
||||||
}
|
|
||||||
ErrorCode state = polyfit(xdata, ydata, xyLength, degree, out_factor, out_chisq);
|
|
||||||
|
|
||||||
delete[] xdata;
|
|
||||||
delete[] ydata; // 释放内存
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
QVector<SatelliteAntPos> SatellitePos2SatelliteAntPos(QVector<SatellitePos> poses)
|
|
||||||
{
|
|
||||||
QVector<SatelliteAntPos> antposes(poses.count());
|
|
||||||
for (long i = 0; i < poses.count(); i++) {
|
|
||||||
antposes[i].time = poses[i].time;
|
|
||||||
antposes[i].Px = poses[i].Px;
|
|
||||||
antposes[i].Py = poses[i].Py;
|
|
||||||
antposes[i].Pz = poses[i].Pz;
|
|
||||||
antposes[i].Vx = poses[i].Vx;
|
|
||||||
antposes[i].Vy = poses[i].Vy;
|
|
||||||
antposes[i].Vz = poses[i].Vz;
|
|
||||||
}
|
|
||||||
return antposes;
|
|
||||||
}
|
|
||||||
|
|
||||||
QVector<SatellitePos> SatelliteAntPos2SatellitePos(QVector<SatelliteAntPos> poses)
|
|
||||||
{
|
|
||||||
QVector<SatellitePos> antposes(poses.count());
|
|
||||||
for (long i = 0; i < poses.count(); i++) {
|
|
||||||
antposes[i].time = poses[i].time;
|
|
||||||
antposes[i].Px = poses[i].Px;
|
|
||||||
antposes[i].Py = poses[i].Py;
|
|
||||||
antposes[i].Pz = poses[i].Pz;
|
|
||||||
antposes[i].Vx = poses[i].Vx;
|
|
||||||
antposes[i].Vy = poses[i].Vy;
|
|
||||||
antposes[i].Vz = poses[i].Vz;
|
|
||||||
}
|
|
||||||
return antposes;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString getDebugDataPath(QString filename)
|
|
||||||
{
|
|
||||||
QString folderName = "debugdata";
|
|
||||||
QString appDir = QCoreApplication::applicationDirPath();
|
|
||||||
QString folderpath = JoinPath(appDir, folderName);
|
|
||||||
if (!QDir(folderpath).exists()) {
|
|
||||||
QDir(appDir).mkdir(folderName);
|
|
||||||
}
|
|
||||||
QString datapath = JoinPath(folderpath, filename);
|
|
||||||
QFile datafile(datapath);
|
|
||||||
if (datafile.exists()) {
|
|
||||||
datafile.remove();
|
|
||||||
}
|
|
||||||
return datapath;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<std::string> split(const std::string& str, char delimiter) {
|
|
||||||
std::vector<std::string> tokens;
|
|
||||||
std::string token;
|
|
||||||
std::istringstream tokenStream(str);
|
|
||||||
|
|
||||||
while (std::getline(tokenStream, token, delimiter)) {
|
|
||||||
tokens.push_back(token);
|
|
||||||
}
|
|
||||||
|
|
||||||
return tokens;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Eigen::VectorXd linspace(double start, double stop, int num) {
|
|
||||||
Eigen::VectorXd result(num);
|
|
||||||
|
|
||||||
double step = (stop - start) / (num - 1); // 计算步长
|
|
||||||
for (int i = 0; i < num; ++i) {
|
|
||||||
result[i] = start + i * step; // 生成等间距数值
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void initializeMatrixWithSSE2(Eigen::MatrixXd& mat, const double* data, long rowcount, long colcount) {
|
|
||||||
__m128d zero = _mm_setzero_pd();
|
|
||||||
|
|
||||||
#pragma omp parallel for
|
|
||||||
for (long i = 0; i < rowcount; ++i) {
|
|
||||||
for (long j = 0; j < colcount; j += 2) { // 每次处理2个double
|
|
||||||
if (j + 2 <= colcount) {
|
|
||||||
__m128d src = _mm_loadu_pd(&data[i * colcount + j]);
|
|
||||||
_mm_storeu_pd(&mat(i, j), src);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// 处理剩余部分
|
|
||||||
for (long k = j; k < colcount; ++k) {
|
|
||||||
mat(i, k) = data[i * colcount + k];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void initializeMatrixWithSSE2(Eigen::MatrixXf& mat, const float* data, long rowcount, long colcount) {
|
|
||||||
__m128 zero = _mm_setzero_ps();
|
|
||||||
|
|
||||||
#pragma omp parallel for
|
|
||||||
for (long i = 0; i < rowcount; ++i) {
|
|
||||||
for (long j = 0; j < colcount; j += 4) { // 每次处理4个float
|
|
||||||
if (j + 4 <= colcount) {
|
|
||||||
__m128 src = _mm_loadu_ps(&data[i * colcount + j]);
|
|
||||||
_mm_storeu_ps(&mat(i, j), src);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// 处理剩余部分
|
|
||||||
for (long k = j; k < colcount; ++k) {
|
|
||||||
mat(i, k) = data[i * colcount + k];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Eigen::MatrixXd BASECONSTVARIABLEAPI MuhlemanSigmaArray(Eigen::MatrixXd& eta_deg)
|
|
||||||
{
|
|
||||||
Eigen::MatrixXd sigma = Eigen::MatrixXd::Zero(eta_deg.rows(), eta_deg.cols());
|
|
||||||
for (long i = 0; i < sigma.rows(); i++) {
|
|
||||||
for (long j = 0; j < sigma.cols(); j++) {
|
|
||||||
sigma(i,j) = calculate_MuhlemanSigma(eta_deg(i, j));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sigma;
|
|
||||||
}
|
|
||||||
|
|
||||||
Eigen::MatrixXd BASECONSTVARIABLEAPI dB2Amp(Eigen::MatrixXd& sigma0)
|
|
||||||
{
|
|
||||||
Eigen::MatrixXd sigma = Eigen::MatrixXd::Zero(sigma0.rows(), sigma0.cols());
|
|
||||||
for (long i = 0; i < sigma.rows(); i++) {
|
|
||||||
for (long j = 0; j < sigma.cols(); j++) {
|
|
||||||
sigma(i, j) =std::pow(10.0, sigma0(i,j)/20.0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sigma;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QDateTime parseCustomDateTime(const QString& dateTimeStr) {
|
|
||||||
// 手动解析日期时间字符串
|
|
||||||
int year = dateTimeStr.left(4).toInt();
|
|
||||||
int month = dateTimeStr.mid(5, 2).toInt();
|
|
||||||
int day = dateTimeStr.mid(8, 2).toInt();
|
|
||||||
int hour = dateTimeStr.mid(11, 2).toInt();
|
|
||||||
int minute = dateTimeStr.mid(14, 2).toInt();
|
|
||||||
int second = dateTimeStr.mid(17, 2).toInt();
|
|
||||||
int msec = dateTimeStr.mid(20, 6).toInt(); // 只取毫秒的前三位,因为QDateTime支持到毫秒
|
|
||||||
|
|
||||||
// 创建 QDate 和 QTime 对象
|
|
||||||
QDate date(year, month, day);
|
|
||||||
QTime time(hour, minute, second, msec ); // 转换为微秒,但QTime只支持毫秒精度
|
|
||||||
|
|
||||||
// 构造 QDateTime 对象
|
|
||||||
QDateTime result(date, time);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool isLeapYear(int year) {
|
|
||||||
return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
int daysInMonth(int year, int month) {
|
|
||||||
if (month == 2) return isLeapYear(year) ? 29 : 28;
|
|
||||||
else if (month == 4 || month == 6 || month == 9 || month == 11) return 30;
|
|
||||||
else return 31;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TimestampMicroseconds parseAndConvert( std::string dateTimeStr) {
|
|
||||||
// 解析年、月、日、时、分、秒和微秒
|
|
||||||
int year = std::stoi(dateTimeStr.substr(0, 4));
|
|
||||||
int month = std::stoi(dateTimeStr.substr(5, 2));
|
|
||||||
int day = std::stoi(dateTimeStr.substr(8, 2));
|
|
||||||
int hour = std::stoi(dateTimeStr.substr(11, 2));
|
|
||||||
int minute = std::stoi(dateTimeStr.substr(14, 2));
|
|
||||||
int second = std::stoi(dateTimeStr.substr(17, 2));
|
|
||||||
int microsec = std::stoi(dateTimeStr.substr(20, 6));
|
|
||||||
|
|
||||||
// 计算从1970年至目标年份前一年的总天数
|
|
||||||
long long totalDays = 0;
|
|
||||||
for (int y = 1970; y < year; ++y) {
|
|
||||||
totalDays += isLeapYear(y) ? 366 : 365;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 加上目标年份从1月到上一个月的天数
|
|
||||||
for (int m = 1; m < month; ++m) {
|
|
||||||
totalDays += daysInMonth(year, m);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 加上本月的天数
|
|
||||||
totalDays += day - 1;
|
|
||||||
|
|
||||||
// 转换为总秒数,再加上小时、分钟、秒
|
|
||||||
long long totalSeconds = totalDays * 24 * 60 * 60 + hour * 60 * 60 + minute * 60 + second;
|
|
||||||
|
|
||||||
// 转换为毫秒和微秒
|
|
||||||
long long msecsSinceEpoch = totalSeconds * 1000 + microsec / 1000;
|
|
||||||
int microseconds = microsec % 1000;
|
|
||||||
|
|
||||||
return { msecsSinceEpoch, microseconds };
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,226 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#ifndef BASETOOL_H
|
|
||||||
#define BASETOOL_H
|
|
||||||
#include "BaseConstVariable.h"
|
|
||||||
|
|
||||||
///
|
|
||||||
/// 基本类、基本函数
|
|
||||||
///
|
|
||||||
|
|
||||||
|
|
||||||
// //#include <mkl.h>
|
|
||||||
#include <complex>
|
|
||||||
#include <iostream>
|
|
||||||
#include <Eigen/Core>
|
|
||||||
#include <Eigen/Dense>
|
|
||||||
#include <time.h>
|
|
||||||
#include <string>
|
|
||||||
#include <omp.h>
|
|
||||||
#include <gdal.h>
|
|
||||||
#include <gdal_priv.h>
|
|
||||||
#include <gdalwarper.h>
|
|
||||||
#include <ogrsf_frmts.h>
|
|
||||||
#include <fstream>
|
|
||||||
#include "GeoOperator.h"
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
#include <QString>
|
|
||||||
#include <QStringList>
|
|
||||||
#include "LogInfoCls.h"
|
|
||||||
#include <QString>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <iomanip>
|
|
||||||
#include <sstream>
|
|
||||||
#include <QDatetime>
|
|
||||||
#include <boost/cstdint.hpp>
|
|
||||||
|
|
||||||
///////////////////////////////////// 基础数学函数 /////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
QString longDoubleToQStringScientific(long double value);
|
|
||||||
|
|
||||||
///////////////////////////////////// 运行时间打印 /////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
QString BASECONSTVARIABLEAPI getCurrentTimeString();
|
|
||||||
QString BASECONSTVARIABLEAPI getCurrentShortTimeString();
|
|
||||||
|
|
||||||
std::vector<QString> BASECONSTVARIABLEAPI splitString(const QString& str, char delimiter);
|
|
||||||
std::vector<QString> BASECONSTVARIABLEAPI convertQStringListToStdVector(const QStringList& qStringList);
|
|
||||||
/////////////////////////////// 基本图像类 结束
|
|
||||||
/////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
std::string BASECONSTVARIABLEAPI Convert(float Num);
|
|
||||||
QString BASECONSTVARIABLEAPI JoinPath(const QString& path, const QString& filename);
|
|
||||||
|
|
||||||
////////////////////////////// 坐标部分基本方法 //////////////////////////////////////////
|
|
||||||
|
|
||||||
////////////////////////////// 坐标部分基本方法 //////////////////////////////////////////
|
|
||||||
|
|
||||||
////////////////////////////// 插值 ////////////////////////////////////////////
|
|
||||||
|
|
||||||
std::complex<double> BASECONSTVARIABLEAPI Cubic_Convolution_interpolation(double u, double v,
|
|
||||||
Eigen::MatrixX<std::complex<double>> img);
|
|
||||||
|
|
||||||
std::complex<double> BASECONSTVARIABLEAPI Cubic_kernel_weight(double s);
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI Bilinear_interpolation(Landpoint p0, Landpoint p11, Landpoint p21, Landpoint p12,Landpoint p22);
|
|
||||||
|
|
||||||
bool BASECONSTVARIABLEAPI onSegment(Point3 Pi, Point3 Pj, Point3 Q);
|
|
||||||
|
|
||||||
Point3 BASECONSTVARIABLEAPI invBilinear(Point3 p, Point3 a, Point3 b, Point3 c, Point3 d);
|
|
||||||
|
|
||||||
//
|
|
||||||
// WGS84 到J2000 坐标系的变换
|
|
||||||
// 参考网址:https://blog.csdn.net/hit5067/article/details/116894616
|
|
||||||
// 资料网址:http://celestrak.org/spacedata/
|
|
||||||
// 参数文件:
|
|
||||||
// a. Earth Orientation Parameter 文件: http://celestrak.org/spacedata/EOP-Last5Years.csv
|
|
||||||
// b. Space Weather Data 文件: http://celestrak.org/spacedata/SW-Last5Years.csv
|
|
||||||
// 备注:上述文件是自2017年-五年内
|
|
||||||
/**
|
|
||||||
在wgs84 坐标系转到J2000 坐标系 主要 涉及到坐标的相互转换。一般给定的WGS坐标为 给定时刻的 t ,BLH
|
|
||||||
转换步骤:
|
|
||||||
step 1: WGS 84 转换到协议地球坐标系
|
|
||||||
step 2: 协议地球坐标系 转换为瞬时地球坐标系
|
|
||||||
step 3: 瞬时地球坐标系 转换为 瞬时真天球坐标系
|
|
||||||
step 4: 瞬时真天球坐标系 转到瞬时平天球 坐标系
|
|
||||||
step 5: 瞬时平天球坐标系转换为协议天球坐标系(J2000)
|
|
||||||
**/
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI sind(double degree);
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI cosd(double d);
|
|
||||||
|
|
||||||
// 插值
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI polyfit(const double* x, const double* y, int xyLength, int poly_n, std::vector<double>& out_factor, double& out_chisq);
|
|
||||||
|
|
||||||
// 叉乘
|
|
||||||
Point3 BASECONSTVARIABLEAPI crossProduct(const Point3& a, const Point3& b);
|
|
||||||
|
|
||||||
Eigen::Matrix3d BASECONSTVARIABLEAPI rotationMatrix(const Eigen::Vector3d& axis, double angle);
|
|
||||||
|
|
||||||
long double BASECONSTVARIABLEAPI convertToMilliseconds(const std::string& dateTimeStr);
|
|
||||||
|
|
||||||
QDateTime BASECONSTVARIABLEAPI parseCustomDateTime(const QString& dateTimeStr);
|
|
||||||
/// <summary>
|
|
||||||
/// list 应该是按照从小到大的顺序排好
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="list"></param>
|
|
||||||
/// <param name="findv"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
long BASECONSTVARIABLEAPI FindValueInStdVector(std::vector<double>& list,double& findv);
|
|
||||||
|
|
||||||
long BASECONSTVARIABLEAPI InsertValueInStdVector(std::vector<double>& list, double insertValue, bool repeatValueInsert = false);
|
|
||||||
|
|
||||||
long BASECONSTVARIABLEAPI FindValueInStdVectorLast(std::vector<double>& list, double& findv);
|
|
||||||
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI polynomial_fit(const std::vector<double>& x, const std::vector<double>& y, int degree, std::vector<double>& out_factor, double& out_chisq);
|
|
||||||
|
|
||||||
QVector<SatelliteAntPos> BASECONSTVARIABLEAPI SatellitePos2SatelliteAntPos(QVector<SatellitePos> poses);
|
|
||||||
|
|
||||||
QVector<SatellitePos> BASECONSTVARIABLEAPI SatelliteAntPos2SatellitePos(QVector<SatelliteAntPos> poses);
|
|
||||||
|
|
||||||
QString BASECONSTVARIABLEAPI getDebugDataPath(QString filename);
|
|
||||||
std::vector<std::string> BASECONSTVARIABLEAPI split(const std::string& str, char delimiter);
|
|
||||||
Eigen::VectorXd BASECONSTVARIABLEAPI linspace(double start, double stop, int num);
|
|
||||||
|
|
||||||
|
|
||||||
/** 内存赋值 ***********************************************************************************************************/
|
|
||||||
void initializeMatrixWithSSE2(Eigen::MatrixXd& mat, const double* data, long rowcount, long colcount);
|
|
||||||
void initializeMatrixWithSSE2(Eigen::MatrixXf& mat, const float* data, long rowcount, long colcount);
|
|
||||||
|
|
||||||
Eigen::MatrixXd BASECONSTVARIABLEAPI MuhlemanSigmaArray(Eigen::MatrixXd& eta_deg);
|
|
||||||
Eigen::MatrixXd BASECONSTVARIABLEAPI dB2Amp(Eigen::MatrixXd& sigma0);
|
|
||||||
|
|
||||||
|
|
||||||
struct TimestampMicroseconds {
|
|
||||||
boost::int64_t msecsSinceEpoch; // 自1970-01-01T00:00:00 UTC以来的毫秒数
|
|
||||||
int microseconds; // 额外的微秒(精确到微秒)
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
bool BASECONSTVARIABLEAPI isLeapYear(int year);
|
|
||||||
int BASECONSTVARIABLEAPI daysInMonth(int year, int month);
|
|
||||||
|
|
||||||
TimestampMicroseconds BASECONSTVARIABLEAPI parseAndConvert( std::string dateTimeStr);
|
|
||||||
|
|
||||||
|
|
||||||
/** 模板函数类 ***********************************************************************************************************/
|
|
||||||
|
|
||||||
inline double calculate_MuhlemanSigma(double eta_deg) {
|
|
||||||
const double eta_rad = eta_deg * M_PI / 180.0; // 角度转弧度
|
|
||||||
|
|
||||||
const double cos_eta = std::cos(eta_rad);
|
|
||||||
const double sin_eta = std::sin(eta_rad);
|
|
||||||
|
|
||||||
const double denominator = sin_eta + 0.1 * cos_eta;
|
|
||||||
|
|
||||||
return (0.0133 * cos_eta) / std::pow(denominator, 3);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline void memsetInitArray(std::shared_ptr<T> ptr, long arrcount, T ti) {
|
|
||||||
for (long i = 0; i < arrcount; i++) {
|
|
||||||
ptr.get()[i] = ti;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline void memcpyArray(std::shared_ptr<T> srct, std::shared_ptr<T> dest, long arrcount) {
|
|
||||||
for (long i = 0; i < arrcount; i++) {
|
|
||||||
dest.get()[i] = srct.get()[i];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline void minValueInArr(T* ptr, long arrcount, T& minvalue) {
|
|
||||||
|
|
||||||
if (arrcount == 0)return;
|
|
||||||
|
|
||||||
minvalue = ptr[0];
|
|
||||||
for (long i = 0; i < arrcount; i++) {
|
|
||||||
if (minvalue > ptr[i]) {
|
|
||||||
minvalue = ptr[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline void maxValueInArr(T* ptr, long arrcount, T& maxvalue) {
|
|
||||||
|
|
||||||
if (arrcount == 0)return;
|
|
||||||
|
|
||||||
maxvalue = ptr[0];
|
|
||||||
for (long i = 0; i < arrcount; i++) {
|
|
||||||
if (maxvalue < ptr[i]) {
|
|
||||||
maxvalue = ptr[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 常用SAR工具 ***********************************************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline T complexAbs(std::complex<T> ccdata) {
|
|
||||||
return T(sqrt(pow(ccdata.real(), 2) + pow(ccdata.imag(), 2)));
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline void complex2dB(std::complex<T>* ccdata, T* outdata, long long count) {
|
|
||||||
|
|
||||||
for (long long i = 0; i < count; i++) {
|
|
||||||
outdata[i] = 20 * log10(complexAbs(ccdata[i]));
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,822 +0,0 @@
|
||||||
#include "stdafx.h"
|
|
||||||
#include "EchoDataFormat.h"
|
|
||||||
#include <QFile>
|
|
||||||
#include <QFileInfo>
|
|
||||||
#include <QDir>
|
|
||||||
#include <QString>
|
|
||||||
#include <QFile>
|
|
||||||
#include <QXmlStreamWriter>
|
|
||||||
#include <QXmlStreamReader>
|
|
||||||
#include <QDebug>
|
|
||||||
#include "ImageOperatorBase.h"
|
|
||||||
|
|
||||||
|
|
||||||
std::shared_ptr<PluseAntPos> CreatePluseAntPosArr(long pluseCount)
|
|
||||||
{
|
|
||||||
return std::shared_ptr<PluseAntPos>(new PluseAntPos[pluseCount],delArrPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
long getPluseDataSize(PluseData& pluseData)
|
|
||||||
{
|
|
||||||
long datasize = sizeof(long) + sizeof(double) + sizeof(double) * 6 + sizeof(long);// PRFId,time,px-vz,pluseCount
|
|
||||||
datasize = datasize + pluseData.plusePoints * sizeof(double) * 2; // 数据块
|
|
||||||
return datasize;
|
|
||||||
}
|
|
||||||
|
|
||||||
ErrorCode getPluseDataFromBuffer(char* buffer, PluseData & data)
|
|
||||||
{
|
|
||||||
long seekid = 0;
|
|
||||||
std::memcpy(&data.id, buffer + seekid, sizeof(data.id)); seekid += sizeof(data.id);
|
|
||||||
std::memcpy(&data.time, buffer + seekid, sizeof(data.time)); seekid += sizeof(data.time);
|
|
||||||
std::memcpy(&data.Px, buffer + seekid, sizeof(data.Px)); seekid += sizeof(data.Px);
|
|
||||||
std::memcpy(&data.Py, buffer + seekid, sizeof(data.Py)); seekid += sizeof(data.Py);
|
|
||||||
std::memcpy(&data.Pz, buffer + seekid, sizeof(data.Pz)); seekid += sizeof(data.Pz);
|
|
||||||
std::memcpy(&data.Vx, buffer + seekid, sizeof(data.Vx)); seekid += sizeof(data.Vx);
|
|
||||||
std::memcpy(&data.Vy, buffer + seekid, sizeof(data.Vy)); seekid += sizeof(data.Vy);
|
|
||||||
std::memcpy(&data.Vz, buffer + seekid, sizeof(data.Vz)); seekid += sizeof(data.Vz);
|
|
||||||
std::memcpy(&data.plusePoints, buffer + seekid, sizeof(data.plusePoints)); seekid += sizeof(data.plusePoints);
|
|
||||||
|
|
||||||
Eigen::MatrixXd echoData_real = Eigen::MatrixXd::Zero(1, data.plusePoints);
|
|
||||||
Eigen::MatrixXd echoData_imag = Eigen::MatrixXd::Zero(1, data.plusePoints);
|
|
||||||
std::memcpy(echoData_real.data(), buffer + seekid, sizeof(data.plusePoints)); seekid += data.plusePoints * sizeof(double);
|
|
||||||
std::memcpy(echoData_imag.data(), buffer + seekid, sizeof(data.plusePoints));
|
|
||||||
|
|
||||||
std::shared_ptr<Eigen::MatrixXcd> echoData = std::make_shared<Eigen::MatrixXcd>(1, data.plusePoints);
|
|
||||||
echoData->real() = echoData_real.array();
|
|
||||||
echoData->imag() = echoData_imag.array();
|
|
||||||
return ErrorCode::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<PluseData> CreatePluseDataArr(long pluseCount)
|
|
||||||
{
|
|
||||||
return std::shared_ptr<PluseData>(new PluseData[pluseCount],delArrPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<std::complex<double>> CreateEchoData(long plusePoints)
|
|
||||||
{
|
|
||||||
return std::shared_ptr<std::complex<double>>(new std::complex<double>[plusePoints],delArrPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
EchoL0Dataset::EchoL0Dataset()
|
|
||||||
{
|
|
||||||
this->folder="";
|
|
||||||
this->filename="";
|
|
||||||
this->xmlname="";
|
|
||||||
this->GPSPointFilename="";
|
|
||||||
this->echoDataFilename="";
|
|
||||||
this->xmlFilePath="";
|
|
||||||
this->GPSPointFilePath="";
|
|
||||||
this->echoDataFilePath="";
|
|
||||||
this->simulationTaskName = "";
|
|
||||||
|
|
||||||
this->PluseCount = 0;
|
|
||||||
this->PlusePoints = 0;
|
|
||||||
this->NearRange = 0;
|
|
||||||
this->FarRange = 0;
|
|
||||||
this->centerFreq = 0;
|
|
||||||
this->Fs = 0;
|
|
||||||
|
|
||||||
this->folder.clear();
|
|
||||||
this->filename.clear();
|
|
||||||
this->xmlname.clear();
|
|
||||||
this->GPSPointFilename.clear();
|
|
||||||
this->echoDataFilename.clear();
|
|
||||||
this->xmlFilePath.clear();
|
|
||||||
this->GPSPointFilePath.clear();
|
|
||||||
this->echoDataFilePath.clear();
|
|
||||||
this->simulationTaskName.clear();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
EchoL0Dataset::~EchoL0Dataset()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ErrorCode EchoL0Dataset::OpenOrNew(QString folder, QString filename, long PluseCount, long PlusePoints)
|
|
||||||
{
|
|
||||||
qDebug() << "--------------Echo Data OpenOrNew ---------------------------------------";
|
|
||||||
qDebug() << "Folder: " << folder;
|
|
||||||
qDebug() << "Filename: " << filename;
|
|
||||||
QDir dir(folder);
|
|
||||||
if (dir.exists() == false)
|
|
||||||
{
|
|
||||||
dir.mkpath(folder);
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
|
|
||||||
if (dir.exists() == false) {
|
|
||||||
return ErrorCode::FOLDER_NOT_EXIST;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
QString filePath = dir.filePath(filename); // 生成完整的文件路径
|
|
||||||
|
|
||||||
this->folder = folder;
|
|
||||||
this->filename = filename;
|
|
||||||
this->simulationTaskName = filename;
|
|
||||||
|
|
||||||
this->xmlname=filename+".xml";
|
|
||||||
this->GPSPointFilename=filename+".gpspos.data";
|
|
||||||
this->echoDataFilename = filename + ".L0echo.data";
|
|
||||||
|
|
||||||
this->xmlFilePath = dir.filePath(this->xmlname);
|
|
||||||
this->GPSPointFilePath = dir.filePath(this->GPSPointFilename);
|
|
||||||
this->echoDataFilePath = dir.filePath(this->echoDataFilename);
|
|
||||||
|
|
||||||
this->PluseCount = PluseCount;
|
|
||||||
this->PlusePoints = PlusePoints;
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
if (QFile(this->xmlFilePath).exists())
|
|
||||||
{
|
|
||||||
this->loadFromXml();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->saveToXml();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (QFile(this->GPSPointFilePath).exists() == false) {
|
|
||||||
// 创建新文件
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
|
|
||||||
GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("ENVI");
|
|
||||||
GDALDataset* poDstDS=(poDriver->Create(this->GPSPointFilePath.toUtf8().constData(), 19, PluseCount, 1, GDT_Float64, NULL));
|
|
||||||
GDALFlushCache((GDALDatasetH)poDstDS);
|
|
||||||
GDALClose(poDstDS);
|
|
||||||
//poDstDS.reset();
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (QFile(this->echoDataFilePath).exists() == false) {
|
|
||||||
|
|
||||||
// 创建新文件
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
|
|
||||||
GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("ENVI");
|
|
||||||
GDALDataset* poDstDS = (poDriver->Create(this->echoDataFilePath.toUtf8().constData(), PlusePoints, PluseCount, 1, GDT_CFloat64, NULL));
|
|
||||||
GDALFlushCache((GDALDatasetH)poDstDS);
|
|
||||||
GDALClose(poDstDS);
|
|
||||||
//poDstDS.reset();
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return ErrorCode::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
ErrorCode EchoL0Dataset::Open(QString xmlfilepath)
|
|
||||||
{
|
|
||||||
QFileInfo fileInfo(xmlfilepath);
|
|
||||||
QString fileName = fileInfo.fileName(); // 获取文件名
|
|
||||||
QString fileSuffix = fileInfo.suffix(); // 获取后缀名
|
|
||||||
QString fileNameWithoutSuffix = fileInfo.baseName(); // 获取不带后缀的文件名
|
|
||||||
QString directoryPath = fileInfo.path(); // 获取文件夹路径
|
|
||||||
if (fileSuffix.toLower() == "xml" || fileSuffix.toLower() == ".xml") {
|
|
||||||
return this->Open(directoryPath,fileNameWithoutSuffix);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return ErrorCode::ECHO_L0DATA_XMLNAMEERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ErrorCode::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
ErrorCode EchoL0Dataset::Open(QString folder, QString filename)
|
|
||||||
{
|
|
||||||
QDir dir(folder);
|
|
||||||
if (dir.exists() == false)
|
|
||||||
{
|
|
||||||
return ErrorCode::FOLDER_NOT_EXIST;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
|
|
||||||
if (dir.exists() == false) {
|
|
||||||
return ErrorCode::FOLDER_NOT_EXIST;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
QString filePath = dir.filePath(filename); // 生成完整的文件路径
|
|
||||||
|
|
||||||
this->folder = folder;
|
|
||||||
this->filename = filename;
|
|
||||||
this->simulationTaskName = filename;
|
|
||||||
|
|
||||||
this->xmlname = filename + ".xml";
|
|
||||||
this->GPSPointFilename = filename + ".gpspos.data";
|
|
||||||
this->echoDataFilename = filename + ".L0echo.data";
|
|
||||||
|
|
||||||
this->xmlFilePath = dir.filePath(this->xmlname);
|
|
||||||
this->GPSPointFilePath = dir.filePath(this->GPSPointFilename);
|
|
||||||
this->echoDataFilePath = dir.filePath(this->echoDataFilename);
|
|
||||||
|
|
||||||
this->PluseCount = PluseCount;
|
|
||||||
this->PlusePoints = PlusePoints;
|
|
||||||
|
|
||||||
//
|
|
||||||
if (QFile(this->xmlFilePath).exists())
|
|
||||||
{
|
|
||||||
this->loadFromXml();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR;
|
|
||||||
}
|
|
||||||
return ErrorCode::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString EchoL0Dataset::getxmlName()
|
|
||||||
{
|
|
||||||
return xmlname;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString EchoL0Dataset::getGPSPointFilename()
|
|
||||||
{
|
|
||||||
return GPSPointFilename;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString EchoL0Dataset::getEchoDataFilename()
|
|
||||||
{
|
|
||||||
return GPSPointFilePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString EchoL0Dataset::getGPSPointFilePath()
|
|
||||||
{
|
|
||||||
return this->GPSPointFilePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString EchoL0Dataset::getEchoDataFilePath()
|
|
||||||
{
|
|
||||||
return this->echoDataFilePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EchoL0Dataset::initEchoArr(std::complex<double> init0)
|
|
||||||
{
|
|
||||||
long blockline = Memory1MB / 8 / 2 / this->PlusePoints * 8000;
|
|
||||||
|
|
||||||
long start = 0;
|
|
||||||
for (start = 0; start < this->PluseCount; start = start + blockline) {
|
|
||||||
long templine = start + blockline < this->PluseCount ? blockline : this->PluseCount - start;
|
|
||||||
std::shared_ptr<std::complex<double>> echotemp = this->getEchoArr(start, templine);
|
|
||||||
for (long i = 0; i < templine; i++) {
|
|
||||||
for (long j = 0; j < this->PlusePoints; j++) {
|
|
||||||
echotemp.get()[i * this->PlusePoints + j] = init0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this->saveEchoArr(echotemp, start, templine);
|
|
||||||
qDebug() << "echo init col : " << start << "\t-\t" << start + templine << "\t/\t" << this->PluseCount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Getter 和 Setter 方法实现
|
|
||||||
long EchoL0Dataset::getPluseCount() { return this->PluseCount; }
|
|
||||||
void EchoL0Dataset::setPluseCount(long pulseCount) { this->PluseCount = pulseCount; }
|
|
||||||
|
|
||||||
long EchoL0Dataset::getPlusePoints() { return this->PlusePoints; }
|
|
||||||
void EchoL0Dataset::setPlusePoints(long pulsePoints) { this->PlusePoints = pulsePoints; }
|
|
||||||
|
|
||||||
|
|
||||||
double EchoL0Dataset::getNearRange() { return this->NearRange; }
|
|
||||||
void EchoL0Dataset::setNearRange(double nearRange) { this->NearRange = nearRange; }
|
|
||||||
|
|
||||||
double EchoL0Dataset::getFarRange() { return this->FarRange; }
|
|
||||||
void EchoL0Dataset::setFarRange(double farRange) { this->FarRange = farRange; }
|
|
||||||
|
|
||||||
double EchoL0Dataset::getCenterFreq() { return this->centerFreq; }
|
|
||||||
void EchoL0Dataset::setCenterFreq(double freq) { this->centerFreq = freq; }
|
|
||||||
|
|
||||||
double EchoL0Dataset::getFs() { return this->Fs; }
|
|
||||||
void EchoL0Dataset::setFs(double samplingFreq) { this->Fs = samplingFreq; }
|
|
||||||
|
|
||||||
QString EchoL0Dataset::getSimulationTaskName() { return this->simulationTaskName; }
|
|
||||||
void EchoL0Dataset::setSimulationTaskName(const QString& taskName) { this->simulationTaskName = taskName; }
|
|
||||||
|
|
||||||
double EchoL0Dataset::getCenterAngle()
|
|
||||||
{
|
|
||||||
return this->CenterAngle;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EchoL0Dataset::setCenterAngle(double angle)
|
|
||||||
{
|
|
||||||
this->CenterAngle = angle;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString EchoL0Dataset::getLookSide()
|
|
||||||
{
|
|
||||||
return this->LookSide;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EchoL0Dataset::setLookSide(QString lookside)
|
|
||||||
{
|
|
||||||
this->LookSide = lookside;
|
|
||||||
}
|
|
||||||
|
|
||||||
double EchoL0Dataset::getBandwidth()
|
|
||||||
{
|
|
||||||
return this->bandwidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EchoL0Dataset::setBandwidth(double Inbandwidth)
|
|
||||||
{
|
|
||||||
this->bandwidth = Inbandwidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
SatelliteAntPos EchoL0Dataset::getSatelliteAntPos(long prf_id)
|
|
||||||
{
|
|
||||||
std::shared_ptr<double> antpos = this->getAntPos();
|
|
||||||
SatelliteAntPos prfpos{};
|
|
||||||
prfpos.time = antpos.get()[prf_id *19 + 0];
|
|
||||||
prfpos.Px = antpos.get()[prf_id *19 + 1];
|
|
||||||
prfpos.Py = antpos.get()[prf_id *19 + 2];
|
|
||||||
prfpos.Pz = antpos.get()[prf_id *19 + 3];
|
|
||||||
prfpos.Vx = antpos.get()[prf_id *19 + 4];
|
|
||||||
prfpos.Vy = antpos.get()[prf_id *19 + 5];
|
|
||||||
prfpos.Vz = antpos.get()[prf_id *19 + 6];
|
|
||||||
prfpos.AntDirectX = antpos.get()[prf_id *19 + 7];
|
|
||||||
prfpos.AntDirectY = antpos.get()[prf_id *19 + 8];
|
|
||||||
prfpos.AntDirectZ = antpos.get()[prf_id *19 + 9];
|
|
||||||
prfpos.AVx = antpos.get()[prf_id *19 + 10];
|
|
||||||
prfpos.AVy = antpos.get()[prf_id *19 + 11];
|
|
||||||
prfpos.AVz =antpos.get()[prf_id *19 + 12];
|
|
||||||
prfpos.ZeroAntDiectX = antpos.get()[prf_id *19 + 13];
|
|
||||||
prfpos.ZeroAntDiectY = antpos.get()[prf_id *19 + 14];
|
|
||||||
prfpos.ZeroAntDiectZ = antpos.get()[prf_id *19 + 15];
|
|
||||||
prfpos.lon =antpos.get()[prf_id *19 + 16];
|
|
||||||
prfpos.lat =antpos.get()[prf_id *19 + 17];
|
|
||||||
prfpos.ati =antpos.get()[prf_id *19 + 18];
|
|
||||||
return prfpos;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EchoL0Dataset::setRefPhaseRange(double refRange)
|
|
||||||
{
|
|
||||||
this->refPhaseRange = refRange;
|
|
||||||
}
|
|
||||||
|
|
||||||
double EchoL0Dataset::getRefPhaseRange()
|
|
||||||
{
|
|
||||||
return this->refPhaseRange;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 打印信息的实现
|
|
||||||
void EchoL0Dataset::printInfo() {
|
|
||||||
qDebug() << "Simulation Task Name: " << this->simulationTaskName ;
|
|
||||||
qDebug() << "Pulse Count: " << this->PluseCount ;
|
|
||||||
qDebug() << "Pulse Points: " << this->PlusePoints;
|
|
||||||
qDebug() << "Near Range: " << this->NearRange ;
|
|
||||||
qDebug() << "Far Range: " << this->FarRange;
|
|
||||||
qDebug() << "Center Frequency: " << this->centerFreq ;
|
|
||||||
qDebug() << "Sampling Frequency: " << this->Fs ;
|
|
||||||
qDebug() << "Band width: " << this->bandwidth ;
|
|
||||||
}
|
|
||||||
|
|
||||||
// xml文件读写
|
|
||||||
void EchoL0Dataset::saveToXml() {
|
|
||||||
|
|
||||||
QString filePath = this->xmlFilePath;
|
|
||||||
|
|
||||||
QFile file(filePath);
|
|
||||||
if (!file.open(QIODevice::WriteOnly)) {
|
|
||||||
qWarning() << "Cannot open file for writing:" << filePath;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QXmlStreamWriter xmlWriter(&file);
|
|
||||||
xmlWriter.setAutoFormatting(true);
|
|
||||||
xmlWriter.writeStartDocument();
|
|
||||||
xmlWriter.writeStartElement("SimulationConfig");
|
|
||||||
|
|
||||||
xmlWriter.writeTextElement("PluseCount", QString::number(this->PluseCount));
|
|
||||||
xmlWriter.writeTextElement("BandWidth", QString::number(this->bandwidth));
|
|
||||||
xmlWriter.writeTextElement("PlusePoints", QString::number(this->PlusePoints));
|
|
||||||
xmlWriter.writeTextElement("NearRange", QString::number(this->NearRange));
|
|
||||||
xmlWriter.writeTextElement("FarRange", QString::number(this->FarRange));
|
|
||||||
xmlWriter.writeTextElement("CenterFreq", QString::number(this->centerFreq));
|
|
||||||
xmlWriter.writeTextElement("Fs", QString::number(this->Fs));
|
|
||||||
xmlWriter.writeTextElement("CenterAngle", QString::number(this->CenterAngle));
|
|
||||||
xmlWriter.writeTextElement("LookSide", this->LookSide);
|
|
||||||
xmlWriter.writeTextElement("SimulationTaskName", this->simulationTaskName);
|
|
||||||
xmlWriter.writeTextElement("Filename", this->filename);
|
|
||||||
xmlWriter.writeTextElement("Xmlname", this->xmlname);
|
|
||||||
xmlWriter.writeTextElement("GPSPointFilename", this->GPSPointFilename);
|
|
||||||
xmlWriter.writeTextElement("EchoDataFilename", this->echoDataFilename);
|
|
||||||
xmlWriter.writeTextElement("refPhaseRange", QString::number(this->refPhaseRange));
|
|
||||||
|
|
||||||
xmlWriter.writeEndElement(); // SimulationConfig
|
|
||||||
xmlWriter.writeEndDocument();
|
|
||||||
|
|
||||||
file.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
ErrorCode EchoL0Dataset::loadFromXml() {
|
|
||||||
QString filePath = this->xmlFilePath;
|
|
||||||
QFile file(filePath);
|
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
|
||||||
qWarning() << "Cannot open file for reading:" << filePath;
|
|
||||||
return ErrorCode::FILEOPENFAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool PluseCountflag = false;
|
|
||||||
bool PlusePointsflag = false;
|
|
||||||
bool NearRangeflag = false;
|
|
||||||
bool FarRangeflag = false;
|
|
||||||
bool CenterFreqflag = false;
|
|
||||||
bool Fsflag = false;
|
|
||||||
|
|
||||||
|
|
||||||
QXmlStreamReader xmlReader(&file);
|
|
||||||
while (!xmlReader.atEnd() && !xmlReader.hasError()) {
|
|
||||||
xmlReader.readNext();
|
|
||||||
|
|
||||||
if (xmlReader.isStartElement()) {
|
|
||||||
QString elementName = xmlReader.name().toString();
|
|
||||||
if (elementName == "BandWidth") {
|
|
||||||
this->bandwidth = xmlReader.readElementText().toDouble();
|
|
||||||
}
|
|
||||||
else if (elementName == "PluseCount") {
|
|
||||||
this->PluseCount = xmlReader.readElementText().toLong();
|
|
||||||
}
|
|
||||||
else if (elementName == "PlusePoints") {
|
|
||||||
this->PlusePoints = xmlReader.readElementText().toLong();
|
|
||||||
PlusePointsflag = true;
|
|
||||||
}
|
|
||||||
else if (elementName == "NearRange") {
|
|
||||||
this->NearRange = xmlReader.readElementText().toDouble();
|
|
||||||
NearRangeflag = true;
|
|
||||||
}
|
|
||||||
else if (elementName == "FarRange") {
|
|
||||||
this->FarRange = xmlReader.readElementText().toDouble();
|
|
||||||
FarRangeflag = true;
|
|
||||||
}
|
|
||||||
else if (elementName == "CenterFreq") {
|
|
||||||
this->centerFreq = xmlReader.readElementText().toDouble();
|
|
||||||
CenterFreqflag = true;
|
|
||||||
}
|
|
||||||
else if (elementName == "Fs") {
|
|
||||||
this->Fs = xmlReader.readElementText().toDouble();
|
|
||||||
Fsflag = true;
|
|
||||||
}
|
|
||||||
else if (elementName == "refPhaseRange") {
|
|
||||||
this->refPhaseRange = xmlReader.readElementText().toDouble();
|
|
||||||
Fsflag = true;
|
|
||||||
}
|
|
||||||
else if (elementName == "SimulationTaskName") {
|
|
||||||
this->simulationTaskName = xmlReader.readElementText();
|
|
||||||
}
|
|
||||||
else if (elementName == "Filename") {
|
|
||||||
this->filename = xmlReader.readElementText();
|
|
||||||
}
|
|
||||||
else if (elementName == "Xmlname") {
|
|
||||||
this->xmlname = xmlReader.readElementText();
|
|
||||||
}
|
|
||||||
else if (elementName == "GPSPointFilename") {
|
|
||||||
this->GPSPointFilename = xmlReader.readElementText();
|
|
||||||
}
|
|
||||||
else if (elementName == "EchoDataFilename") {
|
|
||||||
this->echoDataFilename = xmlReader.readElementText();
|
|
||||||
}
|
|
||||||
else if (elementName == "CenterAngle") {
|
|
||||||
this->CenterAngle = xmlReader.readElementText().toDouble();
|
|
||||||
}
|
|
||||||
else if (elementName == "LookSide") {
|
|
||||||
this->LookSide = xmlReader.readElementText();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (xmlReader.hasError()) {
|
|
||||||
qWarning() << "XML error:" << xmlReader.errorString();
|
|
||||||
file.close();
|
|
||||||
return ErrorCode::ECHO_L0DATA_XMLFILENOTOPEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(PlusePointsflag && PlusePointsflag && FarRangeflag && NearRangeflag && CenterFreqflag && Fsflag)) {
|
|
||||||
file.close();
|
|
||||||
return ErrorCode::ECHO_L0DATA_XMLFILENOTOPEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
file.close();
|
|
||||||
|
|
||||||
return ErrorCode::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<SatelliteAntPos> EchoL0Dataset::getAntPosVelc()
|
|
||||||
{
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
long prfcount = this->PluseCount;
|
|
||||||
std::shared_ptr<SatelliteAntPos> antposlist= SatelliteAntPosOperator::readAntPosFile(this->GPSPointFilePath, prfcount);
|
|
||||||
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
return antposlist;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<double> EchoL0Dataset::getAntPos()
|
|
||||||
{
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
// 读取文件
|
|
||||||
std::shared_ptr<GDALDataset> rasterDataset = OpenDataset(this->GPSPointFilePath, GDALAccess::GA_ReadOnly);
|
|
||||||
|
|
||||||
GDALDataType gdal_datatype = rasterDataset->GetRasterBand(1)->GetRasterDataType();
|
|
||||||
GDALRasterBand* demBand = rasterDataset->GetRasterBand(1);
|
|
||||||
|
|
||||||
long width = rasterDataset->GetRasterXSize();
|
|
||||||
long height = rasterDataset->GetRasterYSize();
|
|
||||||
long band_num = rasterDataset->GetRasterCount();
|
|
||||||
|
|
||||||
std::shared_ptr<double> temp = nullptr;
|
|
||||||
|
|
||||||
if (gdal_datatype == GDT_Float64) {
|
|
||||||
temp=std::shared_ptr<double>(new double[this->PluseCount * 19],delArrPtr);
|
|
||||||
demBand->RasterIO(GF_Read, 0, 0, 19, this->PluseCount, temp.get(), 19, this->PluseCount, gdal_datatype, 0, 0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_GPSFILEFORMATERROR)) ;
|
|
||||||
}
|
|
||||||
rasterDataset.reset();
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
return temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<std::complex<double>> EchoL0Dataset::getEchoArr(long startPRF, long& PRFLen)
|
|
||||||
{
|
|
||||||
if (!(startPRF < this->PluseCount)) {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_PRFIDXOUTRANGE))<<startPRF<<" "<<this->PluseCount;
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
std::shared_ptr<GDALDataset> rasterDataset = OpenDataset(this->echoDataFilePath, GDALAccess::GA_ReadOnly);
|
|
||||||
|
|
||||||
|
|
||||||
GDALDataType gdal_datatype = rasterDataset->GetRasterBand(1)->GetRasterDataType();
|
|
||||||
GDALRasterBand* poBand = rasterDataset->GetRasterBand(1);
|
|
||||||
if (NULL==poBand||nullptr == poBand) {
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR));
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
long width = rasterDataset->GetRasterXSize();
|
|
||||||
long height = rasterDataset->GetRasterYSize();
|
|
||||||
long band_num = rasterDataset->GetRasterCount();
|
|
||||||
|
|
||||||
PRFLen = (PRFLen + startPRF) < height ? PRFLen : height - startPRF;
|
|
||||||
|
|
||||||
std::shared_ptr<std::complex<double>> temp = nullptr;
|
|
||||||
if (height != this->PluseCount || width != this->PlusePoints) {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (gdal_datatype == GDT_CFloat64) {
|
|
||||||
temp= std::shared_ptr<std::complex<double>>(new std::complex<double>[PRFLen * width ], delArrPtr);
|
|
||||||
poBand->RasterIO(GF_Read, 0, startPRF, width, PRFLen, temp.get(), width, PRFLen, GDT_CFloat64, 0, 0);
|
|
||||||
GDALFlushCache((GDALDatasetH)rasterDataset.get());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rasterDataset.reset();
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
return temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<std::complex<double>> EchoL0Dataset::getEchoArrVector(long startPRF, long& PRFLen) {
|
|
||||||
if (!(startPRF < this->PluseCount)) {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_PRFIDXOUTRANGE)) << startPRF << " " << this->PluseCount;
|
|
||||||
return std::vector<std::complex<double>>(0);
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
std::shared_ptr<GDALDataset> rasterDataset = OpenDataset(this->echoDataFilePath, GDALAccess::GA_ReadOnly);
|
|
||||||
|
|
||||||
|
|
||||||
GDALDataType gdal_datatype = rasterDataset->GetRasterBand(1)->GetRasterDataType();
|
|
||||||
GDALRasterBand* poBand = rasterDataset->GetRasterBand(1);
|
|
||||||
if (NULL == poBand || nullptr == poBand) {
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR));
|
|
||||||
return std::vector<std::complex<double>>(0);
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
long width = rasterDataset->GetRasterXSize();
|
|
||||||
long height = rasterDataset->GetRasterYSize();
|
|
||||||
long band_num = rasterDataset->GetRasterCount();
|
|
||||||
|
|
||||||
PRFLen = (PRFLen + startPRF) < height ? PRFLen : height - startPRF;
|
|
||||||
|
|
||||||
std::vector<std::complex<double>> tempArr(size_t(PRFLen) * width);
|
|
||||||
if (height != this->PluseCount || width != this->PlusePoints) {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (gdal_datatype == GDT_CFloat64) {
|
|
||||||
std::shared_ptr<std::complex<double>> temp(new std::complex<double>[PRFLen * width], delArrPtr);
|
|
||||||
poBand->RasterIO(GF_Read, 0, startPRF, width, PRFLen, temp.get(), width, PRFLen, GDT_CFloat64, 0, 0);
|
|
||||||
GDALFlushCache((GDALDatasetH)rasterDataset.get());
|
|
||||||
|
|
||||||
|
|
||||||
for (long i = 0; i < PRFLen; i++){
|
|
||||||
for (long j = 0; j < width; j++){
|
|
||||||
tempArr[i * width + j] = temp.get()[i * width + j];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rasterDataset.reset();
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
return tempArr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::shared_ptr<std::complex<double>> EchoL0Dataset::getEchoArr()
|
|
||||||
{
|
|
||||||
return this->getEchoArr(0,this->PluseCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
ErrorCode EchoL0Dataset::saveAntPos(std::shared_ptr<double> ptr)
|
|
||||||
{
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
// 读取文件
|
|
||||||
std::shared_ptr<GDALDataset> rasterDataset = OpenDataset(this->GPSPointFilePath, GDALAccess::GA_Update);
|
|
||||||
|
|
||||||
GDALDataType gdal_datatype = rasterDataset->GetRasterBand(1)->GetRasterDataType();
|
|
||||||
GDALRasterBand* demBand = rasterDataset->GetRasterBand(1);
|
|
||||||
|
|
||||||
long width = rasterDataset->GetRasterXSize();
|
|
||||||
long height = rasterDataset->GetRasterYSize();
|
|
||||||
long band_num = rasterDataset->GetRasterCount();
|
|
||||||
|
|
||||||
if (gdal_datatype == GDT_Float64) {
|
|
||||||
demBand->RasterIO(GF_Write, 0, 0, 19, this->PluseCount, ptr.get(), 19, this->PluseCount, gdal_datatype, 0, 0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_GPSFILEFORMATERROR));
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
return ErrorCode::ECHO_L0DATA_GPSFILEFORMATERROR;
|
|
||||||
}
|
|
||||||
rasterDataset.reset();
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
return ErrorCode::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
ErrorCode EchoL0Dataset::saveEchoArr(std::shared_ptr<std::complex<double>> echoPtr, long startPRF, long PRFLen)
|
|
||||||
{
|
|
||||||
if (!(startPRF < this->PluseCount)) {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_PRFIDXOUTRANGE));
|
|
||||||
return ErrorCode::ECHO_L0DATA_PRFIDXOUTRANGE;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
GDALDataset* rasterDataset = (GDALDataset*)(GDALOpen(this->echoDataFilePath.toUtf8().constData(), GDALAccess::GA_Update));
|
|
||||||
|
|
||||||
GDALDataType gdal_datatype = rasterDataset->GetRasterBand(1)->GetRasterDataType();
|
|
||||||
GDALRasterBand* poBand = rasterDataset->GetRasterBand(1);
|
|
||||||
if (NULL == poBand || nullptr == poBand) {
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR));
|
|
||||||
return ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
long width = rasterDataset->GetRasterXSize();
|
|
||||||
long height = rasterDataset->GetRasterYSize();
|
|
||||||
long band_num = rasterDataset->GetRasterCount();
|
|
||||||
|
|
||||||
if (height != this->PluseCount || width != this->PlusePoints) {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR));
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
return ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (gdal_datatype == GDT_CFloat64) {
|
|
||||||
poBand->RasterIO(GF_Write, 0, startPRF, width, PRFLen, echoPtr.get(), width, PRFLen, GDT_CFloat64, 0, 0);
|
|
||||||
GDALFlushCache((GDALDatasetH)rasterDataset);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GDALClose(rasterDataset);
|
|
||||||
rasterDataset = nullptr;
|
|
||||||
GDALDestroy();
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
|
|
||||||
return ErrorCode::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<SatelliteAntPos> SatelliteAntPosOperator::readAntPosFile(QString filepath, long& count)
|
|
||||||
{
|
|
||||||
gdalImage antimg(filepath);
|
|
||||||
long rowcount = count;
|
|
||||||
long colcount = 19;
|
|
||||||
std::shared_ptr<double> antlist = readDataArr<double>(antimg, 0, 0, rowcount, colcount, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
|
||||||
std::shared_ptr<SatelliteAntPos> antpos(new SatelliteAntPos[rowcount], delArrPtr);
|
|
||||||
for (long i = 0; i < rowcount; i++) {
|
|
||||||
antpos.get()[i].time = antlist.get()[i * 19 + 0];
|
|
||||||
antpos.get()[i].Px = antlist.get()[i * 19 + 1];
|
|
||||||
antpos.get()[i].Py = antlist.get()[i * 19 + 2];
|
|
||||||
antpos.get()[i].Pz = antlist.get()[i * 19 + 3];
|
|
||||||
antpos.get()[i].Vx = antlist.get()[i * 19 + 4];
|
|
||||||
antpos.get()[i].Vy = antlist.get()[i * 19 + 5];
|
|
||||||
antpos.get()[i].Vz = antlist.get()[i * 19 + 6]; //7
|
|
||||||
antpos.get()[i].AntDirectX = antlist.get()[i * 19 + 7];
|
|
||||||
antpos.get()[i].AntDirectY = antlist.get()[i * 19 + 8];
|
|
||||||
antpos.get()[i].AntDirectZ = antlist.get()[i * 19 + 9];
|
|
||||||
antpos.get()[i].AVx = antlist.get()[i * 19 + 10];
|
|
||||||
antpos.get()[i].AVy = antlist.get()[i * 19 + 11];
|
|
||||||
antpos.get()[i].AVz = antlist.get()[i * 19 + 12];
|
|
||||||
antpos.get()[i].ZeroAntDiectX = antlist.get()[i * 19 + 13];
|
|
||||||
antpos.get()[i].ZeroAntDiectY = antlist.get()[i * 19 + 14];
|
|
||||||
antpos.get()[i].ZeroAntDiectZ = antlist.get()[i * 19 + 15];
|
|
||||||
antpos.get()[i].lon = antlist.get()[i * 19 + 16];
|
|
||||||
antpos.get()[i].lat = antlist.get()[i * 19 + 17];
|
|
||||||
antpos.get()[i].ati = antlist.get()[i * 19 + 18]; // 19
|
|
||||||
}
|
|
||||||
return antpos;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SatelliteAntPosOperator::writeAntPosFile(QString filepath, std::shared_ptr<SatelliteAntPos> data, const long count)
|
|
||||||
{
|
|
||||||
gdalImage antimg=CreategdalImageDouble(filepath,count,19,1,true,true);
|
|
||||||
long rowcount = count;
|
|
||||||
long colcount = 19;
|
|
||||||
std::shared_ptr<double> antpos(new double[rowcount*19], delArrPtr);
|
|
||||||
for (long i = 0; i < colcount; i++) {
|
|
||||||
antpos.get()[i * 19 + 1] = data.get()[i].time;
|
|
||||||
antpos.get()[i * 19 + 2] = data.get()[i].Px;
|
|
||||||
antpos.get()[i * 19 + 3] = data.get()[i].Py;
|
|
||||||
antpos.get()[i * 19 + 4] = data.get()[i].Pz;
|
|
||||||
antpos.get()[i * 19 + 5] = data.get()[i].Vx;
|
|
||||||
antpos.get()[i * 19 + 6] = data.get()[i].Vy;
|
|
||||||
antpos.get()[i * 19 + 7] = data.get()[i].Vz;
|
|
||||||
antpos.get()[i * 19 + 8] = data.get()[i].AntDirectX;
|
|
||||||
antpos.get()[i * 19 + 9] = data.get()[i].AntDirectY;
|
|
||||||
antpos.get()[i * 19 + 10] = data.get()[i].AntDirectZ;
|
|
||||||
antpos.get()[i * 19 + 11] = data.get()[i].AVx;
|
|
||||||
antpos.get()[i * 19 + 12] = data.get()[i].AVy;
|
|
||||||
antpos.get()[i * 19 + 13] = data.get()[i].AVz;
|
|
||||||
antpos.get()[i * 19 + 14] = data.get()[i].ZeroAntDiectX;
|
|
||||||
antpos.get()[i * 19 + 15] = data.get()[i].ZeroAntDiectY;
|
|
||||||
antpos.get()[i * 19 + 16] = data.get()[i].ZeroAntDiectZ;
|
|
||||||
antpos.get()[i * 19 + 17] = data.get()[i].lon;
|
|
||||||
antpos.get()[i * 19 + 18] = data.get()[i].lat;
|
|
||||||
antpos.get()[i * 19 + 19] = data.get()[i].ati;
|
|
||||||
}
|
|
||||||
antimg.saveImage(antpos, 0,0,rowcount, colcount, 1);
|
|
||||||
|
|
||||||
return ;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,225 +0,0 @@
|
||||||
#pragma once
|
|
||||||
/*****************************************************************//**
|
|
||||||
* \file EchoDataFormat.h
|
|
||||||
* \brief 存储仿真过程中的各级产品数据格式,主要包含回波数据格式、仿真参数数据库
|
|
||||||
*
|
|
||||||
* \author 30453
|
|
||||||
* \date October 2024
|
|
||||||
*********************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
#include "BaseConstVariable.h"
|
|
||||||
|
|
||||||
#include <complex>
|
|
||||||
#include <iostream>
|
|
||||||
#include <Eigen/Core>
|
|
||||||
#include <Eigen/Dense>
|
|
||||||
#include <omp.h>
|
|
||||||
#include <memory>
|
|
||||||
#include <vector>
|
|
||||||
#include <io.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
|
|
||||||
#include "BaseTool.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
#include <complex>
|
|
||||||
#include <gdal.h>
|
|
||||||
#include <gdal_priv.h>
|
|
||||||
#include <gdalwarper.h>
|
|
||||||
#include <string>
|
|
||||||
#include <memory>
|
|
||||||
#include <QString>
|
|
||||||
#include <cpl_conv.h> // for CPLMalloc()
|
|
||||||
|
|
||||||
//========================================================================
|
|
||||||
// 成像回波格式
|
|
||||||
// file type:
|
|
||||||
// PRFCOUNT
|
|
||||||
// PRFPOINT
|
|
||||||
// nearRange
|
|
||||||
// farRange
|
|
||||||
// PRF1,time,Px,Py,Pz,Vx,Vy,Vz
|
|
||||||
// PRF2,time,Px,Py,Pz,Vx,Vy,Vz
|
|
||||||
// ------------------ 脉冲文件部分 --------------------------------------
|
|
||||||
// PRF1,time,Px,Py,Pz,Vx,Vy,Vz,PRFPOINT,RealData,imagData
|
|
||||||
// PRF2,time,Px,Py,Pz,Vx,Vy,Vz,PRFPOINT,RealData,imagData
|
|
||||||
// --------------------------------------------------------------
|
|
||||||
// 注意Bp并不关心脉冲的顺序,只是关注脉冲的坐标位置,默认按照脉冲的解析顺序进行组织
|
|
||||||
//========================================================================
|
|
||||||
|
|
||||||
// 成像用的回波脉冲文件格式
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 回波数据--废弃
|
|
||||||
/// </summary>
|
|
||||||
struct PluseData {
|
|
||||||
long id; // PRF id
|
|
||||||
double time;// 时间
|
|
||||||
double Px; // 坐标
|
|
||||||
double Py;
|
|
||||||
double Pz;
|
|
||||||
double Vx; // 速度
|
|
||||||
double Vy;
|
|
||||||
double Vz;
|
|
||||||
long plusePoints; // 脉冲点数
|
|
||||||
std::shared_ptr<std::complex<double>> echoData; // 回波数据
|
|
||||||
};
|
|
||||||
|
|
||||||
long BASECONSTVARIABLEAPI getPluseDataSize(PluseData& pluseData);
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI getPluseDataFromBuffer(char* buffer, PluseData& data);
|
|
||||||
std::shared_ptr<PluseData> BASECONSTVARIABLEAPI CreatePluseDataArr(long pluseCount);
|
|
||||||
std::shared_ptr<std::complex<double>> BASECONSTVARIABLEAPI CreateEchoData(long plusePoints);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 姿态数据
|
|
||||||
/// </summary>
|
|
||||||
struct PluseAntPos {
|
|
||||||
long id; // PRF id
|
|
||||||
double time;// 时间
|
|
||||||
double Px; // 坐标
|
|
||||||
double Py;
|
|
||||||
double Pz;
|
|
||||||
double Vx; // 速度
|
|
||||||
double Vy;
|
|
||||||
double Vz;
|
|
||||||
};
|
|
||||||
std::shared_ptr<PluseAntPos> BASECONSTVARIABLEAPI CreatePluseAntPosArr(long pluseCount);
|
|
||||||
|
|
||||||
|
|
||||||
class BASECONSTVARIABLEAPI SatelliteAntPosOperator {
|
|
||||||
public:
|
|
||||||
static std::shared_ptr<SatelliteAntPos> readAntPosFile(QString filepath,long& count);
|
|
||||||
static void writeAntPosFile(QString filepath, std::shared_ptr< SatelliteAntPos> data,const long count);
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 定义L0级数据
|
|
||||||
class BASECONSTVARIABLEAPI EchoL0Dataset {
|
|
||||||
|
|
||||||
public:
|
|
||||||
EchoL0Dataset();
|
|
||||||
~EchoL0Dataset();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
ErrorCode OpenOrNew(QString folder, QString filename,long PluseCount,long PlusePoints);
|
|
||||||
ErrorCode Open(QString xmlfilepath);
|
|
||||||
ErrorCode Open(QString folder, QString filename);
|
|
||||||
QString getxmlName();
|
|
||||||
QString getGPSPointFilename();
|
|
||||||
QString getEchoDataFilename();
|
|
||||||
QString getGPSPointFilePath();
|
|
||||||
QString getEchoDataFilePath();
|
|
||||||
void initEchoArr(std::complex<double> init0);
|
|
||||||
|
|
||||||
|
|
||||||
private: // 产品名称设置
|
|
||||||
QString folder;
|
|
||||||
QString filename;
|
|
||||||
QString xmlname;
|
|
||||||
QString GPSPointFilename;
|
|
||||||
QString echoDataFilename;
|
|
||||||
//
|
|
||||||
QString xmlFilePath;
|
|
||||||
QString GPSPointFilePath;
|
|
||||||
QString echoDataFilePath;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public: // 文件处理部分
|
|
||||||
// Getter 和 Setter 方法
|
|
||||||
long getPluseCount() ;
|
|
||||||
void setPluseCount(long pulseCount);
|
|
||||||
|
|
||||||
long getPlusePoints() ;
|
|
||||||
void setPlusePoints(long pulsePoints);
|
|
||||||
|
|
||||||
double getNearRange() ;
|
|
||||||
void setNearRange(double nearRange);
|
|
||||||
|
|
||||||
double getFarRange() ;
|
|
||||||
void setFarRange(double farRange);
|
|
||||||
|
|
||||||
double getCenterFreq() ;
|
|
||||||
void setCenterFreq(double freq);
|
|
||||||
|
|
||||||
double getFs() ;
|
|
||||||
void setFs(double samplingFreq);
|
|
||||||
|
|
||||||
QString getSimulationTaskName() ;
|
|
||||||
void setSimulationTaskName(const QString& taskName);
|
|
||||||
|
|
||||||
double getCenterAngle();
|
|
||||||
void setCenterAngle(double angle);
|
|
||||||
|
|
||||||
QString getLookSide();
|
|
||||||
void setLookSide(QString lookside);
|
|
||||||
|
|
||||||
double getBandwidth();
|
|
||||||
void setBandwidth(double Inbandwidth);
|
|
||||||
|
|
||||||
SatelliteAntPos getSatelliteAntPos(long plusePRFID);
|
|
||||||
|
|
||||||
void setRefPhaseRange(double refRange);
|
|
||||||
double getRefPhaseRange();
|
|
||||||
// 打印信息的成员函数
|
|
||||||
void printInfo() ;
|
|
||||||
|
|
||||||
private: // 回波变量
|
|
||||||
long PluseCount;
|
|
||||||
long PlusePoints;
|
|
||||||
double NearRange;
|
|
||||||
double FarRange;
|
|
||||||
double centerFreq; // 入射中心频率
|
|
||||||
double Fs; // 等效采样频率
|
|
||||||
QString simulationTaskName;
|
|
||||||
|
|
||||||
double CenterAngle;
|
|
||||||
QString LookSide;
|
|
||||||
double refPhaseRange;
|
|
||||||
double bandwidth;
|
|
||||||
|
|
||||||
public: // 读写 XML 的函数
|
|
||||||
void saveToXml();
|
|
||||||
ErrorCode loadFromXml();
|
|
||||||
|
|
||||||
public:
|
|
||||||
// 读取文件
|
|
||||||
std::shared_ptr< SatelliteAntPos> getAntPosVelc();
|
|
||||||
std::shared_ptr<double> getAntPos();
|
|
||||||
std::shared_ptr<std::complex<double>> getEchoArr(long startPRF, long& PRFLen);
|
|
||||||
std::shared_ptr<std::complex<double>> getEchoArr();
|
|
||||||
std::vector<std::complex<double>> getEchoArrVector(long startPRF, long& PRFLen);
|
|
||||||
//保存文件
|
|
||||||
ErrorCode saveAntPos(std::shared_ptr<double> ptr); // 注意这个方法很危险,请写入前检查数据是否正确
|
|
||||||
ErrorCode saveEchoArr(std::shared_ptr<std::complex<double>> echoPtr, long startPRF, long PRFLen);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,261 +0,0 @@
|
||||||
#include "stdafx.h"
|
|
||||||
#include "FileOperator.h"
|
|
||||||
#include <boost/filesystem.hpp>
|
|
||||||
#include <string>
|
|
||||||
#include <memory.h>
|
|
||||||
#include <memory>
|
|
||||||
#include <io.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QString>
|
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QString addMaskToFileName(const QString& filePath,QString _zzname) {
|
|
||||||
// 获取文件路径和文件名
|
|
||||||
QFileInfo fileInfo(filePath);
|
|
||||||
|
|
||||||
// 获取文件名和扩展名
|
|
||||||
QString baseName = fileInfo.baseName(); // 不包含扩展名的文件名
|
|
||||||
QString extension = fileInfo.suffix(); // 文件扩展名(例如 ".txt", ".jpg")
|
|
||||||
|
|
||||||
// 拼接新的文件名
|
|
||||||
QString newFileName = baseName + _zzname; // 在文件名中增加 "_mask"
|
|
||||||
if (!extension.isEmpty()) {
|
|
||||||
newFileName += "." + extension; // 如果有扩展名,添加扩展名
|
|
||||||
}
|
|
||||||
|
|
||||||
// 返回新的文件路径
|
|
||||||
QString newFilePath = fileInfo.path() + "/" + newFileName;
|
|
||||||
return newFilePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<QString> getFilelist(const QString& folderpath, const QString& filenameExtension, int (*logfun)(QString logtext, int value))
|
|
||||||
{
|
|
||||||
QString filenameExtensionStr = filenameExtension;
|
|
||||||
filenameExtensionStr = filenameExtensionStr.remove(0, 1);
|
|
||||||
std::vector<QString> filenames(0);
|
|
||||||
if (isExists(folderpath) && isDirectory(folderpath)) {
|
|
||||||
QDir directory(folderpath);
|
|
||||||
if (directory.exists() && directory.isReadable()) {
|
|
||||||
QFileInfoList fileList = directory.entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
|
|
||||||
for (const QFileInfo& fileInfo : fileList) {
|
|
||||||
// qDebug() << fileInfo.filePath() + "\nExtension: (" + filenameExtensionStr + ", " + fileInfo.suffix() + ")";
|
|
||||||
if (filenameExtensionStr == u8"*" || filenameExtensionStr == fileInfo.suffix()) {
|
|
||||||
filenames.push_back(fileInfo.filePath());
|
|
||||||
}
|
|
||||||
if (logfun) {
|
|
||||||
logfun(fileInfo.filePath() + "\nExtension: (" + filenameExtensionStr + ", " + fileInfo.suffix() + ")", 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
qWarning() << "Folder does not exist or is not readable: " << folderpath;
|
|
||||||
}
|
|
||||||
return filenames;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return std::vector<QString>(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getParantFolderNameFromPath(const QString& path)
|
|
||||||
{
|
|
||||||
QDir directory(path);
|
|
||||||
directory.cdUp();
|
|
||||||
QString parentPath = directory.absolutePath();
|
|
||||||
return directory.dirName();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getParantFromPath(const QString& path)
|
|
||||||
{
|
|
||||||
//qDebug() << path;
|
|
||||||
QDir directory(path);
|
|
||||||
directory.cdUp();
|
|
||||||
QString parentPath = directory.absolutePath();
|
|
||||||
//qDebug() << parentPath;
|
|
||||||
return parentPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getFileNameFromPath(const QString& path)
|
|
||||||
{
|
|
||||||
QFileInfo fileInfo(path);
|
|
||||||
return fileInfo.fileName();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getFileNameWidthoutExtend(QString path)
|
|
||||||
{
|
|
||||||
QFileInfo fileInfo(path);
|
|
||||||
QString fileNameWithoutExtension = fileInfo.completeBaseName(); // 获取无后缀文件名
|
|
||||||
qDebug() << u8"File name without extension: " << fileNameWithoutExtension;
|
|
||||||
return fileNameWithoutExtension;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BASECONSTVARIABLEAPI getFileExtension(QString path)
|
|
||||||
{
|
|
||||||
QFileInfo fileInfo(path);
|
|
||||||
QString fileExtension = fileInfo.suffix(); // 获取无后缀文件名
|
|
||||||
return fileExtension;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isDirectory(const QString& path)
|
|
||||||
{
|
|
||||||
QFileInfo fileinfo(path);
|
|
||||||
return fileinfo.isDir();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isExists(const QString& path)
|
|
||||||
{
|
|
||||||
QFileInfo fileinfo(path);
|
|
||||||
return fileinfo.exists();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isFile(const QString& path)
|
|
||||||
{
|
|
||||||
QFileInfo fileinfo(path);
|
|
||||||
return fileinfo.isFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
int write_binfile(char* filepath, char* data, size_t data_len)
|
|
||||||
{
|
|
||||||
FILE* pd = fopen(filepath, "w");
|
|
||||||
if (NULL == pd) {
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
//数据块首地址: "&a",元素大小: "sizeof(unsigned __int8)", 元素个数: "10", 文件指针:"pd"
|
|
||||||
fwrite(data, sizeof(char), data_len, pd);
|
|
||||||
fclose(pd);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
char* read_textfile(char* text_path, int* length)
|
|
||||||
{
|
|
||||||
char* data = NULL;
|
|
||||||
FILE* fp1 = fopen(text_path, "r");
|
|
||||||
if (fp1 == NULL) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
// 读取文件
|
|
||||||
fseek(fp1, 0, SEEK_END);
|
|
||||||
int data_length = ftell(fp1);
|
|
||||||
data = (char*)malloc((data_length + 1) * sizeof(char));
|
|
||||||
rewind(fp1);
|
|
||||||
if (data_length == fread(data, sizeof(char), data_length, fp1)) {
|
|
||||||
data[data_length] = '\0'; // 文件尾
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
free(data);
|
|
||||||
fclose(fp1);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
fclose(fp1);
|
|
||||||
*length = data_length + 1;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool exists_test(const QString& name)
|
|
||||||
{
|
|
||||||
return isExists(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t fsize(FILE* fp)
|
|
||||||
{
|
|
||||||
size_t n;
|
|
||||||
fpos_t fpos; // 当前位置
|
|
||||||
fgetpos(fp, &fpos); // 获取当前位置
|
|
||||||
fseek(fp, 0, SEEK_END);
|
|
||||||
n = ftell(fp);
|
|
||||||
fsetpos(fp, &fpos); // 恢复之前的位置
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void removeFile(const QString& filePath)
|
|
||||||
{
|
|
||||||
QFile file(filePath);
|
|
||||||
|
|
||||||
if (file.exists()) {
|
|
||||||
if (file.remove()) {
|
|
||||||
qDebug() << "File removed successfully: " << filePath;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
qWarning() << "Failed to remove file: " << filePath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
qDebug() << "File does not exist: " << filePath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned long convertToULong(const QString& input) {
|
|
||||||
bool ok; // Used to check if the conversion was successful
|
|
||||||
unsigned long result = input.toULong(&ok);
|
|
||||||
|
|
||||||
if (!ok) {
|
|
||||||
qWarning() << "Conversion to unsigned long failed for input: " << input;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void copyFile(const QString& sourcePath, const QString& destinationPath) {
|
|
||||||
QFile sourceFile(sourcePath);
|
|
||||||
QFile destinationFile(destinationPath);
|
|
||||||
qDebug() << QString("copy file ready !! from ") + sourcePath+" to "+destinationPath ;
|
|
||||||
if (sourceFile.exists()) {
|
|
||||||
if (sourceFile.copy(destinationPath)) {
|
|
||||||
qDebug() << QString("copy file sucessfully !! from ") + sourcePath+" to "+destinationPath ;
|
|
||||||
// 复制成功
|
|
||||||
//QMessageBox::information(nullptr, u8"成功", u8"文件复制成功");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// 复制失败
|
|
||||||
if(sourceFile.exists()){
|
|
||||||
QMessageBox::critical(nullptr, QObject::tr("error"), QObject::tr("The file already exists !!"));
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
QMessageBox::critical(nullptr, QObject::tr("error"), QObject::tr("file copy error"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// 源文件不存在
|
|
||||||
QMessageBox::warning(nullptr, QObject::tr("warning"), QObject::tr("Source file not found"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool copyAndReplaceFile(const QString& sourceFilePath, const QString& destinationFilePath) {
|
|
||||||
// 检查源文件是否存在
|
|
||||||
if (!QFile::exists(sourceFilePath)) {
|
|
||||||
qDebug() << "Source file does not exist:" << sourceFilePath;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果目标文件存在,则删除它
|
|
||||||
if (QFile::exists(destinationFilePath)) {
|
|
||||||
if (!QFile::remove(destinationFilePath)) {
|
|
||||||
qDebug() << "Failed to remove existing destination file:" << destinationFilePath;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 复制文件
|
|
||||||
if (!QFile::copy(sourceFilePath, destinationFilePath)) {
|
|
||||||
qDebug() << "Failed to copy file from" << sourceFilePath << "to" << destinationFilePath;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
qDebug() << "File copied successfully from" << sourceFilePath << "to" << destinationFilePath;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#ifndef FILEOPERATOR_H
|
|
||||||
#define FILEOPERATOR_H
|
|
||||||
#include "BaseConstVariable.h"
|
|
||||||
#include <string.h>
|
|
||||||
#include <memory.h>
|
|
||||||
#include <memory>
|
|
||||||
#include <io.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <QString>
|
|
||||||
#include <QDir>
|
|
||||||
#include <QFile>
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
|
|
||||||
bool BASECONSTVARIABLEAPI isDirectory(const QString& path);
|
|
||||||
bool BASECONSTVARIABLEAPI isExists(const QString& path);
|
|
||||||
bool BASECONSTVARIABLEAPI isFile(const QString& path);
|
|
||||||
void BASECONSTVARIABLEAPI removeFile(const QString& filePath);
|
|
||||||
unsigned long BASECONSTVARIABLEAPI convertToULong(const QString& input);
|
|
||||||
/// <summary>
|
|
||||||
/// 获取文件(绝对路径)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folderpath"></param>
|
|
||||||
/// <param name="FilenameExtension"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
std::vector<QString> BASECONSTVARIABLEAPI getFilelist(const QString& folderpath, const QString& FilenameExtension = ".*", int (*logfun)(QString logtext, int value) = nullptr);
|
|
||||||
|
|
||||||
QString BASECONSTVARIABLEAPI getParantFolderNameFromPath(const QString& path);
|
|
||||||
|
|
||||||
QString BASECONSTVARIABLEAPI getFileNameFromPath(const QString& path);
|
|
||||||
|
|
||||||
QString BASECONSTVARIABLEAPI getFileNameWidthoutExtend(QString path);
|
|
||||||
|
|
||||||
QString BASECONSTVARIABLEAPI getFileExtension(QString path);
|
|
||||||
|
|
||||||
int BASECONSTVARIABLEAPI write_binfile(char* filepath, char* data, size_t data_len);
|
|
||||||
|
|
||||||
char* read_textfile(char* text_path, int* length);
|
|
||||||
|
|
||||||
bool BASECONSTVARIABLEAPI exists_test(const QString& name);
|
|
||||||
|
|
||||||
size_t BASECONSTVARIABLEAPI fsize(FILE* fp);
|
|
||||||
|
|
||||||
QString BASECONSTVARIABLEAPI getParantFromPath(const QString& path);
|
|
||||||
void BASECONSTVARIABLEAPI copyFile(const QString& sourcePath, const QString& destinationPath);
|
|
||||||
QString BASECONSTVARIABLEAPI addMaskToFileName(const QString& filePath, QString _zzname);
|
|
||||||
// QT FileOperator
|
|
||||||
|
|
||||||
bool BASECONSTVARIABLEAPI copyAndReplaceFile(const QString& sourceFilePath, const QString& destinationFilePath);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,500 +0,0 @@
|
||||||
#include "stdafx.h"
|
|
||||||
#include "GeoOperator.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <Eigen/Core>
|
|
||||||
#include <Eigen/Dense>
|
|
||||||
#include <time.h>
|
|
||||||
////#include <mkl.h>
|
|
||||||
#include <string>
|
|
||||||
#include <omp.h>
|
|
||||||
#include <io.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <gdal.h>
|
|
||||||
#include <gdal_priv.h>
|
|
||||||
#include <gdalwarper.h>
|
|
||||||
//#include <ogr_geos.h>
|
|
||||||
#include <ogrsf_frmts.h> //#include "ogrsf_frmts.h"
|
|
||||||
#include <fstream>
|
|
||||||
#include <proj.h>
|
|
||||||
#include "GeoOperator.h"
|
|
||||||
#include <ogr_spatialref.h> // OGRSpatialReference 用于空间参考转换
|
|
||||||
#include <gdal_alg.h> // 用于 GDALWarp 操作
|
|
||||||
#include <ogr_spatialref.h>
|
|
||||||
|
|
||||||
|
|
||||||
Landpoint operator +(const Landpoint& p1, const Landpoint& p2)
|
|
||||||
{
|
|
||||||
return Landpoint{ p1.lon + p2.lon,p1.lat + p2.lat,p1.ati + p2.ati };
|
|
||||||
}
|
|
||||||
|
|
||||||
Landpoint operator -(const Landpoint& p1, const Landpoint& p2)
|
|
||||||
{
|
|
||||||
return Landpoint{ p1.lon - p2.lon,p1.lat - p2.lat,p1.ati - p2.ati };
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator ==(const Landpoint& p1, const Landpoint& p2)
|
|
||||||
{
|
|
||||||
return p1.lat == p2.lat && p1.lon == p2.lon && p1.ati == p2.ati;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Landpoint operator *(const Landpoint& p, double scale)
|
|
||||||
{
|
|
||||||
return Landpoint{
|
|
||||||
p.lon * scale,
|
|
||||||
p.lat * scale,
|
|
||||||
p.ati * scale
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Landpoint LLA2XYZ(const Landpoint& LLA) {
|
|
||||||
double L = LLA.lon * d2r;
|
|
||||||
double B = LLA.lat * d2r;
|
|
||||||
double H = LLA.ati;
|
|
||||||
|
|
||||||
double sinB = sin(B);
|
|
||||||
double cosB = cos(B);
|
|
||||||
|
|
||||||
//double N = a / sqrt(1 - e * e * sin(B) * sin(B));
|
|
||||||
double N = a / sqrt(1 - eSquare * sinB * sinB);
|
|
||||||
Landpoint result = { 0,0,0 };
|
|
||||||
result.lon = (N + H) * cosB * cos(L);
|
|
||||||
result.lat = (N + H) * cosB * sin(L);
|
|
||||||
//result.z = (N * (1 - e * e) + H) * sin(B);
|
|
||||||
result.ati = (N * (1 - 1 / f_inverse) * (1 - 1 / f_inverse) + H) * sinB;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLA2XYZ(const Landpoint& LLA, Point3& XYZ)
|
|
||||||
{
|
|
||||||
double L = LLA.lon * d2r;
|
|
||||||
double B = LLA.lat * d2r;
|
|
||||||
double H = LLA.ati;
|
|
||||||
|
|
||||||
double sinB = sin(B);
|
|
||||||
double cosB = cos(B);
|
|
||||||
|
|
||||||
//double N = a / sqrt(1 - e * e * sin(B) * sin(B));
|
|
||||||
double N = a / sqrt(1 - eSquare * sinB * sinB);
|
|
||||||
Landpoint result = { 0,0,0 };
|
|
||||||
XYZ.x = (N + H) * cosB * cos(L);
|
|
||||||
XYZ.y = (N + H) * cosB * sin(L);
|
|
||||||
//result.z = (N * (1 - e * e) + H) * sin(B);
|
|
||||||
XYZ.z = (N * (1 - 1 / f_inverse) * (1 - 1 / f_inverse) + H) * sinB;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Eigen::MatrixXd LLA2XYZ(Eigen::MatrixXd landpoint)
|
|
||||||
{
|
|
||||||
landpoint.col(0) = landpoint.col(0).array() * d2r; // lon
|
|
||||||
landpoint.col(1) = landpoint.col(1).array() * d2r; // lat
|
|
||||||
|
|
||||||
Eigen::MatrixXd sinB = (landpoint.col(1).array().sin());//lat
|
|
||||||
Eigen::MatrixXd cosB = (landpoint.col(1).array().cos());//lat
|
|
||||||
|
|
||||||
Eigen::MatrixXd N = a / ((1 - sinB.array().pow(2) * eSquare).array().sqrt());
|
|
||||||
Eigen::MatrixXd result(landpoint.rows(), 3);
|
|
||||||
|
|
||||||
result.col(0) = (N.array() + landpoint.col(2).array()) * cosB.array() * Eigen::cos(landpoint.col(0).array()).array(); //x
|
|
||||||
result.col(1) = (N.array() + landpoint.col(2).array()) * cosB.array() * Eigen::sin(landpoint.col(0).array()).array(); //y
|
|
||||||
|
|
||||||
result.col(2) = (N.array() * (1 - 1 / f_inverse) * (1 - 1 / f_inverse) + landpoint.col(2).array()) * sinB.array(); //z
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Landpoint XYZ2LLA(const Landpoint& XYZ) {
|
|
||||||
double tmpX = XYZ.lon;//
|
|
||||||
double temY = XYZ.lat;//
|
|
||||||
double temZ = XYZ.ati;
|
|
||||||
|
|
||||||
double curB = 0;
|
|
||||||
double N = 0;
|
|
||||||
double sqrtTempXY = sqrt(tmpX * tmpX + temY * temY);
|
|
||||||
double calB = atan2(temZ, sqrtTempXY);
|
|
||||||
int counter = 0;
|
|
||||||
double sinCurB = 0;
|
|
||||||
while (abs(curB - calB) * r2d > epsilon && counter < 25)
|
|
||||||
{
|
|
||||||
curB = calB;
|
|
||||||
sinCurB = sin(curB);
|
|
||||||
N = a / sqrt(1 - eSquare * sinCurB * sinCurB);
|
|
||||||
calB = atan2(temZ + N * eSquare * sinCurB, sqrtTempXY);
|
|
||||||
counter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
Landpoint result = { 0,0,0 };
|
|
||||||
result.lon = atan2(temY, tmpX) * r2d;
|
|
||||||
result.lat = curB * r2d;
|
|
||||||
result.ati = temZ / sinCurB - N * (1 - eSquare);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void XYZ2BLH_FixedHeight(double x, double y, double z,double ati, Landpoint& point) {
|
|
||||||
const double a = 6378137.0; // WGS84长半轴
|
|
||||||
const double f = 1.0 / 298.257223563;
|
|
||||||
const double e2 = 2 * f - f * f; // 第一偏心率平方
|
|
||||||
|
|
||||||
// 计算经度L (弧度)
|
|
||||||
const double L_rad = std::atan2(y, x);
|
|
||||||
point.lon = L_rad * 180.0 / M_PI; // 转为度
|
|
||||||
|
|
||||||
const double p = std::sqrt(x * x + y * y);
|
|
||||||
const double H = ati; // 使用已知高度
|
|
||||||
|
|
||||||
// 初始纬度估算(考虑已知高度H)
|
|
||||||
double B_rad = std::atan2(z, p * (1 - e2 * (a / (a + H))));
|
|
||||||
|
|
||||||
// 迭代计算纬度B(固定H)
|
|
||||||
for (int i = 0; i < 10; ++i) { // 已知H时迭代次数减少
|
|
||||||
const double sin_B = std::sin(B_rad);
|
|
||||||
const double N = a / std::sqrt(1 - e2 * sin_B * sin_B);
|
|
||||||
const double delta = e2 * N / (N + H); // 高度固定时的修正项
|
|
||||||
|
|
||||||
const double B_new = std::atan2(z, p * (1 - delta));
|
|
||||||
|
|
||||||
if (std::abs(B_new - B_rad) < 1e-9) {
|
|
||||||
B_rad = B_new;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
B_rad = B_new;
|
|
||||||
}
|
|
||||||
|
|
||||||
point.lat = B_rad * 180.0 / M_PI; // 弧度转度
|
|
||||||
|
|
||||||
// 经度范围修正 [-180°, 180°]
|
|
||||||
point.lon = std::fmod(point.lon + 360.0, 360.0);
|
|
||||||
if (point.lon > 180.0) point.lon -= 360.0;
|
|
||||||
point.ati = ati;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
double getAngle(const Landpoint& a, const Landpoint& b)
|
|
||||||
{
|
|
||||||
double c = dot(a, b) / (getlength(a) * getlength(b));
|
|
||||||
if (a.lon * b.lat - a.lat * b.lon >= 0) {
|
|
||||||
return acos(c > 1 ? 1 : c < -1 ? -1 : c) * r2d;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return 360 - acos(c > 1 ? 1 : c < -1 ? -1 : c) * r2d;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
double dot(const Landpoint& p1, const Landpoint& p2)
|
|
||||||
{
|
|
||||||
return p1.lat * p2.lat + p1.lon * p2.lon + p1.ati * p2.ati;
|
|
||||||
}
|
|
||||||
|
|
||||||
double getlength(const Landpoint& p1) {
|
|
||||||
|
|
||||||
return sqrt(dot(p1, p1));
|
|
||||||
}
|
|
||||||
|
|
||||||
Landpoint crossProduct(const Landpoint& a, const Landpoint& b) {
|
|
||||||
return Landpoint{
|
|
||||||
a.lat * b.ati - a.ati * b.lat,//x
|
|
||||||
a.ati * b.lon - a.lon * b.ati,//y
|
|
||||||
a.lon * b.lat - a.lat * b.lon//z
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
float cross2d(Point3 a, Point3 b)
|
|
||||||
{
|
|
||||||
return a.x * b.y - a.y * b.x;
|
|
||||||
}
|
|
||||||
|
|
||||||
Point3 operator -(Point3 a, Point3 b)
|
|
||||||
{
|
|
||||||
return Point3{ a.x - b.x, a.y - b.y, a.z - b.z };
|
|
||||||
}
|
|
||||||
|
|
||||||
Point3 operator +(Point3 a, Point3 b)
|
|
||||||
{
|
|
||||||
return Point3{ a.x + b.x, a.y + b.y, a.z + b.z };
|
|
||||||
}
|
|
||||||
|
|
||||||
double operator /(Point3 a, Point3 b)
|
|
||||||
{
|
|
||||||
return sqrt(pow(a.x, 2) + pow(a.y, 2)) / sqrt(pow(b.x, 2) + pow(b.y, 2));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Landpoint getSlopeVector(const Landpoint& p0, const Landpoint& p1, const Landpoint& p2, const Landpoint& p3, const Landpoint& p4,bool inLBH) {
|
|
||||||
Landpoint n0, n1, n2, n3, n4;
|
|
||||||
if (inLBH) {
|
|
||||||
n0 = LLA2XYZ(p0);
|
|
||||||
n1 = LLA2XYZ(p1);
|
|
||||||
n2 = LLA2XYZ(p2);
|
|
||||||
n3 = LLA2XYZ(p3);
|
|
||||||
n4 = LLA2XYZ(p4);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
n0 = p0;
|
|
||||||
n1 = p1;
|
|
||||||
n2 = p2;
|
|
||||||
n3 = p3;
|
|
||||||
n4 = p4;
|
|
||||||
}
|
|
||||||
|
|
||||||
Landpoint n01 = n1 - n0, n02 = n2 - n0, n03 = n3 - n0, n04 = n4 - n0;
|
|
||||||
// 锟斤拷n01为锟斤拷锟斤拷锟斤拷锟斤拷
|
|
||||||
Landpoint np01 = p1 - p0, np02 = p2 - p0, np03 = p3 - p0, np04 = p4 - p0;
|
|
||||||
double a2 = getAngle(Landpoint{ np01.lon,np01.lat,0 }, Landpoint{ np02.lon,np02.lat,0 });// 01->02
|
|
||||||
double a3 = getAngle(Landpoint{ np01.lon,np01.lat,0 }, Landpoint{ np03.lon,np03.lat,0 });// 01->03
|
|
||||||
double a4 = getAngle(Landpoint{ np01.lon,np01.lat,0 }, Landpoint{ np04.lon,np04.lat,0 });// 01->04
|
|
||||||
//qDebug() << a2 << "\t" << a3 << "\t" << a4 << endl;
|
|
||||||
a2 = 360 - a2;
|
|
||||||
a3 = 360 - a3;
|
|
||||||
a4 = 360 - a4;
|
|
||||||
Landpoint N, W, S, E;
|
|
||||||
N = n01;
|
|
||||||
if (a2 >= a3 && a2 >= a4) {
|
|
||||||
W = n02;
|
|
||||||
if (a3 >= a4) {
|
|
||||||
S = n03;
|
|
||||||
E = n04;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
S = n04;
|
|
||||||
E = n03;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (a3 >= a2 && a3 >= a4) {
|
|
||||||
W = n03;
|
|
||||||
if (a2 >= a4) {
|
|
||||||
S = n02;
|
|
||||||
E = n04;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
S = n04;
|
|
||||||
E = n02;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (a4 >= a2 && a4 >= a3)
|
|
||||||
{
|
|
||||||
W = n04;
|
|
||||||
if (a2 >= a3) {
|
|
||||||
S = n02;
|
|
||||||
E = n03;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
S = n03;
|
|
||||||
E = n02;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (crossProduct(N, W) + crossProduct(W, S) + crossProduct(S, E) + crossProduct(E, N)) * 0.25;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
double distance(const Vector3D& p1, const Vector3D& p2)
|
|
||||||
{
|
|
||||||
double dx = p1.x - p2.x;
|
|
||||||
double dy = p1.y - p2.y;
|
|
||||||
double dz = p1.z - p2.z;
|
|
||||||
return std::sqrt(dx * dx + dy * dy + dz * dz);
|
|
||||||
}
|
|
||||||
|
|
||||||
double pointToLineDistance(const Vector3D& point, const Vector3D& linePoint, const Vector3D& lineDirection)
|
|
||||||
{
|
|
||||||
Vector3D pointToLine = { point.x - linePoint.x, point.y - linePoint.y, point.z - linePoint.z };
|
|
||||||
|
|
||||||
// 璁$畻鐐瑰埌鐩寸嚎鐨勬姇褰辩偣鐨勪綅缃?
|
|
||||||
double t = (pointToLine.x * lineDirection.x + pointToLine.y * lineDirection.y + pointToLine.z * lineDirection.z) /
|
|
||||||
(lineDirection.x * lineDirection.x + lineDirection.y * lineDirection.y + lineDirection.z * lineDirection.z);
|
|
||||||
|
|
||||||
// 璁$畻鎶曞奖鐐?
|
|
||||||
Vector3D projection = { linePoint.x + t * lineDirection.x, linePoint.y + t * lineDirection.y, linePoint.z + t * lineDirection.z };
|
|
||||||
|
|
||||||
// 璁$畻鐐瑰埌鐩寸嚎鐨勮窛绂?
|
|
||||||
return distance(point, projection);
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector3D operator+(const Vector3D& p1, const Vector3D& p2)
|
|
||||||
{
|
|
||||||
return Vector3D{ p1.x + p2.x,p1.y + p2.y,p1.z + p2.z };
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector3D operator-(const Vector3D& p1, const Vector3D& p2)
|
|
||||||
{
|
|
||||||
return Vector3D{ p1.x - p2.x,p1.y - p2.y,p1.z - p2.z };
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator==(const Vector3D& p1, const Vector3D& p2)
|
|
||||||
{
|
|
||||||
return p1.x == p2.x && p1.y == p2.y && p1.z == p2.z;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector3D operator*(const Vector3D& p, double scale)
|
|
||||||
{
|
|
||||||
return Vector3D{
|
|
||||||
p.x * scale,
|
|
||||||
p.y * scale,
|
|
||||||
p.z * scale
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector3D operator*(double scale, const Vector3D& p)
|
|
||||||
{
|
|
||||||
return Vector3D{
|
|
||||||
p.x * scale,
|
|
||||||
p.y * scale,
|
|
||||||
p.z * scale
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
double getAngle(const Vector3D& a, const Vector3D& b)
|
|
||||||
{
|
|
||||||
double c = dot(a, b) / (getlength(a) * getlength(b));
|
|
||||||
if (a.x * b.y - a.y * b.x >= 0) {
|
|
||||||
return acos(c > 1 ? 1 : c < -1 ? -1 : c) * r2d;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return 360 - acos(c > 1 ? 1 : c < -1 ? -1 : c) * r2d;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
double getCosAngle(const Vector3D& a, const Vector3D& b)
|
|
||||||
{
|
|
||||||
double c = dot(a, b) / (getlength(a) * getlength(b));
|
|
||||||
return acos(c > 1 ? 1 : c < -1 ? -1 : c) * r2d;
|
|
||||||
}
|
|
||||||
|
|
||||||
double dot(const Vector3D& p1, const Vector3D& p2)
|
|
||||||
{
|
|
||||||
return p1.y * p2.y + p1.x * p2.x + p1.z * p2.z;
|
|
||||||
}
|
|
||||||
|
|
||||||
double getlength(const Vector3D& p1)
|
|
||||||
{
|
|
||||||
return std::sqrt(std::pow(p1.x, 2) + std::pow(p1.y, 2) + std::pow(p1.z, 2));
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector3D crossProduct(const Vector3D& a, const Vector3D& b)
|
|
||||||
{
|
|
||||||
return Vector3D{
|
|
||||||
a.y * b.z - a.z * b.y,//x
|
|
||||||
a.z * b.x - a.x * b.z,//y
|
|
||||||
a.x * b.y - a.y * b.x//z
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// n1
|
|
||||||
/// n4 n0 n2
|
|
||||||
/// n3
|
|
||||||
/// </summary>
|
|
||||||
Vector3D getSlopeVector(const Vector3D& n0, const Vector3D& n1, const Vector3D& n2, const Vector3D& n3, const Vector3D& n4)
|
|
||||||
{
|
|
||||||
Vector3D n01 = n1 - n0, n02 = n2 - n0, n03 = n3 - n0, n04 = n4 - n0;
|
|
||||||
return (crossProduct(n01, n04) + crossProduct(n04, n03) + crossProduct(n03, n02) + crossProduct(n02, n01)) * 0.25;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SphericalCoordinates cartesianToSpherical(const CartesianCoordinates& cartesian)
|
|
||||||
{
|
|
||||||
SphericalCoordinates spherical;
|
|
||||||
|
|
||||||
spherical.r = std::sqrt(cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z);
|
|
||||||
spherical.theta = std::acos(cartesian.z / spherical.r);
|
|
||||||
spherical.phi = std::atan2(cartesian.y, cartesian.x);
|
|
||||||
|
|
||||||
return spherical;
|
|
||||||
}
|
|
||||||
|
|
||||||
CartesianCoordinates sphericalToCartesian(const SphericalCoordinates& spherical)
|
|
||||||
{
|
|
||||||
CartesianCoordinates cartesian;
|
|
||||||
|
|
||||||
cartesian.x = spherical.r * std::sin(spherical.theta) * std::cos(spherical.phi);
|
|
||||||
cartesian.y = spherical.r * std::sin(spherical.theta) * std::sin(spherical.phi);
|
|
||||||
cartesian.z = spherical.r * std::cos(spherical.theta);
|
|
||||||
|
|
||||||
return cartesian;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
double getlocalIncAngle(Landpoint& satepoint, Landpoint& landpoint, Landpoint& slopeVector) {
|
|
||||||
Landpoint Rsc = satepoint - landpoint; // AB=B-A
|
|
||||||
//double R = getlength(Rsc);
|
|
||||||
//qDebug() << R << endl;
|
|
||||||
double angle = getAngle(Rsc, slopeVector);
|
|
||||||
if (angle >= 180) {
|
|
||||||
return 360 - angle;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return angle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
double getlocalIncAngle(Vector3D& satepoint, Vector3D& landpoint, Vector3D& slopeVector){
|
|
||||||
Vector3D Rsc = satepoint - landpoint; // AB=B-A
|
|
||||||
//double R = getlength(Rsc);
|
|
||||||
//qDebug() << R << endl;
|
|
||||||
double angle = getAngle(Rsc, slopeVector);
|
|
||||||
if (angle >= 180) {
|
|
||||||
return 360 - angle;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return angle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool BASECONSTVARIABLEAPI ConvertResolutionToDegrees(int sourceEPSG, double resolutionMeters, double refLon, double refLat, double& degreePerPixelX, double& degreePerPixelY){
|
|
||||||
// 初始化源坐标系(平面投影)和目标坐标系(WGS84 经纬度)
|
|
||||||
OGRSpatialReference sourceSRS, targetSRS;
|
|
||||||
sourceSRS.importFromEPSG(sourceEPSG); // 源坐标系需明确 EPSG
|
|
||||||
targetSRS.importFromEPSG(4326); // 目标为 WGS84 经纬度
|
|
||||||
|
|
||||||
// 创建坐标转换器:经纬度 -> 平面坐标
|
|
||||||
OGRCoordinateTransformation* toPlane = OGRCreateCoordinateTransformation(&targetSRS, &sourceSRS);
|
|
||||||
if (!toPlane) return false;
|
|
||||||
|
|
||||||
// 将参考点经纬度转换为平面坐标
|
|
||||||
double x = refLon, y = refLat;
|
|
||||||
if (!toPlane->Transform(1, &x, &y)) {
|
|
||||||
OGRCoordinateTransformation::DestroyCT(toPlane);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建坐标转换器:平面坐标 -> 经纬度
|
|
||||||
OGRCoordinateTransformation* toGeo = OGRCreateCoordinateTransformation(&sourceSRS, &targetSRS);
|
|
||||||
if (!toGeo) {
|
|
||||||
OGRCoordinateTransformation::DestroyCT(toPlane);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算东向分辨率(经度变化量)
|
|
||||||
double eastX = x + resolutionMeters, eastY = y;
|
|
||||||
double eastLon = eastX, eastLat = eastY;
|
|
||||||
if (!toGeo->Transform(1, &eastLon, &eastLat)) {
|
|
||||||
OGRCoordinateTransformation::DestroyCT(toPlane);
|
|
||||||
OGRCoordinateTransformation::DestroyCT(toGeo);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
degreePerPixelX = (eastLon - refLon) / resolutionMeters; // 经度方向每米对应度数
|
|
||||||
|
|
||||||
// 计算北向分辨率(纬度变化量)
|
|
||||||
double northX = x, northY = y + resolutionMeters;
|
|
||||||
double northLon = northX, northLat = northY;
|
|
||||||
if (!toGeo->Transform(1, &northLon, &northLat)) {
|
|
||||||
OGRCoordinateTransformation::DestroyCT(toPlane);
|
|
||||||
OGRCoordinateTransformation::DestroyCT(toGeo);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
degreePerPixelY = (northLat - refLat) / resolutionMeters; // 纬度方向每米对应度数
|
|
||||||
|
|
||||||
// 释放资源
|
|
||||||
OGRCoordinateTransformation::DestroyCT(toPlane);
|
|
||||||
OGRCoordinateTransformation::DestroyCT(toGeo);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
@ -1,147 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _GEOOPERATOR_H
|
|
||||||
#define _GEOOPERATOR_H
|
|
||||||
|
|
||||||
#include "BaseConstVariable.h"
|
|
||||||
#include <Eigen/Core>
|
|
||||||
#include <Eigen/Dense>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <memory.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 将经纬度转换为地固参心坐标系
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="XYZP">经纬度点--degree</param>
|
|
||||||
/// <returns>投影坐标系点</returns>
|
|
||||||
Landpoint BASECONSTVARIABLEAPI LLA2XYZ(const Landpoint& LLA);
|
|
||||||
void BASECONSTVARIABLEAPI LLA2XYZ(const Landpoint& LLA,Point3& XYZ);
|
|
||||||
Eigen::MatrixXd BASECONSTVARIABLEAPI LLA2XYZ(Eigen::MatrixXd landpoint);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 将地固参心坐标系转换为经纬度
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="XYZ">固参心坐标系</param>
|
|
||||||
/// <returns>经纬度--degree</returns>
|
|
||||||
Landpoint BASECONSTVARIABLEAPI XYZ2LLA(const Landpoint& XYZ);
|
|
||||||
|
|
||||||
void BASECONSTVARIABLEAPI XYZ2BLH_FixedHeight(double x, double y, double z, double ati, Landpoint& point);
|
|
||||||
|
|
||||||
Landpoint BASECONSTVARIABLEAPI operator +(const Landpoint& p1, const Landpoint& p2);
|
|
||||||
|
|
||||||
Landpoint BASECONSTVARIABLEAPI operator -(const Landpoint& p1, const Landpoint& p2);
|
|
||||||
|
|
||||||
bool BASECONSTVARIABLEAPI operator ==(const Landpoint& p1, const Landpoint& p2);
|
|
||||||
|
|
||||||
Landpoint BASECONSTVARIABLEAPI operator *(const Landpoint& p, double scale);
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI getAngle(const Landpoint& a, const Landpoint& b);
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI dot(const Landpoint& p1, const Landpoint& p2);
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI getlength(const Landpoint& p1);
|
|
||||||
|
|
||||||
Landpoint BASECONSTVARIABLEAPI crossProduct(const Landpoint& a, const Landpoint& b);
|
|
||||||
|
|
||||||
|
|
||||||
Landpoint BASECONSTVARIABLEAPI getSlopeVector(const Landpoint& p0, const Landpoint& p1, const Landpoint& p2, const Landpoint& p3, const Landpoint& p4, bool inLBH=true);
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI getlocalIncAngle(Landpoint& satepoint, Landpoint& landpoint, Landpoint& slopeVector);
|
|
||||||
|
|
||||||
float BASECONSTVARIABLEAPI cross2d(Point3 a, Point3 b);
|
|
||||||
|
|
||||||
Point3 BASECONSTVARIABLEAPI operator -(Point3 a, Point3 b);
|
|
||||||
|
|
||||||
Point3 BASECONSTVARIABLEAPI operator +(Point3 a, Point3 b);
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI operator /(Point3 a, Point3 b);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 矢量计算
|
|
||||||
struct Vector3D {
|
|
||||||
double x, y, z;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 计算两点之间的距离
|
|
||||||
double BASECONSTVARIABLEAPI distance(const Vector3D& p1, const Vector3D& p2);
|
|
||||||
// 计算点到直线的最短距离
|
|
||||||
double BASECONSTVARIABLEAPI pointToLineDistance(const Vector3D& point, const Vector3D& linePoint, const Vector3D& lineDirection);
|
|
||||||
|
|
||||||
Vector3D BASECONSTVARIABLEAPI operator +(const Vector3D& p1, const Vector3D& p2);
|
|
||||||
|
|
||||||
Vector3D BASECONSTVARIABLEAPI operator -(const Vector3D& p1, const Vector3D& p2);
|
|
||||||
|
|
||||||
bool BASECONSTVARIABLEAPI operator ==(const Vector3D& p1, const Vector3D& p2);
|
|
||||||
|
|
||||||
Vector3D BASECONSTVARIABLEAPI operator *(const Vector3D& p, double scale);
|
|
||||||
|
|
||||||
Vector3D BASECONSTVARIABLEAPI operator *(double scale,const Vector3D& p );
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI getAngle(const Vector3D& a, const Vector3D& b);
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI getCosAngle(const Vector3D& a, const Vector3D& b);
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI dot(const Vector3D& p1, const Vector3D& p2);
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI getlength(const Vector3D& p1);
|
|
||||||
|
|
||||||
Vector3D BASECONSTVARIABLEAPI crossProduct(const Vector3D& a, const Vector3D& b);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// n1
|
|
||||||
/// n4 n0 n2
|
|
||||||
/// n3
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="n0"></param>
|
|
||||||
/// <param name="n1"></param>
|
|
||||||
/// <param name="n2"></param>
|
|
||||||
/// <param name="n3"></param>
|
|
||||||
/// <param name="n4"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Vector3D BASECONSTVARIABLEAPI getSlopeVector(const Vector3D& n0, const Vector3D& n1, const Vector3D& n2, const Vector3D& n3, const Vector3D& n4);
|
|
||||||
|
|
||||||
|
|
||||||
struct CartesianCoordinates {
|
|
||||||
double x, y, z;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct SphericalCoordinates {
|
|
||||||
double r, theta, phi;
|
|
||||||
};
|
|
||||||
|
|
||||||
SphericalCoordinates BASECONSTVARIABLEAPI cartesianToSpherical(const CartesianCoordinates& cartesian);
|
|
||||||
|
|
||||||
CartesianCoordinates BASECONSTVARIABLEAPI sphericalToCartesian(const SphericalCoordinates& spherical);
|
|
||||||
|
|
||||||
double BASECONSTVARIABLEAPI getlocalIncAngle(Vector3D& satepoint, Vector3D& landpoint, Vector3D& slopeVector);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 将平面坐标分辨率(米)转换为经纬度分辨率(度)
|
|
||||||
* @param sourceEPSG 平面坐标系 EPSG 码(如 UTM Zone 50N 对应 32650)
|
|
||||||
* @param resolutionMeters 输入分辨率(单位:米)
|
|
||||||
* @param refLon 参考点经度(十进制度,用于计算局部转换系数)
|
|
||||||
* @param refLat 参考点纬度(十进制度,用于计算局部转换系数)
|
|
||||||
* @param[out] degreePerPixelX 经度方向分辨率(度/像素)
|
|
||||||
* @param[out] degreePerPixelY 纬度方向分辨率(度/像素)
|
|
||||||
* @return 是否转换成功
|
|
||||||
*/
|
|
||||||
bool BASECONSTVARIABLEAPI ConvertResolutionToDegrees(
|
|
||||||
int sourceEPSG,
|
|
||||||
double resolutionMeters,
|
|
||||||
double refLon,
|
|
||||||
double refLat,
|
|
||||||
double& degreePerPixelX,
|
|
||||||
double& degreePerPixelY
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,626 +0,0 @@
|
||||||
#pragma once
|
|
||||||
/**
|
|
||||||
* 影像数据操作项
|
|
||||||
* 所有数据相关的操作,都是基于ENVI的数据格式
|
|
||||||
* 影像读写操作时基于 GDAL 库
|
|
||||||
* **/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef IMAGEOPERATORBASE_H
|
|
||||||
#define IMAGEOPERATORBASE_H
|
|
||||||
#include "BaseConstVariable.h"
|
|
||||||
#include "GeoOperator.h"
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <Eigen/Core>
|
|
||||||
#include <Eigen/Dense>
|
|
||||||
#include <complex>
|
|
||||||
#include <gdal.h>
|
|
||||||
#include <gdal_priv.h>
|
|
||||||
#include <gdalwarper.h>
|
|
||||||
#include <string>
|
|
||||||
#include <memory>
|
|
||||||
#include <QString>
|
|
||||||
#include <cpl_conv.h> // for CPLMalloc()
|
|
||||||
#include "LogInfoCls.h"
|
|
||||||
#include <QObject>
|
|
||||||
#include <QList>
|
|
||||||
#include <functional>
|
|
||||||
#include "ShowProessAbstract.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum ProjectStripDelta {
|
|
||||||
Strip_6, // 6度带
|
|
||||||
Strip_3
|
|
||||||
};
|
|
||||||
|
|
||||||
enum CoordinateSystemType { // 坐标系类型
|
|
||||||
GeoCoordinateSystem,
|
|
||||||
ProjectCoordinateSystem,
|
|
||||||
UNKNOW
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PointRaster { // 影像坐标点
|
|
||||||
double x;
|
|
||||||
double y;
|
|
||||||
double z;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct PointXYZ {
|
|
||||||
double x, y, z;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PointGeo {
|
|
||||||
double lon, lat, ati;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PointImage {
|
|
||||||
double pixel_x, pixel_y;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct ImageGEOINFO {
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
int bandnum;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum GDALREADARRCOPYMETHOD {
|
|
||||||
MEMCPYMETHOD, // 直接拷贝
|
|
||||||
VARIABLEMETHOD // 变量赋值
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// 根据经纬度获取
|
|
||||||
/// EPSG代码,根据经纬度返回对应投影坐标系统,其中如果在中华人民共和国境内,默认使用
|
|
||||||
/// CGCS2000坐标系统(EPSG 4502 ~ 4512 6度带,EPSG 4534 ~ 4554 3度带),其余地方使用WGS坐标系统,
|
|
||||||
/// 投影方法 高斯克吕格(国内), 高斯克吕格
|
|
||||||
/// \param long 经度
|
|
||||||
/// \param lat 纬度
|
|
||||||
/// \return 对应投影坐标系统的 EPSG编码,-1 表示计算错误
|
|
||||||
long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat(double lon, double lat, ProjectStripDelta stripState= ProjectStripDelta::Strip_6);
|
|
||||||
|
|
||||||
long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat_inStrip3(double lon, double lat);
|
|
||||||
|
|
||||||
long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat_inStrip6(double lon, double lat);
|
|
||||||
|
|
||||||
|
|
||||||
QString BASECONSTVARIABLEAPI GetProjectionNameFromEPSG(long epsgCode);
|
|
||||||
|
|
||||||
|
|
||||||
long BASECONSTVARIABLEAPI GetEPSGFromRasterFile(QString filepath);
|
|
||||||
|
|
||||||
std::shared_ptr<PointRaster> BASECONSTVARIABLEAPI GetCenterPointInRaster(QString filepath);
|
|
||||||
|
|
||||||
CoordinateSystemType BASECONSTVARIABLEAPI getCoordinateSystemTypeByEPSGCode(long EPSGCODE);
|
|
||||||
|
|
||||||
|
|
||||||
// 文件打开 // 当指令销毁时,调用GDALClose 销毁类型
|
|
||||||
std::shared_ptr<GDALDataset> BASECONSTVARIABLEAPI OpenDataset(const QString& in_path, GDALAccess rwmode = GA_ReadOnly);
|
|
||||||
void BASECONSTVARIABLEAPI CloseDataset(GDALDataset* ptr);
|
|
||||||
|
|
||||||
// 数据格式转换
|
|
||||||
int BASECONSTVARIABLEAPI TIFF2ENVI(QString in_tiff_path, QString out_envi_path);
|
|
||||||
int BASECONSTVARIABLEAPI ENVI2TIFF(QString in_envi_path, QString out_tiff_path);
|
|
||||||
|
|
||||||
// 保存影像数据 --直接保存 ENVI 文件
|
|
||||||
|
|
||||||
int BASECONSTVARIABLEAPI CreateDataset(QString new_file_path, int height, int width, int band_num, double* gt, QString projection, GDALDataType gdal_dtype, bool need_gt); // 创建文件
|
|
||||||
|
|
||||||
int BASECONSTVARIABLEAPI saveDataset(QString new_file_path, int start_line, int start_cols, int band_ids, int datacols, int datarows, void* databuffer);
|
|
||||||
|
|
||||||
// 根据限制条件估算分块大小
|
|
||||||
int BASECONSTVARIABLEAPI block_num_pre_memory(int width, int height, GDALDataType gdal_dtype, double memey_size);
|
|
||||||
|
|
||||||
// 将结果转换为复数 或者 实数
|
|
||||||
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> BASECONSTVARIABLEAPI ReadComplexMatrixData(int start_line, int width, int line_num, std::shared_ptr<GDALDataset> rasterDataset, GDALDataType gdal_datatype);
|
|
||||||
|
|
||||||
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> BASECONSTVARIABLEAPI ReadMatrixDoubleData(int start_line, int width, int line_num, std::shared_ptr<GDALDataset> rasterDataset, GDALDataType gdal_datatype, int band_idx);
|
|
||||||
|
|
||||||
Eigen::MatrixXd BASECONSTVARIABLEAPI getGeoTranslationArray(QString in_path);
|
|
||||||
ImageGEOINFO BASECONSTVARIABLEAPI getImageINFO(QString in_path);
|
|
||||||
|
|
||||||
GDALDataType BASECONSTVARIABLEAPI getGDALDataType(QString fileptah);
|
|
||||||
|
|
||||||
|
|
||||||
struct RasterExtend {
|
|
||||||
double min_x;
|
|
||||||
double min_y;
|
|
||||||
double max_x;
|
|
||||||
double max_y;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// gdalImage图像操作类
|
|
||||||
/// </summary>
|
|
||||||
|
|
||||||
class BASECONSTVARIABLEAPI gdalImage
|
|
||||||
{
|
|
||||||
|
|
||||||
public: // 方法
|
|
||||||
gdalImage();
|
|
||||||
gdalImage(const QString& raster_path);
|
|
||||||
~gdalImage();
|
|
||||||
virtual void setHeight(int);
|
|
||||||
virtual void setWidth(int);
|
|
||||||
virtual void setTranslationMatrix(Eigen::MatrixXd gt);
|
|
||||||
virtual void setData(Eigen::MatrixXd, int data_band_ids = 1);
|
|
||||||
virtual Eigen::MatrixXd getData(int start_row, int start_col, int rows_count, int cols_count, int band_ids);
|
|
||||||
virtual Eigen::MatrixXf getDataf(int start_row, int start_col, int rows_count, int cols_count, int band_ids);
|
|
||||||
virtual Eigen::MatrixXi getDatai(int start_row, int start_col, int rows_count, int cols_count, int band_ids);
|
|
||||||
virtual ErrorCode getData(double* data, int start_row, int start_col, int rows_count, int cols_count, int band_ids);
|
|
||||||
virtual ErrorCode getData(long* data, int start_row, int start_col, int rows_count, int cols_count, int band_ids);
|
|
||||||
virtual Eigen::MatrixXd getGeoTranslation();
|
|
||||||
virtual GDALDataType getDataType();
|
|
||||||
virtual void saveImage(Eigen::MatrixXd, int start_row, int start_col, int band_ids);
|
|
||||||
virtual void saveImage(Eigen::MatrixXf, int start_row, int start_col, int band_ids);
|
|
||||||
virtual void saveImage(Eigen::MatrixXi, int start_row, int start_col, int band_ids);
|
|
||||||
virtual void saveImage(std::shared_ptr<double>, int start_row, int start_col,int rowcount,int colcount, int band_ids);
|
|
||||||
virtual void saveImage(std::shared_ptr<float>, int start_row, int start_col, int rowcount, int colcount, int band_ids);
|
|
||||||
virtual void saveImage(std::shared_ptr<int>, int start_row, int start_col, int rowcount, int colcount, int band_ids);
|
|
||||||
|
|
||||||
virtual void saveImage();
|
|
||||||
virtual void setNoDataValue(double nodatavalue, int band_ids);
|
|
||||||
virtual void setNoDataValuei(int nodatavalue, int band_ids);
|
|
||||||
virtual double getNoDataValue(int band_ids);
|
|
||||||
virtual int getNoDataValuei(int band_ids);
|
|
||||||
virtual int InitInv_gt();
|
|
||||||
virtual Landpoint getRow_Col(double lon, double lat);
|
|
||||||
virtual Landpoint getLandPoint(double i, double j, double ati);
|
|
||||||
|
|
||||||
virtual void getLandPoint(double i, double j, double ati, Landpoint& Lp);
|
|
||||||
|
|
||||||
virtual double mean(int bandids = 1);
|
|
||||||
double BandmaxValue(int bandids = 1);
|
|
||||||
double BandminValue(int bandids = 1);
|
|
||||||
virtual GDALRPCInfo getRPC();
|
|
||||||
virtual Eigen::MatrixXd getLandPoint(Eigen::MatrixXd points);
|
|
||||||
|
|
||||||
virtual Eigen::MatrixXd getHist(int bandids);
|
|
||||||
|
|
||||||
virtual RasterExtend getExtend();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
QString img_path; // 图像文件
|
|
||||||
int height; // 高
|
|
||||||
int width; // 宽
|
|
||||||
int band_num;// 波段数
|
|
||||||
int start_row;//
|
|
||||||
int start_col;//
|
|
||||||
int data_band_ids;
|
|
||||||
Eigen::MatrixXd gt; // 变换矩阵
|
|
||||||
Eigen::MatrixXd inv_gt; // 逆变换矩阵
|
|
||||||
Eigen::MatrixXd data;
|
|
||||||
QString projection;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// gdalImage图像操作类
|
|
||||||
/// </summary>
|
|
||||||
class BASECONSTVARIABLEAPI gdalImageComplex :public gdalImage
|
|
||||||
{
|
|
||||||
|
|
||||||
public: // 方法
|
|
||||||
gdalImageComplex(const QString& raster_path);
|
|
||||||
~gdalImageComplex();
|
|
||||||
void setData(Eigen::MatrixXcd);
|
|
||||||
void saveImage(Eigen::MatrixXcd data, int start_row, int start_col, int band_ids);
|
|
||||||
void saveImage(std::shared_ptr<std::complex<double>> data, long start_row, long start_col, long rowCount, long colCount, int band_ids);
|
|
||||||
void saveImage(std::complex<double>* data, long start_row, long start_col, long rowcount, long colcount, int banids);
|
|
||||||
|
|
||||||
Eigen::MatrixXcd getDataComplex(int start_row, int start_col, int rows_count, int cols_count, int band_ids);
|
|
||||||
std::shared_ptr<std::complex<double>> getDataComplexSharePtr(int start_row, int start_col, int rows_count, int cols_count, int band_ids);
|
|
||||||
|
|
||||||
void saveComplexImage();//override;
|
|
||||||
void savePreViewImage();
|
|
||||||
public:
|
|
||||||
Eigen::MatrixXcd data;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
bool BASECONSTVARIABLEAPI CopyProjectTransformMatrixFromRasterAToRasterB(QString RasterAPath, QString RasterBPath);
|
|
||||||
|
|
||||||
|
|
||||||
// 创建影像
|
|
||||||
gdalImage BASECONSTVARIABLEAPI CreategdalImageDouble(QString& img_path, int height, int width, int band_num, bool overwrite = false, bool isEnvi = false);
|
|
||||||
gdalImage BASECONSTVARIABLEAPI CreategdalImageFloat(QString& img_path, int height, int width, int band_num, bool overwrite = false, bool isEnvi = false);
|
|
||||||
gdalImage BASECONSTVARIABLEAPI CreategdalImageDouble(const QString& img_path, int height, int width, int band_num, Eigen::MatrixXd gt, QString projection, bool need_gt = true, bool overwrite = false, bool isEnvi = false);
|
|
||||||
gdalImage BASECONSTVARIABLEAPI CreategdalImage(const QString& img_path, int height, int width, int band_num, Eigen::MatrixXd gt, QString projection,bool need_gt = true, bool overwrite = false, bool isEnvi = false, GDALDataType datetype = GDT_Float32);
|
|
||||||
gdalImage BASECONSTVARIABLEAPI CreategdalImage(const QString& img_path, int height, int width, int band_num, Eigen::MatrixXd gt, long espgcode, GDALDataType eType = GDT_Float32, bool need_gt = true, bool overwrite = false, bool isENVI = false);
|
|
||||||
|
|
||||||
gdalImageComplex BASECONSTVARIABLEAPI CreategdalImageComplex(const QString& img_path, int height, int width, int band_num, Eigen::MatrixXd gt, QString projection, bool need_gt = true, bool overwrite = false);
|
|
||||||
gdalImageComplex BASECONSTVARIABLEAPI CreategdalImageComplexNoProj(const QString& img_path, int height, int width, int band_num, bool overwrite = true);
|
|
||||||
|
|
||||||
gdalImageComplex BASECONSTVARIABLEAPI CreateEchoComplex(const QString& img_path, int height, int width, int band_num);
|
|
||||||
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI DEM2XYZRasterAndSlopRaster(QString dempath, QString demxyzpath, QString demsloperPath);
|
|
||||||
|
|
||||||
int BASECONSTVARIABLEAPI ResampleGDAL(const char* pszSrcFile, const char* pszOutFile, double* gt, int new_width, int new_height, GDALResampleAlg eResample);
|
|
||||||
|
|
||||||
void BASECONSTVARIABLEAPI resampleRaster(const char* inputRaster, const char* outputRaster, double targetPixelSizeX, double targetPixelSizeY);
|
|
||||||
|
|
||||||
void BASECONSTVARIABLEAPI cropRasterByLatLon(const char* inputFile, const char* outputFile, double minLon, double maxLon, double minLat, double maxLat);
|
|
||||||
|
|
||||||
int BASECONSTVARIABLEAPI ResampleGDALs(const char* pszSrcFile, int band_ids, GDALRIOResampleAlg eResample = GRIORA_Bilinear);
|
|
||||||
|
|
||||||
void BASECONSTVARIABLEAPI transformRaster(const char* inputFile, const char* outputFile, int sourceEPSG, int targetEPSG);
|
|
||||||
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI transformCoordinate(double x, double y, int sourceEPSG, int targetEPSG, Point2& p);
|
|
||||||
|
|
||||||
int BASECONSTVARIABLEAPI alignRaster(QString inputPath, QString referencePath, QString outputPath, GDALResampleAlg eResample);
|
|
||||||
|
|
||||||
|
|
||||||
void BASECONSTVARIABLEAPI ResampleByReferenceRasterB(QString pszSrcFile, QString RefrasterBPath, QString pszOutFile, GDALResampleAlg eResample);
|
|
||||||
|
|
||||||
//--------------------- 保存文博 -------------------------------
|
|
||||||
|
|
||||||
int BASECONSTVARIABLEAPI saveMatrixXcd2TiFF(Eigen::MatrixXcd data, QString out_tiff_path);
|
|
||||||
|
|
||||||
//----------------------------------------------------
|
|
||||||
|
|
||||||
void BASECONSTVARIABLEAPI clipRaster(QString inRasterPath, QString outRasterPath, long minRow, long maxRow, long minCol, long maxCol);
|
|
||||||
|
|
||||||
// 坐标系转换
|
|
||||||
void BASECONSTVARIABLEAPI ConvertCoordinateSystem(QString inRasterPath, QString outRasterPath, long outepsgcode);
|
|
||||||
|
|
||||||
//--------------------- 图像合并流程 ------------------------------
|
|
||||||
enum MERGEMODE
|
|
||||||
{
|
|
||||||
MERGE_GEOCODING,
|
|
||||||
};
|
|
||||||
|
|
||||||
void BASECONSTVARIABLEAPI MergeTiffs(QList<QString> inputFiles, QString outputFile);
|
|
||||||
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI MergeRasterProcess(QVector<QString> filepath, QString outfileptah, QString mainString, MERGEMODE mergecode = MERGEMODE::MERGE_GEOCODING, bool isENVI = false, ShowProessAbstract* dia = nullptr);
|
|
||||||
|
|
||||||
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI MergeRasterInGeoCoding(QVector<gdalImage> inimgs, gdalImage resultimg, gdalImage maskimg, ShowProessAbstract* dia = nullptr);
|
|
||||||
|
|
||||||
|
|
||||||
// 保存矩阵转换为envi文件,默认数据格式为double
|
|
||||||
bool BASECONSTVARIABLEAPI saveEigenMatrixXd2Bin(Eigen::MatrixXd data, QString dataStrPath);
|
|
||||||
|
|
||||||
|
|
||||||
// 测试
|
|
||||||
void BASECONSTVARIABLEAPI testOutAntPatternTrans(QString antpatternfilename, double* antPatternArr, double starttheta, double deltetheta, double startphi, double deltaphi, long thetanum, long phinum);
|
|
||||||
void BASECONSTVARIABLEAPI testOutAmpArr(QString filename, float* amp, long rowcount, long colcount);
|
|
||||||
void BASECONSTVARIABLEAPI testOutAmpArr(QString filename, double* amp, long rowcount, long colcount);
|
|
||||||
void BASECONSTVARIABLEAPI testOutClsArr(QString filename, long* amp, long rowcount, long colcount);
|
|
||||||
void BASECONSTVARIABLEAPI testOutComplexDoubleArr(QString filename, std::complex<double>* data, long rowcount, long colcount);
|
|
||||||
void BASECONSTVARIABLEAPI testOutDataArr(QString filename, double* data, long rowcount, long colcount);
|
|
||||||
void BASECONSTVARIABLEAPI testOutDataArr(QString filename, float* data, long rowcount, long colcount);
|
|
||||||
void BASECONSTVARIABLEAPI testOutDataArr(QString filename, long* data, long rowcount, long colcount);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void BASECONSTVARIABLEAPI CreateSARIntensityByLookTable(QString IntensityRasterPath, QString LookTableRasterPath, QString SARIntensityPath, long min_rid, long max_rid, long min_cid, long max_cid, std::function<void(long, long)> processBarShow = {});
|
|
||||||
|
|
||||||
bool BASECONSTVARIABLEAPI ConvertVrtToEnvi(QString vrtPath, QString outPath);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void BASECONSTVARIABLEAPI MultiLookRaster(QString inRasterPath, QString outRasterPath, long looklineNumrow, long looklineNumCol);
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI Complex2PhaseRaster(QString inComplexPath, QString outRasterPath);
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI Complex2dBRaster(QString inComplexPath, QString outRasterPath);
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI Complex2AmpRaster(QString inComplexPath, QString outRasterPath);
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI amp2dBRaster(QString inPath, QString outRasterPath);
|
|
||||||
|
|
||||||
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI ResampleDEM(QString indemPath, QString outdemPath, double gridx, double gridy);
|
|
||||||
|
|
||||||
|
|
||||||
void BASECONSTVARIABLEAPI CloseAllGDALRaster();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------- 图像文件读写 ------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long start_col, long& rows_count, long& cols_count, int band_ids, GDALREADARRCOPYMETHOD method)
|
|
||||||
{
|
|
||||||
std::shared_ptr<T> result = nullptr;
|
|
||||||
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
GDALDataset* rasterDataset = (GDALDataset*)(GDALOpen(imgds.img_path.toUtf8().constData(), GA_ReadOnly)); // 锟斤拷只斤拷式锟斤拷取斤拷影锟斤拷
|
|
||||||
|
|
||||||
GDALDataType gdal_datatype = rasterDataset->GetRasterBand(1)->GetRasterDataType();
|
|
||||||
GDALRasterBand* demBand = rasterDataset->GetRasterBand(band_ids);
|
|
||||||
|
|
||||||
rows_count = start_row + rows_count <= imgds.height ? rows_count : imgds.height - start_row;
|
|
||||||
cols_count = start_col + cols_count <= imgds.width ? cols_count : imgds.width - start_col;
|
|
||||||
|
|
||||||
//Eigen::MatrixXd datamatrix(rows_count, cols_count);
|
|
||||||
|
|
||||||
if (gdal_datatype == GDT_Byte) {
|
|
||||||
char* temp = new char[rows_count * cols_count];
|
|
||||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
|
||||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
|
||||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
|
||||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
|
||||||
}
|
|
||||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
|
||||||
long count = rows_count * cols_count;
|
|
||||||
for (long i = 0; i < count; i++) {
|
|
||||||
result.get()[i] = T(temp[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delete[] temp;
|
|
||||||
}
|
|
||||||
else if (gdal_datatype == GDT_UInt16) {
|
|
||||||
unsigned short* temp = new unsigned short[rows_count * cols_count];
|
|
||||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
|
||||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
|
||||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
|
||||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
|
||||||
}
|
|
||||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
|
||||||
long count = rows_count * cols_count;
|
|
||||||
for (long i = 0; i < count; i++) {
|
|
||||||
result.get()[i] = T(temp[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] temp;
|
|
||||||
}
|
|
||||||
else if (gdal_datatype == GDT_Int16) {
|
|
||||||
short* temp = new short[rows_count * cols_count];
|
|
||||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
|
||||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
|
||||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
|
||||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
|
||||||
}
|
|
||||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
|
||||||
long count = rows_count * cols_count;
|
|
||||||
for (long i = 0; i < count; i++) {
|
|
||||||
result.get()[i] = T(temp[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] temp;
|
|
||||||
}
|
|
||||||
else if (gdal_datatype == GDT_UInt32) {
|
|
||||||
unsigned int* temp = new unsigned int[rows_count * cols_count];
|
|
||||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
|
||||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
|
||||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
|
||||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
|
||||||
}
|
|
||||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
|
||||||
long count = rows_count * cols_count;
|
|
||||||
for (long i = 0; i < count; i++) {
|
|
||||||
result.get()[i] = T(temp[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] temp;
|
|
||||||
}
|
|
||||||
else if (gdal_datatype == GDT_Int32) {
|
|
||||||
int* temp = new int[rows_count * cols_count];
|
|
||||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
|
||||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
|
||||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
|
||||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
|
||||||
}
|
|
||||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
|
||||||
long count = rows_count * cols_count;
|
|
||||||
for (long i = 0; i < count; i++) {
|
|
||||||
result.get()[i] = T(temp[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] temp;
|
|
||||||
}
|
|
||||||
// else if (gdal_datatype == GDT_UInt64) {
|
|
||||||
// unsigned long* temp = new unsigned long[rows_count * cols_count];
|
|
||||||
// demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count,
|
|
||||||
//rows_count, gdal_datatype, 0, 0); for (int i = 0; i < rows_count; i++) { for (int j = 0; j <
|
|
||||||
//cols_count; j++) { datamatrix(i, j) = temp[i * cols_count + j];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// delete[] temp;
|
|
||||||
// }
|
|
||||||
// else if (gdal_datatype == GDT_Int64) {
|
|
||||||
// long* temp = new long[rows_count * cols_count];
|
|
||||||
// demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count,
|
|
||||||
//rows_count, gdal_datatype, 0, 0); for (int i = 0; i < rows_count; i++) { for (int j = 0; j <
|
|
||||||
//cols_count; j++) { datamatrix(i, j) = temp[i * cols_count + j];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// delete[] temp;
|
|
||||||
// }
|
|
||||||
else if (gdal_datatype == GDT_Float32) {
|
|
||||||
float* temp = new float[rows_count * cols_count];
|
|
||||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
|
||||||
|
|
||||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
|
||||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
|
||||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
|
||||||
}
|
|
||||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
|
||||||
long count = rows_count * cols_count;
|
|
||||||
for (long i = 0; i < count; i++) {
|
|
||||||
result.get()[i] = T(temp[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] temp;
|
|
||||||
}
|
|
||||||
else if (gdal_datatype == GDT_Float64) {
|
|
||||||
double* temp = new double[rows_count * cols_count];
|
|
||||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
|
||||||
|
|
||||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
|
||||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
|
||||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
|
||||||
}
|
|
||||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
|
||||||
long count = rows_count * cols_count;
|
|
||||||
for (long i = 0; i < count; i++) {
|
|
||||||
result.get()[i] = T(temp[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] temp;
|
|
||||||
}
|
|
||||||
//else if (gdal_datatype == GDT_CFloat32) {
|
|
||||||
// if (std::is_same<T, std::complex<double>>::value || std::is_same<T, std::complex<double>>::value) {
|
|
||||||
// float* temp = new float[rows_count * cols_count * 2];
|
|
||||||
// demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
|
||||||
|
|
||||||
// result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
|
||||||
// if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
|
||||||
// std::memcpy(result.get(), temp, rows_count * cols_count);
|
|
||||||
// }
|
|
||||||
// else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
|
||||||
// long count = rows_count * cols_count;
|
|
||||||
// for (long i = 0; i < count; i++) {
|
|
||||||
// result.get()[i] = T(temp[i * 2],
|
|
||||||
// temp[i * 2 + 1]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// delete[] temp;
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// result = nullptr;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//else if (gdal_datatype == GDT_CFloat64 ) {
|
|
||||||
// if (std::is_same<T, std::complex<double>>::value || std::is_same<T, std::complex<double>>::value) {
|
|
||||||
// double* temp = new double[rows_count * cols_count * 2];
|
|
||||||
// demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
|
||||||
|
|
||||||
// result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
|
||||||
// if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
|
||||||
// std::memcpy(result.get(), temp, rows_count * cols_count);
|
|
||||||
// }
|
|
||||||
// else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
|
||||||
// long count = rows_count * cols_count;
|
|
||||||
// for (long i = 0; i < count; i++) {
|
|
||||||
// result.get()[i] = T(temp[i * 2],
|
|
||||||
// temp[i * 2 + 1]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// delete[] temp;
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// result = nullptr;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
else {
|
|
||||||
}
|
|
||||||
GDALClose((GDALDatasetH)rasterDataset);
|
|
||||||
omp_unset_lock(&lock); // 锟酵放伙拷斤拷
|
|
||||||
omp_destroy_lock(&lock); // 劫伙拷斤拷
|
|
||||||
GDALDestroy(); // or, DllMain at DLL_PROCESS_DETACH
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline std::shared_ptr<T> readDataArrComplex(gdalImageComplex& imgds, long start_row, long start_col, long& rows_count, long& cols_count, int band_ids, GDALREADARRCOPYMETHOD method)
|
|
||||||
{
|
|
||||||
std::shared_ptr<T> result = nullptr;
|
|
||||||
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
GDALDataset* rasterDataset = (GDALDataset*)(GDALOpen(imgds.img_path.toUtf8().constData(), GA_ReadOnly)); // 锟斤拷只斤拷式锟斤拷取斤拷影锟斤拷
|
|
||||||
|
|
||||||
GDALDataType gdal_datatype = rasterDataset->GetRasterBand(1)->GetRasterDataType();
|
|
||||||
GDALRasterBand* demBand = rasterDataset->GetRasterBand(band_ids);
|
|
||||||
|
|
||||||
rows_count = start_row + rows_count <= imgds.height ? rows_count : imgds.height - start_row;
|
|
||||||
cols_count = start_col + cols_count <= imgds.width ? cols_count : imgds.width - start_col;
|
|
||||||
|
|
||||||
//Eigen::MatrixXd datamatrix(rows_count, cols_count);
|
|
||||||
|
|
||||||
if (gdal_datatype == GDT_CFloat32) {
|
|
||||||
if (std::is_same<T, std::complex<double>>::value || std::is_same<T, std::complex<double>>::value) {
|
|
||||||
float* temp = new float[rows_count * cols_count * 2];
|
|
||||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
|
||||||
|
|
||||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
|
||||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
|
||||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
|
||||||
}
|
|
||||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
|
||||||
long count = rows_count * cols_count;
|
|
||||||
for (long i = 0; i < count; i++) {
|
|
||||||
result.get()[i] = T(temp[i * 2],
|
|
||||||
temp[i * 2 + 1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] temp;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
result = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (gdal_datatype == GDT_CFloat64) {
|
|
||||||
if (std::is_same<T, std::complex<double>>::value || std::is_same<T, std::complex<double>>::value) {
|
|
||||||
double* temp = new double[rows_count * cols_count * 2];
|
|
||||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
|
||||||
|
|
||||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
|
||||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
|
||||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
|
||||||
}
|
|
||||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
|
||||||
long count = rows_count * cols_count;
|
|
||||||
for (long i = 0; i < count; i++) {
|
|
||||||
result.get()[i] = T(temp[i * 2],
|
|
||||||
temp[i * 2 + 1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete[] temp;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
result = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
}
|
|
||||||
GDALClose((GDALDatasetH)rasterDataset);
|
|
||||||
omp_unset_lock(&lock); // 锟酵放伙拷斤拷
|
|
||||||
omp_destroy_lock(&lock); // 劫伙拷斤拷
|
|
||||||
GDALDestroy(); // or, DllMain at DLL_PROCESS_DETACH
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------- 图像分块 ------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
@ -1,233 +0,0 @@
|
||||||
#include "stdafx.h"
|
|
||||||
#include "LogInfoCls.h"
|
|
||||||
|
|
||||||
std::string errorCode2errInfo(ErrorCode e)
|
|
||||||
{
|
|
||||||
switch (e)
|
|
||||||
{
|
|
||||||
_CASE_STR(SUCCESS);
|
|
||||||
_CASE_STR(VIRTUALABSTRACT);
|
|
||||||
_CASE_STR(FAIL);
|
|
||||||
_CASE_STR(FILENOFOUND);
|
|
||||||
_CASE_STR(OrbitNodeNotEnough);
|
|
||||||
_CASE_STR(XYDataPointNotEqual);
|
|
||||||
_CASE_STR(FILEOPENFAIL );
|
|
||||||
_CASE_STR(XMLPARSEFAIL );
|
|
||||||
_CASE_STR(XMLNOTFOUNDElEMENT );
|
|
||||||
_CASE_STR(FILEPATHISEMPTY);
|
|
||||||
_CASE_STR(FOLDER_NOT_EXIST);
|
|
||||||
_CASE_STR(FILE_NOT_EXIST);
|
|
||||||
_CASE_STR(FIND_ID_ERROR);
|
|
||||||
_CASE_STR(INSERT_ID_ERROR);
|
|
||||||
_CASE_STR(EPSGCODE_NOTSAME);
|
|
||||||
_CASE_STR(EPSGCODE_NOTSUPPORT);
|
|
||||||
_CASE_STR(RASTERBAND_NOTEQUAL);
|
|
||||||
_CASE_STR(RASTER_DATETYPE_NOTSAME);
|
|
||||||
//GSL 1xx
|
|
||||||
_CASE_STR(Error_GSL_FAILURE );
|
|
||||||
_CASE_STR(Error_GSL_CONTINUE );
|
|
||||||
_CASE_STR(Error_GSL_EDOM );
|
|
||||||
_CASE_STR(Error_GSL_ERANGE );
|
|
||||||
_CASE_STR(Error_GSL_EFAULT );
|
|
||||||
_CASE_STR(Error_GSL_EINVAL );
|
|
||||||
_CASE_STR(Error_GSL_EFAILED );
|
|
||||||
_CASE_STR(Error_GSL_EFACTOR );
|
|
||||||
_CASE_STR(Error_GSL_ESANITY );
|
|
||||||
_CASE_STR(Error_GSL_ENOMEM );
|
|
||||||
_CASE_STR(Error_GSL_EBADFUNC );
|
|
||||||
_CASE_STR(Error_GSL_ERUNAWAY );
|
|
||||||
_CASE_STR(Error_GSL_EMAXITER );
|
|
||||||
_CASE_STR(Error_GSL_EZERODIV );
|
|
||||||
_CASE_STR(Error_GSL_EBADTOL );
|
|
||||||
_CASE_STR(Error_GSL_ETOL );
|
|
||||||
_CASE_STR(Error_GSL_EUNDRFLW );
|
|
||||||
_CASE_STR(Error_GSL_EOVRFLW );
|
|
||||||
_CASE_STR(Error_GSL_ELOSS );
|
|
||||||
_CASE_STR(Error_GSL_EROUND );
|
|
||||||
_CASE_STR(Error_GSL_EBADLEN );
|
|
||||||
_CASE_STR(Error_GSL_ENOTSQR );
|
|
||||||
_CASE_STR(Error_GSL_ESING );
|
|
||||||
_CASE_STR(Error_GSL_EDIVERGE );
|
|
||||||
_CASE_STR(Error_GSL_EUNSUP );
|
|
||||||
_CASE_STR(Error_GSL_EUNIMPL );
|
|
||||||
_CASE_STR(Error_GSL_ECACHE );
|
|
||||||
_CASE_STR(Error_GSL_ETABLE );
|
|
||||||
_CASE_STR(Error_GSL_ENOPROG );
|
|
||||||
_CASE_STR(Error_GSL_ENOPROGJ );
|
|
||||||
_CASE_STR(Error_GSL_ETOLF );
|
|
||||||
_CASE_STR(Error_GSL_ETOLX );
|
|
||||||
_CASE_STR(Error_GSL_ETOLG );
|
|
||||||
_CASE_STR(Error_GSL_EOF );
|
|
||||||
// RFPC
|
|
||||||
_CASE_STR(RFPC_PARAMSISEMPTY);
|
|
||||||
_CASE_STR(ECHO_L0DATA_NOTOPEN);
|
|
||||||
_CASE_STR(ECHO_L0DATA_ROW_COL_NOEQUAL);
|
|
||||||
_CASE_STR(ECHO_L0DATA_PRFIDXOUTRANGE);
|
|
||||||
_CASE_STR(ECHO_L0DATA_GPSFILEFORMATERROR);
|
|
||||||
_CASE_STR(ECHO_L0DATA_ECHOFILEFORMATERROR);
|
|
||||||
_CASE_STR(ECHO_L0DATA_ECHOFILENOTOPEN);
|
|
||||||
_CASE_STR(ECHO_L0DATA_GPSFILEFNOTOPEN);
|
|
||||||
_CASE_STR(ECHO_L0DATA_XMLFILENOTOPEN);
|
|
||||||
_CASE_STR(OUTOFRANGE);
|
|
||||||
_CASE_STR(ECHO_L0DATA_XMLNAMEERROR);
|
|
||||||
//
|
|
||||||
_CASE_STR(TBP_L0OPENFAIL);
|
|
||||||
|
|
||||||
//
|
|
||||||
_CASE_STR(IMAGE_L1DATA_XMLNAMEERROR);
|
|
||||||
_CASE_STR(IMAGE_L1DATA_XMLNAMEOPENERROR);
|
|
||||||
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return "UNKNOW_EVENT!";
|
|
||||||
}
|
|
||||||
|
|
||||||
ErrorCode GSLState2ErrorCode(int gslState)
|
|
||||||
{
|
|
||||||
|
|
||||||
switch (gslState)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return ErrorCode::SUCCESS;
|
|
||||||
break;
|
|
||||||
case -1:
|
|
||||||
return ErrorCode::Error_GSL_FAILURE;
|
|
||||||
break;
|
|
||||||
case -2:
|
|
||||||
return ErrorCode::Error_GSL_CONTINUE;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
return ErrorCode::Error_GSL_EDOM; // 输入域错误,例如 sqrt(-1)
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return ErrorCode::Error_GSL_ERANGE; // 输出范围错误,例如 exp(1e100)
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return ErrorCode::Error_GSL_EFAULT; // 无效指针
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return ErrorCode::Error_GSL_EINVAL; // 用户提供的无效参数
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
return ErrorCode::Error_GSL_EFAILED; // 通用失败
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 6:
|
|
||||||
return ErrorCode::Error_GSL_EFACTOR; // 因子分解失败
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 7:
|
|
||||||
return ErrorCode::Error_GSL_ESANITY; // 理智检查失败,通常不应该发生
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 8:
|
|
||||||
return ErrorCode::Error_GSL_ENOMEM; // 内存分配失败
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 9:
|
|
||||||
return ErrorCode::Error_GSL_EBADFUNC; // 用户提供的函数存在问题
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 10:
|
|
||||||
return ErrorCode::Error_GSL_ERUNAWAY; // 迭代过程失控
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 11:
|
|
||||||
return ErrorCode::Error_GSL_EMAXITER; // 超过最大迭代次数
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 12:
|
|
||||||
return ErrorCode::Error_GSL_EZERODIV; // 尝试进行零除
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 13:
|
|
||||||
return ErrorCode::Error_GSL_EBADTOL; // 用户指定的容忍度无效
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 14:
|
|
||||||
return ErrorCode::Error_GSL_ETOL; // 未能达到指定的容忍度
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 15:
|
|
||||||
return ErrorCode::Error_GSL_EUNDRFLW; // 下溢
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 16:
|
|
||||||
return ErrorCode::Error_GSL_EOVRFLW; // 上溢
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 17:
|
|
||||||
return ErrorCode::Error_GSL_ELOSS; // 精度损失
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 18:
|
|
||||||
return ErrorCode::Error_GSL_EROUND; // 因舍入错误而失败
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 19:
|
|
||||||
return ErrorCode::Error_GSL_EBADLEN; // 矩阵或向量长度不匹配
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 20:
|
|
||||||
return ErrorCode::Error_GSL_ENOTSQR; // 矩阵不是方阵
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 21:
|
|
||||||
return ErrorCode::Error_GSL_ESING; // 检测到明显的奇异性
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 22:
|
|
||||||
return ErrorCode::Error_GSL_EDIVERGE; // 积分或级数发散
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 23:
|
|
||||||
return ErrorCode::Error_GSL_EUNSUP; // 请求的特性不受硬件支持
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 24:
|
|
||||||
return ErrorCode::Error_GSL_EUNIMPL; // 请求的特性尚未实现
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 25:
|
|
||||||
return ErrorCode::Error_GSL_ECACHE; // 超过缓存限制
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 26:
|
|
||||||
return ErrorCode::Error_GSL_ETABLE; // 超过表限制
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 27:
|
|
||||||
return ErrorCode::Error_GSL_ENOPROG; // 迭代未能朝向解决方案取得进展
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 28:
|
|
||||||
return ErrorCode::Error_GSL_ENOPROGJ; // 雅可比评估未能改善解决方案
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 29:
|
|
||||||
return ErrorCode::Error_GSL_ETOLF; // 无法达到 F 的指定容忍度
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 30:
|
|
||||||
return ErrorCode::Error_GSL_ETOLX; // 无法达到 X 的指定容忍度
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 31:
|
|
||||||
return ErrorCode::Error_GSL_ETOLG; // 无法达到梯度的指定容忍度
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 32:
|
|
||||||
return ErrorCode::Error_GSL_EOF; // 文件结束
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return ErrorCode::Error_GSL_FAILURE; // 未知错误,返回一般失败
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,102 +0,0 @@
|
||||||
#pragma once
|
|
||||||
/*****************************************************************//**
|
|
||||||
* \file LogInfoCls.h
|
|
||||||
* \brief 错误枚举类,以及返回错误信息
|
|
||||||
*
|
|
||||||
* \author 陈增辉
|
|
||||||
* \date October 2024
|
|
||||||
*********************************************************************/
|
|
||||||
#include "BaseConstVariable.h"
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
// 定义变换
|
|
||||||
#define _CASE_STR(x) case x : return #x; break;
|
|
||||||
|
|
||||||
|
|
||||||
enum ErrorCode {
|
|
||||||
SUCCESS = -1,// 执行成功
|
|
||||||
VIRTUALABSTRACT = -2,// virtual abstract function ,not implement
|
|
||||||
FAIL=0,
|
|
||||||
FILENOFOUND = 1,
|
|
||||||
OrbitNodeNotEnough = 2,
|
|
||||||
XYDataPointNotEqual = 3,
|
|
||||||
FILEOPENFAIL = 4,
|
|
||||||
XMLPARSEFAIL = 5,
|
|
||||||
XMLNOTFOUNDElEMENT = 6,
|
|
||||||
FILEPATHISEMPTY = 7,
|
|
||||||
FOLDER_NOT_EXIST = 8,
|
|
||||||
FILE_NOT_EXIST = 9,
|
|
||||||
FIND_ID_ERROR = 10,
|
|
||||||
INSERT_ID_ERROR = 11,
|
|
||||||
EPSGCODE_NOTSAME = 12,
|
|
||||||
EPSGCODE_NOTSUPPORT = 13,
|
|
||||||
RASTERBAND_NOTEQUAL = 14,
|
|
||||||
RASTER_DATETYPE_NOTSAME = 15,
|
|
||||||
//GSL 1xx
|
|
||||||
Error_GSL_FAILURE = -101,
|
|
||||||
Error_GSL_CONTINUE = -102, /* iteration has not converged */
|
|
||||||
Error_GSL_EDOM = 101, /* input domain error, e.g sqrt(-1) */
|
|
||||||
Error_GSL_ERANGE = 102, /* output range error, e.g. exp(1e100) */
|
|
||||||
Error_GSL_EFAULT = 103, /* invalid pointer */
|
|
||||||
Error_GSL_EINVAL = 104, /* invalid argument supplied by user */
|
|
||||||
Error_GSL_EFAILED = 105, /* generic failure */
|
|
||||||
Error_GSL_EFACTOR = 106, /* factorization failed */
|
|
||||||
Error_GSL_ESANITY = 107, /* sanity check failed - shouldn't happen */
|
|
||||||
Error_GSL_ENOMEM = 108, /* malloc failed */
|
|
||||||
Error_GSL_EBADFUNC = 109, /* problem with user-supplied function */
|
|
||||||
Error_GSL_ERUNAWAY = 110, /* iterative process is out of control */
|
|
||||||
Error_GSL_EMAXITER = 111, /* exceeded max number of iterations */
|
|
||||||
Error_GSL_EZERODIV = 112, /* tried to divide by zero */
|
|
||||||
Error_GSL_EBADTOL = 113, /* user specified an invalid tolerance */
|
|
||||||
Error_GSL_ETOL = 114, /* failed to reach the specified tolerance */
|
|
||||||
Error_GSL_EUNDRFLW = 115, /* underflow */
|
|
||||||
Error_GSL_EOVRFLW = 116, /* overflow */
|
|
||||||
Error_GSL_ELOSS = 117, /* loss of accuracy */
|
|
||||||
Error_GSL_EROUND = 118, /* failed because of roundoff error */
|
|
||||||
Error_GSL_EBADLEN = 119, /* matrix, vector lengths are not conformant */
|
|
||||||
Error_GSL_ENOTSQR = 120, /* matrix not square */
|
|
||||||
Error_GSL_ESING = 121, /* apparent singularity detected */
|
|
||||||
Error_GSL_EDIVERGE = 122, /* integral or series is divergent */
|
|
||||||
Error_GSL_EUNSUP = 123, /* requested feature is not supported by the hardware */
|
|
||||||
Error_GSL_EUNIMPL = 124, /* requested feature not (yet) implemented */
|
|
||||||
Error_GSL_ECACHE = 125, /* cache limit exceeded */
|
|
||||||
Error_GSL_ETABLE = 126, /* table limit exceeded */
|
|
||||||
Error_GSL_ENOPROG = 127, /* iteration is not making progress towards solution */
|
|
||||||
Error_GSL_ENOPROGJ = 128, /* jacobian evaluations are not improving the solution */
|
|
||||||
Error_GSL_ETOLF = 129, /* cannot reach the specified tolerance in F */
|
|
||||||
Error_GSL_ETOLX = 130, /* cannot reach the specified tolerance in X */
|
|
||||||
Error_GSL_ETOLG = 131, /* cannot reach the specified tolerance in gradient */
|
|
||||||
Error_GSL_EOF = 132, /* end of file */
|
|
||||||
|
|
||||||
// RFPC
|
|
||||||
RFPC_PARAMSISEMPTY = 201,
|
|
||||||
// L0 数据
|
|
||||||
ECHO_L0DATA_NOTOPEN = 202,
|
|
||||||
ECHO_L0DATA_ROW_COL_NOEQUAL = 203, // 行或者列数量错误
|
|
||||||
ECHO_L0DATA_PRFIDXOUTRANGE = 204, // PRF 索引超出范围
|
|
||||||
ECHO_L0DATA_GPSFILEFORMATERROR = 205, // GPS文件错误
|
|
||||||
ECHO_L0DATA_ECHOFILEFORMATERROR = 206, // 回波文件格式错误
|
|
||||||
ECHO_L0DATA_ECHOFILENOTOPEN = 207, // 回波文件打开错误
|
|
||||||
ECHO_L0DATA_GPSFILEFNOTOPEN = 208, // GPS文件打开错误
|
|
||||||
ECHO_L0DATA_XMLFILENOTOPEN = 209, // xml文件打开错误
|
|
||||||
OUTOFRANGE = 210, // 超出范围
|
|
||||||
ECHO_L0DATA_XMLNAMEERROR = 211, // 超出范围
|
|
||||||
// BP成像
|
|
||||||
TBP_L0OPENFAIL = 301, // 0级文件打开错误
|
|
||||||
|
|
||||||
// L1图像
|
|
||||||
IMAGE_L1DATA_XMLNAMEERROR = 401,
|
|
||||||
IMAGE_L1DATA_XMLNAMEOPENERROR = 402,
|
|
||||||
IMAGE_L1DATA_XMLNAMEPARASEERROR = 403,
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::string BASECONSTVARIABLEAPI errorCode2errInfo(ErrorCode code);
|
|
||||||
|
|
||||||
|
|
||||||
ErrorCode BASECONSTVARIABLEAPI GSLState2ErrorCode(int gslState);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,488 +0,0 @@
|
||||||
#include "stdafx.h"
|
|
||||||
#include "ImageOperatorBase.h"
|
|
||||||
#include "BaseTool.h"
|
|
||||||
#include "GeoOperator.h"
|
|
||||||
#include <Eigen/Core>
|
|
||||||
#include <Eigen/Dense>
|
|
||||||
#include <omp.h>
|
|
||||||
#include <io.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <gdal.h>
|
|
||||||
#include <gdal_utils.h>
|
|
||||||
#include <gdal_priv.h>
|
|
||||||
#include <gdalwarper.h>
|
|
||||||
#include <proj.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <memory>
|
|
||||||
#include <iostream>
|
|
||||||
#include "FileOperator.h"
|
|
||||||
#include <opencv2/opencv.hpp>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QDir>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <QProgressDialog>
|
|
||||||
#include <gdal_priv.h>
|
|
||||||
#include <ogr_spatialref.h> // OGRSpatialReference 用于空间参考转换
|
|
||||||
#include <gdal_alg.h> // 用于 GDALWarp 操作
|
|
||||||
|
|
||||||
ErrorCode MergeRasterProcess(QVector<QString> filepaths, QString outfileptah, QString mainString, MERGEMODE mergecode, bool isENVI, ShowProessAbstract* dia)
|
|
||||||
{
|
|
||||||
// 参数检查
|
|
||||||
if (!isExists(mainString)) {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::FILENOFOUND)) << "\t" << mainString;
|
|
||||||
return ErrorCode::FILENOFOUND;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
gdalImage mainimg(mainString);
|
|
||||||
QVector<gdalImage> imgdslist(filepaths.count());
|
|
||||||
for (long i = 0; i < filepaths.count(); i++) {
|
|
||||||
if (!isExists(filepaths[i])) {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::FILENOFOUND)) << "\t" << filepaths[i];
|
|
||||||
return ErrorCode::FILENOFOUND;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
imgdslist[i] = gdalImage(filepaths[i]);
|
|
||||||
if (imgdslist[i].band_num != mainimg.band_num) {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::RASTERBAND_NOTEQUAL)) << "\t" << imgdslist[i].band_num << " != " << mainimg.band_num;
|
|
||||||
return ErrorCode::RASTERBAND_NOTEQUAL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查坐标系是否统一
|
|
||||||
long EPSGCode = GetEPSGFromRasterFile(mainString);
|
|
||||||
long tempCode = 0;
|
|
||||||
for (long i = 0; i < filepaths.count(); i++) {
|
|
||||||
tempCode = GetEPSGFromRasterFile(filepaths[i]);
|
|
||||||
if (EPSGCode != tempCode) {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::EPSGCODE_NOTSAME)) << "\t" << EPSGCode << "!=" << tempCode;
|
|
||||||
return ErrorCode::EPSGCODE_NOTSAME;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查影像类型是否统一
|
|
||||||
GDALDataType mainType = mainimg.getDataType();
|
|
||||||
for (long i = 0; i < imgdslist.count(); i++) {
|
|
||||||
if (mainType != imgdslist[i].getDataType()) {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::RASTER_DATETYPE_NOTSAME)) << "\t" << mainType << "!=" << imgdslist[i].getDataType();
|
|
||||||
return ErrorCode::RASTER_DATETYPE_NOTSAME;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Eigen::MatrixXd maingt = mainimg.getGeoTranslation();
|
|
||||||
Eigen::MatrixXd rgt = Eigen::MatrixXd::Zero(2, 3);
|
|
||||||
RasterExtend mainExtend = mainimg.getExtend();
|
|
||||||
rgt(0, 1) = (mainExtend.max_x - mainExtend.min_x) / (mainimg.width - 1); //dx
|
|
||||||
rgt(1, 2) = -1 * std::abs(((mainExtend.max_y - mainExtend.min_y) / (mainimg.height - 1)));//dy
|
|
||||||
QVector<RasterExtend> extendlist(imgdslist.count());
|
|
||||||
for (long i = 0; i < imgdslist.count(); i++) {
|
|
||||||
extendlist[i] = imgdslist[i].getExtend();
|
|
||||||
mainExtend.min_x = mainExtend.min_x < extendlist[i].min_x ? mainExtend.min_x : extendlist[i].min_x;
|
|
||||||
mainExtend.max_x = mainExtend.max_x > extendlist[i].max_x ? mainExtend.max_x : extendlist[i].max_x;
|
|
||||||
mainExtend.min_y = mainExtend.min_y < extendlist[i].min_y ? mainExtend.min_y : extendlist[i].min_y;
|
|
||||||
mainExtend.max_y = mainExtend.max_y > extendlist[i].max_y ? mainExtend.max_y : extendlist[i].max_y;
|
|
||||||
}
|
|
||||||
|
|
||||||
rgt(0, 0) = mainExtend.min_x;
|
|
||||||
rgt(1, 0) = mainExtend.max_y;
|
|
||||||
|
|
||||||
// 计算数量
|
|
||||||
|
|
||||||
long width = std::ceil((mainExtend.max_x - mainExtend.min_x) / rgt(0, 1) + 1);
|
|
||||||
long height = std::ceil(std::abs((mainExtend.min_y - mainExtend.max_y) / rgt(1, 2)) + 1);
|
|
||||||
OGRSpatialReference oSRS;
|
|
||||||
if (oSRS.importFromEPSG(EPSGCode) != OGRERR_NONE) {
|
|
||||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::EPSGCODE_NOTSUPPORT)) << "\t" << EPSGCode;
|
|
||||||
return ErrorCode::EPSGCODE_NOTSUPPORT;
|
|
||||||
}
|
|
||||||
|
|
||||||
gdalImage resultImage = CreategdalImage(outfileptah, height, width, mainimg.band_num, rgt, EPSGCode, mainType, true, true, isENVI);
|
|
||||||
|
|
||||||
QString resultMaskString = addMaskToFileName(outfileptah, QString("_MASK"));
|
|
||||||
gdalImage maskImage = CreategdalImage(resultMaskString, height, width, 1, rgt, EPSGCode, GDT_Int32, true, true, isENVI);
|
|
||||||
|
|
||||||
// 初始化
|
|
||||||
long resultline = Memory1MB * 500 / 8 / resultImage.width;
|
|
||||||
resultline = resultline < 10000 ? resultline : 10000; // 最多100行
|
|
||||||
resultline = resultline > 0 ? resultline : 2;
|
|
||||||
long bandnum = resultImage.band_num + 1;
|
|
||||||
long starti = 0;
|
|
||||||
long rasterCount = imgdslist.count();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QProgressDialog progressDialog(u8"初始化影像", u8"终止", 0, resultImage.height);
|
|
||||||
progressDialog.setWindowTitle(u8"初始化影像");
|
|
||||||
progressDialog.setWindowModality(Qt::WindowModal);
|
|
||||||
progressDialog.setAutoClose(true);
|
|
||||||
progressDialog.setValue(0);
|
|
||||||
progressDialog.setMaximum(resultImage.height);
|
|
||||||
progressDialog.setMinimum(0);
|
|
||||||
progressDialog.show();
|
|
||||||
|
|
||||||
|
|
||||||
for (starti = 0; starti < resultImage.height; starti = starti + resultline) {
|
|
||||||
long blocklines = resultline;
|
|
||||||
blocklines = starti + blocklines < resultImage.height ? blocklines : resultImage.height - starti;
|
|
||||||
for (long b = 1; b < bandnum; b++) {
|
|
||||||
Eigen::MatrixXd data = resultImage.getData(starti, 0, blocklines, resultImage.width, b);
|
|
||||||
Eigen::MatrixXi maskdata = maskImage.getDatai(starti, 0, blocklines, resultImage.width, b);
|
|
||||||
data = data.array() * 0;
|
|
||||||
maskdata = maskdata.array() * 0;
|
|
||||||
resultImage.saveImage(data, starti, 0, b);
|
|
||||||
maskImage.saveImage(maskdata, starti, 0, b);
|
|
||||||
}
|
|
||||||
if (nullptr != dia) {
|
|
||||||
dia->showProcess(starti * 1.0 / resultImage.height, u8"初始化影像数据");
|
|
||||||
}
|
|
||||||
progressDialog.setValue(starti + blocklines);
|
|
||||||
}
|
|
||||||
progressDialog.close();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
switch (mergecode)
|
|
||||||
{
|
|
||||||
case MERGE_GEOCODING:
|
|
||||||
return MergeRasterInGeoCoding(imgdslist, resultImage, maskImage, dia);
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return ErrorCode::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
ErrorCode MergeRasterInGeoCoding(QVector<gdalImage> imgdslist, gdalImage resultimg, gdalImage maskimg, ShowProessAbstract* dia)
|
|
||||||
{
|
|
||||||
omp_set_num_threads(Paral_num_thread);
|
|
||||||
// 逐点合并计算
|
|
||||||
QVector<RasterExtend> extendlist(imgdslist.count());
|
|
||||||
for (long i = 0; i < imgdslist.count(); i++) {
|
|
||||||
extendlist[i] = imgdslist[i].getExtend();
|
|
||||||
imgdslist[i].InitInv_gt();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分块计算
|
|
||||||
long resultline = Memory1MB * 1000 / 8 / resultimg.width;
|
|
||||||
resultline = resultline < 300 ? resultline : 300; // 最多100行
|
|
||||||
|
|
||||||
long bandnum = resultimg.band_num + 1;
|
|
||||||
long starti = 0;
|
|
||||||
long rasterCount = imgdslist.count();
|
|
||||||
|
|
||||||
long processNumber = 0;
|
|
||||||
QProgressDialog progressDialog(u8"合并影像", u8"终止", 0, resultimg.height);
|
|
||||||
progressDialog.setWindowTitle(u8"合并影像");
|
|
||||||
progressDialog.setWindowModality(Qt::WindowModal);
|
|
||||||
progressDialog.setAutoClose(true);
|
|
||||||
progressDialog.setValue(0);
|
|
||||||
progressDialog.setMaximum(resultimg.height);
|
|
||||||
progressDialog.setMinimum(0);
|
|
||||||
progressDialog.show();
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
|
|
||||||
#pragma omp parallel for
|
|
||||||
for (starti = 0; starti < resultimg.height; starti = starti + resultline) {
|
|
||||||
long blocklines = resultline;
|
|
||||||
blocklines = starti + blocklines < resultimg.height ? blocklines : resultimg.height - starti;
|
|
||||||
|
|
||||||
long rid = starti;
|
|
||||||
long cid = 0;
|
|
||||||
|
|
||||||
Landpoint pp = { 0,0,0 };
|
|
||||||
Landpoint lp = { 0,0,0 };
|
|
||||||
|
|
||||||
for (long ir = 0; ir < rasterCount; ir++) {// 影像
|
|
||||||
long minRid = imgdslist[ir].height;
|
|
||||||
long maxRid = 0;
|
|
||||||
|
|
||||||
Eigen::MatrixXd ridlist = resultimg.getData(starti, 0, blocklines, resultimg.width, 1);
|
|
||||||
ridlist = ridlist.array() * 0;
|
|
||||||
Eigen::MatrixXd cidlist = ridlist.array() * 0;
|
|
||||||
|
|
||||||
for (long i = 0; i < blocklines; i++) {// 行号
|
|
||||||
rid = starti + i;
|
|
||||||
for (long j = 0; j < resultimg.width; j++) {// 列号
|
|
||||||
cid = j;
|
|
||||||
resultimg.getLandPoint(rid, cid, 0, pp);
|
|
||||||
lp = imgdslist[ir].getRow_Col(pp.lon, pp.lat); // 获取点坐标
|
|
||||||
ridlist(i, j) = lp.lat;
|
|
||||||
cidlist(i, j) = lp.lon;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//ImageShowDialogClass* dialog = new ImageShowDialogClass;
|
|
||||||
//dialog->show();
|
|
||||||
//dialog->load_double_MatrixX_data(cidlist, u8"");
|
|
||||||
|
|
||||||
//dialog->exec();
|
|
||||||
|
|
||||||
|
|
||||||
if (ridlist.maxCoeff() < 0 || ridlist.minCoeff() >= imgdslist[ir].height) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cidlist.maxCoeff() < 0 || cidlist.minCoeff() >= imgdslist[ir].width) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
minRid = std::floor(ridlist.minCoeff());
|
|
||||||
maxRid = std::ceil(ridlist.maxCoeff());
|
|
||||||
minRid = minRid < 0 ? 0 : minRid;
|
|
||||||
maxRid = maxRid < imgdslist[ir].height ? maxRid : imgdslist[ir].height - 1;
|
|
||||||
|
|
||||||
long rowlen = maxRid - minRid + 1;
|
|
||||||
if (rowlen <= 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// 获取分配代码
|
|
||||||
Landpoint p0{ 0,0,0 }, p11{ 0,0,0 }, p21{ 0,0,0 }, p12{ 0,0,0 }, p22{ 0,0,0 }, p{ 0,0,0 };
|
|
||||||
|
|
||||||
|
|
||||||
long rowcount = 0;
|
|
||||||
long colcount = 0;
|
|
||||||
double ridtemp = 0, cidtemp = 0;
|
|
||||||
|
|
||||||
long lastr = 0, nextr = 0;
|
|
||||||
long lastc = 0, nextc = 0;
|
|
||||||
|
|
||||||
double r0 = 0, c0 = 0;
|
|
||||||
|
|
||||||
for (long b = 1; b < bandnum; b++) {
|
|
||||||
Eigen::MatrixXd resultdata = resultimg.getData(starti, 0, blocklines, resultimg.width, b);
|
|
||||||
Eigen::MatrixXi resultmask = maskimg.getDatai(starti, 0, blocklines, resultimg.width, b);
|
|
||||||
Eigen::MatrixXd data = imgdslist[ir].getData(minRid, 0, rowlen, imgdslist[ir].width, b);
|
|
||||||
|
|
||||||
double nodata = imgdslist[ir].getNoDataValue(b);
|
|
||||||
for (long ii = 0; ii < data.rows(); ii++) {
|
|
||||||
for (long jj = 0; jj < data.cols(); jj++) {
|
|
||||||
if (std::abs(data(ii, jj) - nodata) < 1e-6) {
|
|
||||||
data(ii, jj) = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rowcount = ridlist.rows();
|
|
||||||
colcount = ridlist.cols();
|
|
||||||
double Bileanervalue = 0;
|
|
||||||
for (long i = 0; i < rowcount; i++) {
|
|
||||||
for (long j = 0; j < colcount; j++) {
|
|
||||||
ridtemp = ridlist(i, j);
|
|
||||||
cidtemp = cidlist(i, j);
|
|
||||||
|
|
||||||
lastr = std::floor(ridtemp);
|
|
||||||
nextr = std::ceil(ridtemp);
|
|
||||||
lastc = std::floor(cidtemp);
|
|
||||||
nextc = std::ceil(cidtemp);
|
|
||||||
|
|
||||||
if (lastr < 0 || lastr >= imgdslist[ir].height
|
|
||||||
|| nextr < 0 || nextr >= imgdslist[ir].height
|
|
||||||
|| lastc < 0 || lastc >= imgdslist[ir].width
|
|
||||||
|| nextc < 0 || nextc >= imgdslist[ir].width) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
|
|
||||||
r0 = ridtemp - std::floor(ridtemp);
|
|
||||||
c0 = cidtemp - std::floor(cidtemp);
|
|
||||||
|
|
||||||
lastr = lastr - minRid;
|
|
||||||
nextr = nextr - minRid;
|
|
||||||
|
|
||||||
p0 = Landpoint{ c0,r0,0 };
|
|
||||||
p11 = Landpoint{ 0,0,data(lastr,lastc) };
|
|
||||||
p21 = Landpoint{ 0,1,data(nextr,lastc) };
|
|
||||||
p12 = Landpoint{ 1,0,data(lastr,nextc) };
|
|
||||||
p22 = Landpoint{ 1,1,data(nextr,nextc) };
|
|
||||||
Bileanervalue = Bilinear_interpolation(p0, p11, p21, p12, p22);
|
|
||||||
if (std::abs(Bileanervalue) < 1e-6 || resultmask(i, j) > 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
resultdata(i, j) = resultdata(i, j) + Bileanervalue;
|
|
||||||
resultmask(i, j) = resultmask(i, j) + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
resultimg.saveImage(resultdata, starti, 0, b);
|
|
||||||
maskimg.saveImage(resultmask, starti, 0, b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
processNumber = processNumber + blocklines;
|
|
||||||
qDebug() << "\rprocess bar:\t" << processNumber * 100.0 / resultimg.height << " % " << "\t\t\t";
|
|
||||||
if (nullptr != dia) {
|
|
||||||
dia->showProcess(processNumber * 1.0 / resultimg.height, u8"合并图像");
|
|
||||||
}
|
|
||||||
if (progressDialog.maximum() <= processNumber) {
|
|
||||||
processNumber = progressDialog.maximum() - 1;
|
|
||||||
}
|
|
||||||
progressDialog.setValue(processNumber);
|
|
||||||
omp_unset_lock(&lock);
|
|
||||||
}
|
|
||||||
omp_destroy_lock(&lock);
|
|
||||||
|
|
||||||
progressDialog.setWindowTitle(u8"影像掩膜");
|
|
||||||
progressDialog.setLabelText(u8"影像掩膜");
|
|
||||||
for (starti = 0; starti < resultimg.height; starti = starti + resultline) {
|
|
||||||
long blocklines = resultline;
|
|
||||||
blocklines = starti + blocklines < resultimg.height ? blocklines : resultimg.height - starti;
|
|
||||||
for (long b = 1; b < bandnum; b++) {
|
|
||||||
Eigen::MatrixXd data = resultimg.getData(starti, 0, blocklines, resultimg.width, b);
|
|
||||||
Eigen::MatrixXd maskdata = maskimg.getData(starti, 0, blocklines, maskimg.width, b);
|
|
||||||
|
|
||||||
for (long i = 0; i < data.rows(); i++) {
|
|
||||||
for (long j = 0; j < data.cols(); j++) {
|
|
||||||
if (maskdata(i, j) == 0) {
|
|
||||||
data(i, j) = -9999;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
data(i, j) = data(i, j) / maskdata(i, j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resultimg.saveImage(data, starti, 0, b);
|
|
||||||
maskimg.saveImage(maskdata, starti, 0, b);
|
|
||||||
}
|
|
||||||
if (nullptr != dia) {
|
|
||||||
dia->showProcess((starti + blocklines) * 1.0 / resultimg.height, u8"影像掩膜");
|
|
||||||
}
|
|
||||||
progressDialog.setValue(starti + blocklines);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
progressDialog.close();
|
|
||||||
return ErrorCode::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MergeTiffs(QList<QString> inputFiles, QString outputFile) {
|
|
||||||
GDALAllRegister();
|
|
||||||
|
|
||||||
if (inputFiles.isEmpty()) {
|
|
||||||
fprintf(stderr, "No input files provided.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Open the first file to determine the data type and coordinate system
|
|
||||||
GDALDataset* poFirstDS = (GDALDataset*)GDALOpen(inputFiles.first().toUtf8().constData(), GA_ReadOnly);
|
|
||||||
if (poFirstDS == nullptr) {
|
|
||||||
fprintf(stderr, "Failed to open the first file %s\n", inputFiles.first().toUtf8().constData());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
double adfGeoTransform[6];
|
|
||||||
CPLErr eErr = poFirstDS->GetGeoTransform(adfGeoTransform);
|
|
||||||
if (eErr != CE_None) {
|
|
||||||
fprintf(stderr, "Failed to get GeoTransform for the first file %s\n", inputFiles.first().toUtf8().constData());
|
|
||||||
GDALClose(poFirstDS);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int nXSize = 0;
|
|
||||||
int nYSize = 0;
|
|
||||||
double minX = std::numeric_limits<double>::max();
|
|
||||||
double minY = std::numeric_limits<double>::max();
|
|
||||||
double maxX = std::numeric_limits<double>::lowest();
|
|
||||||
double maxY = std::numeric_limits<double>::lowest();
|
|
||||||
double pixelWidth = adfGeoTransform[1];
|
|
||||||
double pixelHeight = adfGeoTransform[5];
|
|
||||||
|
|
||||||
// Determine the bounding box and size of the output raster
|
|
||||||
for (const QString& inputFile : inputFiles) {
|
|
||||||
GDALDataset* poSrcDS = (GDALDataset*)GDALOpen(inputFile.toUtf8().constData(), GA_ReadOnly);
|
|
||||||
if (poSrcDS == nullptr) {
|
|
||||||
fprintf(stderr, "Failed to open %s\n", inputFile.toUtf8().constData());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
double adfThisTransform[6];
|
|
||||||
eErr = poSrcDS->GetGeoTransform(adfThisTransform);
|
|
||||||
if (eErr != CE_None) {
|
|
||||||
fprintf(stderr, "Failed to get GeoTransform for %s\n", inputFile.toUtf8().constData());
|
|
||||||
GDALClose(poSrcDS);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
minX = std::min(minX, adfThisTransform[0]);
|
|
||||||
minY = std::min(minY, adfThisTransform[3] + adfThisTransform[5] * poSrcDS->GetRasterYSize());
|
|
||||||
maxX = std::max(maxX, adfThisTransform[0] + adfThisTransform[1] * poSrcDS->GetRasterXSize());
|
|
||||||
maxY = std::max(maxY, adfThisTransform[3]);
|
|
||||||
|
|
||||||
GDALClose(poSrcDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
nXSize = static_cast<int>(std::ceil((maxX - minX) / pixelWidth));
|
|
||||||
nYSize = static_cast<int>(std::ceil((maxY - minY) / (-pixelHeight)));
|
|
||||||
|
|
||||||
GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("GTiff");
|
|
||||||
if (poDriver == nullptr) {
|
|
||||||
fprintf(stderr, "GTiff driver not available.\n");
|
|
||||||
GDALClose(poFirstDS);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
char** papszOptions = nullptr;
|
|
||||||
GDALDataset* poDstDS = poDriver->Create(outputFile.toUtf8().constData(), nXSize, nYSize, 1, poFirstDS->GetRasterBand(1)->GetRasterDataType(), papszOptions);
|
|
||||||
if (poDstDS == nullptr) {
|
|
||||||
fprintf(stderr, "Creation of output file failed.\n");
|
|
||||||
GDALClose(poFirstDS);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
poDstDS->SetGeoTransform(adfGeoTransform);
|
|
||||||
|
|
||||||
const OGRSpatialReference* oSRS = poFirstDS->GetSpatialRef();
|
|
||||||
poDstDS->SetSpatialRef(oSRS);
|
|
||||||
|
|
||||||
float fillValue = std::numeric_limits<float>::quiet_NaN();
|
|
||||||
void* pafScanline = CPLMalloc(GDALGetDataTypeSizeBytes(poFirstDS->GetRasterBand(1)->GetRasterDataType()) * nXSize);
|
|
||||||
memset(pafScanline, 0, GDALGetDataTypeSizeBytes(poFirstDS->GetRasterBand(1)->GetRasterDataType()) * nXSize);
|
|
||||||
|
|
||||||
// Initialize all pixels to NaN
|
|
||||||
for (int iY = 0; iY < nYSize; ++iY) {
|
|
||||||
GDALRasterBand* poBand = poDstDS->GetRasterBand(1);
|
|
||||||
poBand->RasterIO(GF_Write, 0, iY, nXSize, 1, pafScanline, nXSize, 1, poFirstDS->GetRasterBand(1)->GetRasterDataType(), 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
CPLFree(pafScanline);
|
|
||||||
|
|
||||||
// Read each source image and write into the destination image
|
|
||||||
for (const QString& inputFile : inputFiles) {
|
|
||||||
GDALDataset* poSrcDS = (GDALDataset*)GDALOpen(inputFile.toUtf8().constData(), GA_ReadOnly);
|
|
||||||
if (poSrcDS == nullptr) {
|
|
||||||
fprintf(stderr, "Failed to open %s\n", inputFile.toUtf8().constData());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
double adfThisTransform[6];
|
|
||||||
poSrcDS->GetGeoTransform(adfThisTransform);
|
|
||||||
|
|
||||||
int srcXSize = poSrcDS->GetRasterXSize();
|
|
||||||
int srcYSize = poSrcDS->GetRasterYSize();
|
|
||||||
|
|
||||||
int dstXOffset = static_cast<int>(std::round((adfThisTransform[0] - minX) / pixelWidth));
|
|
||||||
int dstYOffset = static_cast<int>(std::round((maxY - adfThisTransform[3]) / (-pixelHeight)));
|
|
||||||
|
|
||||||
GDALRasterBand* poSrcBand = poSrcDS->GetRasterBand(1);
|
|
||||||
GDALRasterBand* poDstBand = poDstDS->GetRasterBand(1);
|
|
||||||
|
|
||||||
void* pafBuffer = CPLMalloc(GDALGetDataTypeSizeBytes(poFirstDS->GetRasterBand(1)->GetRasterDataType()) * srcXSize * srcYSize);
|
|
||||||
poSrcBand->RasterIO(GF_Read, 0, 0, srcXSize, srcYSize, pafBuffer, srcXSize, srcYSize, poFirstDS->GetRasterBand(1)->GetRasterDataType(), 0, 0);
|
|
||||||
|
|
||||||
poDstBand->RasterIO(GF_Write, dstXOffset, dstYOffset, srcXSize, srcYSize, pafBuffer, srcXSize, srcYSize, poFirstDS->GetRasterBand(1)->GetRasterDataType(), 0, 0);
|
|
||||||
|
|
||||||
CPLFree(pafBuffer);
|
|
||||||
GDALClose(poSrcDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
GDALClose(poDstDS);
|
|
||||||
GDALClose(poFirstDS);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
#include "PrintMsgToQDebug.h"
|
|
||||||
#include <QDebug>
|
|
||||||
BASECONSTVARIABLEAPI void PrintMsgToQDebug(char* msg)
|
|
||||||
{
|
|
||||||
qDebug() << QString(msg);
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
|
|
||||||
BASECONSTVARIABLEAPI void PrintfToQDebug(const char* msg)
|
|
||||||
{
|
|
||||||
qDebug() << QString(msg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BASECONSTVARIABLEAPI void PrintTipMsgToQDebug(const char* tip, const char* msg)
|
|
||||||
{
|
|
||||||
qDebug() <<QString(tip)<<"\t:\t" << QString(msg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 自定义的 printf 风格函数
|
|
||||||
BASECONSTVARIABLEAPI void printfinfo(const char* format, ...) {
|
|
||||||
char buffer[256]; // 假设最大输出长度为 256 字节
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
// 使用 va_start 获取可变参数列表
|
|
||||||
va_start(args, format);
|
|
||||||
|
|
||||||
// 使用 vsnprintf 将格式化字符串写入 buffer
|
|
||||||
vsnprintf(buffer, sizeof(buffer), format, args);
|
|
||||||
|
|
||||||
// 结束可变参数列表的使用
|
|
||||||
va_end(args);
|
|
||||||
|
|
||||||
// 将格式化后的字符串转发给 PrintfToQDebug
|
|
||||||
PrintfToQDebug(buffer);
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#ifndef PRINTMSGTOQDEBUG_H_
|
|
||||||
#define PRINTMSGTOQDEBUG_H_
|
|
||||||
#include "BaseConstVariable.h"
|
|
||||||
#include <format>
|
|
||||||
extern "C" BASECONSTVARIABLEAPI void PrintMsgToQDebug(char* msg);
|
|
||||||
extern "C" BASECONSTVARIABLEAPI void PrintfToQDebug(const char* msg);
|
|
||||||
extern "C" BASECONSTVARIABLEAPI void PrintTipMsgToQDebug(const char* tip, const char* msg);
|
|
||||||
extern "C" BASECONSTVARIABLEAPI void printfinfo(const char* format, ...);
|
|
||||||
#endif // !PRINTMSGTOQDEBUG_H_
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
#include "QToolProcessBarDialog.h"
|
|
||||||
#include "ui_QToolProcessBarDialog.h"
|
|
||||||
|
|
||||||
QToolProcessBarDialog::QToolProcessBarDialog(QWidget *parent)
|
|
||||||
: ui(new Ui::QToolProcessBarDialogClass), QDialog(parent)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
ui->progressBar->setRange(0, 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
QToolProcessBarDialog::~QToolProcessBarDialog()
|
|
||||||
{}
|
|
||||||
|
|
||||||
void QToolProcessBarDialog::showProcess(double precent, QString tip)
|
|
||||||
{
|
|
||||||
ui->progressBar->setValue(std::ceil(precent * 100));
|
|
||||||
ui->labelTip->setText(tip);
|
|
||||||
this->update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QToolProcessBarDialog::showToolInfo(QString tip)
|
|
||||||
{
|
|
||||||
ui->textEditTip->append("\n"+tip);
|
|
||||||
}
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include "BaseConstVariable.h"
|
|
||||||
#include <QDialog>
|
|
||||||
|
|
||||||
#include "ImageOperatorBase.h"
|
|
||||||
|
|
||||||
namespace Ui {
|
|
||||||
class QToolProcessBarDialogClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
class BASECONSTVARIABLEAPI QToolProcessBarDialog : public QDialog, public ShowProessAbstract
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
QToolProcessBarDialog(QWidget *parent = nullptr);
|
|
||||||
~QToolProcessBarDialog();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::QToolProcessBarDialogClass* ui;
|
|
||||||
public:
|
|
||||||
virtual void showProcess(double precent, QString tip) override;
|
|
||||||
virtual void showToolInfo(QString tip) override;
|
|
||||||
};
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>QToolProcessBarDialogClass</class>
|
|
||||||
<widget class="QDialog" name="QToolProcessBarDialogClass">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>600</width>
|
|
||||||
<height>400</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>QToolProcessBarDialog</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="widget" native="true">
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QPushButton" name="OKpushButton">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>120</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>120</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>退出</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="labelTip">
|
|
||||||
<property name="text">
|
|
||||||
<string>提示</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="2">
|
|
||||||
<widget class="QProgressBar" name="progressBar">
|
|
||||||
<property name="value">
|
|
||||||
<number>24</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QTextEdit" name="textEditTip"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
|
|
@ -1,276 +0,0 @@
|
||||||
/**
|
|
||||||
* @file RasterProjectBase.cpp
|
|
||||||
* @brief None
|
|
||||||
* @author 陈增辉 (3045316072@qq.com)
|
|
||||||
* @version 2.5.0
|
|
||||||
* @date 24-6-4
|
|
||||||
* @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include "RasterToolBase.h"
|
|
||||||
#include "gdal_priv.h"
|
|
||||||
#include "ogr_spatialref.h"
|
|
||||||
#include "cpl_conv.h" // for CPLMalloc()
|
|
||||||
#include <QTextCodec>
|
|
||||||
#include <iostream>
|
|
||||||
#include <QFile>
|
|
||||||
#include "SARSimulationImageL1.h"
|
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
namespace RasterToolBase {
|
|
||||||
long getProjectEPSGCodeByLon_Lat(double lon, double lat, ProjectStripDelta stripState)
|
|
||||||
{
|
|
||||||
long EPSGCode = 0;
|
|
||||||
switch(stripState) {
|
|
||||||
case ProjectStripDelta::Strip_3: {
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
case ProjectStripDelta::Strip_6: {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
EPSGCode = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
qDebug() << QString(" EPSG code : %1").arg(EPSGCode);
|
|
||||||
return EPSGCode;
|
|
||||||
}
|
|
||||||
long getProjectEPSGCodeByLon_Lat_inStrip3(double lon, double lat)
|
|
||||||
{
|
|
||||||
// EPSG 4534 ~ 4554 3 度带
|
|
||||||
// 首先判断是否是在 中国带宽范围
|
|
||||||
// 中心经度范围 :75E ~ 135E 实际范围 73.5E ~ 136.5E,
|
|
||||||
// 纬度范围 3N ~ 54N,放宽到 0N~ 60N
|
|
||||||
if(73.5 <= lon && lon <= 136.5 && 0 <= lat && lat <= 60) { // 中国境内
|
|
||||||
long code = trunc((lon - 73.5) / 3) + 4534;
|
|
||||||
return code;
|
|
||||||
} else { // 非中国境内 使用 高斯克吕格
|
|
||||||
bool isSouth = lat < 0; // 简单判断南北半球,这里仅为示例,实际应用可能需要更细致的逻辑
|
|
||||||
long prefix = isSouth ? 327000 : 326000;
|
|
||||||
// std::string prefix = isSouth ? "327" : "326";
|
|
||||||
lon = fmod(lon + 360.0, 360.0);
|
|
||||||
long zone = std::floor((lon + 180.0) / 3.0);
|
|
||||||
prefix = prefix + zone;
|
|
||||||
return prefix;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
long getProjectEPSGCodeByLon_Lat_inStrip6(double lon, double lat)
|
|
||||||
{
|
|
||||||
// EPSG 4502 ~ 4512 6度带
|
|
||||||
// 首先判断是否是在 中国带宽范围
|
|
||||||
// 中心经度范围 :75E ~ 135E 实际范围 72.0E ~ 138E,
|
|
||||||
// 纬度范围 3N ~ 54N,放宽到 0N~ 60N
|
|
||||||
if(73.5 <= lon && lon <= 136.5 && 0 <= lat && lat <= 60) { // 中国境内
|
|
||||||
long code = trunc((lon - 72.0) / 6) + 4502;
|
|
||||||
return code;
|
|
||||||
} else { // 非中国境内 使用 UTM// 确定带号,6度带从1开始到60,每6度一个带
|
|
||||||
int zone = static_cast<int>((lon + 180.0) / 6.0) + 1;
|
|
||||||
bool isSouth = lon < 0; // 判断是否在南半球
|
|
||||||
long epsgCodeBase = isSouth ? 32700 : 32600; // 计算EPSG代码
|
|
||||||
long prefix = static_cast<int>(epsgCodeBase + zone);
|
|
||||||
return prefix;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString GetProjectionNameFromEPSG(long epsgCode)
|
|
||||||
{
|
|
||||||
qDebug() << "============= GetProjectionNameFromEPSG ======================";
|
|
||||||
OGRSpatialReference oSRS;
|
|
||||||
|
|
||||||
// 设置EPSG代码
|
|
||||||
if(oSRS.importFromEPSG(epsgCode) != OGRERR_NONE) {
|
|
||||||
qDebug() << "epsgcode not recognition";
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取并输出坐标系的描述(名称)
|
|
||||||
const char* pszName = oSRS.GetAttrValue("GEOGCS");
|
|
||||||
if(pszName) {
|
|
||||||
qDebug() << "Coordinate system name for EPSG " + QString::number(epsgCode)
|
|
||||||
<< " is: " + QString::fromStdString(pszName);
|
|
||||||
return QString::fromStdString(pszName);
|
|
||||||
} else {
|
|
||||||
qDebug() << "Unable to retrieve the name for EPSG " + QString::number(epsgCode);
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
// char* wkt = NULL;
|
|
||||||
// // 转换为WKT格式
|
|
||||||
// oSRS.exportToWkt(&wkt);
|
|
||||||
//
|
|
||||||
// qDebug() << wkt;
|
|
||||||
//
|
|
||||||
// // 从WKT中解析投影名称,这里简化处理,实际可能需要更复杂的逻辑来准确提取名称
|
|
||||||
// std::string wktStr(wkt);
|
|
||||||
// long start = wktStr.find("PROJCS[\"") + 8; // 找到"PROJCS["后的第一个双引号位置
|
|
||||||
// // 从start位置开始找下一个双引号,这之间的内容即为投影名称
|
|
||||||
// int end = wktStr.find('\"', start);
|
|
||||||
// QString projName = QString::fromStdString(wktStr.substr(start, end - start));
|
|
||||||
//
|
|
||||||
// // 释放WKT字符串内存
|
|
||||||
// CPLFree(wkt);
|
|
||||||
|
|
||||||
// return projName;
|
|
||||||
}
|
|
||||||
long GetEPSGFromRasterFile(QString filepath)
|
|
||||||
{
|
|
||||||
qDebug() << "============= GetEPSGFromRasterFile ======================";
|
|
||||||
// QTextCodec* codec = QTextCodec::codecForLocale(); // 获取系统默认编码的文本编解码器
|
|
||||||
// QByteArray byteArray = codec->fromUnicode(filepath); // 将QString转换为QByteArray
|
|
||||||
//,这个应该会自动释放 const char* charArray = byteArray.constData(); //
|
|
||||||
// 获取QByteArray的const char*指针
|
|
||||||
|
|
||||||
{
|
|
||||||
if(QFile(filepath).exists()){
|
|
||||||
qDebug() << "info: the image found.\n";
|
|
||||||
}else{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES"); // 注册GDAL驱动
|
|
||||||
// qDebug()<<filepath.toLocal8Bit().constData()<<std::endl;
|
|
||||||
// 打开影像文件
|
|
||||||
GDALDataset* poDataset;
|
|
||||||
poDataset = (GDALDataset*)GDALOpen(filepath.toUtf8().data(), GA_ReadOnly);
|
|
||||||
if(NULL==poDataset) {
|
|
||||||
qDebug() << "Error: Unable to open the image.\n";
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取影像的投影信息
|
|
||||||
const char* pszProjection = poDataset->GetProjectionRef();
|
|
||||||
|
|
||||||
qDebug() << QString::fromUtf8(pszProjection);
|
|
||||||
|
|
||||||
// 创建SpatialReference对象
|
|
||||||
OGRSpatialReference oSRS;
|
|
||||||
if(oSRS.importFromWkt((char**)&pszProjection) != OGRERR_NONE) {
|
|
||||||
qDebug() << ("Error: Unable to import projection information.\n");
|
|
||||||
GDALClose(poDataset);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
long epsgCode = atoi(oSRS.GetAuthorityCode(nullptr)); // 获取EPSG代码
|
|
||||||
|
|
||||||
if(epsgCode != 0) {
|
|
||||||
GDALClose(poDataset);
|
|
||||||
qDebug() << QString("file %1 :epsg Code %2").arg(filepath).arg(epsgCode);
|
|
||||||
return epsgCode;
|
|
||||||
} else {
|
|
||||||
qDebug() << "EPSG code could not be determined from the spatial reference.";
|
|
||||||
GDALClose(poDataset);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::shared_ptr<PointRaster> GetCenterPointInRaster(QString filepath)
|
|
||||||
{
|
|
||||||
qDebug() << "============= GetCenterPointInRaster ======================";
|
|
||||||
// QTextCodec* codec = QTextCodec::codecForLocale(); // 获取系统默认编码的文本编解码器
|
|
||||||
// QByteArray byteArray = codec->fromUnicode(filepath); // 将QString转换为QByteArray
|
|
||||||
//,这个应该会自动释放 const char* charArray = byteArray.constData(); //
|
|
||||||
// 获取QByteArray的const char*指针
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
// qDebug()<<filepath.toLocal8Bit().constData()<<std::endl;
|
|
||||||
GDALDataset* poDataset = (GDALDataset*)GDALOpen(filepath.toUtf8().data(), GA_ReadOnly);
|
|
||||||
if(nullptr==poDataset||NULL==poDataset) {
|
|
||||||
qDebug() << "Could not open dataset";
|
|
||||||
return nullptr; // 表示读取失败
|
|
||||||
}
|
|
||||||
|
|
||||||
double x, y, z;
|
|
||||||
|
|
||||||
bool flag = false;
|
|
||||||
|
|
||||||
{
|
|
||||||
double adfGeoTransform[6];
|
|
||||||
if(poDataset->GetGeoTransform(adfGeoTransform) != CE_None) {
|
|
||||||
qDebug() << "Failed to get GeoTransform";
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
double dfWidth = poDataset->GetRasterXSize();
|
|
||||||
double dfHeight = poDataset->GetRasterYSize();
|
|
||||||
|
|
||||||
// 计算中心点坐标(像素坐标)
|
|
||||||
double dfCenterX = adfGeoTransform[0] + dfWidth * adfGeoTransform[1] / 2.0
|
|
||||||
+ dfHeight * adfGeoTransform[2] / 2.0;
|
|
||||||
double dfCenterY = adfGeoTransform[3] + dfWidth * adfGeoTransform[4] / 2.0
|
|
||||||
+ dfHeight * adfGeoTransform[5] / 2.0;
|
|
||||||
|
|
||||||
OGRSpatialReference oSRS;
|
|
||||||
oSRS.importFromWkt(poDataset->GetProjectionRef());
|
|
||||||
|
|
||||||
if(oSRS.IsGeographic()) {
|
|
||||||
qDebug() << "Center coords (already in geographic): (" + QString::number(dfCenterX)
|
|
||||||
+ ", " + QString::number(dfCenterY) + ")";
|
|
||||||
flag = true;
|
|
||||||
x = dfCenterX;
|
|
||||||
y = dfCenterY;
|
|
||||||
} else {
|
|
||||||
// 如果不是地理坐标系,转换到WGS84
|
|
||||||
OGRSpatialReference oSRS_WGS84;
|
|
||||||
oSRS_WGS84.SetWellKnownGeogCS("WGS84");
|
|
||||||
|
|
||||||
OGRCoordinateTransformation* poCT =
|
|
||||||
OGRCreateCoordinateTransformation(&oSRS, &oSRS_WGS84);
|
|
||||||
if(poCT == nullptr) {
|
|
||||||
qDebug() << "Failed to create coordinate transformation";
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// double dfLon, dfLat;
|
|
||||||
if(poCT->Transform(1, &dfCenterX, &dfCenterY)) {
|
|
||||||
qDebug() << "Center coords (transformed to WGS84): ("
|
|
||||||
+ QString::number(dfCenterX) + ", " + QString::number(dfCenterY)
|
|
||||||
<< ")";
|
|
||||||
flag = true;
|
|
||||||
x = dfCenterX;
|
|
||||||
y = dfCenterY;
|
|
||||||
} else {
|
|
||||||
qDebug() << "Transformation failed.";
|
|
||||||
}
|
|
||||||
OGRCoordinateTransformation::DestroyCT(poCT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(nullptr==poDataset||NULL==poDataset){}else{
|
|
||||||
GDALClose(poDataset);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(flag) {
|
|
||||||
std::shared_ptr<PointRaster> RasterCenterPoint = std::make_shared<PointRaster>();
|
|
||||||
RasterCenterPoint->x = x;
|
|
||||||
RasterCenterPoint->y = y;
|
|
||||||
RasterCenterPoint->z = 0;
|
|
||||||
return RasterCenterPoint;
|
|
||||||
} else {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CoordinateSystemType getCoordinateSystemTypeByEPSGCode(long epsg_code)
|
|
||||||
{
|
|
||||||
OGRSpatialReference oSRS;
|
|
||||||
if(oSRS.importFromEPSG(epsg_code) == OGRERR_NONE) {
|
|
||||||
if(oSRS.IsGeographic()) {
|
|
||||||
return CoordinateSystemType::GeoCoordinateSystem;
|
|
||||||
} else if(oSRS.IsProjected()) {
|
|
||||||
return CoordinateSystemType::ProjectCoordinateSystem;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return CoordinateSystemType::UNKNOW;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return CoordinateSystemType::UNKNOW;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}; // namespace RasterToolBase
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,96 +0,0 @@
|
||||||
/**
|
|
||||||
* @file RasterProjectBase.h
|
|
||||||
* @brief None
|
|
||||||
* @author 陈增辉 (3045316072@qq.com)
|
|
||||||
* @version 2.5.0
|
|
||||||
* @date 24-6-4
|
|
||||||
* @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LAMPCAE_RASTERTOOLBASE_H
|
|
||||||
#define LAMPCAE_RASTERTOOLBASE_H
|
|
||||||
#include "BaseConstVariable.h"
|
|
||||||
#include "gdal_priv.h"
|
|
||||||
#include <memory>
|
|
||||||
#include "LogInfoCls.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace RasterToolBase {
|
|
||||||
|
|
||||||
static bool GDALAllRegisterEnable = false;
|
|
||||||
|
|
||||||
|
|
||||||
enum ProjectStripDelta {
|
|
||||||
Strip_6, // 6度带
|
|
||||||
Strip_3
|
|
||||||
};
|
|
||||||
|
|
||||||
enum CoordinateSystemType { // 坐标系类型
|
|
||||||
GeoCoordinateSystem,
|
|
||||||
ProjectCoordinateSystem,
|
|
||||||
UNKNOW
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PointRaster { // 影像坐标点
|
|
||||||
double x;
|
|
||||||
double y;
|
|
||||||
double z;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct PointXYZ {
|
|
||||||
double x, y, z;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PointGeo {
|
|
||||||
double lon, lat, ati;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PointImage {
|
|
||||||
double pixel_x, pixel_y;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// 根据经纬度获取
|
|
||||||
/// EPSG代码,根据经纬度返回对应投影坐标系统,其中如果在中华人民共和国境内,默认使用
|
|
||||||
/// CGCS2000坐标系统(EPSG 4502 ~ 4512 6度带,EPSG 4534 ~ 4554 3度带),其余地方使用WGS坐标系统,
|
|
||||||
/// 投影方法 高斯克吕格(国内), 高斯克吕格
|
|
||||||
/// \param long 经度
|
|
||||||
/// \param lat 纬度
|
|
||||||
/// \return 对应投影坐标系统的 EPSG编码,-1 表示计算错误
|
|
||||||
long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat(double long, double lat,
|
|
||||||
ProjectStripDelta stripState = ProjectStripDelta::Strip_3);
|
|
||||||
|
|
||||||
long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat_inStrip3(double lon, double lat);
|
|
||||||
|
|
||||||
long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat_inStrip6(double lon, double lat);
|
|
||||||
|
|
||||||
|
|
||||||
QString BASECONSTVARIABLEAPI GetProjectionNameFromEPSG(long epsgCode);
|
|
||||||
|
|
||||||
|
|
||||||
long BASECONSTVARIABLEAPI GetEPSGFromRasterFile(QString filepath);
|
|
||||||
|
|
||||||
std::shared_ptr<PointRaster> BASECONSTVARIABLEAPI GetCenterPointInRaster(QString filepath);
|
|
||||||
|
|
||||||
CoordinateSystemType BASECONSTVARIABLEAPI getCoordinateSystemTypeByEPSGCode(long EPSGCODE);
|
|
||||||
|
|
||||||
};// namespace RasterProjectConvertor
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 遥感类常用数据
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // LAMPCAE_RASTERTOOLBASE_H
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,218 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "BaseConstVariable.h"
|
|
||||||
|
|
||||||
#include "BaseTool.h"
|
|
||||||
#include "ImageOperatorBase.h"
|
|
||||||
#include "GeoOperator.h"
|
|
||||||
#include "FileOperator.h"
|
|
||||||
#include "LogInfoCls.h"
|
|
||||||
|
|
||||||
enum RasterLevel {
|
|
||||||
RasterSLC,
|
|
||||||
RasterL1B,
|
|
||||||
RasterL2
|
|
||||||
};
|
|
||||||
|
|
||||||
class BASECONSTVARIABLEAPI SARSimulationImageL1Dataset
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
SARSimulationImageL1Dataset(RasterLevel Rasterlevel= RasterLevel::RasterSLC);
|
|
||||||
~SARSimulationImageL1Dataset();
|
|
||||||
|
|
||||||
private:
|
|
||||||
RasterLevel Rasterlevel;
|
|
||||||
public:
|
|
||||||
RasterLevel getRasterLevel();
|
|
||||||
|
|
||||||
|
|
||||||
private :
|
|
||||||
QString outFolderPath;
|
|
||||||
QString L1DatasetName;
|
|
||||||
QString xmlfileName;
|
|
||||||
QString xmlFilePath;
|
|
||||||
QString ImageRasterName;
|
|
||||||
QString ImageRasterPath;
|
|
||||||
QString GPSPointFilename;
|
|
||||||
QString GPSPointFilePath;
|
|
||||||
|
|
||||||
public:
|
|
||||||
QString getoutFolderPath();
|
|
||||||
QString getDatesetName();
|
|
||||||
QString getxmlfileName();
|
|
||||||
QString getxmlFilePath();
|
|
||||||
QString getImageRasterName();
|
|
||||||
QString getImageRasterPath();
|
|
||||||
QString getGPSPointFilename(); // GPS点
|
|
||||||
QString getGPSPointFilePath();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
ErrorCode OpenOrNew(QString folder, QString filename, long rowCount, long colCount);
|
|
||||||
ErrorCode Open(QString folderPath, QString Name);
|
|
||||||
ErrorCode Open(QString xmlPath);
|
|
||||||
public:
|
|
||||||
void saveToXml();
|
|
||||||
ErrorCode loadFromXml();
|
|
||||||
std::shared_ptr<double> getAntPos();
|
|
||||||
ErrorCode saveAntPos(std::shared_ptr<double> ptr); // 注意这个方法很危险,请写入前检查数据是否正确
|
|
||||||
|
|
||||||
std::shared_ptr<std::complex<double>> getImageRaster();
|
|
||||||
ErrorCode saveImageRaster(std::shared_ptr<std::complex<double>> echoPtr, long startPRF, long PRFLen);
|
|
||||||
std::shared_ptr<std::complex<double>> getImageRaster(long startPRF, long PRFLen);
|
|
||||||
|
|
||||||
Eigen::MatrixXcd getImageRasterMatrix();
|
|
||||||
ErrorCode saveImageRaster(Eigen::MatrixXcd& data, long startPRF);
|
|
||||||
|
|
||||||
gdalImage getImageRasterGdalImage();
|
|
||||||
|
|
||||||
private: // xml中参数
|
|
||||||
|
|
||||||
long rowCount;
|
|
||||||
long colCount;
|
|
||||||
|
|
||||||
double Rnear;
|
|
||||||
double Rfar;
|
|
||||||
double Rref;
|
|
||||||
|
|
||||||
double centerFreq;
|
|
||||||
double Fs;
|
|
||||||
double prf;
|
|
||||||
|
|
||||||
double CenterAngle;
|
|
||||||
QString LookSide;
|
|
||||||
QVector<SatelliteAntPos> sateposes;
|
|
||||||
|
|
||||||
double startImageTime;
|
|
||||||
double EndImageTime;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
void setStartImageTime(double imageTime);
|
|
||||||
double getStartImageTime();
|
|
||||||
|
|
||||||
void setEndImageTime(double imageTime);
|
|
||||||
double getEndImageTime();
|
|
||||||
|
|
||||||
|
|
||||||
QVector<SatelliteAntPos> getXmlSateAntPos();
|
|
||||||
void setSateAntPos(QVector<SatelliteAntPos> pos);
|
|
||||||
|
|
||||||
long getrowCount();
|
|
||||||
void setrowCount(long rowCount);
|
|
||||||
|
|
||||||
long getcolCount();
|
|
||||||
void setcolCount(long pulsePoints);
|
|
||||||
|
|
||||||
double getNearRange();
|
|
||||||
void setNearRange(double nearRange);
|
|
||||||
|
|
||||||
double getFarRange();
|
|
||||||
void setFarRange(double farRange);
|
|
||||||
|
|
||||||
double getRefRange();
|
|
||||||
void setRefRange(double refRange);
|
|
||||||
|
|
||||||
double getCenterFreq();
|
|
||||||
void setCenterFreq(double freq);
|
|
||||||
|
|
||||||
double getFs();
|
|
||||||
void setFs(double samplingFreq);
|
|
||||||
|
|
||||||
double getPRF();
|
|
||||||
void setPRF(double PRF);
|
|
||||||
|
|
||||||
double getCenterAngle();
|
|
||||||
void setCenterAngle(double angle);
|
|
||||||
|
|
||||||
QString getLookSide();
|
|
||||||
void setLookSide(QString lookside);
|
|
||||||
|
|
||||||
public:// 多普勒参数
|
|
||||||
double TotalProcessedAzimuthBandWidth, DopplerParametersReferenceTime;
|
|
||||||
double d0, d1, d2, d3, d4;
|
|
||||||
double r0, r1, r2, r3, r4;
|
|
||||||
double DEM;
|
|
||||||
double incidenceAngleNearRange, incidenceAngleFarRange;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
double getTotalProcessedAzimuthBandWidth();
|
|
||||||
void setTotalProcessedAzimuthBandWidth(double v);
|
|
||||||
|
|
||||||
double getDopplerParametersReferenceTime();
|
|
||||||
void setDopplerParametersReferenceTime(double v);
|
|
||||||
|
|
||||||
// 多普勒参数
|
|
||||||
QVector<double> getDopplerParams();
|
|
||||||
void setDopplerParams(double d0, double d1, double d2, double d3, double d4);
|
|
||||||
|
|
||||||
// 多普勒中心系数
|
|
||||||
QVector<double> getDopplerCenterCoff();
|
|
||||||
void setDopplerCenterCoff(double r0, double r1, double r2, double r3, double r4);
|
|
||||||
|
|
||||||
|
|
||||||
double getIncidenceAngleNearRange();
|
|
||||||
void setIncidenceAngleNearRangeet(double angle);
|
|
||||||
|
|
||||||
double getIncidenceAngleFarRange();
|
|
||||||
void setIncidenceAngleFarRange(double angle);
|
|
||||||
|
|
||||||
private:
|
|
||||||
double latitude_center, longitude_center,
|
|
||||||
latitude_topLeft, longitude_topLeft,
|
|
||||||
latitude_topRight, longitude_topRight,
|
|
||||||
latitude_bottomLeft, longitude_bottomLeft,
|
|
||||||
latitude_bottomRight, longitude_bottomRight;
|
|
||||||
public:
|
|
||||||
// Getter and Setter functions
|
|
||||||
double getLatitudeCenter();
|
|
||||||
void setLatitudeCenter(double value);
|
|
||||||
|
|
||||||
double getLongitudeCenter();
|
|
||||||
void setLongitudeCenter(double value);
|
|
||||||
|
|
||||||
double getLatitudeTopLeft();
|
|
||||||
void setLatitudeTopLeft(double value);
|
|
||||||
|
|
||||||
double getLongitudeTopLeft();
|
|
||||||
void setLongitudeTopLeft(double value);
|
|
||||||
|
|
||||||
double getLatitudeTopRight();
|
|
||||||
void setLatitudeTopRight(double value);
|
|
||||||
|
|
||||||
double getLongitudeTopRight();
|
|
||||||
void setLongitudeTopRight(double value);
|
|
||||||
|
|
||||||
double getLatitudeBottomLeft();
|
|
||||||
void setLatitudeBottomLeft(double value);
|
|
||||||
|
|
||||||
double getLongitudeBottomLeft();
|
|
||||||
void setLongitudeBottomLeft(double value);
|
|
||||||
|
|
||||||
double getLatitudeBottomRight();
|
|
||||||
void setLatitudeBottomRight(double value);
|
|
||||||
|
|
||||||
double getLongitudeBottomRight();
|
|
||||||
void setLongitudeBottomRight(double value);
|
|
||||||
public:
|
|
||||||
DemBox getExtend();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
double getdrange();
|
|
||||||
void setdrange(double dr);
|
|
||||||
|
|
||||||
double getdAz();
|
|
||||||
void setdAz(double dAz);
|
|
||||||
private:
|
|
||||||
double dr, dAz;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
#include "stdafx.h"
|
|
||||||
#include "ShowProessAbstract.h"
|
|
||||||
#include "BaseTool.h"
|
|
||||||
#include "GeoOperator.h"
|
|
||||||
#include "FileOperator.h"
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
|
|
||||||
void ShowProessAbstract::showProcess(double precent, QString tip)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShowProessAbstract::showToolInfo(QString tip)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,146 +0,0 @@
|
||||||
#include "stdafx.h"
|
|
||||||
#include "ImageOperatorBase.h"
|
|
||||||
#include "BaseTool.h"
|
|
||||||
#include "GeoOperator.h"
|
|
||||||
#include <Eigen/Core>
|
|
||||||
#include <Eigen/Dense>
|
|
||||||
#include <omp.h>
|
|
||||||
#include <io.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <gdal.h>
|
|
||||||
#include <gdal_utils.h>
|
|
||||||
#include <gdal_priv.h>
|
|
||||||
#include <gdalwarper.h>
|
|
||||||
#include <proj.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <memory>
|
|
||||||
#include <iostream>
|
|
||||||
#include "FileOperator.h"
|
|
||||||
#include <opencv2/opencv.hpp>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QDir>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <QProgressDialog>
|
|
||||||
#include <gdal_priv.h>
|
|
||||||
#include <ogr_spatialref.h> // OGRSpatialReference 用于空间参考转换
|
|
||||||
#include <gdal_alg.h> // 用于 GDALWarp 操作
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void testOutAmpArr(QString filename, float* amp, long rowcount, long colcount)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
Eigen::MatrixXd h_amp_img = Eigen::MatrixXd::Zero(rowcount, colcount);
|
|
||||||
|
|
||||||
for (long hii = 0; hii < rowcount; hii++) {
|
|
||||||
for (long hjj = 0; hjj < colcount; hjj++) {
|
|
||||||
h_amp_img(hii, hjj) = amp[hii * colcount + hjj];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QString ampPath = getDebugDataPath(filename);
|
|
||||||
saveEigenMatrixXd2Bin(h_amp_img, ampPath);
|
|
||||||
qDebug() << filename.toLocal8Bit().constData();
|
|
||||||
qDebug() << "max:\t" << h_amp_img.maxCoeff();
|
|
||||||
qDebug() << "min:\t" << h_amp_img.minCoeff();
|
|
||||||
}
|
|
||||||
|
|
||||||
void testOutAmpArr(QString filename, double* amp, long rowcount, long colcount)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
Eigen::MatrixXd h_amp_img = Eigen::MatrixXd::Zero(rowcount, colcount);
|
|
||||||
|
|
||||||
for (long hii = 0; hii < rowcount; hii++) {
|
|
||||||
for (long hjj = 0; hjj < colcount; hjj++) {
|
|
||||||
h_amp_img(hii, hjj) = amp[hii * colcount + hjj];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QString ampPath = getDebugDataPath(filename);
|
|
||||||
saveEigenMatrixXd2Bin(h_amp_img, ampPath);
|
|
||||||
qDebug() << filename.toLocal8Bit().constData();
|
|
||||||
qDebug() << "max:\t" << h_amp_img.maxCoeff();
|
|
||||||
qDebug() << "min:\t" << h_amp_img.minCoeff();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void testOutClsArr(QString filename, long* amp, long rowcount, long colcount) {
|
|
||||||
|
|
||||||
Eigen::MatrixXd h_amp_img = Eigen::MatrixXd::Zero(rowcount, colcount);
|
|
||||||
|
|
||||||
for (long hii = 0; hii < rowcount; hii++) {
|
|
||||||
for (long hjj = 0; hjj < colcount; hjj++) {
|
|
||||||
h_amp_img(hii, hjj) = amp[hii * colcount + hjj];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QString ampPath = getDebugDataPath(filename);
|
|
||||||
saveEigenMatrixXd2Bin(h_amp_img, ampPath);
|
|
||||||
qDebug() << filename.toLocal8Bit().constData();
|
|
||||||
qDebug() << "max:\t" << h_amp_img.maxCoeff();
|
|
||||||
qDebug() << "min:\t" << h_amp_img.minCoeff();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void testOutComplexDoubleArr(QString filename, std::complex<double>* data, long rowcount, long colcount)
|
|
||||||
{
|
|
||||||
QString ampPath = getDebugDataPath(filename);
|
|
||||||
gdalImageComplex compleximg = CreateEchoComplex(ampPath, rowcount, colcount, 1);
|
|
||||||
compleximg.saveImage(data, 0, 0, rowcount, colcount, 1);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void testOutDataArr(QString filename, double* data, long rowcount, long colcount)
|
|
||||||
{
|
|
||||||
return testOutAmpArr(filename, data, rowcount, colcount);
|
|
||||||
}
|
|
||||||
|
|
||||||
void testOutDataArr(QString filename, float* data, long rowcount, long colcount)
|
|
||||||
{
|
|
||||||
return testOutAmpArr(filename, data, rowcount, colcount);
|
|
||||||
}
|
|
||||||
|
|
||||||
void testOutDataArr(QString filename, long* data, long rowcount, long colcount)
|
|
||||||
{
|
|
||||||
return testOutClsArr(filename, data, rowcount, colcount);
|
|
||||||
}
|
|
||||||
|
|
||||||
void testOutAntPatternTrans(QString antpatternfilename, double* antPatternArr,
|
|
||||||
double starttheta, double deltetheta,
|
|
||||||
double startphi, double deltaphi,
|
|
||||||
long thetanum, long phinum)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
Eigen::MatrixXd antPatternMatrix(thetanum, phinum);
|
|
||||||
for (long t = 0; t < thetanum; ++t) {
|
|
||||||
for (long p = 0; p < phinum; ++p) {
|
|
||||||
long index = t * phinum + p;
|
|
||||||
if (index < thetanum * phinum) {
|
|
||||||
antPatternMatrix(t, p) = static_cast<double>(antPatternArr[index]); // Copy to Eigen matrix
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Eigen::MatrixXd gt(2, 3);
|
|
||||||
gt(0, 0) = startphi;//x
|
|
||||||
gt(0, 1) = deltaphi;
|
|
||||||
gt(0, 2) = 0;
|
|
||||||
|
|
||||||
gt(1, 0) = starttheta;
|
|
||||||
gt(1, 1) = 0;
|
|
||||||
gt(1, 2) = deltetheta;
|
|
||||||
|
|
||||||
QString antpatternfilepath = getDebugDataPath(antpatternfilename);
|
|
||||||
gdalImage ds = CreategdalImageDouble(antpatternfilepath, thetanum, phinum, 1, gt, "", true, true, true);
|
|
||||||
ds.saveImage(antPatternMatrix, 0, 0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,547 +0,0 @@
|
||||||
#include "stdafx.h"
|
|
||||||
#include "ImageOperatorBase.h"
|
|
||||||
#include "BaseTool.h"
|
|
||||||
#include "GeoOperator.h"
|
|
||||||
#include <Eigen/Core>
|
|
||||||
#include <Eigen/Dense>
|
|
||||||
#include <omp.h>
|
|
||||||
#include <io.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <gdal.h>
|
|
||||||
#include <gdal_utils.h>
|
|
||||||
#include <gdal_priv.h>
|
|
||||||
#include <gdalwarper.h>
|
|
||||||
#include <proj.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <memory>
|
|
||||||
#include <iostream>
|
|
||||||
#include "FileOperator.h"
|
|
||||||
#include <opencv2/opencv.hpp>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QDir>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <QProgressDialog>
|
|
||||||
#include <gdal_priv.h>
|
|
||||||
#include <ogr_spatialref.h> // OGRSpatialReference 用于空间参考转换
|
|
||||||
#include <gdal_alg.h> // 用于 GDALWarp 操作
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gdalImageComplex::gdalImageComplex(const QString& raster_path)
|
|
||||||
{
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
this->img_path = raster_path;
|
|
||||||
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
GDALDataset* rasterDataset = (GDALDataset*)(GDALOpen(
|
|
||||||
raster_path.toUtf8().constData(), GA_ReadOnly));
|
|
||||||
this->width = rasterDataset->GetRasterXSize();
|
|
||||||
this->height = rasterDataset->GetRasterYSize();
|
|
||||||
this->band_num = rasterDataset->GetRasterCount();
|
|
||||||
|
|
||||||
double* gt = new double[6];
|
|
||||||
rasterDataset->GetGeoTransform(gt);
|
|
||||||
this->gt = Eigen::MatrixXd(2, 3);
|
|
||||||
this->gt << gt[0], gt[1], gt[2], gt[3], gt[4], gt[5];
|
|
||||||
|
|
||||||
double a = this->gt(0, 0);
|
|
||||||
double b = this->gt(0, 1);
|
|
||||||
double c = this->gt(0, 2);
|
|
||||||
double d = this->gt(1, 0);
|
|
||||||
double e = this->gt(1, 1);
|
|
||||||
double f = this->gt(1, 2);
|
|
||||||
|
|
||||||
this->projection = rasterDataset->GetProjectionRef();
|
|
||||||
|
|
||||||
// 释放投影
|
|
||||||
GDALFlushCache((GDALDatasetH)rasterDataset);
|
|
||||||
GDALClose((GDALDatasetH)rasterDataset);
|
|
||||||
rasterDataset = NULL; // 指矫匡拷
|
|
||||||
this->InitInv_gt();
|
|
||||||
delete[] gt;
|
|
||||||
GDALDestroy(); // or, DllMain at DLL_PROCESS_DETACH
|
|
||||||
omp_unset_lock(&lock); // 锟酵放伙拷斤拷
|
|
||||||
omp_destroy_lock(&lock); // 劫伙拷斤拷
|
|
||||||
}
|
|
||||||
|
|
||||||
gdalImageComplex::~gdalImageComplex() {}
|
|
||||||
|
|
||||||
void gdalImageComplex::setData(Eigen::MatrixXcd data)
|
|
||||||
{
|
|
||||||
this->data = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
void gdalImageComplex::saveImage(Eigen::MatrixXcd data, int start_row, int start_col, int band_ids)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
if (start_row + data.rows() > this->height || start_col + data.cols() > this->width) {
|
|
||||||
QString tip = u8"file path: " + this->img_path;
|
|
||||||
qDebug() << tip;
|
|
||||||
throw std::exception(tip.toUtf8().constData());
|
|
||||||
}
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("ENVI");
|
|
||||||
GDALDataset* poDstDS = nullptr;
|
|
||||||
if (exists_test(this->img_path)) {
|
|
||||||
poDstDS = (GDALDataset*)(GDALOpen(this->img_path.toUtf8().constData(), GA_Update));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
poDstDS = poDriver->Create(this->img_path.toUtf8().constData(), this->width, this->height,
|
|
||||||
this->band_num, GDT_CFloat64, NULL); // 斤拷锟斤拷
|
|
||||||
poDstDS->SetProjection(this->projection.toUtf8().constData());
|
|
||||||
|
|
||||||
double gt_ptr[6];
|
|
||||||
for (int i = 0; i < this->gt.rows(); i++) {
|
|
||||||
for (int j = 0; j < this->gt.cols(); j++) {
|
|
||||||
gt_ptr[i * 3 + j] = this->gt(i, j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
poDstDS->SetGeoTransform(gt_ptr);
|
|
||||||
//delete[] gt_ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
int datarows = data.rows();
|
|
||||||
int datacols = data.cols();
|
|
||||||
|
|
||||||
if (this->getDataType() == GDT_CFloat64)
|
|
||||||
{
|
|
||||||
|
|
||||||
double* databuffer = new double[data.size() * 2];
|
|
||||||
for (int i = 0; i < data.rows(); i++) {
|
|
||||||
for (int j = 0; j < data.cols(); j++) {
|
|
||||||
databuffer[i * data.cols() * 2 + j * 2] = data(i, j).real();
|
|
||||||
databuffer[i * data.cols() * 2 + j * 2 + 1] = data(i, j).imag();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// poDstDS->RasterIO(GF_Write,start_col, start_row, datacols, datarows, databuffer, datacols,
|
|
||||||
// datarows, GDT_Float32,band_ids, num,0,0,0);
|
|
||||||
poDstDS->GetRasterBand(band_ids)->RasterIO(GF_Write, start_col, start_row, datacols, datarows,
|
|
||||||
databuffer, datacols, datarows, GDT_CFloat64, 0, 0);
|
|
||||||
GDALFlushCache(poDstDS);
|
|
||||||
delete databuffer;
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (this->getDataType() == GDT_CFloat32) {
|
|
||||||
|
|
||||||
float* databuffer = new float[data.size() * 2];
|
|
||||||
for (int i = 0; i < data.rows(); i++) {
|
|
||||||
for (int j = 0; j < data.cols(); j++) {
|
|
||||||
databuffer[i * data.cols() * 2 + j * 2] = float(data(i, j).real());
|
|
||||||
databuffer[i * data.cols() * 2 + j * 2 + 1] =float( data(i, j).imag());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// poDstDS->RasterIO(GF_Write,start_col, start_row, datacols, datarows, databuffer, datacols,
|
|
||||||
// datarows, GDT_Float32,band_ids, num,0,0,0);
|
|
||||||
poDstDS->GetRasterBand(band_ids)->RasterIO(GF_Write, start_col, start_row, datacols, datarows,
|
|
||||||
databuffer, datacols, datarows, GDT_CFloat32, 0, 0);
|
|
||||||
GDALFlushCache(poDstDS);
|
|
||||||
delete databuffer;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw std::exception("gdalImageComplex::saveImage: data type error");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GDALClose((GDALDatasetH)poDstDS);
|
|
||||||
GDALDestroy(); // or, DllMain at DLL_PROCESS_DETACH
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
}
|
|
||||||
|
|
||||||
void gdalImageComplex::saveImage(std::shared_ptr<std::complex<double>> data, long start_row, long start_col, long rowCount, long colCount, int band_ids)
|
|
||||||
{
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
if (start_row + rowCount > this->height || start_col + colCount > this->width) {
|
|
||||||
QString tip = u8"file path: " + this->img_path;
|
|
||||||
qDebug() << tip;
|
|
||||||
throw std::exception(tip.toUtf8().constData());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("ENVI");
|
|
||||||
GDALDataset* poDstDS = nullptr;
|
|
||||||
if (exists_test(this->img_path)) {
|
|
||||||
poDstDS = (GDALDataset*)(GDALOpen(this->img_path.toUtf8().constData(), GA_Update));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
poDstDS = poDriver->Create(this->img_path.toUtf8().constData(), this->width, this->height,
|
|
||||||
this->band_num, GDT_CFloat64, NULL); // 斤拷锟斤拷
|
|
||||||
poDstDS->SetProjection(this->projection.toUtf8().constData());
|
|
||||||
|
|
||||||
double gt_ptr[6];
|
|
||||||
for (int i = 0; i < this->gt.rows(); i++) {
|
|
||||||
for (int j = 0; j < this->gt.cols(); j++) {
|
|
||||||
gt_ptr[i * 3 + j] = this->gt(i, j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
poDstDS->SetGeoTransform(gt_ptr);
|
|
||||||
//delete[] gt_ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
double* databuffer = new double[rowCount * colCount * 2];
|
|
||||||
for (long i = 0; i < rowCount; i++) {
|
|
||||||
for (long j = 0; j < colCount; j++) {
|
|
||||||
databuffer[i * colCount * 2 + j * 2] = data.get()[i * colCount + j].real();
|
|
||||||
databuffer[i * colCount * 2 + j * 2 + 1] = data.get()[i * colCount + j].imag();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// poDstDS->RasterIO(GF_Write,start_col, start_row, datacols, datarows, databuffer, datacols,
|
|
||||||
// datarows, GDT_Float32,band_ids, num,0,0,0);
|
|
||||||
poDstDS->GetRasterBand(band_ids)->RasterIO(GF_Write, start_col, start_row, colCount, rowCount,
|
|
||||||
databuffer, colCount, rowCount, GDT_CFloat64, 0, 0);
|
|
||||||
GDALFlushCache(poDstDS);
|
|
||||||
delete databuffer;
|
|
||||||
GDALClose((GDALDatasetH)poDstDS);
|
|
||||||
GDALDestroy(); // or, DllMain at DLL_PROCESS_DETACH
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void gdalImageComplex::saveImage(std::complex<double>* data, long start_row, long start_col, long rowCount, long colCount, int band_ids)
|
|
||||||
{
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
if (start_row + rowCount > this->height || start_col + colCount > this->width) {
|
|
||||||
QString tip = u8"file path: " + this->img_path;
|
|
||||||
qDebug() << tip;
|
|
||||||
throw std::exception(tip.toUtf8().constData());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("ENVI");
|
|
||||||
GDALDataset* poDstDS = nullptr;
|
|
||||||
if (exists_test(this->img_path)) {
|
|
||||||
poDstDS = (GDALDataset*)(GDALOpen(this->img_path.toUtf8().constData(), GA_Update));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
poDstDS = poDriver->Create(this->img_path.toUtf8().constData(), this->width, this->height,
|
|
||||||
this->band_num, GDT_CFloat64, NULL); // 斤拷锟斤拷
|
|
||||||
poDstDS->SetProjection(this->projection.toUtf8().constData());
|
|
||||||
|
|
||||||
double gt_ptr[6];
|
|
||||||
for (int i = 0; i < this->gt.rows(); i++) {
|
|
||||||
for (int j = 0; j < this->gt.cols(); j++) {
|
|
||||||
gt_ptr[i * 3 + j] = this->gt(i, j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
poDstDS->SetGeoTransform(gt_ptr);
|
|
||||||
//delete[] gt_ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
double* databuffer = new double[rowCount * colCount * 2];
|
|
||||||
for (long i = 0; i < rowCount; i++) {
|
|
||||||
for (long j = 0; j < colCount; j++) {
|
|
||||||
databuffer[i * colCount * 2 + j * 2] = data[i * colCount + j].real();
|
|
||||||
databuffer[i * colCount * 2 + j * 2 + 1] = data[i * colCount + j].imag();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// poDstDS->RasterIO(GF_Write,start_col, start_row, datacols, datarows, databuffer, datacols,
|
|
||||||
// datarows, GDT_Float32,band_ids, num,0,0,0);
|
|
||||||
poDstDS->GetRasterBand(band_ids)->RasterIO(GF_Write, start_col, start_row, colCount, rowCount,
|
|
||||||
databuffer, colCount, rowCount, GDT_CFloat64, 0, 0);
|
|
||||||
GDALFlushCache(poDstDS);
|
|
||||||
delete databuffer;
|
|
||||||
GDALClose((GDALDatasetH)poDstDS);
|
|
||||||
GDALDestroy(); // or, DllMain at DLL_PROCESS_DETACH
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
}
|
|
||||||
|
|
||||||
Eigen::MatrixXcd gdalImageComplex::getDataComplex(int start_row, int start_col, int rows_count,
|
|
||||||
int cols_count, int band_ids)
|
|
||||||
{
|
|
||||||
GDALDataset* poDataset;
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
|
|
||||||
// 打开TIFF文件
|
|
||||||
poDataset = (GDALDataset*)GDALOpen(this->img_path.toUtf8().constData(), GA_ReadOnly);
|
|
||||||
if (poDataset == nullptr) {
|
|
||||||
QMessageBox::warning(nullptr, u8"错误", u8"无法打开文件:" + this->img_path);
|
|
||||||
qDebug() << u8"无法打开文件:" + this->img_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取数据集的第一个波段
|
|
||||||
GDALRasterBand* poBand;
|
|
||||||
poBand = poDataset->GetRasterBand(1);
|
|
||||||
rows_count = start_row + rows_count <= this->height ? rows_count : this->height - start_row;
|
|
||||||
cols_count = start_col + cols_count <= this->width ? cols_count : this->width - start_col;
|
|
||||||
// 读取波段信息,假设是复数类型
|
|
||||||
int nXSize = cols_count; poBand->GetXSize();
|
|
||||||
int nYSize = rows_count; poBand->GetYSize();
|
|
||||||
Eigen::MatrixXcd rasterData(nYSize, nXSize); // 使用Eigen的MatrixXcd
|
|
||||||
if (this->getDataType() == GDT_CFloat64)
|
|
||||||
{
|
|
||||||
long long pixelCount =long long( nXSize) *long long( nYSize);
|
|
||||||
double* databuffer = new double[pixelCount * 2];
|
|
||||||
poBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, databuffer, cols_count, rows_count, GDT_CFloat64, 0, 0);
|
|
||||||
GDALClose((GDALDatasetH)poDataset);
|
|
||||||
|
|
||||||
for (long long i = 0; i < nYSize; i++) {
|
|
||||||
for (long long j = 0; j < nXSize; j++) {
|
|
||||||
rasterData(i, j) = std::complex<double>(databuffer[i * nXSize * 2 + j * 2],
|
|
||||||
databuffer[i * nXSize * 2 + j * 2 + 1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delete[] databuffer;
|
|
||||||
}
|
|
||||||
else if(this->getDataType()==GDT_CFloat32)
|
|
||||||
{
|
|
||||||
long long pixelCount = long long(nXSize) * long long(nYSize);
|
|
||||||
float* databuffer = new float[pixelCount * 2];
|
|
||||||
poBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, databuffer, cols_count, rows_count, GDT_CFloat32, 0, 0);
|
|
||||||
GDALClose((GDALDatasetH)poDataset);
|
|
||||||
|
|
||||||
for (long long i = 0; i < nYSize; i++) {
|
|
||||||
for (long long j = 0; j < nXSize; j++) {
|
|
||||||
rasterData(i, j) = std::complex<double>(databuffer[i * nXSize * 2 + j * 2],
|
|
||||||
databuffer[i * nXSize * 2 + j * 2 + 1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delete[] databuffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return rasterData;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<std::complex<double>> gdalImageComplex::getDataComplexSharePtr(int start_row, int start_col, int rows_count, int cols_count, int band_ids)
|
|
||||||
{
|
|
||||||
GDALDataset* poDataset;
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
|
|
||||||
// 打开TIFF文件
|
|
||||||
poDataset = (GDALDataset*)GDALOpen(this->img_path.toUtf8().constData(), GA_ReadOnly);
|
|
||||||
if (poDataset == nullptr) {
|
|
||||||
QMessageBox::warning(nullptr, u8"错误", u8"无法打开文件:" + this->img_path);
|
|
||||||
qDebug() << u8"无法打开文件:" + this->img_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取数据集的第一个波段
|
|
||||||
GDALRasterBand* poBand;
|
|
||||||
poBand = poDataset->GetRasterBand(1);
|
|
||||||
|
|
||||||
// 读取波段信息,假设是复数类型
|
|
||||||
|
|
||||||
|
|
||||||
double* databuffer = new double[rows_count * cols_count * 2];
|
|
||||||
poBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, databuffer, cols_count,
|
|
||||||
rows_count, GDT_CFloat64, 0, 0);
|
|
||||||
GDALClose((GDALDatasetH)poDataset);
|
|
||||||
|
|
||||||
std::shared_ptr<std::complex<double>> rasterData(new std::complex<double>[rows_count * cols_count], delArrPtr);
|
|
||||||
|
|
||||||
for (size_t i = 0; i < rows_count; i++) {
|
|
||||||
for (size_t j = 0; j < cols_count; j++) {
|
|
||||||
rasterData.get()[i * cols_count + j] = std::complex<double>(databuffer[i * cols_count * 2 + j * 2],
|
|
||||||
databuffer[i * cols_count * 2 + j * 2 + 1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delete[] databuffer;
|
|
||||||
return rasterData;
|
|
||||||
}
|
|
||||||
|
|
||||||
void gdalImageComplex::saveComplexImage()
|
|
||||||
{
|
|
||||||
this->saveImage(this->data, this->start_row, this->start_col, this->data_band_ids);
|
|
||||||
}
|
|
||||||
void gdalImageComplex::savePreViewImage()
|
|
||||||
{
|
|
||||||
qDebug() << "void gdalImageComplex::savePreViewImage()";
|
|
||||||
Eigen::MatrixXd data_abs = Eigen::MatrixXd::Zero(this->height, this->width);
|
|
||||||
data_abs = (this->data.array().real().pow(2) + this->data.array().imag().pow(2))
|
|
||||||
.array()
|
|
||||||
.log10() * 10.0; // 计算振幅
|
|
||||||
|
|
||||||
double min_abs = data_abs.minCoeff(); // 最大值
|
|
||||||
double max_abs = data_abs.maxCoeff(); // 最小值
|
|
||||||
double delta = (max_abs - min_abs) / 1000; // 1000分位档
|
|
||||||
Eigen::MatrixX<size_t> data_idx =
|
|
||||||
((data_abs.array() - min_abs).array() / delta).array().floor().cast<size_t>();
|
|
||||||
|
|
||||||
// 初始化
|
|
||||||
double hist[1001];
|
|
||||||
for (size_t i = 0; i < 1001; i++) {
|
|
||||||
hist[i] = 0; // 初始化
|
|
||||||
}
|
|
||||||
for (size_t i = 0; i < this->height; i++) {
|
|
||||||
for (size_t j = 0; j < this->width; j++) {
|
|
||||||
hist[data_idx(i, j)]++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 统计
|
|
||||||
size_t count = this->height * this->width;
|
|
||||||
double precent = 0;
|
|
||||||
size_t curCount = 0;
|
|
||||||
double pre2 = 0;
|
|
||||||
bool findprec_2 = true;
|
|
||||||
double pre98 = 0;
|
|
||||||
bool findprec_98 = true;
|
|
||||||
for (size_t i = 0; i < 1001; i++) {
|
|
||||||
precent = precent + hist[i];
|
|
||||||
if (findprec_2 & precent / count > 0.02) {
|
|
||||||
pre2 = i * delta + min_abs;
|
|
||||||
findprec_2 = false;
|
|
||||||
}
|
|
||||||
if (findprec_98 & precent / count > 0.98) {
|
|
||||||
pre98 = (i - 1) * delta + min_abs;
|
|
||||||
findprec_98 = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 拉伸
|
|
||||||
delta = (pre98 - pre2) / 200;
|
|
||||||
data_idx =
|
|
||||||
((data_abs.array() - pre2).array() / delta).array().floor().cast<size_t>();
|
|
||||||
|
|
||||||
for (size_t i = 0; i < this->height; i++) {
|
|
||||||
for (size_t j = 0; j < this->width; j++) {
|
|
||||||
if (data_idx(i, j) < 0) {
|
|
||||||
data_idx(i, j) = 0;
|
|
||||||
}
|
|
||||||
else if (data_idx(i, j) > 255) {
|
|
||||||
data_idx(i, j) = 255;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 赋值
|
|
||||||
QString filePath = this->img_path;
|
|
||||||
QFile file(filePath);
|
|
||||||
QFileInfo fileInfo(file);
|
|
||||||
|
|
||||||
QString directory = fileInfo.absolutePath();
|
|
||||||
qDebug() << "文件所在目录:" << directory;
|
|
||||||
QString baseName = fileInfo.completeBaseName();
|
|
||||||
qDebug() << "无后缀文件名:" << baseName;
|
|
||||||
|
|
||||||
// 创建文件路径
|
|
||||||
QString previewImagePath = JoinPath(directory, baseName + "_preview.png");
|
|
||||||
cv::Mat img(this->height, this->width, CV_8U, cv::Scalar(0));
|
|
||||||
|
|
||||||
for (size_t i = 0; i < this->height; i++) {
|
|
||||||
for (size_t j = 0; j < this->width; j++) {
|
|
||||||
img.at<uchar>(i, j) = (uchar)(data_idx(i, j));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//std::string outimgpath=previewImagePath.toUtf8().data();
|
|
||||||
cv::imwrite(previewImagePath.toUtf8().data(), img);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gdalImageComplex CreategdalImageComplex(const QString& img_path, int height, int width,
|
|
||||||
int band_num, Eigen::MatrixXd gt, QString projection,
|
|
||||||
bool need_gt, bool overwrite)
|
|
||||||
{
|
|
||||||
if (exists_test(img_path.toUtf8().constData())) {
|
|
||||||
if (overwrite) {
|
|
||||||
gdalImageComplex result_img(img_path);
|
|
||||||
return result_img;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw "file has exist!!!";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("ENVI");
|
|
||||||
GDALDataset* poDstDS = poDriver->Create(img_path.toUtf8().constData(), width, height, band_num,
|
|
||||||
GDT_CFloat64, NULL);
|
|
||||||
if (need_gt) {
|
|
||||||
poDstDS->SetProjection(projection.toUtf8().constData());
|
|
||||||
|
|
||||||
// 锟斤拷锟斤拷转锟斤拷锟斤拷锟斤拷
|
|
||||||
double gt_ptr[6] = { 0 };
|
|
||||||
for (int i = 0; i < gt.rows(); i++) {
|
|
||||||
for (int j = 0; j < gt.cols(); j++) {
|
|
||||||
gt_ptr[i * 3 + j] = gt(i, j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
poDstDS->SetGeoTransform(gt_ptr);
|
|
||||||
}
|
|
||||||
//for(int i = 1; i <= band_num; i++) {
|
|
||||||
// poDstDS->GetRasterBand(i)->SetNoDataValue(0); // 回波部分
|
|
||||||
//}
|
|
||||||
GDALFlushCache((GDALDatasetH)poDstDS);
|
|
||||||
GDALClose((GDALDatasetH)poDstDS);
|
|
||||||
GDALDestroy(); // or, DllMain at DLL_PROCESS_DETACH
|
|
||||||
gdalImageComplex result_img(img_path);
|
|
||||||
return result_img;
|
|
||||||
}
|
|
||||||
|
|
||||||
gdalImageComplex CreategdalImageComplexNoProj(const QString& img_path, int height, int width, int band_num, bool overwrite)
|
|
||||||
{
|
|
||||||
|
|
||||||
// 创建新文件
|
|
||||||
omp_lock_t lock;
|
|
||||||
omp_init_lock(&lock);
|
|
||||||
omp_set_lock(&lock);
|
|
||||||
GDALAllRegister();
|
|
||||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
|
||||||
|
|
||||||
GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("ENVI");
|
|
||||||
GDALDataset* poDstDS = (poDriver->Create(img_path.toUtf8().constData(), width, height, band_num, GDT_CFloat64, NULL));
|
|
||||||
GDALFlushCache((GDALDatasetH)poDstDS);
|
|
||||||
GDALClose((GDALDatasetH)poDstDS);
|
|
||||||
//poDstDS.reset();
|
|
||||||
omp_unset_lock(&lock); //
|
|
||||||
omp_destroy_lock(&lock); //
|
|
||||||
|
|
||||||
gdalImageComplex result_img(img_path);
|
|
||||||
return result_img;
|
|
||||||
}
|
|
||||||
|
|
||||||
gdalImageComplex CreateEchoComplex(const QString& img_path, int height, int width, int band_num)
|
|
||||||
{
|
|
||||||
// 创建图像
|
|
||||||
Eigen::MatrixXd gt = Eigen::MatrixXd::Zero(2, 3);
|
|
||||||
//Xgeo = GeoTransform[0] + Xpixel * GeoTransform[1] + Ypixel * GeoTransform[2]
|
|
||||||
//Ygeo = GeoTransform[3] + Xpixel * GeoTransform[4] + Ypixel * GeoTransform[5]
|
|
||||||
// X
|
|
||||||
gt(0, 0) = 0; gt(0, 2) = 1; gt(0, 2) = 0;
|
|
||||||
gt(1, 0) = 0; gt(1, 1) = 0; gt(1, 2) = 1;
|
|
||||||
// Y
|
|
||||||
QString projection = "";
|
|
||||||
gdalImageComplex echodata = CreategdalImageComplex(img_path, height, width, 1, gt, projection, false, true);
|
|
||||||
return echodata;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1 +0,0 @@
|
||||||
#include "stdafx.h"
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,15 +0,0 @@
|
||||||
|
|
||||||
#ifndef __SHOWPROCESSABSTRACT_H__
|
|
||||||
#define __SHOWPROCESSABSTRACT_H__
|
|
||||||
#include "BaseConstVariable.h"
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
|
|
||||||
class BASECONSTVARIABLEAPI ShowProessAbstract {
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual void showProcess(double precent, QString tip);
|
|
||||||
virtual void showToolInfo(QString tip);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
#include "QToolAbstract.h"
|
|
||||||
|
|
||||||
QToolAbstract::QToolAbstract(QObject* parent)
|
|
||||||
:QObject(parent)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QToolAbstract::~QToolAbstract()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void QToolAbstract::setToolXpath(QVector<QString> intoolPath)
|
|
||||||
{
|
|
||||||
this->toolPath = intoolPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QToolAbstract::setToolName(QString intoolname)
|
|
||||||
{
|
|
||||||
this->toolname = intoolname;
|
|
||||||
}
|
|
||||||
|
|
||||||
QVector<QString> QToolAbstract::getToolXpath()
|
|
||||||
{
|
|
||||||
return this->toolPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString QToolAbstract::getToolName()
|
|
||||||
{
|
|
||||||
return this->toolname;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QToolAbstract::excute()
|
|
||||||
{
|
|
||||||
this->run();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QToolAbstract::run()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#ifndef QToolAbstract_H_
|
|
||||||
#define QToolAbstract_H_
|
|
||||||
|
|
||||||
#include "BaseConstVariable.h"
|
|
||||||
#include <QTreeWidgetItem>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QItemDelegate>
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
|
|
||||||
// 菱땍屢 QTreeWidgetItem 셨넓잚
|
|
||||||
class BASECONSTVARIABLEAPI QToolAbstract : public QObject {
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
QToolAbstract(QObject* parent=nullptr);
|
|
||||||
~QToolAbstract();
|
|
||||||
public slots:
|
|
||||||
virtual void excute();
|
|
||||||
virtual void setToolXpath(QVector<QString> toolPath);
|
|
||||||
virtual void setToolName(QString toolname);
|
|
||||||
virtual QVector<QString> getToolXpath();
|
|
||||||
virtual QString getToolName();
|
|
||||||
public:
|
|
||||||
QVector<QString> toolPath;
|
|
||||||
QString toolname;
|
|
||||||
public:
|
|
||||||
virtual void run();
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
// 鬧꿍묏야芎
|
|
||||||
PluginTool_*.dll
|
|
||||||
void RegisterPreToolBox(RasterProcessTool* mainWindows);
|
|
||||||
extern "C" void RegisterPreToolBox(LAMPMainWidget::RasterMainWidget* mainwindows,ToolBoxWidget* toolbox);
|
|
||||||
*/
|
|
||||||
#endif // !1
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
// dllmain.cpp : 定义 DLL 应用程序的入口点。
|
|
||||||
#include "pch.h"
|
|
||||||
|
|
||||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
|
||||||
DWORD ul_reason_for_call,
|
|
||||||
LPVOID lpReserved
|
|
||||||
)
|
|
||||||
{
|
|
||||||
switch (ul_reason_for_call)
|
|
||||||
{
|
|
||||||
case DLL_PROCESS_ATTACH:
|
|
||||||
case DLL_THREAD_ATTACH:
|
|
||||||
case DLL_THREAD_DETACH:
|
|
||||||
case DLL_PROCESS_DETACH:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容
|
|
||||||
// Windows 头文件
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
// pch.cpp: 与预编译标头对应的源文件
|
|
||||||
|
|
||||||
#include "pch.h"
|
|
||||||
|
|
||||||
// 当使用预编译的头时,需要使用此源文件,编译才能成功。
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
// pch.h: 这是预编译标头文件。
|
|
||||||
// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
|
|
||||||
// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
|
|
||||||
// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
|
|
||||||
// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
|
|
||||||
|
|
||||||
#ifndef PCH_H
|
|
||||||
#define PCH_H
|
|
||||||
|
|
||||||
// 添加要在此处预编译的标头
|
|
||||||
#include "framework.h"
|
|
||||||
|
|
||||||
#endif //PCH_H
|
|
||||||
|
|
@ -7,6 +7,12 @@
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <qprogressdialog.h>
|
#include <qprogressdialog.h>
|
||||||
|
#include "BaseTool.h"
|
||||||
|
#include "GeoOperator.h"
|
||||||
|
#include "ImageOperatorBase.h"
|
||||||
|
#include "FileOperator.h"
|
||||||
|
#include "GF3Util.h"
|
||||||
|
#include "GF3CalibrationAndOrthLib.h"
|
||||||
|
|
||||||
ErrorCode GF3CalibrationRaster(QString inRasterPath, QString outRasterPath, double Qualifyvalue, double calibrationConst)
|
ErrorCode GF3CalibrationRaster(QString inRasterPath, QString outRasterPath, double Qualifyvalue, double calibrationConst)
|
||||||
{
|
{
|
||||||
|
|
@ -18,25 +24,29 @@ ErrorCode GF3CalibrationRaster(QString inRasterPath, QString outRasterPath, doub
|
||||||
gdalImageComplex outraster(outRasterPath);
|
gdalImageComplex outraster(outRasterPath);
|
||||||
|
|
||||||
|
|
||||||
long blocklines = Memory1GB * 2 / 8 / imgraster.width;
|
long blocklines = Memory1MB / 8 / imgraster.width*200;
|
||||||
blocklines = blocklines < 100 ? 100 : blocklines;
|
blocklines = blocklines < 100 ? 100 : blocklines;
|
||||||
Eigen::MatrixXd imgArrb1 = Eigen::MatrixXd::Zero(blocklines, imgraster.width);
|
|
||||||
Eigen::MatrixXd imgArrb2 = Eigen::MatrixXd::Zero(blocklines, imgraster.width);
|
|
||||||
Eigen::MatrixXcd imgArr = Eigen::MatrixXcd::Zero(blocklines, imgraster.width);
|
|
||||||
|
|
||||||
double quayCoff = Qualifyvalue * 1.0 / 32767;
|
double quayCoff = Qualifyvalue * 1.0 / 32767;
|
||||||
double caliCoff = std::pow(10.0, (calibrationConst * 1.0 / 20));
|
double caliCoff = std::pow(10.0, (calibrationConst * 1.0 / 20));
|
||||||
qDebug() << u8"定标系数:\t" << quayCoff / caliCoff;
|
qDebug() << u8"定标系数:\t" << quayCoff / caliCoff;
|
||||||
long startrow = 0;
|
|
||||||
for (startrow = 0; startrow < imgraster.height; startrow = startrow + blocklines) {
|
|
||||||
|
|
||||||
imgArrb1 = imgraster.getData(startrow, 0, blocklines, imgraster.width, 1);
|
omp_lock_t lock;
|
||||||
imgArrb2 = imgraster.getData(startrow, 0, blocklines, imgraster.width, 2);
|
omp_init_lock(&lock);
|
||||||
imgArr = outraster.getDataComplex(startrow, 0, blocklines, outraster.width, 1);
|
#pragma omp parallel for
|
||||||
|
for (int64_t startrow = 0; startrow < imgraster.height; startrow = startrow + blocklines) {
|
||||||
|
|
||||||
|
Eigen::MatrixXd imgArrb1 = imgraster.getData(startrow, 0, blocklines, imgraster.width, 1);
|
||||||
|
Eigen::MatrixXd imgArrb2 = imgraster.getData(startrow, 0, blocklines, imgraster.width, 2);
|
||||||
|
Eigen::MatrixXcd imgArr = outraster.getDataComplex(startrow, 0, blocklines, outraster.width, 1);
|
||||||
imgArr.real() = imgArrb1.array() * quayCoff / caliCoff;
|
imgArr.real() = imgArrb1.array() * quayCoff / caliCoff;
|
||||||
imgArr.imag() = imgArrb2.array() * quayCoff / caliCoff;
|
imgArr.imag() = imgArrb2.array() * quayCoff / caliCoff;
|
||||||
|
omp_set_lock(&lock);
|
||||||
outraster.saveImage(imgArr, startrow, 0, 1);
|
outraster.saveImage(imgArr, startrow, 0, 1);
|
||||||
|
omp_unset_lock(&lock); //
|
||||||
}
|
}
|
||||||
|
omp_destroy_lock(&lock); //
|
||||||
qDebug() << u8"影像写入到:" << outRasterPath;
|
qDebug() << u8"影像写入到:" << outRasterPath;
|
||||||
return ErrorCode::SUCCESS;
|
return ErrorCode::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
@ -246,13 +256,15 @@ ErrorCode RD_PSTN(double& refrange, double& lamda, double& timeR, double& R, dou
|
||||||
|
|
||||||
inct = dt*(dplerTheory2-dplerNumber1) / (dplerTheory2 - dplerTheory1);
|
inct = dt*(dplerTheory2-dplerNumber1) / (dplerTheory2 - dplerTheory1);
|
||||||
if (std::abs(dplerNumber1 - dplerTheory2) < 1e-6 || std::abs(inct) < 1.0e-4) {
|
if (std::abs(dplerNumber1 - dplerTheory2) < 1e-6 || std::abs(inct) < 1.0e-4) {
|
||||||
|
R = R1; // 斜距
|
||||||
|
return ErrorCode::SUCCESS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
inct = std::abs(inct) < 10 ?inct:inct*1e-2;
|
inct = std::abs(inct) < 10 ?inct:inct*1e-2;
|
||||||
timeR = timeR - inct;
|
timeR = timeR - inct;
|
||||||
}
|
}
|
||||||
R = R1; // 斜距
|
return ErrorCode::FAIL;
|
||||||
return ErrorCode::SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorCode GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString outworkdir, QString outlooktablePath,QString outLocalIncidenceAnglePath,bool localincAngleFlag)
|
ErrorCode GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString outworkdir, QString outlooktablePath,QString outLocalIncidenceAnglePath,bool localincAngleFlag)
|
||||||
|
|
@ -398,7 +410,7 @@ ErrorCode GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString out
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存结果
|
// 保存结果
|
||||||
omp_set_lock(&lock);
|
omp_set_lock(&lock);
|
||||||
rasterRC.saveImage(sar_r, startRId, 0, 1);
|
rasterRC.saveImage(sar_r, startRId, 0, 1);
|
||||||
|
|
@ -406,7 +418,6 @@ ErrorCode GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString out
|
||||||
|
|
||||||
omp_unset_lock(&lock);
|
omp_unset_lock(&lock);
|
||||||
|
|
||||||
|
|
||||||
Eigen::MatrixXd Angle_Arr = Eigen::MatrixXd::Zero(dem_x.rows(),dem_x.cols()).array()+181;
|
Eigen::MatrixXd Angle_Arr = Eigen::MatrixXd::Zero(dem_x.rows(),dem_x.cols()).array()+181;
|
||||||
if (localincAngleFlag) {
|
if (localincAngleFlag) {
|
||||||
Eigen::MatrixXd demslope_x = demslope.getData(startRId, 0, blockline, colcount, 1);
|
Eigen::MatrixXd demslope_x = demslope.getData(startRId, 0, blockline, colcount, 1);
|
||||||
|
|
@ -429,7 +440,6 @@ ErrorCode GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString out
|
||||||
bool antflag = false;
|
bool antflag = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (long j = 0; j < blockcols; j++) {
|
for (long j = 0; j < blockcols; j++) {
|
||||||
timeR = sar_r(i, j) / prf;
|
timeR = sar_r(i, j) / prf;
|
||||||
slopex = demslope_x(i, j);
|
slopex = demslope_x(i, j);
|
||||||
|
|
@ -446,7 +456,7 @@ ErrorCode GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString out
|
||||||
R = std::sqrt(Rst_x*Rst_x+Rst_y*Rst_y+Rst_z*Rst_z);
|
R = std::sqrt(Rst_x*Rst_x+Rst_y*Rst_y+Rst_z*Rst_z);
|
||||||
slopeR = std::sqrt(slopex*slopex + slopey * slopey + slopez * slopez);
|
slopeR = std::sqrt(slopex*slopex + slopey * slopey + slopez * slopez);
|
||||||
localangle = ((slopex * Rst_x) + (slopey * Rst_y) + (slopez * Rst_z));
|
localangle = ((slopex * Rst_x) + (slopey * Rst_y) + (slopez * Rst_z));
|
||||||
localangle = std::acos(localangle / R/slopeR)*r2d;
|
localangle = std::acos(localangle / R/slopeR)*r2d; // 角度
|
||||||
Angle_Arr(i, j) = localangle;
|
Angle_Arr(i, j) = localangle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -458,9 +468,7 @@ ErrorCode GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString out
|
||||||
localincangleRaster.saveImage(Angle_Arr, startRId, 0, 1);
|
localincangleRaster.saveImage(Angle_Arr, startRId, 0, 1);
|
||||||
}
|
}
|
||||||
else {}
|
else {}
|
||||||
|
|
||||||
omp_unset_lock(&lock);
|
omp_unset_lock(&lock);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -483,7 +491,6 @@ ErrorCode GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString out
|
||||||
|
|
||||||
ErrorCode GF3OrthSLC( QString inRasterPath, QString inlooktablePath, QString outRasterPath)
|
ErrorCode GF3OrthSLC( QString inRasterPath, QString inlooktablePath, QString outRasterPath)
|
||||||
{
|
{
|
||||||
|
|
||||||
gdalImage slcRaster(inRasterPath);//
|
gdalImage slcRaster(inRasterPath);//
|
||||||
gdalImage looktableRaster(inlooktablePath);//
|
gdalImage looktableRaster(inlooktablePath);//
|
||||||
gdalImage outRaster = CreategdalImage(outRasterPath, looktableRaster.height, looktableRaster.width, 1, looktableRaster.gt, looktableRaster.projection, true, true);// X,Y,Z
|
gdalImage outRaster = CreategdalImage(outRasterPath, looktableRaster.height, looktableRaster.width, 1, looktableRaster.gt, looktableRaster.projection, true, true);// X,Y,Z
|
||||||
|
|
@ -494,60 +501,67 @@ ErrorCode GF3OrthSLC( QString inRasterPath, QString inlooktablePath, QString out
|
||||||
return ErrorCode::FAIL;
|
return ErrorCode::FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Eigen::MatrixXd slcImg = slcRaster.getData(0, 0, slcRaster.height, slcRaster.width, 1);
|
// 分块插值计算
|
||||||
Eigen::MatrixXd sar_r = looktableRaster.getData(0, 0, looktableRaster.height, looktableRaster.width, 1);
|
long blockline = Memory1MB / looktableRaster.width / 8 * 200;//300M
|
||||||
Eigen::MatrixXd sar_c = looktableRaster.getData(0, 0, looktableRaster.height, looktableRaster.width, 2);
|
blockline = blockline < 1 ? 1 : blockline;
|
||||||
Eigen::MatrixXd outImg = outRaster.getData(0, 0, outRaster.height, outRaster.width, 1);
|
|
||||||
|
|
||||||
long lookRows = sar_r.rows();
|
int64_t allcount = 0;
|
||||||
long lookCols = sar_r.cols();
|
#pragma omp parallel for
|
||||||
|
for (long startrowid = 0; startrowid < looktableRaster.height; startrowid = startrowid + blockline) {
|
||||||
|
long tempblockline = startrowid + blockline < looktableRaster.height ? blockline : looktableRaster.height - startrowid;
|
||||||
|
Eigen::MatrixXd sar_r = looktableRaster.getData(startrowid, 0, tempblockline, looktableRaster.width, 1);
|
||||||
|
Eigen::MatrixXd sar_c = looktableRaster.getData(startrowid, 0, tempblockline, looktableRaster.width, 2);
|
||||||
|
|
||||||
long slcRows = slcImg.rows();
|
int64_t slc_min_rid = sar_r.array().minCoeff();
|
||||||
long slcCols = slcImg.cols();
|
int64_t slc_max_rid = sar_r.array().maxCoeff();
|
||||||
|
|
||||||
long lastr = 0;
|
int64_t slc_r_len = slc_max_rid - slc_min_rid+1;
|
||||||
long nextr = 0;
|
slc_min_rid = slc_min_rid < 0 ? 0 : slc_min_rid-1;
|
||||||
long lastc = 0;
|
slc_r_len = slc_r_len + 2;
|
||||||
long nextc = 0;
|
|
||||||
double Bileanervalue = 0;
|
|
||||||
// 插值
|
|
||||||
Landpoint p0{ 0,0,0 }, p11{ 0,0,0 }, p21{ 0,0,0 }, p12{ 0,0,0 }, p22{ 0,0,0 }, p{ 0,0,0 };
|
|
||||||
|
|
||||||
|
Eigen::MatrixXd slcImg = slcRaster.getData(slc_min_rid, 0, slc_r_len, slcRaster.width, 1);
|
||||||
|
Eigen::MatrixXd outImg = outRaster.getData(startrowid, 0, tempblockline, outRaster.width, 1);
|
||||||
|
|
||||||
|
long lastr = 0;
|
||||||
|
long nextr = 0;
|
||||||
|
long lastc = 0;
|
||||||
|
long nextc = 0;
|
||||||
|
double Bileanervalue = 0;
|
||||||
|
// 插值
|
||||||
|
Landpoint p0{ 0,0,0 }, p11{ 0,0,0 }, p21{ 0,0,0 }, p12{ 0,0,0 }, p22{ 0,0,0 }, p{ 0,0,0 };
|
||||||
|
|
||||||
QProgressDialog progressDialog(u8"正射图像生成中", u8"终止", 0, lookRows);
|
long lookRows = sar_r.rows();
|
||||||
progressDialog.setWindowTitle(u8"正射图像生成中");
|
long lookCols = sar_r.cols();
|
||||||
progressDialog.setWindowModality(Qt::WindowModal);
|
|
||||||
progressDialog.setAutoClose(true);
|
|
||||||
progressDialog.setValue(0);
|
|
||||||
progressDialog.setMaximum(lookRows);
|
|
||||||
progressDialog.setMinimum(0);
|
|
||||||
progressDialog.show();
|
|
||||||
|
|
||||||
for (long i = 0; i < lookRows; i++) {
|
long slcRows = slcImg.rows();
|
||||||
for (long j = 0; j < lookCols; j++) {
|
long slcCols = slcImg.cols();
|
||||||
|
|
||||||
lastr = std::floor(sar_r(i, j));
|
for (long i = 0; i < lookRows; i++) {
|
||||||
nextr = std::ceil(sar_r(i, j));
|
for (long j = 0; j < lookCols; j++) {
|
||||||
lastc = std::floor(sar_c(i, j));
|
p0 = { sar_c(i,j) - lastc, sar_r(i,j) - lastr,0 };
|
||||||
nextc = std::ceil(sar_c(i, j));
|
lastr = std::floor(sar_r(i, j));
|
||||||
if (lastr < 0 || lastc < 0 || nextr >= slcRows || nextc >= slcCols) {
|
nextr = std::ceil(sar_r(i, j));
|
||||||
continue;
|
lastc = std::floor(sar_c(i, j));
|
||||||
|
nextc = std::ceil(sar_c(i, j));
|
||||||
|
lastr = lastr - slc_min_rid;
|
||||||
|
nextr = nextr - slc_min_rid;
|
||||||
|
if (lastr < 0 || lastc < 0 || nextr >= slcRows || nextc >= slcCols) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
p11 = Landpoint{ 0,0,slcImg(lastr,lastc) };
|
||||||
|
p21 = Landpoint{ 0,1,slcImg(nextr,lastc) };
|
||||||
|
p12 = Landpoint{ 1,0,slcImg(lastr,nextc) };
|
||||||
|
p22 = Landpoint{ 1,1,slcImg(nextr,nextc) };
|
||||||
|
|
||||||
|
Bileanervalue = Bilinear_interpolation(p0, p11, p21, p12, p22);
|
||||||
|
outImg(i, j) = Bileanervalue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
p0 = { sar_c(i,j)-lastc, sar_r(i,j)-lastr,0 };
|
|
||||||
p11 = Landpoint{ 0,0,slcImg(lastr,lastc) };
|
outRaster.saveImage(outImg, startrowid, 0, 1);
|
||||||
p21 = Landpoint{ 0,1,slcImg(nextr,lastc) };
|
allcount = allcount + tempblockline;
|
||||||
p12 = Landpoint{ 1,0,slcImg(lastr,nextc) };
|
|
||||||
p22 = Landpoint{ 1,1,slcImg(nextr,nextc) };
|
|
||||||
|
|
||||||
Bileanervalue = Bilinear_interpolation(p0, p11, p21, p12, p22);
|
|
||||||
outImg(i, j) = Bileanervalue;
|
|
||||||
}
|
|
||||||
progressDialog.setValue(i);
|
|
||||||
}
|
}
|
||||||
outRaster.saveImage(outImg, 0, 0, 1);
|
return ErrorCode::SUCCESS;
|
||||||
progressDialog.close();
|
|
||||||
return ErrorCode::SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorCode GF3RDProcess(QString inxmlPath, QString indemPath, QString outworkdir, double gridx, double gridy)
|
ErrorCode GF3RDProcess(QString inxmlPath, QString indemPath, QString outworkdir, double gridx, double gridy)
|
||||||
|
|
@ -556,8 +570,8 @@ ErrorCode GF3RDProcess(QString inxmlPath, QString indemPath, QString outworkdir,
|
||||||
l1dataset.Open(inxmlPath);
|
l1dataset.Open(inxmlPath);
|
||||||
|
|
||||||
DemBox box = l1dataset.getExtend();
|
DemBox box = l1dataset.getExtend();
|
||||||
double dlon = 0.1 * (box.max_lon - box.min_lon);
|
double dlon = 0.2 * (box.max_lon - box.min_lon);
|
||||||
double dlat = 0.1 * (box.max_lat - box.min_lat);
|
double dlat = 0.2 * (box.max_lat - box.min_lat);
|
||||||
|
|
||||||
double minlat = box.min_lat - dlat;
|
double minlat = box.min_lat - dlat;
|
||||||
double minlon = box.min_lon - dlon;
|
double minlon = box.min_lon - dlon;
|
||||||
|
|
@ -572,8 +586,8 @@ ErrorCode GF3RDProcess(QString inxmlPath, QString indemPath, QString outworkdir,
|
||||||
long sourceespgcode = getProjectEPSGCodeByLon_Lat(centerlon, centerlat);
|
long sourceespgcode = getProjectEPSGCodeByLon_Lat(centerlon, centerlat);
|
||||||
long demespgcode = GetEPSGFromRasterFile(indemPath);
|
long demespgcode = GetEPSGFromRasterFile(indemPath);
|
||||||
double grid_resolution = gridx < gridy ? gridx : gridy;
|
double grid_resolution = gridx < gridy ? gridx : gridy;
|
||||||
double degreePerPixelX = grid_resolution / 110000.0;
|
double degreePerPixelX = getPixelSpacingInDegree(grid_resolution);
|
||||||
double degreePerPixelY = grid_resolution / 110000.0;
|
double degreePerPixelY = getPixelSpacingInDegree(grid_resolution);
|
||||||
bool meter2degreeflag = ConvertResolutionToDegrees(
|
bool meter2degreeflag = ConvertResolutionToDegrees(
|
||||||
sourceespgcode,
|
sourceespgcode,
|
||||||
grid_resolution,
|
grid_resolution,
|
||||||
|
|
@ -584,8 +598,8 @@ ErrorCode GF3RDProcess(QString inxmlPath, QString indemPath, QString outworkdir,
|
||||||
);
|
);
|
||||||
if (!meter2degreeflag) {
|
if (!meter2degreeflag) {
|
||||||
qDebug() << u8"转换分辨率为经纬度失败";
|
qDebug() << u8"转换分辨率为经纬度失败";
|
||||||
degreePerPixelX = grid_resolution / 110000.0;
|
degreePerPixelX = getPixelSpacingInDegree(grid_resolution);
|
||||||
degreePerPixelY = grid_resolution / 110000.0;
|
degreePerPixelY = getPixelSpacingInDegree(grid_resolution);
|
||||||
}
|
}
|
||||||
qDebug() << u8"DEM影像范围:";
|
qDebug() << u8"DEM影像范围:";
|
||||||
qDebug() << u8"输入分辨率:"<<gridx<<" \t" << gridy;
|
qDebug() << u8"输入分辨率:"<<gridx<<" \t" << gridy;
|
||||||
|
|
@ -601,7 +615,6 @@ ErrorCode GF3RDProcess(QString inxmlPath, QString indemPath, QString outworkdir,
|
||||||
QString resampleDEMPath = JoinPath(outworkdir, getFileNameWidthoutExtend(indemPath) + filename + "_clip_resample.tif");
|
QString resampleDEMPath = JoinPath(outworkdir, getFileNameWidthoutExtend(indemPath) + filename + "_clip_resample.tif");
|
||||||
resampleRaster(clipDEMPath.toUtf8().constData(), resampleDEMPath.toUtf8().constData(), degreePerPixelX, degreePerPixelY);
|
resampleRaster(clipDEMPath.toUtf8().constData(), resampleDEMPath.toUtf8().constData(), degreePerPixelX, degreePerPixelY);
|
||||||
|
|
||||||
|
|
||||||
QString outlooktablePath = JoinPath(outworkdir, getFileNameWidthoutExtend(l1dataset.getxmlFilePath()) + "_looktable.tif");
|
QString outlooktablePath = JoinPath(outworkdir, getFileNameWidthoutExtend(l1dataset.getxmlFilePath()) + "_looktable.tif");
|
||||||
QString outlocalAnglePath = JoinPath(outworkdir, getFileNameWidthoutExtend(l1dataset.getxmlFilePath()) + "_localAngle.tif");
|
QString outlocalAnglePath = JoinPath(outworkdir, getFileNameWidthoutExtend(l1dataset.getxmlFilePath()) + "_localAngle.tif");
|
||||||
|
|
||||||
|
|
@ -612,3 +625,148 @@ ErrorCode GF3RDProcess(QString inxmlPath, QString indemPath, QString outworkdir,
|
||||||
}
|
}
|
||||||
return ErrorCode::SUCCESS;
|
return ErrorCode::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ErrorCode GF3MainOrthProcess(QString inDEMPath, QString inTarFilepath, QString outworkspacefolderpath, double pixelresultionDegreee, bool excutehh2vv)
|
||||||
|
{
|
||||||
|
|
||||||
|
QProgressDialog progressDialog(u8"正射校正处理", u8"", 0, 6);
|
||||||
|
progressDialog.setWindowTitle(u8"正射校正处理");
|
||||||
|
progressDialog.setWindowModality(Qt::WindowModal);
|
||||||
|
progressDialog.setAutoClose(true);
|
||||||
|
progressDialog.setValue(0);
|
||||||
|
progressDialog.setMaximum(6);
|
||||||
|
progressDialog.setMinimum(0);
|
||||||
|
progressDialog.show();
|
||||||
|
|
||||||
|
qDebug() << u8"开始正射校正处理";
|
||||||
|
// 获取任务名称
|
||||||
|
QString tarfilename = getFileNameWidthoutExtend(inTarFilepath);
|
||||||
|
|
||||||
|
// step 1. 创建工作空间
|
||||||
|
GF3TargzFilenameClass tarnameclss=getFilename(tarfilename);
|
||||||
|
QString productionname = tarnameclss.getProductName();
|
||||||
|
QString workfolderpath = JoinPath(outworkspacefolderpath, productionname); // 工作空间
|
||||||
|
createNewFolerPath(workfolderpath, true);
|
||||||
|
qDebug() << u8"step 1. 创建工作空间 ok";
|
||||||
|
progressDialog.setValue(1);
|
||||||
|
// step 2.解压文件
|
||||||
|
QString unarchiverFolderPath = JoinPath(workfolderpath, u8"unarchiver");
|
||||||
|
createNewFolerPath(unarchiverFolderPath, true);
|
||||||
|
unTarfile(inTarFilepath, unarchiverFolderPath);
|
||||||
|
qDebug() << u8"step 2.解压文件 ok";
|
||||||
|
progressDialog.setValue(2);
|
||||||
|
// 在解压文件夹中以及子文件夹查找meta.xml文件
|
||||||
|
QFileInfoList metalist = findFilePath(unarchiverFolderPath, u8"*.meta.xml");
|
||||||
|
if (metalist.count() !=1) {
|
||||||
|
qWarning() << u8"目标文件夹发现了多个meta.xml,不符合规则";
|
||||||
|
QMessageBox::warning(nullptr, u8"警告", QString(u8"%1:%2").arg(tarfilename).arg(u8"目标文件夹发现了多个meta.xml,不符合规则"));
|
||||||
|
return ErrorCode::METAXMLFOUNDERROR;
|
||||||
|
}
|
||||||
|
else {}
|
||||||
|
QString metaxmlpath = metalist[0].canonicalFilePath();
|
||||||
|
|
||||||
|
// step 3.文件转换为通用L1A文件
|
||||||
|
QString L1AFolder = JoinPath(workfolderpath, u8"L1AFolder");
|
||||||
|
createNewFolerPath(L1AFolder);
|
||||||
|
ImportGF3L1AProcess(metaxmlpath, L1AFolder);
|
||||||
|
qDebug() << u8"step 3.文件转换为通用L1A文件 ok";
|
||||||
|
progressDialog.setValue(3);
|
||||||
|
// step 4. 幅度转amp
|
||||||
|
QFileInfoList xmlfilelist = findFilePath(L1AFolder, u8"*.xml");
|
||||||
|
if (xmlfilelist.count() == 0) {
|
||||||
|
qWarning() << u8"目标文件夹没有发现了L1A数据 xml,不符合规则";
|
||||||
|
QMessageBox::warning(nullptr, u8"警告", QString(u8"%1:%2").arg(tarfilename).arg(u8"目标文件夹没有发现了L1A数据 xml,不符合规则"));
|
||||||
|
return ErrorCode::METAXMLFOUNDERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString outampfolder = JoinPath(workfolderpath, u8"ampRaster");
|
||||||
|
createNewFolerPath(outampfolder);
|
||||||
|
for (long i = 0; i < xmlfilelist.count(); i++) {
|
||||||
|
|
||||||
|
QString filename = getFileNameWidthoutExtend(xmlfilelist[i].canonicalFilePath());
|
||||||
|
QString l2bfilename = filename + "_amp";
|
||||||
|
QString folderpath = getParantFromPath(xmlfilelist[i].canonicalFilePath());
|
||||||
|
SARSimulationImageL1Dataset slcl1(RasterLevel::RasterSLC);
|
||||||
|
slcl1.Open(folderpath, filename);
|
||||||
|
|
||||||
|
|
||||||
|
SARSimulationImageL1Dataset l1B(RasterLevel::RasterL1B);
|
||||||
|
l1B.OpenOrNew(outampfolder, l2bfilename, slcl1.getrowCount(), slcl1.getcolCount());
|
||||||
|
QString srcxmlpath = slcl1.getxmlFilePath();
|
||||||
|
QString tarxmlpath = l1B.getxmlFilePath();
|
||||||
|
copyAndReplaceFile(srcxmlpath, tarxmlpath);
|
||||||
|
l1B.loadFromXml();
|
||||||
|
QString imgfilepath = slcl1.getImageRasterPath();
|
||||||
|
Complex2AmpRaster(imgfilepath, l1B.getImageRasterPath()); // 转振幅
|
||||||
|
}
|
||||||
|
progressDialog.setValue(4);
|
||||||
|
// step 5. 创建正射查找表
|
||||||
|
QString L1AXmlPath = xmlfilelist[0].canonicalFilePath();
|
||||||
|
QString looktablefolderpath = JoinPath(workfolderpath, u8"looktableRaster");
|
||||||
|
createNewFolerPath(looktablefolderpath);
|
||||||
|
if (GF3RDProcess(L1AXmlPath, inDEMPath, looktablefolderpath, pixelresultionDegreee, pixelresultionDegreee) == SUCCESS) {
|
||||||
|
qDebug()<<(u8"正射表生成成功");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
qDebug() << (u8"正射表生成失败");
|
||||||
|
}
|
||||||
|
progressDialog.setValue(5);
|
||||||
|
qDebug() << u8"step 4. 创建正射查找表 ok";
|
||||||
|
// step 6. 影像正射
|
||||||
|
QFileInfoList looktableRasterPathList = findFilePath(looktablefolderpath, u8"*_looktable.tif");
|
||||||
|
if (looktableRasterPathList.count() != 1) {
|
||||||
|
qWarning() << u8"目标文件夹发现了多个查找表,不符合规则";
|
||||||
|
QMessageBox::warning(nullptr, u8"警告", QString(u8"%1:%2").arg(tarfilename).arg(u8"目标文件夹发现了多个查找表,不符合规则"));
|
||||||
|
return ErrorCode::METAXMLFOUNDERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
// step 6.1 影像入射角
|
||||||
|
QFileInfoList looktableAngleRasterPathList = findFilePath(looktablefolderpath, u8"*_localAngle.tif");
|
||||||
|
if (looktableAngleRasterPathList.count() != 1) {
|
||||||
|
qWarning() << u8"目标文件夹应该只有1个入射角,不符合规则";
|
||||||
|
QMessageBox::warning(nullptr, u8"警告", QString(u8"%1:%2").arg(tarfilename).arg(u8"目标文件夹发现了1个入射角,不符合规则"));
|
||||||
|
return ErrorCode::METAXMLFOUNDERROR;
|
||||||
|
}
|
||||||
|
QString lookincidenceAnglePath = looktableAngleRasterPathList[0].canonicalFilePath();
|
||||||
|
QString looktableRasterPath = looktableRasterPathList[0].canonicalFilePath();
|
||||||
|
QString outworkpath = JoinPath(workfolderpath, u8"orth");
|
||||||
|
createNewFolerPath(outworkpath, true);
|
||||||
|
QFileInfoList l2filelist = findFilePath(outampfolder,u8"*.xml");
|
||||||
|
for (long i = 0; i < l2filelist.count(); i++) {
|
||||||
|
QString inl2filepath = l2filelist[i].canonicalFilePath();
|
||||||
|
SARSimulationImageL1Dataset l1B(RasterLevel::RasterL1B);
|
||||||
|
l1B.Open(inl2filepath);
|
||||||
|
QString inRaster = l1B.getImageRasterPath();
|
||||||
|
QString outname = getFileNameWidthoutExtend(inRaster) + "_orth.tif";
|
||||||
|
QString outstringpath = JoinPath(outworkpath, outname);
|
||||||
|
if (GF3OrthSLC(inRaster, looktableRasterPath, outstringpath) == SUCCESS) {
|
||||||
|
qDebug() << (u8"正射生成成功");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
qDebug() << (u8"正射生成失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
qDebug() << u8"step 5. 正射影像生成 ok";
|
||||||
|
// step 6.2 生成HH2VV
|
||||||
|
POLARTYPEENUM poltype = getDatasetGF3FilePolsarType(outname);
|
||||||
|
if (poltype == POLARHH && excutehh2vv) {
|
||||||
|
qDebug() << u8"HH2VV生成中:"<< outstringpath;
|
||||||
|
QString intempHH2VV = JoinPath(outworkpath, getFileNameWidthoutExtend(outstringpath) + "_HH2VV_dB.tif");
|
||||||
|
GF3_Sigma0_HH2VV(outstringpath, looktableRasterPath,intempHH2VV);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 将amp转换为sigma0
|
||||||
|
QString intempHH2VV = JoinPath(outworkpath, getFileNameWidthoutExtend(outstringpath) + "_HH2VV_dB.tif");
|
||||||
|
amp2dBRaster(outstringpath, intempHH2VV);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//qDebug() << u8"HH2VV不需要生成";
|
||||||
|
}
|
||||||
|
qDebug() << u8"step 6. HH2VV生成 ok";
|
||||||
|
|
||||||
|
}
|
||||||
|
progressDialog.setValue(6);
|
||||||
|
progressDialog.close();
|
||||||
|
return ErrorCode::SUCCESS;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
#pragma once
|
||||||
|
#ifndef __GF3CALIBRATIONANDGEOCODINGCLASS__H__
|
||||||
|
#define __GF3CALIBRATIONANDGEOCODINGCLASS__H__
|
||||||
|
#include "gf3calibrationandorthlib_global.h"
|
||||||
|
#include "BaseConstVariable.h"
|
||||||
|
#include "ImageOperatorBase.h"
|
||||||
|
#include "LogInfoCls.h"
|
||||||
|
#include "SARSimulationImageL1.h"
|
||||||
|
#include "GF3PSTNClass.h"
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
|
// 数据定标
|
||||||
|
ErrorCode GF3CALIBRATIONANDORTHLIB_EXPORT GF3CalibrationRaster(QString inRasterPath, QString outRasterPath, double Qualifyvalue, double calibrationConst);
|
||||||
|
|
||||||
|
ErrorCode GF3CALIBRATIONANDORTHLIB_EXPORT ImportGF3L1ARasterToWorkspace(QString inMetaxmlPath,QString inRasterPath, QString outWorkDirPath, POLARTYPEENUM polsartype);
|
||||||
|
|
||||||
|
QVector<QString> GF3CALIBRATIONANDORTHLIB_EXPORT SearchGF3DataTiff(QString inMetaxmlPath);
|
||||||
|
|
||||||
|
POLARTYPEENUM GF3CALIBRATIONANDORTHLIB_EXPORT getDatasetGF3FilePolsarType(QString fileName);
|
||||||
|
|
||||||
|
ErrorCode GF3CALIBRATIONANDORTHLIB_EXPORT ImportGF3L1AProcess(QString inMetaxmlPath, QString outWorkDirPath);
|
||||||
|
|
||||||
|
// RD 算法类
|
||||||
|
ErrorCode GF3CALIBRATIONANDORTHLIB_EXPORT RD_PSTN(double& refrange,double& lamda, double& timeR, double& R, double& tx, double& ty, double& tz, double& slopex, double& slopey, double& slopez, GF3PolyfitSatelliteOribtModel& polyfitmodel, SatelliteOribtNode& node,double& d0,double& d1, double& d2, double& d3, double& d4);
|
||||||
|
|
||||||
|
//创建查找表
|
||||||
|
ErrorCode GF3CALIBRATIONANDORTHLIB_EXPORT GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString outworkdir, QString outlooktablePath, QString outLocalIncidenceAnglePath, bool localincAngleFlag=false);
|
||||||
|
ErrorCode GF3CALIBRATIONANDORTHLIB_EXPORT GF3OrthSLC( QString inRasterPath, QString inlooktablePath, QString outRasterPath);
|
||||||
|
|
||||||
|
// 正射处理流程
|
||||||
|
ErrorCode GF3CALIBRATIONANDORTHLIB_EXPORT GF3RDProcess(QString inxmlPath, QString indemPath, QString outworkdir, double gridx, double gridy);
|
||||||
|
|
||||||
|
|
||||||
|
// 正射+校正处理流程
|
||||||
|
ErrorCode GF3CALIBRATIONANDORTHLIB_EXPORT GF3MainOrthProcess(QString inDEMPath, QString inTarFilepath, QString outworkspacefolderpath, double pixelresultionDegreee, bool excutehh2vv = false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
#include "GF3CalibrationAndOrthLib.h"
|
||||||
|
#include "BaseConstVariable.h"
|
||||||
|
#include "RasterToolBase.h"
|
||||||
|
#include "ImageOperatorBase.h"
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QFile>
|
||||||
|
#include <memory>
|
||||||
|
#include "FileOperator.h"
|
||||||
|
#include "GPUBaseTool.h"
|
||||||
|
#include "GPUTool.cuh"
|
||||||
|
#include <omp.h>
|
||||||
|
// GPU相关的代码
|
||||||
|
#include "GF3CalibrationGeoCodingFunCUDA.cuh"
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 将HH极化转换为VV极化
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="in_SigmaHHRasterPath"></param>
|
||||||
|
/// <param name="in_IncidencAngleRasterPath"></param>
|
||||||
|
/// <param name="out_SigmaVVRasterPath"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
int GF3_Sigma0_HH2VV(QString in_SigmaHHRasterPath, QString in_IncidencAngleRasterPath, QString out_SigmaVVRasterPath, SIGMATYPE sigmatype)
|
||||||
|
{
|
||||||
|
// step 1 检查输入合法性
|
||||||
|
{
|
||||||
|
// 1. 检查输入合法性
|
||||||
|
if (in_SigmaHHRasterPath.isEmpty() || in_IncidencAngleRasterPath.isEmpty() || out_SigmaVVRasterPath.isEmpty())
|
||||||
|
{
|
||||||
|
qDebug() << "Input or output file path is empty.";
|
||||||
|
throw std::invalid_argument("Input or output file path is empty.");
|
||||||
|
return 1; // 代表输入或输出文件路径为空
|
||||||
|
}
|
||||||
|
// 2. 检查输入影像是否存在
|
||||||
|
if (!QFile::exists(in_SigmaHHRasterPath) || !QFile::exists(in_IncidencAngleRasterPath))
|
||||||
|
{
|
||||||
|
qDebug() << "Input file does not exist.";
|
||||||
|
throw std::runtime_error("Input file does not exist.");
|
||||||
|
return 2; // 代表输入文件不存在
|
||||||
|
}
|
||||||
|
gdalImage inSigmaHHRaster(in_SigmaHHRasterPath);
|
||||||
|
gdalImage inIncidencAngleRaster(in_IncidencAngleRasterPath);
|
||||||
|
// 3. 检查输入影像大小是否一致
|
||||||
|
if (inSigmaHHRaster.width != inIncidencAngleRaster.width || inSigmaHHRaster.height != inIncidencAngleRaster.height)
|
||||||
|
{
|
||||||
|
qDebug() << "Input images have different sizes.";
|
||||||
|
throw std::runtime_error("Input images have different sizes.");
|
||||||
|
return 3; // 代表输入影像大小不一致
|
||||||
|
}
|
||||||
|
|
||||||
|
// 复制输入文件到输出文件
|
||||||
|
copyFile(in_SigmaHHRasterPath, out_SigmaVVRasterPath);
|
||||||
|
// 4. 检查输出文件是否存在
|
||||||
|
if (!QFile::exists(out_SigmaVVRasterPath))
|
||||||
|
{
|
||||||
|
qDebug() << "Output file does not exist.";
|
||||||
|
throw std::runtime_error("Output file does not exist.");
|
||||||
|
return 4; // 代表输出文件不存在
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// step 2 执行操作
|
||||||
|
{
|
||||||
|
gdalImage inSigmaHHRaster(in_SigmaHHRasterPath);
|
||||||
|
gdalImage inIncidencAngleRaster(in_IncidencAngleRasterPath);
|
||||||
|
gdalImage outSigmaVVRaster(out_SigmaVVRasterPath);
|
||||||
|
|
||||||
|
long width = inSigmaHHRaster.width;
|
||||||
|
long height = inSigmaHHRaster.height;
|
||||||
|
|
||||||
|
int64_t pixel_count64 = static_cast<int64_t>(height) * static_cast<int64_t>(width);
|
||||||
|
// 读取输入影像数据
|
||||||
|
std::shared_ptr<double> sigmaHHRasterData = readDataArr<double>(inSigmaHHRaster, 0, 0, height, width, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||||
|
std::shared_ptr<double> incidenceAngleData = readDataArr<double>(inIncidencAngleRaster, 0, 0, height, width, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||||
|
std::shared_ptr<double> outSigmaVVRasterData = readDataArr<double>(outSigmaVVRaster, 0, 0, height, width, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||||
|
|
||||||
|
#pragma omp parallel for
|
||||||
|
for (int64_t i = 0; i < pixel_count64; i++)
|
||||||
|
{
|
||||||
|
double sigmaHH = sigmaHHRasterData.get()[i];
|
||||||
|
sigmaHH = converSigma2amp(sigmaHH,sigmatype);
|
||||||
|
double incidenceAngle = incidenceAngleData.get()[i];// 角度
|
||||||
|
sigmaHH = 20 * log10(sigmaHH);
|
||||||
|
double sigmaVV = polartionConver_d(sigmaHH, incidenceAngle, 1.0, false); // 输出dB值
|
||||||
|
outSigmaVVRasterData.get()[i] = sigmaVV;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存输出影像数据
|
||||||
|
outSigmaVVRaster.saveImage(outSigmaVVRasterData,0,0,height,width,1);
|
||||||
|
// 释放内存
|
||||||
|
sigmaHHRasterData.reset();
|
||||||
|
incidenceAngleData.reset();
|
||||||
|
outSigmaVVRasterData.reset();
|
||||||
|
|
||||||
|
}
|
||||||
|
return -1;// 代表执行成功
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
#pragma once
|
||||||
|
/**
|
||||||
|
* 用于GF3影像的几何校正和正射处理的数据库
|
||||||
|
* @file GF3CalibrationAndOrthLib.h
|
||||||
|
* @brief GF3影像几何校正和正射处理的数据库
|
||||||
|
* @details
|
||||||
|
* 本库用于GF3影像的几何校正和正射处理,主要操作包括HH->VV极化的转换、影像的几何校正和正射处理等。
|
||||||
|
* 本库的实现基于GF3影像的几何校正和正射处理的相关算法,具体实现细节请参考相关文献。
|
||||||
|
* @author 陈增辉
|
||||||
|
*/
|
||||||
|
#ifndef __GF3CALIBRATIONANDORTHLIB__H__
|
||||||
|
#define __GF3CALIBRATIONANDORTHLIB__H__
|
||||||
|
#include "gf3calibrationandorthlib_global.h"
|
||||||
|
#include <QString>
|
||||||
|
#include "BaseConstVariable.h"
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 将HH极化的雷达散射系数转换为VV极化的雷达散射系数
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="in_SigmaHHRasterPath"></param>
|
||||||
|
/// <param name="in_IncidencAngleRasterPath"></param>
|
||||||
|
/// <param name="out_SigmaVVRasterPath"></param>
|
||||||
|
/// <param name="isVVPolar"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
int GF3CALIBRATIONANDORTHLIB_EXPORT GF3_Sigma0_HH2VV(QString in_SigmaHHRasterPath, QString in_IncidencAngleRasterPath, QString out_SigmaVVRasterPath, SIGMATYPE sigmatype= SIGMATYPE::AMPVALUE);
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,154 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="17.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>{886F7829-AF74-4F23-B3BE-29B7B3C9843C}</ProjectGuid>
|
||||||
|
<Keyword>QtVS_v304</Keyword>
|
||||||
|
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||||
|
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||||
|
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</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>tools_qt5</QtInstall>
|
||||||
|
<QtModules>core</QtModules>
|
||||||
|
<QtBuildConfig>debug</QtBuildConfig>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||||
|
<QtInstall>tools_qt5</QtInstall>
|
||||||
|
<QtModules>core;xml;opengl;gui;xmlpatterns;widgets;quick;dbus;datavisualization</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">
|
||||||
|
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 12.6.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<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'">
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<IncludePath>.;..\GPUBaseLib\GPUTool;..\GPUBaseLib;..\BaseCommonLibrary\ToolAbstract;..\BaseCommonLibrary\BaseTool;..\BaseCommonLibrary;$(IncludePath)</IncludePath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<CudaCompile>
|
||||||
|
<InterleaveSourceInPTX>true</InterleaveSourceInPTX>
|
||||||
|
</CudaCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<CudaCompile>
|
||||||
|
<CodeGeneration>compute_86,sm_86</CodeGeneration>
|
||||||
|
<GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
|
||||||
|
</CudaCompile>
|
||||||
|
<ClCompile>
|
||||||
|
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||||
|
<OpenMPSupport>true</OpenMPSupport>
|
||||||
|
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||||
|
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>cufft.lib;cudart.lib;cudadevrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<PreprocessorDefinitions>GF3CALIBRATIONANDORTHLIB_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<PreprocessorDefinitions>GF3CALIBRATIONANDORTHLIB_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="GF3PSTNClass.cpp" />
|
||||||
|
<ClCompile Include="GF3Util.cpp" />
|
||||||
|
<ClCompile Include="SatelliteGF3xmlParser.cpp" />
|
||||||
|
<ClCompile Include="SateOrbit.cpp" />
|
||||||
|
<ClInclude Include="GF3CalibrationAndGeocodingClass.h" />
|
||||||
|
<ClInclude Include="gf3calibrationandorthlib_global.h" />
|
||||||
|
<ClInclude Include="GF3CalibrationAndOrthLib.h" />
|
||||||
|
<ClCompile Include="GF3CalibrationAndGeocodingClass.cpp" />
|
||||||
|
<ClCompile Include="GF3CalibrationAndOrthLib.cpp" />
|
||||||
|
<ClInclude Include="GF3CalibrationGecodingBaseFuntion.h" />
|
||||||
|
<ClInclude Include="GF3PSTNClass.h" />
|
||||||
|
<ClInclude Include="GF3Util.h" />
|
||||||
|
<ClInclude Include="SatelliteGF3xmlParser.h" />
|
||||||
|
<ClInclude Include="SateOrbit.h" />
|
||||||
|
<CudaCompile Include="GF3CalibrationGeoCodingFunCUDA.cuh" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\BaseCommonLibrary\BaseCommonLibrary.vcxproj">
|
||||||
|
<Project>{872ecd6f-30e3-4a1b-b17c-15e87d373ff6}</Project>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\GPUBaseLib\GPUBaseLib.vcxproj">
|
||||||
|
<Project>{b8b40c54-f7fe-4809-b6fb-8bc014570d7b}</Project>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<CudaCompile Include="GF3CalibrationGeoCodingFunCUDA.cu" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||||
|
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 12.6.targets" />
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
<?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>
|
||||||
|
<ClInclude Include="gf3calibrationandorthlib_global.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClCompile Include="GF3CalibrationAndOrthLib.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClInclude Include="GF3CalibrationAndOrthLib.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="GF3CalibrationGecodingBaseFuntion.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="GF3CalibrationAndGeocodingClass.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="GF3PSTNClass.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="SatelliteGF3xmlParser.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="SateOrbit.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="GF3Util.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<CudaCompile Include="GF3CalibrationGeoCodingFunCUDA.cu" />
|
||||||
|
<CudaCompile Include="GF3CalibrationGeoCodingFunCUDA.cuh" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="GF3CalibrationAndGeocodingClass.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="GF3PSTNClass.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="SatelliteGF3xmlParser.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="SateOrbit.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="GF3Util.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
#pragma once
|
||||||
|
#ifndef __GF3CALIBRATIONGECODINGBASEFUNTION__H__
|
||||||
|
#define __GF3CALIBRATIONGECODINGBASEFUNTION__H__
|
||||||
|
#include "gf3calibrationandorthlib_global.h"
|
||||||
|
#include "BaseConstVariable.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif // __GF3CALIBRATIONGECODINGBASEFUNTION__H__
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
#include "GF3CalibrationGeoCodingFunCUDA.cuh"
|
||||||
|
#include <cmath>
|
||||||
|
#include <complex>
|
||||||
|
#include <device_launch_parameters.h>
|
||||||
|
#include <cuda_runtime.h>
|
||||||
|
#include <cufft.h>
|
||||||
|
#include <cufftw.h>
|
||||||
|
#include <cufftXt.h>
|
||||||
|
#include <cublas_v2.h>
|
||||||
|
#include <cuComplex.h>
|
||||||
|
#include <chrono>
|
||||||
|
#include "BaseConstVariable.h"
|
||||||
|
#include "GPUTool.cuh"
|
||||||
|
|
||||||
|
|
||||||
|
__device__ __host__ float Computrer_polartionConver_rpol_f(float inangle, float alpha)
|
||||||
|
{
|
||||||
|
float tang = 0.0;
|
||||||
|
if (inangle <= 0.0) {
|
||||||
|
tang = 0.0;
|
||||||
|
}
|
||||||
|
else if (inangle > 90.0) {
|
||||||
|
tang = 90.0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tang = inangle;
|
||||||
|
}
|
||||||
|
tang = tang * PI / 180.0;
|
||||||
|
float tan_val = tanf(tang);
|
||||||
|
float rpol = powf((1.0 + 2.0 * tan_val * tan_val), 2) / powf((1.0 + alpha * tan_val * tan_val), 2);
|
||||||
|
return rpol;
|
||||||
|
}
|
||||||
|
|
||||||
|
__device__ __host__ double Computrer_polartionConver_rpol_d(double inangle, double alpha)
|
||||||
|
{
|
||||||
|
double tang = 0.0;
|
||||||
|
if (inangle <= 0.0) {
|
||||||
|
tang = 0.0;
|
||||||
|
}
|
||||||
|
else if (inangle > 90.0) {
|
||||||
|
tang = 90.0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tang = inangle;
|
||||||
|
}
|
||||||
|
tang = tang * PI / 180.0;
|
||||||
|
double tan_val = tan(tang);
|
||||||
|
double rpol = pow((1.0 + 2.0 * tan_val * tan_val), 2) / pow((1.0 + alpha * tan_val * tan_val), 2);
|
||||||
|
return rpol;
|
||||||
|
}
|
||||||
|
|
||||||
|
__host__ __device__ float polartionConver_f(float insig, float inangle, float alpha , bool isvv )
|
||||||
|
{
|
||||||
|
float rpol = Computrer_polartionConver_rpol_f(inangle, alpha);
|
||||||
|
|
||||||
|
// dB转线性
|
||||||
|
float insig_linear = powf(10.0, insig / 10.0);
|
||||||
|
float osig = 0.0;
|
||||||
|
if (isvv) { // C: VV->HH
|
||||||
|
osig = insig_linear * rpol;
|
||||||
|
// 返回线性值
|
||||||
|
return osig;
|
||||||
|
}
|
||||||
|
else { // L: HH->VV
|
||||||
|
osig = insig_linear / rpol;
|
||||||
|
// 返回dB值
|
||||||
|
return 10.0 * log10f(osig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GPUComputePolarizationConver_f(float* insig, float* inangle, float* alpha, bool isvv, int count, float* outsig)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void GPUComputePolarizationConver_d(double* insig, double* inangle, double* alpha, bool isvv, int count, double* outsig)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__host__ __device__ double polartionConver_d(double insig, double inangle, double alpha , bool isvv )
|
||||||
|
{
|
||||||
|
double rpol = Computrer_polartionConver_rpol_d(inangle, alpha);
|
||||||
|
|
||||||
|
// dB转线性
|
||||||
|
double insig_linear = pow(10.0, insig / 10.0);
|
||||||
|
double osig = 0.0;
|
||||||
|
if (isvv) { // C: VV->HH
|
||||||
|
osig = insig_linear * rpol;
|
||||||
|
// 返回dB值
|
||||||
|
return 10.0 * log10(osig);
|
||||||
|
} else { // L: HH->VV
|
||||||
|
osig = insig_linear / rpol;
|
||||||
|
// 返回dB值
|
||||||
|
return 10.0 * log10(osig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 核函数部分 ******************************************************************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 对外调用函数部分 ******************************************************************************************************************************/
|
||||||
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
#ifndef __GF3CALIBRATIONGEOCODINGFUNCUDA__H__
|
||||||
|
#define __GF3CALIBRATIONGEOCODINGFUNCUDA__H__
|
||||||
|
#include "gf3calibrationandorthlib_global.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include "BaseConstVariable.h"
|
||||||
|
#include "GPUTool.cuh"
|
||||||
|
#include <cuda_runtime.h>
|
||||||
|
#include <device_launch_parameters.h>
|
||||||
|
#include <cublas_v2.h>
|
||||||
|
#include <cuComplex.h>
|
||||||
|
|
||||||
|
/** 核函数 *********************************************************************************************************************/
|
||||||
|
/// <summary>
|
||||||
|
/// 计算极化转换系数(float)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inangle">入射角</param>
|
||||||
|
/// <param name="alpha">转换参数</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
extern __device__ __host__ float Computrer_polartionConver_rpol_f(float inangle, float alpha = 1);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 计算极化转换系数 (double)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inangle">入射角</param>
|
||||||
|
/// <param name="alpha">转换参数</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
extern __device__ __host__ double Computrer_polartionConver_rpol_d(double inangle, double alpha = 1);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 后向散射系数变换函数
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="insig">sigma0 (dB)</param>
|
||||||
|
/// <param name="inangle">入射角 (度)</param>
|
||||||
|
/// <param name="alpha">默认1,基尔霍夫模型,0.6为汤姆森</param>
|
||||||
|
/// <param name="isvv">true表示输入为VV,false为HH</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
extern __host__ __device__ double polartionConver_d(double insig, double inangle, double alpha = 1.0, bool isvv = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 后向散射系数变换函数
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="insig">sigma0 (dB)</param>
|
||||||
|
/// <param name="inangle">入射角 (度)</param>
|
||||||
|
/// <param name="alpha">默认1,基尔霍夫模型,0.6为汤姆森</param>
|
||||||
|
/// <param name="isvv">true表示输入为VV,false为HH</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
extern __host__ __device__ float polartionConver_f(float insig, float inangle, float alpha = 1.0, bool isvv = true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 对外调用函数部分 ******************************************************************************************************************************/
|
||||||
|
|
||||||
|
extern "C" void GPUComputePolarizationConver_f(
|
||||||
|
float* insig, float* inangle, float* alpha,
|
||||||
|
bool isvv, int count,
|
||||||
|
float* outsig
|
||||||
|
);
|
||||||
|
extern "C" void GPUComputePolarizationConver_d(
|
||||||
|
double* insig, double* inangle, double* alpha,
|
||||||
|
bool isvv, int count,
|
||||||
|
double* outsig
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#ifndef __GF3PSTNCLASS_H__
|
||||||
|
#define __GF3PSTNCLASS_H__
|
||||||
|
|
||||||
|
|
||||||
|
#include "gf3calibrationandorthlib_global.h"
|
||||||
|
|
||||||
|
|
||||||
#include "LogInfoCls.h"
|
#include "LogInfoCls.h"
|
||||||
#include "BaseConstVariable.h"
|
#include "BaseConstVariable.h"
|
||||||
|
|
@ -14,7 +15,7 @@
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 多项式轨道模型
|
/// 多项式轨道模型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class GF3PolyfitSatelliteOribtModel
|
class GF3CALIBRATIONANDORTHLIB_EXPORT GF3PolyfitSatelliteOribtModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GF3PolyfitSatelliteOribtModel();
|
GF3PolyfitSatelliteOribtModel();
|
||||||
|
|
@ -43,8 +44,9 @@ public: //
|
||||||
virtual void setAntnnaAxisY(double X, double Y, double Z) ; // 设置天线X轴指向
|
virtual void setAntnnaAxisY(double X, double Y, double Z) ; // 设置天线X轴指向
|
||||||
virtual void setAntnnaAxisZ(double X, double Y, double Z) ; // 设置天线X轴指向
|
virtual void setAntnnaAxisZ(double X, double Y, double Z) ; // 设置天线X轴指向
|
||||||
|
|
||||||
virtual ErrorCode getAntnnaDirection(SatelliteOribtNode& node) ; // 获取天线指向方向
|
virtual ErrorCode getAntnnaDirection(SatelliteOribtNode& node); // »ñÈ¡ÌìÏßÖ¸Ïò·½Ïò
|
||||||
virtual ErrorCode getZeroDopplerAntDirect(SatelliteOribtNode& node) ;
|
virtual ErrorCode getZeroDopplerAntDirect(SatelliteOribtNode& node);
|
||||||
|
|
||||||
private: // 变量
|
private: // 变量
|
||||||
long double oribtStartTime; // 卫星模型参考时间
|
long double oribtStartTime; // 卫星模型参考时间
|
||||||
double beamAngle; // 波位角
|
double beamAngle; // 波位角
|
||||||
|
|
@ -93,16 +95,14 @@ public:
|
||||||
//virtual void setPt(double Pt);
|
//virtual void setPt(double Pt);
|
||||||
//virtual void setGri(double gri);
|
//virtual void setGri(double gri);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double Pt; // 发射电压
|
double Pt; // 发射电压
|
||||||
double Gri;// 系统增益
|
double Gri;// 系统增益
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
std::shared_ptr<GF3PolyfitSatelliteOribtModel> CreataGF3PolyfitSatelliteOribtModel(std::vector<SatelliteOribtNode>& nodes, long double startTime, int polynum = 3);
|
std::shared_ptr<GF3PolyfitSatelliteOribtModel> GF3CALIBRATIONANDORTHLIB_EXPORT CreataGF3PolyfitSatelliteOribtModel(std::vector<SatelliteOribtNode>& nodes, long double startTime, int polynum = 3);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
#include "GF3Util.h"
|
||||||
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
|
GF3TargzFilenameClass getFilename(QString filename)
|
||||||
|
{
|
||||||
|
return GF3TargzFilenameClass(filename);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GF3TargzFilenameClass::GF3TargzFilenameClass(QString filename)
|
||||||
|
{
|
||||||
|
// GF3_KAS_FSI_020253_E110.8_N25.5_20200614_L1A_HHHV_L10004871459.tar.gz
|
||||||
|
QStringList filelist = filename.split("_");
|
||||||
|
|
||||||
|
this->sateName = filelist[0];
|
||||||
|
this->RevStateName = filelist[1];
|
||||||
|
this->ImageMode = filelist[2];
|
||||||
|
this->OribtName = filelist[3];
|
||||||
|
this->CenterLon = filelist[4].left(1).toDouble();
|
||||||
|
this->CenterLat = filelist[5].left(1).toDouble();
|
||||||
|
this->DateName = filelist[6];
|
||||||
|
this->levelName = filelist[7];
|
||||||
|
this->PolarName = filelist[8];
|
||||||
|
this->ProductName = filelist[9];
|
||||||
|
if (this->ProductName.contains(".")) {
|
||||||
|
this->ProductName = this->ProductName.split(".")[0];
|
||||||
|
}else{}
|
||||||
|
}
|
||||||
|
|
||||||
|
GF3TargzFilenameClass::~GF3TargzFilenameClass()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QString GF3TargzFilenameClass::getSateName() const
|
||||||
|
{
|
||||||
|
return sateName;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString GF3TargzFilenameClass::getRevStateName() const
|
||||||
|
{
|
||||||
|
return RevStateName;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString GF3TargzFilenameClass::getImageMode() const
|
||||||
|
{
|
||||||
|
return ImageMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString GF3TargzFilenameClass::getOribtName() const
|
||||||
|
{
|
||||||
|
return OribtName;
|
||||||
|
}
|
||||||
|
|
||||||
|
double GF3TargzFilenameClass::getCenterLon() const
|
||||||
|
{
|
||||||
|
return CenterLon;
|
||||||
|
}
|
||||||
|
|
||||||
|
double GF3TargzFilenameClass::getCenterLat() const
|
||||||
|
{
|
||||||
|
return CenterLat;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString GF3TargzFilenameClass::getDateName() const
|
||||||
|
{
|
||||||
|
return DateName;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString GF3TargzFilenameClass::getLevelName() const
|
||||||
|
{
|
||||||
|
return levelName;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString GF3TargzFilenameClass::getPolarName() const
|
||||||
|
{
|
||||||
|
return PolarName;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString GF3TargzFilenameClass::getProductName() const
|
||||||
|
{
|
||||||
|
return ProductName;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
#pragma once
|
||||||
|
#ifndef __GF3UTIL_H__
|
||||||
|
#define __GF3UTIL_H__
|
||||||
|
#include "gf3calibrationandorthlib_global.h"
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
class GF3CALIBRATIONANDORTHLIB_EXPORT GF3TargzFilenameClass {
|
||||||
|
// GF3_KAS_FSI_020253_E110.8_N25.5_20200614_L1A_HHHV_L10004871459.tar.gz
|
||||||
|
|
||||||
|
public:
|
||||||
|
GF3TargzFilenameClass(QString filename);
|
||||||
|
~GF3TargzFilenameClass();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString sateName;
|
||||||
|
QString RevStateName;
|
||||||
|
QString ImageMode;
|
||||||
|
QString OribtName;
|
||||||
|
double CenterLon;
|
||||||
|
double CenterLat;
|
||||||
|
QString DateName;
|
||||||
|
QString levelName;
|
||||||
|
QString PolarName;
|
||||||
|
QString ProductName;
|
||||||
|
|
||||||
|
public:
|
||||||
|
QString getSateName() const; //{ return sateName; }
|
||||||
|
QString getRevStateName() const;// { return RevStateName; }
|
||||||
|
QString getImageMode() const; //{ return ImageMode; }
|
||||||
|
QString getOribtName() const; //{ return OribtName; }
|
||||||
|
double getCenterLon() const; //{ return CenterLon; }
|
||||||
|
double getCenterLat() const; //{ return CenterLat; }
|
||||||
|
QString getDateName() const; //{ return DateName; }
|
||||||
|
QString getLevelName() const; //{ return levelName; }
|
||||||
|
QString getPolarName() const;// { return PolarName; }
|
||||||
|
QString getProductName() const; //{ return ProductName; }
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GF3TargzFilenameClass GF3CALIBRATIONANDORTHLIB_EXPORT getFilename(QString filename);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -41,27 +41,19 @@ Eigen::MatrixX<double> OrbitPoly::SatelliteSpacePoint(long double satellitetime)
|
||||||
if (this->polySatellitePara.rows() != polynum || this->polySatellitePara.cols() != 6) {
|
if (this->polySatellitePara.rows() != polynum || this->polySatellitePara.cols() != 6) {
|
||||||
throw exception("the size of satellitetime has error!! row: p1,p2,p3,p4 col: x,y,z,vx,vy,vz ");
|
throw exception("the size of satellitetime has error!! row: p1,p2,p3,p4 col: x,y,z,vx,vy,vz ");
|
||||||
}
|
}
|
||||||
// ?????????
|
|
||||||
double satellitetime2 =double( satellitetime - this->SatelliteModelStartTime);
|
double satellitetime2 =double( satellitetime - this->SatelliteModelStartTime);
|
||||||
Eigen::MatrixX<double> satetime(1, polynum);
|
Eigen::MatrixX<double> satetime(1, polynum);
|
||||||
for (int i = 0; i < polynum; i++) {
|
for (int i = 0; i < polynum; i++) {
|
||||||
satetime(0, i) = pow(satellitetime2, i);
|
satetime(0, i) = pow(satellitetime2, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
|
||||||
Eigen::MatrixX<double> satellitePoints(1, 6);
|
Eigen::MatrixX<double> satellitePoints(1, 6);
|
||||||
satellitePoints = satetime * polySatellitePara;
|
satellitePoints = satetime * polySatellitePara;
|
||||||
return satellitePoints;
|
return satellitePoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ????????????????????
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="satellitetime">???????</param>
|
|
||||||
/// <param name="SatelliteModelStartTime">??????????</param>
|
|
||||||
/// <param name="polySatellitePara">??????[x1,y1,z1,vx1,vy1,vz1; x2,y2,z2,vx2,vy2,vz2; ..... ]</param>
|
|
||||||
/// <param name="polynum">??????????</param>
|
|
||||||
/// <returns>????????</returns>
|
|
||||||
Eigen::MatrixX<double> SatelliteSpacePoints(Eigen::MatrixX<double>& satellitetime, double SatelliteModelStartTime, Eigen::MatrixX<double>& polySatellitePara, int polynum)
|
Eigen::MatrixX<double> SatelliteSpacePoints(Eigen::MatrixX<double>& satellitetime, double SatelliteModelStartTime, Eigen::MatrixX<double>& polySatellitePara, int polynum)
|
||||||
{
|
{
|
||||||
if (satellitetime.cols() != 1) {
|
if (satellitetime.cols() != 1) {
|
||||||
|
|
@ -70,7 +62,7 @@ Eigen::MatrixX<double> SatelliteSpacePoints(Eigen::MatrixX<double>& satellitetim
|
||||||
if (polySatellitePara.rows() != polynum || polySatellitePara.cols() != 6) {
|
if (polySatellitePara.rows() != polynum || polySatellitePara.cols() != 6) {
|
||||||
throw exception("the size of satellitetime has error!! row: p1,p2,p3,p4 col: x,y,z,vx,vy,vz ");
|
throw exception("the size of satellitetime has error!! row: p1,p2,p3,p4 col: x,y,z,vx,vy,vz ");
|
||||||
}
|
}
|
||||||
// ?????????
|
|
||||||
int satellitetime_num = satellitetime.rows();
|
int satellitetime_num = satellitetime.rows();
|
||||||
satellitetime = satellitetime.array() - SatelliteModelStartTime;
|
satellitetime = satellitetime.array() - SatelliteModelStartTime;
|
||||||
Eigen::MatrixX<double> satelliteTime(satellitetime_num, polynum);
|
Eigen::MatrixX<double> satelliteTime(satellitetime_num, polynum);
|
||||||
|
|
@ -78,7 +70,6 @@ Eigen::MatrixX<double> SatelliteSpacePoints(Eigen::MatrixX<double>& satellitetim
|
||||||
satelliteTime.col(i) = satellitetime.array().pow(i);
|
satelliteTime.col(i) = satellitetime.array().pow(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
|
||||||
Eigen::MatrixX<double> satellitePoints(satellitetime_num, 6);
|
Eigen::MatrixX<double> satellitePoints(satellitetime_num, 6);
|
||||||
satellitePoints = satelliteTime * polySatellitePara;
|
satellitePoints = satelliteTime * polySatellitePara;
|
||||||
return satellitePoints;
|
return satellitePoints;
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#ifndef __SATEORIBT_H__
|
||||||
|
#define __SATEORIBT_H__
|
||||||
///
|
///
|
||||||
/// 计算卫星轨道
|
/// 计算卫星轨道
|
||||||
///
|
///
|
||||||
|
|
@ -7,6 +9,7 @@
|
||||||
//#define EIGEN_VECTORIZE_SSE4_2
|
//#define EIGEN_VECTORIZE_SSE4_2
|
||||||
//#include <mkl.h>
|
//#include <mkl.h>
|
||||||
// 本地方法
|
// 本地方法
|
||||||
|
#include "gf3calibrationandorthlib_global.h"
|
||||||
#include "BaseTool.h"
|
#include "BaseTool.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <Eigen/Core>
|
#include <Eigen/Core>
|
||||||
|
|
@ -16,15 +19,15 @@
|
||||||
//#include <armadillo>
|
//#include <armadillo>
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
//using namespace std;
|
||||||
using namespace Eigen;
|
//using namespace Eigen;
|
||||||
//using namespace arma;
|
//using namespace arma;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 多项式轨道模型
|
/// 多项式轨道模型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class OrbitPoly {
|
class GF3CALIBRATIONANDORTHLIB_EXPORT OrbitPoly {
|
||||||
public:
|
public:
|
||||||
//OrbitPoly(std::string orbitModelPath);
|
//OrbitPoly(std::string orbitModelPath);
|
||||||
OrbitPoly();
|
OrbitPoly();
|
||||||
|
|
@ -49,4 +52,8 @@ public:
|
||||||
/// <param name="polySatellitePara">模型参数[x1,y1,z1,vx1,vy1,vz1; x2,y2,z2,vx2,vy2,vz2; ..... ]</param>
|
/// <param name="polySatellitePara">模型参数[x1,y1,z1,vx1,vy1,vz1; x2,y2,z2,vx2,vy2,vz2; ..... ]</param>
|
||||||
/// <param name="polynum">模型参数数量</param>
|
/// <param name="polynum">模型参数数量</param>
|
||||||
/// <returns>卫星坐标</returns>
|
/// <returns>卫星坐标</returns>
|
||||||
Eigen::MatrixX<double> SatelliteSpacePoints(Eigen::MatrixX<double> &satellitetime, double SatelliteModelStartTime, Eigen::MatrixX<double>& polySatellitePara, int polynum = 4);
|
Eigen::MatrixX<double> GF3CALIBRATIONANDORTHLIB_EXPORT SatelliteSpacePoints(Eigen::MatrixX<double> &satellitetime, double SatelliteModelStartTime, Eigen::MatrixX<double>& polySatellitePara, int polynum = 4);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#ifndef __SATELLITEGF3XMLPARSER_H__
|
||||||
|
#define __SATELLITEGF3XMLPARSER_H__
|
||||||
|
|
||||||
|
#include "gf3calibrationandorthlib_global.h"
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
|
|
@ -9,7 +13,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SatelliteGF3xmlParser {
|
class GF3CALIBRATIONANDORTHLIB_EXPORT SatelliteGF3xmlParser {
|
||||||
public:
|
public:
|
||||||
bool loadFile(const QString& filename);
|
bool loadFile(const QString& filename);
|
||||||
|
|
||||||
|
|
@ -51,3 +55,5 @@ public:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
#pragma once
|
||||||
|
#ifndef __GF3CALIBRATIONANDORTHLIB_GLOBAL_H__
|
||||||
|
#define __GF3CALIBRATIONANDORTHLIB_GLOBAL_H__
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef GF3CALIBRATIONANDORTHLIB_LIB
|
||||||
|
#define GF3CALIBRATIONANDORTHLIB_EXPORT __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define GF3CALIBRATIONANDORTHLIB_EXPORT __declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif// __GF3CALIBRATIONANDORTHLIB_GLOBAL_H__
|
||||||
|
|
@ -0,0 +1,134 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="17.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>{6386D3E3-B743-419F-8354-DA48D0B08728}</ProjectGuid>
|
||||||
|
<Keyword>QtVS_v304</Keyword>
|
||||||
|
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||||
|
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||||
|
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</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>tools_qt5</QtInstall>
|
||||||
|
<QtModules>core;gui;widgets</QtModules>
|
||||||
|
<QtBuildConfig>debug</QtBuildConfig>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||||
|
<QtInstall>tools_qt5</QtInstall>
|
||||||
|
<QtModules>core;xml;sql;opengl;gui;widgets;location;dbus;charts;datavisualization</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'">
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<CopyLocalDeploymentContent>true</CopyLocalDeploymentContent>
|
||||||
|
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||||
|
<CopyLocalDebugSymbols>true</CopyLocalDebugSymbols>
|
||||||
|
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||||
|
<IncludePath>..\GF3CalibrationAndOrthLib;..\GPUBaseLib;..\BaseCommonLibrary\ToolAbstract;..\BaseCommonLibrary\BaseTool;..\BaseCommonLibrary;.;$(IncludePath)</IncludePath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ClCompile>
|
||||||
|
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
<ClCompile Include="QGF3StripBatchProcessDialog.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtMoc Include="QGF3StripBatchProcessDialog.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtUic Include="QGF3StripBatchProcessDialog.ui" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\BaseCommonLibrary\BaseCommonLibrary.vcxproj">
|
||||||
|
<Project>{872ecd6f-30e3-4a1b-b17c-15e87d373ff6}</Project>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\GF3CalibrationAndOrthLib\GF3CalibrationAndOrthLib.vcxproj">
|
||||||
|
<Project>{886f7829-af74-4f23-b3be-29b7b3c9843c}</Project>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\GPUBaseLib\GPUBaseLib.vcxproj">
|
||||||
|
<Project>{b8b40c54-f7fe-4809-b6fb-8bc014570d7b}</Project>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||||
|
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?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>
|
||||||
|
<Filter Include="GPULib">
|
||||||
|
<UniqueIdentifier>{da979fa3-1a37-4b67-aaf3-148de4a4c027}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="QGF3StripBatchProcessDialog.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtMoc Include="QGF3StripBatchProcessDialog.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtUic Include="QGF3StripBatchProcessDialog.ui">
|
||||||
|
<Filter>Form Files</Filter>
|
||||||
|
</QtUic>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,149 @@
|
||||||
|
#include "QGF3StripBatchProcessDialog.h"
|
||||||
|
#include "ui_QGF3StripBatchProcessDialog.h"
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include "FileOperator.h"
|
||||||
|
#include "GeoOperator.h"
|
||||||
|
#include "BaseTool.h"
|
||||||
|
#include "GF3CalibrationAndGeocodingClass.h"
|
||||||
|
|
||||||
|
QGF3StripBatchProcessDialog::QGF3StripBatchProcessDialog(QWidget *parent)
|
||||||
|
: QDialog(parent), ui(new Ui::QGF3StripBatchProcessDialogClass)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
QObject::connect(ui->pushButtonAdd, SIGNAL(clicked(bool)), this, SLOT(onpushButtonAddClicked(bool)));
|
||||||
|
QObject::connect(ui->pushButtonRemove, SIGNAL(clicked(bool)), this, SLOT(onpushButtonRemoveClicked(bool)));
|
||||||
|
QObject::connect(ui->pushButtonWorkSpace, SIGNAL(clicked(bool)), this, SLOT(onpushButtonWorkSpaceClicked(bool)));
|
||||||
|
QObject::connect(ui->checkBoxDEM, SIGNAL(stateChanged(int)), this, SLOT(ontstateChanged(int)));
|
||||||
|
QObject::connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(onreject()));
|
||||||
|
QObject::connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onaccept()));
|
||||||
|
QObject::connect(ui->pushButton_lineDEM, SIGNAL(clicked(bool)), this, SLOT(onpushButtonDEM(bool)));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QGF3StripBatchProcessDialog::~QGF3StripBatchProcessDialog()
|
||||||
|
{}
|
||||||
|
|
||||||
|
void QGF3StripBatchProcessDialog::onaccept()
|
||||||
|
{
|
||||||
|
QString demPath = "";
|
||||||
|
// 获取默认DEM数据
|
||||||
|
if (ui->checkBoxDEM->isChecked()) {
|
||||||
|
QString demdirPath = QApplication::applicationDirPath();// DEM所在文件夹
|
||||||
|
demPath = JoinPath(demdirPath,"SRTM_90m_DEM_V4.tif");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
demPath = ui->lineEdit_DEM->text();
|
||||||
|
}
|
||||||
|
// 获取分辨率
|
||||||
|
double resolutionMeter = ui->doubleSpinBox->value();// 分辨率转度
|
||||||
|
//double resoiutionDegree = getPixelSpacingInDegree(resolutionMeter);// 米 -> 度
|
||||||
|
QString workspacedirpath = ui->lineEditWorkDir->text();
|
||||||
|
this->ui->progressBar->setValue(0);
|
||||||
|
this->ui->progressBar->setMaximum(ui->listWidgetMetaxml->count());
|
||||||
|
bool polarHH2VV = ui->checkoutPolarHH2VV->isChecked();
|
||||||
|
for (long i = 0; i < ui->listWidgetMetaxml->count(); i++) {
|
||||||
|
QString inTargzFilePath = ui->listWidgetMetaxml->item(i)->text();
|
||||||
|
this->ui->label_info->setText(QString(u8"正射处理:%1").arg(inTargzFilePath));
|
||||||
|
GF3MainOrthProcess(demPath,
|
||||||
|
inTargzFilePath,
|
||||||
|
workspacedirpath,
|
||||||
|
resolutionMeter,
|
||||||
|
polarHH2VV);
|
||||||
|
|
||||||
|
this->ui->progressBar->setValue(i);
|
||||||
|
}
|
||||||
|
QMessageBox::information(this, u8"正射处理完成", u8"正射处理完成");
|
||||||
|
}
|
||||||
|
|
||||||
|
void QGF3StripBatchProcessDialog::onreject()
|
||||||
|
{
|
||||||
|
this->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QGF3StripBatchProcessDialog::onpushButtonAddClicked(bool)
|
||||||
|
{
|
||||||
|
QStringList fileNames = QFileDialog::getOpenFileNames(
|
||||||
|
this, // 父窗口
|
||||||
|
tr(u8"选择GF3条带L1A压缩包"), // 标题
|
||||||
|
QString(), // 默认路径
|
||||||
|
tr(u8"tar.gz (*.tar.gz);;tar (*.tar);;All Files (*)") // 文件过滤器
|
||||||
|
);
|
||||||
|
|
||||||
|
// 如果用户选择了文件
|
||||||
|
if (!fileNames.isEmpty()) {
|
||||||
|
QString message = "选择的文件有:\n";
|
||||||
|
for (const QString& fileName : fileNames) {
|
||||||
|
this->ui->listWidgetMetaxml->addItem(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
QMessageBox::information(this, tr(u8"没有选择文件"), tr(u8"没有选择任何文件。"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QGF3StripBatchProcessDialog::onpushButtonRemoveClicked(bool)
|
||||||
|
{
|
||||||
|
QList<QListWidgetItem*> selectedItems = this->ui->listWidgetMetaxml->selectedItems();
|
||||||
|
for (QListWidgetItem* item : selectedItems) {
|
||||||
|
delete this->ui->listWidgetMetaxml->takeItem(this->ui->listWidgetMetaxml->row(item));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QGF3StripBatchProcessDialog::onpushButtonWorkSpaceClicked(bool)
|
||||||
|
{
|
||||||
|
// 调用文件选择对话框并选择一个 .tif 文件
|
||||||
|
QString fileName = QFileDialog::getExistingDirectory(this, u8"选择工作空间路径", "");
|
||||||
|
|
||||||
|
if (!fileName.isEmpty()) {
|
||||||
|
ui->lineEditWorkDir->setText(fileName);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
QMessageBox::information(this, u8"没有选择文件夹", u8"没有选择任何文件夹");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QGF3StripBatchProcessDialog::ontstateChanged(int checked)
|
||||||
|
{
|
||||||
|
bool checkedflag = ui->checkBoxDEM->isChecked();
|
||||||
|
if (!checkedflag) {
|
||||||
|
ui->pushButton_lineDEM->setEnabled(true);
|
||||||
|
ui->lineEdit_DEM->setEnabled(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ui->pushButton_lineDEM->setEnabled(false);
|
||||||
|
ui->lineEdit_DEM->setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QGF3StripBatchProcessDialog::onpushButtonDEM(bool flag)
|
||||||
|
{
|
||||||
|
QString fileName = QFileDialog::getOpenFileName(this, u8"选择DEM文件", "", u8"tif (*.tif);;All Files (*)");
|
||||||
|
if (!fileName.isEmpty()) {
|
||||||
|
ui->lineEdit_DEM->setText(fileName);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
QMessageBox::information(this, u8"没有选择文件", u8"没有选择任何文件");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void showQGF3StripBatchProcessDialog(QWidget* parent)
|
||||||
|
{
|
||||||
|
QGF3StripBatchProcessDialog* dialog = new QGF3StripBatchProcessDialog(parent);
|
||||||
|
dialog->setWindowTitle(u8"GF3条带影像正射批量处理");
|
||||||
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
dialog->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString getDefaultDEMFilePath()
|
||||||
|
{
|
||||||
|
QString fileName = QFileDialog::getOpenFileName(nullptr, u8"选择DEM文件", "", u8"tif (*.tif);;All Files (*)");
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
#pragma once
|
||||||
|
#ifndef __QGF3STRIPBATCHPROCESSDIALOG_H__
|
||||||
|
#define __QGF3STRIPBATCHPROCESSDIALOG_H__
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui{
|
||||||
|
class QGF3StripBatchProcessDialogClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
class QGF3StripBatchProcessDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QGF3StripBatchProcessDialog(QWidget *parent = nullptr);
|
||||||
|
~QGF3StripBatchProcessDialog();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void onaccept();
|
||||||
|
void onreject();
|
||||||
|
void onpushButtonAddClicked(bool);
|
||||||
|
void onpushButtonRemoveClicked(bool);
|
||||||
|
void onpushButtonWorkSpaceClicked(bool);
|
||||||
|
|
||||||
|
void ontstateChanged(int checked);
|
||||||
|
void onpushButtonDEM(bool flag);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::QGF3StripBatchProcessDialogClass* ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Ä£¿éÏÔʾµ÷ÓÃ
|
||||||
|
void showQGF3StripBatchProcessDialog(QWidget* parent = nullptr);
|
||||||
|
QString getDefaultDEMFilePath();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,263 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>QGF3StripBatchProcessDialogClass</class>
|
||||||
|
<widget class="QDialog" name="QGF3StripBatchProcessDialogClass">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>787</width>
|
||||||
|
<height>580</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>QGF3StripBatchProcessDialog</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>GF3条带列表(L1A)</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QFrame" name="frame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QListWidget" name="listWidgetMetaxml">
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::MultiSelection</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_2">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonAdd">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>选择</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonRemove">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>删除</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>参数</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="1" column="3">
|
||||||
|
<widget class="QPushButton" name="pushButton_lineDEM">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>选择</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>分辨率(m)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="checkBoxDEM">
|
||||||
|
<property name="text">
|
||||||
|
<string>默认DEM</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QLineEdit" name="lineEdit_DEM">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>DEM文件地址:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="doubleSpinBox">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>100000.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QCheckBox" name="checkoutPolarHH2VV">
|
||||||
|
<property name="text">
|
||||||
|
<string>极化转换:HH->VV</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>输出工作空间:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEditWorkDir">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonWorkSpace">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>选择</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_info">
|
||||||
|
<property name="text">
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QProgressBar" name="progressBar">
|
||||||
|
<property name="value">
|
||||||
|
<number>24</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
|
|
@ -0,0 +1,576 @@
|
||||||
|
/*
|
||||||
|
AMOLED Style Sheet for QT Applications
|
||||||
|
Author: Jaime A. Quiroga P.
|
||||||
|
Company: GTRONICK
|
||||||
|
Last updated: 01/10/2021, 15:49.
|
||||||
|
Available at: https://github.com/GTRONICK/QSS/blob/master/AMOLED.qss
|
||||||
|
*/
|
||||||
|
QMainWindow {
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QDialog {
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QColorDialog {
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QTextEdit {
|
||||||
|
background-color:#000000;
|
||||||
|
color: #a9b7c6;
|
||||||
|
}
|
||||||
|
QPlainTextEdit {
|
||||||
|
selection-background-color:#f39c12;
|
||||||
|
background-color:#000000;
|
||||||
|
border: 1px solid #FF00FF;
|
||||||
|
color: #a9b7c6;
|
||||||
|
}
|
||||||
|
QPushButton{
|
||||||
|
border: 1px transparent;
|
||||||
|
color: #a9b7c6;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
QPushButton::default{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #e67e22;
|
||||||
|
border-width: 1px;
|
||||||
|
color: #a9b7c6;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
QPushButton:hover{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #FF00FF;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-bottom-radius: 6px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
QPushButton:pressed{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #FF00FF;
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-bottom-radius: 6px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #e67e22;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
QPushButton:disabled{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-bottom-radius: 6px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #808086;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
QToolButton {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #e67e22;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #a9b7c6;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
QToolButton:hover{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #e67e22;
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-bottom-radius: 6px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
QLineEdit {
|
||||||
|
border-width: 1px; border-radius: 4px;
|
||||||
|
border-color: rgb(58, 58, 58);
|
||||||
|
border-style: inset;
|
||||||
|
padding: 0 8px;
|
||||||
|
color: #a9b7c6;
|
||||||
|
background:#000000;
|
||||||
|
selection-background-color:#007b50;
|
||||||
|
selection-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
QLabel {
|
||||||
|
color: #a9b7c6;
|
||||||
|
}
|
||||||
|
QLCDNumber {
|
||||||
|
color: #e67e22;
|
||||||
|
}
|
||||||
|
QProgressBar {
|
||||||
|
text-align: center;
|
||||||
|
color: rgb(240, 240, 240);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: rgb(58, 58, 58);
|
||||||
|
border-style: inset;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: #e67e22;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
QMenu{
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QMenuBar {
|
||||||
|
background:rgb(0, 0, 0);
|
||||||
|
color: #a9b7c6;
|
||||||
|
}
|
||||||
|
QMenuBar::item {
|
||||||
|
spacing: 3px;
|
||||||
|
padding: 1px 4px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
QMenuBar::item:selected {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #e67e22;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-bottom-radius: 6px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding-bottom: 0px;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
QMenu::item:selected {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: #e67e22;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
border-left-width: 2px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding-left:15px;
|
||||||
|
padding-top:4px;
|
||||||
|
padding-bottom:4px;
|
||||||
|
padding-right:7px;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QMenu::item {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #a9b7c6;
|
||||||
|
padding-left:17px;
|
||||||
|
padding-top:4px;
|
||||||
|
padding-bottom:4px;
|
||||||
|
padding-right:7px;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QTabWidget {
|
||||||
|
color:rgb(0,0,0);
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QTabWidget::pane {
|
||||||
|
border-color: rgb(77,77,77);
|
||||||
|
background-color:#000000;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
QTabBar::tab {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #808086;
|
||||||
|
padding: 3px;
|
||||||
|
margin-left:3px;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #e67e22;
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding-left: 3px;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
margin-left:3px;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCheckBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
QCheckBox:disabled {
|
||||||
|
color: #808086;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCheckBox:hover {
|
||||||
|
border-radius:4px;
|
||||||
|
border-style:solid;
|
||||||
|
padding-left: 1px;
|
||||||
|
padding-right: 1px;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
padding-top: 1px;
|
||||||
|
border-width:1px;
|
||||||
|
border-color: rgb(87, 97, 106);
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:checked {
|
||||||
|
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #e67e22;
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #e67e22;
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:unchecked {
|
||||||
|
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #e67e22;
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
QRadioButton {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#000000;
|
||||||
|
padding: 1px;
|
||||||
|
}
|
||||||
|
QRadioButton::indicator:checked {
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-radius:5px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #e67e22;
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #e67e22;
|
||||||
|
}
|
||||||
|
QRadioButton::indicator:!checked {
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-radius:5px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #e67e22;
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
QStatusBar {
|
||||||
|
color:#34e8eb;
|
||||||
|
}
|
||||||
|
QSpinBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QDoubleSpinBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QTimeEdit {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QDateTimeEdit {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QDateEdit {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QComboBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background: #1e1d23;
|
||||||
|
}
|
||||||
|
QComboBox:editable {
|
||||||
|
background: #1e1d23;
|
||||||
|
color: #a9b7c6;
|
||||||
|
selection-background-color:#000000;
|
||||||
|
}
|
||||||
|
QComboBox QAbstractItemView {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background: #1e1d23;
|
||||||
|
selection-color: #FFFFFF;
|
||||||
|
selection-background-color:#000000;
|
||||||
|
}
|
||||||
|
QComboBox:!editable:on, QComboBox::drop-down:editable:on {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background: #1e1d23;
|
||||||
|
}
|
||||||
|
QFontComboBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QToolBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QToolBox::tab {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QToolBox::tab:selected {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QScrollArea {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QSlider::groove:horizontal {
|
||||||
|
height: 5px;
|
||||||
|
background: #e67e22;
|
||||||
|
}
|
||||||
|
QSlider::groove:vertical {
|
||||||
|
width: 5px;
|
||||||
|
background: #e67e22;
|
||||||
|
}
|
||||||
|
QSlider::handle:horizontal {
|
||||||
|
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
|
||||||
|
border: 1px solid #5c5c5c;
|
||||||
|
width: 14px;
|
||||||
|
margin: -5px 0;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
QSlider::handle:vertical {
|
||||||
|
background: qlineargradient(x1:1, y1:1, x2:0, y2:0, stop:0 #b4b4b4, stop:1 #8f8f8f);
|
||||||
|
border: 1px solid #5c5c5c;
|
||||||
|
height: 14px;
|
||||||
|
margin: 0 -5px;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
QSlider::add-page:horizontal {
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
QSlider::add-page:vertical {
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
QSlider::sub-page:horizontal {
|
||||||
|
background: #e67e22;
|
||||||
|
}
|
||||||
|
QSlider::sub-page:vertical {
|
||||||
|
background: #e67e22;
|
||||||
|
}
|
||||||
|
QScrollBar:horizontal {
|
||||||
|
max-height: 20px;
|
||||||
|
background: rgb(0,0,0);
|
||||||
|
border: 1px transparent grey;
|
||||||
|
margin: 0px 20px 0px 20px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:horizontal {
|
||||||
|
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 0, 0, 0), stop:0.7 rgba(255, 0, 0, 0), stop:0.71 rgb(230, 126, 34), stop:1 rgb(230, 126, 34));
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(0,0,0);
|
||||||
|
min-width: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:horizontal:hover {
|
||||||
|
background: rgb(230, 126, 34);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(0,0,0);
|
||||||
|
min-width: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:horizontal {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: rgb(0,0,0);
|
||||||
|
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 0, 0, 0), stop:0.7 rgba(255, 0, 0, 0), stop:0.71 rgb(230, 126, 34), stop:1 rgb(230, 126, 34));
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: right;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:horizontal:hover {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: rgb(0,0,0);
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgb(230, 126, 34);
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
subcontrol-position: right;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:horizontal:pressed {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: grey;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgb(230, 126, 34);
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
subcontrol-position: right;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:horizontal {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: rgb(0,0,0);
|
||||||
|
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 0, 0, 0), stop:0.7 rgba(255, 0, 0, 0), stop:0.71 rgb(230, 126, 34), stop:1 rgb(230, 126, 34));
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: left;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:horizontal:hover {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: rgb(0,0,0);
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgb(230, 126, 34);
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
subcontrol-position: left;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:horizontal:pressed {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: grey;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgb(230, 126, 34);
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
subcontrol-position: left;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::left-arrow:horizontal {
|
||||||
|
border: 1px transparent grey;
|
||||||
|
border-radius: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background: rgb(0,0,0);
|
||||||
|
}
|
||||||
|
QScrollBar::right-arrow:horizontal {
|
||||||
|
border: 1px transparent grey;
|
||||||
|
border-radius: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background: rgb(0,0,0);
|
||||||
|
}
|
||||||
|
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
QScrollBar:vertical {
|
||||||
|
max-width: 20px;
|
||||||
|
background: rgb(0,0,0);
|
||||||
|
border: 1px transparent grey;
|
||||||
|
margin: 20px 0px 20px 0px;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:vertical {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: rgb(0,0,0);
|
||||||
|
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 0, 0, 0), stop:0.7 rgba(255, 0, 0, 0), stop:0.71 rgb(230, 126, 34), stop:1 rgb(230, 126, 34));
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: bottom;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:vertical:hover {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: rgb(0,0,0);
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgb(230, 126, 34);
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
subcontrol-position: bottom;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:vertical:pressed {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: grey;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgb(230, 126, 34);
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
subcontrol-position: bottom;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:vertical {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: rgb(0,0,0);
|
||||||
|
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 0, 0, 0), stop:0.7 rgba(255, 0, 0, 0), stop:0.71 rgb(230, 126, 34), stop:1 rgb(230, 126, 34));
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: top;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:vertical:hover {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: rgb(0,0,0);
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgb(230, 126, 34);
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
subcontrol-position: top;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:vertical:pressed {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: grey;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgb(230, 126, 34);
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
subcontrol-position: top;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:vertical {
|
||||||
|
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 0, 0, 0), stop:0.7 rgba(255, 0, 0, 0), stop:0.71 rgb(230, 126, 34), stop:1 rgb(230, 126, 34));
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(0,0,0);
|
||||||
|
min-height: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:vertical:hover {
|
||||||
|
background: rgb(230, 126, 34);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(0,0,0);
|
||||||
|
min-heigth: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::up-arrow:vertical {
|
||||||
|
border: 1px transparent grey;
|
||||||
|
border-radius: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background: rgb(0,0,0);
|
||||||
|
}
|
||||||
|
QScrollBar::down-arrow:vertical {
|
||||||
|
border: 1px transparent grey;
|
||||||
|
border-radius: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background: rgb(0,0,0);
|
||||||
|
}
|
||||||
|
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,559 @@
|
||||||
|
/*
|
||||||
|
Aqua Style Sheet for QT Applications
|
||||||
|
Author: Jaime A. Quiroga P.
|
||||||
|
Company: GTRONICK
|
||||||
|
Last updated: 22/01/2019, 07:55.
|
||||||
|
Available at: https://github.com/GTRONICK/QSS/blob/master/Aqua.qss
|
||||||
|
*/
|
||||||
|
QMainWindow {
|
||||||
|
background-color:#ececec;
|
||||||
|
}
|
||||||
|
QTextEdit {
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
}
|
||||||
|
QPlainTextEdit {
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
}
|
||||||
|
QToolButton {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217));
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: rgb(0,0,0);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(255,255,255);
|
||||||
|
}
|
||||||
|
QToolButton:hover{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(197, 197, 197), stop:1 rgb(227, 227, 227));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(197, 197, 197));
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222));
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: rgb(0,0,0);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(255,255,255);
|
||||||
|
}
|
||||||
|
QToolButton:pressed{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217));
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: rgb(0,0,0);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(142,142,142);
|
||||||
|
}
|
||||||
|
QPushButton{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217));
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: rgb(0,0,0);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(255,255,255);
|
||||||
|
}
|
||||||
|
QPushButton::default{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217));
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: rgb(0,0,0);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(255,255,255);
|
||||||
|
}
|
||||||
|
QPushButton:hover{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(197, 197, 197), stop:1 rgb(227, 227, 227));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(197, 197, 197));
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222));
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: rgb(0,0,0);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(255,255,255);
|
||||||
|
}
|
||||||
|
QPushButton:pressed{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217));
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: rgb(0,0,0);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(142,142,142);
|
||||||
|
}
|
||||||
|
QPushButton:disabled{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217));
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: #808086;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(142,142,142);
|
||||||
|
}
|
||||||
|
QLineEdit {
|
||||||
|
border-width: 1px; border-radius: 4px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
}
|
||||||
|
QLabel {
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
QLCDNumber {
|
||||||
|
color: rgb(0, 113, 255, 255);
|
||||||
|
}
|
||||||
|
QProgressBar {
|
||||||
|
text-align: center;
|
||||||
|
color: rgb(240, 240, 240);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: rgb(230, 230, 230);
|
||||||
|
border-style: solid;
|
||||||
|
background-color:rgb(207,207,207);
|
||||||
|
}
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255));
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
QMenuBar {
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(207, 209, 207, 255), stop:1 rgba(230, 229, 230, 255));
|
||||||
|
}
|
||||||
|
QMenuBar::item {
|
||||||
|
color: #000000;
|
||||||
|
spacing: 3px;
|
||||||
|
padding: 1px 4px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(207, 209, 207, 255), stop:1 rgba(230, 229, 230, 255));
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenuBar::item:selected {
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
QMenu::item:selected {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
border-left-width: 2px;
|
||||||
|
color: #000000;
|
||||||
|
padding-left:15px;
|
||||||
|
padding-top:4px;
|
||||||
|
padding-bottom:4px;
|
||||||
|
padding-right:7px;
|
||||||
|
}
|
||||||
|
QMenu::item {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
color: #000000;
|
||||||
|
padding-left:17px;
|
||||||
|
padding-top:4px;
|
||||||
|
padding-bottom:4px;
|
||||||
|
padding-right:7px;
|
||||||
|
}
|
||||||
|
QTabWidget {
|
||||||
|
color:rgb(0,0,0);
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QTabWidget::pane {
|
||||||
|
border-color: rgb(223,223,223);
|
||||||
|
background-color:rgb(226,226,226);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 2px;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
QTabBar::tab:first {
|
||||||
|
border-style: solid;
|
||||||
|
border-left-width:1px;
|
||||||
|
border-right-width:0px;
|
||||||
|
border-top-width:1px;
|
||||||
|
border-bottom-width:1px;
|
||||||
|
border-top-color: rgb(209,209,209);
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229));
|
||||||
|
border-bottom-color: rgb(229,229,229);
|
||||||
|
border-top-left-radius: 4px;
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
color: #000000;
|
||||||
|
padding: 3px;
|
||||||
|
margin-left:0px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(255, 255, 255, 255));
|
||||||
|
}
|
||||||
|
QTabBar::tab:last {
|
||||||
|
border-style: solid;
|
||||||
|
border-width:1px;
|
||||||
|
border-top-color: rgb(209,209,209);
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229));
|
||||||
|
border-bottom-color: rgb(229,229,229);
|
||||||
|
border-top-right-radius: 4px;
|
||||||
|
border-bottom-right-radius: 4px;
|
||||||
|
color: #000000;
|
||||||
|
padding: 3px;
|
||||||
|
margin-left:0px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(255, 255, 255, 255));
|
||||||
|
}
|
||||||
|
QTabBar::tab {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-width:1px;
|
||||||
|
border-bottom-width:1px;
|
||||||
|
border-left-width:1px;
|
||||||
|
border-top-color: rgb(209,209,209);
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229));
|
||||||
|
border-bottom-color: rgb(229,229,229);
|
||||||
|
color: #000000;
|
||||||
|
padding: 3px;
|
||||||
|
margin-left:0px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(255, 255, 255, 255));
|
||||||
|
}
|
||||||
|
QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover {
|
||||||
|
border-style: solid;
|
||||||
|
border-left-width:1px;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-top-color: rgb(209,209,209);
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229));
|
||||||
|
border-bottom-color: rgb(229,229,229);
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 3px;
|
||||||
|
margin-left:0px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabBar::tab:selected, QTabBar::tab:first:selected, QTabBar::tab:hover {
|
||||||
|
border-style: solid;
|
||||||
|
border-left-width:1px;
|
||||||
|
border-bottom-width:1px;
|
||||||
|
border-top-width:1px;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-top-color: rgb(209,209,209);
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229));
|
||||||
|
border-bottom-color: rgb(229,229,229);
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 3px;
|
||||||
|
margin-left:0px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
}
|
||||||
|
|
||||||
|
QCheckBox {
|
||||||
|
color: #000000;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
QCheckBox:disabled {
|
||||||
|
color: #808086;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCheckBox:hover {
|
||||||
|
border-radius:4px;
|
||||||
|
border-style:solid;
|
||||||
|
padding-left: 1px;
|
||||||
|
padding-right: 1px;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
padding-top: 1px;
|
||||||
|
border-width:1px;
|
||||||
|
border-color: transparent;
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:checked {
|
||||||
|
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
color: #000000;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:unchecked {
|
||||||
|
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
QRadioButton {
|
||||||
|
color: 000000;
|
||||||
|
padding: 1px;
|
||||||
|
}
|
||||||
|
QRadioButton::indicator:checked {
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-radius:5px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
}
|
||||||
|
QRadioButton::indicator:!checked {
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-radius:5px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
QStatusBar {
|
||||||
|
color:#027f7f;
|
||||||
|
}
|
||||||
|
QSpinBox {
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
}
|
||||||
|
QDoubleSpinBox {
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
}
|
||||||
|
QTimeEdit {
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
}
|
||||||
|
QDateTimeEdit {
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
}
|
||||||
|
QDateEdit {
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255));
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QToolBox::tab {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QToolBox::tab:selected {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QScrollArea {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QSlider::groove:horizontal {
|
||||||
|
height: 5px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255));
|
||||||
|
}
|
||||||
|
QSlider::groove:vertical {
|
||||||
|
width: 5px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255));
|
||||||
|
}
|
||||||
|
QSlider::handle:horizontal {
|
||||||
|
background: rgb(253,253,253);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(207,207,207);
|
||||||
|
width: 12px;
|
||||||
|
margin: -5px 0;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
QSlider::handle:vertical {
|
||||||
|
background: rgb(253,253,253);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(207,207,207);
|
||||||
|
height: 12px;
|
||||||
|
margin: 0 -5px;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
QSlider::add-page:horizontal {
|
||||||
|
background: rgb(181,181,181);
|
||||||
|
}
|
||||||
|
QSlider::add-page:vertical {
|
||||||
|
background: rgb(181,181,181);
|
||||||
|
}
|
||||||
|
QSlider::sub-page:horizontal {
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255));
|
||||||
|
}
|
||||||
|
QSlider::sub-page:vertical {
|
||||||
|
background-color: qlineargradient(spread:pad, y1:0.5, x1:1, y2:0.5, x2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255));
|
||||||
|
}
|
||||||
|
QScrollBar:horizontal {
|
||||||
|
max-height: 20px;
|
||||||
|
border: 1px transparent grey;
|
||||||
|
margin: 0px 20px 0px 20px;
|
||||||
|
}
|
||||||
|
QScrollBar:vertical {
|
||||||
|
max-width: 20px;
|
||||||
|
border: 1px transparent grey;
|
||||||
|
margin: 20px 0px 20px 0px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:horizontal {
|
||||||
|
background: rgb(253,253,253);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(207,207,207);
|
||||||
|
border-radius: 7px;
|
||||||
|
min-width: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:horizontal:hover {
|
||||||
|
background: rgb(253,253,253);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(147, 200, 200);
|
||||||
|
border-radius: 7px;
|
||||||
|
min-width: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:vertical {
|
||||||
|
background: rgb(253,253,253);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(207,207,207);
|
||||||
|
border-radius: 7px;
|
||||||
|
min-height: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:vertical:hover {
|
||||||
|
background: rgb(253,253,253);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(147, 200, 200);
|
||||||
|
border-radius: 7px;
|
||||||
|
min-height: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:horizontal {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
border-bottom-right-radius: 7px;
|
||||||
|
background: rgba(34, 142, 255, 255);
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: right;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:horizontal:pressed {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
border-bottom-right-radius: 7px;
|
||||||
|
background: rgb(181,181,181);
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: right;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:vertical {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-bottom-left-radius: 7px;
|
||||||
|
border-bottom-right-radius: 7px;
|
||||||
|
background: rgba(34, 142, 255, 255);
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: bottom;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:vertical:pressed {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-bottom-left-radius: 7px;
|
||||||
|
border-bottom-right-radius: 7px;
|
||||||
|
background: rgb(181,181,181);
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: bottom;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:horizontal {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-bottom-left-radius: 7px;
|
||||||
|
background: rgba(34, 142, 255, 255);
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: left;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:horizontal:pressed {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-bottom-left-radius: 7px;
|
||||||
|
background: rgb(181,181,181);
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: left;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:vertical {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
background: rgba(34, 142, 255, 255);
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: top;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:vertical:pressed {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
background: rgb(181,181,181);
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: top;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::left-arrow:horizontal {
|
||||||
|
border: 1px transparent grey;
|
||||||
|
border-top-left-radius: 3px;
|
||||||
|
border-bottom-left-radius: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
QScrollBar::right-arrow:horizontal {
|
||||||
|
border: 1px transparent grey;
|
||||||
|
border-top-right-radius: 3px;
|
||||||
|
border-bottom-right-radius: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
QScrollBar::up-arrow:vertical {
|
||||||
|
border: 1px transparent grey;
|
||||||
|
border-top-left-radius: 3px;
|
||||||
|
border-top-right-radius: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
QScrollBar::down-arrow:vertical {
|
||||||
|
border: 1px transparent grey;
|
||||||
|
border-bottom-left-radius: 3px;
|
||||||
|
border-bottom-right-radius: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,181 @@
|
||||||
|
/*
|
||||||
|
Dark Console Style Sheet for QT Applications
|
||||||
|
Author: Jaime A. Quiroga P.
|
||||||
|
Company: GTRONICK
|
||||||
|
Last updated: 24/05/2018, 17:12.
|
||||||
|
Available at: https://github.com/GTRONICK/QSS/blob/master/ConsoleStyle.qss
|
||||||
|
*/
|
||||||
|
QWidget {
|
||||||
|
background-color:rgb(0, 0, 0);
|
||||||
|
color: rgb(240, 240, 240);
|
||||||
|
border-color: rgb(58, 58, 58);
|
||||||
|
}
|
||||||
|
|
||||||
|
QPlainTextEdit {
|
||||||
|
background-color:rgb(0, 0, 0);
|
||||||
|
color: rgb(200, 200, 200);
|
||||||
|
selection-background-color: rgb(255, 153, 0);
|
||||||
|
selection-color: rgb(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabWidget::pane {
|
||||||
|
border-top: 1px solid #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabBar::tab {
|
||||||
|
background-color:rgb(0, 0, 0);
|
||||||
|
border-style: outset;
|
||||||
|
border-width: 1px;
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-bottom-color: rgb(58, 58, 58);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-top-width: 0px;
|
||||||
|
border-style: solid;
|
||||||
|
color: rgb(255, 153, 0);
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabBar::tab:selected, QTabBar::tab:hover {
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
background-color:rgb(0, 0, 0);
|
||||||
|
border-color:rgb(42, 42, 42);
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 0px;
|
||||||
|
border-bottom-right-radius:4px;
|
||||||
|
border-bottom-left-radius:4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabBar::tab:last:selected {
|
||||||
|
background-color:rgb(0, 0, 0);
|
||||||
|
border-color:rgb(42, 42, 42);
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 0px;
|
||||||
|
border-bottom-right-radius:4px;
|
||||||
|
border-bottom-left-radius:4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabBar::tab:!selected {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
border-bottom-right-radius:4px;
|
||||||
|
border-bottom-left-radius:4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton{
|
||||||
|
border-style: outset;
|
||||||
|
border-width: 2px;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-bottom-color: rgb(58, 58, 58);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
padding: 6px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(77, 77, 77, 255), stop:1 rgba(97, 97, 97, 255));
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:hover{
|
||||||
|
border-style: outset;
|
||||||
|
border-width: 2px;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(110, 110, 110, 255));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(110, 110, 110, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(110, 110, 110, 255));
|
||||||
|
border-bottom-color: rgb(115, 115, 115);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
padding: 6px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(107, 107, 107, 255), stop:1 rgba(157, 157, 157, 255));
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:pressed{
|
||||||
|
border-style: outset;
|
||||||
|
border-width: 2px;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(62, 62, 62, 255), stop:1 rgba(22, 22, 22, 255));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-bottom-color: rgb(58, 58, 58);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
padding: 6px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(77, 77, 77, 255), stop:1 rgba(97, 97, 97, 255));
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:disabled{
|
||||||
|
border-style: outset;
|
||||||
|
border-width: 2px;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-bottom-color: rgb(58, 58, 58);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: rgb(0, 0, 0);
|
||||||
|
padding: 6px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(57, 57, 57, 255), stop:1 rgba(77, 77, 77, 255));
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit {
|
||||||
|
border-width: 1px; border-radius: 4px;
|
||||||
|
border-color: rgb(58, 58, 58);
|
||||||
|
border-style: inset;
|
||||||
|
padding: 0 8px;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
background:rgb(101, 101, 101);
|
||||||
|
selection-background-color: rgb(187, 187, 187);
|
||||||
|
selection-color: rgb(60, 63, 65);
|
||||||
|
}
|
||||||
|
|
||||||
|
QProgressBar {
|
||||||
|
text-align: center;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: rgb(58, 58, 58);
|
||||||
|
border-style: inset;
|
||||||
|
}
|
||||||
|
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:0.7, x2:0.5, y2:0.3, stop:0 rgba(0, 200, 0, 255), stop:1 rgba(30, 230, 30, 255));
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenuBar {
|
||||||
|
background:rgb(0, 0, 0);
|
||||||
|
color: rgb(255, 153, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenuBar::item {
|
||||||
|
spacing: 3px;
|
||||||
|
padding: 1px 4px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenuBar::item:selected {
|
||||||
|
background:rgb(115, 115, 115);
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenu {
|
||||||
|
border-width: 2px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: rgb(255, 153, 0);
|
||||||
|
border-style: outset;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenu::item {
|
||||||
|
spacing: 3px;
|
||||||
|
padding: 3px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenu::item:selected {
|
||||||
|
spacing: 3px;
|
||||||
|
padding: 3px 15px;
|
||||||
|
background:rgb(115, 115, 115);
|
||||||
|
color:rgb(255, 255, 255);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: rgb(58, 58, 58);
|
||||||
|
border-style: inset;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,196 @@
|
||||||
|
/*
|
||||||
|
ElegantDark Style Sheet for QT Applications
|
||||||
|
Author: Jaime A. Quiroga P.
|
||||||
|
Company: GTRONICK
|
||||||
|
Last updated: 17/04/2018
|
||||||
|
Available at: https://github.com/GTRONICK/QSS/blob/master/ElegantDark.qss
|
||||||
|
*/
|
||||||
|
QMainWindow {
|
||||||
|
background-color:rgb(82, 82, 82);
|
||||||
|
}
|
||||||
|
QTextEdit {
|
||||||
|
background-color:rgb(42, 42, 42);
|
||||||
|
color: rgb(0, 255, 0);
|
||||||
|
}
|
||||||
|
QPushButton{
|
||||||
|
border-style: outset;
|
||||||
|
border-width: 2px;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-bottom-color: rgb(58, 58, 58);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(77, 77, 77, 255), stop:1 rgba(97, 97, 97, 255));
|
||||||
|
}
|
||||||
|
QPushButton:hover{
|
||||||
|
border-style: outset;
|
||||||
|
border-width: 2px;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(110, 110, 110, 255));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(110, 110, 110, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(110, 110, 110, 255));
|
||||||
|
border-bottom-color: rgb(115, 115, 115);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(107, 107, 107, 255), stop:1 rgba(157, 157, 157, 255));
|
||||||
|
}
|
||||||
|
QPushButton:pressed{
|
||||||
|
border-style: outset;
|
||||||
|
border-width: 2px;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(62, 62, 62, 255), stop:1 rgba(22, 22, 22, 255));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-bottom-color: rgb(58, 58, 58);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(77, 77, 77, 255), stop:1 rgba(97, 97, 97, 255));
|
||||||
|
}
|
||||||
|
QPushButton:disabled{
|
||||||
|
border-style: outset;
|
||||||
|
border-width: 2px;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-bottom-color: rgb(58, 58, 58);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: rgb(0, 0, 0);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(57, 57, 57, 255), stop:1 rgba(77, 77, 77, 255));
|
||||||
|
}
|
||||||
|
QLineEdit {
|
||||||
|
border-width: 1px; border-radius: 4px;
|
||||||
|
border-color: rgb(58, 58, 58);
|
||||||
|
border-style: inset;
|
||||||
|
padding: 0 8px;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
background:rgb(100, 100, 100);
|
||||||
|
selection-background-color: rgb(187, 187, 187);
|
||||||
|
selection-color: rgb(60, 63, 65);
|
||||||
|
}
|
||||||
|
QLabel {
|
||||||
|
color:rgb(255,255,255);
|
||||||
|
}
|
||||||
|
QProgressBar {
|
||||||
|
text-align: center;
|
||||||
|
color: rgb(240, 240, 240);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: rgb(58, 58, 58);
|
||||||
|
border-style: inset;
|
||||||
|
background-color:rgb(77,77,77);
|
||||||
|
}
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:0.7, x2:0.5, y2:0.3, stop:0 rgba(87, 97, 106, 255), stop:1 rgba(93, 103, 113, 255));
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
QMenuBar {
|
||||||
|
background:rgb(82, 82, 82);
|
||||||
|
}
|
||||||
|
QMenuBar::item {
|
||||||
|
color:rgb(223,219,210);
|
||||||
|
spacing: 3px;
|
||||||
|
padding: 1px 4px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenuBar::item:selected {
|
||||||
|
background:rgb(115, 115, 115);
|
||||||
|
}
|
||||||
|
QMenu::item:selected {
|
||||||
|
color:rgb(255,255,255);
|
||||||
|
border-width:2px;
|
||||||
|
border-style:solid;
|
||||||
|
padding-left:18px;
|
||||||
|
padding-right:8px;
|
||||||
|
padding-top:2px;
|
||||||
|
padding-bottom:3px;
|
||||||
|
background:qlineargradient(spread:pad, x1:0.5, y1:0.7, x2:0.5, y2:0.3, stop:0 rgba(87, 97, 106, 255), stop:1 rgba(93, 103, 113, 255));
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255));
|
||||||
|
border-bottom-color: rgb(58, 58, 58);
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
}
|
||||||
|
QMenu::item {
|
||||||
|
color:rgb(223,219,210);
|
||||||
|
background-color:rgb(78,78,78);
|
||||||
|
padding-left:20px;
|
||||||
|
padding-top:4px;
|
||||||
|
padding-bottom:4px;
|
||||||
|
padding-right:10px;
|
||||||
|
}
|
||||||
|
QMenu{
|
||||||
|
background-color:rgb(78,78,78);
|
||||||
|
}
|
||||||
|
QTabWidget {
|
||||||
|
color:rgb(0,0,0);
|
||||||
|
background-color:rgb(247,246,246);
|
||||||
|
}
|
||||||
|
QTabWidget::pane {
|
||||||
|
border-color: rgb(77,77,77);
|
||||||
|
background-color:rgb(101,101,101);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
QTabBar::tab {
|
||||||
|
padding:2px;
|
||||||
|
color:rgb(250,250,250);
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(77, 77, 77, 255), stop:1 rgba(97, 97, 97, 255));
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 2px;
|
||||||
|
border-top-right-radius:4px;
|
||||||
|
border-top-left-radius:4px;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(95, 92, 93, 255));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(95, 92, 93, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(95, 92, 93, 255));
|
||||||
|
border-bottom-color: rgb(101,101,101);
|
||||||
|
}
|
||||||
|
QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover {
|
||||||
|
background-color:rgb(101,101,101);
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 1px;
|
||||||
|
}
|
||||||
|
QTabBar::tab:!selected {
|
||||||
|
margin-top: 1px;
|
||||||
|
margin-right: 1px;
|
||||||
|
}
|
||||||
|
QCheckBox {
|
||||||
|
color:rgb(223,219,210);
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
QCheckBox:hover {
|
||||||
|
border-radius:4px;
|
||||||
|
border-style:solid;
|
||||||
|
padding-left: 1px;
|
||||||
|
padding-right: 1px;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
padding-top: 1px;
|
||||||
|
border-width:1px;
|
||||||
|
border-color: rgb(87, 97, 106);
|
||||||
|
background-color:qlineargradient(spread:pad, x1:0.5, y1:0.7, x2:0.5, y2:0.3, stop:0 rgba(87, 97, 106, 150), stop:1 rgba(93, 103, 113, 150));
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:checked {
|
||||||
|
border-radius:4px;
|
||||||
|
border-style:solid;
|
||||||
|
border-width:1px;
|
||||||
|
border-color: rgb(180,180,180);
|
||||||
|
background-color:qlineargradient(spread:pad, x1:0.5, y1:0.7, x2:0.5, y2:0.3, stop:0 rgba(87, 97, 106, 255), stop:1 rgba(93, 103, 113, 255));
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:unchecked {
|
||||||
|
border-radius:4px;
|
||||||
|
border-style:solid;
|
||||||
|
border-width:1px;
|
||||||
|
border-color: rgb(87, 97, 106);
|
||||||
|
background-color:rgb(255,255,255);
|
||||||
|
}
|
||||||
|
QStatusBar {
|
||||||
|
color:rgb(240,240,240);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2018 Jaime Quiroga
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
@ -0,0 +1,434 @@
|
||||||
|
/*
|
||||||
|
* MacOS Style Sheet for QT Applications
|
||||||
|
* Author: Jaime A. Quiroga P.
|
||||||
|
* Company: GTRONICK
|
||||||
|
* Last updated: 25/12/2020, 23:10.
|
||||||
|
* Available at: https://github.com/GTRONICK/QSS/blob/master/MacOS.qss
|
||||||
|
*/
|
||||||
|
QMainWindow {
|
||||||
|
background-color:#ececec;
|
||||||
|
}
|
||||||
|
QPushButton, QToolButton, QCommandLinkButton{
|
||||||
|
padding: 0 5px 0 5px;
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #c1c9cf, stop:1 #d2d8dd);
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd);
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd);
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd);
|
||||||
|
border-width: 2px;
|
||||||
|
border-radius: 8px;
|
||||||
|
color: #616161;
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #fbfdfd, stop:0.5 #ffffff, stop:1 #fbfdfd);
|
||||||
|
}
|
||||||
|
QPushButton::default, QToolButton::default, QCommandLinkButton::default{
|
||||||
|
border: 2px solid transparent;
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #84afe5, stop:1 #1168e4);
|
||||||
|
}
|
||||||
|
QPushButton:hover, QToolButton:hover, QCommandLinkButton:hover{
|
||||||
|
color: #3d3d3d;
|
||||||
|
}
|
||||||
|
QPushButton:pressed, QToolButton:pressed, QCommandLinkButton:pressed{
|
||||||
|
color: #aeaeae;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #ffffff, stop:0.5 #fbfdfd, stop:1 #ffffff);
|
||||||
|
}
|
||||||
|
QPushButton:disabled, QToolButton:disabled, QCommandLinkButton:disabled{
|
||||||
|
color: #616161;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #dce7eb, stop:0.5 #e0e8eb, stop:1 #dee7ec);
|
||||||
|
}
|
||||||
|
QLineEdit, QTextEdit, QPlainTextEdit, QSpinBox, QDoubleSpinBox, QTimeEdit, QDateEdit, QDateTimeEdit {
|
||||||
|
border-width: 2px;
|
||||||
|
border-radius: 8px;
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd);
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd);
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #c1c9cf, stop:1 #d2d8dd);
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd);
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
color: #3d3d3d;
|
||||||
|
}
|
||||||
|
QLineEdit:focus, QTextEdit:focus, QPlainTextEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QTimeEdit:focus, QDateEdit:focus, QDateTimeEdit:focus {
|
||||||
|
border-width: 2px;
|
||||||
|
border-radius: 8px;
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 #85b7e3, stop:1 #9ec1db);
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #85b7e3, stop:1 #9ec1db);
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #85b7e3, stop:1 #9ec1db);
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 #85b7e3, stop:1 #9ec1db);
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
color: #3d3d3d;
|
||||||
|
}
|
||||||
|
QLineEdit:disabled, QTextEdit:disabled, QPlainTextEdit:disabled, QSpinBox:disabled, QDoubleSpinBox:disabled, QTimeEdit:disabled, QDateEdit:disabled, QDateTimeEdit:disabled {
|
||||||
|
color: #b9b9b9;
|
||||||
|
}
|
||||||
|
QSpinBox::up-button, QDoubleSpinBox::up-button, QTimeEdit::up-button, QDateEdit::up-button, QDateTimeEdit::up-button {
|
||||||
|
subcontrol-origin: padding;
|
||||||
|
subcontrol-position: top right;
|
||||||
|
width: 15px;
|
||||||
|
color: #272727;
|
||||||
|
border-left-width: 1px;
|
||||||
|
border-left-color: darkgray;
|
||||||
|
border-left-style: solid;
|
||||||
|
border-top-right-radius: 3px;
|
||||||
|
padding: 3px;
|
||||||
|
}
|
||||||
|
QSpinBox::down-button, QDoubleSpinBox::down-button, QTimeEdit::down-button, QDateEdit::down-button, QDateTimeEdit::down-button {
|
||||||
|
subcontrol-origin: padding;
|
||||||
|
subcontrol-position: bottom right;
|
||||||
|
width: 15px;
|
||||||
|
color: #272727;
|
||||||
|
border-left-width: 1px;
|
||||||
|
border-left-color: darkgray;
|
||||||
|
border-left-style: solid;
|
||||||
|
border-bottom-right-radius: 3px;
|
||||||
|
padding: 3px;
|
||||||
|
}
|
||||||
|
QSpinBox::up-button:pressed, QDoubleSpinBox::up-button:pressed, QTimeEdit::up-button:pressed, QDateEdit::up-button:pressed, QDateTimeEdit::up-button:pressed {
|
||||||
|
color: #aeaeae;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #ffffff, stop:0.5 #fbfdfd, stop:1 #ffffff);
|
||||||
|
}
|
||||||
|
QSpinBox::down-button:pressed, QDoubleSpinBox::down-button:pressed, QTimeEdit::down-button:pressed, QDateEdit::down-button:pressed, QDateTimeEdit::down-button:pressed {
|
||||||
|
color: #aeaeae;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #ffffff, stop:0.5 #fbfdfd, stop:1 #ffffff);
|
||||||
|
}
|
||||||
|
QSpinBox::up-button:hover, QDoubleSpinBox::up-button:hover, QTimeEdit::up-button:hover, QDateEdit::up-button:hover, QDateTimeEdit::up-button:hover {
|
||||||
|
color: #FFFFFF;
|
||||||
|
border-top-right-radius: 5px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #84afe5, stop:1 #1168e4);
|
||||||
|
|
||||||
|
}
|
||||||
|
QSpinBox::down-button:hover, QDoubleSpinBox::down-button:hover, QTimeEdit::down-button:hover, QDateEdit::down-button:hover, QDateTimeEdit::down-button:hover {
|
||||||
|
color: #FFFFFF;
|
||||||
|
border-bottom-right-radius: 5px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #84afe5, stop:1 #1168e4);
|
||||||
|
}
|
||||||
|
QSpinBox::up-arrow, QDoubleSpinBox::up-arrow, QTimeEdit::up-arrow, QDateEdit::up-arrow, QDateTimeEdit::up-arrow {
|
||||||
|
image: url(/usr/share/icons/Adwaita/16x16/actions/go-up-symbolic.symbolic.png);
|
||||||
|
}
|
||||||
|
QSpinBox::down-arrow, QDoubleSpinBox::down-arrow, QTimeEdit::down-arrow, QDateEdit::down-arrow, QDateTimeEdit::down-arrow {
|
||||||
|
image: url(/usr/share/icons/Adwaita/16x16/actions/go-down-symbolic.symbolic.png);
|
||||||
|
}
|
||||||
|
QProgressBar {
|
||||||
|
max-height: 8px;
|
||||||
|
text-align: center;
|
||||||
|
font: italic bold 11px;
|
||||||
|
color: #3d3d3d;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius:4px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #ddd5d5, stop:0.5 #dad3d3, stop:1 #ddd5d5);
|
||||||
|
}
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #467dd1, stop:0.5 #3b88fc, stop:1 #467dd1);
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
QProgressBar:disabled {
|
||||||
|
color: #616161;
|
||||||
|
}
|
||||||
|
QProgressBar::chunk:disabled {
|
||||||
|
background-color: #aeaeae;
|
||||||
|
}
|
||||||
|
QSlider::groove {
|
||||||
|
border: 1px solid #bbbbbb;
|
||||||
|
background-color: #52595d;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
QSlider::groove:horizontal {
|
||||||
|
height: 6px;
|
||||||
|
}
|
||||||
|
QSlider::groove:vertical {
|
||||||
|
width: 6px;
|
||||||
|
}
|
||||||
|
QSlider::handle:horizontal {
|
||||||
|
background: #ffffff;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(207,207,207);
|
||||||
|
width: 12px;
|
||||||
|
margin: -5px 0;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
QSlider::handle:vertical {
|
||||||
|
background: #ffffff;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(207,207,207);
|
||||||
|
height: 12px;
|
||||||
|
margin: 0 -5px;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
QSlider::add-page, QSlider::sub-page {
|
||||||
|
border: 1px transparent;
|
||||||
|
background-color: #52595d;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
QSlider::add-page:horizontal {
|
||||||
|
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #ddd5d5, stop:0.5 #dad3d3, stop:1 #ddd5d5);
|
||||||
|
}
|
||||||
|
QSlider::sub-page:horizontal {
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #467dd1, stop:0.5 #3b88fc, stop:1 #467dd1);
|
||||||
|
}
|
||||||
|
QSlider::add-page:vertical {
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #467dd1, stop:0.5 #3b88fc, stop:1 #467dd1);
|
||||||
|
}
|
||||||
|
QSlider::sub-page:vertical {
|
||||||
|
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #ddd5d5, stop:0.5 #dad3d3, stop:1 #ddd5d5);
|
||||||
|
}
|
||||||
|
QSlider::add-page:horizontal:disabled, QSlider::sub-page:horizontal:disabled, QSlider::add-page:vertical:disabled, QSlider::sub-page:vertical:disabled {
|
||||||
|
background: #b9b9b9;
|
||||||
|
}
|
||||||
|
QComboBox, QFontComboBox {
|
||||||
|
border-width: 2px;
|
||||||
|
border-radius: 8px;
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd);
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd);
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #c1c9cf, stop:1 #d2d8dd);
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd);
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
color: #272727;
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
QComboBox:editable, QComboBox:!editable, QComboBox::drop-down:editable, QComboBox:!editable:on, QComboBox::drop-down:editable:on {
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
QComboBox::drop-down {
|
||||||
|
subcontrol-origin: padding;
|
||||||
|
subcontrol-position: top right;
|
||||||
|
width: 15px;
|
||||||
|
color: #272727;
|
||||||
|
border-left-width: 1px;
|
||||||
|
border-left-color: darkgray;
|
||||||
|
border-left-style: solid;
|
||||||
|
border-top-right-radius: 3px;
|
||||||
|
border-bottom-right-radius: 3px;
|
||||||
|
}
|
||||||
|
QComboBox::down-arrow {
|
||||||
|
image: url(/usr/share/icons/Adwaita/16x16/actions/go-down-symbolic.symbolic.png); /*Adawaita icon thene*/
|
||||||
|
}
|
||||||
|
|
||||||
|
QComboBox::down-arrow:on {
|
||||||
|
top: 1px;
|
||||||
|
left: 1px;
|
||||||
|
}
|
||||||
|
QComboBox QAbstractItemView {
|
||||||
|
border: 1px solid darkgray;
|
||||||
|
border-radius: 8px;
|
||||||
|
selection-background-color: #dadada;
|
||||||
|
selection-color: #272727;
|
||||||
|
color: #272727;
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
QLabel, QCheckBox, QRadioButton {
|
||||||
|
color: #272727;
|
||||||
|
}
|
||||||
|
QCheckBox {
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
QCheckBox:disabled, QRadioButton:disabled {
|
||||||
|
color: #808086;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCheckBox:hover {
|
||||||
|
border-radius:4px;
|
||||||
|
border-style:solid;
|
||||||
|
padding-left: 1px;
|
||||||
|
padding-right: 1px;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
padding-top: 1px;
|
||||||
|
border-width:1px;
|
||||||
|
border-color: transparent;
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:checked {
|
||||||
|
image: url(/usr/share/icons/Adwaita/16x16/actions/object-select-symbolic.symbolic.png);
|
||||||
|
height: 15px;
|
||||||
|
width: 15px;
|
||||||
|
border-style:solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #48a5fd;
|
||||||
|
color: #ffffff;
|
||||||
|
border-radius: 3px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #48a5fd, stop:0.5 #329cfb, stop:1 #48a5fd);
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:unchecked {
|
||||||
|
|
||||||
|
height: 15px;
|
||||||
|
width: 15px;
|
||||||
|
border-style:solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #48a5fd;
|
||||||
|
border-radius: 3px;
|
||||||
|
background-color: #fbfdfa;
|
||||||
|
}
|
||||||
|
QLCDNumber {
|
||||||
|
color: #616161;;
|
||||||
|
}
|
||||||
|
QMenuBar {
|
||||||
|
background-color: #ececec;
|
||||||
|
}
|
||||||
|
QMenuBar::item {
|
||||||
|
color: #616161;
|
||||||
|
spacing: 3px;
|
||||||
|
padding: 1px 4px;
|
||||||
|
background-color: #ececec;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenuBar::item:selected {
|
||||||
|
background-color: #dadada;
|
||||||
|
color: #3d3d3d;
|
||||||
|
}
|
||||||
|
QMenu {
|
||||||
|
background-color: #ececec;
|
||||||
|
}
|
||||||
|
QMenu::item:selected {
|
||||||
|
background-color: #dadada;
|
||||||
|
color: #3d3d3d;
|
||||||
|
}
|
||||||
|
QMenu::item {
|
||||||
|
color: #616161;;
|
||||||
|
background-color: #e0e0e0;
|
||||||
|
}
|
||||||
|
QTabWidget {
|
||||||
|
color:rgb(0,0,0);
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QTabWidget::pane {
|
||||||
|
border-color: #050a0e;
|
||||||
|
background-color: #e0e0e0;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 4px;
|
||||||
|
position: absolute;
|
||||||
|
top: -0.5em;
|
||||||
|
padding-top: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabWidget::tab-bar {
|
||||||
|
alignment: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabBar::tab {
|
||||||
|
border-bottom: 1px solid #c0c0c0;
|
||||||
|
padding: 3px;
|
||||||
|
color: #272727;
|
||||||
|
background-color: #fefefc;
|
||||||
|
margin-left:0px;
|
||||||
|
}
|
||||||
|
QTabBar::tab:!last {
|
||||||
|
border-right: 1px solid;
|
||||||
|
border-right-color: #c0c0c0;
|
||||||
|
border-bottom-color: #c0c0c0;
|
||||||
|
}
|
||||||
|
QTabBar::tab:first {
|
||||||
|
border-top-left-radius: 4px;
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
}
|
||||||
|
QTabBar::tab:last {
|
||||||
|
border-top-right-radius: 4px;
|
||||||
|
border-bottom-right-radius: 4px;
|
||||||
|
}
|
||||||
|
QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #84afe5, stop:1 #1168e4);
|
||||||
|
}
|
||||||
|
QRadioButton::indicator {
|
||||||
|
height: 14px;
|
||||||
|
width: 14px;
|
||||||
|
border-style:solid;
|
||||||
|
border-radius:7px;
|
||||||
|
border-width: 1px;
|
||||||
|
}
|
||||||
|
QRadioButton::indicator:checked {
|
||||||
|
border-color: #48a5fd;
|
||||||
|
background-color: qradialgradient(cx:0.5, cy:0.5, radius:0.4,fx:0.5, fy:0.5, stop:0 #ffffff, stop:0.5 #ffffff, stop:0.6 #48a5fd, stop:1 #48a5fd);
|
||||||
|
}
|
||||||
|
QRadioButton::indicator:!checked {
|
||||||
|
border-color: #a9b7c6;
|
||||||
|
background-color: #fbfdfa;
|
||||||
|
}
|
||||||
|
QStatusBar {
|
||||||
|
color:#027f7f;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDial {
|
||||||
|
background: #16a085;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #222b2e;
|
||||||
|
}
|
||||||
|
QToolBox::tab {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#222b2e;
|
||||||
|
}
|
||||||
|
QToolBox::tab:selected {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color:#222b2e;
|
||||||
|
}
|
||||||
|
QScrollArea {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color:#222b2e;
|
||||||
|
}
|
||||||
|
|
||||||
|
QScrollBar:horizontal {
|
||||||
|
max-height: 10px;
|
||||||
|
border: 1px transparent grey;
|
||||||
|
margin: 0px 20px 0px 20px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
QScrollBar:vertical {
|
||||||
|
max-width: 10px;
|
||||||
|
border: 1px transparent grey;
|
||||||
|
margin: 20px 0px 20px 0px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:vertical, QScrollBar::handle:horizontal {
|
||||||
|
background: #52595d;
|
||||||
|
border-style: transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
min-height: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:horizontal:hover, QScrollBar::handle:vertical:hover {
|
||||||
|
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #467dd1, stop:0.5 #3b88fc, stop:1 #467dd1);
|
||||||
|
}
|
||||||
|
QScrollBar::add-line, QScrollBar::sub-line {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-radius: 4px;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
background: #b9b9b9;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:horizontal {
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: right;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:vertical {
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: bottom;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:horizontal {
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: left;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:vertical {
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: top;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:vertical:pressed, QScrollBar::add-line:horizontal:pressed, QScrollBar::sub-line:horizontal:pressed, QScrollBar::sub-line:vertical:pressed {
|
||||||
|
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #467dd1, stop:0.5 #3b88fc, stop:1 #467dd1);
|
||||||
|
}
|
||||||
|
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal, QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
QScrollBar::up-arrow:vertical {
|
||||||
|
image: url(/usr/share/icons/Adwaita/16x16/actions/go-up-symbolic.symbolic.png);
|
||||||
|
}
|
||||||
|
QScrollBar::down-arrow:vertical {
|
||||||
|
image: url(/usr/share/icons/Adwaita/16x16/actions/go-down-symbolic.symbolic.png);
|
||||||
|
}
|
||||||
|
QScrollBar::left-arrow:horizontal {
|
||||||
|
image: url(/usr/share/icons/Adwaita/16x16/actions/go-previous-symbolic.symbolic.png);
|
||||||
|
}
|
||||||
|
QScrollBar::right-arrow:horizontal {
|
||||||
|
image: url(/usr/share/icons/Adwaita/16x16/actions/go-next-symbolic.symbolic.png);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,531 @@
|
||||||
|
/*
|
||||||
|
ManjaroMix Style Sheet for QT Applications
|
||||||
|
Author: Jaime A. Quiroga P.
|
||||||
|
Company: GTRONICK
|
||||||
|
Last updated: 25/02/2020, 15:42.
|
||||||
|
Available at: https://github.com/GTRONICK/QSS/blob/master/ManjaroMix.qss
|
||||||
|
*/
|
||||||
|
QMainWindow {
|
||||||
|
background-color:#151a1e;
|
||||||
|
}
|
||||||
|
QCalendar {
|
||||||
|
background-color: #151a1e;
|
||||||
|
}
|
||||||
|
QTextEdit {
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
background-color: #222b2e;
|
||||||
|
color: #d3dae3;
|
||||||
|
}
|
||||||
|
QPlainTextEdit {
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
background-color: #222b2e;
|
||||||
|
color: #d3dae3;
|
||||||
|
}
|
||||||
|
QToolButton {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217));
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: #d3dae3;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(255,255,255);
|
||||||
|
}
|
||||||
|
QToolButton:hover{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(197, 197, 197), stop:1 rgb(227, 227, 227));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(197, 197, 197));
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222));
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: rgb(0,0,0);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(255,255,255);
|
||||||
|
}
|
||||||
|
QToolButton:pressed{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217));
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: rgb(0,0,0);
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(142,142,142);
|
||||||
|
}
|
||||||
|
QPushButton{
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #050a0e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: #d3dae3;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #151a1e;
|
||||||
|
}
|
||||||
|
QPushButton::default{
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #050a0e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #151a1e;;
|
||||||
|
}
|
||||||
|
QPushButton:hover{
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #050a0e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: #d3dae3;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #1c1f1f;
|
||||||
|
}
|
||||||
|
QPushButton:pressed{
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #050a0e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: #d3dae3;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #2c2f2f;
|
||||||
|
}
|
||||||
|
QPushButton:disabled{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217));
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222));
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: #808086;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: rgb(142,142,142);
|
||||||
|
}
|
||||||
|
QLineEdit {
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
background-color: #222b2e;
|
||||||
|
color: #d3dae3;
|
||||||
|
}
|
||||||
|
QLabel {
|
||||||
|
color: #d3dae3;
|
||||||
|
}
|
||||||
|
QLCDNumber {
|
||||||
|
color: #4d9b87;
|
||||||
|
}
|
||||||
|
QProgressBar {
|
||||||
|
text-align: center;
|
||||||
|
color: #d3dae3;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: transparent;
|
||||||
|
border-style: solid;
|
||||||
|
background-color: #52595d;
|
||||||
|
}
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: #214037 ;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
QMenuBar {
|
||||||
|
background-color: #151a1e;
|
||||||
|
}
|
||||||
|
QMenuBar::item {
|
||||||
|
color: #d3dae3;
|
||||||
|
spacing: 3px;
|
||||||
|
padding: 1px 4px;
|
||||||
|
background-color: #151a1e;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenuBar::item:selected {
|
||||||
|
background-color: #252a2e;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
QMenu {
|
||||||
|
background-color: #151a1e;
|
||||||
|
}
|
||||||
|
QMenu::item:selected {
|
||||||
|
background-color: #252a2e;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
QMenu::item {
|
||||||
|
color: #d3dae3;
|
||||||
|
background-color: #151a1e;
|
||||||
|
}
|
||||||
|
QTabWidget {
|
||||||
|
color:rgb(0,0,0);
|
||||||
|
background-color:#000000;
|
||||||
|
}
|
||||||
|
QTabWidget::pane {
|
||||||
|
border-color: #050a0e;
|
||||||
|
background-color: #1e282c;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
border-bottom-right-radius: 4px;
|
||||||
|
}
|
||||||
|
QTabBar::tab:first {
|
||||||
|
border-style: solid;
|
||||||
|
border-left-width:1px;
|
||||||
|
border-right-width:0px;
|
||||||
|
border-top-width:1px;
|
||||||
|
border-bottom-width:0px;
|
||||||
|
border-top-color: #050a0e;
|
||||||
|
border-left-color: #050a0e;
|
||||||
|
border-bottom-color: #050a0e;
|
||||||
|
border-top-left-radius: 4px;
|
||||||
|
color: #d3dae3;
|
||||||
|
padding: 3px;
|
||||||
|
margin-left:0px;
|
||||||
|
background-color: #151a1e;
|
||||||
|
}
|
||||||
|
QTabBar::tab:last {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-width:1px;
|
||||||
|
border-left-width:1px;
|
||||||
|
border-right-width:1px;
|
||||||
|
border-bottom-width:0px;
|
||||||
|
border-color: #050a0e;
|
||||||
|
border-top-right-radius: 4px;
|
||||||
|
color: #d3dae3;
|
||||||
|
padding: 3px;
|
||||||
|
margin-left:0px;
|
||||||
|
background-color: #151a1e;
|
||||||
|
}
|
||||||
|
QTabBar::tab {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-width:1px;
|
||||||
|
border-bottom-width:0px;
|
||||||
|
border-left-width:1px;
|
||||||
|
border-top-color: #050a0e;
|
||||||
|
border-left-color: #050a0e;
|
||||||
|
border-bottom-color: #050a0e;
|
||||||
|
color: #d3dae3;
|
||||||
|
padding: 3px;
|
||||||
|
margin-left:0px;
|
||||||
|
background-color: #151a1e;
|
||||||
|
}
|
||||||
|
QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover {
|
||||||
|
border-style: solid;
|
||||||
|
border-left-width:1px;
|
||||||
|
border-bottom-width:0px;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-top-color: #050a0e;
|
||||||
|
border-left-color: #050a0e;
|
||||||
|
border-bottom-color: #050a0e;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 3px;
|
||||||
|
margin-left:0px;
|
||||||
|
background-color: #1e282c;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabBar::tab:selected, QTabBar::tab:first:selected, QTabBar::tab:hover {
|
||||||
|
border-style: solid;
|
||||||
|
border-left-width:1px;
|
||||||
|
border-bottom-width:0px;
|
||||||
|
border-top-width:1px;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-top-color: #050a0e;
|
||||||
|
border-left-color: #050a0e;
|
||||||
|
border-bottom-color: #050a0e;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 3px;
|
||||||
|
margin-left:0px;
|
||||||
|
background-color: #1e282c;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCheckBox {
|
||||||
|
color: #d3dae3;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
QCheckBox:disabled {
|
||||||
|
color: #808086;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCheckBox:hover {
|
||||||
|
border-radius:4px;
|
||||||
|
border-style:solid;
|
||||||
|
padding-left: 1px;
|
||||||
|
padding-right: 1px;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
padding-top: 1px;
|
||||||
|
border-width:1px;
|
||||||
|
border-color: transparent;
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:checked {
|
||||||
|
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
color: #000000;
|
||||||
|
background-color: qradialgradient(cx:0.4, cy:0.4, radius: 1.5,fx:0, fy:0, stop:0 #1e282c, stop:0.3 #1e282c, stop:0.4 #4fa08b, stop:0.5 #1e282c, stop:1 #1e282c);
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:unchecked {
|
||||||
|
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
QRadioButton {
|
||||||
|
color: #d3dae3;
|
||||||
|
padding: 1px;
|
||||||
|
}
|
||||||
|
QRadioButton::indicator:checked {
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-radius:5px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: qradialgradient(cx:0.5, cy:0.5, radius:0.4,fx:0.5, fy:0.5, stop:0 #4fa08b, stop:1 #1e282c);
|
||||||
|
}
|
||||||
|
QRadioButton::indicator:!checked {
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-radius:5px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
QStatusBar {
|
||||||
|
color:#027f7f;
|
||||||
|
}
|
||||||
|
QSpinBox {
|
||||||
|
color: #d3dae3;
|
||||||
|
background-color: #222b2e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
}
|
||||||
|
QDoubleSpinBox {
|
||||||
|
color: #d3dae3;
|
||||||
|
background-color: #222b2e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
}
|
||||||
|
QTimeEdit {
|
||||||
|
color: #d3dae3;
|
||||||
|
background-color: #222b2e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
}
|
||||||
|
QDateTimeEdit {
|
||||||
|
color: #d3dae3;
|
||||||
|
background-color: #222b2e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
}
|
||||||
|
QDateEdit {
|
||||||
|
color: #d3dae3;
|
||||||
|
background-color: #222b2e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
}
|
||||||
|
QFontComboBox {
|
||||||
|
color: #d3dae3;
|
||||||
|
background-color: #222b2e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
}
|
||||||
|
QComboBox {
|
||||||
|
color: #d3dae3;
|
||||||
|
background-color: #222b2e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4fa08b;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDial {
|
||||||
|
background: #16a085;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #222b2e;
|
||||||
|
}
|
||||||
|
QToolBox::tab {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:#222b2e;
|
||||||
|
}
|
||||||
|
QToolBox::tab:selected {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color:#222b2e;
|
||||||
|
}
|
||||||
|
QScrollArea {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color:#222b2e;
|
||||||
|
}
|
||||||
|
QSlider::groove:horizontal {
|
||||||
|
height: 5px;
|
||||||
|
background-color: #52595d;
|
||||||
|
}
|
||||||
|
QSlider::groove:vertical {
|
||||||
|
width: 5px;
|
||||||
|
background-color: #52595d;
|
||||||
|
}
|
||||||
|
QSlider::handle:horizontal {
|
||||||
|
background: #1a2224;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(207,207,207);
|
||||||
|
width: 12px;
|
||||||
|
margin: -5px 0;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
QSlider::handle:vertical {
|
||||||
|
background: #1a2224;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(207,207,207);
|
||||||
|
height: 12px;
|
||||||
|
margin: 0 -5px;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
QSlider::add-page:horizontal {
|
||||||
|
background: #52595d;
|
||||||
|
}
|
||||||
|
QSlider::add-page:vertical {
|
||||||
|
background: #52595d;
|
||||||
|
}
|
||||||
|
QSlider::sub-page:horizontal {
|
||||||
|
background-color: #15433a;
|
||||||
|
}
|
||||||
|
QSlider::sub-page:vertical {
|
||||||
|
background-color: #15433a;
|
||||||
|
}
|
||||||
|
QScrollBar:horizontal {
|
||||||
|
max-height: 10px;
|
||||||
|
border: 1px transparent grey;
|
||||||
|
margin: 0px 20px 0px 20px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
QScrollBar:vertical {
|
||||||
|
max-width: 10px;
|
||||||
|
border: 1px transparent grey;
|
||||||
|
margin: 20px 0px 20px 0px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:horizontal {
|
||||||
|
background: #52595d;
|
||||||
|
border-style: transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
min-width: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:horizontal:hover {
|
||||||
|
background: #58a492;
|
||||||
|
border-style: transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
min-width: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:vertical {
|
||||||
|
background: #52595d;
|
||||||
|
border-style: transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
min-height: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:vertical:hover {
|
||||||
|
background: #58a492;
|
||||||
|
border-style: transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
min-height: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:horizontal {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-top-right-radius: 4px;
|
||||||
|
border-bottom-right-radius: 4px;
|
||||||
|
background: #15433a;
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: right;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:horizontal:pressed {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-top-right-radius: 4px;
|
||||||
|
border-bottom-right-radius: 4px;
|
||||||
|
background: rgb(181,181,181);
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: right;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:vertical {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
border-bottom-right-radius: 4px;
|
||||||
|
background: #15433a;
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: bottom;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:vertical:pressed {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
border-bottom-right-radius: 4px;
|
||||||
|
background: rgb(181,181,181);
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: bottom;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:horizontal {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-top-left-radius: 4px;
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
background: #15433a;
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: left;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:horizontal:pressed {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-top-left-radius: 4px;
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
background: rgb(181,181,181);
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: left;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:vertical {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-top-left-radius: 4px;
|
||||||
|
border-top-right-radius: 4px;
|
||||||
|
background: #15433a;
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: top;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:vertical:pressed {
|
||||||
|
border: 2px transparent grey;
|
||||||
|
border-top-left-radius: 4px;
|
||||||
|
border-top-right-radius: 4px;
|
||||||
|
background: rgb(181,181,181);
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: top;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
|
||||||
|
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,390 @@
|
||||||
|
/*
|
||||||
|
Material Dark Style Sheet for QT Applications
|
||||||
|
Author: Jaime A. Quiroga P.
|
||||||
|
Inspired on https://github.com/jxfwinter/qt-material-stylesheet
|
||||||
|
Company: GTRONICK
|
||||||
|
Last updated: 04/12/2018, 15:00.
|
||||||
|
Available at: https://github.com/GTRONICK/QSS/blob/master/MaterialDark.qss
|
||||||
|
*/
|
||||||
|
QMainWindow {
|
||||||
|
background-color:#1e1d23;
|
||||||
|
}
|
||||||
|
QDialog {
|
||||||
|
background-color:#1e1d23;
|
||||||
|
}
|
||||||
|
QColorDialog {
|
||||||
|
background-color:#1e1d23;
|
||||||
|
}
|
||||||
|
QTextEdit {
|
||||||
|
background-color:#1e1d23;
|
||||||
|
color: #a9b7c6;
|
||||||
|
}
|
||||||
|
QPlainTextEdit {
|
||||||
|
selection-background-color:#007b50;
|
||||||
|
background-color:#1e1d23;
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
border-width: 1px;
|
||||||
|
color: #a9b7c6;
|
||||||
|
}
|
||||||
|
QPushButton{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #a9b7c6;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QPushButton::default{
|
||||||
|
border-style: inset;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #04b97f;
|
||||||
|
border-width: 1px;
|
||||||
|
color: #a9b7c6;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QToolButton {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #04b97f;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #a9b7c6;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QToolButton:hover{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #37efba;
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QPushButton:hover{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #37efba;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QPushButton:pressed{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #37efba;
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #37efba;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QPushButton:disabled{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #808086;
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #808086;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QLineEdit {
|
||||||
|
border-width: 1px; border-radius: 4px;
|
||||||
|
border-color: rgb(58, 58, 58);
|
||||||
|
border-style: inset;
|
||||||
|
padding: 0 8px;
|
||||||
|
color: #a9b7c6;
|
||||||
|
background:#1e1d23;
|
||||||
|
selection-background-color:#007b50;
|
||||||
|
selection-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
QLabel {
|
||||||
|
color: #a9b7c6;
|
||||||
|
}
|
||||||
|
QLCDNumber {
|
||||||
|
color: #37e6b4;
|
||||||
|
}
|
||||||
|
QProgressBar {
|
||||||
|
text-align: center;
|
||||||
|
color: rgb(240, 240, 240);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border-color: rgb(58, 58, 58);
|
||||||
|
border-style: inset;
|
||||||
|
background-color:#1e1d23;
|
||||||
|
}
|
||||||
|
QProgressBar::chunk {
|
||||||
|
background-color: #04b97f;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
QMenuBar {
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QMenuBar::item {
|
||||||
|
color: #a9b7c6;
|
||||||
|
spacing: 3px;
|
||||||
|
padding: 1px 4px;
|
||||||
|
background: #1e1d23;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenuBar::item:selected {
|
||||||
|
background:#1e1d23;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
QMenu::item:selected {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: #04b97f;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
border-left-width: 2px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding-left:15px;
|
||||||
|
padding-top:4px;
|
||||||
|
padding-bottom:4px;
|
||||||
|
padding-right:7px;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QMenu::item {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #a9b7c6;
|
||||||
|
padding-left:17px;
|
||||||
|
padding-top:4px;
|
||||||
|
padding-bottom:4px;
|
||||||
|
padding-right:7px;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QMenu{
|
||||||
|
background-color:#1e1d23;
|
||||||
|
}
|
||||||
|
QTabWidget {
|
||||||
|
color:rgb(0,0,0);
|
||||||
|
background-color:#1e1d23;
|
||||||
|
}
|
||||||
|
QTabWidget::pane {
|
||||||
|
border-color: rgb(77,77,77);
|
||||||
|
background-color:#1e1d23;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
QTabBar::tab {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #808086;
|
||||||
|
padding: 3px;
|
||||||
|
margin-left:3px;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover {
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-bottom-color: #04b97f;
|
||||||
|
border-bottom-width: 2px;
|
||||||
|
border-style: solid;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding-left: 3px;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
margin-left:3px;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCheckBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
QCheckBox:disabled {
|
||||||
|
color: #808086;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCheckBox:hover {
|
||||||
|
border-radius:4px;
|
||||||
|
border-style:solid;
|
||||||
|
padding-left: 1px;
|
||||||
|
padding-right: 1px;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
padding-top: 1px;
|
||||||
|
border-width:1px;
|
||||||
|
border-color: rgb(87, 97, 106);
|
||||||
|
background-color:#1e1d23;
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:checked {
|
||||||
|
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #04b97f;
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #04b97f;
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:unchecked {
|
||||||
|
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #04b97f;
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
QRadioButton {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
padding: 1px;
|
||||||
|
}
|
||||||
|
QRadioButton::indicator:checked {
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-radius:5px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #04b97f;
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #04b97f;
|
||||||
|
}
|
||||||
|
QRadioButton::indicator:!checked {
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-radius:5px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: #04b97f;
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
QStatusBar {
|
||||||
|
color:#027f7f;
|
||||||
|
}
|
||||||
|
QSpinBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QDoubleSpinBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QTimeEdit {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QDateTimeEdit {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QDateEdit {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QComboBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background: #1e1d23;
|
||||||
|
}
|
||||||
|
QComboBox:editable {
|
||||||
|
background: #1e1d23;
|
||||||
|
color: #a9b7c6;
|
||||||
|
selection-background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QComboBox QAbstractItemView {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background: #1e1d23;
|
||||||
|
selection-color: #FFFFFF;
|
||||||
|
selection-background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QComboBox:!editable:on, QComboBox::drop-down:editable:on {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background: #1e1d23;
|
||||||
|
}
|
||||||
|
QFontComboBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QToolBox {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QToolBox::tab {
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QToolBox::tab:selected {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QScrollArea {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color: #1e1d23;
|
||||||
|
}
|
||||||
|
QSlider::groove:horizontal {
|
||||||
|
height: 5px;
|
||||||
|
background: #04b97f;
|
||||||
|
}
|
||||||
|
QSlider::groove:vertical {
|
||||||
|
width: 5px;
|
||||||
|
background: #04b97f;
|
||||||
|
}
|
||||||
|
QSlider::handle:horizontal {
|
||||||
|
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
|
||||||
|
border: 1px solid #5c5c5c;
|
||||||
|
width: 14px;
|
||||||
|
margin: -5px 0;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
QSlider::handle:vertical {
|
||||||
|
background: qlineargradient(x1:1, y1:1, x2:0, y2:0, stop:0 #b4b4b4, stop:1 #8f8f8f);
|
||||||
|
border: 1px solid #5c5c5c;
|
||||||
|
height: 14px;
|
||||||
|
margin: 0 -5px;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
QSlider::add-page:horizontal {
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
QSlider::add-page:vertical {
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
QSlider::sub-page:horizontal {
|
||||||
|
background: #04b97f;
|
||||||
|
}
|
||||||
|
QSlider::sub-page:vertical {
|
||||||
|
background: #04b97f;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
Neon Style Sheet for QT Applications (QpushButton)
|
||||||
|
Author: Jaime A. Quiroga P.
|
||||||
|
Company: GTRONICK
|
||||||
|
Last updated: 24/10/2020, 15:42.
|
||||||
|
Available at: https://github.com/GTRONICK/QSS/blob/master/NeonButtons.qss
|
||||||
|
*/
|
||||||
|
QPushButton{
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #050a0e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: #d3dae3;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #100E19;
|
||||||
|
}
|
||||||
|
QPushButton::default{
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #050a0e;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #151a1e;
|
||||||
|
}
|
||||||
|
QPushButton:hover{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 #C0DB50, stop:0.4 #C0DB50, stop:0.5 #100E19, stop:1 #100E19);
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 #100E19, stop:0.5 #100E19, stop:0.6 #C0DB50, stop:1 #C0DB50);
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #C0DB50, stop:0.3 #C0DB50, stop:0.7 #100E19, stop:1 #100E19);
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 #C0DB50, stop:0.3 #C0DB50, stop:0.7 #100E19, stop:1 #100E19);
|
||||||
|
border-width: 2px;
|
||||||
|
border-radius: 1px;
|
||||||
|
color: #d3dae3;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
QPushButton:pressed{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 #d33af1, stop:0.4 #d33af1, stop:0.5 #100E19, stop:1 #100E19);
|
||||||
|
border-bottom-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 #100E19, stop:0.5 #100E19, stop:0.6 #d33af1, stop:1 #d33af1);
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #d33af1, stop:0.3 #d33af1, stop:0.7 #100E19, stop:1 #100E19);
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 #d33af1, stop:0.3 #d33af1, stop:0.7 #100E19, stop:1 #100E19);
|
||||||
|
border-width: 2px;
|
||||||
|
border-radius: 1px;
|
||||||
|
color: #d3dae3;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 166 B |
Binary file not shown.
|
After Width: | Height: | Size: 140 B |
Binary file not shown.
|
After Width: | Height: | Size: 147 B |
Binary file not shown.
|
After Width: | Height: | Size: 165 B |
Binary file not shown.
|
After Width: | Height: | Size: 167 B |
|
|
@ -0,0 +1,45 @@
|
||||||
|
### QT StyleSheet templates ###
|
||||||
|
Themes available:
|
||||||
|
1. [Ubuntu](https://github.com/GTRONICK/QSS/blob/master/Ubuntu.qss)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. [ElegantDark](https://github.com/GTRONICK/QSS/blob/master/ElegantDark.qss)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. [MaterialDark](https://github.com/GTRONICK/QSS/blob/master/MaterialDark.qss)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
4. [ConsoleStyle](https://github.com/GTRONICK/QSS/blob/master/ConsoleStyle.qss)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
5. [AMOLED](https://github.com/GTRONICK/QSS/blob/master/AMOLED.qss)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
6. [Aqua](https://github.com/GTRONICK/QSS/blob/master/Aqua.qss)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## The ManjaroMix Theme!: Includes a radial gradient for Checkboxes, and minimalist arrows for scrollbars. ##
|
||||||
|
7. [ManjaroMix](https://github.com/GTRONICK/QSS/blob/master/ManjaroMix.qss)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
8. [NeonButtons](https://github.com/GTRONICK/QSS/blob/master/NeonButtons.qss)
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
## MacOS Theme!: Reduced code, image integration through URL resources. ##
|
||||||
|
9. [MacOS](https://github.com/GTRONICK/QSS/blob/master/MacOS.qss)
|
||||||
|
|
||||||
|

|
||||||
|
**Added images in QSS_IMG folder**
|
||||||
|
|
||||||
|
Stay tunned!, this files are being updated frequently.
|
||||||
|
*Consider donating :)* **PayPal Account:** gtronick@gmail.com
|
||||||
|
|
||||||
|
|
@ -0,0 +1,496 @@
|
||||||
|
/*
|
||||||
|
Ubuntu Style Sheet for QT Applications
|
||||||
|
Author: Jaime A. Quiroga P.
|
||||||
|
Company: GTRONICK
|
||||||
|
Last updated: 01/10/2021 (dd/mm/yyyy), 15:18.
|
||||||
|
Available at: https://github.com/GTRONICK/QSS/blob/master/Ubuntu.qss
|
||||||
|
*/
|
||||||
|
QMainWindow {
|
||||||
|
background-color:#f0f0f0;
|
||||||
|
}
|
||||||
|
QCheckBox {
|
||||||
|
padding:2px;
|
||||||
|
}
|
||||||
|
QCheckBox:hover {
|
||||||
|
border:1px solid rgb(255,150,60);
|
||||||
|
border-radius:4px;
|
||||||
|
padding: 1px;
|
||||||
|
background-color:qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(190, 90, 50, 50), stop:1 rgba(250, 130, 40, 50));
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:checked {
|
||||||
|
border:1px solid rgb(246, 134, 86);
|
||||||
|
border-radius:4px;
|
||||||
|
background-color:rgb(246, 134, 86)
|
||||||
|
}
|
||||||
|
QCheckBox::indicator:unchecked {
|
||||||
|
border-width:1px solid rgb(246, 134, 86);
|
||||||
|
border-radius:4px;
|
||||||
|
background-color:rgb(255,255,255);
|
||||||
|
}
|
||||||
|
QColorDialog {
|
||||||
|
background-color:#f0f0f0;
|
||||||
|
}
|
||||||
|
QComboBox {
|
||||||
|
color:rgb(81,72,65);
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
QComboBox:editable {
|
||||||
|
selection-color:rgb(81,72,65);
|
||||||
|
selection-background-color: #ffffff;
|
||||||
|
}
|
||||||
|
QComboBox QAbstractItemView {
|
||||||
|
selection-color: #ffffff;
|
||||||
|
selection-background-color: rgb(246, 134, 86);
|
||||||
|
}
|
||||||
|
QComboBox:!editable:on, QComboBox::drop-down:editable:on {
|
||||||
|
color: #1e1d23;
|
||||||
|
}
|
||||||
|
QDateTimeEdit, QDateEdit, QDoubleSpinBox, QFontComboBox {
|
||||||
|
color:rgb(81,72,65);
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDialog {
|
||||||
|
background-color:#f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLabel,QLineEdit {
|
||||||
|
color:rgb(17,17,17);
|
||||||
|
}
|
||||||
|
QLineEdit {
|
||||||
|
background-color:rgb(255,255,255);
|
||||||
|
selection-background-color:rgb(236,116,64);
|
||||||
|
}
|
||||||
|
QMenuBar {
|
||||||
|
color:rgb(223,219,210);
|
||||||
|
background-color:rgb(65,64,59);
|
||||||
|
}
|
||||||
|
QMenuBar::item {
|
||||||
|
padding-top:4px;
|
||||||
|
padding-left:4px;
|
||||||
|
padding-right:4px;
|
||||||
|
color:rgb(223,219,210);
|
||||||
|
background-color:rgb(65,64,59);
|
||||||
|
}
|
||||||
|
QMenuBar::item:selected {
|
||||||
|
color:rgb(255,255,255);
|
||||||
|
padding-top:2px;
|
||||||
|
padding-left:2px;
|
||||||
|
padding-right:2px;
|
||||||
|
border-top-width:2px;
|
||||||
|
border-left-width:2px;
|
||||||
|
border-right-width:2px;
|
||||||
|
border-top-right-radius:4px;
|
||||||
|
border-top-left-radius:4px;
|
||||||
|
border-style:solid;
|
||||||
|
background-color:rgb(65,64,59);
|
||||||
|
border-top-color: rgb(47,47,44);
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(90, 87, 78, 255), stop:1 rgba(47,47,44, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 rgba(90, 87, 78, 255), stop:1 rgba(47,47,44, 255));
|
||||||
|
}
|
||||||
|
QMenu {
|
||||||
|
color:rgb(223,219,210);
|
||||||
|
background-color:rgb(65,64,59);
|
||||||
|
}
|
||||||
|
QMenu::item {
|
||||||
|
color:rgb(223,219,210);
|
||||||
|
padding:4px 10px 4px 20px;
|
||||||
|
}
|
||||||
|
QMenu::item:selected {
|
||||||
|
color:rgb(255,255,255);
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(225, 108, 54, 255), stop:1 rgba(246, 134, 86, 255));
|
||||||
|
border-style:solid;
|
||||||
|
border-width:3px;
|
||||||
|
padding:4px 7px 4px 17px;
|
||||||
|
border-bottom-color:qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(175,85,48,255), stop:1 rgba(236,114,67, 255));
|
||||||
|
border-top-color:qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(253,156,113,255), stop:1 rgba(205,90,46, 255));
|
||||||
|
border-right-color:qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgba(253,156,113,255), stop:1 rgba(205,90,46, 255));
|
||||||
|
border-left-color:qlineargradient(spread:pad, x1:1, y1:0.5, x2:0, y2:0.5, stop:0 rgba(253,156,113,255), stop:1 rgba(205,90,46, 255));
|
||||||
|
}
|
||||||
|
QPlainTextEdit {
|
||||||
|
border: 1px solid transparent;
|
||||||
|
color:rgb(17,17,17);
|
||||||
|
selection-background-color:rgb(236,116,64);
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
QProgressBar {
|
||||||
|
text-align: center;
|
||||||
|
color: rgb(0, 0, 0);
|
||||||
|
border: 1px inset rgb(150,150,150);
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color:rgb(221,221,219);
|
||||||
|
}
|
||||||
|
QProgressBar::chunk:horizontal {
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(225, 108, 54, 255), stop:1 rgba(246, 134, 86, 255));
|
||||||
|
border:1px solid;
|
||||||
|
border-radius:8px;
|
||||||
|
border-bottom-color:qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(175,85,48,255), stop:1 rgba(236,114,67, 255));
|
||||||
|
border-top-color:qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(253,156,113,255), stop:1 rgba(205,90,46, 255));
|
||||||
|
border-right-color:qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgba(253,156,113,255), stop:1 rgba(205,90,46, 255));
|
||||||
|
border-left-color:qlineargradient(spread:pad, x1:1, y1:0.5, x2:0, y2:0.5, stop:0 rgba(253,156,113,255), stop:1 rgba(205,90,46, 255));
|
||||||
|
}
|
||||||
|
QPushButton{
|
||||||
|
color:rgb(17,17,17);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 6px;
|
||||||
|
border-bottom-color: rgb(150,150,150);
|
||||||
|
border-right-color: rgb(165,165,165);
|
||||||
|
border-left-color: rgb(165,165,165);
|
||||||
|
border-top-color: rgb(180,180,180);
|
||||||
|
border-style: solid;
|
||||||
|
padding: 4px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(220, 220, 220, 255), stop:1 rgba(255, 255, 255, 255));
|
||||||
|
}
|
||||||
|
QPushButton:hover{
|
||||||
|
color:rgb(17,17,17);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius:6px;
|
||||||
|
border-top-color: rgb(255,150,60);
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(200, 70, 20, 255), stop:1 rgba(255,150,60, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 rgba(200, 70, 20, 255), stop:1 rgba(255,150,60, 255));
|
||||||
|
border-bottom-color: rgb(200,70,20);
|
||||||
|
border-style: solid;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(220, 220, 220, 255), stop:1 rgba(255, 255, 255, 255));
|
||||||
|
}
|
||||||
|
QPushButton:default{
|
||||||
|
color:rgb(17,17,17);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius:6px;
|
||||||
|
border-top-color: rgb(255,150,60);
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(200, 70, 20, 255), stop:1 rgba(255,150,60, 255));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 rgba(200, 70, 20, 255), stop:1 rgba(255,150,60, 255));
|
||||||
|
border-bottom-color: rgb(200,70,20);
|
||||||
|
border-style: solid;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(220, 220, 220, 255), stop:1 rgba(255, 255, 255, 255));
|
||||||
|
}
|
||||||
|
QPushButton:pressed{
|
||||||
|
color:rgb(17,17,17);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 6px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-top-color: rgba(255,150,60,200);
|
||||||
|
border-right-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(200, 70, 20, 255), stop:1 rgba(255,150,60, 200));
|
||||||
|
border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 rgba(200, 70, 20, 255), stop:1 rgba(255,150,60, 200));
|
||||||
|
border-bottom-color: rgba(200,70,20,200);
|
||||||
|
border-style: solid;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(220, 220, 220, 255), stop:1 rgba(255, 255, 255, 255));
|
||||||
|
}
|
||||||
|
QPushButton:disabled{
|
||||||
|
color:rgb(174,167,159);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 6px;
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(200, 200, 200, 255), stop:1 rgba(230, 230, 230, 255));
|
||||||
|
}
|
||||||
|
QRadioButton {
|
||||||
|
padding: 1px;
|
||||||
|
}
|
||||||
|
QRadioButton::indicator:checked {
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-radius:5px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgba(246, 134, 86, 255);
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color:rgba(246, 134, 86, 255);
|
||||||
|
}
|
||||||
|
QRadioButton::indicator:!checked {
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
border-style:solid;
|
||||||
|
border-radius:5px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(246, 134, 86);
|
||||||
|
color: #a9b7c6;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
QScrollArea {
|
||||||
|
color: white;
|
||||||
|
background-color:#f0f0f0;
|
||||||
|
}
|
||||||
|
QSlider::groove {
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(207,207,207);
|
||||||
|
}
|
||||||
|
QSlider::groove:horizontal {
|
||||||
|
height: 5px;
|
||||||
|
background: rgb(246, 134, 86);
|
||||||
|
}
|
||||||
|
QSlider::groove:vertical {
|
||||||
|
width: 5px;
|
||||||
|
background: rgb(246, 134, 86);
|
||||||
|
}
|
||||||
|
QSlider::handle:horizontal {
|
||||||
|
background: rgb(253,253,253);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(207,207,207);
|
||||||
|
width: 12px;
|
||||||
|
margin: -5px 0;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
QSlider::handle:vertical {
|
||||||
|
background: rgb(253,253,253);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-color: rgb(207,207,207);
|
||||||
|
height: 12px;
|
||||||
|
margin: 0 -5px;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
QSlider::add-page:horizontal, QSlider::add-page:vertical {
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
QSlider::sub-page:horizontal, QSlider::sub-page:vertical {
|
||||||
|
background: rgb(246, 134, 86);
|
||||||
|
}
|
||||||
|
QStatusBar, QSpinBox {
|
||||||
|
color:rgb(81,72,65);
|
||||||
|
}
|
||||||
|
QSpinBox {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
QScrollBar:horizontal {
|
||||||
|
max-height: 20px;
|
||||||
|
border: 1px transparent;
|
||||||
|
margin: 0px 20px 0px 20px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:horizontal {
|
||||||
|
background: rgb(253,253,253);
|
||||||
|
border: 1px solid rgb(207,207,207);
|
||||||
|
border-radius: 7px;
|
||||||
|
min-width: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:horizontal:hover {
|
||||||
|
background: rgb(253,253,253);
|
||||||
|
border: 1px solid rgb(255,150,60);
|
||||||
|
border-radius: 7px;
|
||||||
|
min-width: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:horizontal {
|
||||||
|
border: 1px solid rgb(207,207,207);
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-bottom-right-radius: 7px;
|
||||||
|
background: rgb(255, 255, 255);
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: right;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:horizontal:hover {
|
||||||
|
border: 1px solid rgb(255,150,60);
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-bottom-right-radius: 7px;
|
||||||
|
background: rgb(255, 255, 255);
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: right;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:horizontal:pressed {
|
||||||
|
border: 1px solid grey;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
border-bottom-right-radius: 7px;
|
||||||
|
background: rgb(231,231,231);
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: right;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:horizontal {
|
||||||
|
border: 1px solid rgb(207,207,207);
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-bottom-left-radius: 7px;
|
||||||
|
background: rgb(255, 255, 255);
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: left;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:horizontal:hover {
|
||||||
|
border: 1px solid rgb(255,150,60);
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-bottom-left-radius: 7px;
|
||||||
|
background: rgb(255, 255, 255);
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: left;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:horizontal:pressed {
|
||||||
|
border: 1px solid grey;
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-bottom-left-radius: 7px;
|
||||||
|
background: rgb(231,231,231);
|
||||||
|
width: 20px;
|
||||||
|
subcontrol-position: left;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::left-arrow:horizontal {
|
||||||
|
border: 1px transparent grey;
|
||||||
|
border-top-left-radius: 3px;
|
||||||
|
border-bottom-left-radius: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background: rgb(230,230,230);
|
||||||
|
}
|
||||||
|
QScrollBar::right-arrow:horizontal {
|
||||||
|
border: 1px transparent grey;
|
||||||
|
border-top-right-radius: 3px;
|
||||||
|
border-bottom-right-radius: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background: rgb(230,230,230);
|
||||||
|
}
|
||||||
|
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
QScrollBar:vertical {
|
||||||
|
max-width: 20px;
|
||||||
|
border: 1px transparent grey;
|
||||||
|
margin: 20px 0px 20px 0px;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:vertical {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: rgb(207,207,207);
|
||||||
|
border-bottom-right-radius: 7px;
|
||||||
|
border-bottom-left-radius: 7px;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
background: rgb(255, 255, 255);
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: bottom;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:vertical:hover {
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: rgb(255,150,60);
|
||||||
|
border-bottom-right-radius: 7px;
|
||||||
|
border-bottom-left-radius: 7px;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
background: rgb(255, 255, 255);
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: bottom;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::add-line:vertical:pressed {
|
||||||
|
border: 1px solid grey;
|
||||||
|
border-bottom-left-radius: 7px;
|
||||||
|
border-bottom-right-radius: 7px;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
background: rgb(231,231,231);
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: bottom;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:vertical {
|
||||||
|
border: 1px solid rgb(207,207,207);
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-bottom-left-radius: 7px;
|
||||||
|
background: rgb(255, 255, 255);
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: top;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:vertical:hover {
|
||||||
|
border: 1px solid rgb(255,150,60);
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-bottom-left-radius: 7px;
|
||||||
|
background: rgb(255, 255, 255);
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: top;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::sub-line:vertical:pressed {
|
||||||
|
border: 1px solid grey;
|
||||||
|
border-top-left-radius: 7px;
|
||||||
|
border-top-right-radius: 7px;
|
||||||
|
background: rgb(231,231,231);
|
||||||
|
height: 20px;
|
||||||
|
subcontrol-position: top;
|
||||||
|
subcontrol-origin: margin;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:vertical {
|
||||||
|
background: rgb(253,253,253);
|
||||||
|
border: 1px solid rgb(207,207,207);
|
||||||
|
border-radius: 7px;
|
||||||
|
min-height: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::handle:vertical:hover {
|
||||||
|
background: rgb(253,253,253);
|
||||||
|
border: 1px solid rgb(255,150,60);
|
||||||
|
border-radius: 7px;
|
||||||
|
min-height: 25px;
|
||||||
|
}
|
||||||
|
QScrollBar::up-arrow:vertical {
|
||||||
|
border: 1px transparent grey;
|
||||||
|
border-top-left-radius: 3px;
|
||||||
|
border-top-right-radius: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background: rgb(230,230,230);
|
||||||
|
}
|
||||||
|
QScrollBar::down-arrow:vertical {
|
||||||
|
border: 1px transparent grey;
|
||||||
|
border-bottom-left-radius: 3px;
|
||||||
|
border-bottom-right-radius: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
background: rgb(230,230,230);
|
||||||
|
}
|
||||||
|
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
QTabWidget {
|
||||||
|
color:rgb(0,0,0);
|
||||||
|
background-color:rgb(247,246,246);
|
||||||
|
}
|
||||||
|
QTabWidget::pane {
|
||||||
|
border-color: rgb(180,180,180);
|
||||||
|
background-color:rgb(247,246,246);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
QTabBar::tab {
|
||||||
|
padding-left:4px;
|
||||||
|
padding-right:4px;
|
||||||
|
padding-bottom:2px;
|
||||||
|
padding-top:2px;
|
||||||
|
color:rgb(81,72,65);
|
||||||
|
background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(221,218,217,255), stop:1 rgba(240,239,238,255));
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-top-right-radius:4px;
|
||||||
|
border-top-left-radius:4px;
|
||||||
|
border-top-color: rgb(180,180,180);
|
||||||
|
border-left-color: rgb(180,180,180);
|
||||||
|
border-right-color: rgb(180,180,180);
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
}
|
||||||
|
QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover {
|
||||||
|
background-color:rgb(247,246,246);
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 1px;
|
||||||
|
}
|
||||||
|
QTabBar::tab:!selected {
|
||||||
|
margin-top: 1px;
|
||||||
|
margin-right: 1px;
|
||||||
|
}
|
||||||
|
QTextEdit {
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color:transparent;
|
||||||
|
color:rgb(17,17,17);
|
||||||
|
selection-background-color:rgb(236,116,64);
|
||||||
|
}
|
||||||
|
QTimeEdit, QToolBox, QToolBox::tab, QToolBox::tab:selected {
|
||||||
|
color:rgb(81,72,65);
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,112 @@
|
||||||
|
/**
|
||||||
|
* @file GF3StripPatchProcess/main.cpp
|
||||||
|
* @brief Main entry point for the GF3 Strip Patch Process application.
|
||||||
|
* @details 适用于GF3卫星影像的条带批量化处理程序。
|
||||||
|
* @author 陈增辉(3045316072@qq.com)
|
||||||
|
* @date 2025-05-12
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
#include <QtCore/QCoreApplication>
|
||||||
|
#include "QGF3StripBatchProcessDialog.h"
|
||||||
|
#include <QtWidgets/QApplication>
|
||||||
|
#include <QDateTime>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QTextStream>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#pragma execution_character_set("utf-8")
|
||||||
|
|
||||||
|
// 自定义消息处理器函数
|
||||||
|
void customMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg)
|
||||||
|
{
|
||||||
|
QByteArray localMsg = msg.toLocal8Bit();
|
||||||
|
const char* file = context.file ? context.file : "";
|
||||||
|
const char* function = context.function ? context.function : "";
|
||||||
|
QString dateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz");
|
||||||
|
|
||||||
|
QFile outFile("application.log");
|
||||||
|
outFile.open(QIODevice::WriteOnly | QIODevice::Append);
|
||||||
|
QTextStream ts(&outFile);
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case QtDebugMsg:
|
||||||
|
{
|
||||||
|
QString logMessage = QString("%1 Debug: %2 (%3:%4, %5)")
|
||||||
|
.arg(dateTime) // Assuming dateTime is a QDateTime object and needs to be converted to string
|
||||||
|
.arg(QString::fromLocal8Bit(localMsg.constData()))
|
||||||
|
.arg(file)
|
||||||
|
.arg(context.line)
|
||||||
|
.arg(function);
|
||||||
|
ts << logMessage << "\n";
|
||||||
|
std::cout << logMessage.toLocal8Bit().constData() << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case QtInfoMsg:
|
||||||
|
{
|
||||||
|
QString logMessage = QString("%1 Info: %2 (%3:%4, %5)")
|
||||||
|
.arg(dateTime)
|
||||||
|
.arg(QString::fromLocal8Bit(localMsg.constData()))
|
||||||
|
.arg(file)
|
||||||
|
.arg(context.line)
|
||||||
|
.arg(function);
|
||||||
|
ts << logMessage << "\n";
|
||||||
|
std::cout << logMessage.toLocal8Bit().constData() << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case QtWarningMsg:
|
||||||
|
{
|
||||||
|
QString logMessage = QString("%1 Warning: %2 (%3:%4, %5)")
|
||||||
|
.arg(dateTime)
|
||||||
|
.arg(QString::fromLocal8Bit(localMsg.constData()))
|
||||||
|
.arg(file)
|
||||||
|
.arg(context.line)
|
||||||
|
.arg(function);
|
||||||
|
ts << logMessage << "\n";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case QtCriticalMsg:
|
||||||
|
{
|
||||||
|
QString logMessage = QString("%1 Critical: %2 (%3:%4, %5)")
|
||||||
|
.arg(dateTime)
|
||||||
|
.arg(QString::fromLocal8Bit(localMsg.constData()))
|
||||||
|
.arg(file)
|
||||||
|
.arg(context.line)
|
||||||
|
.arg(function);
|
||||||
|
ts << logMessage << "\n";
|
||||||
|
std::cout << logMessage.toLocal8Bit().constData() << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case QtFatalMsg:
|
||||||
|
{
|
||||||
|
QString logMessage = QString("%1 Fatal: %2 (%3:%4, %5)")
|
||||||
|
.arg(dateTime)
|
||||||
|
.arg(QString::fromLocal8Bit(localMsg.constData()))
|
||||||
|
.arg(file)
|
||||||
|
.arg(context.line)
|
||||||
|
.arg(function);
|
||||||
|
ts << logMessage << "\n";
|
||||||
|
std::cout << logMessage.toLocal8Bit().constData() << std::endl;
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
qInstallMessageHandler(customMessageHandler);
|
||||||
|
|
||||||
|
QApplication a(argc, argv);
|
||||||
|
|
||||||
|
QFile qssFile(u8"./QSS/AMOLED.qss");
|
||||||
|
if (qssFile.open(QFile::ReadOnly)) {
|
||||||
|
a.setStyleSheet(qssFile.readAll());
|
||||||
|
}
|
||||||
|
qssFile.close();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
showQGF3StripBatchProcessDialog(nullptr);
|
||||||
|
return a.exec();
|
||||||
|
}
|
||||||
Binary file not shown.
|
|
@ -42,6 +42,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pluginToolboxLibrary", "plu
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SPG4Tool", "SPG4Tool\SPG4Tool.vcxproj", "{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SPG4Tool", "SPG4Tool\SPG4Tool.vcxproj", "{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KJ135WBJYAlgInterfaceToolbox", "Toolbox\KJ135WBJYAlgInterfaceToolbox\KJ135WBJYAlgInterfaceToolbox.vcxproj", "{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GF3StripPatchProcess", "GF3StripPatchProcess\GF3StripPatchProcess.vcxproj", "{6386D3E3-B743-419F-8354-DA48D0B08728}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GF3CalibrationAndOrthLib", "GF3CalibrationAndOrthLib\GF3CalibrationAndOrthLib.vcxproj", "{886F7829-AF74-4F23-B3BE-29B7B3C9843C}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|ARM = Debug|ARM
|
Debug|ARM = Debug|ARM
|
||||||
|
|
@ -196,6 +202,42 @@ Global
|
||||||
{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E}.Release|x64.Build.0 = Release|x64
|
{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E}.Release|x64.Build.0 = Release|x64
|
||||||
{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E}.Release|x86.ActiveCfg = Release|x64
|
{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E}.Release|x86.ActiveCfg = Release|x64
|
||||||
{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E}.Release|x86.Build.0 = Release|x64
|
{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E}.Release|x86.Build.0 = Release|x64
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Debug|ARM.ActiveCfg = Debug|x64
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Debug|ARM.Build.0 = Debug|x64
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Debug|x86.ActiveCfg = Debug|x64
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Debug|x86.Build.0 = Debug|x64
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Release|ARM.ActiveCfg = Release|x64
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Release|ARM.Build.0 = Release|x64
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Release|x64.Build.0 = Release|x64
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Release|x86.ActiveCfg = Release|x64
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Release|x86.Build.0 = Release|x64
|
||||||
|
{6386D3E3-B743-419F-8354-DA48D0B08728}.Debug|ARM.ActiveCfg = Debug|x64
|
||||||
|
{6386D3E3-B743-419F-8354-DA48D0B08728}.Debug|ARM.Build.0 = Debug|x64
|
||||||
|
{6386D3E3-B743-419F-8354-DA48D0B08728}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{6386D3E3-B743-419F-8354-DA48D0B08728}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{6386D3E3-B743-419F-8354-DA48D0B08728}.Debug|x86.ActiveCfg = Debug|x64
|
||||||
|
{6386D3E3-B743-419F-8354-DA48D0B08728}.Debug|x86.Build.0 = Debug|x64
|
||||||
|
{6386D3E3-B743-419F-8354-DA48D0B08728}.Release|ARM.ActiveCfg = Release|x64
|
||||||
|
{6386D3E3-B743-419F-8354-DA48D0B08728}.Release|ARM.Build.0 = Release|x64
|
||||||
|
{6386D3E3-B743-419F-8354-DA48D0B08728}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{6386D3E3-B743-419F-8354-DA48D0B08728}.Release|x64.Build.0 = Release|x64
|
||||||
|
{6386D3E3-B743-419F-8354-DA48D0B08728}.Release|x86.ActiveCfg = Release|x64
|
||||||
|
{6386D3E3-B743-419F-8354-DA48D0B08728}.Release|x86.Build.0 = Release|x64
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Debug|ARM.ActiveCfg = Debug|x64
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Debug|ARM.Build.0 = Debug|x64
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Debug|x86.ActiveCfg = Debug|x64
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Debug|x86.Build.0 = Debug|x64
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Release|ARM.ActiveCfg = Release|x64
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Release|ARM.Build.0 = Release|x64
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Release|x64.Build.0 = Release|x64
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Release|x86.ActiveCfg = Release|x64
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Release|x86.Build.0 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
@ -210,6 +252,8 @@ Global
|
||||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64} = {6505E2BA-06A2-447B-BC85-8CF1A81359BC}
|
{E56B3878-A3DC-41A4-ABF3-B628816D0D64} = {6505E2BA-06A2-447B-BC85-8CF1A81359BC}
|
||||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2} = {2768F9D6-D410-4E88-A479-8336DAF97072}
|
{8C8CA066-A93A-4098-9A46-B855EFEAADF2} = {2768F9D6-D410-4E88-A479-8336DAF97072}
|
||||||
{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E} = {2768F9D6-D410-4E88-A479-8336DAF97072}
|
{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E} = {2768F9D6-D410-4E88-A479-8336DAF97072}
|
||||||
|
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8} = {41B1F23D-9119-47A7-B102-34022AF83CDA}
|
||||||
|
{886F7829-AF74-4F23-B3BE-29B7B3C9843C} = {2768F9D6-D410-4E88-A479-8336DAF97072}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {179F0A62-C631-4667-AD03-3780ADE09F41}
|
SolutionGuid = {179F0A62-C631-4667-AD03-3780ADE09F41}
|
||||||
|
|
|
||||||
|
|
@ -196,9 +196,6 @@
|
||||||
<ProjectReference Include="..\GPUBaseLib\GPUBaseLib.vcxproj">
|
<ProjectReference Include="..\GPUBaseLib\GPUBaseLib.vcxproj">
|
||||||
<Project>{b8b40c54-f7fe-4809-b6fb-8bc014570d7b}</Project>
|
<Project>{b8b40c54-f7fe-4809-b6fb-8bc014570d7b}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\pluginToolboxLibrary\pluginToolboxLibrary.vcxproj">
|
|
||||||
<Project>{667625a5-8de2-4373-99f0-8bad2cced011}</Project>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\RasterMainWidgetGUI\RasterMainWidgetGUI.vcxproj">
|
<ProjectReference Include="..\RasterMainWidgetGUI\RasterMainWidgetGUI.vcxproj">
|
||||||
<Project>{e56b3878-a3dc-41a4-abf3-b628816d0d64}</Project>
|
<Project>{e56b3878-a3dc-41a4-abf3-b628816d0d64}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -40,29 +40,17 @@ namespace LAMPMainWidget {
|
||||||
mUi->setupUi(dynamic_cast<QMainWindow*>(this));
|
mUi->setupUi(dynamic_cast<QMainWindow*>(this));
|
||||||
setupWindow();
|
setupWindow();
|
||||||
setupTaskWindow();
|
setupTaskWindow();
|
||||||
|
setupShowMessage();
|
||||||
|
|
||||||
|
this->show();// 强制显示窗口
|
||||||
setupLayers();
|
setupLayers();
|
||||||
setupStatusBar();
|
setupStatusBar();
|
||||||
setupActions();
|
setupActions();
|
||||||
setRightToolbox();
|
setRightToolbox();
|
||||||
|
|
||||||
mUi->panAction->trigger();
|
mUi->panAction->trigger();
|
||||||
mUi->layerList->setCurrentItem(mLayerList.first());
|
mUi->layerList->setCurrentItem(mLayerList.first());
|
||||||
|
|
||||||
|
|
||||||
this->show();// 强制显示窗口
|
|
||||||
// 绑定消息显示
|
|
||||||
RasterMessageShow::RasterWidgetMessageShow* messageshow = RasterMessageShow::RasterWidgetMessageShow::getInstance(this);
|
|
||||||
messageshow->bandingTextBrowserMessage(this->mUi->textBrowserMessage);
|
|
||||||
|
|
||||||
connect(mUi->actioncloseAllRasterFile, SIGNAL(triggered()), this, SLOT(onactioncloseAllRasterFile_triggered()));
|
|
||||||
|
|
||||||
this->mUi->toolBar->hide();
|
|
||||||
this->mUi->dockWidget_Map->hide();
|
|
||||||
this->mUi->dockWidget->hide();
|
|
||||||
this->mUi->statusbar->hide();
|
|
||||||
this->mUi->dockWidget_2->hide();
|
|
||||||
this->mUi->dockWidget_3->hide();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RasterMainWidget::~RasterMainWidget() {
|
RasterMainWidget::~RasterMainWidget() {
|
||||||
|
|
@ -74,8 +62,7 @@ namespace LAMPMainWidget {
|
||||||
delete mCenterLabel;
|
delete mCenterLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::setupTaskWindow() {
|
||||||
RasterMainWidget::setupTaskWindow() {
|
|
||||||
mUi->taskTable->setColumnCount(5);
|
mUi->taskTable->setColumnCount(5);
|
||||||
mUi->taskTable->setHorizontalHeaderLabels(QStringList{
|
mUi->taskTable->setHorizontalHeaderLabels(QStringList{
|
||||||
"名称", "范围", "zoom值", "数据源", "进度"
|
"名称", "范围", "zoom值", "数据源", "进度"
|
||||||
|
|
@ -83,8 +70,7 @@ namespace LAMPMainWidget {
|
||||||
mUi->taskTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
mUi->taskTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::setupActions() {
|
||||||
RasterMainWidget::setupActions() {
|
|
||||||
mMapActionGroup->addAction(mUi->panAction);
|
mMapActionGroup->addAction(mUi->panAction);
|
||||||
mMapActionGroup->addAction(mUi->zoomInAction);
|
mMapActionGroup->addAction(mUi->zoomInAction);
|
||||||
mMapActionGroup->addAction(mUi->zoomOutAction);
|
mMapActionGroup->addAction(mUi->zoomOutAction);
|
||||||
|
|
@ -104,6 +90,9 @@ namespace LAMPMainWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterMainWidget::setupWindow() {
|
void RasterMainWidget::setupWindow() {
|
||||||
|
//mMapglWidget = new QOpenGLWidget(mMapConvas); // 使用OpenGL渲染
|
||||||
|
//mMapConvas->setViewport(mMapglWidget);
|
||||||
|
//mMapConvas->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
|
||||||
mUi->mapCanvasLayout->addWidget(mMapConvas);
|
mUi->mapCanvasLayout->addWidget(mMapConvas);
|
||||||
//setFixedSize(size());
|
//setFixedSize(size());
|
||||||
//setWindowFlags(windowFlags() | Qt::WindowMinMaxButtonsHint | Qt::WindowSystemMenuHint);
|
//setWindowFlags(windowFlags() | Qt::WindowMinMaxButtonsHint | Qt::WindowSystemMenuHint);
|
||||||
|
|
@ -157,12 +146,11 @@ namespace LAMPMainWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::initMaps() {
|
||||||
RasterMainWidget::initMaps() {
|
if (mMaps.isEmpty()) {
|
||||||
if (false&&mMaps.isEmpty()) {
|
|
||||||
mMaps = QHash<QString, MapLayer*>{
|
mMaps = QHash<QString, MapLayer*>{
|
||||||
{"Openstreet地图", new TmsLayer(OSTNormalMap, "ostnormalmap", mMapConvas)},
|
//{"Openstreet地图", new TmsLayer(OSTNormalMap, "ostnormalmap", mMapConvas)},
|
||||||
{"高德地图", new TmsLayer(GaodeNormapMap, "gaodenormalmap", mMapConvas)}
|
{"高德地图", new TmsLayer(GaodeNormapMap, "gaodenormalmap", mMapConvas)}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -188,6 +176,16 @@ namespace LAMPMainWidget {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RasterMainWidget::setupShowMessage()
|
||||||
|
{
|
||||||
|
// 绑定消息显示
|
||||||
|
RasterMessageShow::RasterWidgetMessageShow* messageshow = RasterMessageShow::RasterWidgetMessageShow::getInstance(this);
|
||||||
|
messageshow->bandingTextBrowserMessage(this->mUi->textBrowserMessage);
|
||||||
|
|
||||||
|
connect(mUi->actioncloseAllRasterFile, SIGNAL(triggered()), this, SLOT(onactioncloseAllRasterFile_triggered()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
QWidget* RasterMainWidget::spacerWiget(int width) const {
|
QWidget* RasterMainWidget::spacerWiget(int width) const {
|
||||||
auto spacer = new QWidget{};
|
auto spacer = new QWidget{};
|
||||||
spacer->setHidden(true);
|
spacer->setHidden(true);
|
||||||
|
|
@ -197,18 +195,15 @@ namespace LAMPMainWidget {
|
||||||
return spacer;
|
return spacer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::panHandle(bool checked) {
|
||||||
RasterMainWidget::panHandle(bool checked) {
|
|
||||||
mMapConvas->selectTool(QString{ "pan_tool" });
|
mMapConvas->selectTool(QString{ "pan_tool" });
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::zoomInHandle(bool checked) {
|
||||||
RasterMainWidget::zoomInHandle(bool checked) {
|
|
||||||
mMapConvas->selectTool(QString{ "zoomin_tool" });
|
mMapConvas->selectTool(QString{ "zoomin_tool" });
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::zoomOutHandle(bool checked) {
|
||||||
RasterMainWidget::zoomOutHandle(bool checked) {
|
|
||||||
mMapConvas->selectTool(QString{ "zoomout_tool" });
|
mMapConvas->selectTool(QString{ "zoomout_tool" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -217,38 +212,32 @@ namespace LAMPMainWidget {
|
||||||
mMapConvas->selectTool("drawline_tool");
|
mMapConvas->selectTool("drawline_tool");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
RasterMainWidget::sponsorHandle(bool checked) {
|
void RasterMainWidget::sponsorHandle(bool checked) {
|
||||||
auto* window = new SponsorWindow(dynamic_cast<QWidget*>(this));
|
auto* window = new SponsorWindow(dynamic_cast<QWidget*>(this));
|
||||||
window->exec();
|
window->exec();
|
||||||
window->deleteLater();
|
window->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::refreshHandle(bool checked) {
|
||||||
RasterMainWidget::refreshHandle(bool checked) {
|
|
||||||
mMapConvas->refreshMap();
|
mMapConvas->refreshMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::selectHandle(bool checked) {
|
||||||
RasterMainWidget::selectHandle(bool checked) {
|
|
||||||
mMapConvas->selectTool(QString{ "select_tool" });
|
mMapConvas->selectTool(QString{ "select_tool" });
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::centerChangedHandle(LAMPMainWidget::PointXY pos) {
|
||||||
RasterMainWidget::centerChangedHandle(LAMPMainWidget::PointXY pos) {
|
|
||||||
mCenterText->setText(QString("lon:%1, lat:%2").arg(pos.x()).arg(pos.y()));
|
mCenterText->setText(QString("lon:%1, lat:%2").arg(pos.x()).arg(pos.y()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::zoomChangedHandle(int zoom) {
|
||||||
RasterMainWidget::zoomChangedHandle(int zoom) {
|
|
||||||
mZoomText->setText(QString("%1").arg(zoom));
|
mZoomText->setText(QString("%1").arg(zoom));
|
||||||
mScaleText->setText(QString("1cm:%1m").arg(this->mMapConvas->scale()));
|
mScaleText->setText(QString("1cm:%1m").arg(this->mMapConvas->scale()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::clickedHandle(LAMPMainWidget::PointXY pos) {
|
||||||
RasterMainWidget::clickedHandle(LAMPMainWidget::PointXY pos) {
|
|
||||||
QString posText = QString("%1, %2").arg(pos.x()).arg(pos.y());
|
QString posText = QString("%1, %2").arg(pos.x()).arg(pos.y());
|
||||||
if (mSetLeftTop) {
|
if (mSetLeftTop) {
|
||||||
mUi->leftTopText->setText(posText);
|
mUi->leftTopText->setText(posText);
|
||||||
|
|
@ -260,23 +249,20 @@ namespace LAMPMainWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::leftTopClickedHandle() {
|
||||||
RasterMainWidget::leftTopClickedHandle() {
|
|
||||||
mSetLeftTop = true;
|
mSetLeftTop = true;
|
||||||
mUi->selectAction->trigger();
|
mUi->selectAction->trigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::rightBottomClickedHandle() {
|
||||||
RasterMainWidget::rightBottomClickedHandle() {
|
|
||||||
mSetLeftTop = false;
|
mSetLeftTop = false;
|
||||||
mUi->selectAction->trigger();
|
mUi->selectAction->trigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::layerChanged(QListWidgetItem* current, QListWidgetItem* previous) {
|
||||||
RasterMainWidget::layerChanged(QListWidgetItem* current, QListWidgetItem* previous) {
|
|
||||||
auto mapName = current->text();
|
auto mapName = current->text();
|
||||||
if (!mMaps.contains(mapName)) {
|
if (!mMaps.contains(mapName)) {
|
||||||
qDebug() << mapName << "不支持";
|
qDebug() << mapName << u8"不支持";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -284,7 +270,7 @@ namespace LAMPMainWidget {
|
||||||
auto i = mMaps.begin();
|
auto i = mMaps.begin();
|
||||||
for (; i != mMaps.end(); ++i) {
|
for (; i != mMaps.end(); ++i) {
|
||||||
if (i.key() == mapName) {
|
if (i.key() == mapName) {
|
||||||
i.value()->setVisiblity(true);
|
i.value()->setVisiblity(true); // 切换图层为显示模式
|
||||||
qDebug() << i.key() << i.value()->isVisible();
|
qDebug() << i.key() << i.value()->isVisible();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -292,23 +278,21 @@ namespace LAMPMainWidget {
|
||||||
i.value()->setVisiblity(false);
|
i.value()->setVisiblity(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
mMapConvas->addLayer(layer);
|
mMapConvas->addLayer(layer);//图层开始显示
|
||||||
mMapConvas->setCurrentLayer(layer->id());
|
mMapConvas->setCurrentLayer(layer->id());
|
||||||
mMapConvas->refreshMap();
|
mMapConvas->refreshMap();//刷新地图
|
||||||
|
|
||||||
zoomChangedHandle(mMapConvas->zoomValue());
|
zoomChangedHandle(mMapConvas->zoomValue());// 更新zoom值
|
||||||
centerChangedHandle(mMapConvas->mapCenter());
|
centerChangedHandle(mMapConvas->mapCenter());// 更新中心坐标
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::createDownloadTask() {
|
||||||
RasterMainWidget::createDownloadTask() {
|
|
||||||
auto taskWindow = new TaskWindow(dynamic_cast<QWidget*>(this));
|
auto taskWindow = new TaskWindow(dynamic_cast<QWidget*>(this));
|
||||||
taskWindow->exec();
|
taskWindow->exec();
|
||||||
taskWindow->deleteLater();
|
taskWindow->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RasterMainWidget::changeTaskTable(int row, int col, QString text) {
|
||||||
RasterMainWidget::changeTaskTable(int row, int col, QString text) {
|
|
||||||
mUi->taskTable->takeItem(row, col);
|
mUi->taskTable->takeItem(row, col);
|
||||||
mUi->taskTable->setItem(row, col, new QTableWidgetItem(text));
|
mUi->taskTable->setItem(row, col, new QTableWidgetItem(text));
|
||||||
}
|
}
|
||||||
|
|
@ -325,14 +309,14 @@ namespace LAMPMainWidget {
|
||||||
mMapConvas->selectTool("addplane_tool");
|
mMapConvas->selectTool("addplane_tool");
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterMainWidget::onactioncloseAllRasterFile_triggered()
|
void RasterMainWidget::onactioncloseAllRasterFile_triggered()
|
||||||
{
|
{
|
||||||
CloseAllGDALRaster();
|
CloseAllGDALRaster();
|
||||||
}
|
}
|
||||||
|
|
||||||
QTableWidget* RasterMainWidget::getTaskTable()
|
QTableWidget* RasterMainWidget::getTaskTable()
|
||||||
{
|
{
|
||||||
return this->mUi->taskTable;
|
return this->mUi->taskTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#include <QActionGroup>
|
#include <QActionGroup>
|
||||||
#include <QListWidgetItem>
|
#include <QListWidgetItem>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
#include <QOpenGLWidget>
|
||||||
#include <QTableWidget>
|
#include <QTableWidget>
|
||||||
#include <mapcanvas.h>
|
#include <mapcanvas.h>
|
||||||
#include <maplayer.h>
|
#include <maplayer.h>
|
||||||
|
|
@ -44,7 +45,7 @@ namespace LAMPMainWidget {
|
||||||
void initMaps();
|
void initMaps();
|
||||||
void setRightToolbox();
|
void setRightToolbox();
|
||||||
void initToolbox();
|
void initToolbox();
|
||||||
|
void setupShowMessage();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// 各处处理函数
|
/// 各处处理函数
|
||||||
|
|
@ -75,7 +76,10 @@ namespace LAMPMainWidget {
|
||||||
void onactioncloseAllRasterFile_triggered();
|
void onactioncloseAllRasterFile_triggered();
|
||||||
private:
|
private:
|
||||||
Ui::RasterMainWidget* mUi;
|
Ui::RasterMainWidget* mUi;
|
||||||
MapCanvas* mMapConvas;
|
MapCanvas* mMapConvas;//地图容器
|
||||||
|
QOpenGLWidget* mMapglWidget;// OpenGL窗口
|
||||||
|
|
||||||
|
|
||||||
QLineEdit* mScaleText;
|
QLineEdit* mScaleText;
|
||||||
QLabel* mScaleLabel;
|
QLabel* mScaleLabel;
|
||||||
QLineEdit* mCenterText;
|
QLineEdit* mCenterText;
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>898</width>
|
<width>906</width>
|
||||||
<height>580</height>
|
<height>609</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
|
@ -84,8 +84,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>898</width>
|
<width>906</width>
|
||||||
<height>22</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="projectMenu">
|
<widget class="QMenu" name="projectMenu">
|
||||||
|
|
@ -117,11 +117,15 @@
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>工具</string>
|
<string>工具</string>
|
||||||
</property>
|
</property>
|
||||||
|
<addaction name="actioncloseAllRasterFile"/>
|
||||||
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="helpMenu">
|
<widget class="QMenu" name="helpMenu">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>帮助</string>
|
<string>帮助</string>
|
||||||
</property>
|
</property>
|
||||||
|
<addaction name="tutorialAction"/>
|
||||||
|
<addaction name="srcAction"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="projectMenu"/>
|
<addaction name="projectMenu"/>
|
||||||
|
|
@ -134,9 +138,6 @@
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusbar"/>
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
<widget class="QToolBar" name="toolBar">
|
<widget class="QToolBar" name="toolBar">
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>toolBar</string>
|
<string>toolBar</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -378,85 +379,11 @@ p, li { white-space: pre-wrap; }
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QDockWidget" name="dockWidget_Map">
|
<action name="actioncloseAllRasterFile">
|
||||||
<property name="layoutDirection">
|
<property name="text">
|
||||||
<enum>Qt::LeftToRight</enum>
|
<string>释放影像文件</string>
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>地图窗口</string>
|
|
||||||
</property>
|
|
||||||
<attribute name="dockWidgetArea">
|
|
||||||
<number>1</number>
|
|
||||||
</attribute>
|
|
||||||
<widget class="QWidget" name="dockWidgetContents_5">
|
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>502</width>
|
|
||||||
<height>274</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="mapTab">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>地图</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<layout class="QGridLayout" name="mapCanvasLayout"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="taskTab">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>任务</string>
|
|
||||||
</attribute>
|
|
||||||
<widget class="QWidget" name="gridLayoutWidget_5">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>1431</width>
|
|
||||||
<height>871</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="taskLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QTableWidget" name="taskTable"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<widget class="QMenuBar" name="menubar">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>906</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<widget class="QMenu" name="toolsMenu">
|
|
||||||
<property name="title">
|
|
||||||
<string>工具</string>
|
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actioncloseAllRasterFile"/>
|
</action>
|
||||||
</widget>
|
|
||||||
<addaction name="toolsMenu"/>
|
|
||||||
</widget>
|
|
||||||
<action name="tutorialAction">
|
<action name="tutorialAction">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>使用教程</string>
|
<string>使用教程</string>
|
||||||
|
|
@ -593,11 +520,6 @@ p, li { white-space: pre-wrap; }
|
||||||
<string>飞机</string>
|
<string>飞机</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actioncloseAllRasterFile">
|
|
||||||
<property name="text">
|
|
||||||
<string>释放影像文件</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../RasterMainWidgetGUI.qrc"/>
|
<include location="../RasterMainWidgetGUI.qrc"/>
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,7 @@ namespace LAMPMainWidget {
|
||||||
initCache();
|
initCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString GaodeNormalProvider::tileUrl(const LAMPMainWidget::PointXY& pos, int zoom) const {
|
||||||
GaodeNormalProvider::tileUrl(const LAMPMainWidget::PointXY& pos, int zoom) const {
|
|
||||||
|
|
||||||
QString urlFmt = { R"(http://wprd01.is.autonavi.com/appmaptile?style=6&x=%1&y=%2&z=%3)" };
|
QString urlFmt = { R"(http://wprd01.is.autonavi.com/appmaptile?style=6&x=%1&y=%2&z=%3)" };
|
||||||
return QString(urlFmt).arg(pos.x()).arg(pos.y()).arg(zoom);
|
return QString(urlFmt).arg(pos.x()).arg(pos.y()).arg(zoom);
|
||||||
|
|
|
||||||
|
|
@ -84,8 +84,7 @@ namespace LAMPMainWidget {
|
||||||
setZoomValue(zoom);
|
setZoomValue(zoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MapCanvas::resizeEvent(QResizeEvent* event) {
|
||||||
MapCanvas::resizeEvent(QResizeEvent* event) {
|
|
||||||
updateViewExtent(true);
|
updateViewExtent(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,19 +96,17 @@ namespace LAMPMainWidget {
|
||||||
QGraphicsView::mouseMoveEvent(event);
|
QGraphicsView::mouseMoveEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MapCanvas::refreshMap() {
|
||||||
MapCanvas::refreshMap() {
|
|
||||||
QMapIterator<QString, MapLayer*> iterator(mLayers);
|
QMapIterator<QString, MapLayer*> iterator(mLayers);
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
iterator.next();
|
iterator.next();
|
||||||
iterator.value()->map()->setViewExtent(mViewExtent);
|
iterator.value()->map()->setViewExtent(mViewExtent);//设置当前图层的可视范围
|
||||||
iterator.value()->update();
|
iterator.value()->update();//更新当前图层的显示内容
|
||||||
}
|
}
|
||||||
mScene->update();
|
mScene->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MapCanvas::addLayer(MapLayer* const layer) {
|
||||||
MapCanvas::addLayer(MapLayer* const layer) {
|
|
||||||
if (!layer)
|
if (!layer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -119,15 +116,14 @@ namespace LAMPMainWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
mLayers.insert(layer->id(), layer);
|
mLayers.insert(layer->id(), layer);
|
||||||
if (mLayers.count() == 1) {
|
if (mLayers.count() == 1) {//判断是否是第唯一个图层
|
||||||
setCurrentLayer(layer->id());
|
setCurrentLayer(layer->id());
|
||||||
}
|
}
|
||||||
mScene->addItem(layer->map());
|
mScene->addItem(layer->map());//将当前图层添加到场景中
|
||||||
refreshMap();
|
refreshMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MapCanvas::setZoomValue(const int zoom) {
|
||||||
MapCanvas::setZoomValue(const int zoom) {
|
|
||||||
mZoomValue = normalizeZoom(zoom);
|
mZoomValue = normalizeZoom(zoom);
|
||||||
zoomChanged(mZoomValue);
|
zoomChanged(mZoomValue);
|
||||||
|
|
||||||
|
|
@ -142,8 +138,7 @@ namespace LAMPMainWidget {
|
||||||
updateViewExtent(true);
|
updateViewExtent(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MapCanvas::updateViewExtent(bool reset) {
|
||||||
MapCanvas::updateViewExtent(bool reset) {
|
|
||||||
if (!mCurrentLayer) {
|
if (!mCurrentLayer) {
|
||||||
qDebug() << "未设置当前图层,视图区域无法更新";
|
qDebug() << "未设置当前图层,视图区域无法更新";
|
||||||
return;
|
return;
|
||||||
|
|
@ -161,7 +156,7 @@ namespace LAMPMainWidget {
|
||||||
mViewExtent.translate(offset.x(), offset.y());
|
mViewExtent.translate(offset.x(), offset.y());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "视图区域更新 平移范围 x ,y "<<-mDragRect.width()<<" , "<<-mDragRect.height() ;
|
qDebug() << "视图区域更新 平移范围 x ,y " << -mDragRect.width() << " , " << -mDragRect.height();
|
||||||
/// 视图偏移并重置偏移属性
|
/// 视图偏移并重置偏移属性
|
||||||
mViewExtent.translate(-mDragRect.width(), -mDragRect.height());
|
mViewExtent.translate(-mDragRect.width(), -mDragRect.height());
|
||||||
mDragRect.setRect(0, 0, 0, 0);
|
mDragRect.setRect(0, 0, 0, 0);
|
||||||
|
|
@ -178,33 +173,29 @@ namespace LAMPMainWidget {
|
||||||
refreshMap();
|
refreshMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MapCanvas::setCrs(const CRS* const crs) {
|
||||||
MapCanvas::setCrs(const CRS* const crs) {
|
|
||||||
mCrs = crs;
|
mCrs = crs;
|
||||||
crsChanged();
|
crsChanged();
|
||||||
updateViewExtent(true);
|
updateViewExtent(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MapCanvas::setCurrentLayer(const QString& id) {
|
||||||
MapCanvas::setCurrentLayer(const QString& id) {
|
|
||||||
if (!mLayers.contains(id)) {
|
if (!mLayers.contains(id)) {
|
||||||
qWarning() << "未添加图层=>" << id;
|
qWarning() << "未添加图层=>" << id;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mCurrentLayer = mLayers[id];
|
mCurrentLayer = mLayers[id];
|
||||||
if (!mCrs) {
|
if (!mCrs) {
|
||||||
setCrs(&mCurrentLayer->crs());
|
setCrs(&mCurrentLayer->crs());//设置当前图层的坐标系,后期考虑继续拆分
|
||||||
}
|
}
|
||||||
updateViewExtent(true);
|
updateViewExtent(true);// 更新视图区域
|
||||||
}
|
}
|
||||||
|
|
||||||
double
|
double MapCanvas::scale() const {
|
||||||
MapCanvas::scale() const {
|
|
||||||
return logicalDpiX() * resolution() * 39.37 / 100;;
|
return logicalDpiX() * resolution() * 39.37 / 100;;
|
||||||
}
|
}
|
||||||
|
|
||||||
double
|
double MapCanvas::resolution() const {
|
||||||
MapCanvas::resolution() const {
|
|
||||||
if (!mCurrentLayer) {
|
if (!mCurrentLayer) {
|
||||||
qWarning() << "未设置当前图层,无法获取分辨率";
|
qWarning() << "未设置当前图层,无法获取分辨率";
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -213,8 +204,7 @@ namespace LAMPMainWidget {
|
||||||
return mCurrentLayer->resolution();
|
return mCurrentLayer->resolution();
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int MapCanvas::zoomValue() const {
|
||||||
MapCanvas::zoomValue() const {
|
|
||||||
if (!mCurrentLayer) {
|
if (!mCurrentLayer) {
|
||||||
qWarning() << "未设置当前图层,默认返回zoom值为0";
|
qWarning() << "未设置当前图层,默认返回zoom值为0";
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -223,8 +213,7 @@ namespace LAMPMainWidget {
|
||||||
return mCurrentLayer->zoomValue();
|
return mCurrentLayer->zoomValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int MapCanvas::normalizeZoom(const int zoom) const {
|
||||||
MapCanvas::normalizeZoom(const int zoom) const {
|
|
||||||
int z{};
|
int z{};
|
||||||
if (zoom <= kMinZoomValue) {
|
if (zoom <= kMinZoomValue) {
|
||||||
z = kMinZoomValue;
|
z = kMinZoomValue;
|
||||||
|
|
@ -239,8 +228,7 @@ namespace LAMPMainWidget {
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
PointXY
|
PointXY MapCanvas::pixel2Lonlat(const QPointF& point) const {
|
||||||
MapCanvas::pixel2Lonlat(const QPointF& point) const {
|
|
||||||
QPointF scenePoint = mapToScene(QPoint{ static_cast<int>(point.x()), static_cast<int>(point.y()) });
|
QPointF scenePoint = mapToScene(QPoint{ static_cast<int>(point.x()), static_cast<int>(point.y()) });
|
||||||
QPointF mapPoint{ scenePoint.x() * resolution(), scenePoint.y() * resolution() };
|
QPointF mapPoint{ scenePoint.x() * resolution(), scenePoint.y() * resolution() };
|
||||||
PointXY crsPoint = mCrs->inverse(PointXY{ mapPoint });
|
PointXY crsPoint = mCrs->inverse(PointXY{ mapPoint });
|
||||||
|
|
@ -248,8 +236,7 @@ namespace LAMPMainWidget {
|
||||||
return crsPoint;
|
return crsPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool MapCanvas::selectTool(const QString& tool) {
|
||||||
MapCanvas::selectTool(const QString& tool) {
|
|
||||||
if (!mMapTools.contains(tool)) {
|
if (!mMapTools.contains(tool)) {
|
||||||
qWarning() << QString("%1工具不存在").arg(tool);
|
qWarning() << QString("%1工具不存在").arg(tool);
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -274,8 +261,7 @@ namespace LAMPMainWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MapCanvas::setupTools() {
|
||||||
MapCanvas::setupTools() {
|
|
||||||
auto panTool = new MapToolPan(this);
|
auto panTool = new MapToolPan(this);
|
||||||
mMapTools.insert(panTool->id(), panTool);
|
mMapTools.insert(panTool->id(), panTool);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ namespace LAMPMainWidget {
|
||||||
void mouseMoveEvent(QMouseEvent* event) override;
|
void mouseMoveEvent(QMouseEvent* event) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QGraphicsScene* mScene;
|
QGraphicsScene* mScene; // 场景对象
|
||||||
QRectF mMapExtent;
|
QRectF mMapExtent;
|
||||||
QRectF mViewExtent;
|
QRectF mViewExtent;
|
||||||
QRectF mDragRect;
|
QRectF mDragRect;
|
||||||
|
|
|
||||||
|
|
@ -10,16 +10,20 @@
|
||||||
|
|
||||||
namespace LAMPMainWidget {
|
namespace LAMPMainWidget {
|
||||||
|
|
||||||
void
|
/// <summary>
|
||||||
MapCanvasMap::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) {
|
/// 重写paint函数,绘制图层的内容
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="painter"></param>
|
||||||
|
/// <param name="option"></param>
|
||||||
|
/// <param name="widget"></param>
|
||||||
|
void MapCanvasMap::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) {
|
||||||
if (!mLayer->provider().hasContent()) {
|
if (!mLayer->provider().hasContent()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
painter->drawImage(mViewExtent.topLeft(), mLayer->provider().preparedImage());
|
painter->drawImage(mViewExtent.topLeft(), mLayer->provider().preparedImage());
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF
|
QRectF MapCanvasMap::boundingRect() const {
|
||||||
MapCanvasMap::boundingRect() const {
|
|
||||||
auto width = mViewExtent.size().width();
|
auto width = mViewExtent.size().width();
|
||||||
auto height = mViewExtent.size().height();
|
auto height = mViewExtent.size().height();
|
||||||
return mViewExtent + QMarginsF(1024, 1024, 1024, 1024);
|
return mViewExtent + QMarginsF(1024, 1024, 1024, 1024);
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class MapCanvasMap : public QGraphicsItem {
|
||||||
~MapCanvasMap() override = default;
|
~MapCanvasMap() override = default;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; //图层绘制函数
|
||||||
|
|
||||||
QRectF boundingRect() const override;
|
QRectF boundingRect() const override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,81 +5,78 @@
|
||||||
|
|
||||||
namespace LAMPMainWidget {
|
namespace LAMPMainWidget {
|
||||||
|
|
||||||
size_t
|
size_t writeData(void* content, size_t size, size_t nmemb, void* userp) {
|
||||||
writeData(void *content, size_t size, size_t nmemb, void *userp) {
|
size_t realSize{ size * nmemb };
|
||||||
size_t realSize{size * nmemb};
|
auto userRes = static_cast<QByteArray*>(userp);
|
||||||
auto userRes = static_cast<QByteArray *>(userp);
|
if (!userRes) {
|
||||||
if (!userRes) {
|
qDebug() << "无效的数据存储对象";
|
||||||
qDebug() << "无效的数据存储对象";
|
return 0;
|
||||||
return 0;
|
}
|
||||||
}
|
userRes->append(static_cast<char*>(content), int(realSize));
|
||||||
userRes->append(static_cast<char *>(content), int(realSize));
|
|
||||||
|
|
||||||
return realSize;
|
return realSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString Network::kUserAgent{"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"};
|
const QString Network::kUserAgent{ "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" };
|
||||||
|
|
||||||
QByteArray
|
QByteArray Network::httpRequest(const QString& url) {
|
||||||
Network::httpRequest(const QString &url) {
|
QByteArray result{};
|
||||||
QByteArray result{};
|
if (url.isEmpty()) {
|
||||||
if (url.isEmpty()) {
|
qDebug() << QString("url为空");
|
||||||
qDebug() << QString("url为空");
|
return result;
|
||||||
return result;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
CURL *curl = curl_easy_init();
|
CURL* curl = curl_easy_init();
|
||||||
if (!curl) {
|
if (!curl) {
|
||||||
qDebug() << "无法初始化curl句柄";
|
qDebug() << "无法初始化curl句柄";
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, url.toStdString().c_str());
|
curl_easy_setopt(curl, CURLOPT_URL, url.toStdString().c_str());
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeData);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeData);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &result);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &result);
|
||||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, kUserAgent.toStdString().c_str());
|
curl_easy_setopt(curl, CURLOPT_USERAGENT, kUserAgent.toStdString().c_str());
|
||||||
|
|
||||||
CURLcode res = curl_easy_perform(curl);
|
CURLcode res = curl_easy_perform(curl);
|
||||||
if (CURLE_OK != res) {
|
if (CURLE_OK != res) {
|
||||||
qDebug() << QString("%1 =>请求异常, %2").arg(url).arg(curl_easy_strerror(res));
|
qDebug() << QString("%1 =>请求异常, %2").arg(url).arg(curl_easy_strerror(res));
|
||||||
result.clear(); // 请求失败时,清空接受到的数据
|
result.clear(); // 请求失败时,清空接受到的数据
|
||||||
}
|
}
|
||||||
|
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray
|
QByteArray Network::httpsRequest(const QString& url) {
|
||||||
Network::httpsRequest(const QString &url) {
|
QByteArray result{};
|
||||||
QByteArray result{};
|
if (url.isEmpty()) {
|
||||||
if (url.isEmpty()) {
|
qDebug() << QString(u8"url为空");
|
||||||
qDebug() << QString("url为空");
|
return result;
|
||||||
return result;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
CURL *curl = curl_easy_init();
|
CURL* curl = curl_easy_init();
|
||||||
if (!curl) {
|
if (!curl) {
|
||||||
qDebug() << "无法初始化curl句柄";
|
qDebug() << u8"无法初始化curl句柄";
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, url.toStdString().c_str());
|
curl_easy_setopt(curl, CURLOPT_URL, url.toStdString().c_str());
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeData);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeData);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &result);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &result);
|
||||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, kUserAgent.toStdString().c_str());
|
curl_easy_setopt(curl, CURLOPT_USERAGENT, kUserAgent.toStdString().c_str());
|
||||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||||
|
|
||||||
CURLcode res = curl_easy_perform(curl);
|
CURLcode res = curl_easy_perform(curl);
|
||||||
if (CURLE_OK != res) {
|
if (CURLE_OK != res) {
|
||||||
qDebug() << QString("%1 =>请求异常, %2").arg(url).arg(curl_easy_strerror(res));
|
qDebug() << QString(u8"%1 =>请求异常, %2").arg(url).arg(curl_easy_strerror(res));
|
||||||
result.clear(); // 请求失败时,清空接受到的数据
|
result.clear(); // 请求失败时,清空接受到的数据
|
||||||
}
|
}
|
||||||
|
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
|
|
||||||
namespace LAMPMainWidget
|
namespace LAMPMainWidget
|
||||||
{
|
{
|
||||||
void
|
void DownloadTask::run()
|
||||||
DownloadTask::run()
|
|
||||||
{
|
{
|
||||||
auto currentLayer = dynamic_cast<const TmsLayer*>(mTaskInfo.layer);
|
auto currentLayer = dynamic_cast<const TmsLayer*>(mTaskInfo.layer);
|
||||||
auto provider = dynamic_cast<const TmsProvider*>(¤tLayer->provider());
|
auto provider = dynamic_cast<const TmsProvider*>(¤tLayer->provider());
|
||||||
|
|
@ -53,14 +52,13 @@ namespace LAMPMainWidget
|
||||||
double progress = static_cast<double>(completed) / count;
|
double progress = static_cast<double>(completed) / count;
|
||||||
auto progessStr = QString("%1").arg(progress * 100);
|
auto progessStr = QString("%1").arg(progress * 100);
|
||||||
mTaskInfo.display->takeItem(mRowId, 4);
|
mTaskInfo.display->takeItem(mRowId, 4);
|
||||||
mTaskInfo.display->setItem(mRowId, 4,new QTableWidgetItem(QString("%1").arg(progress * 100)));
|
mTaskInfo.display->setItem(mRowId, 4, new QTableWidgetItem(QString("%1").arg(progress * 100)));
|
||||||
// mTaskInfo.display->resizeColumnsToContents();
|
// mTaskInfo.display->resizeColumnsToContents();
|
||||||
// mTaskInfo.display->horizontalHeader()->setStretchLastSection(true);
|
// mTaskInfo.display->horizontalHeader()->setStretchLastSection(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void DownloadTask::generateCommonRow()
|
||||||
DownloadTask::generateCommonRow()
|
|
||||||
{
|
{
|
||||||
auto provider = dynamic_cast<const TmsProvider*>(&mTaskInfo.layer->provider());
|
auto provider = dynamic_cast<const TmsProvider*>(&mTaskInfo.layer->provider());
|
||||||
mRowId = mTaskInfo.display->rowCount();
|
mRowId = mTaskInfo.display->rowCount();
|
||||||
|
|
@ -71,24 +69,21 @@ namespace LAMPMainWidget
|
||||||
mTaskInfo.display->setItem(mRowId, 3, new QTableWidgetItem(provider->id()));
|
mTaskInfo.display->setItem(mRowId, 3, new QTableWidgetItem(provider->id()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void DownloadTask::generateErrorRow()
|
||||||
DownloadTask::generateErrorRow()
|
|
||||||
{
|
{
|
||||||
generateCommonRow();
|
generateCommonRow();
|
||||||
mTaskInfo.display->setItem(mRowId, 4, new QTableWidgetItem("任务新建失败"));
|
mTaskInfo.display->setItem(mRowId, 4, new QTableWidgetItem("任务新建失败"));
|
||||||
mTaskInfo.display->resizeColumnsToContents();
|
mTaskInfo.display->resizeColumnsToContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void DownloadTask::generateSuccessRow()
|
||||||
DownloadTask::generateSuccessRow()
|
|
||||||
{
|
{
|
||||||
generateCommonRow();
|
generateCommonRow();
|
||||||
mTaskInfo.display->setItem(mRowId, 4, new QTableWidgetItem("0.0%"));
|
mTaskInfo.display->setItem(mRowId, 4, new QTableWidgetItem("0.0%"));
|
||||||
mTaskInfo.display->resizeColumnsToContents();
|
mTaskInfo.display->resizeColumnsToContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString DownloadTask::getExtentStr()
|
||||||
DownloadTask::getExtentStr()
|
|
||||||
{
|
{
|
||||||
auto leftTop = mTaskInfo.extent.topLeft();
|
auto leftTop = mTaskInfo.extent.topLeft();
|
||||||
auto rightBottom = mTaskInfo.extent.bottomRight();
|
auto rightBottom = mTaskInfo.extent.bottomRight();
|
||||||
|
|
@ -112,8 +107,7 @@ namespace LAMPMainWidget
|
||||||
delete mUi;
|
delete mUi;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TaskWindow::setupWindow()
|
||||||
TaskWindow::setupWindow()
|
|
||||||
{
|
{
|
||||||
setFixedSize(size());
|
setFixedSize(size());
|
||||||
auto currentLayer = dynamic_cast<const TmsLayer*>(mParent->mMapConvas->currentLayer());
|
auto currentLayer = dynamic_cast<const TmsLayer*>(mParent->mMapConvas->currentLayer());
|
||||||
|
|
@ -129,8 +123,7 @@ namespace LAMPMainWidget
|
||||||
QString("%1, %2").arg(mParent->mRightBottom.x()).arg(mParent->mRightBottom.y()));
|
QString("%1, %2").arg(mParent->mRightBottom.x()).arg(mParent->mRightBottom.y()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TaskWindow::setupAction()
|
||||||
TaskWindow::setupAction()
|
|
||||||
{
|
{
|
||||||
QObject::connect(mUi->exitBtn, &QPushButton::clicked, this, &TaskWindow::close);
|
QObject::connect(mUi->exitBtn, &QPushButton::clicked, this, &TaskWindow::close);
|
||||||
QObject::connect(mUi->createBtn, &QPushButton::clicked, this, &TaskWindow::createTask);
|
QObject::connect(mUi->createBtn, &QPushButton::clicked, this, &TaskWindow::createTask);
|
||||||
|
|
@ -140,8 +133,7 @@ namespace LAMPMainWidget
|
||||||
this, &TaskWindow::setupZoomValue);
|
this, &TaskWindow::setupZoomValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TaskWindow::createTask()
|
||||||
TaskWindow::createTask()
|
|
||||||
{
|
{
|
||||||
if (!taskInfoCheck()) {
|
if (!taskInfoCheck()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -152,9 +144,9 @@ namespace LAMPMainWidget
|
||||||
auto extent = QRectF(QPointF(mParent->mLeftTop.x(), mParent->mLeftTop.y()),
|
auto extent = QRectF(QPointF(mParent->mLeftTop.x(), mParent->mLeftTop.y()),
|
||||||
QPointF(mParent->mRightBottom.x(), mParent->mRightBottom.y()));
|
QPointF(mParent->mRightBottom.x(), mParent->mRightBottom.y()));
|
||||||
auto tileInfo = TaskInfo{ mTaskName, savePath, extent,
|
auto tileInfo = TaskInfo{ mTaskName, savePath, extent,
|
||||||
mZoomValue,
|
mZoomValue,
|
||||||
mParent->mMapConvas->currentLayer(),
|
mParent->mMapConvas->currentLayer(),
|
||||||
mParent->getTaskTable()
|
mParent->getTaskTable()
|
||||||
/*mParent->mUi->taskTable*/ };
|
/*mParent->mUi->taskTable*/ };
|
||||||
|
|
||||||
auto task = new DownloadTask(tileInfo);
|
auto task = new DownloadTask(tileInfo);
|
||||||
|
|
@ -162,12 +154,11 @@ namespace LAMPMainWidget
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TaskWindow::setupSaveDir()
|
||||||
TaskWindow::setupSaveDir()
|
|
||||||
{
|
{
|
||||||
auto saveDir = QFileDialog::getExistingDirectory(dynamic_cast<QWidget*>(this), "存储路径选择");
|
auto saveDir = QFileDialog::getExistingDirectory(dynamic_cast<QWidget*>(this), "存储路径选择");
|
||||||
if (saveDir.isEmpty()) {
|
if (saveDir.isEmpty()) {
|
||||||
qWarning() << "未选择存储路径";
|
qWarning() << u8"未选择存储路径";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -175,15 +166,13 @@ namespace LAMPMainWidget
|
||||||
mUi->saveDirText->setText(mSavePath);
|
mUi->saveDirText->setText(mSavePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TaskWindow::setupTaskName(const QString& text)
|
||||||
TaskWindow::setupTaskName(const QString& text)
|
|
||||||
{
|
{
|
||||||
qDebug() << "任务名=>" << text;
|
qWarning() << u8"任务名=>" << text;
|
||||||
mTaskName = text;
|
mTaskName = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool TaskWindow::taskInfoCheck()
|
||||||
TaskWindow::taskInfoCheck()
|
|
||||||
{
|
{
|
||||||
if (mTaskName.isEmpty()) {
|
if (mTaskName.isEmpty()) {
|
||||||
QMessageBox::critical(dynamic_cast<QWidget*>(this), "错误", "任务名称为空");
|
QMessageBox::critical(dynamic_cast<QWidget*>(this), "错误", "任务名称为空");
|
||||||
|
|
@ -198,11 +187,10 @@ namespace LAMPMainWidget
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TaskWindow::setupZoomValue(int index)
|
||||||
TaskWindow::setupZoomValue(int index)
|
|
||||||
{
|
{
|
||||||
auto zoom = mUi->zoomValueCbx->itemData(index).toInt();
|
auto zoom = mUi->zoomValueCbx->itemData(index).toInt();
|
||||||
qDebug() << "设置下载任务zoom值=>" << zoom;
|
qWarning() << u8"设置下载任务zoom值=>" << zoom;
|
||||||
mZoomValue = zoom;
|
mZoomValue = zoom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,7 @@ namespace LAMPMainWidget {
|
||||||
setProvider(TmsProviderFactory::create(provider));
|
setProvider(TmsProviderFactory::create(provider));
|
||||||
}
|
}
|
||||||
|
|
||||||
double
|
double TmsLayer::resolution() const {
|
||||||
TmsLayer::resolution() const {
|
|
||||||
auto pd = dynamic_cast<const TmsProvider*>(&provider());
|
auto pd = dynamic_cast<const TmsProvider*>(&provider());
|
||||||
auto sz = pd->tileSize();
|
auto sz = pd->tileSize();
|
||||||
double length = crs().extent().width();
|
double length = crs().extent().width();
|
||||||
|
|
@ -32,8 +31,7 @@ namespace LAMPMainWidget {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF
|
QRectF TmsLayer::extent() const {
|
||||||
TmsLayer::extent() const {
|
|
||||||
auto pd = dynamic_cast<const TmsProvider*>(&provider());
|
auto pd = dynamic_cast<const TmsProvider*>(&provider());
|
||||||
QSize sz = pd->tileSize();
|
QSize sz = pd->tileSize();
|
||||||
|
|
||||||
|
|
@ -41,14 +39,13 @@ namespace LAMPMainWidget {
|
||||||
int height = power2(zoomValue()) * sz.height();
|
int height = power2(zoomValue()) * sz.height();
|
||||||
|
|
||||||
//#ifdef DEBUG
|
//#ifdef DEBUG
|
||||||
// qDebug() << "layer extent=>{width:" << width << ", height:" << height << "}";
|
qDebug() << "layer extent=>{width:" << width << ", height:" << height << "}";
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
return { 0, 0, static_cast<qreal>(width), static_cast<qreal>(height) };
|
return { 0, 0, static_cast<qreal>(width), static_cast<qreal>(height) };
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TmsLayer::setZoomValue(int zoom) {
|
||||||
TmsLayer::setZoomValue(int zoom) {
|
|
||||||
int zoomValue{};
|
int zoomValue{};
|
||||||
if (zoom <= minZoom()) {
|
if (zoom <= minZoom()) {
|
||||||
zoomValue = minZoom();
|
zoomValue = minZoom();
|
||||||
|
|
@ -63,8 +60,7 @@ namespace LAMPMainWidget {
|
||||||
mZoomValue = zoomValue;
|
mZoomValue = zoomValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool TmsLayer::parseTiles(const QRectF& rect, int zoom, QHash<QPoint, QString>& tiles, QSize& size) const {
|
||||||
TmsLayer::parseTiles(const QRectF& rect, int zoom, QHash<QPoint, QString>& tiles, QSize& size) const {
|
|
||||||
|
|
||||||
auto pd = dynamic_cast<const TmsProvider*>(&provider());
|
auto pd = dynamic_cast<const TmsProvider*>(&provider());
|
||||||
auto tileSize = pd->tileSize();
|
auto tileSize = pd->tileSize();
|
||||||
|
|
@ -80,7 +76,7 @@ namespace LAMPMainWidget {
|
||||||
auto yMin = qFloor(mapLeftTop.y() / tileSize.height());
|
auto yMin = qFloor(mapLeftTop.y() / tileSize.height());
|
||||||
auto yMax = qFloor(mapRightBottom.y() / tileSize.height());
|
auto yMax = qFloor(mapRightBottom.y() / tileSize.height());
|
||||||
if ((xMin > xMax) || (yMin > yMax)) {
|
if ((xMin > xMax) || (yMin > yMax)) {
|
||||||
qDebug() << "下载区边界错误";
|
qDebug() << u8"下载区边界错误";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,26 +4,32 @@
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QSqlQuery>
|
#include <QSqlQuery>
|
||||||
#include <QSqlError>
|
#include <QSqlError>
|
||||||
|
#include <QPointer>
|
||||||
#include <tmsprovider.h>
|
#include <tmsprovider.h>
|
||||||
#include <network.h>
|
#include <network.h>
|
||||||
|
#include <iostream>
|
||||||
#pragma execution_character_set("utf-8")
|
#pragma execution_character_set("utf-8")
|
||||||
|
|
||||||
namespace LAMPMainWidget
|
namespace LAMPMainWidget
|
||||||
{
|
{
|
||||||
TileDownloadTask::TileDownloadTask(TileInfo tile, QObject* parent)
|
TileDownloadTask::TileDownloadTask(TileInfo tile, tileReadyCallback cb, QObject* parent)
|
||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
mTile(std::move(tile))
|
mTile(std::move(tile)),
|
||||||
|
mCallback(cb)
|
||||||
{
|
{
|
||||||
|
// 程序初始化时注册(如main函数或类构造函数)
|
||||||
|
qRegisterMetaType<TileInfo>("TileInfo");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TileDownloadTask::run()
|
||||||
TileDownloadTask::run()
|
|
||||||
{
|
{
|
||||||
Network web{};
|
Network web{};
|
||||||
QByteArray data = web.httpsRequest(mTile.url);
|
QByteArray data = web.httpsRequest(mTile.url);
|
||||||
mTile.data = data;
|
mTile.data = data;
|
||||||
tileReady(mTile);
|
if (mCallback) {
|
||||||
|
mCallback(mTile);
|
||||||
|
}
|
||||||
|
else {}
|
||||||
}
|
}
|
||||||
|
|
||||||
TmsProvider::TmsProvider(QObject* parent)
|
TmsProvider::TmsProvider(QObject* parent)
|
||||||
|
|
@ -42,13 +48,12 @@ namespace LAMPMainWidget
|
||||||
delete mImage;
|
delete mImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool TmsProvider::initCache()
|
||||||
TmsProvider::initCache()
|
|
||||||
{
|
{
|
||||||
mDbConn = QSqlDatabase::addDatabase("QSQLITE", id());
|
mDbConn = QSqlDatabase::addDatabase("QSQLITE", id());
|
||||||
mDbConn.setDatabaseName(mDbName);
|
mDbConn.setDatabaseName(mDbName);
|
||||||
if (!mDbConn.open()) {
|
if (!mDbConn.open()) {
|
||||||
qCritical() << "缓存数据库打开失败";
|
std::cout << u8"缓存数据库打开失败";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,8 +76,7 @@ namespace LAMPMainWidget
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray
|
QByteArray TmsProvider::getCache(const QPoint& pos, int zoom)
|
||||||
TmsProvider::getCache(const QPoint& pos, int zoom)
|
|
||||||
{
|
{
|
||||||
QByteArray res{};
|
QByteArray res{};
|
||||||
mDbConn.open();
|
mDbConn.open();
|
||||||
|
|
@ -87,7 +91,7 @@ namespace LAMPMainWidget
|
||||||
select.bindValue(":zoom", zoom);
|
select.bindValue(":zoom", zoom);
|
||||||
select.bindValue(":position", QString("%1:%2").arg(pos.x()).arg(pos.y()));
|
select.bindValue(":position", QString("%1:%2").arg(pos.x()).arg(pos.y()));
|
||||||
if (!select.exec()) {
|
if (!select.exec()) {
|
||||||
qDebug() << pos << "查询失败=>" << select.lastError().text();
|
std::cout << pos.x()<<","<<pos.y() << "查询失败=>" << select.lastError().text().toUtf8().constData() << std::endl;
|
||||||
mDbConn.close();
|
mDbConn.close();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
@ -101,11 +105,10 @@ namespace LAMPMainWidget
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool TmsProvider::addCache(const QPoint& pos, int zoom, QByteArray data)
|
||||||
TmsProvider::addCache(const QPoint& pos, int zoom, QByteArray data)
|
|
||||||
{
|
{
|
||||||
if (data.isEmpty()) {
|
if (data.isEmpty()) {
|
||||||
qWarning() << "瓦片数据为空";
|
std::cout << "瓦片数据为空";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mDbConn.open();
|
mDbConn.open();
|
||||||
|
|
@ -121,7 +124,7 @@ namespace LAMPMainWidget
|
||||||
sql.bindValue(":data", data);
|
sql.bindValue(":data", data);
|
||||||
|
|
||||||
if (!sql.exec()) {
|
if (!sql.exec()) {
|
||||||
qCritical() << pos << "=>" << sql.lastError().text();
|
std::cout << pos.x() << "," << pos.y() << "=>" << sql.lastError().text().toUtf8().constData() << std::endl;
|
||||||
mDbConn.close();
|
mDbConn.close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -130,15 +133,13 @@ namespace LAMPMainWidget
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool TmsProvider::cacheContains(const QPoint& pos, int zoom)
|
||||||
TmsProvider::cacheContains(const QPoint& pos, int zoom)
|
|
||||||
{
|
{
|
||||||
QByteArray res = getCache(pos, zoom);
|
QByteArray res = getCache(pos, zoom);
|
||||||
return !res.isEmpty();
|
return !res.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TmsProvider::createTask(const QRectF& rect, int zoom)
|
||||||
TmsProvider::createTask(const QRectF& rect, int zoom)
|
|
||||||
{
|
{
|
||||||
newImage(rect);
|
newImage(rect);
|
||||||
|
|
||||||
|
|
@ -164,16 +165,30 @@ namespace LAMPMainWidget
|
||||||
tileReady(tile);
|
tileReady(tile);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
/* 原始写法遇到了跨线程信号槽失效问题,这里修改为回调函数方式
|
||||||
auto* task = new TileDownloadTask(tile);
|
auto* task = new TileDownloadTask(tile);
|
||||||
QObject::connect(task, &TileDownloadTask::tileReady, this, &TmsProvider::tileReady);
|
if (!QObject::connect(task, SIGNAL(tileReady(TileInfo)), this, SLOT(tileReady(TileInfo)))) {
|
||||||
|
qDebug() << "连接失败:" << QObject::tr(qPrintable(Q_FUNC_INFO));
|
||||||
|
}
|
||||||
|
|
||||||
QThreadPool::globalInstance()->start(task);
|
QThreadPool::globalInstance()->start(task);
|
||||||
|
*/
|
||||||
|
// 回调函数版本
|
||||||
|
QPointer<TmsProvider> safeThis(this);
|
||||||
|
auto* task = new TileDownloadTask(tile, [safeThis]( TileInfo info) {
|
||||||
|
if (safeThis) { // 自动检测对象是否存活
|
||||||
|
QMetaObject::invokeMethod(safeThis.data(), [safeThis, info] {
|
||||||
|
safeThis->tileReady(info);
|
||||||
|
}, Qt::QueuedConnection); // 强制主线程执行[6](@ref)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
QThreadPool::globalInstance()->start(task);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TmsProvider::tileReady(TileInfo tile)
|
||||||
TmsProvider::tileReady(TileInfo tile)
|
|
||||||
{
|
{
|
||||||
if (!cacheContains(tile.position, tile.zoom)) {
|
if (!cacheContains(tile.position, tile.zoom)) {
|
||||||
addCache(tile.position, tile.zoom, tile.data);
|
addCache(tile.position, tile.zoom, tile.data);
|
||||||
|
|
@ -190,8 +205,7 @@ namespace LAMPMainWidget
|
||||||
painter.drawImage(QPointF(xPos, yPos), img);
|
painter.drawImage(QPointF(xPos, yPos), img);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TmsProvider::newImage(const QRectF& rect)
|
||||||
TmsProvider::newImage(const QRectF& rect)
|
|
||||||
{
|
{
|
||||||
QSize imgSize{ int(rect.width()), int(rect.height()) };
|
QSize imgSize{ int(rect.width()), int(rect.height()) };
|
||||||
if (!mImage || imgSize != mImage->size()) {
|
if (!mImage || imgSize != mImage->size()) {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@ namespace LAMPMainWidget
|
||||||
QString url;
|
QString url;
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
};
|
};
|
||||||
|
// 在结构体定义后声明
|
||||||
|
Q_DECLARE_METATYPE(TileInfo);
|
||||||
/*
|
/*
|
||||||
* 异步执行的瓦片下载任务
|
* 异步执行的瓦片下载任务
|
||||||
*/
|
*/
|
||||||
|
|
@ -39,7 +40,9 @@ namespace LAMPMainWidget
|
||||||
void tileReady(TileInfo tile);
|
void tileReady(TileInfo tile);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TileDownloadTask(TileInfo tile, QObject* parent = nullptr);
|
using tileReadyCallback = std::function<void( TileInfo )>;
|
||||||
|
|
||||||
|
explicit TileDownloadTask(TileInfo tile, tileReadyCallback=nullptr, QObject* parent = nullptr);
|
||||||
TileDownloadTask(const TileDownloadTask& other) = delete;
|
TileDownloadTask(const TileDownloadTask& other) = delete;
|
||||||
TileDownloadTask(TileDownloadTask&& other) = delete;
|
TileDownloadTask(TileDownloadTask&& other) = delete;
|
||||||
TileDownloadTask& operator=(const TileDownloadTask& other) = delete;
|
TileDownloadTask& operator=(const TileDownloadTask& other) = delete;
|
||||||
|
|
@ -47,11 +50,15 @@ namespace LAMPMainWidget
|
||||||
|
|
||||||
~TileDownloadTask() override = default;
|
~TileDownloadTask() override = default;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void run() override;
|
void run() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TileInfo mTile;
|
TileInfo mTile;
|
||||||
|
private:
|
||||||
|
tileReadyCallback mCallback;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TmsProvider : public LayerProvider
|
class TmsProvider : public LayerProvider
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,7 @@
|
||||||
|
|
||||||
namespace LAMPMainWidget
|
namespace LAMPMainWidget
|
||||||
{
|
{
|
||||||
PointXY
|
PointXY WebMercator::forward(const LAMPMainWidget::PointXY& point) const
|
||||||
WebMercator::forward(const LAMPMainWidget::PointXY& point) const
|
|
||||||
{
|
{
|
||||||
PointXY result{};
|
PointXY result{};
|
||||||
PointXY originXy = CRS::forward(point);
|
PointXY originXy = CRS::forward(point);
|
||||||
|
|
@ -17,8 +16,7 @@ namespace LAMPMainWidget
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
PointXY
|
PointXY WebMercator::inverse(const LAMPMainWidget::PointXY& point) const
|
||||||
WebMercator::inverse(const LAMPMainWidget::PointXY& point) const
|
|
||||||
{
|
{
|
||||||
PointXY originXy{};
|
PointXY originXy{};
|
||||||
QSizeF sz = extent().size();
|
QSizeF sz = extent().size();
|
||||||
|
|
@ -29,14 +27,12 @@ namespace LAMPMainWidget
|
||||||
return CRS::inverse(originXy);
|
return CRS::inverse(originXy);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString WebMercator::proj4Cvt() const
|
||||||
WebMercator::proj4Cvt() const
|
|
||||||
{
|
{
|
||||||
return QString{"+proj=webmerc +datum=WGS84"};
|
return QString{"+proj=webmerc +datum=WGS84"};
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString WebMercator::wktDef() const
|
||||||
WebMercator::wktDef() const
|
|
||||||
{
|
{
|
||||||
return QString{
|
return QString{
|
||||||
R"(
|
R"(
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue