增加日志

ptz
Matthew 3 months ago
parent 20aaed0bb2
commit 8fc0354f0c

@ -210,6 +210,10 @@ size_t GpioControl::TurnOn(const std::vector<int>& cmds)
m_locker.lock(); m_locker.lock();
for (it = cmds.cbegin(); it != cmds.cend(); ++it) for (it = cmds.cbegin(); it != cmds.cend(); ++it)
{ {
if (*it == 0)
{
continue;
}
param.cmd = *it; param.cmd = *it;
turnOnImpl(param); turnOnImpl(param);
} }

@ -507,6 +507,21 @@ public:
GpioControl::TurnOff(m_cmds, m_delayCloseTime); GpioControl::TurnOff(m_cmds, m_delayCloseTime);
} }
std::string GetStatus()
{
std::string result;
for (auto it = m_cmds.cbegin(); it != m_cmds.cend(); ++it)
{
if (*it == 0)
{
continue;
}
result += std::to_string(*it) + "=" + std::to_string(GpioControl::getInt(*it)) + " ";
}
return result;
}
protected: protected:
void TurnOn() void TurnOn()
{ {

@ -1556,7 +1556,10 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
if (netHandle == 0) if (netHandle == 0)
{ {
// timeout // timeout
XYLOG(XYLOG_SEVERITY_ERROR, "Ethernet not existing CH=%u PR=%X PHOTOID=%u", (uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, localPhotoInfo.photoId); std::string pwrStatus = powerCtrlPtr->GetStatus();
pwrStatus += ethernetPowerCtrl->GetStatus();
XYLOG(XYLOG_SEVERITY_ERROR, "Ethernet Not Existing CH=%u PR=%X PHOTOID=%u PWR:%s",
(uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, localPhotoInfo.photoId, pwrStatus.c_str());
TakePhotoCb(0, localPhotoInfo, "", 0); TakePhotoCb(0, localPhotoInfo, "", 0);
return false; return false;
} }

Loading…
Cancel
Save