Wintertotal 2014

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

AI_GRAPH - 1

Private Sub Chart6_Click()


End Sub
Private Sub Group267_DblClick()
Dim ShapeObj As Object
For Each ShapeObj In Group267.ContainedObjects
If ShapeObj.ClassName = "Chart" Then
ShapeObj.ShowCustomPages
HistScrollBar3.VerticalPosition = ShapeObj.VerticalPosition + ShapeObj.Height
HistScrollBar3.HorizontalPosition = ShapeObj.HorizontalPosition
HistScrollBar3.Width = ShapeObj.Width
Exit For
End If
Next
End Sub
Private Sub Group267_Edit()
Dim ShapeObj As Object
For Each ShapeObj In Group267.ContainedObjects
If ShapeObj.ClassName = "Chart" Then
ShapeObj.ShowCustomPages
HistScrollBar3.VerticalPosition = ShapeObj.VerticalPosition + ShapeObj.Height
HistScrollBar3.HorizontalPosition = ShapeObj.HorizontalPosition
HistScrollBar3.Width = ShapeObj.Width
Exit For
End If
Next
End Sub
Private Sub ScrollRightFast3_Click()
Dim ShapeObj As Object
For Each ShapeObj In Group267.ContainedObjects
If ShapeObj.ClassName = "Chart" Then
ShapeObj.ScrollPercentage = 50
ShapeObj.ScrollForward
Exit For
End If
Next
End Sub
Private Sub ScrollRight3_Click()
Dim ShapeObj As Object
For Each ShapeObj In Group267.ContainedObjects
If ShapeObj.ClassName = "Chart" Then
ShapeObj.ScrollPercentage = 25
ShapeObj.ScrollForward
Exit For
End If
Next
End Sub
Private Sub ScrollLeft3_Click()
Dim ShapeObj As Object
For Each ShapeObj In Group267.ContainedObjects
If ShapeObj.ClassName = "Chart" Then
ShapeObj.ScrollPercentage = 25
ShapeObj.ScrollBack
Exit For
End If
Next
End Sub
Private Sub ScrollLeftFast3_Click()
Dim ShapeObj As Object
For Each ShapeObj In Group267.ContainedObjects
If ShapeObj.ClassName = "Chart" Then
ShapeObj.ScrollPercentage = 50
ShapeObj.ScrollBack
Exit For
End If
Next
End Sub
AI_GRAPH - 2

Private Sub CFixPicture_Activated()
End Sub
Private Sub CFixPicture_Initialize()
'ANALOG_NAME.Caption = USER.ANALOG_NAME.CurrentValue
'ANALOG_NAME.Caption =@ITEM_NAME@_VAL.A_DESC
End Sub
Private Sub CLOSE_SCR_Click()
CLOSEPICTURE
End Sub
frmAdvancedColor - 1

