create a form with Skill that create a file from library manager

Discussion in 'Cadence' started by manell15, Apr 22, 2008.

  1. manell15

    manell15 Guest

    I am developping a tool with skill language that generate automaticaly
    a testchip from a file that describe tle list of cells of the
    testchip.
    I want to create from an interface this file that contains in each
    line :
    "name of a library" "name of the cell" "the view of the cell"
    "the position of the cell in the testchip"
    the interface will contain a button called "BROWSE"
    when we click on the button the library manager appears and we choose
    the library, the cell name and the cell view , in this moment a file
    should be created containing all these informations: "name of a
    library" "name of the cell" "the view of the cell" "the position
    of the cell in the testchip"
    Could you please help me

    Best regards
    manell15
     
    manell15, Apr 22, 2008
    #1
  2. manell15

    Riad KACED Guest

    Hi,

    The Cadence Documentation is your best companion.
    You have to learn how to create guis/forms/buttons and write the
    callbacks which are the skill functions to be executed underneath ...
    Give a look to the folowing documents :

    1. The Skill User Guide: $CDSHOME/doc/sklangref/sklangref.pdf
    2. The Skill reference Manual: $CDSHOME/doc/sklanguser/sklanguser.pdf
    3. The User interface Manual: $CDSHOME/doc/skuiref/skuiref.pdf

    The later is a good one to know about the forms/buttons and other GUI
    stuffs. It comes with loads of examples as well.
    This is a good one that can help for your browser task.
    Do note that many posts related to guis/forms have been answered in
    this forum, just google it !

    Give it try yourself and feel free to back if you need a more specific
    thing.

    Riad.

    -------- Snippet from The User interface Manual
    Adding an Entry to a Menu
    The following code adds a new entry, Library Browser, to the CIW. It
    looks for the Library
    Manager entry in all the menus of the CIW, and adds an entry for the
    Library Browser
    immediately after it.
    let( ((ciwBannerMenus hiGetBannerMenus(window(1))) toolMenu
    pdItem menuList found libBrowser)
    while(ciwBannerMenus
    pdItem = eval(car(ciwBannerMenus))
    ciwBannerMenus = cdr(ciwBannerMenus)
    menuList = pdItem ->_menuItemList
    while(menuList
    menuItem = car(menuList)
    menuList = cdr(menuList)
    when(menuItem == ’LibMan
    found = t
    menuList = nil
    ciwBannerMenus = nil
    )
    )
    )
    when( found
    libBrowser = hiCreateMenuItem(
    ?name ’LibBrowser
    ?itemText "Library Browser..."
    ?callback "dmbOpenLibDAGBrowser()"
    )
    hiInsertMenuItem(pdItem libBrowser ’LibMan)
    )
    )
     
    Riad KACED, Apr 23, 2008
    #2
  3. manell15

    S. Badel Guest

    You'll want to look at ddsSyncWithForm() type of function, to allow choosing from the library manager.

    Below's a minimal example.


    Cheers,
    Stéphane

    --

    procedure( SBChooseCellview()

    unless( boundp('CSForm) && hiIsForm(CSForm)
    CSForm = hiCreateAppForm(
    ?name 'CSForm
    ?formTitle "Choose Cellview"
    ?buttonLayout '(OKCancel)
    ?buttonDisabled '(Help)
    ?dialogStyle 'modal
    ?initialSize 320:210
    ?minSize 320:210
    ?maxSize 320:210
    ?fields list(
    ; source
    list( hiCreateStringField(
    ?name 'srcLib
    ?prompt "Library"
    ?defValue ""
    ?callback "ddsUpdateSyncWithForm()"
    ) 20:20 260:025 080 )
    list( hiCreateStringField(
    ?name 'srcCell
    ?prompt "Cell"
    ?defValue ""
    ?callback "ddsUpdateSyncWithForm()"
    ) 20:50 260:025 080 )
    list( hiCreateStringField(
    ?name 'srcView
    ?prompt "View"
    ?defValue ""
    ?callback "ddsUpdateSyncWithForm()"
    ) 20:80 260:025 080 )
    list( hiCreateButton(
    ?name 'srcBrowseBtn
    ?buttonText "Browse..."
    ?callback "ddsSyncWithForm( CSForm 'browse 'srcLib 'srcCell 'srcView )"
    ) 20:120 100:040 )
    ; destination
    ) ; ?fields
    ) ; hiCreateAppForm
    )

    when( hiDisplayForm( CSForm )
    list( CSForm->srcLib->value CSForm->srcCell->value CSForm->srcView->value )
    )

    ) ; procedure
     
    S. Badel, Apr 23, 2008
    #3
  4. manell15

    manell15 Guest

    Thank you very much for your help.
    I want to ask how to add a text in an " MLTextField".
    I've trayed to do it with the fuction "appel()" but this function
    concat all texts in the same line and I want to insert each new text
    in a newline.

    Best regards
    manell15



    list( hiCreateMLTextField(
    ?name 'zone
    ?prompt "List of cells"
    ?defValue ""
    ?editable t
    )

    (defun appel ()
    (let (nextLine)
    nextLine=strcat(CSForm->srcLib->value " " CSForm->srcCell->value " "
    CSForm->srcView->value )
    CSForm~>zone~>value =strcat( nextLine CSForm~>zone~>value )
    )
     
    manell15, Apr 24, 2008
    #4
  5. manell15

    S. Badel Guest

    Thank you very much for your help.
    why don't you add a newline ("\n") ?
     
    S. Badel, Apr 24, 2008
    #5
  6. manell15

    manell15 Guest

    Hi
    when I concat mt text with "\n", "\n" is considered as a string so I
    obtain "text\n"
    It is possible to use "\n" to add a new line ? I know that it is
    possible with printf but for strcut fuction for example can I use it
    to add a new line?

    Best regards
    Manell15
     
    manell15, Apr 24, 2008
    #6
  7. manell15

    S. Badel Guest

    Hi
    From the documentation, I see :

    The string can contain the C newline character (’\n’) to indicate an advance to the next logical line.

    So, yes it should work

    CSForm~>zone~>value =strcat( nextLine "\n" CSForm~>zone~>value )


    How exactly do you do it ?


    Stéphane
     
    S. Badel, Apr 24, 2008
    #7
  8. manell15

    Riad KACED Guest

    Hi !

    I'm not actually sure I've understand the question but a quick test on
    my side gave a pretty good interpretation of the \n
    This is what I've run on my box :
    procedure( rkCreateMLTextForm()
    let((myInitString myNewString)
    myString="Here we go !!"
    myNewString="Here we go Again !!"
    sprintf(myInitString "%s\n%s\n%s\n%s ..." myString myString
    myString myString)
    myMLText = hiCreateMLTextField(
    ?name 'myMLText
    ?prompt "Type in Text"
    ?value myInitString
    )
    myForm = hiCreateAppForm(
    ?name 'myForm
    ?formTitle "Muti Line text Form Sample"
    ?fields list( list(myMLText 0:0 600:200 120))
    )
    myMLText~>value = strcat(myMLText~>value "\n" myNewString "\n\n"
    myNewString)
    hiDisplayForm(myForm)
    )
    )

    Hope it helps !

    Riad.
     
    Riad KACED, Apr 24, 2008
    #8
  9. manell15

    manell15 Guest

    Hi all

    Thank you very much for your help
    I've tryed it and it works now

    Best Regard
    manell15
     
    manell15, Apr 25, 2008
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.