⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 analogdisplay.bas

📁 Measurement of gamma characteristic(Ca200Sample_Gamma.exe)provides Gamma characteristics of W,R,
💻 BAS
字号:
Attribute VB_Name = "AnalogDisplay"
Option Explicit
Type AnalogValue
    BarType As Integer  '0:Color 1:FMA 2:JEITA
    SelectDataName As String '"COLOR","FMA","JEITA"
    Range(3) As Single
    value(3) As Single
End Type

Public Sub AnalogSet(Bar As Object, Dat As AnalogValue)

    Dim BarColor(3, 9) As Long
    Dim Pink As Long, Water As Long, Black As Long, Blue As Long
    
    Dim i As Integer, j As Integer
    Dim xw As Integer
    Dim yw As Integer
    
    Dim Range(3) As Single
    Dim value(3) As Single
    
    Pink = RGB(255, 0, 255)
    Water = RGB(0, 255, 255)
    Black = RGB(0, 0, 0)
    Blue = RGB(0, 0, 255)
    
    Bar.ScaleHeight = 600
    Bar.ScaleWidth = 880
    xw = 880
    yw = 600
    
    Bar.Cls
        
    For i = 0 To 2
        Range(i) = Dat.Range(i)
        value(i) = Dat.value(i)
    Next i
    
    Select Case Dat.SelectDataName
        Case "COLOR" 'Lvxy
            For i = 0 To 2
                If -Range(i) < value(i) And Range(i) > value(i) Then
                    BarColor(i, 0) = Black
                    BarColor(i, 1) = Black
                    BarColor(i, 2) = Black
                    BarColor(i, 3) = Black
                    BarColor(i, 4) = Water
                    BarColor(i, 5) = Black
                    BarColor(i, 6) = Black
                    BarColor(i, 7) = Black
                    BarColor(i, 8) = Black
                ElseIf 0 < value(i) Then
                    If Range(i) * 2 > value(i) Then
                        BarColor(i, 0) = Black
                        BarColor(i, 1) = Black
                        BarColor(i, 2) = Black
                        BarColor(i, 3) = Black
                        BarColor(i, 4) = Water
                        BarColor(i, 5) = Water
                        BarColor(i, 6) = Black
                        BarColor(i, 7) = Black
                        BarColor(i, 8) = Black
                    ElseIf Range(i) * 4 > value(i) Then
                        BarColor(i, 0) = Black
                        BarColor(i, 1) = Black
                        BarColor(i, 2) = Black
                        BarColor(i, 3) = Black
                        BarColor(i, 4) = Water
                        BarColor(i, 5) = Water
                        BarColor(i, 6) = Pink
                        BarColor(i, 7) = Black
                        BarColor(i, 8) = Black
                    ElseIf Range(i) * 8 > value(i) Then
                        BarColor(i, 0) = Black
                        BarColor(i, 1) = Black
                        BarColor(i, 2) = Black
                        BarColor(i, 3) = Black
                        BarColor(i, 4) = Water
                        BarColor(i, 5) = Water
                        BarColor(i, 6) = Pink
                        BarColor(i, 7) = Pink
                        BarColor(i, 8) = Black
                    ElseIf Range(i) * 8 <= value(i) Then
                        BarColor(i, 0) = Black
                        BarColor(i, 1) = Black
                        BarColor(i, 2) = Black
                        BarColor(i, 3) = Black
                        BarColor(i, 4) = Water
                        BarColor(i, 5) = Water
                        BarColor(i, 6) = Pink
                        BarColor(i, 7) = Pink
                        BarColor(i, 8) = Pink
                    End If
                Else
                    If -Range(i) * 2 < value(i) Then
                        BarColor(i, 0) = Black
                        BarColor(i, 1) = Black
                        BarColor(i, 2) = Black
                        BarColor(i, 3) = Water
                        BarColor(i, 4) = Water
                        BarColor(i, 5) = Black
                        BarColor(i, 6) = Black
                        BarColor(i, 7) = Black
                        BarColor(i, 8) = Black
                    ElseIf -Range(i) * 4 < value(i) Then
                        BarColor(i, 0) = Black
                        BarColor(i, 1) = Black
                        BarColor(i, 2) = Pink
                        BarColor(i, 3) = Water
                        BarColor(i, 4) = Water
                        BarColor(i, 5) = Black
                        BarColor(i, 6) = Black
                        BarColor(i, 7) = Black
                        BarColor(i, 8) = Black
                    ElseIf -Range(i) * 8 < value(i) Then
                        BarColor(i, 0) = Black
                        BarColor(i, 1) = Pink
                        BarColor(i, 2) = Pink
                        BarColor(i, 3) = Water
                        BarColor(i, 4) = Water
                        BarColor(i, 5) = Black
                        BarColor(i, 6) = Black
                        BarColor(i, 7) = Black
                        BarColor(i, 8) = Black
                    ElseIf -Range(i) * 8 >= value(i) Then
                        BarColor(i, 0) = Pink
                        BarColor(i, 1) = Pink
                        BarColor(i, 2) = Pink
                        BarColor(i, 3) = Water
                        BarColor(i, 4) = Water
                        BarColor(i, 5) = Black
                        BarColor(i, 6) = Black
                        BarColor(i, 7) = Black
                        BarColor(i, 8) = Black
                    End If
                End If
            Next i
            Case "FMA"
                For i = 0 To 2
                    For j = 0 To 8
                        BarColor(i, j) = Black
                    Next j
                Next i
                i = 1
                If Range(i) > value(i) Then
                    BarColor(i, 4) = Water
                ElseIf Range(i) * 2 > value(i) Then
                    BarColor(i, 3) = Water
                    BarColor(i, 4) = Water
                    BarColor(i, 5) = Water
                ElseIf Range(i) * 4 > value(i) Then
                    BarColor(i, 2) = Pink
                    BarColor(i, 3) = Water
                    BarColor(i, 4) = Water
                    BarColor(i, 5) = Water
                    BarColor(i, 6) = Pink
                ElseIf Range(i) * 8 > value(i) Then
                    BarColor(i, 1) = Pink
                    BarColor(i, 2) = Pink
                    BarColor(i, 3) = Water
                    BarColor(i, 4) = Water
                    BarColor(i, 5) = Water
                    BarColor(i, 6) = Pink
                    BarColor(i, 7) = Pink
                ElseIf Range(i) * 8 <= value(i) Then
                    BarColor(i, 0) = Pink
                    BarColor(i, 1) = Pink
                    BarColor(i, 2) = Pink
                    BarColor(i, 3) = Water
                    BarColor(i, 4) = Water
                    BarColor(i, 5) = Water
                    BarColor(i, 6) = Pink
                    BarColor(i, 7) = Pink
                    BarColor(i, 8) = Pink
                End If
            Case "JEITA"
                For i = 0 To 2
                    For j = 0 To 8
                        BarColor(i, j) = Black
                    Next j
                Next i
        End Select
    
    'Horizontal Line
    For i = 1 To 2
        Bar.Line (0, yw / 3 * i)-(xw, yw / 3 * i), Black
    Next i
    
    'Triangle Mark
    For i = 0 To 2
        Bar.Line (450, 30 + i * 200)-(490, 30 + i * 200), Blue
        Bar.Line (450, 30 + i * 200)-(470, 80 + i * 200), Blue
        Bar.Line (490, 30 + i * 200)-(470, 80 + i * 200), Blue
    Next i
    
    For i = 0 To 2
        For j = 0 To 8
            Bar.Line (j * 90 + 80, 110 - 10 + i * 200)-(j * 90 + 70 + 80, 110 + 10 + i * 200), BarColor(i, j), BF
        Next j
    Next i

    Select Case Dat.SelectDataName
        Case "COLOR" 'Lvxy
            Bar.CurrentX = 0:    Bar.CurrentY = 0
            Bar.Print "dx"
            Bar.CurrentX = 0:    Bar.CurrentY = 200
            Bar.Print "dy"
            Bar.CurrentX = 0:    Bar.CurrentY = 400
            
            ' 021225
            'Bar.Print "dLv"
            Bar.Print "d" + gstrLvOrEv
            
        Case "FMA"
            Bar.CurrentX = 0:    Bar.CurrentY = 200
            Bar.Print Dat.SelectDataName
        Case "JEITA"
            Bar.CurrentX = 0:    Bar.CurrentY = 200
            Bar.Print
    End Select


