1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559
| Imports System.IO
Public Class Form1
'first method: Path on localhost
Public rep1 As String = "C:\SOC"
Public rep2 As String = "C:\EMC"
' Indicateur pour GUI
Dim indic0 As Boolean
Dim indic1 As Boolean
Dim indic2 As Boolean
Dim indic3 As Boolean
Dim indic4 As Boolean
Dim indic5 As Boolean
Dim indic6 As Boolean
Dim indic7 As Boolean
Dim indic8 As Boolean
'''''''''''''''''''Declaration SOC ERRORS
'Error Type 1:
Public SOC_Erreur0 As String = "[ERROR]: 0xEB001002 Setup FLAVA(HDMI OUT 1080p"
''''''''''''''''''''Error Type 2:
Public SOC_Erreur00 As String = "bank=0x0,row=0x0,col=0x30,top=NG,bottom=OK"
Public SOC_Erreur01 As String = "bank=0x1,row=0x0,col=0x30,top=NG,bottom=OK"
Public SOC_Erreur02 As String = "bank=0x2,row=0x0,col=0x30,top=NG,bottom=OK"
Public SOC_Erreur03 As String = "bank=0x3,row=0x0,col=0x30,top=NG,bottom=OK"
Public SOC_Erreur04 As String = "bank=0x4,row=0x0,col=0x30,top=NG,bottom=OK"
Public SOC_Erreur05 As String = "bank=0x5,row=0x0,col=0x30,top=NG,bottom=OK"
Public SOC_Erreur06 As String = "bank=0x6,row=0x0,col=0x30,top=NG,bottom=OK"
Public SOC_Erreur07 As String = "bank=0x7,row=0x0,col=0x30,top=NG,bottom=OK"
''''''''''''''''''Error Type 3:
Public SOC_Erreur10 As String = "bank=0x0,row=0x0,col=0x30,top=OK,bottom=NG"
Public SOC_Erreur11 As String = "bank=0x1,row=0x0,col=0x30,top=OK,bottom=NG"
Public SOC_Erreur12 As String = "bank=0x2,row=0x0,col=0x30,top=OK,bottom=NG"
Public SOC_Erreur13 As String = "bank=0x3,row=0x0,col=0x30,top=OK,bottom=NG"
Public SOC_Erreur14 As String = "bank=0x4,row=0x0,col=0x30,top=OK,bottom=NG"
Public SOC_Erreur15 As String = "bank=0x5,row=0x0,col=0x30,top=OK,bottom=NG"
Public SOC_Erreur16 As String = "bank=0x6,row=0x0,col=0x30,top=OK,bottom=NG"
Public SOC_Erreur17 As String = "bank=0x7,row=0x0,col=0x30,top=OK,bottom=NG"
'''''''''''''''''''Error Type 4:
Public SOC_Erreur20 As String = "DCT[0] is disabled"
Public SOC_Erreur21 As String = "DCT[1] is disabled"
Public SOC_Erreur22 As String = "DCT[2] is disabled"
Public SOC_Erreur23 As String = "DCT[3] is disabled"
Public SOC_Erreur24 As String = "DCT[4] is disabled"
Public SOC_Erreur25 As String = "DCT[5] is disabled"
Public SOC_Erreur26 As String = "DCT[6] is disabled"
Public SOC_Erreur27 As String = "DCT[7] is disabled"
'''''''''''''''''''Error type 5
Public SOC_Erreur30 As String = "EDC error count is detected (DCT ch0)"
Public SOC_Erreur31 As String = "EDC error count is detected (DCT ch1)"
Public SOC_Erreur32 As String = "EDC error count is detected (DCT ch2)"
Public SOC_Erreur33 As String = "EDC error count is detected (DCT ch3)"
Public SOC_Erreur34 As String = "EDC error count is detected (DCT ch4)"
Public SOC_Erreur35 As String = "EDC error count is detected (DCT ch5)"
Public SOC_Erreur36 As String = "EDC error count is detected (DCT ch6)"
Public SOC_Erreur37 As String = "EDC error count is detected (DCT ch7)"
'''''''''''''''''''''''''''''Declaration EMC ERROR
Public EMC_Erreur As String = "HDMI-IC Access ERROR"
'' declaration des proprietes
Dim Dir1 As New DirectoryInfo(rep1)
Dim Dir2 As New DirectoryInfo(rep2)
Private Sub TextBox1_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
indic0 = False
indic1 = False
indic2 = False
indic3 = False
indic4 = False
indic5 = False
indic6 = False
indic7 = False
indic8 = False
If e.KeyCode = Keys.Enter Then
If TextBox1.Text = "" Then
MsgBox("Please enter Your Board Serial Number ")
TextBox1.Focus()
Exit Sub
End If
Dim SN As String = TextBox1.Text
TextBox1.Text = ""
Try
'STEP1: ERROR SOC CHECK
Dim listFiles_Soc As FileInfo() = Dir1.GetFiles()
Dim listFiles_EMC As FileInfo() = Dir2.GetFiles()
Dim file1 As FileInfo
Dim file2 As FileInfo
Dim fileFound As Boolean = False
'check if the SN flashed corresponds to the right soc file
For Each file1 In listFiles_Soc
If file1.ToString.Contains(SN) Then
'move to the file and open it
Dim MyFile As Stream = File.OpenRead(rep1 + "\" + file1.ToString)
Dim MyLine As StreamReader = New StreamReader(MyFile, System.Text.Encoding.ASCII)
'Read the File Line by Line from the first to the end
MyLine.BaseStream.Seek(0, SeekOrigin.Begin)
'btest varible indique que l'erreur est non existante au prealable dans chaque ligne
Dim btest As Boolean = False
'.peek défini le caractère suivant, si =-1 alors c'est qu'il n'y a plus de caractère et la fin du fichier est donc atteinte
While MyLine.Peek() > -1
Dim rep As String = MyLine.Peek
Dim line As String = MyLine.ReadLine
soc_msg.Text = ""
'test if the line contains any soc error
If line.Contains(SOC_Erreur0) Then
btest = True
soc_msg.Text = +SOC_Erreur0 + vbNewLine
Panel1.BackColor = Color.Red
LabelExpertise.Visible = True
GB_Bottom.Visible = False
GB_Top.Visible = False
Bottom.Visible = False
TOP.Visible = False
End If
'ERROR TYPE2
If line.Contains(SOC_Erreur00) Then
indic0 = True
btest = True
soc_msg.Text = SOC_Erreur00 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur01) Then
indic1 = True
btest = True
soc_msg.Text += SOC_Erreur01 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur02) Then
indic2 = True
btest = True
soc_msg.Text += SOC_Erreur02 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur03) Then
indic3 = True
btest = True
soc_msg.Text += SOC_Erreur03 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur04) Then
indic4 = True
btest = True
soc_msg.Text += SOC_Erreur04 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur05) Then
indic5 = True
btest = True
soc_msg.Text += SOC_Erreur05.ToString + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur06) Then
indic6 = True
btest = True
soc_msg.Text += SOC_Erreur06 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur07) Then
indic7 = True
btest = True
soc_msg.Text += SOC_Erreur07 + vbNewLine
Panel1.BackColor = Color.Red
End If
'ERROR TYPE 3:
If line.Contains(SOC_Erreur10) Then
btest = True
soc_msg.Text = SOC_Erreur10 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur11) Then
btest = True
soc_msg.Text += SOC_Erreur11 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur12) Then
btest = True
soc_msg.Text += SOC_Erreur12 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur13) Then
btest = True
soc_msg.Text += SOC_Erreur13 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur14) Then
btest = True
soc_msg.Text += SOC_Erreur14 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur15) Then
btest = True
soc_msg.Text += SOC_Erreur15 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur16) Then
btest = True
soc_msg.Text += SOC_Erreur16 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur17) Then
btest = True
soc_msg.Text += SOC_Erreur17 + vbNewLine
Panel1.BackColor = Color.Red
End If
'ERROR TYPE 4:
If line.Contains(SOC_Erreur20) Then
btest = True
soc_msg.Text = SOC_Erreur20 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur21) Then
btest = True
soc_msg.Text += SOC_Erreur21 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur22) Then
btest = True
soc_msg.Text += SOC_Erreur22 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur23) Then
btest = True
soc_msg.Text += SOC_Erreur23 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur24) Then
btest = True
soc_msg.Text += SOC_Erreur24 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur25) Then
btest = True
soc_msg.Text += SOC_Erreur25 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur26) Then
btest = True
soc_msg.Text += SOC_Erreur26 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur27) Then
btest = True
soc_msg.Text += SOC_Erreur27 + vbNewLine
Panel1.BackColor = Color.Red
End If
'ERROR TYPE5
If line.Contains(SOC_Erreur30) Then
btest = True
soc_msg.Text = SOC_Erreur30 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur31) Then
btest = True
soc_msg.Text += SOC_Erreur31 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur32) Then
btest = True
soc_msg.Text += SOC_Erreur32 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur33) Then
btest = True
soc_msg.Text += SOC_Erreur33 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur34) Then
btest = True
soc_msg.Text += SOC_Erreur34 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur35) Then
btest = True
soc_msg.Text += SOC_Erreur35 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur36) Then
btest = True
soc_msg.Text += SOC_Erreur36 + vbNewLine
Panel1.BackColor = Color.Red
ElseIf line.Contains(SOC_Erreur37) Then
btest = True
soc_msg.Text += SOC_Erreur37 + vbNewLine
Panel1.BackColor = Color.Red
End If
If Not btest Then
soc_msg.Text = "NO ERRORS FOUND"
Panel1.BackColor = Color.Lime
End If
End While
MyLine.Close()
MyFile.Close()
fileFound = True
End If
If Not fileFound Then
soc_msg.Text = "SOC Log File Not Found"
Panel1.BackColor = Color.Orange
End If
Next 'move to the repertory EMC
'check if the SN flashed corresponds to the right soc file
For Each file2 In listFiles_EMC
If file2.ToString.Contains(SN) Then
'move to the file and open it
Dim MyFile2 As Stream = File.OpenRead(rep2 + "\" + file2.ToString)
Dim MyLine2 As StreamReader = New StreamReader(MyFile2, System.Text.Encoding.ASCII)
MyLine2.BaseStream.Seek(0, SeekOrigin.Begin)
Dim btest As Boolean = False
fileFound = True
While MyLine2.Peek() > -1
Dim rep2 As String = MyLine2.Peek
Dim line2 As String = MyLine2.ReadLine
soc_msg.Text = ""
If line2.Contains(EMC_Erreur) Then
btest = True
emc_msg.Text += EMC_Erreur
Panel2.BackColor = Color.Red
End If
If Not btest Then
emc_msg.Text = "NO ERROR FOUND "
Panel2.BackColor = Color.Lime
End If
End While
MyLine2.Close()
MyLine2.Close()
fileFound = True
End If
Next
If Not fileFound Then
emc_msg.Text = "EMC Log File Not FOUND"
Panel2.BackColor = Color.Orange
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
' RAM 0 TOP clignote
If indic0 Then
If LabelDCT0.ForeColor = Color.Black Then
LabelDCT0.ForeColor = Color.Red
ElseIf LabelDCT0.ForeColor = Color.Red Then
LabelDCT0.ForeColor = Color.Black
End If
If LabelDCT01.ForeColor = Color.Black Then
LabelDCT01.ForeColor = Color.Red
ElseIf LabelDCT01.ForeColor = Color.Red Then
LabelDCT01.ForeColor = Color.Black
End If
End If
' RAM 1 Bottom clignote
If indic1 Then
If LabelDCT1.ForeColor = Color.Black Then
LabelDCT1.ForeColor = Color.Red
ElseIf LabelDCT1.ForeColor = Color.Red Then
LabelDCT1.ForeColor = Color.Black
End If
If LabelDCT11.ForeColor = Color.Black Then
LabelDCT11.ForeColor = Color.Red
ElseIf LabelDCT11.ForeColor = Color.Red Then
LabelDCT11.ForeColor = Color.Black
End If
End If
' RAM 2 TOP clignote
If indic2 Then
If LabelDCT2.ForeColor = Color.Black Then
LabelDCT2.ForeColor = Color.Red
ElseIf LabelDCT2.ForeColor = Color.Red Then
LabelDCT2.ForeColor = Color.Black
End If
' RAM 2 Bottom clignote
If LabelDCT21.ForeColor = Color.Black Then
LabelDCT21.ForeColor = Color.Red
ElseIf LabelDCT21.ForeColor = Color.Red Then
LabelDCT21.ForeColor = Color.Black
End If
End If
' RAM 3 TOP clignote
If indic3 Then
If LabelDCT3.ForeColor = Color.Black Then
LabelDCT3.ForeColor = Color.Red
ElseIf LabelDCT3.ForeColor = Color.Red Then
LabelDCT3.ForeColor = Color.Black
End If
' RAM 3 Bottom clignote
If LabelDCT31.ForeColor = Color.Black Then
LabelDCT31.ForeColor = Color.Red
ElseIf LabelDCT31.ForeColor = Color.Red Then
LabelDCT31.ForeColor = Color.Black
End If
End If
' RAM 4 TOP clignote
If indic4 Then
If LabelDCT4.ForeColor = Color.Black Then
LabelDCT4.ForeColor = Color.Red
ElseIf LabelDCT4.ForeColor = Color.Red Then
LabelDCT4.ForeColor = Color.Black
End If
' RAM 4 Bottom clignote
If LabelDCT41.ForeColor = Color.Black Then
LabelDCT41.ForeColor = Color.Red
ElseIf LabelDCT41.ForeColor = Color.Red Then
LabelDCT41.ForeColor = Color.Black
End If
End If
' RAM 5 TOP clignote
If indic5 Then
If LabelDCT5.ForeColor = Color.Black Then
LabelDCT5.ForeColor = Color.Red
ElseIf LabelDCT5.ForeColor = Color.Red Then
LabelDCT5.ForeColor = Color.Black
End If
' RAM 5 Bottom clignote
If LabelDCT51.ForeColor = Color.Black Then
LabelDCT51.ForeColor = Color.Red
ElseIf LabelDCT51.ForeColor = Color.Red Then
LabelDCT51.ForeColor = Color.Black
End If
End If
' RAM 6 TOP clignote
If indic6 Then
If LabelDCT6.ForeColor = Color.Black Then
LabelDCT6.ForeColor = Color.Red
ElseIf LabelDCT6.ForeColor = Color.Red Then
LabelDCT6.ForeColor = Color.Black
End If
' RAM 6 Bottom clignote
If LabelDCT61.ForeColor = Color.Black Then
LabelDCT61.ForeColor = Color.Red
ElseIf LabelDCT61.ForeColor = Color.Red Then
LabelDCT61.ForeColor = Color.Black
End If
End If
' RAM 7 TOP clignote
If indic7 Then
If LabelDCT7.ForeColor = Color.Black Then
LabelDCT7.ForeColor = Color.Red
ElseIf LabelDCT7.ForeColor = Color.Red Then
LabelDCT7.ForeColor = Color.Black
End If
' RAM 7 Bottom clignote
If LabelDCT71.ForeColor = Color.Black Then
LabelDCT71.ForeColor = Color.Red
ElseIf LabelDCT71.ForeColor = Color.Red Then
LabelDCT71.ForeColor = Color.Black
End If
End If
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
'RAM 0 clignote TOP and Bottom
If LabelDCT0.Visible = True Then
LabelDCT0.Visible = False
ElseIf LabelDCT0.Visible = False Then
LabelDCT0.Visible = True
End If
If LabelDCT01.Visible = True Then
LabelDCT01.Visible = False
ElseIf LabelDCT01.Visible = False Then
LabelDCT01.Visible = True
End If
'RAM 1 clignote TOP and Bottom
If LabelDCT1.Visible = True Then
LabelDCT1.Visible = False
ElseIf LabelDCT1.Visible = False Then
LabelDCT1.Visible = True
End If
If LabelDCT11.Visible = True Then
LabelDCT11.Visible = False
ElseIf LabelDCT11.Visible = False Then
LabelDCT11.Visible = True
End If
'RAM 2 clignote TOP and Bottom
If LabelDCT2.Visible = True Then
LabelDCT2.Visible = False
ElseIf LabelDCT2.Visible = False Then
LabelDCT2.Visible = True
End If
If LabelDCT21.Visible = True Then
LabelDCT21.Visible = False
ElseIf LabelDCT21.Visible = False Then
LabelDCT21.Visible = True
End If
'RAM 3 clignote TOP and Bottom
If LabelDCT3.Visible = True Then
LabelDCT3.Visible = False
ElseIf LabelDCT3.Visible = False Then
LabelDCT3.Visible = True
End If
If LabelDCT31.Visible = True Then
LabelDCT31.Visible = False
ElseIf LabelDCT31.Visible = False Then
LabelDCT31.Visible = True
End If
'RAM 4 clignote TOP and Bottom
If LabelDCT4.Visible = True Then
LabelDCT4.Visible = False
ElseIf LabelDCT4.Visible = False Then
LabelDCT4.Visible = True
End If
If LabelDCT41.Visible = True Then
LabelDCT41.Visible = False
ElseIf LabelDCT41.Visible = False Then
LabelDCT41.Visible = True
End If
'RAM 5 clignote TOP and Bottom
If LabelDCT5.Visible = True Then
LabelDCT5.Visible = False
ElseIf LabelDCT5.Visible = False Then
LabelDCT5.Visible = True
End If
If LabelDCT51.Visible = True Then
LabelDCT51.Visible = False
ElseIf LabelDCT51.Visible = False Then
LabelDCT51.Visible = True
End If
'RAM 6 clignote TOP and Bottom
If LabelDCT6.Visible = True Then
LabelDCT6.Visible = False
ElseIf LabelDCT6.Visible = False Then
LabelDCT6.Visible = True
End If
If LabelDCT61.Visible = True Then
LabelDCT61.Visible = False
ElseIf LabelDCT61.Visible = False Then
LabelDCT61.Visible = True
End If
'RAM 7 clignote TOP and Bottom
If LabelDCT7.Visible = True Then
LabelDCT7.Visible = False
ElseIf LabelDCT7.Visible = False Then
LabelDCT7.Visible = True
End If
If LabelDCT71.Visible = True Then
LabelDCT71.Visible = False
ElseIf LabelDCT71.Visible = False Then
LabelDCT71.Visible = True
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
LabelDCT0.Visible = False
LabelDCT1.Visible = False
LabelDCT2.Visible = False
LabelDCT3.Visible = False
LabelDCT4.Visible = False
LabelDCT5.Visible = False
LabelDCT6.Visible = False
LabelDCT7.Visible = False
LabelDCT71.Visible = False
LabelDCT01.Visible = False
LabelDCT21.Visible = False
LabelDCT31.Visible = False
LabelDCT41.Visible = False
LabelDCT51.Visible = False
LabelDCT61.Visible = False
LabelDCT11.Visible = False
LabelExpertise.Visible = False
Timer1.Start()
' Timer2.Start()
End Sub
End Class |
Partager