├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── Ucom.sln └── Ucom ├── Ucom.rc ├── Ucom.vcxproj ├── Ucom.vcxproj.filters ├── res ├── Icon.ico ├── On.bmp ├── Ucom.rc2 └── off.bmp ├── resource.hm ├── src ├── core │ ├── DeConsole.h │ ├── Text.cpp │ ├── Text.h │ ├── UBase.h │ ├── iSocket.cpp │ ├── iSocket.h │ ├── iUart.cpp │ └── iUart.h ├── dialog │ ├── DataWatch.cpp │ ├── DataWatch.h │ ├── Encoder.cpp │ ├── Encoder.h │ ├── GraphDlg.cpp │ ├── GraphDlg.h │ ├── GraphFull.cpp │ ├── GraphFull.h │ ├── MultiSend.cpp │ ├── MultiSend.h │ ├── NetDlg.cpp │ ├── NetDlg.h │ ├── SendFile.cpp │ ├── SendFile.h │ ├── Splitter.cpp │ ├── Splitter.h │ ├── UartDlg.cpp │ ├── UartDlg.h │ ├── Ucom.cpp │ ├── Ucom.h │ ├── UcomDlg.cpp │ ├── UcomDlg.h │ └── UcomDlgBase.cpp ├── lib │ └── ChartCtrl │ │ ├── ChartAxis.cpp │ │ ├── ChartAxis.h │ │ ├── ChartAxisLabel.cpp │ │ ├── ChartAxisLabel.h │ │ ├── ChartBalloonLabel.h │ │ ├── ChartBalloonLabel.inl │ │ ├── ChartBarSerie.cpp │ │ ├── ChartBarSerie.h │ │ ├── ChartCandlestickSerie.cpp │ │ ├── ChartCandlestickSerie.h │ │ ├── ChartCrossHairCursor.cpp │ │ ├── ChartCrossHairCursor.h │ │ ├── ChartCtrl.cpp │ │ ├── ChartCtrl.h │ │ ├── ChartCursor.cpp │ │ ├── ChartCursor.h │ │ ├── ChartDateTimeAxis.cpp │ │ ├── ChartDateTimeAxis.h │ │ ├── ChartDragLineCursor.cpp │ │ ├── ChartDragLineCursor.h │ │ ├── ChartFont.cpp │ │ ├── ChartFont.h │ │ ├── ChartGanttSerie.cpp │ │ ├── ChartGanttSerie.h │ │ ├── ChartGradient.cpp │ │ ├── ChartGradient.h │ │ ├── ChartGrid.cpp │ │ ├── ChartGrid.h │ │ ├── ChartLabel.h │ │ ├── ChartLabel.inl │ │ ├── ChartLegend.cpp │ │ ├── ChartLegend.h │ │ ├── ChartLineSerie.cpp │ │ ├── ChartLineSerie.h │ │ ├── ChartLogarithmicAxis.cpp │ │ ├── ChartLogarithmicAxis.h │ │ ├── ChartMouseListener.h │ │ ├── ChartPointsArray.h │ │ ├── ChartPointsArray.inl │ │ ├── ChartPointsSerie.cpp │ │ ├── ChartPointsSerie.h │ │ ├── ChartScrollBar.cpp │ │ ├── ChartScrollBar.h │ │ ├── ChartSerie.cpp │ │ ├── ChartSerie.h │ │ ├── ChartSerieBase.h │ │ ├── ChartSerieBase.inl │ │ ├── ChartSeriesMouseListener.h │ │ ├── ChartStandardAxis.cpp │ │ ├── ChartStandardAxis.h │ │ ├── ChartString.h │ │ ├── ChartSurfaceSerie.cpp │ │ ├── ChartSurfaceSerie.h │ │ ├── ChartTitle.cpp │ │ ├── ChartTitle.h │ │ ├── ChartXYSerie.cpp │ │ ├── ChartXYSerie.h │ │ └── PointsOrdering.h ├── resource.h ├── stdafx.cpp ├── stdafx.h └── targetver.h └── test ├── requirements.txt └── ucom.py /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | 11 | [Dd]ebug/ 12 | [Rr]elease/ 13 | x64/ 14 | build/ 15 | [Bb]in/ 16 | [Oo]bj/ 17 | 18 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 19 | !packages/*/build/ 20 | 21 | # MSTest test Results 22 | [Tt]est[Rr]esult*/ 23 | [Bb]uild[Ll]og.* 24 | 25 | *_i.c 26 | *_p.c 27 | *.ilk 28 | *.meta 29 | *.obj 30 | *.pch 31 | *.pdb 32 | *.pgc 33 | *.pgd 34 | *.rsp 35 | *.sbr 36 | *.tlb 37 | *.tli 38 | *.tlh 39 | *.tmp 40 | *.tmp_proj 41 | *.log 42 | *.vspscc 43 | *.vssscc 44 | .builds 45 | *.pidb 46 | *.log 47 | *.scc 48 | 49 | 50 | # Visual C++ cache files 51 | ipch/ 52 | *.aps 53 | *.ncb 54 | *.opensdf 55 | *.sdf 56 | *.cachefile 57 | 58 | # Visual Studio profiler 59 | *.psess 60 | *.vsp 61 | *.vspx 62 | 63 | # Guidance Automation Toolkit 64 | *.gpState 65 | 66 | # ReSharper is a .NET coding add-in 67 | _ReSharper*/ 68 | *.[Rr]e[Ss]harper 69 | 70 | # TeamCity is a build add-in 71 | _TeamCity* 72 | 73 | # DotCover is a Code Coverage Tool 74 | *.dotCover 75 | 76 | # NCrunch 77 | *.ncrunch* 78 | .*crunch*.local.xml 79 | 80 | # Installshield output folder 81 | [Ee]xpress/ 82 | 83 | # DocProject is a documentation generator add-in 84 | DocProject/buildhelp/ 85 | DocProject/Help/*.HxT 86 | DocProject/Help/*.HxC 87 | DocProject/Help/*.hhc 88 | DocProject/Help/*.hhk 89 | DocProject/Help/*.hhp 90 | DocProject/Help/Html2 91 | DocProject/Help/html 92 | 93 | # Click-Once directory 94 | publish/ 95 | 96 | # Publish Web Output 97 | *.Publish.xml 98 | 99 | # NuGet Packages Directory 100 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 101 | #packages/ 102 | 103 | # Windows Azure Build Output 104 | csx 105 | *.build.csdef 106 | 107 | # Windows Store app package directory 108 | AppPackages/ 109 | 110 | # Others 111 | sql/ 112 | *.Cache 113 | ClientBin/ 114 | [Ss]tyle[Cc]op.* 115 | ~$* 116 | *~ 117 | *.dbmdl 118 | *.[Pp]ublish.xml 119 | *.pfx 120 | *.publishsettings 121 | 122 | # RIA/Silverlight projects 123 | Generated_Code/ 124 | 125 | # Backup & report files from converting an old project file to a newer 126 | # Visual Studio version. Backup files are not needed, because we have git ;-) 127 | _UpgradeReport_Files/ 128 | Backup*/ 129 | UpgradeLog*.XML 130 | UpgradeLog*.htm 131 | 132 | # SQL Server files 133 | App_Data/*.mdf 134 | App_Data/*.ldf 135 | 136 | 137 | #LightSwitch generated files 138 | GeneratedArtifacts/ 139 | _Pvt_Extensions/ 140 | ModelManifest.xml 141 | 142 | # ========================= 143 | # Windows detritus 144 | # ========================= 145 | 146 | # Windows image file caches 147 | Thumbs.db 148 | ehthumbs.db 149 | 150 | # Folder config file 151 | Desktop.ini 152 | 153 | # Recycle Bin used on file shares 154 | $RECYCLE.BIN/ 155 | 156 | # Mac desktop service store files 157 | .DS_Store 158 | *.db 159 | *.opendb 160 | 161 | # User define 162 | 163 | Output/ 164 | ipch/ 165 | .vs 166 | TODO.md 167 | Ucom/doc/ -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [Uread](https://github.com/creaink/ucom/compare/v1.1.0...HEAD) 4 | 5 | ## [1.1.0](https://github.com/creaink/ucom/compare/v1.0.4...v1.1.0) - 2018-08-30 6 | 7 | ### Added 8 | 9 | - 增加网络面板、支持 TCP server 和 client 及 UDP 10 | - 纵向窗口变化、发送接收纵向窗口调整(上下拖动发送计数旁按钮) 11 | - 增加串口流控制和显示 12 | - 编码查询 -> 编码转换,hex 和字符互相转换 13 | - 添加发送区的 Ctrl + a 的全选快捷键支持 14 | 15 | ### Changed 16 | 17 | - 帮助信息按钮改为跳转网页 18 | 19 | ### Fixed 20 | 21 | - 修复历史命令上下切换 bug、提高数据接收效率 22 | - 修复 hex 接收显示反序问题 23 | 24 | ## [1.0.4](https://github.com/creaink/ucom/compare/v1.0.2...v1.0.4) - 2017-05-27 25 | 26 | ### Added 27 | 28 | - 增加图表功能 29 | 30 | ## [1.0.2](https://github.com/creaink/ucom/compare/v1.0.0...v1.0.2) - 2017-05-10 31 | 32 | ### Added 33 | 34 | - 增加 cmd 模式 35 | 36 | ### Fixed 37 | 38 | - 修复关闭串口时可能弹出参数错误内存不足的错误 39 | - 修复发帧换行的换行叠加,大写 hex 发送错误 40 | - 修复 hex 模式下可能有无关字节的问题 41 | 42 | ## 1.0.0 - 2016-09-29 43 | 44 | ### Added 45 | 46 | - 发布第一个版本 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Creaink 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ucom 2 | 3 | Ucom 是一个基于 MFC 的高效串口、网络调试工具,单可执行文件运行无需依赖动态链接库,支持多开和多种扩展功能。 4 | 5 | ![ucom](https://i.loli.net/2019/03/02/5c7a0fa8ad36b.png) 6 | 7 | Ucom 中串口读写使用 [Serial-Communications-in-Win32](https://docs.microsoft.com/en-us/previous-versions/ms810467(v=mdn.10)),网络使用 [CAsyncSocket](https://docs.microsoft.com/en-us/cpp/mfc/reference/casyncsocket-class?view=vs-2017),图表扩展功能使用了 [High-speed-Charting-Control](https://www.codeproject.com/Articles/14075/High-speed-Charting-Control)。 8 | 9 | 工程建议使用 VS2017 打开,需要提前安装 C++ MFC 组件,可以直接在 [releases](https://github.com/creaink/ucom/releases) 页面下载已编译文件,技术交流 QQ 群:560901616。 10 | 11 | ## 功能 12 | 13 | 已下的功能都针对最新的版本来说,其他版本参考 [Changelog](https://github.com/creaink/ucom/blob/master/CHANGELOG.md)。 14 | 15 | - **多数据源**,提供串口和网络两个数据源,切换数据源,不影响软件的其他功能 16 | - **配置保存功能**,当关闭软件时候会自动保存串口、网络配置里的信息和用户设定的背景色和字体色等配置 17 | - **自定义接收区主题**,可以定制接收框的主题样式 18 | - **扩展工具面板**,点击 `探索>>` 按钮可以在窗口右侧扩展出接收图表、编码解码、接收监视、发送助手等工具面板 19 | - **动态刷新串口**,当有新设备接入时,点击串口号,在下拉菜单里选择刷新串口可以扫描端口变动 20 | - **多编码支持**,完全支持接收区以 UTF-8 和 Unicode 的编码显示 21 | - **透明传输**,不会阻碍 0x00, 0x11 等字节的发送接收 22 | - **支持常用串口流控制** 23 | - **支持文件发送**,建议不要发送太大的文件 24 | - **支持 AT 模式**,回车发送数据(数据包含回车),发送的数据同时以特殊显示格式(红色字体)添到接收显示的新行中,上下方向键调用历史命令(数据),输入框内按 Tab 在开头补上 `AT+` 25 | - **支持面板的拖动**,支持横向、纵向窗口大小调整和发送接收纵向窗口调整 26 | - 提供数据统计和实时传输速率数据显示,快速清空等功能 27 | - 提供 HEX 接收显示和 HEX 模式发送,并对不规范输入进行提醒 28 | - `Ctrl + Enter` 快速发送 29 | 30 | ### 数据源面板 31 | 32 | 点击串口或者网络标签可以切换数据源,**切换面板不影响连接**;数据源面板的信息都会在软件关闭时候保存;点击左侧的开关图标能够切换串口连接状态。 33 | 34 | #### 串口数据源 35 | 36 | - 串口号下拉列表如果选择刷新串口可以动态扫描刷新串口列表 37 | - 关于流控制 38 | 39 | ```txt 40 | 本机 DSR <- 对方 DTR 41 | 本机 DTR -> 对方 DSR 42 | 本机 RTS -> 对方 CTS 43 | 本机 CTS <- 对方 RTS 44 | ``` 45 | 46 | #### 网络数据源 47 | 48 | - 使用网络数据源首先选择协议 49 | - `TCP Client` 模式用于连接 TCP Server,此时的目的IP、目的端口为 Server 的IP、端口,本地 Client 端口随机分配暂不可指定 50 | - `TCP Server` 模式用于建立 TCP Server,此时目的端口为在本机上建立 Server 的端口;连接按钮代表创建 Server,如有客户端连接到服务器,客户端列表会动态增添所有连接到本 Server 的 IP和端口。Server 发送数据需要指定特定的客户端或者选择**所有连接**发送给所有客户端,接收的客户端的数据会以 `【From: IP:Port】` 开始加以分别。 51 | - `UDP` 模式不分 Server 和 Client 模式,此时本地端口为本地监听的端口,目的端口和目的IP为对方 UDP 的监听地址和端口,可以在建立 UDP 信息之后更改 52 | 53 | ### 主面板 54 | 55 | - **满收清空**,当勾选此项时候,当接区达到毗邻的数值输入框的设定值(Byte)时会自动清空 56 | - **快速启动**,可以快速调用常用的工具和系统设置项 57 | - **间隔发送**,当勾选此项时候,当接区达到毗邻的数值输入框的设定值( ms)时会自动发送 58 | - **发帧换行**,当勾选此项时候,自动为发送框的数据末尾添加回车换行符 59 | - **暂停接收**,暂停数据的显示,但是数据依然在后台接收,只是不显示 60 | - **保存接收**,用于保存当前接收框里的文本信息为TXT文件 61 | - 背景色、字体色、字体样式,可以定制接收框的样式,字体样式信息不会保存 62 | 63 | ### 面板调整 64 | 65 | 可以通过拖拽窗口右侧和底侧边框改变收、发框的大小,通过拖动收、发框之间右侧的按钮(发送计数旁按钮)可以改变其布局。 66 | 67 | ### 接收图表 68 | 69 | 接收图表,支持指定格式数值分拣、图形化显示,格式:`空格+通道(0-5)+':'+数据+换行`,如: `printf(" 0:%d 1:%f\n", ...)`,最多支持六通道。 70 | 71 | - 点击**开始**按钮开始从接收区分析绘制数据,**清除**按钮清空图表 72 | - **导出数据**按钮可以保存当前绘制的图表的数据,该数据文件可以用 Excel 打开后另存为表格方便后续分析 73 | - 在**数据列表**选择曲线,在右侧的曲线框调整该曲线的线宽、线色等属性 74 | - **坐标轴**框内选择纵、横坐标轴之后后可以分别调整其属性;轴范围上大下小,当光标失焦时候确定;一条曲线默认只缓存最近 512 个点,建议帧间隔大于 20ms 75 | - **外挂**按钮点击之后弹出的外挂窗口可任意调整大小 76 | - **背景色**按钮可以更改图表的背景颜色 77 | - 在波形图上向右下角拉选取框:放大,反之是还原,右键平移 78 | 79 | ### 编码解码 80 | 81 | - 编码查询,提供三种常用的字符编码的 16 进制编码查询、可变换显示风格 82 | - HEX 解码,从提供的 HEX 字符串尝试解码到三种编码的字符串 83 | 84 | ### 接收监视 85 | 86 | 监视注释,能够以监视数据帧(以 MFC 接收的帧间隔为准)分析数据帧的时间关系,序号大的数据会插入第一行,时间戳精确到毫秒。 87 | 88 | - **开始监视**开始监控数据帧 89 | - **HEX记录**将接收的数据帧以 HEX 字符的方式显示 90 | - **最大记录**勾选之后,记录的数据帧数到达最大记录之后会自动清空数 91 | - 由于列表空间有限,点击数据帧条目之后,在下方的框内会详细显示数据帧的数据 92 | 93 | ### 发送助手 94 | 95 | 发送助手,支持最大十个条目发送,可时间触发轮发或者使用键盘触发某一行发送,也支持使用单独按钮发送。支持自动换行、HEX 模式。 96 | 97 | - 当需要发送的数据较大(或包含回车时)时候可以在下方的输入框输入数据,然后在**传送**按钮旁选择需要传送的条目,之后按下传送按钮可以将输入框内的内容传输至条目当中 98 | - 可以点击每个条目旁的按钮触发单条发送,也可以勾选上方的**键盘触发**之后将光标放到下方输入框,使用英文输入法输入对应按钮上的字母触发发送 99 | - 设置好轮发时间勾选**定时轮发**,会根据时间间隔轮发 10 条记录 100 | 101 | ## 写在最后 102 | 103 | 谨以此小工具感谢长春理工大学电子学会,和在学会里一起努力的小伙伴们,以及那些奋斗日夜。 104 | -------------------------------------------------------------------------------- /Ucom.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28010.2036 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ucom", "Ucom\Ucom.vcxproj", "{2F3CABBB-B51B-43EB-A7DE-BEB235410806}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2F3CABBB-B51B-43EB-A7DE-BEB235410806}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {2F3CABBB-B51B-43EB-A7DE-BEB235410806}.Debug|Win32.Build.0 = Debug|Win32 16 | {2F3CABBB-B51B-43EB-A7DE-BEB235410806}.Release|Win32.ActiveCfg = Release|Win32 17 | {2F3CABBB-B51B-43EB-A7DE-BEB235410806}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {CC22DED0-C703-4514-809E-8C23A02E5C13} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Ucom/Ucom.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/Ucom.rc -------------------------------------------------------------------------------- /Ucom/Ucom.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | Create 106 | Create 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | {2F3CABBB-B51B-43EB-A7DE-BEB235410806} 122 | Ucom 123 | MFCProj 124 | 10.0.17134.0 125 | 126 | 127 | 128 | Application 129 | true 130 | v141 131 | NotSet 132 | Static 133 | 134 | 135 | Application 136 | false 137 | v141 138 | true 139 | NotSet 140 | Static 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | true 154 | $(SolutionDir)Output\Bin\$(Configuration)\ 155 | $(SolutionDir)Output\Obj\$(Configuration)\ 156 | 157 | 158 | false 159 | $(SolutionDir)Output\Bin\$(Configuration)\ 160 | $(SolutionDir)Output\Obj\$(Configuration)\ 161 | 162 | 163 | 164 | Use 165 | Level3 166 | Disabled 167 | WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) 168 | true 169 | $(ProjectDir)src;$(ProjectDir)src\core;$(ProjectDir)src\lib\ChartCtrl;$(ProjectDir)src\dialog;%(AdditionalIncludeDirectories) 170 | 171 | 172 | Windows 173 | true 174 | 175 | 176 | false 177 | true 178 | _DEBUG;%(PreprocessorDefinitions) 179 | 180 | 181 | 0x0804 182 | _DEBUG;%(PreprocessorDefinitions) 183 | $(IntDir);%(AdditionalIncludeDirectories) 184 | 185 | 186 | 187 | 188 | Level3 189 | Use 190 | Full 191 | true 192 | true 193 | WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) 194 | true 195 | Sync 196 | false 197 | $(ProjectDir)src;$(ProjectDir)src\core;$(ProjectDir)src\lib\ChartCtrl;$(ProjectDir)src\dialog;%(AdditionalIncludeDirectories) 198 | true 199 | Speed 200 | 201 | 202 | Windows 203 | true 204 | true 205 | true 206 | true 207 | 208 | 209 | false 210 | true 211 | NDEBUG;%(PreprocessorDefinitions) 212 | 213 | 214 | 0x0804 215 | NDEBUG;%(PreprocessorDefinitions) 216 | $(IntDir);%(AdditionalIncludeDirectories) 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | -------------------------------------------------------------------------------- /Ucom/Ucom.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {b05c26d9-9108-4534-9774-5afd9bec50ac} 6 | 7 | 8 | {e5e19ad4-8f22-4faf-840f-d823503d2439} 9 | 10 | 11 | {d3e03ad3-c16f-4aad-9e36-b00e244da7bf} 12 | 13 | 14 | {f5e82c32-059a-42ff-99f6-d67aa7542863} 15 | 16 | 17 | {ad050153-a09f-4a13-a90c-8ec29f669e67} 18 | 19 | 20 | {dad3dd12-20a5-4fbb-99c8-d93f179e295f} 21 | 22 | 23 | {1ecd68a4-e58a-4499-98eb-4176b12ce66f} 24 | 25 | 26 | {38437ead-3807-44b0-8946-8cdc36192d8d} 27 | 28 | 29 | {76a9acc2-5647-4b2d-af55-34c5a147d0df} 30 | 31 | 32 | {876df184-4b56-4cd0-819f-70c825f585d6} 33 | 34 | 35 | {1ff8d67c-9634-4576-a2af-e48a554666e6} 36 | 37 | 38 | 39 | 40 | Dialog\inc 41 | 42 | 43 | Dialog\inc 44 | 45 | 46 | Dialog\inc 47 | 48 | 49 | Dialog\inc 50 | 51 | 52 | Dialog\inc 53 | 54 | 55 | Dialog\inc 56 | 57 | 58 | Dialog\inc 59 | 60 | 61 | Dialog\inc 62 | 63 | 64 | Dialog\inc 65 | 66 | 67 | Dialog\inc 68 | 69 | 70 | Dialog\inc 71 | 72 | 73 | Core\inc 74 | 75 | 76 | Core\inc 77 | 78 | 79 | Core\inc 80 | 81 | 82 | Core\inc 83 | 84 | 85 | Core\inc 86 | 87 | 88 | Chart\inc 89 | 90 | 91 | Chart\inc 92 | 93 | 94 | Chart\inc 95 | 96 | 97 | Chart\inc 98 | 99 | 100 | Chart\inc 101 | 102 | 103 | Chart\inc 104 | 105 | 106 | Chart\inc 107 | 108 | 109 | Chart\inc 110 | 111 | 112 | Chart\inc 113 | 114 | 115 | Chart\inc 116 | 117 | 118 | Chart\inc 119 | 120 | 121 | Chart\inc 122 | 123 | 124 | Chart\inc 125 | 126 | 127 | Chart\inc 128 | 129 | 130 | Chart\inc 131 | 132 | 133 | Chart\inc 134 | 135 | 136 | Chart\inc 137 | 138 | 139 | Chart\inc 140 | 141 | 142 | Chart\inc 143 | 144 | 145 | Chart\inc 146 | 147 | 148 | Chart\inc 149 | 150 | 151 | Chart\inc 152 | 153 | 154 | Chart\inc 155 | 156 | 157 | Chart\inc 158 | 159 | 160 | Chart\inc 161 | 162 | 163 | Chart\inc 164 | 165 | 166 | Chart\inc 167 | 168 | 169 | Chart\inc 170 | 171 | 172 | Chart\inc 173 | 174 | 175 | Chart\inc 176 | 177 | 178 | Chart\inc 179 | 180 | 181 | MFC 182 | 183 | 184 | MFC 185 | 186 | 187 | MFC 188 | 189 | 190 | 191 | 192 | Dialog\src 193 | 194 | 195 | Dialog\src 196 | 197 | 198 | Dialog\src 199 | 200 | 201 | Dialog\src 202 | 203 | 204 | Dialog\src 205 | 206 | 207 | Dialog\src 208 | 209 | 210 | Dialog\src 211 | 212 | 213 | Dialog\src 214 | 215 | 216 | Dialog\src 217 | 218 | 219 | Dialog\src 220 | 221 | 222 | Dialog\src 223 | 224 | 225 | Dialog\src 226 | 227 | 228 | Core\src 229 | 230 | 231 | Core\src 232 | 233 | 234 | Core\src 235 | 236 | 237 | Chart\src 238 | 239 | 240 | Chart\src 241 | 242 | 243 | Chart\src 244 | 245 | 246 | Chart\src 247 | 248 | 249 | Chart\src 250 | 251 | 252 | Chart\src 253 | 254 | 255 | Chart\src 256 | 257 | 258 | Chart\src 259 | 260 | 261 | Chart\src 262 | 263 | 264 | Chart\src 265 | 266 | 267 | Chart\src 268 | 269 | 270 | Chart\src 271 | 272 | 273 | Chart\src 274 | 275 | 276 | Chart\src 277 | 278 | 279 | Chart\src 280 | 281 | 282 | Chart\src 283 | 284 | 285 | Chart\src 286 | 287 | 288 | Chart\src 289 | 290 | 291 | Chart\src 292 | 293 | 294 | Chart\src 295 | 296 | 297 | Chart\src 298 | 299 | 300 | Chart\src 301 | 302 | 303 | Chart\src 304 | 305 | 306 | MFC 307 | 308 | 309 | 310 | 311 | Resource 312 | 313 | 314 | Resource 315 | 316 | 317 | Resource 318 | 319 | 320 | 321 | 322 | Resource 323 | 324 | 325 | 326 | 327 | Resource 328 | 329 | 330 | -------------------------------------------------------------------------------- /Ucom/res/Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/res/Icon.ico -------------------------------------------------------------------------------- /Ucom/res/On.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/res/On.bmp -------------------------------------------------------------------------------- /Ucom/res/Ucom.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/res/Ucom.rc2 -------------------------------------------------------------------------------- /Ucom/res/off.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/res/off.bmp -------------------------------------------------------------------------------- /Ucom/resource.hm: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated Help ID include file. 2 | // Used by Ucom.rc 3 | // 4 | #define HIDC_PicUartStatus 0x80660403 // IDD_UCOM_DIALOG 5 | -------------------------------------------------------------------------------- /Ucom/src/core/DeConsole.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* console debug, use cout to output debug info */ 4 | //#define USING_CONSLOE 5 | #ifdef USING_CONSLOE 6 | 7 | #include 8 | #include 9 | #pragma warning(disable:4996) 10 | 11 | using std::cin; 12 | using std::cout; 13 | using std::endl; 14 | 15 | using std::hex; 16 | using std::dec; 17 | 18 | inline void InitDebugConsole(void){ 19 | AllocConsole(); 20 | freopen("CONOUT$", "w+t", stdout); 21 | freopen("CONIN$", "r+t", stdin); 22 | } 23 | #endif -------------------------------------------------------------------------------- /Ucom/src/core/Text.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/core/Text.cpp -------------------------------------------------------------------------------- /Ucom/src/core/Text.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | // text bank 5 | class TextBank 6 | { 7 | private: 8 | static const char HexTable[17]; 9 | int ByteCnt; 10 | CString DataStr; 11 | public: 12 | TextBank(void); 13 | virtual ~TextBank(); 14 | 15 | void AppendString(CString &mStr, bool isHexFormat = false); 16 | void ReString(CString &mStr, bool isHexFormat = false); 17 | unsigned char ValueOfString(LPCTSTR buffer); 18 | 19 | const CString &GetCStrData(void) 20 | { 21 | return DataStr; 22 | } 23 | 24 | unsigned int GetLength(void) 25 | { 26 | return ByteCnt; 27 | } 28 | 29 | void ClearData(void) 30 | { 31 | DataStr.Empty(); 32 | ByteCnt = 0; 33 | } 34 | 35 | static int isHexChar(char ch) 36 | { 37 | if ((ch <= '9' && ch >= '0') 38 | || (ch <= 'F' && ch >= 'A') 39 | || (ch <= 'f' && ch >= 'a')) 40 | return 1; 41 | else if (ch == ' ') 42 | return 2; 43 | else 44 | return 0; 45 | } 46 | 47 | }; 48 | -------------------------------------------------------------------------------- /Ucom/src/core/UBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | 6 | // register global message 7 | // at *.h file: afx_msg LRESULT OnMyReceiveMsg(WPARAM wParam, LPARAM lParam); 8 | // at *.cpp file: ON_REGISTERED_MESSAGE(WM_MYONRECVMSG, OnMyReceiveMsg) 9 | // implement this method in the class 10 | const UINT WM_MYONRECVMSG = ::RegisterWindowMessage(_T("ONRECEIVE")); 11 | 12 | #define WH_MASK 0xFFFF0000 13 | #define WL_MASK 0x0000FFFF 14 | #define WKIND_MASK 0x000F0000 15 | #define WH_UCOM_UART 0x00010000 16 | #define WH_UCOM_NET 0x00020000 17 | #define WH_UCOM_SUBNET 0x00120000 18 | 19 | #define WL_UCOM_OPEN 0x00000001 20 | #define WL_UCOM_CLOSE 0x00000002 21 | #define WL_UCOM_RECV 0x00000003 22 | 23 | #define W_UART_RECV 0x00010003 24 | #define W_NET_RECV 0x00020003 25 | #define W_SUBNET_RECV 0x00120003 26 | 27 | #define W_SUBNET_OPEN 0x00120004 28 | #define W_SUBNET_CLOSE 0x00120005 29 | 30 | 31 | // custom message 32 | #define WM_NETDLG_MSG (WM_USER + 2) 33 | #define WM_UARTDLG_MSG (WM_USER + 3) 34 | 35 | 36 | // abstract of async send and read 37 | class UcomBase 38 | { 39 | public: 40 | UcomBase() { 41 | } 42 | ~UcomBase() { 43 | } 44 | virtual int AsyncSend(const CString &dataStr) = 0; 45 | virtual int AsyncRead(CString &dataStr, CString & infoStr, WPARAM wParam, LPARAM lParam) = 0; 46 | virtual bool IsRWable (void) = 0; 47 | }; 48 | -------------------------------------------------------------------------------- /Ucom/src/core/iSocket.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/core/iSocket.cpp -------------------------------------------------------------------------------- /Ucom/src/core/iSocket.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "UBase.h" 5 | #include "DeConsole.h" 6 | 7 | #define ISOCKET_READBUFF_MAX 4086 8 | 9 | typedef struct 10 | { 11 | CString strIP; 12 | void *hSocket; 13 | } nSocketPara; 14 | 15 | 16 | // socket client class, will be dynamic created at ISocket server mode 17 | class nSocket :public CAsyncSocket 18 | { 19 | private: 20 | HWND hwParent; 21 | HWND hwTopParent; 22 | nSocketPara mPara; 23 | public: 24 | nSocket(HWND pParent, HWND pTopParent) { 25 | hwParent = pParent; 26 | hwTopParent = pTopParent; 27 | } 28 | ~nSocket(); 29 | 30 | void SetSocketHandle(void *hSock) { 31 | mPara.hSocket = hSock; 32 | } 33 | void OnReceive(int nErrorCode); 34 | 35 | void OnSend(int nErrorCode); 36 | 37 | void OnConnect(int nErrorCode); 38 | 39 | void OnClose(int nErrorCode); 40 | 41 | void PostMsgIsOpen(bool isOpen); 42 | void GetClientInfo(void); 43 | int UnblockRead(CString &dataStr); 44 | }; 45 | 46 | // server socket 47 | class iSocket :public CAsyncSocket 48 | { 49 | private: 50 | // socket is ready for read and write 51 | bool isSocketOpen; 52 | // parent dialog HWND, use for send message to non-main dailog 53 | HWND hwParent; 54 | HWND hwTopParent; 55 | public: 56 | iSocket(); 57 | ~iSocket(); 58 | CArray nClient; 59 | void SetParentHWND(HWND pParent, HWND pTopParent) { 60 | hwParent = pParent; 61 | hwTopParent = pTopParent; 62 | } 63 | void DelFromClient(nSocket *mclient); 64 | void DelAllClient(void); 65 | 66 | void OnReceive(int nErrorCode); 67 | 68 | void OnAccept(int nErrorCode); 69 | 70 | void OnConnect(int nErrorCode); 71 | 72 | void OnClose(int nErrorCode); 73 | 74 | void PostMsgIsOpen(bool isOpen); 75 | int UnblockRead(CString &dataStr); 76 | int UnblockRead(CString & dataStr, CString & infoStr); 77 | 78 | int UnblockSend(const CString & dataStr) 79 | { 80 | return Send((LPCTSTR)dataStr, dataStr.GetLength()); 81 | } 82 | 83 | bool IsScoketOpen(void) 84 | { 85 | return isSocketOpen; 86 | } 87 | // use for UDP Socket, need open or close in the pannel 88 | void SetIsOpen(bool isopen) 89 | { 90 | isSocketOpen = isopen; 91 | } 92 | }; -------------------------------------------------------------------------------- /Ucom/src/core/iUart.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/core/iUart.cpp -------------------------------------------------------------------------------- /Ucom/src/core/iUart.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "UBase.h" 4 | 5 | #define IUART_BUFF_MAX 1024 6 | 7 | typedef struct 8 | { 9 | // serial-port HANDLE 10 | HANDLE *commHandle; 11 | // unused 12 | HWND hwParent; 13 | HWND hwTopParent; 14 | }ThreadPara; 15 | 16 | 17 | class iUart 18 | { 19 | private: 20 | HANDLE hUartCom; 21 | DCB uartConfig; 22 | CString ComName; 23 | 24 | OVERLAPPED m_osRead; 25 | OVERLAPPED m_osWrite; 26 | ThreadPara mThreadPara; 27 | 28 | HWND hwParent; 29 | HWND hwTopParent; 30 | public: 31 | 32 | iUart(){ 33 | hUartCom = NULL; 34 | mThreadPara.commHandle = &hUartCom; 35 | } 36 | ~iUart(); 37 | 38 | void ClosePort(void){ 39 | CloseHandle(hUartCom); 40 | hUartCom = NULL; 41 | TRACE("Close PortHandle\n"); 42 | } 43 | 44 | bool OpenCom(bool isBlockMode = true); 45 | bool ConfigUart(CString comName, DCB mConfig); 46 | 47 | void GetComList(CComboBox *cblist); 48 | 49 | int WriteCString(const CString &cBuffer); 50 | CString ReadCString(void); 51 | 52 | int UnblockRead(CString &dataStr); 53 | int UnblockSend(const CString &dataStr); 54 | 55 | void SetParentHWND(HWND pParent, HWND pTopParent) 56 | { 57 | hwParent = pParent; 58 | hwTopParent = pTopParent; 59 | } 60 | 61 | HANDLE GetHandle(void) 62 | { 63 | return hUartCom; 64 | } 65 | 66 | HANDLE* GetHandleAddr(void) 67 | { 68 | return &hUartCom; 69 | } 70 | 71 | bool isConnected(void) 72 | { 73 | if (hUartCom == NULL) 74 | return false; 75 | else 76 | return true; 77 | } 78 | 79 | ThreadPara *GetThreadStartPara(void) 80 | { 81 | mThreadPara.hwParent = hwParent; 82 | mThreadPara.hwTopParent = hwTopParent; 83 | return &mThreadPara; 84 | } 85 | 86 | }; 87 | 88 | 89 | UINT RxThreadFunc(LPVOID mThreadPara); 90 | -------------------------------------------------------------------------------- /Ucom/src/dialog/DataWatch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/DataWatch.cpp -------------------------------------------------------------------------------- /Ucom/src/dialog/DataWatch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // CDataWatch Dialog 4 | 5 | class CDataWatch : public CDialog 6 | { 7 | DECLARE_DYNAMIC(CDataWatch) 8 | 9 | public: 10 | CDataWatch(CWnd* pParent = NULL); // Standard constructor 11 | virtual ~CDataWatch(); 12 | 13 | // Dialog data 14 | enum { IDD = IDD_WATCH }; 15 | 16 | protected: 17 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 18 | 19 | DECLARE_MESSAGE_MAP() 20 | 21 | private: 22 | bool isRecData,isFullClear; 23 | int ItemCnt,MaxItem; 24 | 25 | static const char HexTable[]; 26 | 27 | CListCtrl *pList; 28 | void ClearList(void); 29 | void ChangeMaxItem(void); 30 | 31 | public: 32 | virtual BOOL OnInitDialog(); 33 | void CDataWatch::AddItem(CString str); 34 | afx_msg void OnBnClickedBtnwatch(); 35 | afx_msg void OnBnClickedCkbdisphex(); 36 | afx_msg void OnEnChangeEdbmaxlist(); 37 | afx_msg void OnBnClickedBtnclearlist(); 38 | afx_msg void OnClickListwatch(NMHDR *pNMHDR, LRESULT *pResult); 39 | virtual void OnOK(); 40 | virtual BOOL PreTranslateMessage(MSG* pMsg); 41 | }; 42 | -------------------------------------------------------------------------------- /Ucom/src/dialog/Encoder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/Encoder.cpp -------------------------------------------------------------------------------- /Ucom/src/dialog/Encoder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxwin.h" 3 | #include "Text.h" 4 | 5 | // CEncoder Dialog 6 | 7 | class CEncoder : public CDialog 8 | { 9 | DECLARE_DYNAMIC(CEncoder) 10 | 11 | public: 12 | CEncoder(CWnd* pParent = NULL); 13 | virtual ~CEncoder(); 14 | 15 | // Dialog data 16 | enum { IDD = IDD_ENCODER }; 17 | 18 | protected: 19 | virtual void DoDataExchange(CDataExchange* pDX); 20 | private: 21 | int encSel; 22 | public: 23 | CString GetAsciiCode(CString &str); 24 | static const char HexTable[17]; 25 | CString Ascii2Unicode(CString &strascii); 26 | CString Ascii2Utf8(CString &strascii); 27 | CString Unicode2Ascii(const CString &dataStr); 28 | CString Utf8toAscii(const CString &dataStr); 29 | 30 | CString GetHexString(CString &dataStr); 31 | CString GetDecString(const CString &dataStr); 32 | TextBank DataDec; 33 | 34 | DECLARE_MESSAGE_MAP() 35 | 36 | afx_msg void OnEnChangeEncinput(); 37 | afx_msg void OnBnClickedEncclear(); 38 | // CStatic mEncDisp; 39 | int m_RadioEnc; 40 | afx_msg void OnClickedRadio1(); 41 | virtual void OnOK(); 42 | virtual BOOL OnInitDialog(); 43 | afx_msg void OnSelchangeEncEec(); 44 | virtual BOOL PreTranslateMessage(MSG* pMsg); 45 | }; 46 | -------------------------------------------------------------------------------- /Ucom/src/dialog/GraphDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/GraphDlg.cpp -------------------------------------------------------------------------------- /Ucom/src/dialog/GraphDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #define MAX_LOADSTRING 100 5 | #include "ChartCtrl.h" 6 | #include "ChartLineSerie.h" 7 | #include "PointsOrdering.h" 8 | 9 | #include "GraphFull.h" 10 | // CGraphDlg Dialog 11 | 12 | #define MAX_GRAPH_LINES 6 13 | #define MAX_GRAPH_POINT 512 14 | struct 15 | { 16 | double dataNew; 17 | double data[MAX_GRAPH_POINT]; 18 | 19 | COLORREF color; 20 | bool IsVisible; 21 | CChartLineSerie *pLineSerie; 22 | }typedef LineData; 23 | 24 | class CGraphDlg : public CDialog 25 | { 26 | DECLARE_DYNAMIC(CGraphDlg) 27 | 28 | public: 29 | CGraphDlg(CWnd* pParent = NULL); // Standard constructor 30 | virtual ~CGraphDlg(); 31 | 32 | // Dialog data 33 | enum { IDD = IDD_GRAPH }; 34 | 35 | protected: 36 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 37 | 38 | public: 39 | void AddDataString(CString str); 40 | void FlashGraph(); 41 | bool ColorPicker(COLORREF &color); 42 | COLORREF HSI2RGB(double H, double S, double I); 43 | void DoDDX_Control(bool isAttach); 44 | private: 45 | bool isGraph, isFullGraph; 46 | void InitChart(void); 47 | void InitLines(void); 48 | double lineXdata[MAX_GRAPH_POINT]; 49 | 50 | CChartCtrl mChartCtrl; 51 | CChartStandardAxis* pBottomAxis; 52 | CChartStandardAxis* pLeftAxis; 53 | CChartStandardAxis* pAxisNow; 54 | 55 | CListCtrl *pList; 56 | LineData lines[MAX_GRAPH_LINES]; 57 | int pLineNow; 58 | 59 | bool listColorAvailable; 60 | CGraphFull GraphFullDlg; 61 | 62 | DECLARE_MESSAGE_MAP() 63 | public: 64 | 65 | virtual BOOL OnInitDialog(); 66 | afx_msg void OnBnClickedBtncleargraph(); 67 | afx_msg void OnPaint(); 68 | virtual void OnOK(); 69 | afx_msg void OnBnClickedBtnstartgraph(); 70 | afx_msg void OnBnClickedRadAxis(); 71 | afx_msg void OnBnClickedCkbaxisscroll(); 72 | afx_msg void OnBnClickedCkbaxisauto(); 73 | afx_msg void OnEdbaxismin(); 74 | afx_msg void OnEdbaxismax(); 75 | afx_msg void OnBnClickedCkbaxisgrid(); 76 | afx_msg void OnBnClickedBtngraphcolor(); 77 | afx_msg void OnCustomdrawLstlinedata(NMHDR *pNMHDR, LRESULT *pResult); 78 | afx_msg void OnBnClickedCkblinev(); 79 | afx_msg void OnClickLstlinedata(NMHDR *pNMHDR, LRESULT *pResult); 80 | afx_msg void OnBnClickedBtnlinecolor(); 81 | afx_msg void OnSelendokCblinewidth(); 82 | afx_msg void OnSelendokCblinepen(); 83 | afx_msg void OnBnClickedBtnsaveline(); 84 | afx_msg void OnBnClickedBtngraphfull(); 85 | afx_msg LRESULT CloseGraphFull(WPARAM wParam, LPARAM lParam); 86 | virtual BOOL PreTranslateMessage(MSG* pMsg); 87 | }; 88 | -------------------------------------------------------------------------------- /Ucom/src/dialog/GraphFull.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/GraphFull.cpp -------------------------------------------------------------------------------- /Ucom/src/dialog/GraphFull.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WM_COMM_CLOSE_ME_MSG (WM_USER + 3) 4 | // CGraphFull Dialog 5 | #include "ChartCtrl.h" 6 | 7 | class CGraphFull : public CDialog 8 | { 9 | private: 10 | CChartCtrl *pChartCtrl; 11 | 12 | DECLARE_DYNAMIC(CGraphFull) 13 | public: 14 | CGraphFull::CGraphFull(CChartCtrl *pChart, CWnd* pParent = NULL); // Standard constructor 15 | virtual ~CGraphFull(); 16 | HWND pMianHwnd; 17 | void DoDDX_Control(bool isAttach); 18 | void Resize(LONG Bottom, LONG Right); 19 | // Dialog data 20 | #ifdef AFX_DESIGN_TIME 21 | enum { IDD = IDD_GraphFull }; 22 | #endif 23 | 24 | protected: 25 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 26 | 27 | DECLARE_MESSAGE_MAP() 28 | public: 29 | afx_msg void OnSize(UINT nType, int cx, int cy); 30 | // virtual void OnCancel(); 31 | virtual BOOL OnInitDialog(); 32 | afx_msg void OnClose(); 33 | virtual void OnCancel(); 34 | }; 35 | -------------------------------------------------------------------------------- /Ucom/src/dialog/MultiSend.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/MultiSend.cpp -------------------------------------------------------------------------------- /Ucom/src/dialog/MultiSend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | // CMultiSend Dialog 5 | // Send helper 6 | #include "Text.h" 7 | #include "UBase.h" 8 | 9 | #define LOOP_SEND_ID 1020 10 | class CMultiSend : public CDialog 11 | { 12 | DECLARE_DYNAMIC(CMultiSend) 13 | 14 | public: 15 | CMultiSend::CMultiSend(CWnd* pParent, UcomBase** mbase); 16 | virtual ~CMultiSend(); 17 | 18 | // Dialog data 19 | enum { IDD = IDD_XSEND }; 20 | 21 | 22 | private: 23 | bool isHotKey; 24 | void LoopSendSet(void); 25 | 26 | TextBank txData; 27 | void SendEdbox(int index); 28 | int UnblockSend(const CString &dataStr); 29 | void OnTimeSend(bool clearcnt=false); 30 | BOOL PreTranslateMessage(MSG* pMsg); 31 | 32 | UcomBase** uuBase; 33 | protected: 34 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 35 | 36 | 37 | 38 | DECLARE_MESSAGE_MAP() 39 | public: 40 | afx_msg void OnBnClickedCkbtimexsend(); 41 | afx_msg void OnTimer(UINT_PTR nIDEvent); 42 | virtual BOOL OnInitDialog(); 43 | afx_msg void OnEnChangeEdbtimexsend(); 44 | virtual void OnOK(); 45 | afx_msg void OnBnClickedBtnsend(UINT uId); 46 | afx_msg void OnDropdownCbtransnum(); 47 | afx_msg void OnBnClickedBtntrans(); 48 | afx_msg void OnClickedCkbxhotkey(); 49 | }; 50 | -------------------------------------------------------------------------------- /Ucom/src/dialog/NetDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/NetDlg.cpp -------------------------------------------------------------------------------- /Ucom/src/dialog/NetDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include "UBase.h" 5 | #include "iSocket.h" 6 | 7 | // CNetDlg Dialog 8 | enum NetDlg_Type 9 | { 10 | netdlg_tcpserver = 0, 11 | netdlg_tcpclient = 1, 12 | netdlg_udp = 2 13 | }; 14 | #define NETDLG_TCP_CLIENT 0 15 | #define NETDLG_TCP_SERVER 1 16 | #define NETDLG_UDP 2 17 | 18 | class CNetDlg : public CDialog, public UcomBase 19 | { 20 | DECLARE_DYNAMIC(CNetDlg) 21 | 22 | private: 23 | // receive thread HADNLE 24 | HANDLE hRxThread; 25 | iSocket mSocket; 26 | bool isWorking; 27 | int curSender; // current send client 28 | int typeSel; 29 | CString infoServer, infoLocal; 30 | HWND hwTopParent; 31 | public: 32 | CNetDlg(CWnd* pParent = NULL); 33 | virtual ~CNetDlg(); 34 | void SethwTopParent(HWND pTopParent) { 35 | hwTopParent = pTopParent; 36 | } 37 | 38 | void InitPanel(void); 39 | void SwPanel(bool choose); 40 | void EnableIPIn(int type); 41 | void ChangeBmpPic(int PicCtrlID, unsigned short nPicID); 42 | void SetTips(CString tips); 43 | void GetDstIPStr(CString &str); 44 | 45 | void LoadRegConfig(); 46 | // when parent dialog close should invoke OnClose to save data 47 | void WriteRegData(void); 48 | 49 | // client list process 50 | void DelClient(nSocketPara *nPara); 51 | void AddClient(nSocketPara *nPara); 52 | void CleanClient(void); 53 | 54 | void OpenSocket(void); 55 | 56 | int AsyncSend(const CString &dataStr); 57 | int AsyncRead(CString &dataStr, CString & infoStr, WPARAM wParam, LPARAM lParam); 58 | bool IsRWable(void) { 59 | return mSocket.IsScoketOpen(); 60 | } 61 | 62 | // Dialog data 63 | #ifdef AFX_DESIGN_TIME 64 | enum { IDD = IDD_NET }; 65 | #endif 66 | 67 | protected: 68 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 69 | 70 | DECLARE_MESSAGE_MAP() 71 | public: 72 | afx_msg void OnBtnConnect(); 73 | afx_msg void OnPaint(); 74 | virtual BOOL OnInitDialog(); 75 | afx_msg void OnEditPortSendComplete(); 76 | afx_msg LRESULT CNetDlg::OnMyReceiveMsg(WPARAM wParam, LPARAM lParam); 77 | afx_msg void OnSelNetType(); 78 | afx_msg void OnSelChangeCient(); 79 | afx_msg void OnEditPortRecvComplete(); 80 | afx_msg void OnClickedNpicuartstatus(); 81 | virtual BOOL PreTranslateMessage(MSG* pMsg); 82 | }; 83 | -------------------------------------------------------------------------------- /Ucom/src/dialog/SendFile.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/SendFile.cpp -------------------------------------------------------------------------------- /Ucom/src/dialog/SendFile.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/SendFile.h -------------------------------------------------------------------------------- /Ucom/src/dialog/Splitter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/Splitter.cpp -------------------------------------------------------------------------------- /Ucom/src/dialog/Splitter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // CSplitter 6 | #define SPF_TOP 0x0010 /* distance of the control to the top of the window will be constant */ 7 | #define SPF_BOTTOM 0x0020 /* distance of the control to the bottom of the window will be constant */ 8 | #define SPF_LEFT 0x0040 /* distance of the control to the left of the window will be constant */ 9 | #define SPF_RIGHT 0x0080 /* distance of the control to the right of the window will be constant */ 10 | 11 | #define UWM_SPLIT_MOVED_MSG _T("UWM_SPLIT_MOVED_MSG ") 12 | static UINT UWM_SPLIT_MOVED = ::RegisterWindowMessage(UWM_SPLIT_MOVED_MSG); 13 | 14 | enum { 15 | CS_VERT = 1, 16 | CS_HORZ = 2, 17 | CS_NONE = 0 18 | }; 19 | 20 | class CSplitter : public CButton 21 | { 22 | public: 23 | CSplitter(); 24 | 25 | public: 26 | void AddToBottomOrRightCtrls(UINT nCtrlId, WORD nFlags = SPF_TOP | SPF_LEFT | SPF_RIGHT | SPF_BOTTOM); 27 | void AddToTopOrLeftCtrls(UINT nCtrlId, WORD nFlags = SPF_TOP | SPF_LEFT | SPF_BOTTOM | SPF_RIGHT); 28 | void SetType(UINT nType); 29 | void SetBottomLimit(UINT nCtrlId); 30 | virtual ~CSplitter(); 31 | 32 | 33 | protected: 34 | //{{AFX_MSG(CSplitter) 35 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 36 | afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 37 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); 38 | //afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); 39 | //}}AFX_MSG 40 | 41 | DECLARE_MESSAGE_MAP() 42 | private: 43 | unsigned int m_nType; 44 | std::vector m_vtTopLeftControls; 45 | std::vector m_vtBottomRightControls; 46 | CWnd * m_pOldDragCapture; 47 | CPoint m_ptStartDrag, m_ptStartPos; 48 | bool m_bDragging; 49 | HCURSOR m_hCursor; 50 | CRect m_rectMax; 51 | // DECLARE_DYNAMIC(CSplitter) 52 | // 53 | //public: 54 | // CSplitter(); 55 | // virtual ~CSplitter(); 56 | // 57 | //protected: 58 | // DECLARE_MESSAGE_MAP() 59 | }; 60 | 61 | 62 | -------------------------------------------------------------------------------- /Ucom/src/dialog/UartDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/UartDlg.cpp -------------------------------------------------------------------------------- /Ucom/src/dialog/UartDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "iUart.h" 4 | 5 | 6 | // CUartDlg Dialog 7 | class CUartDlg : public CDialog, public UcomBase 8 | { 9 | DECLARE_DYNAMIC(CUartDlg) 10 | 11 | private: 12 | HANDLE hRxThread; // receive thread HANDLE 13 | HWND hwTopParent; // top dailog HWND 14 | bool IsUartPortAvailable(void); 15 | // panne is working 16 | bool isWorking; 17 | iUart mUart; 18 | void ClearFlowCtrlStats(void); 19 | public: 20 | 21 | void InitPanel(void); 22 | void SwPanel(bool choose); 23 | void ChangeBmpPic(int PicCtrlID, unsigned short nPicID); 24 | 25 | void OpenUart(); 26 | 27 | void OnDropdownCbUartPort(); 28 | void OnSelendokCbUartPort(); 29 | 30 | DCB GetUartConfigDCB(void); 31 | void LoadRegConfig(); 32 | void GetRegData(CString &comName, CString &dcbConfig); 33 | // when parent dialog close should invoke OnClose to save data 34 | void WriteRegData(void); 35 | 36 | void SethwTopParent(HWND pTopParent) { 37 | hwTopParent = pTopParent; 38 | } 39 | int AsyncSend(const CString &dataStr) { 40 | if (!isWorking) 41 | return -1; 42 | return mUart.UnblockSend(dataStr); 43 | } 44 | int AsyncRead(CString &dataStr, CString & infoStr, WPARAM wParam, LPARAM lParam) { 45 | if (!isWorking) 46 | return -1; 47 | return mUart.UnblockRead(dataStr); 48 | } 49 | bool IsRWable(void) { 50 | return isWorking; 51 | } 52 | public: 53 | CUartDlg(CWnd* pParent = NULL); // Standard constructor 54 | virtual ~CUartDlg(); 55 | 56 | // Dialog data 57 | #ifdef AFX_DESIGN_TIME 58 | enum { IDD = IDD_UART }; 59 | #endif 60 | 61 | protected: 62 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 63 | 64 | DECLARE_MESSAGE_MAP() 65 | public: 66 | afx_msg void OnBtnOpen(); 67 | virtual BOOL OnInitDialog(); 68 | afx_msg void OnPaint(); 69 | afx_msg void OnStnClickedPicuartstatus(); 70 | afx_msg void OnBnClickedCkbdtr(); 71 | afx_msg void OnBnClickedCkbrts(); 72 | afx_msg LRESULT OnMyReceiveMsg(WPARAM wParam, LPARAM lParam); 73 | virtual BOOL PreTranslateMessage(MSG* pMsg); 74 | }; 75 | -------------------------------------------------------------------------------- /Ucom/src/dialog/Ucom.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/Ucom.cpp -------------------------------------------------------------------------------- /Ucom/src/dialog/Ucom.h: -------------------------------------------------------------------------------- 1 | 2 | // Ucom.h : PROJECT_NAME Application Header file 3 | // 4 | 5 | #pragma once 6 | 7 | #ifndef __AFXWIN_H__ 8 | #error "include this file before include stdafx.h to generate PCH file" 9 | #endif 10 | 11 | #include "resource.h" // main symbol 12 | #include "DeConsole.h" 13 | 14 | // CUcomApp: 15 | // refer Ucom.cpp 16 | // 17 | 18 | class CUcomApp : public CWinApp 19 | { 20 | public: 21 | CUcomApp(); 22 | 23 | // overide 24 | public: 25 | virtual BOOL InitInstance(); 26 | 27 | // implement 28 | 29 | DECLARE_MESSAGE_MAP() 30 | }; 31 | 32 | extern CUcomApp theApp; -------------------------------------------------------------------------------- /Ucom/src/dialog/UcomDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/UcomDlg.cpp -------------------------------------------------------------------------------- /Ucom/src/dialog/UcomDlg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/UcomDlg.h -------------------------------------------------------------------------------- /Ucom/src/dialog/UcomDlgBase.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/dialog/UcomDlgBase.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartAxis.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartAxis.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartAxis.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartAxis.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartAxisLabel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartAxisLabel.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartAxisLabel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartAxisLabel.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartBalloonLabel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartBalloonLabel.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartBalloonLabel.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartBalloonLabel.inl -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartBarSerie.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartBarSerie.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartBarSerie.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartBarSerie.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartCandlestickSerie.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartCandlestickSerie.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartCandlestickSerie.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartCandlestickSerie.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartCrossHairCursor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartCrossHairCursor.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartCrossHairCursor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartCrossHairCursor.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartCtrl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartCtrl.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartCtrl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartCtrl.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartCursor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartCursor.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartCursor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartCursor.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartDateTimeAxis.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartDateTimeAxis.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartDateTimeAxis.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartDateTimeAxis.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartDragLineCursor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartDragLineCursor.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartDragLineCursor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartDragLineCursor.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartFont.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartFont.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartFont.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartFont.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartGanttSerie.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartGanttSerie.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartGanttSerie.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartGanttSerie.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartGradient.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartGradient.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartGradient.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartGradient.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartGrid.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartGrid.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartGrid.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartGrid.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartLabel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartLabel.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartLabel.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartLabel.inl -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartLegend.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartLegend.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartLegend.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartLegend.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartLineSerie.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartLineSerie.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartLineSerie.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartLineSerie.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartLogarithmicAxis.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartLogarithmicAxis.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartLogarithmicAxis.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartLogarithmicAxis.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartMouseListener.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartMouseListener.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartPointsArray.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartPointsArray.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartPointsArray.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartPointsArray.inl -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartPointsSerie.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartPointsSerie.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartPointsSerie.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartPointsSerie.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartScrollBar.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartScrollBar.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartScrollBar.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartScrollBar.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartSerie.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartSerie.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartSerie.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartSerie.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartSerieBase.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartSerieBase.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartSerieBase.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartSerieBase.inl -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartSeriesMouseListener.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartSeriesMouseListener.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartStandardAxis.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartStandardAxis.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartStandardAxis.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartStandardAxis.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartString.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartString.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartSurfaceSerie.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartSurfaceSerie.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartSurfaceSerie.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartSurfaceSerie.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartTitle.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartTitle.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartTitle.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartTitle.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartXYSerie.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartXYSerie.cpp -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/ChartXYSerie.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/ChartXYSerie.h -------------------------------------------------------------------------------- /Ucom/src/lib/ChartCtrl/PointsOrdering.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/lib/ChartCtrl/PointsOrdering.h -------------------------------------------------------------------------------- /Ucom/src/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/resource.h -------------------------------------------------------------------------------- /Ucom/src/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/stdafx.cpp -------------------------------------------------------------------------------- /Ucom/src/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/stdafx.h -------------------------------------------------------------------------------- /Ucom/src/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creaink/ucom/7fabf4791456296871081ee87e112a9d5c64a046/Ucom/src/targetver.h -------------------------------------------------------------------------------- /Ucom/test/requirements.txt: -------------------------------------------------------------------------------- 1 | pyserial -------------------------------------------------------------------------------- /Ucom/test/ucom.py: -------------------------------------------------------------------------------- 1 | # coding:utf-8 2 | # 对于串口的测试可以使用 vspd 建立成对的虚拟串口 3 | # 可以使用 ipython 加载此文件内的函数方便测试 4 | 5 | import time 6 | import serial 7 | import math 8 | import random 9 | import socket 10 | 11 | # 测试串口图像 12 | def testUartGraph(): 13 | com = serial.Serial('com2', 115200) 14 | i = 0 15 | while 1: 16 | i=i+1 17 | s = ' 0:%.2f 1:%g 2:%d 3:%d 4:%d 5:10.0\n'%(50*math.sin((i%20)*2*math.pi/20), random.randint(0,100)-50, (i%50), (i%100 -50), (i%50 -10)) 18 | com.write(s.encode()) 19 | time.sleep(0.1) 20 | 21 | # 测试 ucom 的多 tcp 客户端的链接 22 | def testMutliTcpClient(port): 23 | client_1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 24 | client_1.connect(('127.0.0.1', port)) 25 | client_1.send('client_1'.encode()) 26 | 27 | client_2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 28 | client_2.connect(('127.0.0.1', port)) 29 | client_2.send('client_2'.encode()) 30 | 31 | time.sleep(0.5) 32 | client_1.close() 33 | client_2.close() 34 | 35 | # 测试 ucom 的 tcp 客户端 36 | def testTcpAsServer(): 37 | server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 38 | server.bind(("127.0.0.1", 8051)) 39 | server.listen() 40 | print("Server start") 41 | while True: 42 | connection, address = server.accept() 43 | print('Connected by', address) 44 | buf = connection.recv(1) 45 | connection.send(buf) 46 | connection.close() --------------------------------------------------------------------------------