加载按钮
Sub OnClick(Byval Item)
Dim Chart,tag,ctrl,objTrendWnd,objTimeAxis,objValAxis,objTrend
Set Chart=ScreenItems("组合框2")'Chart
tag=Chart.SelText
Set ctrl = ScreenItems("控件1")'thread
Set objTrendWnd = ctrl.GetTrendWindow("趋势窗口 1")'ThreadWnd
Set objTimeAxis = ctrl.GetTimeAxisCollection.Item("时间轴 1")'T1
Set objValAxis = ctrl.GetValueAxisCollection.Item("数值轴 1")'V1
'MsgBox("通过~")
Set objTrend = ctrl.GetTrendCollection.AddItem(tag)
objTrend.Provider = 1
objTrend.TagName = tag
objTrend.TrendWindow = objTrendWnd.Name
objTrend.TimeAxis = objTimeAxis.Name
objTrend.ValueAxis = objValAxis.Name
'Msgbox tag
'ctrl.TrendRename = "机后混合热值"
If tag="ProcessValueArchive\MIXBT" Then
ctrl.TrendRename = "机后混合热值"
End If
If tag="ProcessValueArchive\MIXBF" Then
ctrl.TrendRename = "机后混合流量"
End If
End Sub
清除按钮
Sub OnClick(Byval Item)
Dim ctrl
Dim i
Set ctrl = ScreenItems("控件1")'thread
For i=1 To ctrl.TrendCount
ctrl.TrendIndex =i
ctrl.TrendRemove =ctrl.TrendName'添加曲线前先删除所有曲线
Next
End Sub
索引名称与文本一一对应,文本为归档变量路径名称。
项目下载地址:
https://download.csdn.net/download/weixin_37928884/88450144
学习资料
https://www.cnblogs.com/fishingsriver/
https://support.industry.siemens.com/cs/cn/zh/view/109782055