ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¤ñ¸û¤@°ï¸ê®Æ¤¤³W«h°ÝÃD¡A¯à§_§PŪ

[µo°Ý] ¤ñ¸û¤@°ï¸ê®Æ¤¤³W«h°ÝÃD¡A¯à§_§PŪ

½Ð°Ý¦U¦ì¤j¤j~
¸ê®Æ«D±`¤j¡A¦ý¥Ø«e¥u·Q½T»{¦p¤U­±ª¬ºA¡A¸Ó¦p¦ó¥h§PÂ_»Ý¨D©O?¦³¤j¤j¥i¥HÀ°¦£¬Ý¤@¤U¶Ü?


¦b¶}©l©Mµ²§ô¡A³o°Ï¶¡¤º
­Y¥H(NET DGND
¥i¥H¥h§PÂ_³o­Ó°Ï¶¡ªºµ²ªG¡A¦³µL²Å¦X»Ý¨D?

»Ý¨D1:
­Y°Ï¶¡¤º¡A¥u¥X²{¤@¦¸portRef«h§PÂ_(net DGND³o­Ó¶}©l¡A¬O²§±`ªº
¨Ã¥B¦Cªí©óÀx¦s®æ¤¤A¦C¤¤

»Ý¨D2:
­Y°Ï¶¡¤º¡AportRef¥X²{¦h¦¸¡A­Y¦³GND©MVDD³o¨âºØ¦r²´¡A³o¼Ë¤]ºâ¬O²§±`
¨Ã¥B¦Cªí©óÀx¦s®æ¤¤A¦C¤¤

--------------------------------------
(net DGND
              (joined
                (portRef DGND)
                (portRef GND
                  (instanceRef INS55717393))
                (portRef VDD
                  (instanceRef INS55717393)))
              (figure WIRE
                (path
                  (pointList
                    (pt 610 -380)
                    (pt 600 -380)
                    (pt 600 -400))))
              (figure WIRE
                (path
                  (pointList
                    (pt 760 -320)
                    (pt 740 -320)))))

¤W¶Ç³¡¥÷¸ê®Æ¤º®eÀÉ®×, ¨Ã¼ÒÀÀ´X­Ó²§±`½d¨Ò~~

TOP

¦^´_ 2# ­ã´£³¡ªL

ÁÂÁªO¥D´£¿ô
ªþ¤W¤å¦rÀÉ~¥Ø«e¬O·Q­n°w¹ï³o¤å¦rÀÉ¡A°µ¸ê®Æ¤ÀªR
¦]¬°(net DGND   ;³oºØ¶}ÀYªº¸ê®Æ«Ü¦hµ§¡A¦b¤U¤@µ§( net XXX)¤§«e¡A·|´£¨ú¥X¤U­±ªºª¬ºA¡A




test0307.rar (3.72 KB)

TOP

¦^´_ 3# boblovejoyce

²§±`1:
­Y°Ï¶¡¤º¡A¥u¥X²{¤@¦¸portRef«h§PÂ_(net DGND³o­Ó¶}©l¡A¬O²§±`ªº
³oÃä±j½Õªº¬O¥u¥X²{¤@¦¸portRef
¨º´N·|±N DGND Åã¥Ü¨ìA¦C¤¤
©ó¬O´NÄ~Äò±½´y¤U¤@­Ó(net
²§±`2:
­Y°Ï¶¡¤º¡AportRef¥X²{¦h¦¸¡A­Y¦³GND©MVDD³o¨âºØ¦r²´¡A³o¼Ë¤]ºâ¬O²§±`
¨Ã¥B¦Cªí©óÀx¦s®æ¤¤A¦C¤¤
¥Øªº¬O¤£·Q­nGND©MVDD ¦P®É¥X²{¦b¦P¤@­Ó (net °Ï¶¡¤º

ªO¥D¥i«ü±Ð¤@¤U¶Ü?

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2016-3-7 21:45 ½s¿è

¦^´_ 4# boblovejoyce


(net DGND ¬°¶}ÀY, ¥i§PÂ_
(pt 740 -320))))) ¬°µ²§À, ¬Û¦üªº«Ü¦h, ³o´NµL©T©w³W«h¥i§PÂ_!
©|¥B¤å¦rÀÉ¥u¯à§ä¨ì¤@­Ónet DGND, ¦Óexcel·Qªí²{ªºµ²ªG¤]¥¼¼ÒÀÀ!!!

