VB串口曲线显示源码.docx

上传人:李司机 文档编号:6746491 上传时间:2024-01-18 格式:DOCX 页数:107 大小:286.72KB
返回 下载 相关 举报
VB串口曲线显示源码.docx_第1页
第1页 / 共107页
VB串口曲线显示源码.docx_第2页
第2页 / 共107页
VB串口曲线显示源码.docx_第3页
第3页 / 共107页
VB串口曲线显示源码.docx_第4页
第4页 / 共107页
VB串口曲线显示源码.docx_第5页
第5页 / 共107页
点击查看更多>>
资源描述

《VB串口曲线显示源码.docx》由会员分享,可在线阅读,更多相关《VB串口曲线显示源码.docx(107页珍藏版)》请在三一办公上搜索。

1、Forml.frm源码VERSION5.00BeginVB.FormFormlBorderStyIe=1FixedSingleCaption=实时曲线”CIientHeight=6690CIientLeft=45CIientTop=495CIientWidth=9840Icon=FormLfrx”:00001.inkTopic=FormlMaxButton=0FalseMinButton=0FalseScaIeHeight=6690ScaIeWidth=9840StartUpPosition=3窗口缺省BeginVB1PictureBoxPicturelAutoRedraw=-1TrueBac

2、kCoIor=&H80000012&Height=2175Left=120ScaIeHeight=2115ScaIeWidth=9585Tabindex=4Top=120Width=9650EndBeginVB1PictureBoxPictureJineAutoRedraw=-1TrueBackCoIor=&H80000012&Height=2145Left=120ScaIeHeight=2085ScaIeWidth=4785Tabindex=3Top=2280Width=4845EndBeginVB1PictureBoxPicture_pointAutoRedraw=-1TrueBackCo

3、Ior=&H80000012&Height=2145Left=120ScaIeHeight=2085ScaIeWidth=4785Tabindex=2Top=4440Width=4845EndBeginVB1PictureBoxPicturejine2AutoRedraw=-1TrueBackCoIor=&H80000012&Height=2145Left=4920ScaIeHeight=2085ScaIeWidth=4785Tabindex=1Top=2280Width=4845EndBeginVB1PictureBoxPicture_point2AutoRedraw=-1TrueBackC

4、oIor=&H80000012&Height=2145Left=4920ScaIeHeight=2085ScaIeWidth=4785Tabindex=OTop=4440Width=4845EndEndAttributeVB_Name=FormlAttributeVB_GlobalNameSpace=FalseAttributeVB_Creatable=FalseAttributeVB_Predeclaredld=TrueAttributeVB_Exposed=FalseOptionExplicitPrivateSubForm_Load()WithLDrawl.InitDrawLinePict

5、ureJine,vbRed,True.Max=5.HorzSpIits=6.VertSpIits=6.LineType=TYPE-LINE.RePaintEndWithWithPDrawl.InitDrawLinePicture_point,vbRedzTrue.Max=5.HorzSpIits=6.VertSpIits=6.LineType=TYPE_P0INT.RePaintEndWithWithLDraw2.InitDrawLinePicturejine2,vbRed,True.Max=5.HorzSpIits=6.VertSpIits=6.LineType=TYPE-LINE.RePa

6、intEndWithWithPDraw2.InitDrawLinePicture_point2,vbRedzTrue.Max=5.HorzSpIits=6.VertSpIits=6.LineType=TYPE_P0INT.RePaintEndWithWithPDraw3.InitDrawLinePicturelzvbYellow,True,RGB(O,Oz255),True.Max=5.HorzSpIits=6.VertSpIits=6.LineType=TYPE_POINTEndWithEndSubPrivateSubForm_Unload(CancelAsInteger)UnloadMeE

7、ndSubPrivateSubPicture_line_Paint()1.Drawl.RePaintEndSubPrivateSubPicture_line2_Click()1.Draw2.RePaintEndSubPrivateSubPicture_point_Paint()PDrawl.RePaintEndSubPrivateSubPicture_point2_Click()PDrawl.RePaintEndSubPrivateSubPicturel_Click()PDraw3.RePaintEndSubForm2.frm源码VERSION5.00BeginVB.FormForm2Capt

