chore.优化调试日志和调试宏

This commit is contained in:
MistEO
2022-01-04 15:15:49 +08:00
parent aacbc77953
commit 4f5cba41ff
15 changed files with 298 additions and 297 deletions

View File

@@ -5,7 +5,7 @@
asst::AbstractImageAnalyzer::AbstractImageAnalyzer(const cv::Mat image)
: m_image(image), m_roi(empty_rect_to_full(Rect(), image))
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
,
m_image_draw(image.clone())
#endif
@@ -15,7 +15,7 @@ asst::AbstractImageAnalyzer::AbstractImageAnalyzer(const cv::Mat image)
asst::AbstractImageAnalyzer::AbstractImageAnalyzer(const cv::Mat image, const Rect& roi)
: m_image(image),
m_roi(empty_rect_to_full(roi, image))
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
,
m_image_draw(image.clone())
#endif
@@ -26,7 +26,7 @@ asst::AbstractImageAnalyzer::AbstractImageAnalyzer(const cv::Mat image, const Re
void asst::AbstractImageAnalyzer::set_image(const cv::Mat image)
{
m_image = image;
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
m_image_draw = image.clone();
#endif
}

View File

@@ -34,7 +34,7 @@ namespace asst
cv::Mat m_image;
Rect m_roi;
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
cv::Mat m_image_draw;
#endif
};

View File

@@ -328,7 +328,7 @@ bool asst::Assistant::append_recruit(unsigned max_times, const std::vector<int>&
return true;
}
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
bool Assistant::append_debug()
{
LogTraceFunction;

View File

@@ -60,7 +60,7 @@ namespace asst
// 参数 use_expedited: 是否使用加急券
bool append_recruit(unsigned max_times, const std::vector<int>& select_level, const std::vector<int>& confirm_level, bool need_refresh, bool use_expedited);
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
// 调试用
bool append_debug();
#endif

View File

@@ -106,7 +106,7 @@ bool AsstCatchCustom(asst::Assistant* p_asst, const char* address)
bool AsstCatchFake(asst::Assistant* p_asst)
{
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
if (p_asst == nullptr) {
return false;
}
@@ -115,7 +115,7 @@ bool AsstCatchFake(asst::Assistant* p_asst)
#else
(void*)p_asst;
return false;
#endif // LOG_TRACE
#endif // ASST_DEBUG
}
bool ASSTAPI AsstAppendStartUp(asst::Assistant* p_asst)
@@ -257,9 +257,9 @@ bool AsstAppendDebug(asst::Assistant* p_asst)
if (p_asst == nullptr) {
return false;
}
#if LOG_TRACE
#if ASST_DEBUG
return p_asst->append_debug();
#else
return false;
#endif // LOG_TRACE
#endif // ASST_DEBUG
}

View File

@@ -65,7 +65,7 @@ bool asst::CreditShopImageAnalyzer::whether_to_buy_analyze()
continue;
}
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
cv::rectangle(m_image_draw, utils::make_rect<cv::Rect>(commodity), cv::Scalar(0, 0, 255), 2);
#endif
m_need_to_buy.emplace_back(commodity);
@@ -85,10 +85,10 @@ bool asst::CreditShopImageAnalyzer::sold_out_analyze()
for (const Rect& commodity : m_need_to_buy) {
sold_out_analyzer.set_roi(commodity);
if (sold_out_analyzer.analyze()) {
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
cv::rectangle(m_image_draw, utils::make_rect<cv::Rect>(commodity), cv::Scalar(0, 0, 255));
cv::putText(m_image_draw, "Sold Out", cv::Point(commodity.x, commodity.y), 1, 2, cv::Scalar(255, 0, 0));
#endif // LOG_TRACE
#endif // ASST_DEBUG
// 如果识别到了售罄,那这个商品就不用买了,跳过
continue;

View File

@@ -20,7 +20,7 @@ bool asst::InfrastClueVacancyImageAnalyzer::analyze()
}
Rect rect = analyzer.get_result().rect;
Log.trace("has", clue_vacancy, suffix);
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
cv::rectangle(m_image_draw, utils::make_rect<cv::Rect>(rect), cv::Scalar(0, 0, 255), 2);
cv::putText(m_image_draw, suffix, cv::Point(rect.x, rect.y + 1), 0, 1, cv::Scalar(0, 0, 255), 2);
#endif

View File

@@ -79,7 +79,7 @@ bool asst::InfrastFacilityImageAnalyzer::analyze()
continue;
}
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
cv::RNG rng(time(0));
cv::Scalar rand_color(rng.uniform(0, 255), rng.uniform(0, 255), rng.uniform(0, 255));
int index = 0;

View File

@@ -114,9 +114,9 @@ void asst::InfrastOperImageAnalyzer::oper_detect()
continue;
}
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
cv::rectangle(m_image_draw, utils::make_rect<cv::Rect>(smiley_rect), cv::Scalar(0, 0, 255), 2);
#endif // LOG_TRACE
#endif // ASST_DEBUG
infrast::Oper oper;
oper.smiley = smiley;
@@ -193,12 +193,12 @@ void asst::InfrastOperImageAnalyzer::mood_analyze()
// TODO这里的进度条长度算的并不是特别准属于能跑就行。有空再优化下
double ratio = static_cast<double>(max_white_length) / roi.width;
oper.mood_ratio = ratio;
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
cv::Point p1(roi.x, roi.y);
cv::Point p2(roi.x + max_white_length, roi.y);
cv::line(m_image_draw, p1, p2, cv::Scalar(0, 255, 0), 1);
cv::putText(m_image_draw, std::to_string(ratio), p1, 1, 1.0, cv::Scalar(0, 255, 0));
#endif // LOG_TRACE
#endif // ASST_DEBUG
}
}
@@ -307,7 +307,7 @@ void asst::InfrastOperImageAnalyzer::skill_analyze()
skill_rect.x += roi.x;
skill_rect.y += roi.y;
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
cv::rectangle(m_image_draw, utils::make_rect<cv::Rect>(skill_rect), cv::Scalar(0, 255, 0), 2);
#endif
@@ -370,7 +370,7 @@ void asst::InfrastOperImageAnalyzer::skill_analyze()
Log.trace(most_confident_skills.id, most_confident_skills.names.front());
std::string skill_id = most_confident_skills.id;
log_str += skill_id + " - " + most_confident_skills.names.front() + "; ";
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
cv::Mat skill_mat = m_image(utils::make_rect<cv::Rect>(skill_rect));
#endif
oper.skills.emplace(std::move(most_confident_skills));
@@ -437,7 +437,7 @@ void asst::InfrastOperImageAnalyzer::doing_analyze()
working_analyzer.set_roi(working_rect);
if (working_analyzer.analyze()) {
oper.doing = infrast::Doing::Working;
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
cv::putText(m_image_draw, "Working", cv::Point(working_rect.x, working_rect.y), 1, 1, cv::Scalar(0, 0, 255), 2);
#endif
}

View File

