🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
解决耦合性的软件设计: 先上(结果)图: ![](https://box.kancloud.cn/50ebab2c1b85280acff0d1d84dfa1749_1122x996.png) 一例子: 由于 : hiredisHelper.h hiredishelper.cpp已经 封装为 类库…… 甚至 已经支持 Get 和 Set的 三目 运算 所以: 只上 监控 GPs系统的监控 代码: ``` // conShowdata_andmouse190111.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include "pch.h" #include <iostream> #include <windows.h> #include <string> #include"hiredishelper.h" int main() { PBLIB::Redis::hiredisUtility red001; std::string xstr = ""; std::string ystr = ""; std::string minLen3lines = ""; std::string oldx= xstr; std::string oldy = ystr; std::string oldminLen3lines; do {//do110 red001.Connect(1000); std::string flag1str="2"; int flag = -1; do { red001.Get("flag1", flag1str); red001.Get("x", xstr); red001.Get("y", ystr); red001.Get("minLen3lines", minLen3lines); if (oldminLen3lines==minLen3lines&& xstr == oldx&& oldy==ystr) { Sleep(100); } else { //red001.Get("x", xstr); // red001.Get("y", ystr); std::cout << "[x:" <<xstr; std::cout << "-y" << ystr << "],"; std::cout << "[minLen3lines:" << minLen3lines << "]; "; oldx = xstr; oldy = ystr; oldminLen3lines = minLen3lines; } } while ("1"== flag1str); system("pause"); } while (true);//do110while110 std::cout << "Hello World!\n"; } // 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 // 调试程序: F5 或调试 >“开始调试”菜单 // 入门提示: // 1. 使用解决方案资源管理器窗口添加/管理文件 // 2. 使用团队资源管理器窗口连接到源代码管理 // 3. 使用输出窗口查看生成输出和其他消息 // 4. 使用错误列表窗口查看错误 // 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 // 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 ```