Skip to content

Commit 1367aa4

Browse files
authored
Merge pull request #46 from Digitelektro/develop
Develop
2 parents 6b9f0f3 + 46fcba4 commit 1367aa4

14 files changed

Lines changed: 206 additions & 66 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Thumbs.db
3535
/.qmake.cache
3636
/.qmake.stash
3737
Build/
38+
build/
3839

3940
# qtcreator generated files
4041
*.pro.user*

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ if(UNIX AND NOT APPLE)
151151
SET(CPACK_GENERATOR "DEB")
152152
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
153153
SET(CPACK_PACKAGE_VERSION_MINOR "4")
154-
SET(CPACK_PACKAGE_VERSION_PATCH "2")
154+
SET(CPACK_PACKAGE_VERSION_PATCH "3")
155155
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Digitelektro")
156156
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/Digitelektro/MeteorDemod")
157157
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Russian Meteor M2 weather satellite data decoder")

GIS/shaperenderer.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ GIS::ShapeRenderer::ShapeRenderer(const std::string shapeFile, const cv::Scalar
1010
, mAltitude(altitude)
1111
, mThicknes(5)
1212
, mPointRadius(10)
13-
, mFontScale(2)
13+
, mFontHeight(40)
14+
, mFontLineWidth(2)
1415
{
1516

1617
}
@@ -113,10 +114,11 @@ void GIS::ShapeRenderer::drawShapeMercator(cv::Mat &src, float xStart, float ySt
113114
}
114115

115116
if(drawName) {
117+
double fontScale = cv::getFontScaleFromHeight(cv::FONT_ITALIC, mFontHeight, mFontLineWidth);
116118
int baseLine;
117-
cv::Size size = cv::getTextSize(fieldValues[namePos], cv::FONT_ITALIC, mFontScale, mThicknes, &baseLine);
118-
cv::putText(src, fieldValues[namePos], cv::Point2d(coordinate.x - (size.width/2), coordinate.y - size.height + baseLine), cv::FONT_ITALIC, mFontScale, cv::Scalar(0,0,0), mThicknes+1, cv::LINE_AA);
119-
cv::putText(src, fieldValues[namePos], cv::Point2d(coordinate.x - (size.width/2), coordinate.y - size.height + baseLine), cv::FONT_ITALIC, mFontScale, mColor, mThicknes, cv::LINE_AA);
119+
cv::Size size = cv::getTextSize(fieldValues[namePos], cv::FONT_ITALIC, fontScale, mFontLineWidth, &baseLine);
120+
cv::putText(src, fieldValues[namePos], cv::Point2d(coordinate.x - (size.width/2), coordinate.y - size.height + baseLine), cv::FONT_ITALIC, fontScale, cv::Scalar(0,0,0), mFontLineWidth+1, cv::LINE_AA);
121+
cv::putText(src, fieldValues[namePos], cv::Point2d(coordinate.x - (size.width/2), coordinate.y - size.height + baseLine), cv::FONT_ITALIC, fontScale, mColor, mFontLineWidth, cv::LINE_AA);
120122
}
121123
}
122124
}
@@ -222,10 +224,11 @@ void GIS::ShapeRenderer::drawShapeEquidistant(cv::Mat &src, float xStart, float
222224
}
223225

224226
if(drawName) {
227+
double fontScale = cv::getFontScaleFromHeight(cv::FONT_ITALIC, mFontHeight, mFontLineWidth);
225228
int baseLine;
226-
cv::Size size = cv::getTextSize(fieldValues[namePos], cv::FONT_ITALIC, mFontScale, mThicknes, &baseLine);
227-
cv::putText(src, fieldValues[namePos], cv::Point2d(coordinate.x - (size.width/2), coordinate.y - size.height + baseLine), cv::FONT_ITALIC, mFontScale, cv::Scalar(0,0,0), mThicknes+1, cv::LINE_AA);
228-
cv::putText(src, fieldValues[namePos], cv::Point2d(coordinate.x - (size.width/2), coordinate.y - size.height + baseLine), cv::FONT_ITALIC, mFontScale, mColor, mThicknes, cv::LINE_AA);
229+
cv::Size size = cv::getTextSize(fieldValues[namePos], cv::FONT_ITALIC, fontScale, mFontLineWidth, &baseLine);
230+
cv::putText(src, fieldValues[namePos], cv::Point2d(coordinate.x - (size.width/2), coordinate.y - size.height + baseLine), cv::FONT_ITALIC, fontScale, cv::Scalar(0,0,0), mFontLineWidth+1, cv::LINE_AA);
231+
cv::putText(src, fieldValues[namePos], cv::Point2d(coordinate.x - (size.width/2), coordinate.y - size.height + baseLine), cv::FONT_ITALIC, fontScale, mColor, mFontLineWidth, cv::LINE_AA);
229232
}
230233
}
231234
}