TOP

¦^´_ 1# boblovejoyce
¯ó¯ó§¹¦¨¦p¤Uµ{¦¡¡A
¦]¬°VBªº¥¿«hªí¹F¦¡¥\¯à®z¤FÂI
©Ò¥H¤S¦Û¤v¼g¤F FindCloseBracket §ä¥X¤Ç°tªº¥k¬A¸¹¦ì¸m
  1. Sub Test()
  2.     Dim fn As Integer, allText As String, indexClose As Long
  3.     Dim fname
  4.     fname = Application.GetOpenFilename()
  5.     If TypeName(fname) = "Boolean" Then Exit Sub
  6.     fn = FreeFile()
  7.     Open fname For Input As #fn
  8.     allText = Input$(LOF(1), 1)
  9.     Close #fn
  10.    
  11.     Sheets.Add
  12.     Cells(1, 1).Resize(, 3) = Array("net", "check", "portRef")
  13.     Dim oRegex As Object: Set oRegex = CreateObject("vbscript.regexp")
  14.     Dim oMch As Object, oMch2 As Object, x, i As Long, j As Long, endindex As Long
  15.     Dim hasVDD As Boolean, hasGND As Boolean
  16.     With oRegex
  17.         .Global = True
  18.         .Pattern = "\(net\s+([^\s()]*)"     '(net ¶}ÀY¡A®·®»¤U¤@­Ó«DªÅ¥Õ©Î()ªº¦r²Õ
  19.         Set oMch = .Execute(allText)
  20.         
  21.         .Pattern = "\(portRef\s+([^\s()]*)"     '(portRef ¶}ÀY¡A®·®»¤U¤@­Ó«DªÅ¥Õ©Î()ªº¦r²Õ
  22.         i = 2
  23.         For Each x In oMch
  24.             endindex = FindCloseBracket(allText, x.firstIndex)
  25.             Set oMch2 = .Execute(Mid(allText, x.firstIndex, endindex - x.firstIndex + 1))
  26.             Cells(i, 1) = x.subMatches(0)
  27.             j = 3
  28.             hasVDD = False: hasGND = False
  29.             For Each y In oMch2
  30.                 If InStr(1, y.subMatches(0), "VDD", vbTextCompare) Then hasVDD = True
  31.                 If InStr(1, y.subMatches(0), "GND", vbTextCompare) Then hasGND = True
  32.                 Cells(i, j) = y.subMatches(0)
  33.                 j = j + 1
  34.             Next
  35.             Cells(i, 2) = IIf(oMch2.Count < 2 Or (hasVDD And hasGND), "X", "O")
  36.             
  37.             i = i + 1
  38.         Next
  39.     End With
  40. End Sub

  41. '   s: input string
  42. '   i: index of begin bracket "("
  43. Function FindCloseBracket(ByRef s As String, ByVal i As Long) As Long
  44.     Dim isInString As Boolean   'ex : ¹w¨¾Âù¤Þ¸¹¦r¦ê¤ºªº () »~§P
  45.     i = i + 1   '±q¤U¤@­Ó¦r¤¸¶}©l
  46.     Do While i <= Len(s)
  47.         Select Case Mid(s, i, 1)
  48.         Case "("
  49.             If Not isInString Then
  50.                 i = FindCloseBracket(s, i)
  51.                 If i = 0 Then Exit Do
  52.             End If
  53.         Case ")"
  54.             If Not isInString Then
  55.                 FindCloseBracket = i
  56.                 Exit Function
  57.             End If
  58.         Case """"
  59.             isInString = Not isInString
  60.         Case Else
  61.         End Select
  62.         
  63.         i = i + 1
  64.         DoEvents
  65.     Loop
  66.     FindCloseBracket = 0
  67. End Function
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¥u¥Î²³æªº³W«h¡A
(net DGND¡@ªí¥Ü¶}ÀY¡A
¹J¢´­Ó¥k¬A¸¹¡@)))))¡@¬°µ²§À¡A
­Y«D¦¹³W«h¡A¤£¶·¦A°Ñ¦Ò¥H¤U¤º®e¡I

±N¤å¦rÀɶK¦Ü¢ÏÄæ¡AÀË´ú¦³²§±`¡A¦b¢ÐÄæ¥H¤å¦rªí¥Ü¡G
Sub TEST()
Dim xR As Range, T$, xH As Range, Cx
[B:B].ClearContents
For Each xR In Range([A1], Cells(Rows.Count, 1).End(xlUp))
¡@¡@T = Trim(xR)
¡@¡@If T = "(net DGND" Then Set xH = xR: ReDim Cx(3): GoTo 101
¡@¡@If xH Is Nothing Then GoTo 101
¡@¡@If InStr(xR, "portRef") Then Cx(0) = Cx(0) + 1
¡@¡@If T = "(portRef GND" Then Cx(1) = 1: GoTo 101
¡@¡@If T = "(portRef VDD" Then Cx(2) = 1: GoTo 101
¡@¡@If Right(T, 5) = ")))))" Then
¡@¡@¡@¡@If Val(Cx(0)) < 2 Then Cx(3) = 1
¡@¡@¡@¡@If Cx(1) + Cx(2) > 1 Then Cx(3) = 2
¡@¡@¡@¡@If Cx(3) > 0 Then Range(xH(1, 2), xR(1, 2)) = "²§±`(" & Cx(3) & ")"
¡@¡@¡@¡@Set xH = Nothing
¡@¡@End If
101: Next
End Sub

°Ñ¦ÒÀÉ¡G
http://www.funp.net/634979

TOP

¦^´_ 6# stillfish00
ÁÂÁ¦^ÂÐ~¥i¥H³B²z
ÁöµM§Ú¦³¸Õ¹L¼Æ¶q¦æ¼Æ«Ü¦h®É¡A§Ú¶]¤F¤@­Ó¤p®É~¥¦¤~¦AÄ~Äòcheck©M¼g¤J
¦]¬°§Úªº¸ê®Æ¼Æ¶q¥i¥H¹F¨ì50¸U¦æ¥H¤W
µM«á¤S¦³­«­«ªºÃö«Y~~
¦pªG¦³CHECK OKªº¡A¤£»Ý­n¼g¤JÅã¥Ü¥X¨Ó¡AÀ³¸Ó´N·|§Ö¨Ç

TOP

¦^´_ 7# ­ã´£³¡ªL


    ÁÂÁ¦^ÂÐ~
¦]¬°³W«h«Ü¦h¡A³o¥u¬O¨ä¤¤¤@­Ó³W«h
§Úªº³W«h¡A¬O¦b±½´y¥u­n¦³(net
´N¶}©l¥h§PÂ_~
µ²§À¤£¤@©w¬O)))))
µ²§ÀÀ³¸Óºâ¬O¤U¤@­Ó(net¤§«e~

§Ú´ú¸Õ¤F~¦b³o­Ó©T©wªº³W«h¤U¡A¬OOKªº (¥i¬O§Ú¦³±NCX(0)§ï¦¨¤p©ó3)
³v¦æ°õ¦æ®É¡ACX(1) CX(2) ©l²×¨S¦³­È
½Ð±Ð¬°¤°»ò·|¨S¦³­È?

TOP

¦^´_ 9# boblovejoyce

³á~§â³o­Ó§ï¦¨InStr¡A´N¦³­È¤F~
If InStr(T, "(portRef GND") > 0 Then Cx(1) = 1: GoTo 101
If InStr(T, "(portRef VDD") > 0 Then Cx(2) = 1: GoTo 101

ÁÂÁÂ

TOP

        ÀR«ä¦Û¦b : ª¾ÃÑ­n¥Î¤ßÅé·|¡A¤~¯àÅܦ¨¦Û¤vªº´¼¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD