commit b5fbaa9db5ad4795b5c7800fb2b09531259c1bd7 Author: Sherlock Date: Sat Aug 23 15:15:57 2025 +0800 笔记 diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 0000000..7103c2a --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1,11 @@ +{ + "promptDelete": false, + "readableLineLength": false, + "showLineNumber": false, + "pdfExportSettings": { + "pageSize": "Letter", + "landscape": false, + "margin": "0", + "downscalePercent": 100 + } +} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 0000000..7b7faab --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1,4 @@ +{ + "accentColor": "", + "baseFontSize": 17 +} \ No newline at end of file diff --git a/.obsidian/core-plugins-migration.json b/.obsidian/core-plugins-migration.json new file mode 100644 index 0000000..436f43c --- /dev/null +++ b/.obsidian/core-plugins-migration.json @@ -0,0 +1,30 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "properties": false, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": false +} \ No newline at end of file diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json new file mode 100644 index 0000000..8e719d8 --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,33 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "properties": false, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": false, + "webviewer": false, + "footnotes": false, + "bases": true +} \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json new file mode 100644 index 0000000..42a46ec --- /dev/null +++ b/.obsidian/graph.json @@ -0,0 +1,22 @@ +{ + "collapse-filter": true, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": false, + "showOrphans": true, + "collapse-color-groups": true, + "colorGroups": [], + "collapse-display": true, + "showArrow": false, + "textFadeMultiplier": 0, + "nodeSizeMultiplier": 1, + "lineSizeMultiplier": 1, + "collapse-forces": true, + "centerStrength": 0.518713248970312, + "repelStrength": 10, + "linkStrength": 1, + "linkDistance": 250, + "scale": 1, + "close": true +} \ No newline at end of file diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json new file mode 100644 index 0000000..a5905ec --- /dev/null +++ b/.obsidian/workspace.json @@ -0,0 +1,234 @@ +{ + "main": { + "id": "1bd807fe88ca9c64", + "type": "split", + "children": [ + { + "id": "ef2347a8bf0ceb3e", + "type": "tabs", + "children": [ + { + "id": "bbf91c3bb75b1c93", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "笔记/虚拟机.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "虚拟机" + } + }, + { + "id": "e9cad7149d0fefbb", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "2025-08-18.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "2025-08-18" + } + } + ], + "currentTab": 1 + } + ], + "direction": "vertical" + }, + "left": { + "id": "217021656a2d4ef1", + "type": "split", + "children": [ + { + "id": "e02fff6c919759d7", + "type": "tabs", + "children": [ + { + "id": "e525954af0620c48", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": { + "sortOrder": "byCreatedTimeReverse", + "autoReveal": false + }, + "icon": "lucide-folder-closed", + "title": "文件列表" + } + }, + { + "id": "62dd24b8a8a70ab7", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + }, + "icon": "lucide-search", + "title": "搜索" + } + }, + { + "id": "9b362e25f8ed6774", + "type": "leaf", + "state": { + "type": "bookmarks", + "state": {}, + "icon": "lucide-bookmark", + "title": "书签" + } + } + ] + } + ], + "direction": "horizontal", + "width": 200 + }, + "right": { + "id": "13b77209034da81b", + "type": "split", + "children": [ + { + "id": "352dc70db312daae", + "type": "tabs", + "children": [ + { + "id": "5ba8111adcdcfb3e", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "file": "笔记/C++.md", + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-coming-in", + "title": "C++ 的反向链接列表" + } + }, + { + "id": "728bc10f6e28d4b5", + "type": "leaf", + "state": { + "type": "outgoing-link", + "state": { + "file": "笔记/GitHub.md", + "linksCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-going-out", + "title": "GitHub 的出链列表" + } + }, + { + "id": "60bfefdbf806c829", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": true + }, + "icon": "lucide-tags", + "title": "标签" + } + }, + { + "id": "557e1a76595e2bd2", + "type": "leaf", + "state": { + "type": "outline", + "state": { + "file": "2025-08-18.md", + "followCursor": true, + "showSearch": true, + "searchQuery": "" + }, + "icon": "lucide-list", + "title": "2025-08-18 的大纲" + } + } + ], + "currentTab": 3 + } + ], + "direction": "horizontal", + "width": 200 + }, + "left-ribbon": { + "hiddenItems": { + "bases:创建新数据库": false, + "switcher:打开快速切换": false, + "graph:查看关系图谱": false, + "canvas:新建白板": false, + "daily-notes:打开/创建今天的日记": false, + "templates:插入模板": false, + "command-palette:打开命令面板": false + } + }, + "active": "e9cad7149d0fefbb", + "lastOpenFiles": [ + "未命名 2.base", + "Linux.md", + "未命名 1.base", + "未命名.base", + "调试指令/高轨dg终端入网.md", + "2025-08-18.md", + "boost.md", + "笔记/虚拟机.md", + "笔记/C++.md", + "串口.md", + "开启网口.md", + "rbnet.ko 模块.md", + "红黑隔离测试.md", + "密态入网.md", + "笔记/CMakeLists-Qt.md", + "调试指令/AP.md", + "调试指令/CP.md", + "调试指令/AT指令.md", + "调试指令/891入网AT指令.md", + "操作指南.md", + "笔记/CMakeLists.md", + "Pasted image 20250528144119.png", + "Pasted image 20250528144112.png", + "未命名.canvas", + "2025-08-01.md", + "任务/XW测试任务.md", + "调试指令", + "日志读取小程序/未命名 1.md", + "项目/HH态CP控制小程序.md", + "项目", + "笔记/QT.md", + "任务/图片", + "任务", + "笔记/GitHub.md", + "func.md", + "Pasted image 20250213171955.png", + "Pasted image 20250213092216.png", + "Pasted image 20250213094931.png", + "~$第5章(3课时)已更新.ppt", + "~$第2章(2课时)已更新.ppt", + "笔记", + "QT/图片/7941646ae9f8aeb7212bf21961ac0b79_.png", + "QT/图片/ce35786fa07e588a9538c0dad8daf521_.png", + "QT/图片/016cf2ec99554101094703fbf2d0c6ee_.png", + "QT/图片/298e44ff81e6f5da424ed5794b746193_.png", + "QT/图片/9880bbadba9f47a4f5ea039bf6a5c589_.png" + ] +} \ No newline at end of file diff --git a/027d147db3a0ebe921fd9ad2e9664076_115f7bca329ae801314a770f5d12bdaa_8.zip b/027d147db3a0ebe921fd9ad2e9664076_115f7bca329ae801314a770f5d12bdaa_8.zip new file mode 100644 index 0000000..dbf43f6 Binary files /dev/null and b/027d147db3a0ebe921fd9ad2e9664076_115f7bca329ae801314a770f5d12bdaa_8.zip differ diff --git a/2025-08-18.md b/2025-08-18.md new file mode 100644 index 0000000..f85ccd0 --- /dev/null +++ b/2025-08-18.md @@ -0,0 +1,28 @@ +石家庄西区高轨在轨测试 +cp版本:v1.5 +发送AT指令 + AT^PSTM=4 + AT^STOREFREQXW=1,1610016,0 + at+cfun=1 +频谱仪无法使用,将下行接到原型机上,原型机显示有信号 + + +7E 00 46 +83 +20 02 00 00 +35 01 00 +34 07 00 2A DD 0C CC 00 00 +5A 02 00 00 +52 02 00 05 +53 02 00 05 +54 02 00 28 +55 02 02 EE +56 04 00 00 00 0A +09 01 01 +0B 01 05 +46 07 4C 4C 01 0B 01 0B 1E +47 01 72 +48 01 3F +49 01 73 +4A 01 3F +ED 7E \ No newline at end of file diff --git a/9bfbc9579e6bae78e3887c20a924a060_a82e3bb329e4a61e49d2ee60c669447a_8 1.zip b/9bfbc9579e6bae78e3887c20a924a060_a82e3bb329e4a61e49d2ee60c669447a_8 1.zip new file mode 100644 index 0000000..18f840a Binary files /dev/null and b/9bfbc9579e6bae78e3887c20a924a060_a82e3bb329e4a61e49d2ee60c669447a_8 1.zip differ diff --git a/9bfbc9579e6bae78e3887c20a924a060_a82e3bb329e4a61e49d2ee60c669447a_8.zip b/9bfbc9579e6bae78e3887c20a924a060_a82e3bb329e4a61e49d2ee60c669447a_8.zip new file mode 100644 index 0000000..18f840a Binary files /dev/null and b/9bfbc9579e6bae78e3887c20a924a060_a82e3bb329e4a61e49d2ee60c669447a_8.zip differ diff --git a/C/cmath.md b/C/cmath.md new file mode 100644 index 0000000..bdc9253 --- /dev/null +++ b/C/cmath.md @@ -0,0 +1,29 @@ +#include "cmath" +基础数学运算 + sqrt(x): 计算 x 的平方根。 + pow(x, y): 计算 x 的 y 次幂。 + exp(x): 计算 e 的 x 次幂 (e 是自然对数的底)。 + log(x): 计算 x 的自然对数。 + log10(x): 计算 x 的以 10 为底的对数。 +三角函数 + sin(x): 计算 x 弧度的正弦值。 + cos(x): 计算 x 弧度的余弦值。 + tan(x): 计算 x 弧度的正切值。 + asin(x): 计算 x 的反正弦值,结果在 -pi/2 到 pi/2 弧度范围内。 + acos(x): 计算 x 的反余弦值,结果在 0 到 pi 弧度范围内。 + atan(x): 计算 x 的反正切值,结果在 -pi/2 到 pi/2 弧度范围内。 +双曲函数 + sinh(x): 计算 x 的双曲正弦值。 + cosh(x): 计算 x 的双曲余弦值。 + tanh(x): 计算 x 的双曲正切值。 +取整和舍入 + floor(x): 返回不大于 x 的最大整数。 + ceil(x): 返回不小于 x 的最小整数。 + round(x): 四舍五入到最近的整数。 + trunc(x): 舍去 x 的小数部分,返回整数部分。 +绝对值与符号 + abs(x): 计算 x 的绝对值。对于整型和浮点型有不同的重载版本。 + copysign(x, y): 返回 x 的值但带有 y 的符号。 +其他 + fmod(x, y): 计算 x 除以 y 的浮点余数。 + modf(x, &intpart): 将 x 分解为整数和小数部分,整数部分通过指针返回。 \ No newline at end of file diff --git a/C/代码.md b/C/代码.md new file mode 100644 index 0000000..fbcf071 --- /dev/null +++ b/C/代码.md @@ -0,0 +1,5 @@ +`system("chcp 65001")` +`setbuf(stdout, NULL)` 解决Clion内置控制台debug时不显示打印的问题 +`QT_ASSUME_STDERR_HAS_CONSOLE=1` Clion调试显示qDebug +在对应目录下 + `windeployqt ${NAME}` 生成所需库 diff --git a/C/叫号系统.md b/C/叫号系统.md new file mode 100644 index 0000000..3425cf8 --- /dev/null +++ b/C/叫号系统.md @@ -0,0 +1,13 @@ +简化版:排队叫号系统=1天 + +功能1:取号 + 取号:新客户到现场,输入姓名,生成号码并显示排队信息:排队号,姓名,当前号码前面等待人数。 +号码生成: + 排队号码:一位字母A+3位数字。例如:A001。每次客户取号递增1。 +功能2:叫号 + 银行工作人员选择叫号,显示当前待办客户的排队号、排队总人数。 + 如果客户未到,工作人员再次叫号,总共3次机会,3次之后呼叫下一位客户。 +功能3:取消排队 +某位客户可以取消自己的排队。取消排队后,在叫号时就不再呼叫该客户。 +功能4: +显示当前排队情况:当前正在排队的人数,排队信息(每个人的姓名) \ No newline at end of file diff --git a/C/快捷键.md b/C/快捷键.md new file mode 100644 index 0000000..e69de29 diff --git a/C/指针练习.md b/C/指针练习.md new file mode 100644 index 0000000..c5d36dd --- /dev/null +++ b/C/指针练习.md @@ -0,0 +1,70 @@ +1.指针-判定子串 +编写一个程序,判定一个字符串是否是另一个字符串的子串,若是,则返回子串在主串中的位置。要求不能使用系统函数。 + +2.指针-删除字符 +编写一个函数,删除一个字符串中的指定字符,函数原型:Void delStr(char str,char ch) + +3.指针-数组移动元素 +编写一个程序, 输入一个整形数组array,将该数组的最后一个元素移到第0个位置,其它元素后移一个位置。在main中将该数组输出。不要定义辅助数组。 + +4.指针-数组交换元素 +从键盘上输入10个整数存放到一维数组中,将其中最小的数与第一个数对换,最大的数与最后一个数对换。要求进行数据交换的处理过程编写成一个函数,函数中对数据的处理要用指针方法实现。输入数据为:35,20,94,-23,39,-56,100,87,49,12. + +5.指针-移动字符串内容 +编写一个函数,函数的功能是移动字符串中的内容。移动的规则如下:把第1到第m个字符,平移到字符串的最后;再把第m+1到最后的字符移动到字符串的前部。例如,字符串中原由的内容为:ABCDEFGHIJK,m的值为3,则移动后,字符串中的内容应该是DEFGHIJKABC。在主函数中输入一个长度不大于20的字符串和平移的值m,调用函数完成字符串的平移。要求用指针方法处理字符串。 + +6.指针-字符串复制 +输入一个长度不大于30的字符串,将此字符串中从第m个字符开始的剩余全部字符复制成为另一个字符串,并将这个新字符串输出。要求用指针方法处理字符串。 + +7.数组或指针-移动元素 +将一个5x5的矩阵中最大的元素放在中心,4个角分别放4个最小的元素(顺序为从左到右,从上到下依次从小到大存放),写一函数实现之。用main函数调用 + +8.指针-复制部分字符串 +有一个字符串,包含n个字符。写一函数,将此字符串中从第m个字符开始的全部字符复制成为另一个字符串;(复制操作在子函数中实现,并用指针传递); + +9.数组和指针-排序 +编写一个程序,在主函数中建立数组并输入n个数,调用自定义函数对这n个数进行排序,然后显示排序的结果。(要求用指针作为函数参数进行传递) + +10.指针-查找集合中的字符 +请编写函数,在一个字符串中进行搜索,查找所有在一个给定字符集合中出现的字符。 +接口如下: char find_char (char const source, char const * chars) +例如souce = “ABCDEF”, chars = "XYZ"或者"JURY"就返回NULL +如果chars = “XRCQEF” 返回指向C字符的指针 + +11.指针-删除子串 +编写函数,删除字符串的一部分,如果substr是str的子串,就删除掉str中substr部分 +例如str = “ABCDEFG” substr=“CDE” 那么删除后str="ABFG"并且函数返回1 +如果不是子串,就不修改str,函数返回-1 +int del_substr(char str, char const substr) + +12.指针-字符替换 +编制一个字符替换函数,实现将已知字符串str中,所有ch指定的字符都用ch2指定的字符代替。函数原型:void replace (char str,char ch,char ch2) + +13.指针-比较字符串 +自己编写一个函数,比较两个字符串是否相等,函数原型为:int Compare (char str1, char str2) + +14***.指针-使用指针判断回文数*** +一个正数如果顺着和反过来都是一样的(比如12321,反过来也是12321),那么就称为回文数。回文数不能以0开头,回文数从1开始。使用指针实现回文数判断。 + +15.指针-找出最大的字符串 +用指针法编程,从键盘上输入多个字符串(每个串不超过5个字符且没有空格),用””作为输入结束的标记。从所输入的若干字符串中,找出一个最大的串,并输出该串。要求串的输入以及最大串的查找通过调用编写的函数实现。 + +16.数组-报数出圈 +有n个人围成一圈,顺序排号。从第1个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来第几号的那位。 + +17.数组-使用函数输出一个整数的逆序数 + +18.循环或递归-皮球掉落 +皮球从某给定高度自由落下,触地后反弹到原高度的一半,再落下,再反弹,……,如此反复。问皮球在第n次落地时,在空中一共经过多少距离?第n次反弹的高度是多少? + +19.指针-指向函数的指针 +用函数和指针完成下述程序功能:有两个整数a和b,由用户输入1,2或3。如输入1,程序就给出a和b中大者,输入2,就给出a和b中小者,输入3,则求a与b之和。 + +练习20.1 +输入一个整数n,定义一个长度为n的动态数组,输入n个数字,输出这n个数中仅出现一次的数。 +例如:输入 12 36 72 36 87 99 87 12 35 12 + 输出 72 99 35 + +练习20.2 +输入一个整数n,定义一个长度为n的动态数组,输入n个数字,去掉其中最大的2个数和最小的2个数,求剩余数据的平均值 + diff --git a/C/练习3.md b/C/练习3.md new file mode 100644 index 0000000..4dcd924 --- /dev/null +++ b/C/练习3.md @@ -0,0 +1,61 @@ +练习4-1: +某种聊天工具,每个好友的id都是唯一的,当用户接收到信息后,如果会话窗口之前没有与该好友的聊天信息,则在通信列表里,会将新 +接收的消息的好友id置顶,如果会话窗口中已有与该好友的聊天信息,则将该好友的id移动到通讯列表的顶端。请根据要求实现该功能。 +输入:第一行为整数N,代表有N组测试数据,接下来的N组测试中,第一行为整数T,代表有T条通讯,第二行有T个整数,按时间先后顺序表示接收到讯息的好友id。 +输出:按照通讯列表从上到下的顺序输出好友id,每个id以空格分隔。 +注:只支持一组测试数据即可。 +样例输入: 样例输出: +![[3a02555e24cab50917acb282f461237.png]]![[7a0aa8773d0a7158d0f5105b1af598d.png]] + +练习4-3: +有两组数据分别是{10,15,2,8,22,11}、{1,5,10,22,4,8,33,6},将这两组数据分别存储在list容器中,并将两个链表合并,合并之后删除重复 +元素,对链表中的值从小到大排序。 + +练习4-6 +假设一个算术表达式中可以包含三种符号:圆括号“(”和“)”、方括号“[” +和“]”、花括号“{”和“}”,且这三种括号可按任意次序嵌套使用。编写判别 +给定表达式中所含的括号是否正确配对的算法 + +练习6-2:set +现有n个正整数,要求出这n个正整数中的第k个最小整数(相同大小的整数只计算一次)。 + +练习7-1:set +计算集合的并。结果不能有重复元素。 +![[0bb15f78462e86158422796120dc207.png]]![[f59eac4e6d3133f2f5858a8acb8686c.png]] + +练习5-2:map +按字典序统计下面这段文字中单词出现的次数 +It was the best of times, and it was the worst of times. It was the age of wisdom, and it was the age of foolishness. It was the epoch of belief, and it was the epoch of incredulity. It was the season of light, and it was the season of darkness. It was the spring of hope, and it was the winter of despair. We had everything before us, and we had nothing before us. We were all going direct to Heaven, and we were all going direct the other way. In short, the period was so far like the present period. That some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only. + +练习7-2:multimap或map嵌套 +小A经营着一个不大的水果店。他认为生存之道就是经营最受顾客欢迎的水果。现在他想要一份水果销售情况的明细表,这样就可以很容易掌握所有水果的销售情况了。小A告诉你每一笔销售记录的水果名称,产地和销售的数量,请你帮他生成明细表。 +![[6be0838f13e72aec326d619f0b71332.png]]![[2b156b84355b2f971688672c938db99.png]] + +练习5-1:容器vector、排序、插入、删除 +杰克船长挖掘到一个宝藏,里面有各种各样的财宝,每种财宝一堆,杰克船长打算每次将两堆财宝合并,直到将这些财宝合并为一堆,显 +然,经过n-1次合并之后,财宝会成为1堆,假定消耗的体力为两堆财宝的重量之和,为了将这批宝藏搬运到船上,杰克船长必须保证合并 +时花费的体力最少,你的任务是设计合并方案,计算出最小的体力消耗值。 +输入:第一行一个整数N表示有N组测试数据, +接下来的N组测试数据,第一行整数M表示有M种财宝,下一行包括M个整数,表示每种财宝的重量。 +输出:消耗的最小体力值 +![[12407f4de1c3a66578d2e8f82d4c51f.png]]![[d51e2d4d5194acd69a2d21ea46db3fd.png]]![[2573882d9beaa8ae813e1dc759981b1.png]] + +练习8-1:栈和数组 +小A在纸上写了一个串,只包含’(和 ’)’。一个’(能唯一匹配一个’),但是一个匹配的’(必须出现在')之前。请判断小A写的字符 +串能否括号完全匹配,如果能,输出配对的括号的位置(匹配的括号不可以交叉,只能嵌套)。 +![[b81c8e32fb279b599b41bb069fde712.png]]![[498a6e3e108ad1ba52f6c84f6b00815.png]] + +练习8-2:栈和双端队列deque +小A每天都在用一款名为“小A浏览器”的软件。在这个浏览器中,一共三种操作:打开页面、回退和前进。它们的功能如下: +打开页面:在地址栏中输入网址,并跳转到网址对应的页面; +回退:返回到上一次访问的页面; +前进:返回到上次回退前的页面,如果上一次操作是打开页面,那么将无法前进。 +现在,小A打开浏览器,进行了一系列操作,你需要输出他每次操作后所在页面的网址。 +![[7ae7b55e7def6eb5bad45d7ad6f01c9.png]]![[2e672494682fd2377a55eadc65f4040.png]] + +练习4-2:最后练 +在一项比赛中,有五位参赛选手分别是A、B、C、D、E,设计一个Player类,数据成员包括选手的姓名和分数。选手的分数按照如下方 +式产生:10名裁判对每位选手打分,去掉一个最高分,再去掉一个最低分,剩余的分数取平均值。最后按照分数从高到低的顺序输出选手 +的姓名和得分信息。 +提示和要求:用STL完成本题目,用vector容器存放每位选手的信息,每位选手的分数可放入双端队列中,用sort()排序后去掉两端,再求 +平均值,用sort()对vector排序 \ No newline at end of file diff --git a/C/题目.md b/C/题目.md new file mode 100644 index 0000000..9ac03d2 --- /dev/null +++ b/C/题目.md @@ -0,0 +1,77 @@ +练习4.1 +小明去美国旅游,打电话回来告诉家人美国当地温度是华氏(F)64度,请问摄氏温度(C)是多少度? +它们之间转换关系: C = 5/9*(F-32)。注意:温度是浮点数 + +练习4.2 +有一小车从静止以匀加速1m/s开始运行,请问10秒后,它的速度是多少?走了多远距离? +![[be0901734e3e6c86c6e66d780d7a9e3.png]] + +练习6.1-编写软件-计算阶梯电价-选择控制结构 +为了提倡居民节约用电,某省电力公司执行“阶梯电价”,安装一户一表的居民用户电价分为两个“阶梯”:月用电量50千瓦时(含50千瓦时)以内的,电价为0.53元/千瓦时;超过50千瓦时的,超出部分的用电量,电价上调0.05元/千瓦时。请编写程序计算电费。 + +练习6.2-编写软件-出租车计价-选择控制结构 +本题要求根据某城市普通出租车收费标准编写程序进行车费计算。具体标准如下: +起步里程为3公里,起步费10元; +超起步里程后10公里内,每公里2元; +超过10公里以上的部分加收50%的回空补贴费,即每公里3元; +营运过程中,因路阻及乘客要求临时停车的,按每5分钟2元计收(不足5分钟则不收费)。 +输入格式: +输入在一行中给出输入行驶里程(单位为公里,精确到小数点后1位)与等待时间(整数,单位为分钟),其间以空格分隔。 +输出格式: +在一行中输出乘客应支付的车费(单位为元),结果四舍五入,保留到元。 + +练习6.3-编写软件-计算超速罚款-选择控制结构 +(一)时速超过限定时速不到10%的,给予警告; +(二)在限速为50公里以下的道路,时速超过限定时速10%以上不到20%的,处50元罚款;超过限定时速20%以上不到50%的,处100元罚款;超过限定时速50%以上不到70%的,处300元罚款;超过限定时速70%的,处500元罚款; +(三)在限速为50公里以上80公里以下的道路,时速超过限定时速10%以上不到20%的,处100元罚款;超过限定时速20%以上不到50%的,处150元罚款;超过限定时速50%以上不到70%的,处500元罚款;超过限定时速70%的,处1000元罚款; +(四)在限速为80公里以上100公里以下的道路,时速超过限定时速10%以上不到20%的,处150元罚款;超过限定时速20%以上不到50%的,处200元罚款;超过限定时速50%以上不到70%的,处1000元罚款;超过限定时速70%的,处1500元罚款; +(五)在限速为100公里以上的道路,时速超过限定时速10%以上不到50%的,处200元罚款;超过限定时速50%以上不到70%的,处1500元罚款;超过限定时速70%以上的,处2000元罚款。 + +练习8.1-循环-输出n行数字金字塔 +![[cff720f3f351189ced1ddba397dc54d.png]] + +练习8.2-循环-十进制转十六进制 +编写一个函数实现数制的转换,不用递归,用数组实现。在主函数中输入一个十进制数,输出相应的十六进制数。 + +练习1 +利用重载函数的方法设计一个程序,该程序通过函数"calc()"进行计算并返回显示结果。 +当传入一个参数时,计算该参数的平方值; +当传入两个参数时,计算两个参数的积; +当传入三个参数时,计算三个参数的和。 + +练习2 +利用函数重载,计算圆形,矩形,梯形的面积。 + +练习3-1 +编写一个函数模板,分别求一个数组里面数据的最大值,最小值和平均值。 +void MathHelper(T num[], int size) + +练习3-2 +编写一个函数模板,实现数据交换的操作。 + +练习3-3 +编写如下形式的排序函数模板: +templatevoid sort(Type* A, int n, bool f) +对一个具有n个Type类型的一维数组进行排序,f为1表示从小到大排序,f为0表示从大到小排序,并通过不同参数类型机型调用,验证正确性。 + +练习11.1 +递归-使用函数输出指定范围内的Fibonacci数 (第n个数) + + +练习19.1-字符串复制 +用指针法实现字符串的复制.实现将一个已知字符串的内容复制到一个新的字符串。 (不用strcpy) + +练习19.2-字符串连接 + 将两个字符串连接起来,不要用strcat + +练习19.3-指针-字符串长度 +编写一函数,求一个字符串的长度,要求用字符指针实现。在主函数中输入字符串,调用该函数输出其长度。不能用strlen + +练习19.4-指针数组 +输入对应的数字,输出对应的月份。 + +练习19.5-指针-判定子串 +编写一个程序,判定一个字符串是否是另一个字符串的子串,若是,则返回子串在主串中的位置。要求不能使用系统函数。 + +练习19.6-指针-指向函数的指针 +用函数和指针完成下述程序功能:有两个整数a和b,由用户输入1,2或3。如输入1,程序就给出a和b中大者,输入2,就给出a和b中小者,输入3,则求a与b之和。(创建三个函数,根据选择不同调用不同的函数,使用函数指针) \ No newline at end of file diff --git a/C/题目2.md b/C/题目2.md new file mode 100644 index 0000000..7b5989d --- /dev/null +++ b/C/题目2.md @@ -0,0 +1,141 @@ +练习21.1-结构体-文件 +从键盘输入两个学生数据,写入一个文件中,再读出这两个学生的数据显示在屏幕上。 + +练习21.2-结构体-文件 +建立一个文件,向其中写入一组学生的姓名和成绩,然后从该文件中读出成绩大于80分的学生信息,并显示在屏幕上 + +练习22.1-编写软件-猜数字游戏-链表 +猜数字游戏是令游戏机随机产生一个100以内的正整数,用户输入一个数对其进行猜测,需要你编写程序自动对其与随机产生的被猜数进行比较,并提示大了(“Too big”),还是小了(“Too small”),相等表示猜到了。如果猜到,则结束程序。程序还要求统计猜的次数,如果1次猜出该数,提示“Bingo!”;如果3次以内猜到该数,则提示“Lucky You!”;如果超过3次但是在N(>3)次以内(包括第N次)猜到该数,则提示“Good Guess!”;如果超过N次都没有猜到,则提示“Game Over”,并结束程序。如果在到达N次之前,用户输入了一个负数,也输出“Game Over”,并结束程序。 +要求:游戏结束时(无论是否猜到)显示玩家猜数字的过程(用链表)。 + +练习22.2 +单链表逆序输出 + +练习22.3 +单链表排序 + +位运算练习 +1.位运算-二进制输出 +按二进制位输出一个整数。例如,1000=0000 0011 1110 1000B + +2.位运算-值交换(自己画一画过程) +交换两个变量的值,不使用中间变量。 + +3.位运算-求绝对值 +使用位运算求一个数的绝对值。 + +练习1: +下面是一个类的测试程序,设计出能使用如下测试程序的类。 +![[1003e54f07f1f747ac8c0cfdf1516da.png]]![[c9b0899e65d2d97e1ba4a70bb4fe2df.png]] + +练习2: +设计一个立方体类Box,它能计算并输出立方体的体积和表面积。要求: +·(1) 包含成员变量m_a(立方体边长)。 +·(2) 包含函数SetA(doublea)(设置立方体边长)、GetVolume()(计算体积)、GetArea()(计算表面积)。 +·(3) 包含函数Display(),用来输出计算的结果。 +·(4)设计测试用主函数main(),用来测试Box类。 + +练习3: +设计一个Rectangle类。要求: +·(1) 包含两个成员变量m_length和m_width,其默认值为1。 +·(2) 包含成员函数Perimeter()计算长方形的周长,Area()计算长方形面积。 +·(3) 包含成员函数SetWidth()和GetWidth()用来设置和得到m_width的值,SetLength()和GetLength()用来设置和得到m_length的 +值。Set...()函数应验证m_length和m_width均为0.0到20.0之间的浮点数。 +·(4)编写主函数,测试Rectangle类。 + +练习5: +编写一个Person类,包括: +·1、普通数据成员:姓名,性别,年龄。 +·2、三个构造函数:无参数构造函数,有参数构造函数(参数:姓名的指针,年龄,性别),拷贝构造函数。 +·3、析构函数, +输出人员信息函数print()。 +编写main ()函数,分别调用三种构造函数,创建三个对象P1、P2、P3,其中P3的创建是用P2通过深拷贝复制得到的 + +练习6: +编写一个程序,输入N个学生数据,包括学号、姓名、成绩,输出这些学生数据并计算平均分。要求: +·(1) 设计一个学生类Stud,除了包括学号、姓名和成绩数据成员外,有两个静态变量分别存放总分和人数。 +·(2)有两个普通成员函数SetData()和Disp(),分别用于给数据成员赋值和输出数据成员的值。另有一个静态成员函数Avg(),它用于 +计算平均分。 +·(3) 在main()函数中定义一个对象数组用于存储输入的学生数据。 + + +练习7: +有一个学生类Student,包括学生姓名、成绩,要求: +·(1)设计一个友元函数Compare(),比较两个学生成绩的高低。 +·(2) 在main()函数中定义一个对象数组用于存储输入学生的数据,并求出最高分和最低分的学生。 + +练习2-1: +请编写程序完成如下设计 +·学生类,数据成员包括学号(公有)、姓名(保护)、年龄(私有)、学生数(静态)。学生数用来统计构造出来的学生对象数量 +·课代表类,继承自学生类,数据包括负责课程编号(公有)、课程评分(公有) +·要求使用构造初始化符表“:”的形式进行构造,每个类有相关数据的输出显示函数 +·在主函数中构造对象并输出显示相关数据 + + +练习2-2: +·定义一个点Point类,数据成员是浮点型横纵坐标; +·定义一个颜色类Color数据成员只有颜色(字符数组#000000~#FFFFFF); +●一个直线类Line,数据成员是两个Point对象,表示起点和终点(即Point两个对象为Line的内嵌对象); +·一个三角形类Triangle,继承自Line和Color,数据成员有三角形的高height,三角形理解成以基类Color为颜色,以基类直线为底,以 +height为高的直角三角形,(即直线和高分别为两条直角边)请实现相关函数,计算三角形的颜色、周长和面积并给出相关输出 + +```cpp +#include + +int main(){ + +} +``` + +练习2-3: +设计日期类和时间类,并以此两类为基类派生日期时间类 +要求: +日期类包括年、月、日等成员 +·时间类包括时、分、秒等成员 +·日期时间类能够实现日期时间的求差、比较大小的功能 +1、使用运算符重载实现该功能,以时间日期类的对象描述日期时间之差 +2、假设每个月都是30天,不考虑闰年 +3、不考虑公元前 + +练习2-4: +设计圆类,并以圆类为基类,派生圆柱类、圆锥类和圆球类(分别求出其面积和体积) +要求: +·自行确定各类具有的数据成员、函数成员,如果需要对象成员,再自行设计相关类; +·在设计程序过程中,尽量多地涉及类继承与多态性的重要概念,如虚函数、纯虚函数、抽象基类等等。 +注:应当用圆类继承一个区域类(或形状类) + +练习8: +设计一个Rational类,进行带分数的运算。要求: +·(1) 包含两个整数成员变量表示分子和分母。 +·(2) 包含一个对所声明对象初始化的构造函数。不提供参数时,构造函数应提供默认值。分数存放成简化形式,例如分数“2/4”应在 +对象中存放成分子1和分母2的形式。 +·(3)对下列情况提供public成员函数: +a)两个Rational值相加,结果保存成简化形式。 +b) 两个Rational值相减,结果保存成简化形式。 +c) 两个Rational值相乘,结果保存成简化形式。 +d)两个Rational值相除,结果保存成简化形式。 +e)按a/b形式打印Rational值,其中a为分子,b为分母。 +·(4)编写主函数,测试Rational类。 +·(5)将上述成员函数改为运算符重载的形式,分别作为成员函数和友元函数实现上述功能。 + +练习3-4: +编写一个类模板,完成对不同数据类型的数组的排序(小到大)操作。 +如: +●int array[5]={3,6,2,1,4}; +●double array[5]={3.1,1.2,4.5,1.1,0.2}; + +练习3-5: +定义一个堆栈类模板,实现不同数据类型数据的入栈和出栈操作,堆栈的大小用非类型参数指定。 + +练习3-6: +用类模板创建单链表,并实现在链表里增加一个节点和删除一个节点的操作。 + +练习:文本文件-九九乘法表![[72d1094207daa7f6c6a98a4f10275fd.png]] + +练习5-7:文件读写、二进制文件 +编写一个程序,将5种商品的商品号、商品名、单价和数量写入二进制文件f.bin中,然后将该文件中的数据读到数组中,并将其输出到屏幕上。![[c34b2009414956177d593a62b4f2cc4.png]] + +练习5-8:文件读写、二进制文件 +编写一个程序从文件f.bin(第1题已建立的文件)中读出任意一种商品的数据并输出到屏幕上。比如输入整数2,则输出第二种商品的信息 +![[1746003581975944b10199ea7232702.png]] + diff --git a/GlobalData.h b/GlobalData.h new file mode 100644 index 0000000..4eda09e --- /dev/null +++ b/GlobalData.h @@ -0,0 +1,7 @@ +#ifndef GLOBALDATA_H +#define GLOBALDATA_H + +char g_bufferData[8] = {0}; +int g_count = 0; + +#endif // GLOBALDATA_H diff --git a/Linux.md b/Linux.md new file mode 100644 index 0000000..1ad7806 --- /dev/null +++ b/Linux.md @@ -0,0 +1,4 @@ +查看程序使用的编译链 +``` bash +readelf -p .comment +``` \ No newline at end of file diff --git a/QT/图片/016cf2ec99554101094703fbf2d0c6ee_.png b/QT/图片/016cf2ec99554101094703fbf2d0c6ee_.png new file mode 100644 index 0000000..4c7e026 Binary files /dev/null and b/QT/图片/016cf2ec99554101094703fbf2d0c6ee_.png differ diff --git a/QT/图片/13a1d2593a339ca6e1dd82d2e4c666cf_.png b/QT/图片/13a1d2593a339ca6e1dd82d2e4c666cf_.png new file mode 100644 index 0000000..eb0c96e Binary files /dev/null and b/QT/图片/13a1d2593a339ca6e1dd82d2e4c666cf_.png differ diff --git a/QT/图片/1aee77a18abcc6bd172fafd345914a25_.png b/QT/图片/1aee77a18abcc6bd172fafd345914a25_.png new file mode 100644 index 0000000..5136175 Binary files /dev/null and b/QT/图片/1aee77a18abcc6bd172fafd345914a25_.png differ diff --git a/QT/图片/1c67bddb94794a221a0b270fce22add.png b/QT/图片/1c67bddb94794a221a0b270fce22add.png new file mode 100644 index 0000000..a5518f2 Binary files /dev/null and b/QT/图片/1c67bddb94794a221a0b270fce22add.png differ diff --git a/QT/图片/1c96f27ff7d0ff328031518234a3820.png b/QT/图片/1c96f27ff7d0ff328031518234a3820.png new file mode 100644 index 0000000..a538681 Binary files /dev/null and b/QT/图片/1c96f27ff7d0ff328031518234a3820.png differ diff --git a/QT/图片/2058cd9a063c9e68f8c25ac2d89dfa3.png b/QT/图片/2058cd9a063c9e68f8c25ac2d89dfa3.png new file mode 100644 index 0000000..d8c533e Binary files /dev/null and b/QT/图片/2058cd9a063c9e68f8c25ac2d89dfa3.png differ diff --git a/QT/图片/2301b46bffa58656717f4dccdd25272.png b/QT/图片/2301b46bffa58656717f4dccdd25272.png new file mode 100644 index 0000000..88312a2 Binary files /dev/null and b/QT/图片/2301b46bffa58656717f4dccdd25272.png differ diff --git a/QT/图片/278efd24a2830685a4398e4f1faa1194_.png b/QT/图片/278efd24a2830685a4398e4f1faa1194_.png new file mode 100644 index 0000000..e957c5e Binary files /dev/null and b/QT/图片/278efd24a2830685a4398e4f1faa1194_.png differ diff --git a/QT/图片/298e44ff81e6f5da424ed5794b746193_.png b/QT/图片/298e44ff81e6f5da424ed5794b746193_.png new file mode 100644 index 0000000..d3acc18 Binary files /dev/null and b/QT/图片/298e44ff81e6f5da424ed5794b746193_.png differ diff --git a/QT/图片/31b4af2c637c34f5dd9a2178805f566.png b/QT/图片/31b4af2c637c34f5dd9a2178805f566.png new file mode 100644 index 0000000..ab1d641 Binary files /dev/null and b/QT/图片/31b4af2c637c34f5dd9a2178805f566.png differ diff --git a/QT/图片/325df8980ecb953d6b11a42310eb2ae 1.png b/QT/图片/325df8980ecb953d6b11a42310eb2ae 1.png new file mode 100644 index 0000000..e1de00c Binary files /dev/null and b/QT/图片/325df8980ecb953d6b11a42310eb2ae 1.png differ diff --git a/QT/图片/325df8980ecb953d6b11a42310eb2ae.png b/QT/图片/325df8980ecb953d6b11a42310eb2ae.png new file mode 100644 index 0000000..e1de00c Binary files /dev/null and b/QT/图片/325df8980ecb953d6b11a42310eb2ae.png differ diff --git a/QT/图片/3451d9c3e1cfa4f092b55089d9a871b2_.png b/QT/图片/3451d9c3e1cfa4f092b55089d9a871b2_.png new file mode 100644 index 0000000..59f04f1 Binary files /dev/null and b/QT/图片/3451d9c3e1cfa4f092b55089d9a871b2_.png differ diff --git a/QT/图片/3e079b2dacb0c6d1a5a22349efca51f.png b/QT/图片/3e079b2dacb0c6d1a5a22349efca51f.png new file mode 100644 index 0000000..b71dedc Binary files /dev/null and b/QT/图片/3e079b2dacb0c6d1a5a22349efca51f.png differ diff --git a/QT/图片/4304673e2ea5db096c7de5eed4c5e9f.png b/QT/图片/4304673e2ea5db096c7de5eed4c5e9f.png new file mode 100644 index 0000000..790a980 Binary files /dev/null and b/QT/图片/4304673e2ea5db096c7de5eed4c5e9f.png differ diff --git a/QT/图片/46e658d6041b47fb78aa4720dd81569.png b/QT/图片/46e658d6041b47fb78aa4720dd81569.png new file mode 100644 index 0000000..e6fe984 Binary files /dev/null and b/QT/图片/46e658d6041b47fb78aa4720dd81569.png differ diff --git a/QT/图片/48c249bf0d77938a3bae9cad52c467d.png b/QT/图片/48c249bf0d77938a3bae9cad52c467d.png new file mode 100644 index 0000000..177541a Binary files /dev/null and b/QT/图片/48c249bf0d77938a3bae9cad52c467d.png differ diff --git a/QT/图片/4ae3509a77bbba8eb07fa1aa3d5cdebd_.png b/QT/图片/4ae3509a77bbba8eb07fa1aa3d5cdebd_.png new file mode 100644 index 0000000..49b81a7 Binary files /dev/null and b/QT/图片/4ae3509a77bbba8eb07fa1aa3d5cdebd_.png differ diff --git a/QT/图片/4ece700f456523e757d44c56c6d11d2.png b/QT/图片/4ece700f456523e757d44c56c6d11d2.png new file mode 100644 index 0000000..a5bb188 Binary files /dev/null and b/QT/图片/4ece700f456523e757d44c56c6d11d2.png differ diff --git a/QT/图片/5442927f2ae1aeb7e85ea257b063642.png b/QT/图片/5442927f2ae1aeb7e85ea257b063642.png new file mode 100644 index 0000000..407eafd Binary files /dev/null and b/QT/图片/5442927f2ae1aeb7e85ea257b063642.png differ diff --git a/QT/图片/601af90279996ffd05fc554b3655fdc2_.png b/QT/图片/601af90279996ffd05fc554b3655fdc2_.png new file mode 100644 index 0000000..234fc1d Binary files /dev/null and b/QT/图片/601af90279996ffd05fc554b3655fdc2_.png differ diff --git a/QT/图片/6480b14aaf7b6b0b15a9ff78f0a1716.png b/QT/图片/6480b14aaf7b6b0b15a9ff78f0a1716.png new file mode 100644 index 0000000..1e96aaf Binary files /dev/null and b/QT/图片/6480b14aaf7b6b0b15a9ff78f0a1716.png differ diff --git a/QT/图片/68834c79fd94cac9456844aabdb91e2.png b/QT/图片/68834c79fd94cac9456844aabdb91e2.png new file mode 100644 index 0000000..c0bc4b4 Binary files /dev/null and b/QT/图片/68834c79fd94cac9456844aabdb91e2.png differ diff --git a/QT/图片/6994f7ae22e288920d7f8c48131a7863_.png b/QT/图片/6994f7ae22e288920d7f8c48131a7863_.png new file mode 100644 index 0000000..fda0553 Binary files /dev/null and b/QT/图片/6994f7ae22e288920d7f8c48131a7863_.png differ diff --git a/QT/图片/6a34489b1f2cf3d7f825b6589d97c12.png b/QT/图片/6a34489b1f2cf3d7f825b6589d97c12.png new file mode 100644 index 0000000..c70fa69 Binary files /dev/null and b/QT/图片/6a34489b1f2cf3d7f825b6589d97c12.png differ diff --git a/QT/图片/6de3c18328b5209ba72b85b12830e85.png b/QT/图片/6de3c18328b5209ba72b85b12830e85.png new file mode 100644 index 0000000..960dcf2 Binary files /dev/null and b/QT/图片/6de3c18328b5209ba72b85b12830e85.png differ diff --git a/QT/图片/76ccc2eb91d810fb120769a20b187df.png b/QT/图片/76ccc2eb91d810fb120769a20b187df.png new file mode 100644 index 0000000..62d8c32 Binary files /dev/null and b/QT/图片/76ccc2eb91d810fb120769a20b187df.png differ diff --git a/QT/图片/7941646ae9f8aeb7212bf21961ac0b79_.png b/QT/图片/7941646ae9f8aeb7212bf21961ac0b79_.png new file mode 100644 index 0000000..afc9986 Binary files /dev/null and b/QT/图片/7941646ae9f8aeb7212bf21961ac0b79_.png differ diff --git a/QT/图片/85742fec35bea44361c110e5d9934595_.png b/QT/图片/85742fec35bea44361c110e5d9934595_.png new file mode 100644 index 0000000..01f616c Binary files /dev/null and b/QT/图片/85742fec35bea44361c110e5d9934595_.png differ diff --git a/QT/图片/85d88d848f33e6741bd89f976b0799a3_.png b/QT/图片/85d88d848f33e6741bd89f976b0799a3_.png new file mode 100644 index 0000000..e8d2159 Binary files /dev/null and b/QT/图片/85d88d848f33e6741bd89f976b0799a3_.png differ diff --git a/QT/图片/8d3b90f415b25cbefd48f544124e91d.png b/QT/图片/8d3b90f415b25cbefd48f544124e91d.png new file mode 100644 index 0000000..d681c6f Binary files /dev/null and b/QT/图片/8d3b90f415b25cbefd48f544124e91d.png differ diff --git a/QT/图片/8d8913f24215ff42251fdf6717d1407.png b/QT/图片/8d8913f24215ff42251fdf6717d1407.png new file mode 100644 index 0000000..b07ebf7 Binary files /dev/null and b/QT/图片/8d8913f24215ff42251fdf6717d1407.png differ diff --git a/QT/图片/92f8bd976d775f7a9b67c3c6954238f.png b/QT/图片/92f8bd976d775f7a9b67c3c6954238f.png new file mode 100644 index 0000000..336d6a6 Binary files /dev/null and b/QT/图片/92f8bd976d775f7a9b67c3c6954238f.png differ diff --git a/QT/图片/9880bbadba9f47a4f5ea039bf6a5c589_.png b/QT/图片/9880bbadba9f47a4f5ea039bf6a5c589_.png new file mode 100644 index 0000000..75cc1ed Binary files /dev/null and b/QT/图片/9880bbadba9f47a4f5ea039bf6a5c589_.png differ diff --git a/QT/图片/9bb714eef96f1a75085dbf443150a33.png b/QT/图片/9bb714eef96f1a75085dbf443150a33.png new file mode 100644 index 0000000..6c7908b Binary files /dev/null and b/QT/图片/9bb714eef96f1a75085dbf443150a33.png differ diff --git a/QT/图片/a664b00245443af2610ed85316be5baa_.png b/QT/图片/a664b00245443af2610ed85316be5baa_.png new file mode 100644 index 0000000..6603598 Binary files /dev/null and b/QT/图片/a664b00245443af2610ed85316be5baa_.png differ diff --git a/QT/图片/aaa800e142788cf565ac37315721a8a0_.png b/QT/图片/aaa800e142788cf565ac37315721a8a0_.png new file mode 100644 index 0000000..69d7605 Binary files /dev/null and b/QT/图片/aaa800e142788cf565ac37315721a8a0_.png differ diff --git a/QT/图片/ac6c40c81e6d5d1b07aa9f0cb2c8995.png b/QT/图片/ac6c40c81e6d5d1b07aa9f0cb2c8995.png new file mode 100644 index 0000000..35ca642 Binary files /dev/null and b/QT/图片/ac6c40c81e6d5d1b07aa9f0cb2c8995.png differ diff --git a/QT/图片/bffa6e3037d447b3f1fb9186bc405be.png b/QT/图片/bffa6e3037d447b3f1fb9186bc405be.png new file mode 100644 index 0000000..c6286fa Binary files /dev/null and b/QT/图片/bffa6e3037d447b3f1fb9186bc405be.png differ diff --git a/QT/图片/cb355e9a8c05d1029098edb443cf7b0.png b/QT/图片/cb355e9a8c05d1029098edb443cf7b0.png new file mode 100644 index 0000000..ca4d19b Binary files /dev/null and b/QT/图片/cb355e9a8c05d1029098edb443cf7b0.png differ diff --git a/QT/图片/ce35786fa07e588a9538c0dad8daf521_.png b/QT/图片/ce35786fa07e588a9538c0dad8daf521_.png new file mode 100644 index 0000000..27ba4f1 Binary files /dev/null and b/QT/图片/ce35786fa07e588a9538c0dad8daf521_.png differ diff --git a/QT/图片/d08f9e7c0915b0a331202b67cda69e9.png b/QT/图片/d08f9e7c0915b0a331202b67cda69e9.png new file mode 100644 index 0000000..086dc66 Binary files /dev/null and b/QT/图片/d08f9e7c0915b0a331202b67cda69e9.png differ diff --git a/QT/图片/d836ca5bf444fbea85c5d62b9b84b36.png b/QT/图片/d836ca5bf444fbea85c5d62b9b84b36.png new file mode 100644 index 0000000..49d57de Binary files /dev/null and b/QT/图片/d836ca5bf444fbea85c5d62b9b84b36.png differ diff --git a/QT/图片/d99805b18eff46c65eaaa9e88ee9daa.png b/QT/图片/d99805b18eff46c65eaaa9e88ee9daa.png new file mode 100644 index 0000000..5e52db7 Binary files /dev/null and b/QT/图片/d99805b18eff46c65eaaa9e88ee9daa.png differ diff --git a/QT/图片/decdc9e3db801e3e9d27d3e5e454975.png b/QT/图片/decdc9e3db801e3e9d27d3e5e454975.png new file mode 100644 index 0000000..e69e99d Binary files /dev/null and b/QT/图片/decdc9e3db801e3e9d27d3e5e454975.png differ diff --git a/QT/图片/e126ed32ceb5545b7dc71b6d505d9d8d_.png b/QT/图片/e126ed32ceb5545b7dc71b6d505d9d8d_.png new file mode 100644 index 0000000..a3159c6 Binary files /dev/null and b/QT/图片/e126ed32ceb5545b7dc71b6d505d9d8d_.png differ diff --git a/QT/图片/ec811ac7cf10e0a88a1f84da045270f.png b/QT/图片/ec811ac7cf10e0a88a1f84da045270f.png new file mode 100644 index 0000000..9a50054 Binary files /dev/null and b/QT/图片/ec811ac7cf10e0a88a1f84da045270f.png differ diff --git a/QT/图片/f87337629223e006d36bff6a9712231.png b/QT/图片/f87337629223e006d36bff6a9712231.png new file mode 100644 index 0000000..1d73dda Binary files /dev/null and b/QT/图片/f87337629223e006d36bff6a9712231.png differ diff --git a/QT/图片/faf3e195b449015d171c7627d01bd55b_.png b/QT/图片/faf3e195b449015d171c7627d01bd55b_.png new file mode 100644 index 0000000..d7b36ba Binary files /dev/null and b/QT/图片/faf3e195b449015d171c7627d01bd55b_.png differ diff --git a/QT/图片/fd4fbf294881512f4a25b16894c2c7ec_.png b/QT/图片/fd4fbf294881512f4a25b16894c2c7ec_.png new file mode 100644 index 0000000..b1a37f6 Binary files /dev/null and b/QT/图片/fd4fbf294881512f4a25b16894c2c7ec_.png differ diff --git a/QT/第七章.md b/QT/第七章.md new file mode 100644 index 0000000..06a4a4f --- /dev/null +++ b/QT/第七章.md @@ -0,0 +1,13 @@ +![[第7章(3课时)已更新.ppt]] + +第7章,重点:信号槽的机制和自定义信号槽的使用。了解对象树的机制(例如界面类)。了解容器、qlist、qstring、qbytearray、qvariant的使用。 + +![[3e079b2dacb0c6d1a5a22349efca51f.png]] + +![[6de3c18328b5209ba72b85b12830e85.png]] + +![[31b4af2c637c34f5dd9a2178805f566.png]] + +![[1c67bddb94794a221a0b270fce22add.png]] + +当然,习惯于传统for的使用的人还是很多的。 \ No newline at end of file diff --git a/QT/第三章.md b/QT/第三章.md new file mode 100644 index 0000000..973285e --- /dev/null +++ b/QT/第三章.md @@ -0,0 +1,20 @@ +![[第3章(1课时)已更新.ppt]] + +第3章,重点是使用基础窗口和组件,以及使用槽函数连接在其上面点击等操作发出的信号,进行自己具体的操作。 + +![[d836ca5bf444fbea85c5d62b9b84b36.png]] + +各个组件可以像这样,拖拽到界面,然后通过创建槽,连接各组件的信号,熟悉组件的用法。 + +![[decdc9e3db801e3e9d27d3e5e454975.png]] +![[6480b14aaf7b6b0b15a9ff78f0a1716.png]] +![[bffa6e3037d447b3f1fb9186bc405be.png]] +![[5442927f2ae1aeb7e85ea257b063642.png]] +![[cb355e9a8c05d1029098edb443cf7b0.png]] +![[ac6c40c81e6d5d1b07aa9f0cb2c8995.png]] + +信号槽的连接,connect和转到槽都试一下,这两种用的多。另一种用的少,可以以后再熟悉。 + +![[6a34489b1f2cf3d7f825b6589d97c12.png]] +![[48c249bf0d77938a3bae9cad52c467d.png]] +![[2301b46bffa58656717f4dccdd25272.png]] diff --git a/QT/第九章.md b/QT/第九章.md new file mode 100644 index 0000000..c0d880c --- /dev/null +++ b/QT/第九章.md @@ -0,0 +1,11 @@ +![[第9章(3课时)已更新.ppt]] + +第9章,重点:国际化(翻译)的使用。创建插件(dll)和应用程序使用插件。 +![[76ccc2eb91d810fb120769a20b187df.png]] +这是qt插件的一个示意图 +如果不使用动态加载dll,可以在pro文件配置。 +![[9bb714eef96f1a75085dbf443150a33.png]] + + +![[testPlugin.zip]] +![[testPluginApp.zip]] diff --git a/QT/第二十章.md b/QT/第二十章.md new file mode 100644 index 0000000..bcbdb01 --- /dev/null +++ b/QT/第二十章.md @@ -0,0 +1,23 @@ +![[第20章(1课时)已更新.ppt]] +QWaitCondition的使用 +![[7941646ae9f8aeb7212bf21961ac0b79_.png]] +![[ce35786fa07e588a9538c0dad8daf521_.png]] +![[278efd24a2830685a4398e4f1faa1194_.png]] +"1thread" 0 +"1thread" 1 +"1thread" 2 +"1thread" 3 +"1thread" 4 +"1thread" 5 +"1thread" 6 +"1thread" 7 这里已经满了,无法生产了 +"2thread" 0 消费一个之后 +"1thread" 8 才能继续生产 +"2thread" 1 +"1thread" 9 +"2thread" 9 +![[3451d9c3e1cfa4f092b55089d9a871b2_.png]] +使用两个线程是这样的。 +![[threadclock.cpp]] +![[GlobalData.h]] +![[threadclock.h]] diff --git a/QT/第二章.md b/QT/第二章.md new file mode 100644 index 0000000..c10acac --- /dev/null +++ b/QT/第二章.md @@ -0,0 +1,5 @@ +![[第2章(2课时)已更新.ppt]] + +第2章,重点:创建新的widget工程,设计界面.ui文件的拖拽实现界面,应用程序依赖的dll,设置应用程序图标icon。工程文件.pro的说明。代码自动补全功能。 + +![[4304673e2ea5db096c7de5eed4c5e9f.png]] \ No newline at end of file diff --git a/QT/第五章.md b/QT/第五章.md new file mode 100644 index 0000000..631eb08 --- /dev/null +++ b/QT/第五章.md @@ -0,0 +1,3 @@ +![[第5章(3课时)已更新.ppt]] + +第5章 重点和优先级。1、优先级最高-主窗口的实现(mainwindow的使用。包括菜单栏、工具栏、中心组件、dock、statusbar)。2、拖动的大致实现过程(可以敲一敲课件的代码熟悉一下或者简单的输出信息)。 diff --git a/QT/第八章.md b/QT/第八章.md new file mode 100644 index 0000000..e16e677 --- /dev/null +++ b/QT/第八章.md @@ -0,0 +1,5 @@ +![[第8章(1课时)已更新.ppt]] + +第8章,重点:qt样式表的使用(特别是qss文件的方式)。 +关于样式表的使用,qt助手中有样例。搜索:Qt Style Sheets Examples即可。 +![[46e658d6041b47fb78aa4720dd81569.png]] diff --git a/QT/第六章.md b/QT/第六章.md new file mode 100644 index 0000000..7a8bf90 --- /dev/null +++ b/QT/第六章.md @@ -0,0 +1,5 @@ +![[第6章(1课时)已更新.ppt]] + +第6章,重点:事件处理函数的使用(例如鼠标、键盘),事件过滤器的使用,定时器的使用(信号槽方式) + +其中,事件过滤器,很有用。 \ No newline at end of file diff --git a/QT/第十七章.md b/QT/第十七章.md new file mode 100644 index 0000000..fdb24b2 --- /dev/null +++ b/QT/第十七章.md @@ -0,0 +1,30 @@ +![[第17章(2课时)已更新.ppt]] + +第17章重点:qt连接数据库的使用。 +安装完mysql,在odbc配置数据源。 +![[92f8bd976d775f7a9b67c3c6954238f.png]] +将lib和dll文件从mysql安装目录找到,复制到qt的安装目录下。 +![[8d3b90f415b25cbefd48f544124e91d.png]] +![[4ece700f456523e757d44c56c6d11d2.png]] +![[325df8980ecb953d6b11a42310eb2ae 1.png]] +![[68834c79fd94cac9456844aabdb91e2.png]] + +常用的一些sql语句: +#创建数据库 +create database db_name; +#使用数据库,也就是指定当前数据库。 +use db_name; +#创建表 +create table tb_name ( +id int auto_increment primary key, +name varchar(20) +); +#插入数据 +insert into tb_name (id, name) values (1,‘zhao’); +#更新数据 +update tb_name set name = ‘qian’ where id = 1; +#删除数据 +delete from tb_name where id = 1; +#删除表 +drop table tb_name; + diff --git a/QT/第十九章.md b/QT/第十九章.md new file mode 100644 index 0000000..1bf0cbd --- /dev/null +++ b/QT/第十九章.md @@ -0,0 +1,22 @@ +![[第19章(1课时)已更新.ppt]]第19章重点:线程的使用(子类化)和线程同步(锁和信号量)。 +![[fd4fbf294881512f4a25b16894c2c7ec_.png]] +![[85742fec35bea44361c110e5d9934595_.png]] +一个简单的线程示例,显示当前时间,通过信号槽发送到主线程。 +这是我以前写的共享内存的实例代码,共享内存的优先级可以放在后面。 +![[027d147db3a0ebe921fd9ad2e9664076_115f7bca329ae801314a770f5d12bdaa_8.zip]] + +![[9bfbc9579e6bae78e3887c20a924a060_a82e3bb329e4a61e49d2ee60c669447a_8 1.zip]] +线程和锁的示例: +![[4ae3509a77bbba8eb07fa1aa3d5cdebd_.png]] +![[e126ed32ceb5545b7dc71b6d505d9d8d_.png]] +![[85d88d848f33e6741bd89f976b0799a3_.png]] +一个简单的锁的样例 +读锁是不阻塞的 +![[a664b00245443af2610ed85316be5baa_.png]] +![[13a1d2593a339ca6e1dd82d2e4c666cf_.png]] +读写锁之间是阻塞的 +![[6994f7ae22e288920d7f8c48131a7863_.png]] +![[1aee77a18abcc6bd172fafd345914a25_.png]] +![[601af90279996ffd05fc554b3655fdc2_.png]] +![[faf3e195b449015d171c7627d01bd55b_.png]] + diff --git a/QT/第十五章.md b/QT/第十五章.md new file mode 100644 index 0000000..602d40e --- /dev/null +++ b/QT/第十五章.md @@ -0,0 +1,10 @@ +![[第15章(1课时)已更新.ppt]] + +第15章重点:文件的操作(打开、读写、关闭),配置文件ini的使用(qsettings)。其次,文件监视器(QFileSystemWatcher)。 +![[f87337629223e006d36bff6a9712231.png]] +![[2058cd9a063c9e68f8c25ac2d89dfa3.png]] +以上是QSettings读写配置文件ini的例子 +![[1c96f27ff7d0ff328031518234a3820.png]] +![[ec811ac7cf10e0a88a1f84da045270f.png]] +以上是qfile读写文件的例子 +![[8d8913f24215ff42251fdf6717d1407.png]] diff --git a/QT/第十八章.md b/QT/第十八章.md new file mode 100644 index 0000000..ec36cb5 --- /dev/null +++ b/QT/第十八章.md @@ -0,0 +1,8 @@ +![[第18章(2课时)已更新.ppt]] +第18章重点:udp的使用(客户端和服务端),udp和tcp的区别,其次是tcp的使用(客户端和服务端)。 +我自己以前写过这两部分的小demo。发出来给大家参考,大家可以结合课件具体写出代码练习。 +![[tcp_client.zip]] +![[udp_client.zip]] +![[udp_server.zip]] +![[tcp_server.zip]] + diff --git a/QT/第十章.md b/QT/第十章.md new file mode 100644 index 0000000..e9d5f4b --- /dev/null +++ b/QT/第十章.md @@ -0,0 +1,8 @@ +![[第10章(2课时)已更新.ppt]] +![[第11章(2课时)已更新.ppt]] +![[第12章(1课时)已更新.ppt]] +![[第13章(1课时)已更新.ppt]] +![[第14章(1课时)已更新.ppt]] +我把我这里的一个qss文件发出来,大家参考一下 +![[style.qss]] +第10章重点,使用painter简单绘制(文字、线、矩形、多边形等简单形状)。本章优先级可以放在其他章的后面。 \ No newline at end of file diff --git a/QT/第四章.md b/QT/第四章.md new file mode 100644 index 0000000..d39059d --- /dev/null +++ b/QT/第四章.md @@ -0,0 +1,7 @@ +![[第4章(1课时)已更新.ppt]] + +第4章,重点boxlayout(基本布局),另外几个布局其次。伙伴和tab顺序排在布局后面,有空再熟悉。 + +代码示例 +![[d99805b18eff46c65eaaa9e88ee9daa.png]] +![[d08f9e7c0915b0a331202b67cda69e9.png]] diff --git a/QT/补充内容.md b/QT/补充内容.md new file mode 100644 index 0000000..42b3f8a --- /dev/null +++ b/QT/补充内容.md @@ -0,0 +1,51 @@ +![[kafka_2_消息队列通信的模式.pptx]]![[kafka_1_概念.pptx]] +![[kafka_4_消息格式.pptx]] + +![[kafka_3_架构原理.pptx]] + +![[RocketMq_1_原理.pptx]] + +![[RocketMq_2_消息格式.pptx]] + +qcustomplot是一个第三方库,用来绘制图表的,很有名。以后如果遇到绘制图表的需求就会用到它。 +官网。https://www.qcustomplot.com/index.php/introduction +1、 下载后将qcustomplot.cpp和qcustomplot.h加入到工程中。 +2、 在.pro文件添加打印支持。greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport。否则编译会报错。c++11支持在工程中已经自动添加了。 +3、 example是例子程序,里面有各种图表。 + +![[qcustomplot.zip]] + +![[016cf2ec99554101094703fbf2d0c6ee_.png]] +![[aaa800e142788cf565ac37315721a8a0_.png]] +![[9880bbadba9f47a4f5ea039bf6a5c589_.png]] +![[298e44ff81e6f5da424ed5794b746193_.png]] +还有另一个第三方库,也是用来制作图表的,qwt。 +官网:https://sourceforge.net/projects/qwt/ +这个库的使用不是把代码添加进来,而是把动态库添加进来。 +步骤: +1、先把qwt-6.1.4.zip解压 +进入目录下面,用Qt Creator打开qwt.pro文件,即打开了Qwt工程。 +编译生成的库文件都在build-qwt-Desktop_Qt_5_12_3_MinGW_32_bit-Debug下面。 + +2、 +将build-qwt-Desktop_Qt_5_12_3_MinGW_32_bit-Debug\lib下的libqwt.a和libqwtd.a复制到D:\Qt\Qt5.12.3\5.12.3\mingw73_32\lib下。 + +将build-qwt-Desktop_Qt_5_12_3_MinGW_32_bit-Debug\lib下的qwt.dll和qwtd.dll复制到D:\Qt\Qt5.12.3\5.12.3\mingw73_32\bin下。 + +将build-qwt-Desktop_Qt_5_12_3_MinGW_32_bit-Debug\plugins\designer下的qwt_designer_plugin.dll复制到D:\Qt\Qt5.12.3\5.12.3\mingw73_32\plugins\designer下。 + +在D:\Qt\Qt5.12.3\5.12.3\mingw73_32\include下新建一个Qwt的文件夹,将D:\Qwt-6.1.4\src下的所有.h头文件复制到新建的Qwt文件夹下。 + +3、新建Qt工程,在.pro文件加入 +1. DEFINES += QT_DLL QWT_DLL +2. +3. LIBS += -lqwtd +4. +5. LIBS += -lqwt +6. +7. INCLUDEPATH +=D:\Qt\Qt5.12.3\5.12.3\mingw73_32\include\Qwt + +4、使用qt designer(qt creator里面的设计界面会看不到组件,只能看到位置)打开ui界面文件,可以拖拽qwt组件到界面上。 + + +![[qwt-6.1.4.zip]] diff --git a/RocketMq_1_原理.pptx b/RocketMq_1_原理.pptx new file mode 100644 index 0000000..ecbdfde Binary files /dev/null and b/RocketMq_1_原理.pptx differ diff --git a/RocketMq_2_消息格式.pptx b/RocketMq_2_消息格式.pptx new file mode 100644 index 0000000..cc06359 Binary files /dev/null and b/RocketMq_2_消息格式.pptx differ diff --git a/boost.md b/boost.md new file mode 100644 index 0000000..8cf7cec --- /dev/null +++ b/boost.md @@ -0,0 +1,49 @@ +Windows安装 +``` bash +Remove-Item b2.exe, bjam.exe -Force -ErrorAction SilentlyContinue + +$mingwPath = "C:\Path\Qt5.12.12\Tools\mingw730_64\bin\" +$env:PATH = "$mingwPath;$env:PATH" +$env:CC = "$mingwPath\gcc.exe" +$env:CXX = "$mingwPath\g++.exe" +$env:RC = "windres --target=pe-x86-64" +.\bootstrap.bat gcc --verbose + +.\b2 toolset=gcc --build-type=complete install --prefix="C:\Work\boost_64" -j8 + +``` +linux安装 + +``` bash +./bootstrap.sh + +vim project-config.jam + +./b2 link=static toolset=gcc address-model=64 --prefix=/work/lib/boost/gcc install + +``` + +``` bash +./b2 \ + --prefix=./install \ # 安装到当前目录的 install 目录(可修改为绝对路径) + --static \ # 仅生成静态库 + --disable-shared \ # 禁用动态库(可选,若需纯静态建议开启) + variant=debug,release \ # 同时生成 Debug 和 Release 版本 + runtime-link=static \ # 静态链接运行时库(可选,部分场景需要) + cxxflags="-std=c++17 -Wall" \ # 指定 C++ 标准和编译警告 + --with-system \ # 编译 system 库(示例,按需添加其他库,如 filesystem、program_options 等) + --with-thread \ # 编译 thread 库 + --with-date_time \ # 编译 date_time 库 + --install # 编译后安装到 --prefix 指定路径 +``` +``` project-config.jam +if ! gcc in [ feature.values ] +{ + using gcc : : /opt/gccs/dg-gcc-aarch64-7.4.1/bin/aarch64-linux-gnu-gcc ; +} + +``` + +./b2 --static --disable-shared variant=debug,release toolset=gcc address-model=64 --prefix=/work/lib/boost/gcc12 install + +.\b2 toolset=gcc --build-type=complete --prefix=/work/lib/boost/gcc12_2 install \ No newline at end of file diff --git a/kafka_1_概念.pptx b/kafka_1_概念.pptx new file mode 100644 index 0000000..57ca7a4 Binary files /dev/null and b/kafka_1_概念.pptx differ diff --git a/kafka_2_消息队列通信的模式.pptx b/kafka_2_消息队列通信的模式.pptx new file mode 100644 index 0000000..de3d6aa Binary files /dev/null and b/kafka_2_消息队列通信的模式.pptx differ diff --git a/kafka_3_架构原理.pptx b/kafka_3_架构原理.pptx new file mode 100644 index 0000000..46a59f8 Binary files /dev/null and b/kafka_3_架构原理.pptx differ diff --git a/kafka_4_消息格式.pptx b/kafka_4_消息格式.pptx new file mode 100644 index 0000000..ca27aad Binary files /dev/null and b/kafka_4_消息格式.pptx differ diff --git a/qcustomplot.zip b/qcustomplot.zip new file mode 100644 index 0000000..6f37dc6 Binary files /dev/null and b/qcustomplot.zip differ diff --git a/qwt-6.1.4.zip b/qwt-6.1.4.zip new file mode 100644 index 0000000..593e461 Binary files /dev/null and b/qwt-6.1.4.zip differ diff --git a/rbnet.ko 模块.md b/rbnet.ko 模块.md new file mode 100644 index 0000000..9d94aa7 --- /dev/null +++ b/rbnet.ko 模块.md @@ -0,0 +1,43 @@ +1.安装模块(不再需要加参数) +``` bash +insmod rbnet.ko +``` +2.配置需要处理的接口与类型(可动态配置,enable后任可修改。实时生效,不需要rmmod) +``` bash +echo lo > /proc/rbnet/ifaces_in +``` +输入方向需要去帧头的接口列表,多个使用逗号隔开(无0xeb90则不做处理) +``` bash +echo lo > /proc/rbnet/ifaces_out +``` + 输出方向需要加帧头的接口列表,多个使用逗号隔开 +``` bash +echo 0x17 > /proc/rbnet/dtype_out +``` + 输出方向帧头中的类型字段,多个使用逗号隔开 + +3.使能功能 +``` bash +echo 1 > /proc/rbnet/enabled +``` +``` bash +echo 0 > /proc/rbnet/enabled +``` + +4.可开启调试信息查看包处理过程 +``` bash +echo 1 > /proc/rbnet/hexdump_enable +``` + +``` bash +dmesg +``` + + +``` bash +insmod rbnet.ko +echo eth0 > /proc/rbnet/ifaces_in +echo eth0 > /proc/rbnet/ifaces_out +echo 0x17 > /proc/rbnet/dtype_out +echo 1 > /proc/rbnet/enabled +``` \ No newline at end of file diff --git a/style.qss b/style.qss new file mode 100644 index 0000000..37842b1 --- /dev/null +++ b/style.qss @@ -0,0 +1,262 @@ + + +QPushButton +{ + background-color: red; + border-style: outset; + border-width: 2px; + border-radius: 10px; + border-color: beige; + font: bold 14px; + min-width: 10em; + padding: 6px; +} + +QPushButton:pressed +{ + background-color: rgb(224, 0, 0); + border-style: inset; +} + +QPushButton:hover +{ + background-color: yellow; +} +QPushButton:hover:pressed +{ + background-color: green; +} + +QPushButton::menu-indicator +{ + image: url(:/toolbutton/Next.png); + subcontrol-position: right center; + subcontrol-origin: padding; + left: -2px; +} + +QRadioButton::indicator { + width: 20px; + height: 20px; +} + +QRadioButton::indicator::unchecked { + image: url(:/radio/status/radio_unchecked.png); +} + QRadioButton::indicator:unchecked:hover { + image: url(:/radio/status/radio_unchecked_hover.png); + } + QRadioButton::indicator:unchecked:pressed { + image: url(:/radio/status/radio_unchecked_pressed.png); + } +QRadioButton::indicator::checked { + image: url(:/radio/status/radio_checked.png); +} + QRadioButton::indicator:checked:hover { + image: url(:/radio/status/radio_checked_hover.png); + } + + QRadioButton::indicator:checked:pressed { + image: url(:/radio/status/radio_checked_pressed.png); + } + QCheckBox { + spacing: 5px; + } + + QCheckBox::indicator { + width: 20px; + height: 20px; + } + + QCheckBox::indicator:unchecked:hover { + image: url(:/checkbox/status/checkbox_unchecked_hover.png); + } + QCheckBox::indicator:unchecked:pressed { + image: url(:/checkbox/status/checkbox_unchecked_pressed.png); + } + QCheckBox::indicator:checked:hover { + image: url(:/checkbox/status/checkbox_checked_hover.png); + } + + QCheckBox::indicator:checked:pressed { + image: url(:/checkbox/status/checkbox_checked_pressed.png); + } + QCheckBox::indicator:indeterminate:hover { + image: url(:/checkbox/status/checkbox_indeterminate_hover.png); + } + + QCheckBox::indicator:indeterminate:pressed { + image: url(:/checkbox/status/checkbox_indeterminate_pressed.png); + } + +QComboBox { + border: 1px solid gray; + border-radius: 3px; + padding: 1px 18px 1px 3px; + min-width: 6em; + } + + QComboBox:editable { + background: white; + } + QComboBox:!editable, QComboBox::drop-down:editable { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, + stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3); + } + /* QComboBox gets the "on" state when the popup is open */ + QComboBox:!editable:on, QComboBox::drop-down:editable:on { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #D3D3D3, stop: 0.4 #D8D8D8, + stop: 0.5 #DDDDDD, stop: 1.0 #E1E1E1); + } + QComboBox:on { /* shift the text when the popup opens */ + padding-top: 3px; + padding-left: 4px; + } + QComboBox::drop-down { + subcontrol-origin: padding; + subcontrol-position: top right; + width: 15px; + + border-left-width: 1px; + border-left-color: darkgray; + border-left-style: solid; /* just a single line */ + border-top-right-radius: 3px; /* same radius as the QComboBox */ + border-bottom-right-radius: 3px; + } + QComboBox::down-arrow { + image: url(:/combobox/status/down_arrow_green.png); + } + + QComboBox::down-arrow:on { /* shift the arrow when popup is open */ + top: 1px; + left: 1px; + } + QLineEdit { + border: 2px solid gray; + border-radius: 10px; + padding: 0 8px; + background: yellow; + selection-background-color: darkgray; + } + QLineEdit[echoMode="2"] { + lineedit-password-character: 9679; + } + QLineEdit:read-only { + background: lightblue; + } + + QTextEdit { + background-color: white; + background-image: url(:/textedit/status/draft.png); + background-repeat: no-repeat; + background-position: center; + background-size: cover;/*无法适应组件大小*/ + background-attachment: fixed; + } + + QSpinBox { + padding-right: 15px; /* make room for the arrows */ + border-image: url(:/spinbox/status/frame.png) 4; + border-width: 3; + } + QSpinBox::up-arrow { + image: url(:/spinbox/status/up_arrow.png); + width: 7px; + height: 7px; + } + + QSpinBox::down-arrow { + image: url(:/spinbox/status/down_arrow.png); + width: 7px; + height: 7px; + } + + QSpinBox::up-arrow:disabled, QSpinBox::up-arrow:off { /* off state when value is max */ + image: url(:/spinbox/status/up_arrow_disabled.png); + } + + QSpinBox::down-arrow:disabled, + QSpinBox::down-arrow:off { /* off state when value in min */ + + image: url(:/spinbox/status/down_arrow_disabled.png); + } + QSpinBox::up-button:hover { + border-image: url(:/spinbox/status/up_arrow_hover.png) 1; + } + QSpinBox::down-button:hover { + border-image: url(:/spinbox/status/down_arrow_hover.png) 1; + } + + QSpinBox::up-button:pressed { + border-image: url(:/spinbox/status/up_arrow_disabled.png) 1; + } + QSpinBox::down-button:pressed { + border-image: url(:/spinbox/status/down_arrow_disabled.png) 1; + } + QSlider::groove:horizontal { + border: 1px solid #999999; + height: 8px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */ + background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #B1B1B1, stop:1 #c4c4c4); + margin: 2px 0; + } + + QSlider::handle:horizontal { + background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f); + border: 1px solid #5c5c5c; + width: 18px; + margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */ + border-radius: 3px; + } +QSlider::sub-page:horizontal { + + background: blue; +} + QSlider::add-page:horizontal { + background: green; + } + QToolButton { /* all types of tool button */ + border: 2px solid #8f8f91; + border-radius: 6px; + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #f6f7fa, stop: 1 #dadbde); + } + + QToolButton[popupMode="1"] { /* only for MenuButtonPopup */ + padding-right: 20px; /* make way for the popup button */ + } + + QToolButton:pressed { + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #dadbde, stop: 1 #f6f7fa); + } + + /* the subcontrols below are used only in the MenuButtonPopup mode */ + QToolButton::menu-button { + border: 2px solid gray; + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; + /* 16px width + 4px for border = 20px allocated above */ + width: 16px; + } + + QToolButton::menu-arrow { + image: url(downarrow.png); + } + + QToolButton::menu-arrow:open { + top: 1px; left: 1px; /* shift it a bit */ + } + + QProgressBar { + border: 2px solid grey; + border-radius: 5px; + text-align: center; + } + + QProgressBar::chunk { + background-color: #CD96CD; + width: 10px; + margin: 0.5px; + } \ No newline at end of file diff --git a/tcp_client 1.zip b/tcp_client 1.zip new file mode 100644 index 0000000..dbeefc1 Binary files /dev/null and b/tcp_client 1.zip differ diff --git a/tcp_client.zip b/tcp_client.zip new file mode 100644 index 0000000..dbeefc1 Binary files /dev/null and b/tcp_client.zip differ diff --git a/tcp_server.zip b/tcp_server.zip new file mode 100644 index 0000000..2671d08 Binary files /dev/null and b/tcp_server.zip differ diff --git a/testPlugin.zip b/testPlugin.zip new file mode 100644 index 0000000..efdeed7 Binary files /dev/null and b/testPlugin.zip differ diff --git a/testPluginApp.zip b/testPluginApp.zip new file mode 100644 index 0000000..d0c7d68 Binary files /dev/null and b/testPluginApp.zip differ diff --git a/threadclock.cpp b/threadclock.cpp new file mode 100644 index 0000000..6c42895 --- /dev/null +++ b/threadclock.cpp @@ -0,0 +1,170 @@ +#include "threadclock.h" + +#include "GlobalData.h" +#include +#include +#include +#include +#include + +QMutex mutex(QMutex::Recursive);//默认那种方式不行,另一个线程不会阻塞等待 +QReadWriteLock rwLock(QReadWriteLock::Recursive); + +QMutex mutexCon;//配合等待条件,不能用上面那种 +QWaitCondition condition; + +//信号量 +QSemaphore sem(8); + +ThreadClock::ThreadClock(QObject *parent) + : QThread{parent} +{ + ; +} + +QString ThreadClock::name() const +{ + return m_name; +} + +void ThreadClock::setName(const QString &newName) +{ + m_name = newName; +} +#if 1 +void ThreadClock::run() +{ + mutex.lock(); + while (g_count < 5) { + g_count++; + qDebug() << m_name << g_count; + sleep(1); + } + g_count = 0; + mutex.unlock(); +} +#endif +#if 0 +/* +"2thread" 2 +"1thread" 1 +"1thread" 4 +"2thread" 4 +"2thread" 0 +"2thread" 1 +"2thread" 2 +"2thread" 3 +"2thread" 4 +"2thread" 5 +*/ +//可见读锁在线程之间是不阻塞的 +void ThreadClock::run() +{ + rwLock.lockForRead(); + while (g_count < 5) { + g_count++; + qDebug() << m_name << g_count; + sleep(1); + } + g_count = 0; + rwLock.unlock(); +} +#endif + +#if 0 +/* +"1thread" 1 +"1thread" 2 +"1thread" 3 +"1thread" 4 +"1thread" 5 +"2thread" 1 +"2thread" 2 +"2thread" 3 +"2thread" 4 +"2thread" 5 +*/ +//读写锁之间是阻塞的 +void ThreadClock::run() +{ + if (m_name == "1thread") { + rwLock.lockForRead(); + }else { + rwLock.lockForWrite(); + } + + while (g_count < 5) { + g_count++; + qDebug() << m_name << g_count; + sleep(1); + } + g_count = 0; + rwLock.unlock(); +} +#endif + +#if 0 +//QWaitCondition的使用 注意:无限循环 +void ThreadClock::run() +{ + //生产者 + if (m_name == "1thread") { + while (true) { + mutexCon.lock(); + g_count++;//生产 + qDebug() << m_name << g_count;//生产的数据 + condition.wakeAll();//唤醒其它线程(可以消费) + mutexCon.unlock(); + } + }else{//消费者 + while (true) { + mutexCon.lock(); + while (g_count <= 0) {//说明生产者还没有生产数据 + condition.wait(&mutexCon);//等待生产者生产完成,解锁 + } + qDebug() << m_name << g_count;//消费的数据 + g_count--;//消费 + + mutexCon.unlock(); + } + } + +} +#endif +/* +"1thread" 0 +"1thread" 1 +"1thread" 2 +"1thread" 3 +"1thread" 4 +"1thread" 5 +"1thread" 6 +"1thread" 7 这里已经满了,无法生产了 +"2thread" 0 消费一个之后 +"1thread" 8 才能继续生产 +"2thread" 1 +"1thread" 9 +"2thread" 9 +*/ +#if 0 +//信号量的使用 注意:无限循环 +void ThreadClock::run() +{ + //生产者 + if (m_name == "1thread") { + while (true) { + sem.acquire(1); + g_bufferData[g_count % 8] = '0' + g_count;//这里把g_count当成索引 + qDebug() << m_name << g_bufferData[g_count % 8];//生产的数据 + g_count++; + } + }else{//消费者 + while (true) { + + qDebug() << m_name << g_bufferData[g_count % 8];//消费的数据 + sem.release(1); + + } + } +} +#endif diff --git a/threadclock.h b/threadclock.h new file mode 100644 index 0000000..316ae2b --- /dev/null +++ b/threadclock.h @@ -0,0 +1,23 @@ +#ifndef THREADCLOCK_H +#define THREADCLOCK_H + +#include +#include + +class ThreadClock : public QThread +{ + Q_OBJECT +public: + explicit ThreadClock(QObject *parent = nullptr); + + + QString name() const; + void setName(const QString &newName); + +private: + QString m_name; +protected: + void run() override; +}; + +#endif // THREADCLOCK_H diff --git a/udp_client.zip b/udp_client.zip new file mode 100644 index 0000000..f1d94cc Binary files /dev/null and b/udp_client.zip differ diff --git a/udp_server.zip b/udp_server.zip new file mode 100644 index 0000000..ff0c6ae Binary files /dev/null and b/udp_server.zip differ diff --git a/串口.md b/串口.md new file mode 100644 index 0000000..3012447 --- /dev/null +++ b/串口.md @@ -0,0 +1,24 @@ +### **Linux/MacOS 测试步骤** +1. **创建虚拟串口**: + ```bash + socat -d -d pty,raw,echo=0 pty,raw,echo=0 + ``` + 记录生成的设备路径(如 `/dev/pts/1` 和 `/dev/pts/2`)。 + +2. **使用 `minicom` 测试**: + • 终端1监听 `/dev/pts/1`: + ```bash + minicom -D /dev/pts/1 -b 9600 + ``` + • 终端2发送数据到 `/dev/pts/2`: + ```bash + echo -n -e "\xEB\x90\x07\x00\x00\x0B\x61\x74\x2B\x74\x65\x73\x74\x3D\x31\x0D\x0A" > /dev/pts/1 + ``` + • 在终端1查看接收结果。 + +--- + +``` bash +stty -F /dev/ttyS3 115200 raw -echo # 设置串口参数 +cat /dev/ttyS3 | hexdump -v -e '/1 "%02X "' # 实时十六进制显示 +``` \ No newline at end of file diff --git a/任务/XW测试任务.md b/任务/XW测试任务.md new file mode 100644 index 0000000..e9b4d2c --- /dev/null +++ b/任务/XW测试任务.md @@ -0,0 +1,8 @@ +- [ ] 回环 + 具备状态后,ap ping hh头的包给cp,cp回环。在ap和hh模块处查看收发包。 + +- [ ] 峰值速率 + AP给CP灌包,灌包时减小包长,CP回包,在logx处查看上下行速率 + 打到200M后,减少包长度 + + \ No newline at end of file diff --git a/图片/0bb15f78462e86158422796120dc207.png b/图片/0bb15f78462e86158422796120dc207.png new file mode 100644 index 0000000..192cbe9 Binary files /dev/null and b/图片/0bb15f78462e86158422796120dc207.png differ diff --git a/图片/1003e54f07f1f747ac8c0cfdf1516da 1.png b/图片/1003e54f07f1f747ac8c0cfdf1516da 1.png new file mode 100644 index 0000000..39a78e6 Binary files /dev/null and b/图片/1003e54f07f1f747ac8c0cfdf1516da 1.png differ diff --git a/图片/12407f4de1c3a66578d2e8f82d4c51f.png b/图片/12407f4de1c3a66578d2e8f82d4c51f.png new file mode 100644 index 0000000..c1534d1 Binary files /dev/null and b/图片/12407f4de1c3a66578d2e8f82d4c51f.png differ diff --git a/图片/1746003581975944b10199ea7232702 1.png b/图片/1746003581975944b10199ea7232702 1.png new file mode 100644 index 0000000..1a3fed7 Binary files /dev/null and b/图片/1746003581975944b10199ea7232702 1.png differ diff --git a/图片/2573882d9beaa8ae813e1dc759981b1.png b/图片/2573882d9beaa8ae813e1dc759981b1.png new file mode 100644 index 0000000..25b42c7 Binary files /dev/null and b/图片/2573882d9beaa8ae813e1dc759981b1.png differ diff --git a/图片/2b156b84355b2f971688672c938db99.png b/图片/2b156b84355b2f971688672c938db99.png new file mode 100644 index 0000000..5d6b03b Binary files /dev/null and b/图片/2b156b84355b2f971688672c938db99.png differ diff --git a/图片/2e672494682fd2377a55eadc65f4040.png b/图片/2e672494682fd2377a55eadc65f4040.png new file mode 100644 index 0000000..c0fc4a8 Binary files /dev/null and b/图片/2e672494682fd2377a55eadc65f4040.png differ diff --git a/图片/3a02555e24cab50917acb282f461237 1.png b/图片/3a02555e24cab50917acb282f461237 1.png new file mode 100644 index 0000000..f41daa3 Binary files /dev/null and b/图片/3a02555e24cab50917acb282f461237 1.png differ diff --git a/图片/3a02555e24cab50917acb282f461237.png b/图片/3a02555e24cab50917acb282f461237.png new file mode 100644 index 0000000..f41daa3 Binary files /dev/null and b/图片/3a02555e24cab50917acb282f461237.png differ diff --git a/图片/498a6e3e108ad1ba52f6c84f6b00815.png b/图片/498a6e3e108ad1ba52f6c84f6b00815.png new file mode 100644 index 0000000..fe36761 Binary files /dev/null and b/图片/498a6e3e108ad1ba52f6c84f6b00815.png differ diff --git a/图片/6be0838f13e72aec326d619f0b71332.png b/图片/6be0838f13e72aec326d619f0b71332.png new file mode 100644 index 0000000..35ebe96 Binary files /dev/null and b/图片/6be0838f13e72aec326d619f0b71332.png differ diff --git a/图片/72d1094207daa7f6c6a98a4f10275fd 1.png b/图片/72d1094207daa7f6c6a98a4f10275fd 1.png new file mode 100644 index 0000000..99ed078 Binary files /dev/null and b/图片/72d1094207daa7f6c6a98a4f10275fd 1.png differ diff --git a/图片/7a0aa8773d0a7158d0f5105b1af598d 1.png b/图片/7a0aa8773d0a7158d0f5105b1af598d 1.png new file mode 100644 index 0000000..6d25a97 Binary files /dev/null and b/图片/7a0aa8773d0a7158d0f5105b1af598d 1.png differ diff --git a/图片/7a0aa8773d0a7158d0f5105b1af598d.png b/图片/7a0aa8773d0a7158d0f5105b1af598d.png new file mode 100644 index 0000000..6d25a97 Binary files /dev/null and b/图片/7a0aa8773d0a7158d0f5105b1af598d.png differ diff --git a/图片/7ae7b55e7def6eb5bad45d7ad6f01c9.png b/图片/7ae7b55e7def6eb5bad45d7ad6f01c9.png new file mode 100644 index 0000000..a65ab08 Binary files /dev/null and b/图片/7ae7b55e7def6eb5bad45d7ad6f01c9.png differ diff --git a/图片/b81c8e32fb279b599b41bb069fde712.png b/图片/b81c8e32fb279b599b41bb069fde712.png new file mode 100644 index 0000000..39856df Binary files /dev/null and b/图片/b81c8e32fb279b599b41bb069fde712.png differ diff --git a/图片/be0901734e3e6c86c6e66d780d7a9e3.png b/图片/be0901734e3e6c86c6e66d780d7a9e3.png new file mode 100644 index 0000000..dcd875a Binary files /dev/null and b/图片/be0901734e3e6c86c6e66d780d7a9e3.png differ diff --git a/图片/c34b2009414956177d593a62b4f2cc4.png b/图片/c34b2009414956177d593a62b4f2cc4.png new file mode 100644 index 0000000..276fdf2 Binary files /dev/null and b/图片/c34b2009414956177d593a62b4f2cc4.png differ diff --git a/图片/c9b0899e65d2d97e1ba4a70bb4fe2df.png b/图片/c9b0899e65d2d97e1ba4a70bb4fe2df.png new file mode 100644 index 0000000..7fa829f Binary files /dev/null and b/图片/c9b0899e65d2d97e1ba4a70bb4fe2df.png differ diff --git a/图片/cff720f3f351189ced1ddba397dc54d.png b/图片/cff720f3f351189ced1ddba397dc54d.png new file mode 100644 index 0000000..1e32df2 Binary files /dev/null and b/图片/cff720f3f351189ced1ddba397dc54d.png differ diff --git a/图片/d51e2d4d5194acd69a2d21ea46db3fd.png b/图片/d51e2d4d5194acd69a2d21ea46db3fd.png new file mode 100644 index 0000000..b3547ea Binary files /dev/null and b/图片/d51e2d4d5194acd69a2d21ea46db3fd.png differ diff --git a/图片/f59eac4e6d3133f2f5858a8acb8686c.png b/图片/f59eac4e6d3133f2f5858a8acb8686c.png new file mode 100644 index 0000000..ecd16fc Binary files /dev/null and b/图片/f59eac4e6d3133f2f5858a8acb8686c.png differ diff --git a/密态入网.md b/密态入网.md new file mode 100644 index 0000000..317d9bb --- /dev/null +++ b/密态入网.md @@ -0,0 +1,38 @@ +CP: +``` bash +echo -e "\x00AT^PSTM=0\r" > /dev/stty_ps_r80 +echo -e "\x00AT+CIPCA=0\r" > /dev/stty_ps_r80 +echo -e "\x00at+cfun=1\r" > /dev/stty_ps_r80 +``` +``` bash +echo -e "\x00AT+CGDCONT=1,\"IP\",\"cmnet\",,0,0,0,2,0,0,0,0,1,1,1,1,0,\"\",,0,0,1\r" > /dev/stty_ps_r80 +echo -e "\x00AT+CGACT=1,1\r" > /dev/stty_ps_r80 +``` +入网成功 +``` bash +ifconfig eth2 up +ip link set eth2 master br0 +ip link set seth0 master br0 +ip link set pcie1 nomaster +ip link set eth1 nomaster +ifconfig seth0 up +``` +AP: +``` bash +cd /root +./hh & +``` +其他配置在网卡脚本中:/vab/va/etc/init.d/network +network——bk是未接密卡 直通的配置 + +注释: +``` bash +echo 0x28 0x9 > /sys/class/net/eth1/device/rgmii_delayline +ethtool -K eth1 rx-checksum off + +若单独测ap与cp之间网卡通信(ping包方式) +拆除密卡 +cp侧: +ifconfig eth2 192.168.1.2 up +ip link set eth2 nomaster +``` \ No newline at end of file diff --git a/开启网口.md b/开启网口.md new file mode 100644 index 0000000..f4001af --- /dev/null +++ b/开启网口.md @@ -0,0 +1,49 @@ +``` bash +insmod mdio-netlink.ko +./mdio +``` + +``` bash +./mdio stmmac-0 phy 1 raw 0x1E 0xa001 +./mdio stmmac-0 phy 1 raw 0x1F 0x8164 +./mdio stmmac-0 phy 1 raw 0x1E 0xa003 +./mdio stmmac-0 phy 1 raw 0x1F 0x80f1 +./mdio stmmac-0 phy 1 raw 0x1E 0xa004 +./mdio stmmac-0 phy 1 raw 0x1F 0x00b0 +./mdio stmmac-0 phy 1 raw 0x1E 0xa001 +./mdio stmmac-0 phy 1 raw 0x1F 0x0164 #工作模式(100)配置、rgmii工作模式(千兆、全双工) +./mdio stmmac-0 phy 1 raw 0x0 0x0140 #关闭自协商 +./mdio stmmac-0 phy 1 raw 0x1E 0x01a0 +./mdio stmmac-0 phy 1 raw 0x1F 0xa8d0 #打开收发包统计,桥接芯片两侧收到的包数 +./mdio stmmac-0 phy 1 raw 0x11 #正常为0xa419 +./mdio stmmac-0 phy 1 raw 0x1E 0x01a3 +./mdio stmmac-0 phy 1 raw 0x1F +./mdio stmmac-0 phy 1 raw 0x1E 0x01a4 +./mdio stmmac-0 phy 1 raw 0x1F #sgmii侧收包统计,64~1518 +./mdio stmmac-0 phy 1 raw 0x1E 0x01ad +./mdio stmmac-0 phy 1 raw 0x1F +./mdio stmmac-0 phy 1 raw 0x1E 0x01ae +./mdio stmmac-0 phy 1 raw 0x1F #rgmii侧收包统计,64~1518 +``` + + +``` bash +ifconfig eth0 192.168.1.1 up +``` + +``` bash +diag_shell "port 7 speed 1000M" +diag_shell "show port 7 status" +diag_shell "show counter mac detail" +diag_shell "register write addr 0x13c5 value 0x951" +``` + +cp开机自动配ip: +修改文件`/etc/network/interfaces` +``` bash +auto eth2 +iface eth2 inet static +address 192.168.10.2 +netmask 255.255.255.0 +gateway 192.168.10.255 +``` diff --git a/操作指南.md b/操作指南.md new file mode 100644 index 0000000..f73c64e --- /dev/null +++ b/操作指南.md @@ -0,0 +1,75 @@ +1. `web.tar.gz`放入/root目录下,`tar -xzvf web.tar.gz` 解压 +2. `rc.local`放入/etc目录下 +3. `./rc.local`运行自动化程序 +4. `tcpdump -i br_lan port 8600 -xx` 抓包 +5. `rm /etc/localtime` + + +6. 起始符: + 7e +2. 帧长: + 00 64 +3. 命令字: + 87 +4. 参数体: + 00 02 + 00 54 + 0b 01 + 00 + 6e 10 + 50 48 41 53 45 5f 41 52 52 41 52 59 5f 30 33 30 + 6f 06 + 43 45 54 43 35 34 + 70 14 + 55 53 32 2e 30 30 30 2e 34 39 36 35 2d 32 30 32 33 30 30 31 + 71 0a + 32 30 32 33 2d 30 32 2d 32 37 + 72 0b + 56 31 2e 30 30 2e 30 30 2e 31 39 + 46 05 + 00 00 00 00 00 + 47 01 + 00 + 48 01 + 00 + 49 01 + 00 + 4a 01 + 00 +5. 校验字: + 2e +6. 结束符: + 7e + + +tmpKey:34___tmpUC:06--OutItemInfoPt:07 +AntennaMgrGetRplParaToInfo:Ret=29 +tmpKey:34___tmpUC:06--OutItemInfoPt + +7e 00 3a +83 +00 01 00 +02 04 00 00 72 42 +04 04 00 00 4b fa +11 01 00 +12 01 00 +06 02 00 00 +07 02 00 00 +08 01 3a +13 02 00 00 +14 02 00 00 +0a 02 03 c8 +0d 04 00 00 23 28 +aa 01 00 +ab 02 00 00 +ba 7e + +7E 00 64 87 00 02 00 54 0B 01 00 6E 10 50 48 41 53 45 5F 41 52 52 41 52 59 5F 30 33 30 6F 06 43 45 54 43 35 34 70 14 55 53 32 2E 30 30 30 2E 34 39 36 35 2D 32 30 32 33 30 30 31 71 0A 32 30 32 33 2D 30 32 2D 32 37 72 0B 56 31 2E 30 30 2E 30 30 2E 31 39 46 05 00 00 00 00 00 47 01 00 48 01 00 49 01 00 4A 01 00 2E 7E + +7e 00 3a 83 00 01 00 02 04 00 00 72 42 04 04 00 00 4b fa 11 01 00 12 01 00 06 02 00 00 +07 02 00 00 08 01 3a 13 02 00 00 14 02 00 00 0a 02 03 c8 0d 04 00 00 23 28aa 01 00 +ab 02 00 00 ba 7e + +7E 00 04 83 08 01 3F CB 7E + +7E 00 4D 83 08 01 3F 00 01 01 02 04 00 00 6D 60 04 04 00 00 4B 00 11 01 01 12 01 01 06 02 03 E8 07 02 07 D0 0B 01 F3 13 02 00 02 14 02 02 D5 0A 02 00 00 0D 04 47 97 0E 21 0C 02 07 D0 46 05 01 02 03 04 0A 47 01 05 48 01 06 49 01 07 4A 01 08 7A 7E \ No newline at end of file diff --git a/日志读取小程序/未命名 1.md b/日志读取小程序/未命名 1.md new file mode 100644 index 0000000..93e1025 --- /dev/null +++ b/日志读取小程序/未命名 1.md @@ -0,0 +1,3 @@ +13 可动 +1 ! +scrollbar-axis-range-control !! \ No newline at end of file diff --git a/未命名 1.base b/未命名 1.base new file mode 100644 index 0000000..f165474 --- /dev/null +++ b/未命名 1.base @@ -0,0 +1,3 @@ +views: + - type: table + name: 表格 diff --git a/未命名 2.base b/未命名 2.base new file mode 100644 index 0000000..f165474 --- /dev/null +++ b/未命名 2.base @@ -0,0 +1,3 @@ +views: + - type: table + name: 表格 diff --git a/未命名.base b/未命名.base new file mode 100644 index 0000000..f165474 --- /dev/null +++ b/未命名.base @@ -0,0 +1,3 @@ +views: + - type: table + name: 表格 diff --git a/笔记/C++.md b/笔记/C++.md new file mode 100644 index 0000000..9b5324d --- /dev/null +++ b/笔记/C++.md @@ -0,0 +1,19 @@ +## 基础配置 +#### 1.编码及输出 +```cpp +#if WIN32 + system("chcp 65001"); + setbuf(stdout, NULL);//解决Clion内置控制台debug时不显示打印的问题 +#endif +``` + + +--- +## 字符串检查函数 +![[Pasted image 20250213092216.png]] + +--- +## 异常 +![[Pasted image 20250213171955.png]] + +--- diff --git a/笔记/CMakeLists-Qt.md b/笔记/CMakeLists-Qt.md new file mode 100644 index 0000000..e731d17 --- /dev/null +++ b/笔记/CMakeLists-Qt.md @@ -0,0 +1,61 @@ +```python +cmake_minimum_required(VERSION 3.28) +project(MyAppClient) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(CMAKE_PREFIX_PATH "C:/Path/QT15/5.15.2/mingw81_64") + +find_package(Qt5 COMPONENTS + Core + Gui + Widgets + REQUIRED) + +add_executable(${PROJECT_NAME} main.cpp) +target_link_libraries(${PROJECT_NAME} + Qt5::Core + Qt5::Gui + Qt5::Widgets +) + +#1. **检查平台和工具链文件**:如果当前平台是Windows且未定义`CMAKE_TOOLCHAIN_FILE`,则执行后续操作。 +if (WIN32 AND NOT DEFINED CMAKE_TOOLCHAIN_FILE) + #2. **设置调试后缀**:如果使用的是MSVC编译器且构建类型为Debug,则设置`DEBUG_SUFFIX`为"d",否则为空。 + set(DEBUG_SUFFIX) + if (MSVC AND CMAKE_BUILD_TYPE MATCHES "Debug") + set(DEBUG_SUFFIX "d") + endif () + #3. **确定Qt安装路径**:尝试找到Qt的安装路径,如果默认路径不存在,则向上查找两级目录。 + set(QT_INSTALL_PATH "${CMAKE_PREFIX_PATH}") + if (NOT EXISTS "${QT_INSTALL_PATH}/bin") + set(QT_INSTALL_PATH "${QT_INSTALL_PATH}/..") + if (NOT EXISTS "${QT_INSTALL_PATH}/bin") + set(QT_INSTALL_PATH "${QT_INSTALL_PATH}/..") + endif () + endif () + #4. **复制qwindows.dll**:如果存在`qwindows${DEBUG_SUFFIX}.dll`,则在项目构建完成后将其复制到目标目录的`plugins/platforms/`子目录中。 + if (EXISTS "${QT_INSTALL_PATH}/plugins/platforms/qwindows${DEBUG_SUFFIX}.dll") + add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory + "$/plugins/platforms/") + add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + "${QT_INSTALL_PATH}/plugins/platforms/qwindows${DEBUG_SUFFIX}.dll" + "$/plugins/platforms/") + endif () + #5. **复制Qt库文件**:对于每个指定的Qt库,在项目构建完成后将其对应的DLL文件复制到目标目录。 + foreach (QT_LIB Core Widgets Gui Network) + add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + "${QT_INSTALL_PATH}/bin/Qt5${QT_LIB}${DEBUG_SUFFIX}.dll" + "$") + endforeach (QT_LIB) +endif () + +#自动复制配置文件 +#file(COPY ${CMAKE_SOURCE_DIR}/ DESTINATION ${CMAKE_BINARY_DIR}) +``` \ No newline at end of file diff --git a/笔记/CMakeLists.md b/笔记/CMakeLists.md new file mode 100644 index 0000000..b5d9ccf --- /dev/null +++ b/笔记/CMakeLists.md @@ -0,0 +1,75 @@ +```python +cmake_minimum_required(VERSION 3.28) +project(Ant) + +# 定义默认编译器 +set(DEFAULT_BYL "dg") +# 检查自定义编译器参数 +if (NOT DEFINED BYL) + set(BYL ${DEFAULT_BYL}) +endif () + +if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + if (BYL STREQUAL "jr")#菁蓉 + set(CMAKE_C_COMPILER "/opt/jr-gcc-aarch64-7.5.0/bin/aarch64-linux-gnu-gcc") + set(CMAKE_CXX_COMPILER "/opt/jr-gcc-aarch64-7.5.0/bin/aarch64-linux-gnu-g++") + set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build.${PROJECT_NAME}/lib/jr) + elseif (BYL STREQUAL "lj")#两江 + set(CMAKE_C_COMPILER "/opt/lj-gcc-aarch64-10.3/bin/aarch64-none-linux-gnu-gcc") + set(CMAKE_CXX_COMPILER "/opt/lj-gcc-aarch64-10.3/bin/aarch64-none-linux-gnu-g++") + set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build.${PROJECT_NAME}/lib/lj) + elseif (BYL STREQUAL "dg")#典格 + set(CMAKE_C_COMPILER "/opt/dg-gcc-aarch64-7.4.1/bin/aarch64-linux-gnu-gcc") + set(CMAKE_CXX_COMPILER "/opt/dg-gcc-aarch64-7.4.1/bin/aarch64-linux-gnu-g++") + set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build.${PROJECT_NAME}/lib/dg) + endif () +elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows") + set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build.${PROJECT_NAME}/lib/mingw810_64) +endif () + +set(CMAKE_CXX_STANDARD 17) + +#导入库 +include_directories(build.mbf/include build.mpcr/include) +link_libraries(mpcr mbf) +if (CMAKE_SYSTEM_NAME STREQUAL "Windows") + link_directories(build.mpcr/lib/mingw810_64 build.mbf/lib/mingw810_64) +elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") + if (BYL STREQUAL "jr")#菁蓉 + link_directories(build.mpcr/lib/jr build.mbf/lib/jr) + elseif (BYL STREQUAL "lj")#两江 + link_directories(build.mpcr/lib/lj build.mbf/lib/lj) + elseif (BYL STREQUAL "dg")#典格 + link_directories(build.mpcr/lib/dg build.mbf/lib/dg) + endif () +endif () + +include_directories(.) +aux_source_directory(. SRC_lIST) + +#add_library(Ant STATIC ${SRC_lIST}) +add_library(Ant SHARED ${SRC_lIST}) +#链接系统库 +if (CMAKE_SYSTEM_NAME STREQUAL "Windows") + target_link_libraries(${PROJECT_NAME} ws2_32) +endif () + +# 复制头文件 +# 设置源文件夹和目标文件夹 +set(SOURCE_DIR "${CMAKE_SOURCE_DIR}") +set(TARGET_DIR "${CMAKE_SOURCE_DIR}/build.${PROJECT_NAME}/include") +# 确保目标文件夹存在 +file(MAKE_DIRECTORY ${TARGET_DIR}) +# 复制 include 文件夹下的所有文件到 build.${PROJECT_NAME}/include 目录 +file(GLOB INCLUDE_FILES "${SOURCE_DIR}/*.h") +file(COPY ${INCLUDE_FILES} DESTINATION ${TARGET_DIR}) +``` +--- + +``` bash +# 交叉编译 +cmake .. \ + -DCMAKE_C_COMPILER=/usr/bin/arm-linux-gnueabihf-gcc \ + -DCMAKE_CXX_COMPILER=/usr/bin/arm-linux-gnueabihf-g++ \ + -DCMAKE_BUILD_TYPE=Release +``` diff --git a/笔记/GitHub.md b/笔记/GitHub.md new file mode 100644 index 0000000..638e4b6 --- /dev/null +++ b/笔记/GitHub.md @@ -0,0 +1,7 @@ + +[acwj](https://github.com/DoctorWkt/acwj) +[Tinyhttpd](https://github.com/EZLippi/Tinyhttpd) +[TinyWebServer](https://github.com/qinguoyi/TinyWebServer) +[CPlusPlusThings](https://github.com/Light-City/CPlusPlusThings) +[C-Plus-Plus](https://github.com/TheAlgorithms/C-Plus-Plus) +[推出一系列重磅项目,带大家实战学习C++,配合本开源项目学习,成长飞快!](https://github.com/Light-City/CPlusPlusThings/blob/master/proj/README.md) \ No newline at end of file diff --git a/笔记/QT.md b/笔记/QT.md new file mode 100644 index 0000000..d1e1df0 --- /dev/null +++ b/笔记/QT.md @@ -0,0 +1,16 @@ +在Clion环境变量中添加,以显示qDebug的输出 +``` +QT_ASSUME_STDERR_HAS_CONSOLE=1 +``` + +在对应目录下执行以生成所需库 +``` +windeployqt ${NAME} +``` + +--- +qDebug显示中文 +```cpp +QTextCodec *codec = QTextCodec::codecForName("UTF-8"); +QTextCodec::setCodecForLocale(codec); +``` diff --git a/笔记/虚拟机.md b/笔记/虚拟机.md new file mode 100644 index 0000000..aec2d8a --- /dev/null +++ b/笔记/虚拟机.md @@ -0,0 +1,10 @@ +###### 挂载共享文件夹 +``` bash +sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other +``` + +###### 创建虚拟串口 +``` bash +socat -d -d pty,raw,echo=0 pty,raw,echo=0 +``` + diff --git a/第10章(2课时)已更新.ppt b/第10章(2课时)已更新.ppt new file mode 100644 index 0000000..1500bd9 Binary files /dev/null and b/第10章(2课时)已更新.ppt differ diff --git a/第11章(2课时)已更新.ppt b/第11章(2课时)已更新.ppt new file mode 100644 index 0000000..21466c9 Binary files /dev/null and b/第11章(2课时)已更新.ppt differ diff --git a/第12章(1课时)已更新.ppt b/第12章(1课时)已更新.ppt new file mode 100644 index 0000000..3497220 Binary files /dev/null and b/第12章(1课时)已更新.ppt differ diff --git a/第13章(1课时)已更新.ppt b/第13章(1课时)已更新.ppt new file mode 100644 index 0000000..b5e6c0d Binary files /dev/null and b/第13章(1课时)已更新.ppt differ diff --git a/第14章(1课时)已更新.ppt b/第14章(1课时)已更新.ppt new file mode 100644 index 0000000..2189564 Binary files /dev/null and b/第14章(1课时)已更新.ppt differ diff --git a/第15章(1课时)已更新.ppt b/第15章(1课时)已更新.ppt new file mode 100644 index 0000000..b9b36dc Binary files /dev/null and b/第15章(1课时)已更新.ppt differ diff --git a/第17章(2课时)已更新.ppt b/第17章(2课时)已更新.ppt new file mode 100644 index 0000000..1349fa4 Binary files /dev/null and b/第17章(2课时)已更新.ppt differ diff --git a/第18章(2课时)已更新.ppt b/第18章(2课时)已更新.ppt new file mode 100644 index 0000000..b21e731 Binary files /dev/null and b/第18章(2课时)已更新.ppt differ diff --git a/第19章(1课时)已更新.ppt b/第19章(1课时)已更新.ppt new file mode 100644 index 0000000..adb7d76 Binary files /dev/null and b/第19章(1课时)已更新.ppt differ diff --git a/第20章(1课时)已更新.ppt b/第20章(1课时)已更新.ppt new file mode 100644 index 0000000..56bb247 Binary files /dev/null and b/第20章(1课时)已更新.ppt differ diff --git a/第2章(2课时)已更新.ppt b/第2章(2课时)已更新.ppt new file mode 100644 index 0000000..f6e4728 Binary files /dev/null and b/第2章(2课时)已更新.ppt differ diff --git a/第3章(1课时)已更新.ppt b/第3章(1课时)已更新.ppt new file mode 100644 index 0000000..e8860fd Binary files /dev/null and b/第3章(1课时)已更新.ppt differ diff --git a/第4章(1课时)已更新.ppt b/第4章(1课时)已更新.ppt new file mode 100644 index 0000000..b658ffe Binary files /dev/null and b/第4章(1课时)已更新.ppt differ diff --git a/第5章(3课时)已更新.ppt b/第5章(3课时)已更新.ppt new file mode 100644 index 0000000..e500281 Binary files /dev/null and b/第5章(3课时)已更新.ppt differ diff --git a/第6章(1课时)已更新.ppt b/第6章(1课时)已更新.ppt new file mode 100644 index 0000000..4e609d8 Binary files /dev/null and b/第6章(1课时)已更新.ppt differ diff --git a/第7章(3课时)已更新.ppt b/第7章(3课时)已更新.ppt new file mode 100644 index 0000000..1670bef Binary files /dev/null and b/第7章(3课时)已更新.ppt differ diff --git a/第8章(1课时)已更新.ppt b/第8章(1课时)已更新.ppt new file mode 100644 index 0000000..8fc951a Binary files /dev/null and b/第8章(1课时)已更新.ppt differ diff --git a/第9章(3课时)已更新.ppt b/第9章(3课时)已更新.ppt new file mode 100644 index 0000000..e72343f Binary files /dev/null and b/第9章(3课时)已更新.ppt differ diff --git a/红黑隔离测试.md b/红黑隔离测试.md new file mode 100644 index 0000000..9afdf0f --- /dev/null +++ b/红黑隔离测试.md @@ -0,0 +1,81 @@ +将AP的ip设置为1.1 +``` bash +ifconfig eth0 192.168.1.1 up +ip route add default via 192.168.1.3 dev eth0 +``` +开启红黑隔离 +``` bash +echo -e "AT+GMAC=12,1\r" > /dev/ttyS4 +``` +关闭红黑隔离 +``` bash +echo -e "AT+GMAC=12,0\r" > /dev/ttyS4 +``` +开启cp网卡 +``` bash +echo -e "at+gmac=1,2\r" > /dev/ttyS4 +``` +设置ap地址 +``` bash +echo -e "AT+GMAC=11,154,42,22,189,195,194\r" > /dev/ttyS4 #原AP +``` +``` bash +echo -e "AT+GMAC=11,122,90,221,216,73,170\r" > /dev/ttyS4 #新AP +``` +``` bash +echo -e "AT+GMAC=11,108,31,247,37,159,211\r" > /dev/ttyS4 #pc +``` +cp灌包 +``` bash +echo -e "at+gmac=2\r" > /dev/ttyS4 +``` +查看CP收包数 +``` bash +echo -e "AT+GMAC=6\r" > /dev/ttyS4 +``` +关闭回环 +``` bash +echo -e "at+gmac=13,0\r" > /dev/ttyS4 +``` +AP开启rbnet,CP开启回环后执行 +``` bash +ethtool -K eth0 rx-checksum off +ethtool -K eth1 rx-checksum off +``` +AP收灌包 +``` bash +iperf-2.0.5 -s -u -i 1 +``` +AP设置CP的静态ARP +``` bash +arp -s 192.168.1.3 04:05:06:07:08:09 +``` +AP向CP灌包 +``` bash +iperf -c 192.168.1.3 -u -b 100m -i 1 -t 30 +``` + + + +``` bash +echo -e "AT+CTRL0=0\r" > /dev/ttyS4 +``` + +AQ指令 +``` bash +AQ+CKST?\r\n +``` +``` bash +echo -e "AT+XWLOCKSAT=19,1,1,1696664,0" > /dev/ttyS4 +``` +``` bash +echo -e "at+cfun=1" > /dev/ttyS4 +``` +AQ+MAC=02:03:03:03:03:02 + +AQ+CFGIP=1,192.168.1.1\r\n + + +iperf-2.0.5 -c 192.168.1.3 -p 5001 -i 1 -t 10 + +iperf-2.0.5 -c 192.168.1.3 -u -b 100m -i 1 -t 10 \ No newline at end of file diff --git a/调试指令/891入网AT指令.md b/调试指令/891入网AT指令.md new file mode 100644 index 0000000..d719575 --- /dev/null +++ b/调试指令/891入网AT指令.md @@ -0,0 +1,7 @@ +AT^PSTM=0 +AT+CIPCA=0 +AT^UELOCSET=86.227731,41.553194,893.234 +at+cfun=1 + +AT+CGDCONT=1,"IP","cscnnet" +AT+CGACT=1,1 \ No newline at end of file diff --git a/调试指令/AP.md b/调试指令/AP.md new file mode 100644 index 0000000..8816eee --- /dev/null +++ b/调试指令/AP.md @@ -0,0 +1,10 @@ +# 公共 +## 网络 +###### 向CP传输文件 +``` bash +python3 -m http.server 8000 +``` +# 典格 + + +# 菁蓉 \ No newline at end of file diff --git a/调试指令/AT指令.md b/调试指令/AT指令.md new file mode 100644 index 0000000..26b380b --- /dev/null +++ b/调试指令/AT指令.md @@ -0,0 +1,4 @@ +单音400M最大 +``` +AT+PHYDBG=6,2,3800000,0,0,0,0,0,0,0 +``` \ No newline at end of file diff --git a/调试指令/CP.md b/调试指令/CP.md new file mode 100644 index 0000000..2147b9a --- /dev/null +++ b/调试指令/CP.md @@ -0,0 +1,7 @@ +## 网口 +### 新版 +eth2连接天线 +eth1连接AP + +### 旧版 +eth2连接AP \ No newline at end of file diff --git a/调试指令/高轨dg终端入网.md b/调试指令/高轨dg终端入网.md new file mode 100644 index 0000000..972b951 --- /dev/null +++ b/调试指令/高轨dg终端入网.md @@ -0,0 +1,29 @@ +###### at指令 +``` +at^pstm=2 +``` +``` +AT^STOREFREQXW=1,1696664,0 +``` +``` +at+cfun=1 +``` +查询分配的ip +``` +AT+CGPADDR +``` +##### 业务网卡配置 +###### CP +发送at指令:AT+DNNHWCFG=1 //gmac模式 +###### AP +``` bash +ip link set eth1_dat1 down +ip link set eth1_dat1 address 08:01:02:03:04:05 #修改mac地址 +ifconfig eth1_dat1 10.16.65.188 #配置为核心网分配的ip +route add -host 45.62.1.1 eth1_dat1 #配置路由 +arp -s 45.62.1.1 01:02:02:03:04:05 #配置静态arp +``` + +CP +手动延迟开机 +run mmcboot \ No newline at end of file diff --git a/项目/HH态CP控制小程序.md b/项目/HH态CP控制小程序.md new file mode 100644 index 0000000..9c1cff3 --- /dev/null +++ b/项目/HH态CP控制小程序.md @@ -0,0 +1,18 @@ +## 目的 + +与SmallCtrl交互,目的为控制天线等 +## 功能 + +- [x] 程序内独立的命令(setant,seteph) +- [x] 用串口发送AT指令,可开关二进制头 +- [x] 用网口发送udp指令 + + +| 命令 | cmd | key | value | 备注 | +| :----: | :----: | :-: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-: | +| 下发12根数 | seteph | 12 | 521,3,"2025-05-08T00:00:00,30,0,-4227.268,0.00116412597,-5.25908394E-5,-0.589584819,0.503823737,0.884489756,-0.00823131286,4.947983E-13,-2.69184802E-11,-2.17330291E-8,0.0,3.43133385E-25",2023,3,21,8,10,15000 | | +| 天线开关 | setant | 8 | 1/0 | | +| BUC | setant | 6 | | | +| BDC | setant | 7 | | | +| KA发射频率 | setant | 2 | | | +| KA接收频率 | setant | 4 | | |