Private NLSStrMgr As Object 'Important!! Do NOT move, edit, or remove this line!
'FormVersion: 1.0
Public Sub SetGroupGradiant(CObj As Object, color As Long)
Dim Shape As Object
Dim LumMin As Double, LumMax As Double, LumRange As Double
Dim ObjLum As Double, NewLumMin As Double, NewLumRange As Double, NewLum As Double
Dim I As Integer
Dim h As Double, l As Double, s As Double
Call GetHLS(color, h, l, s)
Call GetLumInfo(CObj, LumMin, LumMax)
LumRange = LumMax - LumMin
NewLumMin = l
NewRange = 1 - l
For I = 1 To CObj.Count
Set Shape = CObj.Item(I)
If (Shape.ClassName = "Group") Then
Call SetGroupGradiant(Shape.ContainedObjects, color)
Else
On Error Resume Next
ObjLum = GetLum(Shape.ForegroundColor)
If LumRange = 0 Then
NewLum = NewLumMin
Else
NewLum = ((ObjLum - LumMin) / LumRange) * NewRange + NewLumMin
End If
Shape.ForegroundColor = SetHLS(h, NewLum, s)
End If
Next I
End Sub
Private Sub GetLumInfo(CObj As Object, min As Double, max As Double)
Dim Shape As Object
Dim I As Integer, min1 As Double, max1 As Double, lum As Double
min = 1
max = 0
For I = 1 To CObj.Count
Set Shape = CObj.Item(I)
If (Shape.ClassName = "Group") Then
Call GetLumInfo(Shape.ContainedObjects, min1, max1)
If (min1 < min) Then
min = min1
End If
If (max1 > max) Then
max = max1
End If
Else
On Error Resume Next
lum = GetLum(Shape.ForegroundColor)
If (lum > max) Then
max = lum
End If
If (lum < min) Then
min = lum
End If
End If
Next I
End Sub
Public Sub SetObjHueSat(CObj As Object, h As Double, s As Double)
Dim Shape As Object
Dim I As Integer
For I = 1 To CObj.Count
Set Shape = CObj.Item(I)
If (Shape.ClassName = "Group") Then
Call SetObjHueSat(Shape.ContainedObjects, h, s)
Else
On Error Resume Next
Shape.ForegroundColor = SetHueSat(Shape.ForegroundColor, h, s)
End If
Next I
End Sub
Public Sub SetObjHue(CObj As Object, h As Double)
Dim Shape As Object
Dim I As Integer
For I = 1 To CObj.Count
frmAdvancedColor - 2

Set Shape = CObj.Item(I)
If (Shape.ClassName = "Group") Then
Call SetObjHue(Shape.ContainedObjects, h)
Else
On Error Resume Next
Shape.ForegroundColor = SetHue(Shape.ForegroundColor, h)
End If
Next I
End Sub
Public Sub SetObjSat(CObj As Object, s As Double)
Dim Shape As Object
Dim I As Integer
For I = 1 To CObj.Count
Set Shape = CObj.Item(I)
If (Shape.ClassName = "Group") Then
Call SetObjSat(Shape.ContainedObjects, s)
Else
On Error Resume Next
Shape.ForegroundColor = SetSat(Shape.ForegroundColor, s)
End If
Next I
End Sub
Private Sub HLS_To_RGB(r As Long, g As Long, b As Long, hue As Double, lum As Double, sat As Do
uble)
Dim m2 As Double
Dim ml As Double
Dim RValue As Double
Dim GValue As Double
Dim BValue As Double
If (lum <= 0.5) Then
m2 = lum * (1 + sat)
Else
m2 = lum + sat - (lum * sat)
End If
ml = 2 * lum - m2
If (sat = 0) Then
If (hue = -1) Then
RValue = lum
GValue = lum
BValue = lum
Else
MsgBox NLSStrMgr.GetNLSStr(1000)
End If

Else
RValue = hls_func(ml, m2, hue + 120)
GValue = hls_func(ml, m2, hue)
BValue = hls_func(ml, m2, hue - 120)
End If
' Convert to RGBMAX (255)
r = RValue * 255
g = GValue * 255
b = BValue * 255
End Sub
Private Function hls_func(ByVal nl As Double, ByVal n2 As Double, ByVal hue As Double) As Doubl
e
If (hue > 360) Then
hue = hue - 360
Else
If hue < 0 Then
hue = hue + 360
End If
End If
If (hue < 60) Then
hls_func = nl + (n2 - nl) * hue / 60
Else
If (hue < 180) Then
hls_func = n2
Else

If (hue < 240) Then
hls_func = nl + (n2 - nl) * (240 - hue) / 60
Else
hls_func = nl
frmAdvancedColor - 3

End If
End If

End If
End Function
Private Sub RGB_To_HLS(ByVal r As Long, ByVal g As Long, ByVal b As Long, hue As Double, lum As
Double, sat As Double)
Dim min As Double
Dim max As Double
Dim RValue As Double
Dim GValue As Double
Dim BValue As Double
RValue = r / 255#
GValue = g / 255#
BValue = b / 255#
max = maximum(RValue, GValue, BValue)
min = minimum(RValue, GValue, BValue)
lum = (max + min) / 2
If (max = min) Then
sat = 0
hue = -1 ' Undefined
Else
' Calculate the saturation

