From 1fbb9ffe51dce11129505c19cd7c4f56d2874b03 Mon Sep 17 00:00:00 2001 From: "XI.CHEN" <2311041011@qq.com> Date: Wed, 21 May 2025 11:59:07 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E7=BD=91=E7=BB=9C=E6=8B=8D=E7=85=A7?= =?UTF-8?q?=E5=9C=A8=E5=AD=90=E7=B1=BB=E6=9E=84=E9=80=A0=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E4=B8=AD=E8=B0=83=E7=94=A8updatetime"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1772027e9efa31a8bd13c2024b2d2afcb82a87b5. --- app/src/main/cpp/PhoneDevice.cpp | 5 +++++ app/src/main/cpp/netcamera/HangYuCtrl.cpp | 10 ---------- app/src/main/cpp/netcamera/HangYuCtrl.h | 2 +- app/src/main/cpp/netcamera/HikonCtrl.cpp | 10 ---------- app/src/main/cpp/netcamera/HikonCtrl.h | 2 +- app/src/main/cpp/netcamera/YuShiCtrl.cpp | 10 ---------- app/src/main/cpp/netcamera/YuShiCtrl.h | 3 +-- 7 files changed, 8 insertions(+), 34 deletions(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 3d431180..50c5b6b9 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -5267,5 +5267,10 @@ VendorCtrl* CPhoneDevice::MakeVendorCtrl(int vendor, uint8_t channel, const std: // Hang Yu - New vendorCtrl = new HangYuCtrl(ip, userName, password, channel, netHandle, syncTime); } + if (syncTime) + { + time_t ts = time(NULL); + vendorCtrl->UpdateTime(ts); + } return vendorCtrl; } diff --git a/app/src/main/cpp/netcamera/HangYuCtrl.cpp b/app/src/main/cpp/netcamera/HangYuCtrl.cpp index 5b096496..c852346f 100644 --- a/app/src/main/cpp/netcamera/HangYuCtrl.cpp +++ b/app/src/main/cpp/netcamera/HangYuCtrl.cpp @@ -12,16 +12,6 @@ #include #include -HangYuCtrl::HangYuCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime) - : VendorCtrl(ip, userName, password, channel, netHandle, syncTime) -{ - if (syncTime) - { - time_t ts = time(NULL); - UpdateTime(ts); - } -} - HangYuCtrl::~HangYuCtrl() { diff --git a/app/src/main/cpp/netcamera/HangYuCtrl.h b/app/src/main/cpp/netcamera/HangYuCtrl.h index 40196744..be5b2a84 100644 --- a/app/src/main/cpp/netcamera/HangYuCtrl.h +++ b/app/src/main/cpp/netcamera/HangYuCtrl.h @@ -10,7 +10,7 @@ class HangYuCtrl : public VendorCtrl { public: - HangYuCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime = true); + using VendorCtrl::VendorCtrl; virtual ~HangYuCtrl(); virtual bool SetOsd(uint8_t channel, std::string osd, uint8_t pos); diff --git a/app/src/main/cpp/netcamera/HikonCtrl.cpp b/app/src/main/cpp/netcamera/HikonCtrl.cpp index 5fb221c8..eaa194d5 100644 --- a/app/src/main/cpp/netcamera/HikonCtrl.cpp +++ b/app/src/main/cpp/netcamera/HikonCtrl.cpp @@ -12,16 +12,6 @@ #include #include -HikonCtrl::HikonCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime) - : VendorCtrl(ip, userName, password, channel, netHandle, syncTime) -{ - if (syncTime) - { - time_t ts = time(NULL); - UpdateTime(ts); - } -} - HikonCtrl::~HikonCtrl() { diff --git a/app/src/main/cpp/netcamera/HikonCtrl.h b/app/src/main/cpp/netcamera/HikonCtrl.h index 1f004221..0acb9d15 100644 --- a/app/src/main/cpp/netcamera/HikonCtrl.h +++ b/app/src/main/cpp/netcamera/HikonCtrl.h @@ -10,7 +10,7 @@ class HikonCtrl : public VendorCtrl { public: - HikonCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime = true); + using VendorCtrl::VendorCtrl; virtual ~HikonCtrl(); virtual bool SetOsd(uint8_t channel, std::string osd, uint8_t pos); diff --git a/app/src/main/cpp/netcamera/YuShiCtrl.cpp b/app/src/main/cpp/netcamera/YuShiCtrl.cpp index bcba3621..7b7f0df4 100644 --- a/app/src/main/cpp/netcamera/YuShiCtrl.cpp +++ b/app/src/main/cpp/netcamera/YuShiCtrl.cpp @@ -8,16 +8,6 @@ #include -YuShiCtrl::YuShiCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime) - : VendorCtrl(ip, userName, password, channel, netHandle, syncTime) -{ - if (syncTime) - { - time_t ts = time(NULL); - UpdateTime(ts); - } -} - YuShiCtrl::~YuShiCtrl() { diff --git a/app/src/main/cpp/netcamera/YuShiCtrl.h b/app/src/main/cpp/netcamera/YuShiCtrl.h index c334bf7b..dbc4c07a 100644 --- a/app/src/main/cpp/netcamera/YuShiCtrl.h +++ b/app/src/main/cpp/netcamera/YuShiCtrl.h @@ -10,8 +10,7 @@ class YuShiCtrl : public VendorCtrl { public: -// using VendorCtrl::VendorCtrl; - YuShiCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle, bool syncTime = true); + using VendorCtrl::VendorCtrl; virtual ~YuShiCtrl(); virtual bool SetOsd(uint8_t channel, std::string osd, uint8_t pos);