End Sub

Public Sub AnalogBarDisp(mm As RefData)
    
    Dim tt As AnalogValue
    Dim analogrange(3) As Single
    

    Select Case mm.SelectDataName
        Case "COLOR"
            objCa.GetAnalogRange analogrange(0), analogrange(1)
            tt.Range(0) = analogrange(0)
            tt.Range(1) = analogrange(0)
            tt.Range(2) = analogrange(1)
            tt.value(0) = (typCurrentMeasurementData.ssx - typCurrentRefereceData.sRefx) / typCurrentRefereceData.sRefx * 100
            tt.value(1) = (typCurrentMeasurementData.ssy - typCurrentRefereceData.sRefy) / typCurrentRefereceData.sRefy * 100
            tt.value(2) = (typCurrentMeasurementData.sLv - typCurrentRefereceData.sRefLv) / typCurrentRefereceData.sRefLv * 100
        Case "FMA"
            objCa.GetFMAAnalogRange analogrange(0)
            tt.Range(0) = analogrange(0)
            tt.Range(1) = analogrange(0)
            tt.Range(2) = analogrange(0)
            tt.value(0) = typCurrentMeasurementData.sFMA
            tt.value(1) = typCurrentMeasurementData.sFMA 'Use This Value
            tt.value(2) = typCurrentMeasurementData.sFMA
        Case "JEITA"
            objCa.GetFMAAnalogRange analogrange(0)
            tt.Range(0) = analogrange(0)
            tt.Range(1) = analogrange(0)
            tt.Range(2) = analogrange(0)
            tt.value(0) = typCurrentMeasurementData.sJEITA
            tt.value(1) = typCurrentMeasurementData.sJEITA 'Use This Value
            tt.value(2) = typCurrentMeasurementData.sJEITA
    End Select
    
    tt.SelectDataName = mm.SelectDataName
    
    Call AnalogSet(FormMeasurement.picAnalog, tt)


End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -