Commit 94abcb70 authored by Helen Oleynikova's avatar Helen Oleynikova

Merge branch 'master' of git://github.com/mavlink/qgroundcontrol

parents 4b34688a 4992f93d
......@@ -21,7 +21,6 @@ tmp
debug
release
/qgroundcontrol
mavlinkgen-build-desktop
qgroundcontrol.xcodeproj/**
doc/html
doc/doxy.log
......
......@@ -123,34 +123,6 @@ INCLUDEPATH += $$MAVLINKPATH
INCLUDEPATH += $$MAVLINKPATH/common
}
#
# [DEPRECATED] MAVLink generator UI. Provides a GUI interface for generating MAVLink dialects.
# Replaced by mavgenerator.py within the MAVLink project.
#
contains(DEFINES, ENABLE_MAVGEN) {
warning("Including support for MAVLink generator GUI (manual override from command line, CAUTION: deprecated)")
} else:infile(user_config.pri, DEFINES, ENABLE_MAVGEN) {
DEFINES += ENABLE_MAVGEN # infile doesn't automatically include everything in the specified file
warning("Including support for MAVLink generator GUI (manual override from user_config.pri, CAUTION: deprecated)")
}
contains(DEFINES, ENABLE_MAVGEN) {
# Rename the macro to be consistent with other QGC feature existance macros.
DEFINES -= ENABLE_MAVGEN
DEFINES += QGC_MAVGEN_ENABLED
DEPENDPATH += \
src/apps/mavlinkgen
INCLUDEPATH += \
src/apps/mavlinkgen \
src/apps/mavlinkgen/ui \
src/apps/mavlinkgen/generator
include(src/apps/mavlinkgen/mavlinkgen.pri)
} else {
message("Skipping support for MAVLink generator GUI (deprecated, see README)")
}
#
# [OPTIONAL] OpenSceneGraph
# Allow the user to override OpenSceneGraph compilation through a DISABLE_OPEN_SCENE_GRAPH
......@@ -348,7 +320,9 @@ INCLUDEPATH += \
#
# [REQUIRED] QWT plotting library dependency. Provides plotting capabilities.
#
include(libs/qwt/qwt.pri)
include(libs/qwt.pri)
DEPENDPATH += libs/qwt
INCLUDEPATH += libs/qwt
#
# [REQUIRED] QSerialPort library. Provides serial port wrapper library.
......@@ -416,9 +390,10 @@ contains(DEFINES, DISABLE_3DMOUSE) {
exists(/usr/local/lib/libxdrvlib.so) {
message("Including support for 3DConnexion mice")
DEFINES +=
DEFINES += \
QGC_MOUSE_ENABLED_LINUX \
ParameterCheck # Hack: Has to be defined for magellan usage
ParameterCheck
# Hack: Has to be defined for magellan usage
HEADERS += src/input/Mouse6dofInput.h
SOURCES += src/input/Mouse6dofInput.cpp
......
......@@ -37,9 +37,6 @@ The QUpgrade module relies on `libudev` on Linux platforms, so be sure to instal
### Specifying MAVLink dialects
The MAVLink dialect compiled by default by QGC is for the ardupilotmega. This will happen if no other dialects are specified. Setting the `MAVLINK_CONF` variable sets the dialects, with more than one specified in a space-separated list. Note that doing this may result in compilation errors as certain dialects may conflict with each other!
### MAVLink dialect generator
An add-on is available for QGC that provides a UI for generating MAVLink dialects from within QGC. This feature has been deprecated since identical functionality now exists within the MAVLink project itself. Enable this functionality by specifying the `DEFINES` variable `ENABLE_MAVGEN`.
### Opal-RT's RT-LAB simulator
Integration with Opal-RT's RT-LAB simulator can be enabled on Windows by installing RT-LAB 7.2.4. This allows vehicles to be simulated in RT-LAB and communicate directly with QGC on the same computer as if the UAS was actually deployed. This support is enabled by default once the requisite RT-LAB software is installed. Disabling this can be done by adding `DISABLE_RTLAB` to the `DEFINES` variable.
......@@ -90,7 +87,8 @@ To build on Linux:
- - -
1. Install base dependencies (QT + phonon/webkit, SDL)
* For Ubuntu: `sudo apt-get install libqt4-dev libphonon-dev libphonon4 phonon-backend-gstreamer qtcreator libsdl1.2-dev build-essential libudev-dev`
* For Fedora: `sudo yum install qt qt-creator qt-webkit-devel SDL-devel SDL-static systemd-devel`
* For Fedora: `sudo yum install qt qt-creator qt-webkit-devel phonon-devel SDL-devel SDL-static systemd-devel`
* For Arch Linux: `pacman -Sy qtwebkit phonon-qt4`
2. **[OPTIONAL]** Install additional libraries
* For text-to-speech (espeak)
......
......@@ -91,7 +91,7 @@
<damping_coeff_rebound unit="LBS/FT/SEC"> 4.0 </damping_coeff_rebound>
<max_steer unit="DEG">0</max_steer>
<brake_group>NONE</brake_group>
<retractable>FIXED</retractable>
<retractable>0</retractable>
</contact>
<contact type="BOGEY" name="NOSE">
<location unit="M">
......@@ -107,7 +107,7 @@
<damping_coeff_rebound unit="LBS/FT/SEC"> 4.0 </damping_coeff_rebound>
<max_steer unit="DEG">0</max_steer>
<brake_group>NONE</brake_group>
<retractable>FIXED</retractable>
<retractable>0</retractable>
</contact>
<contact type="STRUCTURE" name="TAIL">
......
......@@ -103,11 +103,11 @@
</ground_reactions>
<!-- the front and rear motors spin clockwise, and the left and right motors spin counter-clockwise. -->
<propulsion>
<engine file="a2830-12" name="front">
<engine file="a2830-12" name="right">
<location unit="M">
<x> -0.283 </x>
<y> 0.00 </y>
<z> 0.00 </z>
<x> 0.000 </x>
<y> 0.283 </y>
<z> 0.000 </z>
</location>
<orient unit="DEG">
<pitch> 90.00 </pitch>
......@@ -117,8 +117,8 @@
<feed>0</feed>
<thruster file="prop10x4.5">
<location unit="M">
<x> -0.283 </x>
<y> 0.00 </y>
<x> 0.000 </x>
<y> 0.283 </y>
<z> 0.125 </z>
</location>
<orient unit="DEG">
......@@ -130,11 +130,12 @@
<p_factor> 10 </p_factor>
</thruster>
</engine>
<engine file="a2830-12" name="rear">
<engine file="a2830-12" name="left">
<location unit="M">
<x> 0.283 </x>
<y> 0.000 </y>
<z> 0.000 </z>
<x> 0.00 </x>
<y> -0.283 </y>
<z> 0.00 </z>
</location>
<orient unit="DEG">
<pitch> 90.00 </pitch>
......@@ -144,8 +145,8 @@
<feed>0</feed>
<thruster file="prop10x4.5">
<location unit="M">
<x> 0.283 </x>
<y> 0.000 </y>
<x> 0.00 </x>
<y> -0.283 </y>
<z> 0.125 </z>
</location>
<orient unit="DEG">
......@@ -157,10 +158,11 @@
<p_factor> 10 </p_factor>
</thruster>
</engine>
<engine file="a2830-12" name="left">
<engine file="a2830-12" name="front">
<location unit="M">
<x> 0.00 </x>
<y> 0.283 </y>
<x> -0.283 </x>
<y> 0.00 </y>
<z> 0.00 </z>
</location>
<orient unit="DEG">
......@@ -171,8 +173,8 @@
<feed>0</feed>
<thruster file="prop10x4.5">
<location unit="M">
<x> 0.00 </x>
<y> 0.283 </y>
<x> -0.283 </x>
<y> 0.00 </y>
<z> 0.125 </z>
</location>
<orient unit="DEG">
......@@ -184,10 +186,11 @@
<p_factor> 10 </p_factor>
</thruster>
</engine>
<engine file="a2830-12" name="right">
<engine file="a2830-12" name="rear">
<location unit="M">
<x> 0.000 </x>
<y> -0.283 </y>
<x> 0.283 </x>
<y> 0.000 </y>
<z> 0.000 </z>
</location>
<orient unit="DEG">
......@@ -198,8 +201,8 @@
<feed>0</feed>
<thruster file="prop10x4.5">
<location unit="M">
<x> 0.000 </x>
<y> -0.283 </y>
<x> 0.283 </x>
<y> 0.000 </y>
<z> 0.125 </z>
</location>
<orient unit="DEG">
......@@ -211,6 +214,7 @@
<p_factor> 10 </p_factor>
</thruster>
</engine>
<tank type="FUEL" number="0">
<location unit="M">
<x> 0.00 </x>
......@@ -222,6 +226,7 @@
<contents unit="KG"> 0.0 </contents>
</tank>
</propulsion>
<aerodynamics>
<axis name="LIFT">
</axis>
......
......@@ -142,6 +142,41 @@
<factor>0.514444444444444</factor> <!-- knots to mps -->
</chunk>
<!-- Magnetometer -->
<chunk>
<name>Magnetic Variation (rad)</name>
<type>float</type>
<format>%.8f</format>
<node>/environment/magnetic-variation-deg</node>
<factor>0.01745329251994329576</factor> <!-- degrees to radians -->
</chunk>
<chunk>
<name>Magnetic Dip (rad)</name>
<type>float</type>
<format>%.8f</format>
<node>/environment/magnetic-dip-deg</node>
<factor>0.01745329251994329576</factor> <!-- degrees to radians -->
</chunk>
<!-- Temperature -->
<chunk>
<name>Temperature (deg C)</name>
<type>float</type>
<format>%.8f</format>
<node>/environment/temperature-degc</node>
<factor>1</factor>
</chunk>
<!-- Pressure -->
<chunk>
<name>Pressure (hPa)</name>
<type>float</type>
<format>%.8f</format>
<node>/environment/pressure-inhg</node>
<factor>33.86389</factor> <!-- inhg to hpa -->
</chunk>
</output>
<input>
......@@ -152,22 +187,27 @@
<!-- motors, in range 0.0 to 1.0 -->
<chunk>
<name>throttle0</name>
<type>double</type>
<type>float</type>
<node>/controls/engines/engine[0]/throttle</node>
</chunk>
<chunk>
<name>throttle1</name>
<type>double</type>
<type>float</type>
<node>/controls/engines/engine[1]/throttle</node>
</chunk>
<chunk>
<name>throttle2</name>
<type>double</type>
<type>float</type>
<node>/controls/engines/engine[2]/throttle</node>
</chunk>
<chunk>
<name>running</name>
<type>bool</type>
<node>/engines/engine/running</node>
</chunk>
<chunk>
<name>throttle3</name>
<type>double</type>
<type>float</type>
<node>/controls/engines/engine[3]/throttle</node>
</chunk>
......
This folder contains the various required libraries for QGC to compile. They are distributed with the codebase to ease development.
# Qwt
Qt Widgets for Technical Applications
Version: 6.1
Source obtained: `svn checkout svn://svn.code.sf.net/p/qwt/code/branches/qwt-6.1 qwt`
Contents of `/libs/qwt` is the contents of the `/src` directory from the Qwt repository.
qwt.pri file is custom made to compile all necessary Qwt code in with QGC.
......@@ -73,7 +73,7 @@ static inline uint16_t crc_calculate(const uint8_t* pBuffer, uint16_t length)
* @param data new bytes to hash
* @param crcAccum the already accumulated checksum
**/
static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint8_t length)
static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint16_t length)
{
const uint8_t *p = (const uint8_t *)pBuffer;
while (length--) {
......
......@@ -5,6 +5,10 @@
#ifndef COMMON_H
#define COMMON_H
#ifndef MAVLINK_H
#error Wrong include order: common.h MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set all defines from mavlink.h manually.
#endif
#ifdef __cplusplus
extern "C" {
#endif
......
......@@ -73,7 +73,6 @@ MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, ui
#endif
{
// This code part is the same for all messages;
uint16_t checksum;
msg->magic = MAVLINK_STX;
msg->len = length;
msg->sysid = system_id;
......@@ -81,12 +80,13 @@ MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, ui
// One sequence number per component
msg->seq = mavlink_get_channel_status(chan)->current_tx_seq;
mavlink_get_channel_status(chan)->current_tx_seq = mavlink_get_channel_status(chan)->current_tx_seq+1;
checksum = crc_calculate((uint8_t*)&msg->len, length + MAVLINK_CORE_HEADER_LEN);
msg->checksum = crc_calculate(((const uint8_t*)(msg)) + 3, MAVLINK_CORE_HEADER_LEN);
crc_accumulate_buffer(&msg->checksum, _MAV_PAYLOAD(msg), msg->len);
#if MAVLINK_CRC_EXTRA
crc_accumulate(crc_extra, &checksum);
crc_accumulate(crc_extra, &msg->checksum);
#endif
mavlink_ck_a(msg) = (uint8_t)(checksum & 0xFF);
mavlink_ck_b(msg) = (uint8_t)(checksum >> 8);
mavlink_ck_a(msg) = (uint8_t)(msg->checksum & 0xFF);
mavlink_ck_b(msg) = (uint8_t)(msg->checksum >> 8);
return length + MAVLINK_NUM_NON_PAYLOAD_BYTES;
}
......@@ -133,7 +133,7 @@ MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint
buf[4] = mavlink_system.compid;
buf[5] = msgid;
status->current_tx_seq++;
checksum = crc_calculate((uint8_t*)&buf[1], MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate((const uint8_t*)&buf[1], MAVLINK_CORE_HEADER_LEN);
crc_accumulate_buffer(&checksum, packet, length);
#if MAVLINK_CRC_EXTRA
crc_accumulate(crc_extra, &checksum);
......@@ -158,6 +158,7 @@ MAVLINK_HELPER void _mavlink_resend_uart(mavlink_channel_t chan, const mavlink_m
ck[0] = (uint8_t)(msg->checksum & 0xFF);
ck[1] = (uint8_t)(msg->checksum >> 8);
// XXX use the right sequence here
MAVLINK_START_UART_SEND(chan, MAVLINK_NUM_NON_PAYLOAD_BYTES + msg->len);
_mavlink_send_uart(chan, (const char *)&msg->magic, MAVLINK_NUM_HEADER_BYTES);
......@@ -172,7 +173,13 @@ MAVLINK_HELPER void _mavlink_resend_uart(mavlink_channel_t chan, const mavlink_m
*/
MAVLINK_HELPER uint16_t mavlink_msg_to_send_buffer(uint8_t *buffer, const mavlink_message_t *msg)
{
memcpy(buffer, (const uint8_t *)&msg->magic, MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)msg->len);
memcpy(buffer, (const uint8_t *)&msg->magic, MAVLINK_NUM_HEADER_BYTES + (uint16_t)msg->len);
uint8_t *ck = buffer + (MAVLINK_NUM_HEADER_BYTES + (uint16_t)msg->len);
ck[0] = (uint8_t)(msg->checksum & 0xFF);
ck[1] = (uint8_t)(msg->checksum >> 8);
return MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)msg->len;
}
......
......@@ -28,6 +28,7 @@
#define MAVLINK_MAX_EXTENDED_PAYLOAD_LEN (MAVLINK_MAX_EXTENDED_PACKET_LEN - MAVLINK_EXTENDED_HEADER_LEN - MAVLINK_NUM_NON_PAYLOAD_BYTES)
#pragma pack(push, 1)
typedef struct param_union {
union {
float param_float;
......@@ -62,13 +63,12 @@ typedef struct __mavlink_message {
uint64_t payload64[(MAVLINK_MAX_PAYLOAD_LEN+MAVLINK_NUM_CHECKSUM_BYTES+7)/8];
} mavlink_message_t;
typedef struct __mavlink_extended_message {
mavlink_message_t base_msg;
int32_t extended_payload_len; ///< Length of extended payload if any
uint8_t extended_payload[MAVLINK_MAX_EXTENDED_PAYLOAD_LEN];
} mavlink_extended_message_t;
#pragma pack(pop)
typedef enum {
MAVLINK_TYPE_CHAR = 0,
......
......@@ -43,7 +43,7 @@ namespace core {
/// <summary>
/// Gets or sets the value of the User-agent HTTP header.
/// </summary>
UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7";
UserAgent = QString("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:%1.0) Gecko/%2%3%4 Firefox/%5.0.%6").arg(QString::number(Random(3,14)), QString::number(Random(QDate().currentDate().year() - 4, QDate().currentDate().year())), QString::number(Random(11,12)), QString::number(Random(10,30)), QString::number(Random(3,14)), QString::number(Random(1,10))).toLatin1();
Timeout = 5 * 1000;
CorrectGoogleVersions=true;
......@@ -54,6 +54,10 @@ namespace core {
UrlFactory::~UrlFactory()
{
}
int UrlFactory::Random(int low, int high)
{
return low + qrand() % (high - low);
}
QString UrlFactory::TileXYToQuadKey(const int &tileX,const int &tileY,const int &levelOfDetail) const
{
QString quadKey;
......@@ -112,7 +116,7 @@ namespace core {
#ifdef DEBUG_URLFACTORY
qDebug()<<"Correct GoogleVersion";
#endif //DEBUG_URLFACTORY
//setIsCorrectGoogleVersions(true);
setIsCorrectGoogleVersions(true);
QString url = "https://maps.google.com";
qheader.setUrl(QUrl(url));
......@@ -131,7 +135,7 @@ namespace core {
return;
}
QString html=QString(reply->readAll());
QRegExp reg("\"*https://mts0.google.com/vt/lyrs=m@(\\d*)",Qt::CaseInsensitive);
QRegExp reg("\"*https://mt0.google.com/vt/lyrs=m@(\\d*)",Qt::CaseInsensitive);
if(reg.indexIn(html)!=-1)
{
QStringList gc=reg.capturedTexts();
......@@ -143,7 +147,7 @@ namespace core {
#endif //DEBUG_URLFACTORY
}
reg = QRegExp("\"*https://mts0.google.com/vt/lyrs=h@(\\d*)",Qt::CaseInsensitive);
reg=QRegExp("\"*https://mt0.google.com/vt/lyrs=h@(\\d*)",Qt::CaseInsensitive);
if(reg.indexIn(html)!=-1)
{
QStringList gc=reg.capturedTexts();
......@@ -153,7 +157,7 @@ namespace core {
qDebug()<<"TryCorrectGoogleVersions, VersionGoogleLabels: "<<VersionGoogleLabels;
#endif //DEBUG_URLFACTORY
}
reg=QRegExp("\"*https://khms0.google.com/kh/v=(\\d*)",Qt::CaseInsensitive);
reg=QRegExp("\"*https://khm\\D?\\d.google.com/kh/v=(\\d*)",Qt::CaseInsensitive);
if(reg.indexIn(html)!=-1)
{
QStringList gc=reg.capturedTexts();
......@@ -163,7 +167,7 @@ namespace core {
qDebug()<<"TryCorrectGoogleVersions, VersionGoogleSatellite: "<<VersionGoogleSatellite;
}
reg=QRegExp("\"*https://mts0.google.com/vt/lyrs=t@(\\d*),r@(\\d*)",Qt::CaseInsensitive);
reg=QRegExp("\"*https://mt0.google.com/vt/lyrs=t@(\\d*),r@(\\d*)",Qt::CaseInsensitive);
if(reg.indexIn(html)!=-1)
{
QStringList gc=reg.capturedTexts();
......@@ -206,7 +210,6 @@ namespace core {
QString sec2 = ""; // after &zoom=...
GetSecGoogleWords(pos, sec1, sec2);
TryCorrectGoogleVersions();
return QString("https://%1%2.google.com/%3/v=%4&hl=%5&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleSatellite).arg(language).arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2);
}
break;
......@@ -230,7 +233,6 @@ namespace core {
QString sec2 = ""; // after &zoom=...
GetSecGoogleWords(pos, sec1, sec2);
TryCorrectGoogleVersions();
return QString("https://%1%2.google.com/%3/v=%4&hl=%5&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleTerrain).arg(language).arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2);
}
break;
......@@ -244,7 +246,7 @@ namespace core {
TryCorrectGoogleVersions();
// http://mt0.google.cn/vt/v=w2.101&hl=zh-CN&gl=cn&x=12&y=6&z=4&s=Ga
return QString("http://%1%2.google.cn/%3/lyrs=%4&hl=%5&gl=cn&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleMapChina).arg("zh-CN").arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2);
return QString("https://%1%2.google.cn/%3/lyrs=%4&hl=%5&gl=cn&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleMapChina).arg("zh-CN").arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2);
}
break;
case MapType::GoogleSatelliteChina:
......@@ -255,9 +257,9 @@ namespace core {
QString sec2 = ""; // after &zoom=...
GetSecGoogleWords(pos, sec1, sec2);
// TryCorrectGoogleVersions();
// http://khm0.google.cn/kh/v=46&x=12&y=6&z=4&s=Ga
// https://khm0.google.cn/kh/v=46&x=12&y=6&z=4&s=Ga
return QString("http://%1%2.google.cn/%3/lyrs=%4&gl=cn&x=%5%6&y=%7&z=%8&s=%9").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleSatelliteChina).arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2);
return QString("https://%1%2.google.cn/%3/lyrs=%4&gl=cn&x=%5%6&y=%7&z=%8&s=%9").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleSatelliteChina).arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2);
}
break;
case MapType::GoogleLabelsChina:
......@@ -270,7 +272,7 @@ namespace core {
TryCorrectGoogleVersions();
// http://mt0.google.cn/vt/v=w2t.110&hl=zh-CN&gl=cn&x=12&y=6&z=4&s=Ga
return QString("http://%1%2.google.cn/%3/imgtp=png32&lyrs=%4&hl=%5&gl=cn&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleLabelsChina).arg("zh-CN").arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2);
return QString("https://%1%2.google.cn/%3/imgtp=png32&lyrs=%4&hl=%5&gl=cn&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleLabelsChina).arg("zh-CN").arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2);
}
break;
case MapType::GoogleTerrainChina:
......@@ -284,7 +286,7 @@ namespace core {
// http://mt0.google.cn/vt/v=w2p.110&hl=zh-CN&gl=cn&x=12&y=6&z=4&s=Ga
return QString("http://%1%2.google.com/%3/lyrs=%4&hl=%5&gl=cn&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleTerrainChina).arg("zh-CN").arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2);
return QString("https://%1%2.google.com/%3/lyrs=%4&hl=%5&gl=cn&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleTerrainChina).arg("zh-CN").arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2);
}
break;
case MapType::GoogleMapKorea:
......@@ -311,7 +313,7 @@ namespace core {
// http://khm1.google.co.kr/kh/v=54&x=109&y=49&z=7&s=
return QString("http://%1%2.google.co.kr/%3/v=%4&x=%5%6&y=%7&z=%8&s=%9").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleSatelliteKorea).arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2);
return QString("https://%1%2.google.co.kr/%3/v=%4&x=%5%6&y=%7&z=%8&s=%9").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleSatelliteKorea).arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2);
}
break;
case MapType::GoogleLabelsKorea:
......@@ -502,12 +504,12 @@ namespace core {
QString UrlFactory::MakeGeocoderUrl(QString keywords)
{
QString key = keywords.replace(' ', '+');
return QString("http://maps.google.com/maps/geo?q=%1&output=csv&key=%2").arg(key).arg(GoogleMapsAPIKey);
return QString("https://maps.google.com/maps/geo?q=%1&output=csv&key=%2").arg(key).arg(GoogleMapsAPIKey);
}
QString UrlFactory::MakeReverseGeocoderUrl(internals::PointLatLng &pt,const QString &language)
{
return QString("http://maps.google.com/maps/geo?hl=%1&ll=%2,%3&output=csv&key=%4").arg(language).arg(QString::number(pt.Lat())).arg(QString::number(pt.Lng())).arg(GoogleMapsAPIKey);
return QString("https://maps.google.com/maps/geo?hl=%1&ll=%2,%3&output=csv&key=%4").arg(language).arg(QString::number(pt.Lat())).arg(QString::number(pt.Lng())).arg(GoogleMapsAPIKey);
}
internals::PointLatLng UrlFactory::GetLatLngFromGeodecoder(const QString &keywords, GeoCoderStatusCode::Types &status)
......
......@@ -61,6 +61,7 @@ namespace core {
Placemark GetPlacemarkFromGeocoder(internals::PointLatLng location);
int Timeout;
private:
int Random(int low, int high);
void GetSecGoogleWords(const core::Point &pos, QString &sec1, QString &sec2);