• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Creation of custom view types in IC6

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 14018
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Creation of custom view types in IC6

tyanata
tyanata over 14 years ago

 Can anyone say is there some difference in creation of custom view types in IC6 compared to IC5.

In out IC5 design environment we use several custom viewtypes, registered with corresponding .reg files in $CDSHOME/share/cdssetup/registry/data/ folder. 

So I just copied these .reg files in IC6_install_path//share/cdssetup/registry/data/

After that when I opened in IC6 create new  cellview menu these viewtypes appear in the list. But after that when try to create such cellview the routine crashes.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    It should work the same way. Do you really mean that it "crashes" (i.e. does virtuoso abort), or do you mean that you get a SKILL error?

    If it crashes (i.e. virtuoso exits) you should report it to customer support. If it gives a SKILL error, you might want to post the code here together with the error message and we can take a look (or report to customer support).

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tyanata
    tyanata over 14 years ago

     Hello,

     

    In fact cadence not crashes but error message appear in IC6. The same routine works well in IC5.

    Brief description: this custom view type is called xls and in fact is Excel file attaching as cellview. You can attach already existing xls file or to create new one on basis of existing template file.

     

    First I post the text of file called xls.reg which is placed in  $CDSHOME/share/cdssetup/registry/data/

     /*
    File Name:    :    xls.reg
    */


    DataFormat ExcelSheet {
      Pattern = *.xls;
      Default_Editor = ExcelSheet ;
     dfII_ViewType = xls;
     Co_Managed= *.xls master.tag;
    }


    Tool ExcelSheet{
    Tool_Alias = oocalc;
     }

    Tool oocalc {}

    ViewAlias {
      xls=ExcelSheet;
    }

     

    After that is text of file called xls.il which is in fact the routine of creating xls view:

     

    /* xls.il
     */

    ;Create the initial panel form

    l_sep0 = list(
                 hiCreateSeparatorField(
                   ?name 'sep0
               ) 1:5 400:0)
           
    l_sep1 = list(
                 hiCreateSeparatorField(
                   ?name 'sep1
               ) 399:6 70:1)

    l_sep2 = list(
                 hiCreateSeparatorField(
                   ?name 'sep2
               ) 0:75 400:0)

    l_sep3 = list(
                 hiCreateSeparatorField(
                   ?name 'sep3
               ) 0:6 69:1)


    l_radio1 = list(trXlsFileSelect = hiCreateRadioField(
        ?name        'trXlsFileSelect
        ?prompt     ""
        ?choices    list("Create new *.XLS file" "Select existing *.XLS file")
        ?defValue    "Create new *.XLS file"
        ?itemsPerRow    1
        ) 0:20 400:20)

    l_string1 = list(trXlsFileNameField = hiCreateStringField(
        ?name        'trXlsFileNameField
        ?invisible    t
        ?defValue    "NOFILE"
        ) 0:50 400:10)


    trXlsSelectForm = hiCreateAppForm(
        ?name         'trXlsSelectForm
        ?formTitle    "Chose creation mode"
        ?callback    '("XlsSelectFormCB(hiGetCurrentForm() )")
        ?fields        list(l_sep0 l_sep1 l_sep2 l_sep3 l_radio1 l_string1)
        ?buttonLayout    'OKCancel
        ;?unmapAfterCB    t        

    )   


    procedure( XlsSelectFormCB(theForm)
    prog((file_path file_extension file retdia fchoice)
    retdia = t
    file_path=""
    file_extension=""
    fchoice = theForm->trXlsFileSelect->value
    case( fchoice

    ( "Create new *.XLS file"
    ; put here some excel file
    file_path = ".../template.xls"
    theForm->trXlsFileNameField->value = file_path
    retdia = t
    );Create new *.XLS file

    ("Select existing *.XLS file"

    while(!isFile(file_path) || (file_extension != "xls")
    theForm->trXlsFileNameField->value = "*.xls"
    ddsFileBrowseCB(theForm 'trXlsFileNameField  "*.xls")

    file_path = theForm->trXlsFileNameField->value
    if(!isFile(file_path) then

    warnText = sprintf(nil "File doesn't exist:\nPress YES to try again")
    ;display warning box
    retdia = hiDisplayAppDBox(
        ?name 'xx
        ?dboxBanner " "
        ?dboxText warnText
        ?buttonLayout 'YesNo
    )

    ;file exists, but extension doesn't match program_file_extension
    else
    ;get file
    file = car(last(parseString(file_path "/")))

    ;get file extension
    file_extension = car(last(parseString(file ".")))
    ;println(file_extension)
    if(file_extension != "xls" then
    warnText = sprintf(nil "%s is not a XLS file:\nPress YES to try again" file )
    ;display warning box
    retdia = hiDisplayAppDBox(?name 'xx
    ?dboxBanner " "
    ?dboxText warnText
    ?buttonLayout 'YesNo
    )
    ) ; if
    ) ;if

    ;user gives up - then return NOFILE
    when(!retdia
    file_path = "NOFILE"
    theForm->trXlsFileNameField->value = file_path
    return(nil)

    );when


    ); while

    );Select existing *.XLS file

    );case

    ;println(file_path)
    return(t)
    );prog
    );SelectFormCB





    procedure( openXlsDataTrigger(argList)
    prog(( cellName file libName objId tmplFile viewFileName viewName viewType cmd)

      cellName = argList->cellName
      libName = argList->libName
      viewName = argList->viewName
      viewType = argList->viewType
      mode = argList->accessMode
     
      viewFileName = ddMapGetViewTypeFileName( viewType )


    case( mode
       ;
          ("w" ; Create the XLS cellView if not exists or re-write

    tmplFile = "NOFILE"
    hiFormDefaults(trXlsSelectForm)
    while(!isFile(tmplFile)

    hiDisplayForm( trXlsSelectForm )
    tmplFile = trXlsSelectForm->trXlsFileNameField->value

    ;when user gives up
    when(tmplFile == "NOFILE"

    ;delete the cell
    ;if open for read, it exists
    objId=ddGetObj(libName cellName viewName viewFileName nil "r")

    if(!objId then

    ;get object Id
    objId = ddGetObj(libName )

    if((length(dbAllCellViews(objId cellName)) <= 1) &&  member(viewName dbAllCellViews(objId cellName)) then

    cmd=sprintf(nil "\\rm -Rf %s" ddGetObj(libName cellName)~>writePath); delete the whole cell if it containf only XLS

    else
    cmd=sprintf(nil "\\rm -Rf %s" ddGetObj(libName cellName viewName)~>writePath); delete XLS view only
    )
    ;delete object
    ;println(cmd) - tracking
    unless(system(cmd)
    error(" ERROR - command failed: %s \n" cmd)
    ) ; unless
    ) ; if


    return(nil)
    );when


    );while





    objId = ddGetObj(libName cellName viewName)
    unless(objId~>isWritable
    ;checkout call
    ddAutoCheckout(objId)
    )

    ;checkout failed, error out
    unless(objId~>isWritable
    error("View could not be opened for edit.")
    ) ; unless

    ;delete object
    cmd=sprintf(nil "\\rm -rf %s" objId~>writePath)
    unless(system(cmd)
    error(" ERROR - command failed: %s \n" cmd)
    ) ; unless



     file = strcat(libName "_" cellName "_" viewName ".xls") 
     printf(file)
     objId = ddGetObj(libName cellName viewName file nil "w" )

    ;get file path
    file_path = ddGetObjWritePath(objId)

    ;copy the file to the cell view location
    cmd=sprintf(nil "\\cp %s %s" tmplFile file_path)
    unless(system(cmd)
    error(" ERROR - command failed: %s \n" cmd)
    ) ; unless

    system(sprintf(nil "chmod +w %s" file_path))

    file = ddGetObjWritePath( objId )
    cmd = sprintf( nil "ooffice -nologo %s  &" file )
    );w
        ("a" ;open existing cell wor write
        if( objId = ddGetObj( libName cellName viewName viewFileName nil "r" ); if exists - just open it
        then 
            file = ddGetObjWritePath( objId )
            cmd = sprintf( nil "ooffice -nologo %s  &" file )
        else
            ;display error message
            hiDisplayAppDBox(?name 'xx
            ?dboxBanner " "
            ?dboxText "Error: maybe file doesn't exist or failed"
            ?buttonLayout 'CloseHelp
            )
            return(nil);exit
           
        );if
    );a
        ("r" ;read-only
        if( objId = ddGetObj( libName cellName viewName viewFileName nil "r" ); if exists - just open it
        then 
            file = ddGetObjWritePath( objId )
            cmd = sprintf( nil "ooffice -nologo -view %s  &" file );open in viewer mode
        else
            ;display error message
            hiDisplayAppDBox(?name 'xx
            ?dboxBanner " "
            ?dboxText "Error: maybe file doesn't exist or failed"
            ?buttonLayout 'CloseHelp
            )
            return(nil);exit
           
        );if
    );r

    );case
      ;
      ; Start OpenOffice
      ;
     
      system(cmd)
      return(t)
      ); prog

    );procedure

    ;
    ; Dummy trigger functions
    ;
    procedure( CCSxlsAppTrig(argL) t )
    procedure( CCSxlsEnableTrig(@optional argL) t )

    procedure( CCSxlsRegister()
      deRegApp(
        ?appName "oocalc"
        ?appTrigger 'CCSxlsAppTrig ; Dummy function
        ?dataTrigger 'openXlsDataTrigger
        ?enableTrigger 'CCSxlsEnableTrig ; Dummy function
        ?viewType "xls"
        ?widgetType "none"
      )
    )

    ;
    ; Register the triggers
    ;
    unless(deViewTypeIsRegistered("xls")
    CCSxlsRegister()
    )

     

    Be aware that following lines have to be customized for your case:

    ; put here some excel file
    file_path = ".../template.xls"

    Here you just have to create one file called template.xls and to enter its path insted of  .../template.xls.

     

    Here is the error message which I receive in IC6:

     *Error* View could not be opened for edit.
    *WARNING* (DEBASE-102079): A SKILL error occurred in function openXlsDataTrigger

     

    Best regards,

     

    tyanta

     

     

     

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tyanata
    tyanata over 14 years ago

    Additional information about the routines in xls.il. They are based on the routines in Solution ID:    1836295 . 

    Only difference is that we added possiblity file with name different from "template" to be used for cellview xls.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information