8、ion=CIientHeight=CIientLeft=CIientTop=CIientWidth=1.inkTopic=MaxButton:Form23030605104680Form2=0FalseScaIeHeight=3030ScaIeWidth=StartUpPosition=46803窗口缺省BeginVB.LabelLabel2Caption=火灾报警器数据采集工具V1.0BeginPropertyFontNameSizeCharsetWeightUnderlineItalic=宋体,=10.5=134=400=0False=0FalseStrikethrough=0FalseE

9、ndPropertyHeight1.eftTabindexTopWidthEnd=375=840=1=1680=3375BeginVB.LabelLabellCaption=西安亚川电力科技有限公司UBeginPropertyFontName=”宋体”Size=10.5Charset=134Weight=400Underline=0FalseItalic=0FalseStrikethrough=0FalseEndPropertyHeight=495Left=960Tabindex=0Top=720Width=2535EndEndAttributeVB_Name=Form2AttributeVB

10、_GlobalNameSpace=FalseAttributeVB_Creatable=FalseAttributeVB_Predeclaredld=TrueAttributeVB_Exposed=FalsefrmAbout.frm源码VERSION5.00BeginVB.FormfrmAboutBorderStyIe=3FixedDialogCaption=”火灾报警器数据采集工具CIientHeight=3555CIientLeft=2340CIientTop=1935CIientWidth=5730ClipControIs=0FalseIcon=frmAbout.frx:0000Link

11、Topic=,Form2MaxButton=0,FalseMinButton=0FalseScaIeHeight=2453.724ScaIeMode=0UserScaIeWidth=5380.766ShowInTaskbar=0FalseBeginVB1PictureBoxpiclconAutoSize=-1TrueClipControIs=0FalseHeight=540Left=240Picture=frmAbout.frx:038AScaIeHeight=ScaIeModeScaIeWidth337.12=OUser=337.12Tabindex=1Top=240WidthEnd=540

12、BeginVB1CommandButtoncmdOKCancel=-1TrueCaptionDefault=Height1.eft=Tabindex=确定”-1True=3454125=OTop=2625Width=1500EndBeginVB1CommandButtonCmdSysInfoCaptionHeightLeft=Tabindex=系统信息(&S).”=3454140=2Top=3075Width=1485EndBeginVB.LineLinelBorderCoIor=&H00808080&BorderStyIe=6InsideSolidIndex=1Xl=84.515X2=530

13、9.398Yl=1687.583Y2End=1687.583BeginVB.LabelIbIDescriptionCaption=本软件是西安亚川电力科技有限公司的火灾报警器数据采集专用软件。UForeCoIor=&H00000000&Height=1170Left=1050Tabindex=3Top=1125Width=3885EndBeginVB.LabelIblTitIeCaption=”西安亚川电力科技有限公司”ForeCoIor=&H00000000&Height=480Left=1050Tablndex=5Top=240Width=3885EndBeginVB.LineLinelB

14、orderCoIor=&HOOFFFFFF&BorderWidth=2Index=OXl=98.6X2=5309.398Yl=1697.936Y2=1697.936EndBeginVB.LabelIbIVersionCaption=”版本1.0Height=225Left=1050Tabindex=6Top=780Width=3885EndBeginVB.LabelIbIDiscIaimerCaption=”西安亚川电力科技有限公司版权所有”ForeCoIor=&H00000000&Height=825Left=255Tabindex=4Top=2625Width=3630EndEndAttr

15、ibuteVB_Name=frmAboutAttributeVB_GlobalNameSpace=FalseAttributeVB_Creatable=FalseAttributeVB_Predeclaredld=TrueAttributeVB_Exposed=FalseOptionExplicit,注册表关键字安全选项ConstREAD_CONTROL=&H20000ConstKEY_QUERY_VALUE=&H1ConstKEY_SET_VALUE=&H2ConstKEY_CREATE_SUB_KEY=&H4ConstKEY_ENUMERATE_SUB_KEYS=&H8ConstKEY_N

16、OTIFY=&H10ConstKEY_CREArEjjNK=&H20ConstKEY_ALL_ACCESS=KEY_QUERY_VALUE+KEY_SET_VALUE+_KEY_CREATE_SUB_KEY+KEY_ENUMERATE_SUB_KEYS+_KEY_NOTIFY+KEY_CREATE_LINK+READ_CONTROL,注册表关键字ROOT类型ConstHKEY_LOCAL_MACHINE=&H80000002ConstERROR_SUCCESS=0ConstREG_SZ=1,独立的空的终结字符串ConstREG_DWORD=4,32位数字ConstgREGKEYSYSINFOL

