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

📄 bgp.frm

📁 网络路由震荡模拟器
💻 FRM
📖 第 1 页 / 共 2 页
字号:
ReDim lPath(1 To 3, 0 To 5) As String  'l的路由表
 
 lPath(1, 0) = 1
 lPath(1, 1) = 2
 lPath(1, 2) = 4
 lPath(1, 3) = 10
 lPath(1, 4) = 6
 lPath(1, 5) = "n"
 
 lPath(2, 0) = 2
 lPath(2, 1) = 3
 lPath(2, 2) = 4
 lPath(2, 3) = 5
 lPath(2, 4) = 4
 lPath(2, 5) = "m"
 lPath(3, 0) = 0
 
 pPath(1, 0) = 3
 pPath(1, 1) = 3
 pPath(1, 2) = 4
 pPath(1, 3) = 0
 pPath(1, 4) = 10
 pPath(1, 5) = "r"
 pPath(2, 0) = 0
 pPath(3, 0) = 0
 
 
End Sub
'pic1路由图形形初始化
Private Sub Init_BoXing()
    
    Dim x1 As Single
    Dim y1 As Single
    
   Picture1.AutoRedraw = True
   Picture1.ScaleMode = 0
   Picture1.Scale (0, 0)-(300, 200)  ' 设定自定义座标系统。
  ' Picture1.DrawStyle = 2
   Picture1.DrawStyle = 0
   
   Picture1.Circle (60, 60), 5  'n
   Picture1.CurrentY = 54   ' 移动光标位置。
   Picture1.CurrentX = 58
   Picture1.Print "n"
   
    '6
   Picture1.CurrentY = 35   ' 移动光标位置。
   Picture1.CurrentX = 60
   Picture1.Print "6"
     '4
   Picture1.CurrentY = 35   ' 移动光标位置。
   Picture1.CurrentX = 90
   Picture1.Print "4"
   
     'C1
   Picture1.CurrentY = 35   ' 移动光标位置。
   Picture1.CurrentX = 40
   Picture1.Print "C1"
   
   Picture1.Circle (100, 60), 5  'm
   Picture1.CurrentY = 54   ' 移动光标位置。
   Picture1.CurrentX = 96
   Picture1.Print "m"
   
   Picture1.Circle (80, 30), 5  'l
   Picture1.CurrentY = 24   ' 移动光标位置。
   Picture1.CurrentX = 79
   Picture1.Print "l"

   Picture1.Circle (180, 30), 5  'p
   Picture1.CurrentY = 23   ' 移动光标位置。
   Picture1.CurrentX = 178
   Picture1.Print "p"
   
     '1
   Picture1.CurrentY = 15   ' 移动光标位置。
   Picture1.CurrentX = 130
   Picture1.Print "1"

   Picture1.Circle (180, 60), 5  'r
   Picture1.CurrentY = 54   ' 移动光标位置。
   Picture1.CurrentX = 178
   Picture1.Print "r"

     '10
   Picture1.CurrentY = 40   ' 移动光标位置。
   Picture1.CurrentX = 180
   Picture1.Print "10"

      'C2
   Picture1.CurrentY = 40   ' 移动光标位置。
   Picture1.CurrentX = 200
   Picture1.Print "C2"

   Picture1.Circle (60, 120), 5  'o
   Picture1.CurrentY = 114   ' 移动光标位置。
   Picture1.CurrentX = 58
   Picture1.Print "o"
   
     '(10)
   Picture1.CurrentY = 85   ' 移动光标位置。
   Picture1.CurrentX = 40
   Picture1.Print "(10)"
      '(5)
   Picture1.CurrentY = 90   ' 移动光标位置。
   Picture1.CurrentX = 110
   Picture1.Print "(5)"
   
       '(0)
   Picture1.CurrentY = 90   ' 移动光标位置。
   Picture1.CurrentX = 170
   Picture1.Print "(0)"
        'AS3
   Picture1.CurrentY = 115   ' 移动光标位置。
   Picture1.CurrentX = 160
   Picture1.Print "AS3"
        'AS2
   Picture1.CurrentY = 115   ' 移动光标位置。
   Picture1.CurrentX = 70
   Picture1.Print "AS2"
         'AS4
   Picture1.CurrentY = 165   ' 移动光标位置。
   Picture1.CurrentX = 170
   Picture1.Print "AS4"
   
   Picture1.Circle (150, 120), 5  's
   Picture1.CurrentY = 114   ' 移动光标位置。
   Picture1.CurrentX = 148
   Picture1.Print "s"
   
   
   Picture1.Circle (160, 170), 5  'k
   Picture1.CurrentY = 164   ' 移动光标位置。
   Picture1.CurrentX = 158
   Picture1.Print "k"
   
    Picture1.DrawStyle = 2
    Picture1.Circle (80, 45), 45, , , , 0.6 'as1
   Picture1.Circle (190, 45), 30, , , , 0.8 'as1
   Picture1.Circle (130, 45), 110, , , , 0.35 'as1
   
   Picture1.Circle (70, 120), 25, , , , 0.5 'as2
   
   Picture1.Circle (160, 120), 25, , , , 0.5 'as3
   
   Picture1.Circle (170, 170), 25, , , , 0.5 'as4

   initLine
