1、记录x马达位置用于拼接影像;
2、修复了航线读写错误问题;
This commit is contained in:
@ -121,3 +121,28 @@ QList<QString> getFileInfo(QString file)
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
long long getNanosecondsSinceMidnight()
|
||||
{
|
||||
// 获取当前系统时间
|
||||
auto now = std::chrono::system_clock::now();
|
||||
|
||||
// 转换为 time_t(秒级别的时间戳)
|
||||
std::time_t t = std::chrono::system_clock::to_time_t(now);
|
||||
std::tm local_tm = *std::localtime(&t); // 获取本地时间结构
|
||||
|
||||
// 将时间结构调整到当天 00:00:00
|
||||
local_tm.tm_hour = 0;
|
||||
local_tm.tm_min = 0;
|
||||
local_tm.tm_sec = 0;
|
||||
local_tm.tm_isdst = -1; // 让 mktime 自动判断夏令时
|
||||
|
||||
// 获取当天 00:00:00 的时间点
|
||||
auto midnight = std::chrono::system_clock::from_time_t(std::mktime(&local_tm));
|
||||
|
||||
// 计算从当天 00:00:00 到现在的时间差
|
||||
auto nanoseconds_since_midnight = std::chrono::duration_cast<std::chrono::nanoseconds>(now - midnight);
|
||||
|
||||
// 返回纳秒数
|
||||
return nanoseconds_since_midnight.count();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user