From 71f24468d2e4b80028258d5fa728fbc8a3e049f8 Mon Sep 17 00:00:00 2001 From: chen0088 Date: Thu, 16 Jun 2022 11:17:31 +0800 Subject: [PATCH 1/3] modify gps location Signed-off-by: chen0088 --- .../cameraoperator/client/src/dcamera_client.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp index 86e22ebd..8c4c6173 100644 --- a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp +++ b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp @@ -470,15 +470,19 @@ void DCameraClient::SetQualityAndGpsLocation(const std::shared_ptrSetGpsLocation(gpsCoordinates[0], gpsCoordinates[1]); + "gpsCoordinates[0]: %f, gpsCoordinates[1]: %f, gpsCoordinates[2]: %f", + GetAnonyString(cameraId_).c_str(), gpsCoordinates[0], gpsCoordinates[1], gpsCoordinates[2]); + std::unique_ptr location = std::make_unique(); + location->latitude = gpsCoordinates[0]; + location->longitude = gpsCoordinates[1]; + location->altitude = gpsCoordinates[2]; + photoCaptureSettings->SetLocation(location); } return; } -- Gitee From ed6aa79a2328337dd78141e2c4b359a2df193870 Mon Sep 17 00:00:00 2001 From: chen0088 Date: Fri, 17 Jun 2022 08:55:32 +0800 Subject: [PATCH 2/3] modify gps location Signed-off-by: chen0088 --- .../cameraoperator/client/src/dcamera_client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp index 8c4c6173..69b6ca18 100644 --- a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp +++ b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp @@ -477,11 +477,11 @@ void DCameraClient::SetQualityAndGpsLocation(const std::shared_ptr location = std::make_unique(); location->latitude = gpsCoordinates[0]; location->longitude = gpsCoordinates[1]; - location->altitude = gpsCoordinates[2]; + location->altitude = gpsCoordinates[2]; // 2:inedx photoCaptureSettings->SetLocation(location); } return; -- Gitee From 2004b72480362f39a2aa49acb048aa0ca4c8e3b7 Mon Sep 17 00:00:00 2001 From: chen0088 Date: Fri, 17 Jun 2022 16:51:34 +0800 Subject: [PATCH 3/3] modify gps location Signed-off-by: chen0088 --- .../cameraoperator/client/src/dcamera_client.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp index 69b6ca18..e2e8359f 100644 --- a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp +++ b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp @@ -31,6 +31,10 @@ namespace OHOS { namespace DistributedHardware { +const int32_t LATITUDE = 0; +const int32_t LONGITUDE = 1; +const int32_t ALTITUDE = 2; + DCameraClient::DCameraClient(const std::string& dhId) { DHLOGI("DCameraClient Constructor dhId: %s", GetAnonyString(dhId).c_str()); @@ -476,12 +480,13 @@ void DCameraClient::SetQualityAndGpsLocation(const std::shared_ptr location = std::make_unique(); - location->latitude = gpsCoordinates[0]; - location->longitude = gpsCoordinates[1]; - location->altitude = gpsCoordinates[2]; // 2:inedx + location->latitude = gpsCoordinates[LATITUDE]; + location->longitude = gpsCoordinates[LONGITUDE]; + location->altitude = gpsCoordinates[ALTITUDE]; photoCaptureSettings->SetLocation(location); } return; -- Gitee