End Sub
Private Sub initLine()
   Picture1.DrawStyle = 0
   Picture1.Line (60, 65)-(60, 115)  'n-o
    
   Picture1.Line (160, 165)-(60, 125)  'k-o

   Picture1.Line (100, 65)-(150, 115)  'm-s
   
   Picture1.Line (180, 65)-(150, 115)  'r-s
   
   Picture1.Line (160, 165)-(150, 125)  'k-s

   Picture1.DrawStyle = 0

     
   Picture1.Line (60, 55)-(80, 35)  'n-l
   
   Picture1.Line (100, 55)-(80, 35)  'm-l
   Picture1.Line (175, 30)-(85, 30)  'p-l
   Picture1.Line (180, 35)-(180, 55)  'p-r
   Picture1.Circle (80, 30), 5  'l

   Picture1.Circle (180, 30), 5  'p
 
   
End Sub
'////////路由选择过程中///////////////
Private Sub flashRotue(ByVal dot As String, ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer)
Dim dt As Variant
Dim drawr As Boolean
Dim drawy As Boolean
Dim j, k, l As Integer

If (p1 = 1) Or (p2 = 1) Or (p3 = 1) Then j = 1

If (p1 = 2) Or (p2 = 2) Or (p3 = 2) Then k = 2
If (p1 = 3) Or (p2 = 3) Or (p3 = 3) Then l = 3
p1 = 0
p2 = 0
p3 = 0
If j = 1 Then p1 = 1
If k = 2 Then p2 = 2
If l = 3 Then p3 = 3
 drawr = False
  drawy = False
  Picture1.DrawStyle = 0
  initLine
Do
  dt = DoEvents()
  If stopSimulate = True Then
       Exit Sub
    End If
If flashTag = True Then
    If drawr = False Then
        
        If dot = "l" Then
          Picture1.Circle (80, 30), 5, RGB(255, 128, 128) 'l
 
          If p1 <> 0 Then
                Picture1.Line (60, 55)-(80, 35), RGB(255, 128, 128) 'n-l
                Picture1.Line (60, 65)-(60, 115), RGB(255, 128, 128) 'n-o
                Picture1.Line (160, 165)-(60, 125), RGB(255, 128, 128) 'k-o
        
          End If
          If p2 <> 0 Then
                Picture1.Line (100, 55)-(80, 35), RGB(255, 128, 128) 'm-l
                Picture1.Line (100, 65)-(150, 115), RGB(255, 128, 128)  'm-s
                Picture1.Line (160, 165)-(150, 125), RGB(255, 128, 128)  'k-s
        
          End If
          If p3 <> 0 Then
               Picture1.Line (175, 30)-(85, 30), RGB(255, 128, 128)  'p-l
               Picture1.Line (180, 35)-(180, 55), RGB(255, 128, 128)  'p-r
               Picture1.Line (180, 65)-(150, 115), RGB(255, 128, 128)  'r-s
               Picture1.Line (160, 165)-(150, 125), RGB(255, 128, 128)  'k-s
        
          End If
          
          
        End If
        
        If dot = "p" Then
           Picture1.Circle (180, 30), 5, RGB(255, 128, 128) 'p

          If p1 <> 0 Then
                Picture1.Line (175, 30)-(85, 30), RGB(255, 128, 128)  'p-l
                Picture1.Line (60, 55)-(80, 35), RGB(255, 128, 128) 'n-l
                Picture1.Line (60, 65)-(60, 115), RGB(255, 128, 128) 'n-o
                Picture1.Line (160, 165)-(60, 125), RGB(255, 128, 128) 'k-o
        
          End If
          If p2 <> 0 Then
                Picture1.Line (175, 30)-(85, 30), RGB(255, 128, 128)  'p-l
                Picture1.Line (100, 55)-(80, 35), RGB(255, 128, 128) 'm-l
                Picture1.Line (100, 65)-(150, 115), RGB(255, 128, 128)  'm-s
                Picture1.Line (160, 165)-(150, 125), RGB(255, 128, 128)  'k-s
        
          End If
          If p3 <> 0 Then
               
               Picture1.Line (180, 35)-(180, 55), RGB(255, 128, 128)  'p-r
               Picture1.Line (180, 65)-(150, 115), RGB(255, 128, 128)  'r-s
               Picture1.Line (160, 165)-(150, 125), RGB(255, 128, 128)  'k-s
        
          End If
          
        End If
       drawy = False
      flashnum = flashnum + 1
      drawr = True
      'flashTag = False
     End If
