找回密码
 注册
关于网站域名变更的通知
查看: 421|回复: 4
打印 上一主题 下一主题

新手SKIll 解惑, 感谢解答

[复制链接]

该用户从未签到

跳转到指定楼层
#
发表于 2022-4-5 12:28 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
问题:  ( !isDir(sprintf(config_file "%s_shared\\post_process" config_file)) 中,
这个config_file。。。。。。。。。。。config_file    最后的路径是啥? 帮忙贴一下,为啥前后都有config_file变量

完整参考片段:
procedure( ppra_read_gerber_config()
let( (fin line film_def cmp usage key name mod_inc params layers config_file ret)

        ret = nil

        ; location of shared library files
        config_file = getShellEnvVar("allegroLIB_DIR");

        ; see if environment variable was set
        if( !config_file then
                  axlUIConfirm("[ALLEGROLIB_DIR] environment variable not set!")
                 
          ; see if shared post-process location exists
        else if( !isDir(sprintf(config_file "%s_shared\\post_process" config_file)) then
                  axlUIConfirm(sprintf(nil "[%s] library directory does not exist!" config_file))
                 
          ; see if gerber.cfg file exists
        else if( !isFile(sprintf(config_file "%s\\gerber.cfg" config_file)) then
                  axlUIConfirm(sprintf(nil "[%s] does not exist!" config_file))                 
                 
          ; open the file
        else if( (fin = axlDMOpenFile("TEMP" config_file "r")) == nil then
                axlUIConfirm(sprintf(nil "[%s] Cannot open file!" config_file))
               
        else
                ; read the file
                while( (film_def = lineread(fin))
               
                        ; if film_def = t, then it is a blank line
                        ;if( (film_def != t) && (!nindex(film_def ";")) then
                        if( film_def != t then
                               
                                key     = nth(0 film_def)
                                name    = substring(key 3) ; remove usage prefix
                                usage   = substring(key 1 1)                               
                                mod_inc = nth(1 film_def)
                                params  = nth(2 film_def)
                                layers  = nth(3 film_def)
                                PPRA_GERBER_FILMS[key] = make_PPRA_FILM_DATA(?usage usage ?name name ?mod_inc mod_inc ?params params ?layers layers)
                        )
                )
                axlDMClose(fin)
                ret = t
        ))))
        ret
))


该用户从未签到

4#
 楼主| 发表于 2022-4-5 19:51 | 只看该作者
zs_king 发表于 2022-04-05 17:39:36
%s 字符串变量   
%d 整数变量
%f 小数变量
%L  List类型的变量
.......
这些在Skill里,进行格式化的时候,经常用到。可以了解下


太感谢了????

“来自电巢APP”

该用户从未签到

3#
 楼主| 发表于 2022-4-5 19:42 | 只看该作者
多谢解惑

“来自电巢APP”

  • TA的每日心情
    奋斗
    2025-9-24 15:41
  • 签到天数: 86 天

    [LV.6]常住居民II

    2#
    发表于 2022-4-5 13:29 | 只看该作者
    就跟a=a+1的意思差不多,获取它的值,处理,再赋给它。%s表示printf里面的字符串类型。有点c基础的应该知道%d表示十进制数字。

    “来自电巢APP”

    该用户从未签到

    1#
     楼主| 发表于 2022-4-5 12:31 | 只看该作者
    另外%s 代表啥? 见笑了,我是小白


    完整参考片段:
    procedure( ppra_read_gerber_config()
    let( (fin line film_def cmp usage key name mod_inc params layers config_file ret)

            ret = nil

            ; location of shared library files
            config_file = getShellEnvVar("allegroLIB_DIR");

            ; see if environment variable was set
            if( !config_file then
                      axlUIConfirm("[ALLEGROLIB_DIR] environment variable not set!")
                     
              ; see if shared post-process location exists
           else if( !isDir(sprintf(config_file "%s_shared\\post_process" config_file)) then
                      axlUIConfirm(sprintf(nil "[%s] library directory does not exist!" config_file))
                     
              ; see if gerber.cfg file exists
            else if( !isFile(sprintf(config_file "%s\\gerber.cfg" config_file)) then
                      axlUIConfirm(sprintf(nil "[%s] does not exist!" config_file))                 
                     
              ; open the file
            else if( (fin = axlDMOpenFile("TEMP" config_file "r")) == nil then
                    axlUIConfirm(sprintf(nil "[%s] Cannot open file!" config_file))
                   
            else
                    ; read the file
                    while( (film_def = lineread(fin))
                   
                            ; if film_def = t, then it is a blank line
                            ;if( (film_def != t) && (!nindex(film_def ";")) then
                            if( film_def != t then
                                  
                                    key     = nth(0 film_def)
                                    name    = substring(key 3) ; remove usage prefix
                                    usage   = substring(key 1 1)                              
                                    mod_inc = nth(1 film_def)
                                    params  = nth(2 film_def)
                                    layers  = nth(3 film_def)
                                    PPRA_GERBER_FILMS[key] = make_PPRA_FILM_DATA(?usage usage ?name name ?mod_inc mod_inc ?params params ?layers layers)
                            )
                    )
                    axlDMClose(fin)
                    ret = t
            ))))
            ret
    ))

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    关闭

    推荐内容上一条 /1 下一条

    EDA365公众号

    关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

    GMT+8, 2025-11-22 06:48 , Processed in 0.187500 second(s), 24 queries , Gzip On.

    深圳市墨知创新科技有限公司

    地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

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