GIS/shaperenderer.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ class ShapeRenderer : public ShapeReader
3030
void setPointRadius(int radius) {
3131
mPointRadius = radius;
3232
}
33-
void setFontScale(int scale) {
34-
mFontScale = scale;
33+
void setFontHeight(int height) {
34+
mFontHeight = height;
35+
}
36+
void setFontLineWidth(int width) {
37+
mFontLineWidth = width;
3538
}
3639

3740
private:
@@ -45,7 +48,8 @@ class ShapeRenderer : public ShapeReader
4548
std::string mTextFieldName;
4649
int mThicknes;
4750
int mPointRadius;
48-
int mFontScale;
51+
int mFontHeight;
52+
int mFontLineWidth;
4953
};
5054

5155
} //namespace GIS

common/settings.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ void Settings::parseIni(const std::string &path)
6666
ini::extract(mIniParser.sections["Program"]["ProjectionScale"], mProjectionScale, 0.75f);
6767
ini::extract(mIniParser.sections["Program"]["CompositeProjectionScale"], mCompositeProjectionScale, 0.75f);
6868
ini::extract(mIniParser.sections["Program"]["CompositeAzimuthalEquidistantProjection"], mCompositeEquadistantProjection, true);
69-
ini::extract(mIniParser.sections["Program"]["CompositeMercatorProjection"], mCompositeMercatorProjection, true);
69+
ini::extract(mIniParser.sections["Program"]["CompositeMercatorProjection"], mCompositeMercatorProjection, false);
7070
ini::extract(mIniParser.sections["Program"]["GenerateComposite123"], mGenerateComposite123, true);
7171
ini::extract(mIniParser.sections["Program"]["GenerateComposite125"], mGenerateComposite125, true);
7272
ini::extract(mIniParser.sections["Program"]["GenerateComposite221"], mGenerateComposite221, true);
7373
ini::extract(mIniParser.sections["Program"]["GenerateComposite68"], mGenerateComposite68, true);
7474
ini::extract(mIniParser.sections["Program"]["GenerateCompositeThermal"], mGenerateCompositeThermal, true);
75-
75+
ini::extract(mIniParser.sections["Program"]["GenerateComposite68Rain"], mGenerateComposite68Rain, true);
7676

7777
ini::extract(mIniParser.sections["Demodulator"]["CostasBandwidth"], mCostasBw, 50);
7878
ini::extract(mIniParser.sections["Demodulator"]["RRCFilterOrder"], mRRCFilterOrder, 64);
@@ -82,7 +82,8 @@ void Settings::parseIni(const std::string &path)
8282

8383
ini::extract(mIniParser.sections["Watermark"]["Place"], mWaterMarkPlace);
8484
ini::extract(mIniParser.sections["Watermark"]["Color"], mWaterMarkColor, HTMLColor(0xAD880C));
85-
ini::extract(mIniParser.sections["Watermark"]["Size"], mWaterMarkSize, 5);
85+
ini::extract(mIniParser.sections["Watermark"]["Size"], mWaterMarkSize, 80);
86+
ini::extract(mIniParser.sections["Watermark"]["Width"], mWaterMarkLineWidth, 3);
8687
ini::extract(mIniParser.sections["Watermark"]["Text"], mWaterMarkText);
8788

8889
ini::extract(mIniParser.sections["ReceiverLocation"]["Draw"], mDrawreceiver, false);
@@ -95,20 +96,20 @@ void Settings::parseIni(const std::string &path)
9596

9697
ini::extract(mIniParser.sections["ShapeFileGraticules"]["FileName"], mShapeGraticulesFile);
9798
ini::extract(mIniParser.sections["ShapeFileGraticules"]["Color"], mShapeGraticulesColor, HTMLColor(0xC8C8C8));
98-
ini::extract(mIniParser.sections["ShapeFileGraticules"]["Thickness"], mShapeGraticulesThickness, 5);
99+
ini::extract(mIniParser.sections["ShapeFileGraticules"]["Thickness"], mShapeGraticulesThickness, 1);
99100

100101
ini::extract(mIniParser.sections["ShapeFileCoastLines"]["FileName"], mShapeCoastLinesFile);
101102
ini::extract(mIniParser.sections["ShapeFileCoastLines"]["Color"], mShapeCoastLinesColor, HTMLColor(0x808000));
102-
ini::extract(mIniParser.sections["ShapeFileCoastLines"]["Thickness"], mShapeCoastLinesThickness, 5);
103+
ini::extract(mIniParser.sections["ShapeFileCoastLines"]["Thickness"], mShapeCoastLinesThickness, 2);
103104

104105
ini::extract(mIniParser.sections["ShapeFileBoundaryLines"]["FileName"], mShapeBoundaryLinesFile);
105106
ini::extract(mIniParser.sections["ShapeFileBoundaryLines"]["Color"], mShapeBoundaryLinesColor, HTMLColor(0xC8C8C8));
106-
ini::extract(mIniParser.sections["ShapeFileBoundaryLines"]["Thickness"], mShapeBoundaryLinesThickness, 5);
107+
ini::extract(mIniParser.sections["ShapeFileBoundaryLines"]["Thickness"], mShapeBoundaryLinesThickness, 2);
107108

