窗口初始化
窗口初始化会执行此函数
VB
Private Sub VGA_Initialize() Handles VGA.Initialize
print("窗口加载完毕")
OutputWindow.Clear
' Use this routine for Form_Load.
VGA.LoadPrompting
SetInitialState
End Sub
窗口关闭
Form窗口关闭时候执行此函数
VB
Private Sub VGA_Terminate() Handles VGA.Terminate
MessageBox.show("切换弹窗")
' Use this routine for Form_Close.
End Sub
切换页面
当用户点击Production一次会触发一次这个函数
在Production页面,用户每次点击主界面都会触发
VB
Public Sub Shown()
MessageBox.show("切换弹窗")
'切换页面
End Sub
模式改变
用户点击Production、校准、设置三个页面切换,每次切换会触发这个函数
模式输出:Production
VB
Private Sub VGA_OperatingModeChanged() Handles VGA.OperatingModeChanged
MessageBox.show(String.Format( "当前系统模式:{0}",OperatingMode.Production) )
print(String.Format( "当前系统模式:{0}",OperatingMode.Production))
'当操作模式改变时,执行此例程。.
If VGA.OperatingMode = OperatingMode.Production Then
End If
End Sub
实时刷新
实时刷新此函数,刷新频率大概是100毫秒刷新一次
VB
Public Sub Refresh()
Dim rand As New Random()
Dim randomDouble As Double = rand.NextDouble() ' 生成 0.0~1.0 的随机小数
Label1.Text = randomDouble.ToString("F4") '保留4位小数
点击取消按钮
用户手动点击取消按钮触发此函数
或者用户点击Producetion、设置、校准页面也会触发
程序加载时候也会触发此函数
VB
Sub VGA_OnCancel(ByVal transferLine As TransferLine) Handles VGA.OnCancel
'当发生取消时,执行此例程。
print("触发onCancel函数,系统内部")
MessageBox.show("点击了取消")
If VGA.OperatingMode <> OperatingMode.Production Then
Exit Sub
End If
SetInitialState
End Sub