Cadence Skill 论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 24733|回复: 20

如何將Version 16.x 降到Version 15.7的代碼

[复制链接]
发表于 2013-7-2 08:47:44 | 显示全部楼层 |阅读模式
本帖最后由 XYX365 于 2013-7-2 08:51 编辑

要使用以下的代碼,必須安裝多個版本的Allegro才能使用.
V16.5以上的話必須降到V16.3以下,才能再降到V15.7
  1. axlCmdRegister("16to15" 'fnExportV16xToV15xMain ?cmdType "general")

  2. procedure(fnExportV16xToV15xMain()
  3.   prog(()
  4.       fVersion = axlVersion('version)
  5.       tDesignFullName = axlGetDrawingName()
  6.       tDesignType = axlDesignType(t)
  7.       tHomePath = getShellEnvVar("CDSROOT")
  8.       if(fVersion > 16.0 then
  9.           unless(getShellEnvVar("DOWNREV_16_TO_15") setShellEnvVar("DOWNREV_16_TO_15=1"))
  10.           if(fVersion == 16.01 then
  11.                 tDesignFileName = car(reverse(parseString(tDesignFullName "/")))
  12.                 case(tDesignType
  13.                     ("BOARD"
  14.                         t15xFileName = strcat(cadr(reverse(parseString(tDesignFileName "."))) "_157.brd")
  15.                     )
  16.                     ("PACKAGE"
  17.                         t15xFileName = strcat(cadr(reverse(parseString(tDesignFileName "."))) "_157.dra")
  18.                 )
  19.             )
  20.             tDownSoftware = strcat(tHomePath "\\tools\\pcb\\bin\\vc5\\downrev15.exe")
  21.             if(isExecutable(tDownSoftware) then
  22.                 when(isFile(t15xFileName)
  23.                     deleteFile(t15xFileName)
  24.                 )
  25. sprintf(tSvaeFileCmd "%s %s -outfile %s " tDownSoftware tDesignFileName t15xFileName)
  26. bResult = axlRunBatchDBProgram("Downrev15" tSvaeFileCmd ?startMsg "Save design to 15.7 Start..." ?silent t)
  27. printf("Downrev Finish.")
  28. deleteFile(strcat(car(parseString(tDesignFileName ".")) ".log"))
  29. else
  30. printf("Can not find downrev15.exe")
  31. return(nil)
  32. )
  33. else
  34. if(fVersion < 16.5 then case(tDesignType
  35. ("BOARD"
  36. tNewDesignFileName = strcat(cadr(reverse(parseString(tDesignFullName "/."))) "_New1601.brd")
  37. )
  38. ("PACKAGE"
  39. tNewDesignFileName = strcat(cadr(reverse(parseString(tDesignFullName "/."))) "_New1601.dra")
  40. )
  41. )
  42. when(isFile(tNewDesignFileName)
  43. deleteFile(tNewDesignFileName)
  44. )
  45. tScriptFileName=axlTempFile()
  46. pScriptFile=outfile(tScriptFileName "w")
  47. fprintf(pScriptFile "setwindow pcb\n")
  48. fprintf(pScriptFile "downrev \n")
  49. fprintf(pScriptFile "setwindow form.downrev\n")
  50. fprintf(pScriptFile "FORM downrev downrev \n")
  51. fprintf(pScriptFile "fillin "%s"\n" tNewDesignFileName)
  52. fprintf(pScriptFile "FORM downrev close\n")
  53. close(pScriptFile)
  54. sprintf(tRunScriptCommand,"replay %s",tScriptFileName)
  55. axlShell(tRunScriptCommand)
  56. deleteFile(tScriptFileName)
  57. deleteFile("downrev.log")
  58. case(tDesignType
  59. ("BOARD"
  60. t15xFileName = strcat(cadr(reverse(parseString(tNewDesignFileName "."))) "_157.brd")
  61. )
  62. ("PACKAGE"
  63. t15xFileName = strcat(cadr(reverse(parseString(tNewDesignFileName "."))) "_157.dra")
  64. )
  65. )
  66. case(fVersion
  67. (16.2
  68. tDownSoftware = strcat(tHomePath "\\tools\\pcb\\bin\\vc5\\downrev15.exe"
  69. )
  70. (16.3
  71. tDownSoftware = strcat(tHomePath "\\tools\\pcb\\bin\\vc5\\downrev15.exe"
  72. )
  73. (16.5
  74. tDownSoftware = strcat(tHomePath "\\tools\\pcb\\bin\\vc5\\downrev15.exe"
  75. )
  76. (t
  77. tDownSoftware = strcat(tHomePath "\\tools\\pcb\\bin\\vc5\\downrev15.exe"
  78. )
  79. )
  80. if(isExecutable(tDownSoftware) then
  81. when(isFile(t15xFileName)
  82. deleteFile(t15xFileName)
  83. )
  84. sprintf(tSvaeFileCmd "%s %s -outfile %s " tDownSoftware tNewDesignFileName t15xFileName)
  85. bResult = axlRunBatchDBProgram("Downrev15" tSvaeFileCmd ?startMsg "Save design to 15.7 Start..." ?silent t)
  86. printf("Downrev Finish.")
  87. deleteFile(strcat(car(parseString(tNewDesignFileName ".")) ".log"))
  88. else
  89. printf("Can not find downrev15.exe")
  90. return(nil)
  91. )
  92. else
  93. case(tDesignType
  94. ("BOARD"
  95. tNewDesignFileName = strcat(cadr(reverse(parseString(tDesignFullName "/."))) "_New162.brd")
  96. )
  97. ("PACKAGE"
  98. tNewDesignFileName = strcat(cadr(reverse(parseString(tDesignFullName "/."))) "_New162.dra")
  99. )
  100. )

  101. tScriptFileName=axlTempFile()
  102. pScriptFile=outfile(tScriptFileName "w")
  103. fprintf(pScriptFile "setwindow pcb\n")
  104. fprintf(pScriptFile "downrev \n")
  105. fprintf(pScriptFile "setwindow form.downrev\n")
  106. fprintf(pScriptFile "FORM downrev save2 YES \n")
  107. fprintf(pScriptFile "FORM downrev save\n")
  108. fprintf(pScriptFile "fillin "%s"\n" tNewDesignFileName)
  109. fprintf(pScriptFile "FORM downrev close\n")
  110. close(pScriptFile)
  111. sprintf(tRunScriptCommand,"replay %s",tScriptFileName)
  112. axlShell(tRunScriptCommand)
  113. deleteFile(tScriptFileName)
  114. deleteFile("downrev.log")
  115. )
  116. )
  117. else
  118. return(nil)
  119. )
  120. )
  121. )
复制代码

发表于 2013-7-2 15:58:42 | 显示全部楼层
谢谢分享!!{:soso_e179:}
发表于 2013-8-27 13:12:08 | 显示全部楼层
看起来很庞大
发表于 2013-8-27 14:07:03 | 显示全部楼层
记得我们之前是用一个批处理语句就可以转了
发表于 2013-8-27 14:07:42 | 显示全部楼层
记得我们之前是用一个批处理语句就可以转了
发表于 2014-3-11 09:43:05 | 显示全部楼层
谁知道批处理怎么转呢?
发表于 2014-3-19 21:34:18 | 显示全部楼层
谢谢分享。。。
发表于 2014-3-28 08:48:36 | 显示全部楼层
15.7的安装破解包,谁有呢?群里有我的Q号,谁发我一份
发表于 2014-4-2 17:54:45 | 显示全部楼层
不错 支持;
发表于 2014-4-12 12:45:43 | 显示全部楼层
这个能改成降到15.5的吗?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|网站地图|Cadence Skill 论坛 ( 蜀ICP备13024417号 )

GMT+8, 2024-11-23 17:01 , Processed in 1.301741 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表