108109
ini::extract(mIniParser.sections["ShapeFilePopulatedPlaces"]["FileName"], mShapePopulatedPlacesFile);
109110
ini::extract(mIniParser.sections["ShapeFilePopulatedPlaces"]["Color"], mShapePopulatedPlacesColor, HTMLColor(0x5A42F5));
110-
ini::extract(mIniParser.sections["ShapeFilePopulatedPlaces"]["Thickness"], mShapePopulatedPlacesThickness, 5);
111-
ini::extract(mIniParser.sections["ShapeFilePopulatedPlaces"]["FontScale"], mShapePopulatedPlacesFontScale, 2);
111+
ini::extract(mIniParser.sections["ShapeFilePopulatedPlaces"]["Width"], mShapePopulatedPlacesFontWidth, 2);
112+
ini::extract(mIniParser.sections["ShapeFilePopulatedPlaces"]["Size"], mShapePopulatedPlacesFontSize, 40);
112113
ini::extract(mIniParser.sections["ShapeFilePopulatedPlaces"]["PointRadius"], mShapePopulatedPlacesPointradius, 10);
113114
ini::extract(mIniParser.sections["ShapeFilePopulatedPlaces"]["FilterColumnName"], mShapePopulatedPlacesFilterColumnName, std::string("ADM0CAP"));
114115
ini::extract(mIniParser.sections["ShapeFilePopulatedPlaces"]["NumericFilter"], mShapePopulatedPlacesNumbericFilter, 1);

common/settings.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class Settings
123123
bool generateComposite221() const { return mGenerateComposite221; }
124124
bool generateComposite68() const { return mGenerateComposite68; }
125125
bool generateCompositeThermal() const { return mGenerateCompositeThermal; }
126+
bool generateComposite68Rain() const { return mGenerateComposite68Rain; }
126127

127128
int getTimeOffsetM2Sec() const { return mTimeOffsetM2Sec; }
128129

@@ -135,6 +136,7 @@ class Settings
135136
const std::string &getWaterMarkPlace() const { return mWaterMarkPlace; }
136137
const HTMLColor &getWaterMarkColor() const { return mWaterMarkColor; }
137138
int getWaterMarkSize() const { return mWaterMarkSize; }
139+
int getWaterMarkLineWidth() const { return mWaterMarkLineWidth; }
138140
const std::string &getWaterMarkText() const { return mWaterMarkText; }
139141

140142
bool drawReceiver() const { return mDrawreceiver; }
@@ -159,8 +161,8 @@ class Settings
159161

160162
const std::string &getShapePopulatedPlacesFile() const { return mShapePopulatedPlacesFile; }
161163
const HTMLColor &getShapePopulatedPlacesColor() const { return mShapePopulatedPlacesColor; }
162-
int getShapePopulatedPlacesThickness() const { return mShapePopulatedPlacesThickness; }
163-
int getShapePopulatedPlacesFontScale() const { return mShapePopulatedPlacesFontScale; }
164+
int getShapePopulatedPlacesFontWidth() const { return mShapePopulatedPlacesFontWidth; }
165+
int getShapePopulatedPlacesFontSize() const { return mShapePopulatedPlacesFontSize; }
164166
int getShapePopulatedPlacesPointradius() const { return mShapePopulatedPlacesPointradius; }
165167
const std::string &getShapePopulatedPlacesFilterColumnName() const { return mShapePopulatedPlacesFilterColumnName; }
166168
int getShapePopulatedPlacesNumbericFilter() const { return mShapePopulatedPlacesNumbericFilter; }
@@ -192,6 +194,7 @@ class Settings
192194
bool mGenerateComposite221;
193195
bool mGenerateComposite68;
194196
bool mGenerateCompositeThermal;
197+
bool mGenerateComposite68Rain;
195198

196199
int mTimeOffsetM2Sec;
197200

@@ -207,6 +210,7 @@ class Settings
207210
std::string mWaterMarkPlace;
208211
HTMLColor mWaterMarkColor;
209212
int mWaterMarkSize;
213+
int mWaterMarkLineWidth;
210214
std::string mWaterMarkText;
211215

212216
//ini section: ReceiverLocation
@@ -236,8 +240,8 @@ class Settings
236240
//ini section: ShapeFilePopulatedPlaces
237241
std::string mShapePopulatedPlacesFile;
238242
HTMLColor mShapePopulatedPlacesColor;
239-
int mShapePopulatedPlacesThickness;
240-
int mShapePopulatedPlacesFontScale;
243+
int mShapePopulatedPlacesFontWidth;
244+
int mShapePopulatedPlacesFontSize;
241245
int mShapePopulatedPlacesPointradius;
242246
std::string mShapePopulatedPlacesFilterColumnName;
243247
int mShapePopulatedPlacesNumbericFilter;

common/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
#define VERSION_MAJOR 2
55
#define VERSION_MINOR 4
6-
#define VERSION_FIX 2
6+
#define VERSION_FIX 3
77

88
#endif // VERSION_H

0 commit comments

Comments
 (0)