If (lum <= 0.5) Then
sat = (max - min) / (max + min)
Else
sat = (max - min) / (2 - max - min)
End If
' next calculate the hue
Dim delta As Double
delta = max - min
If (RValue = max) Then
hue = (GValue - BValue) / delta ' result between yellow and magenta
Else
If (GValue = max) Then
hue = 2 + (BValue - RValue) / delta ' between cyan and yellow
Else
If (BValue = max) Then
hue = 4 + (RValue - GValue) / delta ' between magenta and cyan
End If
End If
End If
hue = hue * 60 ' convert to degrees
If (hue < 0#) Then
hue = hue + 360 ' make non-negative
End If
End If
End Sub
Private Function maximum(ByVal a As Double, ByVal b As Double, ByVal c As Double) As Double
If (a > b) Then
If (a > c) Then
maximum = a
Else
maximum = c
End If
Else
If (b > c) Then
maximum = b
Else
maximum = c
End If
End If
End Function
Private Function minimum(ByVal a As Double, ByVal b As Double, ByVal c As Double) As Double
If (a < b) Then
If (a < c) Then
minimum = a
Else
minimum = c
End If
Else
If (b < c) Then
minimum = b
frmAdvancedColor - 4

Else
minimum = c
End If
End If
End Function
Private Sub GetRGB(ByVal rgbval As Long, r As Long, g As Long, b As Long)
r = rgbval Mod 256
rgbval = Int(rgbval / 256)
g = rgbval Mod 256
rgbval = Int(rgbval / 256)
b = rgbval Mod 256
End Sub
Public Sub GetHLS(ByVal rgbval As Long, hue As Double, lum As Double, sat As Double)
Dim r As Long, g As Long, b As Long
Call GetRGB(rgbval, r, g, b)
Call RGB_To_HLS(r, g, b, hue, lum, sat)
'If sat = 0 Then
'sat = 0.00000001
'End If
End Sub
Private Function GetLum(ByVal rgbval As Long) As Double
Dim r As Long, g As Long, b As Long, hue As Double, sat As Double, lum As Double
Call GetRGB(rgbval, r, g, b)
Call RGB_To_HLS(r, g, b, hue, lum, sat)
GetLum = lum
End Function
Private Function SetHue(rgbval As Long, hue As Double) As Long
Dim h As Double, l As Double, s As Double
Dim r As Long, g As Long, b As Long
Call GetHLS(rgbval, h, l, s)
Call HLS_To_RGB(r, g, b, hue, l, s)
SetHue = RGB(r, g, b)
End Function
Private Function SetSat(rgbval As Long, sat As Double) As Long
Dim h As Double, l As Double, s As Double
Dim r As Long, g As Long, b As Long
Call GetHLS(rgbval, h, l, s)
Call HLS_To_RGB(r, g, b, h, l, sat)
SetSat = RGB(r, g, b)
End Function
Private Function SetHueSat(rgbval As Long, hue As Double, sat As Double) As Long
Dim h As Double, l As Double, s As Double
Dim r As Long, g As Long, b As Long
Call GetHLS(rgbval, h, l, s)
Call HLS_To_RGB(r, g, b, hue, l, sat)
SetHueSat = RGB(r, g, b)
End Function
Private Function SetHLS(hue As Double, lum As Double, sat As Double) As Long
Dim r As Long, g As Long, b As Long
Call HLS_To_RGB(r, g, b, hue, lum, sat)
SetHLS = RGB(r, g, b)
End Function
Private Sub UserForm_Initialize()
Set NLSStrMgr = CreateObject("frmAdvancedColorRES.NLSStrMgr") 'Important!! Do NOT move, edi
t, or remove this line!
NLSStrMgr.NLSContainer Me 'Important!! Do NOT move, edit, or remove this line!
End Sub
frmAnalogAnim - 1

Private Sub Label1_Click()
End Sub
Private Sub Label2_Click()
End Sub
frmPipes - 1

Private NLSStrMgr As Object 'Important!! Do NOT move, edit, or remove this line!
'FormVersion: 1.0
Option Explicit
Public Pipe As Object
Public Sub InitializeDynamo(DynamoName As Object)
Set Pipe = DynamoName
End Sub
Private Sub UserForm_Activate()
Me.clrPipeColor.color = GetPipeColor()
End Sub
Public Function GetPipeColor() As Long
Dim PipeColor As Object
Set PipeColor = FindLocalObject(Pipe, "PipeColor")
GetPipeColor = PipeColor.ForegroundColor
End Function
Public Sub SetPipeColor(color As Long)
Dim hue As Double, sat As Double, lum As Double
Dim PipeColor As Long
PipeColor = GetPipeColor()
If PipeColor <> color Then
Call frmAdvancedColor.SetGroupGradiant(Pipe.ContainedObjects, color)
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Call SetPipeColor(clrPipeColor.color)
Unload Me
End Sub
Private Sub UserForm_Initialize()
Set NLSStrMgr = CreateObject("frmPipesRES.NLSStrMgr") 'Important!! Do NOT move, edit, or re
move this line!
NLSStrMgr.NLSContainer Me 'Important!! Do NOT move, edit, or remove this line!
End Sub
frmPumpAnim - 1

Private NLSStrMgr As Object 'Important!! Do NOT move, edit, or remove this line!
'FormVersion: 1.0
Option Explicit
Public Pump As Object
Private frmDynamoColor As Object
Private blnColorFormCancel As Boolean
Private blnColorFormShow As Boolean
Private blnFormActivate As Boolean
Public Sub InitializeDynamo(DynamoName As Object)
Set Pump = DynamoName
End Sub
Private Sub LaunchColorByForm()
Dim PumpColorObj As Object
Dim blnHasConnection As Boolean
Dim lngIndex As Long
Dim lngStatus As Long

'If the Dynamo ColorBy form has just been activated, we don't want to launch the color by f
orm.
If blnColorFormShow = False Then
'Set the flag as to whether the form was shown to true then, copy a local instance of t
he DynamoColorBy form
blnColorFormShow = True
GetFormDynamoColor frmDynamoColor
End If
Set PumpColorObj = FindLocalObject(Pump, "PumpColorAnimation")
frmDynamoColor.InitializeColorByForm PumpColorObj, frmPumpAnim, blnColorFormCancel
frmDynamoColor.Show
'Display the datasource expression set in the dynamo color by form to display in the pumpan
imation form
If frmDynamoColor.blnCanceled = False Then
txtDataSource.Caption = frmDynamoColor.ExpressionEditor1.EditText
End If
'Now that the form has been activated, we can set the flag to false and allow launching
'of the ColorBy form
blnFormActivate = False

'If the user did not make a connection to animate the color, uncheck the animate color chec
k box
PumpColorObj.IsConnected "ForegroundColor", blnHasConnection, lngIndex, lngStatus
If blnHasConnection = False Then
cbxAnimatePump.VALUE = False
End If

End Sub
Private Sub cbxAnimatePump_Click()
If blnFormActivate = False Then
If cbxAnimatePump.VALUE = True Then
LaunchColorByForm
End If
End If
blnFormActivate = False
End Sub
Private Sub cmdColorBy_Click()
If cbxAnimatePump.VALUE <> True Then
cbxAnimatePump.VALUE = True
Else
LaunchColorByForm
End If
End Sub
Private Sub UserForm_Activate()
Dim PumpColorObj As Object
Dim blnHasConnection As Boolean
Dim lIndex As Long
Dim lStatus As Long
Dim strPropertyName As String
Dim strExpression As String
Dim strFullyQualifiedExpression As String
Dim vtAnimationObjects

'Set up the pump color by animation
Set PumpColorObj = FindLocalObject(Pump, "PumpColorAnimation")
'Determine if the pump foreground color is animated
frmPumpAnim - 2

PumpColorObj.IsConnected "ForegroundColor", blnHasConnection, lIndex, lStatus
If blnHasConnection = True Then
'Set a flag so the Dynamo ColorBy form does not get launched
blnFormActivate = True
cbxAnimatePump.VALUE = True
PumpColorObj.GetConnectionInformation lIndex, strPropertyName, strExpression, strFullyQ
ualifiedExpression, vtAnimationObjects
txtDataSource.Caption = vtAnimationObjects(0).Source
End If
End Sub
Private Sub cmdCancel_Click()
If TypeName(frmDynamoColor) <> "Nothing" Then
Unload frmDynamoColor
End If

Pump.SelectObject (True)

Unload Me
End Sub
Private Sub cmdOK_Click()
Dim PumpColorObj As Object

If cbxAnimatePump.VALUE = False Then
'If the user wants to remove a color animation, get an instance of the Dynamo color
'form if one does not already exist and initialize it. Then call the KillColorAnimatio
nObject subroutine
'to remove the connection
If TypeName(frmDynamoColor) = "Nothing" Then
GetFormDynamoColor frmDynamoColor
Set PumpColorObj = FindLocalObject(Pump, "PumpColorAnimation")
frmDynamoColor.InitializeColorByForm PumpColorObj, frmPumpAnim, blnColorFormCancel
End If
Call frmDynamoColor.KillColorAnimationObject(PumpColorObj)
End If

If TypeName(frmDynamoColor) <> "Nothing" Then
Unload frmDynamoColor
End If

Pump.SelectObject (True)

Unload Me
End Sub
Private Sub UserForm_Initialize()
Set NLSStrMgr = CreateObject("frmPumpAnimRES.NLSStrMgr") 'Important!! Do NOT move, edit, or
remove this line!
NLSStrMgr.NLSContainer Me 'Important!! Do NOT move, edit, or remove this line!
End Sub
frmTanks - 1

Private NLSStrMgr As Object 'Important!! Do NOT move, edit, or remove this line!
'FormVersion: 1.0
Option Explicit
Public TankObject As Object
Public Sub InitializeDynamo(DynamoName As Object)
Set TankObject = DynamoName
End Sub
Private Sub UserForm_Activate()
Me.clrTankColor.color = GetTankColor()
End Sub
Public Function GetTankColor() As Long
Dim TankColor As Object
Set TankColor = FindLocalObject(TankObject, "TankColor")
GetTankColor = TankColor.ForegroundColor
End Function
Public Sub SetTankColor(color As Long)
Dim hue As Double, sat As Double, lum As Double
Dim TankColor As Long
TankColor = GetTankColor()
If TankColor <> color Then
Call frmAdvancedColor.SetGroupGradiant(TankObject.ContainedObjects, color)
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Call SetTankColor(clrTankColor.color)
Unload Me
End Sub
Private Sub UserForm_Initialize()
Set NLSStrMgr = CreateObject("frmTanksRES.NLSStrMgr") 'Important!! Do NOT move, edit, or re
move this line!
NLSStrMgr.NLSContainer Me 'Important!! Do NOT move, edit, or remove this line!
End Sub
frmValveAnim - 1

Private NLSStrMgr As Object 'Important!! Do NOT move, edit, or remove this line!
'FormVersion: 1.01
Option Explicit
Public RefreshRate
Public DeadBand
Public Tolerance
Public OldDataSource As String
Public Valve As Object
Public Sub InitializeDynamo(Dynamo As Object)
Set Valve = Dynamo
End Sub
Private Sub ExpressionEditor1_AfterKillFocus()
If ExpressionEditor1.EditText <> "" Then
Dim err As Integer
err = HandleFetchLimits()
If (err <> 0) Then
ExpressionEditor1.SetFocusToComboBox
MsgBox NLSStrMgr.GetNLSStr(1000)
End If
End If
End Sub
Private Function HandleFetchLimits() As String
If ExpressionEditor1.EditText <> OldDataSource Then
Dim err As Integer
Dim HiLimit As Single, LoLimit As Single
Dim ds As String
ds = ExpressionEditor1.EditText
Call FetchLimits(ds, HiLimit, LoLimit, err)
If (err = 0) Then
OldDataSource = ds
ExpressionEditor1.EditText = ds
ElseIf (err = 2) Then ' Valid source may not exist? Just do nothing
err = 0
End If

End If
HandleFetchLimits = err
End Function
Private Sub UserForm_Activate()
'Initialize form interface

Me.clrOpenPosition.color = GetOpenValveColor()
Me.clrClosedPosition.color = GetClosedValveColor()
Call InitValveTypeUI ' initialize the radio buttons for NormallyOPen/Closed state
Me.ExpressionEditor1.EditText = GetValveDataSource()
OldDataSource = ExpressionEditor1.EditText
Me.ExpressionEditor1.SetFocusToComboBox
ExpressionEditor1.RefreshRate = GetValveRefreshRate()
ExpressionEditor1.DeadBand = GetValveDeadBand()
End Sub
Private Function GetOpenValve() As Object
Dim ValveType As Object

Set ValveType = FindLocalObject(Valve, "ValveType")
If (ValveType.InitialValue = 0) Then
Set GetOpenValve = FindLocalObject(Valve, "ValveForeground")
Else
Set GetOpenValve = FindLocalObject(Valve, "ValveBackground")
End If

End Function
Private Function GetClosedValve() As Object
Dim ValveType As Object

Set ValveType = FindLocalObject(Valve, "ValveType")
If (ValveType.InitialValue = 0) Then
Set GetClosedValve = FindLocalObject(Valve, "ValveBackground")
Else
Set GetClosedValve = FindLocalObject(Valve, "ValveForeground")
End If

End Function
Private Sub InitValveTypeUI()
frmValveAnim - 2

Dim ValveType As Object
Set ValveType = FindLocalObject(Valve, "ValveType")

Select Case ValveType.InitialValue
Case 0 'Valve is normally open (0=open, 1=closed)
Me.optValveNormallyOpen.VALUE = 1
Me.optValveNormallyClosed.VALUE = 0
Case 1 'Valve is normally closed (0=closed, 1=open)
Me.optValveNormallyClosed.VALUE = 1
Me.optValveNormallyOpen.VALUE = 0
End Select
End Sub
Private Function GetValveTypeUI() As Long
' Normally Open = 0, Normally Closed = 1
If Me.optValveNormallyClosed.VALUE = True Then
GetValveTypeUI = 1
Else
GetValveTypeUI = 0
End If
End Function
Private Sub SetValveDataSource(DataSource As String)
Dim OpenValveDatasource As Object
Dim OpenValve As Object
Set OpenValve = GetOpenValve()
Set OpenValveDatasource = FindLocalObject(OpenValve, "ValveVisible")
OpenValveDatasource.SetSource DataSource, True, ExpressionEditor1.RefreshRate, ExpressionEd
itor1.DeadBand

Dim ClosedValveDatasource As Object
Dim ClosedValve As Object
Set ClosedValve = GetClosedValve()
Set ClosedValveDatasource = FindLocalObject(ClosedValve, "ValveVisible")
ClosedValveDatasource.SetSource DataSource, True, ExpressionEditor1.RefreshRate, Expression
Editor1.DeadBand
End Sub
Private Function GetValveDataSource() As String
Dim OpenValve As Object
Dim ValveVisible As Object
Set OpenValve = GetOpenValve()
Set ValveVisible = FindLocalObject(OpenValve, "ValveVisible")
GetValveDataSource = ValveVisible.Source
End Function

Private Function GetOpenValveColor() As Long
Dim OpenValve As Object
Dim ValveColor As Object
Set OpenValve = GetOpenValve()
Set ValveColor = FindLocalObject(OpenValve, "ValveColor")
GetOpenValveColor = ValveColor.ForegroundColor
End Function
Private Function GetClosedValveColor() As Long
Dim ClosedValve As Object
Dim ValveColor As Object
Set ClosedValve = GetClosedValve()
Set ValveColor = FindLocalObject(ClosedValve, "ValveColor")
GetClosedValveColor = ValveColor.ForegroundColor
End Function
Private Sub SetOpenValveColor(color As Long)
Dim hue As Double, sat As Double, lum As Double
Dim OpenValve As Object
Set OpenValve = GetOpenValve()
Call frmAdvancedColor.SetGroupGradiant(OpenValve.ContainedObjects, color)
End Sub
Private Sub SetClosedValveColor(color As Long)
Dim hue As Double, sat As Double, lum As Double
Dim ClosedValve As Object
Set ClosedValve = GetClosedValve()
Call frmAdvancedColor.SetGroupGradiant(ClosedValve.ContainedObjects, color)
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
' Check to make sure the user entered something
frmValveAnim - 3

If ExpressionEditor1.EditText = "" Then
ExpressionEditor1.SetFocusToComboBox
MsgBox (NLSStrMgr.GetNLSStr(1001))
Exit Sub
End If

' Check the Data source
Dim ret As Integer
ret = QuickAdd(ExpressionEditor1.EditText)
Select Case ret
Case 0 'Data Source is valid or nothing is entered.
Dim err As Integer
err = HandleFetchLimits
If err <> 0 Then
ExpressionEditor1.SetFocusToComboBox
MsgBox (NLSStrMgr.GetNLSStr(1001))
Exit Sub
End If
ExpressionEditor1.SaveToHistoryList (ExpressionEditor1.EditText)
Case 1 'Invalid Data Source syntax
ExpressionEditor1.SetFocusToComboBox
MsgBox (NLSStrMgr.GetNLSStr(1002))
Exit Sub
Case 2 'User Performed QuickAdd (now ds is OK)
Call HandleFetchLimits
ExpressionEditor1.SetFocusToComboBox
Exit Sub
Case 3 'Type of data source does not match property being animated
MsgBox (NLSStrMgr.GetNLSStr(1003))
ExpressionEditor1.SetFocusToComboBox
Exit Sub
Case 4 'Use Anyway on datasource (Could not validate tag, user said OK)
Case 5 'Could not validate tag, user said do not use
ExpressionEditor1.SetFocusToComboBox
Exit Sub
End Select

Call SetValveDataSource(ExpressionEditor1.EditText)

' Handle Valve Type definition
Dim ValveType As Object
Set ValveType = FindLocalObject(Valve, "ValveType")
ValveType.InitialValue = GetValveTypeUI() ' Get user selection on Valve type

' Set the Valve colors
' NOTE: DOES NOT SUPPORT NAMED COLORS
Call SetOpenValveColor(clrOpenPosition.color)
Call SetClosedValveColor(clrClosedPosition.color)

Unload Me
End Sub
Public Function GetValveRefreshRate()
Dim ValveObj As Object
Dim blnHasConnection1 As Boolean
Dim lIndex1 As Long
Dim lStatus1 As Long
Dim strPropertyName1 As String
Dim strExpression1 As String
Dim strFullyQualifiedExpression1 As String
Dim vtAnimationObjects1
Set ValveObj = FindLocalObject(Valve, "ValveVisible")
ValveObj.IsConnected "InputValue", blnHasConnection1, lIndex1, lStatus1
ValveObj.GetConnectionInformation lIndex1, strPropertyName1, strExpression1, strFullyQualifiedE
xpression1, vtAnimationObjects1, Tolerance, DeadBand, RefreshRate
GetValveRefreshRate = RefreshRate
End Function
Public Function GetValveDeadBand()
GetValveDeadBand = DeadBand
End Function
Private Sub UserForm_Initialize()
Set NLSStrMgr = CreateObject("frmValveAnimRES.NLSStrMgr") 'Important!! Do NOT move, edit, o
r remove this line!
NLSStrMgr.NLSContainer Me 'Important!! Do NOT move, edit, or remove this line!
End Sub

You might also like