Skip to content

Commit

Permalink
Merge pull request #38 from Digitelektro/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
Digitelektro authored Sep 28, 2022
2 parents 71ded81 + 8d1c852 commit 3c33000
Show file tree
Hide file tree
Showing 15 changed files with 169 additions and 366 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ if(UNIX AND NOT APPLE)
SET(CPACK_GENERATOR "DEB")
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "3")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_VERSION_PATCH "1")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Digitelektro")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/Digitelektro/MeteorDemod")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Russian Meteor M2 weather satellite data decoder")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "python3-opencv")
INCLUDE(CPack)
endif()
endif()
19 changes: 10 additions & 9 deletions GIS/shapereader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <iostream>
#include <vector>
#include <iterator>
#include <memory>
#include "databuffer.h"
#include "dbfilereader.h"

Expand Down Expand Up @@ -373,24 +374,24 @@ class ShapeReader
}
}

RecordIterator *getRecordIterator() {
std::unique_ptr<RecordIterator> getRecordIterator() {
if(mLoaded) {
return new RecordIterator(mBinaryData);
return std::unique_ptr<RecordIterator>(new RecordIterator(mBinaryData));
}
return nullptr;
return std::unique_ptr<RecordIterator>(nullptr);
}
PolyLineIterator *getPolyLineIterator(const RecordIterator &recordIterator) {
std::unique_ptr<PolyLineIterator> getPolyLineIterator(const RecordIterator &recordIterator) {
if(mLoaded) {
return new PolyLineIterator(mBinaryData, recordIterator.mRecordPosition);
return std::unique_ptr<PolyLineIterator>(new PolyLineIterator(mBinaryData, recordIterator.mRecordPosition));
}
return nullptr;
return std::unique_ptr<PolyLineIterator>(nullptr);
}

MultiPointIterator *getMultiPointIterator(const RecordIterator &recordIterator) {
std::unique_ptr<MultiPointIterator> getMultiPointIterator(const RecordIterator &recordIterator) {
if(mLoaded) {
return new MultiPointIterator(mBinaryData, recordIterator.mRecordPosition);
return std::unique_ptr<MultiPointIterator>(new MultiPointIterator(mBinaryData, recordIterator.mRecordPosition));
}
return nullptr;
return std::unique_ptr<MultiPointIterator>(nullptr);
}

const DbFileReader &getDbFilereader() const {
Expand Down
22 changes: 7 additions & 15 deletions GIS/shaperenderer.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "shaperenderer.h"
#include <vector>
#include "pixelgeolocationcalculator.h"
#include <vector>


GIS::ShapeRenderer::ShapeRenderer(const std::string shapeFile, const cv::Scalar &color, int earthRadius, int altitude)
Expand Down Expand Up @@ -32,11 +32,11 @@ void GIS::ShapeRenderer::drawShapeMercator(cv::Mat &src, float xStart, float ySt
}

if(getShapeType() == ShapeReader::ShapeType::stPolyline) {
ShapeReader::RecordIterator *recordIterator = getRecordIterator();
auto recordIterator = getRecordIterator();

if(recordIterator) {
for(recordIterator->begin(); *recordIterator != recordIterator->end(); ++(*recordIterator)) {
ShapeReader::PolyLineIterator *polyLineIterator = getPolyLineIterator(*recordIterator);
auto polyLineIterator = getPolyLineIterator(*recordIterator);

if(polyLineIterator) {
std::vector<cv::Point> polyLines;
Expand All @@ -54,15 +54,11 @@ void GIS::ShapeRenderer::drawShapeMercator(cv::Mat &src, float xStart, float ySt
if(polyLines.size() > 1) {
cv::polylines(src, polyLines, false, mColor, mThicknes);
}

delete polyLineIterator;
}
}

delete recordIterator;
}
} else if(getShapeType() == ShapeReader::ShapeType::stPoint) {
ShapeReader::RecordIterator *recordIterator = getRecordIterator();
auto recordIterator = getRecordIterator();

if(mfilter.size() == 0) {
if(recordIterator) {
Expand Down Expand Up @@ -135,11 +131,11 @@ void GIS::ShapeRenderer::drawShapeEquidistant(cv::Mat &src, float xStart, float
}

if(getShapeType() == ShapeReader::ShapeType::stPolyline) {
ShapeReader::RecordIterator *recordIterator = getRecordIterator();
auto recordIterator = getRecordIterator();

if(recordIterator) {
for(recordIterator->begin(); *recordIterator != recordIterator->end(); ++(*recordIterator)) {
ShapeReader::PolyLineIterator *polyLineIterator = getPolyLineIterator(*recordIterator);
auto polyLineIterator = getPolyLineIterator(*recordIterator);

if(polyLineIterator) {
std::vector<cv::Point> polyLines;
Expand All @@ -159,15 +155,11 @@ void GIS::ShapeRenderer::drawShapeEquidistant(cv::Mat &src, float xStart, float
if(polyLines.size() > 1) {
cv::polylines(src, polyLines, false, mColor, mThicknes);
}

delete polyLineIterator;
}
}

delete recordIterator;
}
} else if(getShapeType() == ShapeReader::ShapeType::stPoint) {
ShapeReader::RecordIterator *recordIterator = getRecordIterator();
auto recordIterator = getRecordIterator();

if(mfilter.size() == 0) {
if(recordIterator) {
Expand Down
6 changes: 4 additions & 2 deletions common/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ void Settings::parseIni(const std::string &path)
ini::extract(mIniParser.sections["Program"]["SpreadImage"], mSpreadImage, true);
ini::extract(mIniParser.sections["Program"]["AddRainOverlay"], mAddRainOverlay, true);
ini::extract(mIniParser.sections["Program"]["JpgQuality"], mJpegQuality, 90);
ini::extract(mIniParser.sections["Program"]["AlfaM2"], mAlfaM2, 110.8f);
ini::extract(mIniParser.sections["Program"]["DeltaM2"], DeltaM2, -3.2f);
ini::extract(mIniParser.sections["Program"]["ScanAngleM2"], mScanAngleM2, 110.8f);
ini::extract(mIniParser.sections["Program"]["RollM2"], mM2Roll, -2.9f);
ini::extract(mIniParser.sections["Program"]["PitchM2"], mM2Pitch, 0.3f);
ini::extract(mIniParser.sections["Program"]["YawM2"], mM2Yaw, 0.0f);
ini::extract(mIniParser.sections["Program"]["NightPassTreshold"], mNightPassTreshold, 10.0f);

ini::extract(mIniParser.sections["Demodulator"]["CostasBandwidth"], mCostasBw, 50);
Expand Down
12 changes: 8 additions & 4 deletions common/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ class Settings
bool getBrokenM2Modulation() const;

int getJpegQuality() const { return mJpegQuality; }
float getM2Alfa() const { return mAlfaM2; }
float getM2Delta() const { return DeltaM2; }
float getM2ScanAngle() const { return mScanAngleM2; }
float getM2Roll() const { return mM2Roll; }
float getM2Pitch() const { return mM2Pitch; }
float getM2Yaw() const { return mM2Yaw; }
bool equadistantProjection() const { return mEquidistantProjection; }
bool mercatorProjection() const { return mMercatorProjection; }
bool spreadImage() const { return mSpreadImage; }
Expand Down Expand Up @@ -159,8 +161,10 @@ class Settings

//ini section: Program
int mJpegQuality;
float mAlfaM2;
float DeltaM2;
float mScanAngleM2;
float mM2Roll;
float mM2Pitch;
float mM2Yaw;
bool mEquidistantProjection;
bool mMercatorProjection;
bool mSpreadImage;
Expand Down
2 changes: 1 addition & 1 deletion common/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

#define VERSION_MAJOR 2
#define VERSION_MINOR 3
#define VERSION_FIX 0
#define VERSION_FIX 1

#endif // VERSION_H
Loading

0 comments on commit 3c33000

Please sign in to comment.