資源簡介
STM32示波器畢業設計 便攜式數字示波器源碼及上位機
基于正點原子迷你板 ALIENTEK MiniSTM32 V3.0
UCOSIII+EMWIN開發
基于正點原子迷你板 ALIENTEK MiniSTM32 V3.0
UCOSIII+EMWIN開發
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
namespace?Drawer
{
????public?partial?class?Drawer?:?Form
????{
????????private?const?int?Unit_length?=?25;//單位格大小
????????private?int?DrawStep?=?1;//默認繪制單位
????????private?const?int?Y_Max?=?200;//Y軸最大數值
????????private?const?int?MaxStep?=?33;//繪制單位最大值
????????private?const?int?MinStep?=?1;//繪制單位最小值
????????private?const?int?StartPrint?=?25;//點坐標偏移量
????????private?List?DataList?=?new?List();//數據結構----線性鏈表
????????private?Pen?TablePen?=?new?Pen(Color.FromArgb(0x00?0x00?0x00));//軸線顏色
????????private?Pen?LinesPen?=?new?Pen(Color.FromArgb(0xa0?0x00?0x00));//波形顏色
????????public?ShowWindow?ShowMainWindow;//定義顯示主窗口委托訪問權限為public
????????public?HideWindow?HideMainWindow;//定義隱藏主窗口委托
????????public?OpenPort?OpenSerialPort;//定義打開串口委托
????????public?ClosePort?CloseSerialPort;//定義關閉串口委托
????????public?GetMainPos?GetMainPos;//定義獲取主窗口信息委托(自動對齊)
????????public?GetMainWidth?GetMainWidth;//定義獲取主窗口寬度(自動對齊)
????????private?bool?KeyShift?KeyShowMain?KeyHideMain?KeyExit?KeyOpen?KeyClose?KeyStepUp?KeyStepDown;
????????public?Drawer()
????????{
????????????this.Setstyle(Controlstyles.DoubleBuffer?|?Controlstyles.UserPaint?|
???????????????????????????Controlstyles.AllPaintingInWmPaint
???????????????????????????true);//開啟雙緩沖
????????????this.Updatestyles();
????????????InitializeComponent();
????????}
????????public?void?SetDrawStep(int?DrawStep)
????????{
????????????this.DrawStep?=?DrawStep;
????????}
????????public?void?AddData(byte[]?Data)
????????{
????????????for?(int?i?=?0;?i?????????????????DataList.Add(Data[i]);//鏈表尾部添加數據
????????????Invalidate();//刷新顯示
????????}
????????private?void?Form1_Paint(object?sender?PaintEventArgs?e)//畫
????????{
????????????this.Width?=?850;
?
????????????String?Str?=?““;
????????????System.Drawing.Drawing2D.GraphicsPath?gp?=?new?System.Drawing.Drawing2D.GraphicsPath();
????????????e.Graphics.FillRectangle(Brushes.White?e.Graphics.ClipBounds);
//Draw?Y?縱向軸繪制
????????????for?(int?i?=?0;?i?<=?this.ClientRectangle.Width?/?Unit_length;?i++)
????????????{
????????????????e.Graphics.DrawLine(TablePen?StartPrint?+?i?*?Unit_length?StartPrint?StartPrint?+?i?*?Unit_length?StartPrint?+?Y_Max);//畫線
????????????????
????????????????gp.AddString((i?*?(Unit_length?/?DrawStep)).ToString()?this.Font.FontFamily?(int)Fontstyle.Regular?12?new?RectangleF(StartPrint?+?i?*?Unit_length?-?7this.ClientRectangle.Height-StartPrint?+?4?400?50)?null);//添加文字
????????????}
//Draw?X?橫向軸繪制
????????????for?(int?i?=?0;?i?<=?10;?i++)
????????????{
????????????????e.Graphics.DrawLine(TablePen?StartPrint?(i?+?1)?*?Unit_length?this.ClientRectangle.Width?(i?+?1)?*?Unit_length);//畫線
????????????}
????????????e.Graphics.DrawPath(Pens.Black?gp);//寫文字
???
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-08-03?08:57??最終板\
?????目錄???????????0??2018-04-10?21:22??最終板\串口數據的波形顯示軟件\
?????文件????????7500??2018-04-10?19:45??最終板\串口數據的波形顯示軟件\123.txt
?????目錄???????????0??2018-04-10?21:22??最終板\串口數據的波形顯示軟件\Drawer\
?????文件????????2034??2018-04-10?00:57??最終板\串口數據的波形顯示軟件\Drawer\Drawer.Designer.cs
?????文件????????8971??2018-04-10?01:45??最終板\串口數據的波形顯示軟件\Drawer\Drawer.cs
?????文件????????6206??2014-01-14?23:18??最終板\串口數據的波形顯示軟件\Drawer\Drawer.csproj
?????文件?????????452??2014-01-14?22:50??最終板\串口數據的波形顯示軟件\Drawer\Drawer.csproj.user
?????文件????????5817??2018-04-10?00:57??最終板\串口數據的波形顯示軟件\Drawer\Drawer.resx
?????文件????????1684??2014-01-14?22:50??最終板\串口數據的波形顯示軟件\Drawer\Drawer_TemporaryKey.pfx
?????文件???????13960??2018-04-10?18:05??最終板\串口數據的波形顯示軟件\Drawer\MainForm.Designer.cs
?????文件????????6312??2018-04-10?19:45??最終板\串口數據的波形顯示軟件\Drawer\MainForm.cs
?????文件????????6189??2018-04-10?18:05??最終板\串口數據的波形顯示軟件\Drawer\MainForm.resx
?????文件?????????490??2013-12-08?11:01??最終板\串口數據的波形顯示軟件\Drawer\Program.cs
?????目錄???????????0??2018-04-10?21:22??最終板\串口數據的波形顯示軟件\Drawer\Properties\
?????文件????????1332??2013-12-01?14:38??最終板\串口數據的波形顯示軟件\Drawer\Properties\AssemblyInfo.cs
?????文件????????2864??2013-12-01?14:38??最終板\串口數據的波形顯示軟件\Drawer\Properties\Resources.Designer.cs
?????文件????????5612??2013-12-01?14:38??最終板\串口數據的波形顯示軟件\Drawer\Properties\Resources.resx
?????文件????????1093??2013-12-01?14:38??最終板\串口數據的波形顯示軟件\Drawer\Properties\Settings.Designer.cs
?????文件?????????249??2013-12-01?14:38??最終板\串口數據的波形顯示軟件\Drawer\Properties\Settings.settings
?????目錄???????????0??2018-04-10?21:22??最終板\串口數據的波形顯示軟件\Drawer\bin\
?????目錄???????????0??2018-04-10?21:22??最終板\串口數據的波形顯示軟件\Drawer\bin\Debug\
?????文件???????20992??2013-12-08?13:45??最終板\串口數據的波形顯示軟件\Drawer\bin\Debug\Drawer.exe
?????文件???????42496??2013-12-08?13:45??最終板\串口數據的波形顯示軟件\Drawer\bin\Debug\Drawer.pdb
?????文件???????22472??2014-01-14?22:54??最終板\串口數據的波形顯示軟件\Drawer\bin\Debug\Drawer.vshost.exe
?????目錄???????????0??2018-04-10?21:22??最終板\串口數據的波形顯示軟件\Drawer\bin\Release\
?????文件????????1799??2018-04-10?19:45??最終板\串口數據的波形顯示軟件\Drawer\bin\Release\Drawer.application
?????文件???????18944??2018-04-10?19:45??最終板\串口數據的波形顯示軟件\Drawer\bin\Release\Drawer.exe
?????文件????????2999??2018-04-10?19:45??最終板\串口數據的波形顯示軟件\Drawer\bin\Release\Drawer.exe.manifest
?????文件???????38400??2018-04-10?19:45??最終板\串口數據的波形顯示軟件\Drawer\bin\Release\Drawer.pdb
?????文件????????1799??2018-04-10?19:45??最終板\串口數據的波形顯示軟件\Drawer\bin\Release\Drawer.vshost.application
............此處省略748個文件信息
評論
共有 條評論