17、OC=,SOFTWAREMicrosoftSharedToolsLocationConstgREGVALSYSINFOLOC=MSINFOConstgREGKEYSYSINFO=SOFTWAREMicrosoftSharedToolsMSINFOConstgREGVALSYSINFO=PATHPrivateDeclareFunctionRegOpenKeyExLib,advapi32AliasRegOpenKeyExA(ByVaIhKeyAsLong,ByVaIIpSubKeyAsString,ByVaIulptionsAsLong,ByVaISamDesiredAsLong,ByRefphk

18、ResultAsLong)AsLongPrivateDeclareFunctionRegQueryVaIueExLibadvapi32AliasRegQueryVaIueExA(ByVaIhKeyAsLong,ByVaIIpVaIueNameAsString,ByVaIIpReservedAsLong,ByRefIpTypeAsLong,ByVaIIpDataAsString,ByRefIpcbDataAsLong)AsLongPrivateDeclareFunctionRegCIoseKeyLibadvapi32(ByVaIhKeyAsLong)AsLongPrivateSubcmdSysl

19、nfo_Click()CallStartSysInfoEndSubPrivateSubcmdOK_Click()UnloadMeEndSubPrivateSubForm_Load()Me.Caption=关于&AppJitIeIbIVersion.Caption=版本&App.Major&.&App.Minor&.&App.RevisionIblTitIe-Caption=AppJitIeEndSubPublicSubStartSysInfoOOnErrorGoToSysInfoErrDimrcAsLongDimSysInfoPathAsString试图从注册表中获得系统信息程序的路径及名称I

20、fGetKeyValue(HKEY_LOCAL_MACHINE,gREGKEYSYSINFOzgREGVALSYSINFO,SysInfoPath)Then试图仅从注册表中获得系统信息程序的路径ElselfGetKeyValue(HKEY_LOCAL_MACHINE,gREGKEYSYSINFOLOCzgREGVALSYSINFOLOCzSysInfoPath)Then,已知32位文件版本的有效位置If(Dir(SyslnfoPath&MSINFO32.EXE),)ThenSysInfoPath=SysInfoPath&MSINFO32.EXE,错误文件不能被找到.ElseGolbSysInf

21、oErrEndIf,错误注册表相应条目不能被找到ElseGoToSysInfoErrEndIfCallShell(SyslnfoPath,VbNormaIFocus)ExitSubSysInfoErr:MsgBox此时系统信息不可用,VbOKOnIyEndSubPublicFunctionGetKeyVaIue(KeyRootAsLong,KeyNameAsString,SubKeyRefAsString,ByRefKeyVaIAsString)AsBooleanDimIAsLong,循环计数器DimrcAsLong,返回代码DimhKeyAsLong打开的注册表关键字句柄注册表关键字数据类型

22、注册表关键字值的临时DimhDepthAsLongDimKeyVaITypeAsLongDimtmpValAsString存储器DimKeyVaISizeAsLong,注册表关键自变量的尺,打开HKEY_LOCAL_MACHINE.下的RegKeyrc=RegOpenKeyExlKeyRoot,KeyName,0,KEY_ALL_ACCESS,hKey)1打开注册表关键字If(rcERROR_SUCCESS)ThenGoToGetKeyError处理错误tmpVal=String$(1024,0)KeyVaISize=1024分配变量空间标记变量尺寸检索注册表关键字的值.rc=RegQuery