@@ -202,9 +202,7 @@ size_t asst::InfrastProductionTask::opers_detect()
[&cur_oper](const infrast::Oper& oper) -> bool {
// 有可能是同一个干员比一下hash
int dist = utils::hamming(cur_oper.face_hash, oper.face_hash);
#ifdef LOG_TRACE
Log.trace("opers_detect hash dist |", dist);
#endif
Log.debug("opers_detect hash dist |", dist);
return dist < m_face_hash_thres;
});
// 如果两个的hash距离过小则认为是同一个干员不进行插入
@@ -370,9 +368,7 @@ bool asst::InfrastProductionTask::optimal_calc()
if (!opt.possible_hashs.empty()) {
for (const auto& [key, hash] : opt.possible_hashs) {
int dist = utils::hamming(find_iter->name_hash, hash);
#ifdef LOG_TRACE
Log.trace("optimal_calc | name hash dist", dist, hash, find_iter->name_hash);
#endif
Log.debug("optimal_calc | name hash dist", dist, hash, find_iter->name_hash);
if (dist < m_name_hash_thres) {
hash_matched = true;
break;
@@ -498,9 +494,7 @@ bool asst::InfrastProductionTask::opers_choose()
// 既要技能相同也要hash相同双重校验
for (const auto& [_, hash] : opt_iter->possible_hashs) {
int dist = utils::hamming(lhs.name_hash, hash);
#ifdef LOG_TRACE
Log.trace("opers_choose | name hash dist", dist);
#endif
Log.debug("opers_choose | name hash dist", dist);
if (dist < m_name_hash_thres) {
return true;
}
@@ -529,9 +523,7 @@ bool asst::InfrastProductionTask::opers_choose()
m_all_available_opers.cbegin(), m_all_available_opers.cend(),
[&](const infrast::Oper& lhs) -> bool {
int dist = utils::hamming(lhs.face_hash, find_iter->face_hash);
#ifdef LOG_TRACE
Log.trace("opers_choose | face hash dist", dist);
#endif
Log.debug("opers_choose | face hash dist", dist);
if (dist < m_face_hash_thres) {
return true;
}

View File

@@ -17,7 +17,7 @@ namespace asst
{
m_uses_of_drones = std::move(uses_of_drones);
}
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
public:
#else
// 为了方便调试把这两个个接口拿到public来了

View File

@@ -27,7 +27,7 @@ bool asst::InfrastSmileyImageAnalyzer::analyze()
auto& res = mm_analyzer.get_result();
for (const MatchRect& mr : res) {
temp_result.emplace_back(infrast::Smiley{ type, mr.rect });
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
cv::rectangle(m_image_draw, utils::make_rect<cv::Rect>(mr.rect), cv::Scalar(0, 0, 255), 2);
#endif
}

View File

@@ -34,6 +34,15 @@ namespace asst
m_dirname = std::move(dirname);
}
template <typename... Args>
inline void debug([[maybe_unused]] Args&&... args)
{
#ifdef ASST_DEBUG
std::string_view level = "DEB";
log(level, std::forward<Args>(args)...);
#endif
}
template <typename... Args>
inline void trace(Args&&... args)
{
@@ -122,13 +131,13 @@ namespace asst
if (!m_ofs.is_open()) {
m_ofs = std::ofstream(m_log_filename, std::ios::out | std::ios::app);
}
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
stream_args(m_ofs, buff, args...);
#else
stream_args(m_ofs, buff, std::forward<Args>(args)...);
#endif
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
stream_args<true>(std::cout, buff, std::forward<Args>(args)...);
#endif
}

View File

@@ -1,260 +1,260 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="RelWithDebInfo|x64">
<Configuration>RelWithDebInfo</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\AsstCaller.h" />
<ClInclude Include="..\..\include\AsstPort.h" />
<ClInclude Include="AbstractConfiger.h" />
<ClInclude Include="AbstractImageAnalyzer.h" />
<ClInclude Include="AbstractResource.h" />
<ClInclude Include="AbstractTask.h" />
<ClInclude Include="Assistant.h" />
<ClInclude Include="AsstInfrastDef.h" />
<ClInclude Include="AsstUtils.hpp" />
<ClInclude Include="AsstDef.h" />
<ClInclude Include="AsstMsg.h" />
<ClInclude Include="AutoRecruitTask.h" />
<ClInclude Include="CreditShopImageAnalyzer.h" />
<ClInclude Include="GeneralConfiger.h" />
<ClInclude Include="CreditShoppingTask.h" />
<ClInclude Include="InfrastAbstractTask.h" />
<ClInclude Include="InfrastClueImageAnalyzer.h" />
<ClInclude Include="InfrastConfiger.h" />
<ClInclude Include="InfrastControlTask.h" />
<ClInclude Include="InfrastDormTask.h" />
<ClInclude Include="InfrastFacilityImageAnalyzer.h" />
<ClInclude Include="InfrastInfoTask.h" />
<ClInclude Include="InfrastMfgTask.h" />
<ClInclude Include="InfrastOfficeTask.h" />
<ClInclude Include="InfrastOperImageAnalyzer.h" />
<ClInclude Include="InfrastPowerTask.h" />
<ClInclude Include="InfrastProductionTask.h" />
<ClInclude Include="InfrastClueVacancyImageAnalyzer.h" />
<ClInclude Include="InfrastReceptionTask.h" />
<ClInclude Include="InfrastSmileyImageAnalyzer.h" />
<ClInclude Include="InfrastTradeTask.h" />
<ClInclude Include="MultiMatchImageAnalyzer.h" />
<ClInclude Include="OcrImageAnalyzer.h" />
<ClInclude Include="OcrPack.h" />
<ClInclude Include="PenguinPack.h" />
<ClInclude Include="RecruitImageAnalyzer.h" />
<ClInclude Include="AipOcr.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="ItemConfiger.h" />
<ClInclude Include="Logger.hpp" />
<ClInclude Include="RecruitTask.h" />
<ClInclude Include="PenguinUploader.h" />
<ClInclude Include="ProcessTask.h" />
<ClInclude Include="ProcessTaskImageAnalyzer.h" />
<ClInclude Include="RecruitConfiger.h" />
<ClInclude Include="RuntimeStatus.h" />
<ClInclude Include="TaskData.h" />
<ClInclude Include="MatchImageAnalyzer.h" />
<ClInclude Include="TemplResource.h" />
<ClInclude Include="UserConfiger.h" />
<ClInclude Include="Version.h" />
<ClInclude Include="Controller.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AbstractConfiger.cpp" />
<ClCompile Include="AbstractImageAnalyzer.cpp" />
<ClCompile Include="AbstractResource.cpp" />
<ClCompile Include="AbstractTask.cpp" />
<ClCompile Include="AutoRecruitTask.cpp" />
<ClCompile Include="CreditShopImageAnalyzer.cpp" />
<ClCompile Include="CreditShoppingTask.cpp" />
<ClCompile Include="InfrastAbstractTask.cpp" />
<ClCompile Include="InfrastClueImageAnalyzer.cpp" />
<ClCompile Include="InfrastConfiger.cpp" />
<ClCompile Include="InfrastControlTask.cpp" />
<ClCompile Include="InfrastDormTask.cpp" />
<ClCompile Include="InfrastFacilityImageAnalyzer.cpp" />
<ClCompile Include="InfrastInfoTask.cpp" />
<ClCompile Include="InfrastMfgTask.cpp" />
<ClCompile Include="InfrastOfficeTask.cpp" />
<ClCompile Include="InfrastOperImageAnalyzer.cpp" />
<ClCompile Include="InfrastPowerTask.cpp" />
<ClCompile Include="InfrastProductionTask.cpp" />
<ClCompile Include="InfrastClueVacancyImageAnalyzer.cpp" />
<ClCompile Include="InfrastReceptionTask.cpp" />
<ClCompile Include="InfrastSmileyImageAnalyzer.cpp" />
<ClCompile Include="InfrastTradeTask.cpp" />
<ClCompile Include="MultiMatchImageAnalyzer.cpp" />
<ClCompile Include="OcrImageAnalyzer.cpp" />
<ClCompile Include="OcrPack.cpp" />
<ClCompile Include="PenguinPack.cpp" />
<ClCompile Include="RecruitImageAnalyzer.cpp" />
<ClCompile Include="AipOcr.cpp" />
<ClCompile Include="Resource.cpp" />
<ClCompile Include="Assistant.cpp" />
<ClCompile Include="AsstCaller.cpp" />
<ClCompile Include="GeneralConfiger.cpp" />
<ClCompile Include="ItemConfiger.cpp" />
<ClCompile Include="RecruitTask.cpp" />
<ClCompile Include="PenguinUploader.cpp" />
<ClCompile Include="ProcessTask.cpp" />
<ClCompile Include="ProcessTaskImageAnalyzer.cpp" />
<ClCompile Include="RecruitConfiger.cpp" />
<ClCompile Include="RuntimeStatus.cpp" />
<ClCompile Include="TaskData.cpp" />
<ClCompile Include="MatchImageAnalyzer.cpp" />
<ClCompile Include="TemplResource.cpp" />
<ClCompile Include="UserConfiger.cpp" />
<ClCompile Include="Controller.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\resource\config.json" />
<None Include="..\..\resource\infrast.json" />
<None Include="..\..\resource\tasks.json" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{362d1e30-f5ae-4279-9985-65c27b3ba300}</ProjectGuid>
<RootNamespace>MeoAssistant</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)include;$(SolutionDir)3rdparty\include;$(IncludePath)</IncludePath>
<LibraryPath>$(TargetDir);$(SolutionDir)\3rdparty\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)include;$(SolutionDir)3rdparty\include;$(IncludePath)</IncludePath>
<LibraryPath>$(TargetDir);$(SolutionDir)\3rdparty\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;ASST_DLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<Optimization>MaxSpeed</Optimization>
<AdditionalOptions>/utf-8 /MP %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>meojson.lib;ppocr.lib;opencv_world453.lib;penguin-stats-recognize.lib;zlibstatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<Profile>true</Profile>
</Link>
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<PostBuildEvent>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="RelWithDebInfo|x64">
<Configuration>RelWithDebInfo</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\AsstCaller.h" />
<ClInclude Include="..\..\include\AsstPort.h" />
<ClInclude Include="AbstractConfiger.h" />
<ClInclude Include="AbstractImageAnalyzer.h" />
<ClInclude Include="AbstractResource.h" />
<ClInclude Include="AbstractTask.h" />
<ClInclude Include="Assistant.h" />
<ClInclude Include="AsstInfrastDef.h" />
<ClInclude Include="AsstUtils.hpp" />
<ClInclude Include="AsstDef.h" />
<ClInclude Include="AsstMsg.h" />
<ClInclude Include="AutoRecruitTask.h" />
<ClInclude Include="CreditShopImageAnalyzer.h" />
<ClInclude Include="GeneralConfiger.h" />
<ClInclude Include="CreditShoppingTask.h" />
<ClInclude Include="InfrastAbstractTask.h" />
<ClInclude Include="InfrastClueImageAnalyzer.h" />
<ClInclude Include="InfrastConfiger.h" />
<ClInclude Include="InfrastControlTask.h" />
<ClInclude Include="InfrastDormTask.h" />
<ClInclude Include="InfrastFacilityImageAnalyzer.h" />
<ClInclude Include="InfrastInfoTask.h" />
<ClInclude Include="InfrastMfgTask.h" />
<ClInclude Include="InfrastOfficeTask.h" />
<ClInclude Include="InfrastOperImageAnalyzer.h" />
<ClInclude Include="InfrastPowerTask.h" />
<ClInclude Include="InfrastProductionTask.h" />
<ClInclude Include="InfrastClueVacancyImageAnalyzer.h" />
<ClInclude Include="InfrastReceptionTask.h" />
<ClInclude Include="InfrastSmileyImageAnalyzer.h" />
<ClInclude Include="InfrastTradeTask.h" />
<ClInclude Include="MultiMatchImageAnalyzer.h" />
<ClInclude Include="OcrImageAnalyzer.h" />
<ClInclude Include="OcrPack.h" />
<ClInclude Include="PenguinPack.h" />
<ClInclude Include="RecruitImageAnalyzer.h" />
<ClInclude Include="AipOcr.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="ItemConfiger.h" />
<ClInclude Include="Logger.hpp" />
<ClInclude Include="RecruitTask.h" />
<ClInclude Include="PenguinUploader.h" />
<ClInclude Include="ProcessTask.h" />
<ClInclude Include="ProcessTaskImageAnalyzer.h" />
<ClInclude Include="RecruitConfiger.h" />
<ClInclude Include="RuntimeStatus.h" />
<ClInclude Include="TaskData.h" />
<ClInclude Include="MatchImageAnalyzer.h" />
<ClInclude Include="TemplResource.h" />
<ClInclude Include="UserConfiger.h" />
<ClInclude Include="Version.h" />
<ClInclude Include="Controller.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AbstractConfiger.cpp" />
<ClCompile Include="AbstractImageAnalyzer.cpp" />
<ClCompile Include="AbstractResource.cpp" />
<ClCompile Include="AbstractTask.cpp" />
<ClCompile Include="AutoRecruitTask.cpp" />
<ClCompile Include="CreditShopImageAnalyzer.cpp" />
<ClCompile Include="CreditShoppingTask.cpp" />
<ClCompile Include="InfrastAbstractTask.cpp" />
<ClCompile Include="InfrastClueImageAnalyzer.cpp" />
<ClCompile Include="InfrastConfiger.cpp" />
<ClCompile Include="InfrastControlTask.cpp" />
<ClCompile Include="InfrastDormTask.cpp" />
<ClCompile Include="InfrastFacilityImageAnalyzer.cpp" />
<ClCompile Include="InfrastInfoTask.cpp" />
<ClCompile Include="InfrastMfgTask.cpp" />
<ClCompile Include="InfrastOfficeTask.cpp" />
<ClCompile Include="InfrastOperImageAnalyzer.cpp" />
<ClCompile Include="InfrastPowerTask.cpp" />
<ClCompile Include="InfrastProductionTask.cpp" />
<ClCompile Include="InfrastClueVacancyImageAnalyzer.cpp" />
<ClCompile Include="InfrastReceptionTask.cpp" />
<ClCompile Include="InfrastSmileyImageAnalyzer.cpp" />
<ClCompile Include="InfrastTradeTask.cpp" />
<ClCompile Include="MultiMatchImageAnalyzer.cpp" />
<ClCompile Include="OcrImageAnalyzer.cpp" />
<ClCompile Include="OcrPack.cpp" />
<ClCompile Include="PenguinPack.cpp" />
<ClCompile Include="RecruitImageAnalyzer.cpp" />
<ClCompile Include="AipOcr.cpp" />
<ClCompile Include="Resource.cpp" />
<ClCompile Include="Assistant.cpp" />
<ClCompile Include="AsstCaller.cpp" />
<ClCompile Include="GeneralConfiger.cpp" />
<ClCompile Include="ItemConfiger.cpp" />
<ClCompile Include="RecruitTask.cpp" />
<ClCompile Include="PenguinUploader.cpp" />
<ClCompile Include="ProcessTask.cpp" />
<ClCompile Include="ProcessTaskImageAnalyzer.cpp" />
<ClCompile Include="RecruitConfiger.cpp" />
<ClCompile Include="RuntimeStatus.cpp" />
<ClCompile Include="TaskData.cpp" />
<ClCompile Include="MatchImageAnalyzer.cpp" />
<ClCompile Include="TemplResource.cpp" />
<ClCompile Include="UserConfiger.cpp" />
<ClCompile Include="Controller.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\resource\config.json" />
<None Include="..\..\resource\infrast.json" />
<None Include="..\..\resource\tasks.json" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{362d1e30-f5ae-4279-9985-65c27b3ba300}</ProjectGuid>
<RootNamespace>MeoAssistant</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)include;$(SolutionDir)3rdparty\include;$(IncludePath)</IncludePath>
<LibraryPath>$(TargetDir);$(SolutionDir)\3rdparty\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)include;$(SolutionDir)3rdparty\include;$(IncludePath)</IncludePath>
<LibraryPath>$(TargetDir);$(SolutionDir)\3rdparty\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;ASST_DLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<Optimization>MaxSpeed</Optimization>
<AdditionalOptions>/utf-8 /MP %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>meojson.lib;ppocr.lib;opencv_world453.lib;penguin-stats-recognize.lib;zlibstatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<Profile>true</Profile>
</Link>
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>xcopy /e /y /i /c $(SolutionDir)resource $(TargetDir)resource
xcopy /e /y /i /c $(SolutionDir)3rdparty\resource $(TargetDir)resource</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>copy resource</Message>
</PostBuildEvent>
<PreLinkEvent>
<Command>xcopy /e /y /i /c $(SolutionDir)3rdparty\bin $(TargetDir)</Command>
</PreLinkEvent>
<PreLinkEvent>
<Message>copy 3rd party dll</Message>
</PreLinkEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<FunctionLevelLinking>
</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;ASST_DLL_EXPORTS;LOG_TRACE;DEBUG_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<Optimization>Disabled</Optimization>
<WholeProgramOptimization>true</WholeProgramOptimization>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<AdditionalOptions>/utf-8 /MP %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>meojson.lib;ppocr.lib;opencv_world453.lib;penguin-stats-recognize.lib;zlibstatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<Profile>true</Profile>
</Link>
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<PostBuildEvent>
xcopy /e /y /i /c $(SolutionDir)3rdparty\resource $(TargetDir)resource</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>copy resource</Message>
</PostBuildEvent>
<PreLinkEvent>
<Command>xcopy /e /y /i /c $(SolutionDir)3rdparty\bin $(TargetDir)</Command>
</PreLinkEvent>
<PreLinkEvent>
<Message>copy 3rd party dll</Message>
</PreLinkEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<FunctionLevelLinking>
</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;ASST_DLL_EXPORTS;ASST_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<Optimization>Disabled</Optimization>
<WholeProgramOptimization>true</WholeProgramOptimization>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<AdditionalOptions>/utf-8 /MP %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>meojson.lib;ppocr.lib;opencv_world453.lib;penguin-stats-recognize.lib;zlibstatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<Profile>true</Profile>
</Link>
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>xcopy /e /y /i /c $(SolutionDir)resource $(TargetDir)resource
xcopy /e /y /i /c $(SolutionDir)3rdparty\resource $(TargetDir)resource</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>copy resource</Message>
</PostBuildEvent>
<PreLinkEvent>
<Command>xcopy /e /y /i /c $(SolutionDir)3rdparty\bin $(TargetDir)</Command>
</PreLinkEvent>
<PreLinkEvent>
<Message>copy 3rd party dll</Message>
</PreLinkEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties />
</VisualStudio>
</ProjectExtensions>
xcopy /e /y /i /c $(SolutionDir)3rdparty\resource $(TargetDir)resource</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>copy resource</Message>
</PostBuildEvent>
<PreLinkEvent>
<Command>xcopy /e /y /i /c $(SolutionDir)3rdparty\bin $(TargetDir)</Command>
</PreLinkEvent>
<PreLinkEvent>
<Message>copy 3rd party dll</Message>
</PreLinkEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties />
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@@ -161,7 +161,7 @@ bool asst::TaskData::parse(const json::value& json)
int y = area_arr[1].as_integer();
int width = area_arr[2].as_integer();
int height = area_arr[3].as_integer();
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
if (x + width > WindowWidthDefault || y + height > WindowHeightDefault) {
m_last_error = name + " roi is out of bounds";
return false;
@@ -192,7 +192,7 @@ bool asst::TaskData::parse(const json::value& json)
m_all_tasks_info.emplace(name, task_info_ptr);
}
#ifdef LOG_TRACE
#ifdef ASST_DEBUG
for (const auto& [name, task] : m_all_tasks_info) {
for (const auto& next : task->next) {
if (m_all_tasks_info.find(next) == m_all_tasks_info.cend()) {