• 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. Unable to register data type for csv files

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 150
  • Views 12727
  • 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

Unable to register data type for csv files

MorrisDH
MorrisDH over 3 years ago

This how I coded the DataFormat:

DataFormat libreoffice {
  Pattern = document.csv;
  Default_Editor = libreoffice;
  dfII_ViewType = csvText;
  Co_Managed = document.csv master.tag;
}


ViewAlias {
  csvText=libreoffice
}

Tool libreoffice {}

The data trigger:

procedure( csvDataTrigger(argList)
let( (mode(getq(argList accessMode)) libName(getq(argList libName)) cellName(getq(argList cellName)) viewName(getq(argList viewName)) fileId fileName)


    fileId=ddGetObj(libName cellName viewName "document.csv")

    when(fileId
        fileName=strcat(ddGetObjWritePath(ddGetObj(libName cellName viewName)) "/document.csv")
                if(isFile("/bin/libreoffice") then
          ipcBeginProcess(sprintf(nil "libreoffice %s" fileName))
                )
        )
    t
)
)

Dummy functions. I don't get why we need dummy functions but that's OK for now.

procedure( csvAppTrig(argL) t )
procedure( csvEnableTrig(@optional argL) t )

procedure( csvRegister()
  deRegApp(
    ?appName "libreoffice"
    ?appTrigger 'csvAppTrig ; Dummy function
    ?dataTrigger 'csvDataTrigger
    ?enableTrigger 'csvEnableTrig ; Dummy function
    ?viewType "csvText"
    ?widgetType "none"
  )
)

 Register the triggers

csvRegister()

envSetVal("graphic" "viewNameToTypeList" 'string "document csv")

The code loads with no errors or warnings but the view type is not listed in the cell creation drop down.

  • Cancel
  • MorrisDH
    MorrisDH over 3 years ago

    Changed "document" to "csvText" in the envSetVal command but that had not affect.

    Manually created the view by created test_csv/csvText/master.tag and test_csv/csvText/document.csv in a library. When I attempted to open in virtuoso I get a warning dialog "The viewType (bom) of cellview Test/test_csv/csvText is not registered to be opened in a Virtuoso window"

    The data.reg file I am using  is the only data.ref file in the search path per setup.loc.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • mbracht
    mbracht over 3 years ago

    Hi,

    For me this works a treat - I just slightly adjusted the dataTrigger function so as to allow for the scenario that the csv document doesn't exist:

    procedure( csvDataTrigger(argList)
       let( (mode(getq(argList accessMode)) libName(getq(argList libName)) cellName(getq(argList cellName)) viewName(getq(argList viewName)) fileId fileName)

          fileId=ddGetObj(libName cellName viewName "document.csv")

          if(fileId then
             fileName=strcat(ddGetObjWritePath(ddGetObj(libName cellName viewName)) "/document.csv")
             if(isFile("/bin/libreoffice") then
                ipcBeginProcess(sprintf(nil "libreoffice %s" fileName))
             )
          else
             fileId = ddGetObj( libName cellName viewName "document.csv" nil "w" )
             fileName=strcat(ddGetObjWritePath(ddGetObj(libName cellName viewName)) "/document.csv")
             (ipcBeginProcess  (sprintf nil "libreoffice %s" fileName))
          )
          t
       )
    )

    Oh - and I didn't issue the envSetVal statement.

    Max

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MorrisDH
    MorrisDH over 3 years ago in reply to mbracht

    Hi,

    Does the new view type show up in the "Type" drop down in the "New File" dialog?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • mbracht
    mbracht over 3 years ago in reply to MorrisDH

    yes it does...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • mbracht
    mbracht over 3 years ago in reply to MorrisDH

    Can you please insert some print statement in your data trigger function just to make sure it actually gets called.
    And when you type in the CIW:
    (deGetAllViewTypes)
    do you see you the csvText view type?
    If you do, what do you get from
    (deGetAppInfo "csvtext")

    Max

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MorrisDH
    MorrisDH over 3 years ago in reply to mbracht

    How to call the function if I can't create a new cell of that viewType? What does argList look like?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • mbracht
    mbracht over 3 years ago in reply to MorrisDH

    argList is a disembodied property list that looks like this:

    from_OpenForm: nil
    fromWindow: nil
    subMaster: nil
    sessionWindow: nil
    checkOutLicense: t
    instanceName: nil
    srcContext: nil
    window: window:4
    pushed: nil
    eip: nil
    action: open
    rootType: "openOffice"
    help: "libreoffice"
    appName: "libreoffice"
    hierPath: ""
    hierarchy: ("{master res doc }:a")
    viewNameList: nil
    accessMode: "a"
    viewFileId: dd:0x2d36e140
    fileName: nil
    viewType: "openOffice"
    viewName: "doc"
    cellName: "res"
    libId: dd:0x2bc655f0
    libName: "master"
    configL: nil
    configId: nil
    prependList: nil

    As you can see it contains (among others...) the information about library, cell and view name.

    But again - can you please run the (deGetAllViewTypes) command to check whether the view type got registered in the first place. And (in case deGetAllViewTypse() returns your new view type) also the (deGetAppInfo ...) command.

    Max

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MorrisDH
    MorrisDH over 3 years ago

    The data.reg and trigger functions all work now. Unfortunately I'm not sure why. I did modify the trigger function as suggested by mbracht but that initially had no positive affect. Now it's working perfectly.

    Thanks for the help.

    Cheers,

    • 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.

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

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