Else
If drawy = False Then
   
   If dot = "l" Then
         Picture1.Circle (80, 30), 5, RGB(255, 255, 128) 'l
          If p1 <> 0 Then
                Picture1.Line (60, 55)-(80, 35), RGB(255, 255, 128) 'n-l
                Picture1.Line (60, 65)-(60, 115), RGB(255, 255, 128) 'n-o
                Picture1.Line (160, 165)-(60, 125), RGB(255, 255, 128) 'k-o
        
          End If
          If p2 <> 0 Then
                Picture1.Line (100, 55)-(80, 35), RGB(255, 255, 128) 'm-l
                Picture1.Line (100, 65)-(150, 115), RGB(255, 255, 128)  'm-s
                Picture1.Line (160, 165)-(150, 125), RGB(255, 255, 128)  'k-s
        
          End If
          If p3 <> 0 Then
               Picture1.Line (175, 30)-(85, 30), RGB(255, 255, 128)  'p-l
               Picture1.Line (180, 35)-(180, 55), RGB(255, 255, 128)  'p-r
               Picture1.Line (180, 65)-(150, 115), RGB(255, 255, 128)  'r-s
               Picture1.Line (160, 165)-(150, 125), RGB(255, 255, 128)  'k-s
        
          End If
        End If
        
        If dot = "p" Then
         Picture1.Circle (180, 30), 5, RGB(255, 255, 128)
          If p1 <> 0 Then
                Picture1.Line (175, 30)-(85, 30), RGB(255, 255, 128)  'p-l
                Picture1.Line (60, 55)-(80, 35), RGB(255, 255, 128) 'n-l
                Picture1.Line (60, 65)-(60, 115), RGB(255, 255, 128) 'n-o
                Picture1.Line (160, 165)-(60, 125), RGB(255, 255, 128) 'k-o
        
          End If
          If p2 <> 0 Then
                Picture1.Line (175, 30)-(85, 30), RGB(255, 255, 128)  'p-l
                Picture1.Line (100, 55)-(80, 35), RGB(255, 255, 128) 'm-l
                Picture1.Line (100, 65)-(150, 115), RGB(255, 255, 128)  'm-s
                Picture1.Line (160, 165)-(150, 125), RGB(255, 255, 128)  'k-s
        
          End If
          If p3 <> 0 Then
               
               Picture1.Line (180, 35)-(180, 55), RGB(255, 255, 128)  'p-r
               Picture1.Line (180, 65)-(150, 115), RGB(255, 255, 128)  'r-s
               Picture1.Line (160, 165)-(150, 125), RGB(255, 255, 128)  'k-s
        
          End If
          
        End If
 drawr = False
 drawy = True
 End If
End If
  If flashnum = 3 Then
  Exit Do
  End If
Loop 'While flashnum = 5


    Timer1.Enabled = False
    
    initLine
    
    
   


End Sub
Private Sub rturnCmd_Click()
End
End Sub

Private Sub stopCmd_Click()
stopSimulate = True
End Sub

Private Sub Timer1_Timer()


If flashTag = True Then
   
   flashTag = False
Else
   flashTag = True
End If

'flashRotue dot, path1, path2, path3


End Sub

⌨️ 快捷键说明

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