23、VaIueExthKeyzSubKeyRef,0,_KeyVaIType,tmpVal,KeyVaISize)获得/创建关键字值If(rcERROR_SUCCESS)ThenGoToGetKeyErrorIf(Asc(Mid(tmpVal,KeyVaISizez1)=0)Then串tmpVal=Left(tmpVal,KeyVaISize-1)出来Else符串tmpVal=Left(tmpVal,KeyVaISize)串EndIf,处理错误Win95外接程序空终结字符Null被找到,从字符串中分离,WinNT没有空终结字,Null没有被找到,分离字符决定转换的关键字的值类型.SelectCas

24、eKeyVaITypeCaseREG_SZ据类型KeyVaI=tmpValCaseREG_DWORD键字数据类型ForI=LenftmpVaI)To1Step-1KeyVaI=KeyVaI+Hex(Asc(Mid(tmpVal,1,1)NextKeyVaI=Format$(&h+KeyVaI)串,搜索数据类型.,字符串注册关键字数,友制字符串的值四字节的注册表关将每位进行转换生成值字符。ByCharo转换四字节的字符为字符EndSelectGetKeyVaIue=True返回成功rc=RegCIoseKey(HKey)关闭注册表关键字ExitFunction,退出GetKeyError:错误发

25、生后将其清除.KeyVaI=设置返回值到空字符串GetKeyVaIue=False返回失败rc=RegCIoseKey(HKey),关闭注册表关键字EndFunctionfrmBrowser.frm源码VERSION5.00Object=831FDD16-0C5C-llD2-A9FC-0000F8754DAl#2.0#0;MSCOMCTL.OCXObject=EAB22AC0-30Cl-llCF-A7EB-0000C05BAE0B#l.l#0;shdocvw.dllBeginVB.FormfrmBrowserCIientHeight=CIientLeft=49653060CIientTop=3

26、510CIientWidth=1.inkTopic=6540FormlScaIeHeight=4965ScaIeWidth=ShowInTaskbar=65400FalseBeginVB.TimertimTimerEnabledIntervalLeftTopEnd=0False=5=6180=1500BeginVB1PictureBoxpicAddressAlignBorderStyIeHeightLeftScaIeHeightScaIeWidthTabindexTabStopTop=1AlignTop=0None=675=0=675=6540=4=0False=540Width=6540Be

27、ginVB.ComboBoxCboAddressHeightLeftTabindexTextTopWidthEnd=300=45=2=Combol=300=3795BeginVB.LabelIbIAddressCaptionHeight1.eftTabindexTagTopWidthEndEnd=地址(&A):”=255=45=1=地址(&A):“=60=3075BeginMSComctlLib.ToolbartbT00IBarAlign=1AlignTopHeight=1.eft=Tabindex=540O3Top=OWidth=6540ExtentX=11536_ExtentY=Butto

28、nWidth=953820ButtonHeight=794Appearance=ImageList=Version=1imlToolbarlcons393216BeginPropertyButtons66833FE8-8583-llDl-B16A-00C0F0283628NumButtons=6BeginPropertyButtonl66833FEA-8583-llDl-B16A-00C0F0283628Key=BackObject.TooITipText=BackImageindexEndProperty=1BeginPropertyButton266833FEA-8583-llDl-B16

29、A-00C0F0283628)Key=ForwardObject-TooITipText=ForwardImageindex=2EndPropertyBeginPropertyButton366833FEA-8583-llDl-B16A-00C0F0283628)Key=StopObjectTooITipText=StopImageindex=3EndPropertyBeginPropertyButton466833FEA-8583-llDl-B16A-00C0F0283628)Key=RefreshObjectTooITipText=RefreshImageindex=4EndPropert

30、yBeginPropertyButton566833FEA-8583-llDl-B16A-00C0F0283628Key=HomeObject.TooITipText=HomeImageindex=5EndPropertyBeginPropertyButton666833FEA-8583-llDl-B16A-00C0F0283628)Key=SearchObjectTooITipText=SearchImageindex=6EndPropertyEndPropertyEndBeginMSComctlLib.ImageListImlTooIbarIconsLeft=2670Top=2235_Ex

31、tentX=1005_ExtentY二1005BackCoIor=-2147483643ImageWidth=24ImageHeight=24MaskCoIor=12632256Version=393216BeginPropertvImages2C247F25-8591-llDl-B16A-00C0F0283628)NumListImages=6BeginPropertyListlmagel2C247F27-8591-llDl-B16A-00C0F0283628Picture=frmBrowser.frx:0000Key=,EndPropertyBeginPropertyListImageZ2

32、C247F27-8591-llDl-B16A-00C0F0283628Picture=frmBrowser.frx:0712Key=,EndPropertyBeginPropertyListlmage32C247F27-8591-llDl-B16A-00C0F0283628frmBrowser.frx :0E24PictureKeyEndPropertyBeginPropertyListlmage42C247F27-8591-llDl-B16A-00C0F0283628Picture=frmBrowser.frx:1536Key=,EndPropertyBeginPropertyListlma

