第一次上传

This commit is contained in:
2025-08-20 23:06:28 +08:00
commit c0593df9e1
485 changed files with 533424 additions and 0 deletions

18
PublicFunctions/Basic.cpp Normal file
View File

@@ -0,0 +1,18 @@
#include "Basic.h"
/**
* @brief map 映射函数,把x的值,映射到out_min到out_max的范围内
* @param x 需要映射的值
* @param in_min x有可能的最小值
* @param in_max x有可能的最大值
* @param out_min 输出的最小值
* @param out_max 输出的最大值
* @return 映射结果
*/
M_d64 map(M_d64 x, M_d64 in_min, M_d64 in_max, M_d64 out_min, M_d64 out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
void Sleep(M_u16 msec){
QTime _Timer = QTime::currentTime().addMSecs(msec);
while( QTime::currentTime() < _Timer )
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}