33、ge52C247F27-8591-llDl-B16A-00C0F0283628Picture=frmBrowser.frx:1C48Key=,EndPropertyBeginPropertyListImageG2C247F27-8591-llDl-B16A-00C0F0283628Picture=frmBrowser.frx:235AKey=,EndPropertyEndPropertyEndBeginSHDocvwCtLWebBrowserbrwWebBrowserHeight=3734Left=50Tabindex=OTop三1215Width5393ExtentX=9513ExtentY

34、=6586ViewMode=OOffline=OSilent=ORegisterAsBrowser=ORegisterAsDropTarget=1AutoArrange=OFalseNoCIientEdge=OFalseAIignLeft=OFalseNoWebView=O,FalseHideFiIeNames=OFalseSingIeCIick=OFalseSingIeSeIection=OFalseNoFoIders=OFalseTransparent=OFalseViewID=,0057D0E0-3573-llCF-AE69-08002B2E1262Location=http:/EndE

35、ndAttributeVBName=,frmBrowserAttributeVB_GlobalNameSpace=FalseAttributeVB_Creatable=FalseAttributeVB_Predeclaredld=TrueAttributeVB_Exposed=FalsePublicStartingAddressAsStringDimmbDontNavigateNowAsBooleanPrivateSubForm_Load()OnErrorResumeNextMe.ShowtbTolBar.RefreshForm_ResizecboAddress.Move50zIbIAddre

36、ss.Top+IbIAddress.Height+15IfLen(StartingAddress)OThencboAddress.Text=StartingAddressCboAddress.AddItemCboAddressJext尝试定位到起始地址timTimer.Enabled=TruebrwWebBrowser.NavigateStartingAddressEndIfEndSubPrivateSubbrwWebBrowser_DownloadComplete()OnErrorResumeNextMe.Caption=brwWebBrowser.LocationNameEndSubPri

37、vateSubbrwWebBrowser_NaVigateCompIete2(ByVaIpDispAsObject,URLAsVariant)OnErrorResumeNextDimIAsIntegerDimbFoundAsBooleanMe.Caption=brwWebBrowser.LocationNameForI=OToCboAddress.UstCount-1IfCboAddresslist(I)=brwWebBrowser.LocationURLThenbFound=TrueExitForEndIfNextImbDontNavigateNow=TrueIfbFoundThenCboA

38、ddress.RemoveitemIEndIfcboAddress.AddltembrwWebBrowser.LocatioURL,OCboAddress.UstIndex=OmbDontNavigateNow=FalseEndSubPrivateSubcboAddress_Click()IfmbDontNavigateNowThenExitSubtimTimer.Enabled=TruebrwWebBrowser.NavigateCboAddressJextEndSubPrivateSubcboAddress_KeyPress(KeyAsciiAsInteger)OnErrorResumeN

39、extIfKeyAscii=VbKeyReturnThencboAddress_ClickEndIfEndSubPrivateSubForm_Resize()OnErrorResumeNextcboAddress.Width=Me1ScaIeWidth-100brwWebBrowser.Width=Me-ScaIeWidth-100brwWebBrowser.Height=Me-ScaIeHeight-(picAddress.7bp+picAddress.Height)-100EndSubPrivateSubtimTimer_Timer()IfbrwWebBrowser.Busy=FalseT

40、hentimTimer.Enabled=FalseMe.Caption=brwWebBrowser.LocationNameElseMe.Caption=Working.EndIfPrivateSubtbToolBar_ButtonClick(ByValButtonAsButton)OnErrorResumeNexttimTimer.Enabled=TrueSelectCaseButton.KeyCaseBackbrwWebBrowser.GoBackCaseForward,brwWebBrowser.GoForwardCaseRefreshbrwWebBrowser.RefreshCaseH

41、omebrwWebBrowser.GoHomeCaseSearchbrwWebBrowser.GoSearchCaseStoptimTimer.Enabled=FalsebrwWebBrowser.StopMe.Caption=brwWebBrowser.LocationNameEndSelectEndSubfrmMain.frm源码VERSION5.00Object=F9043C88-F6F2-101A-A3C9-08002B2F49FB#1.2#0;,COMDLG32.OCXObject=831FDD16-0C5C-llD2-A9FC-0000F8754DAl#2.0#0;MSCOMCTL.OCXObject=5E9E78A0-531B-llCF-91F6-C2863C385E30#1.0#0;,MSFLXGRD.OCXObject=648A5603-

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号