christmas decorations for the schematic editor. Svenn shoul
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
christmas decorations for the schematic editor. Svenn shoul

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Cadence
Author Message
fogh
Guest





Posted: Fri Nov 26, 2004 1:03 am    Post subject: christmas decorations for the schematic editor. Svenn shoul Reply with quote

Hi All,

I have started writing a toolbar for placing instances in a schematic. I am a
bit too busy for this now, but please contribute if you want.
I should rephrase that: contribute any change you make. Consider this code as
GPL licensed : do not distribute it encrypted or in context-file only format ;
and do send back the improvements.

/*
Frederic Oghdayan , november 2004.
generate a schematic toolbar for the current technology.

TODO:
- group by category,
- skip categories||cells with names like "obsolete" "don t use" ...
- trigger with schematic editor.
- use dlSaveDlist and dlDlistToIcon to generate readymade icons as library
owner. If speed allows, appear/disappear with instance mode.
- find&use grey std color background
- avoid empty icons: make the symbol fatter before turning it to a DL.
X- make more columns depending on available screen height
X- close all cell in scratch mode (and refresh?)
- select by menu which libraries/categories/cells should be in the bar
*/

hiSetBindKey("Schematics" "CtrlShift<Key>t" "CmTechSchIcons()")

procedure(CmTechSchIcons() ;;this proc generates globals with name "^CmTechSch"
let(
;nil
(techlibname cv dl icon iconsymname itemsymname menusymname callback cols rows
handlename w (usablescreenheigth 600) (iconwidth 32) )
usablescreenheigth=if(isCallable('getMaxScreenCoords)
round(80%*cadr(getMaxScreenCoords()))
usablescreenheigth)

;;techlibname="gpdk"
techlibname=techGetTechFile(geGetEditCellView())->libName
CmTechSchItemList=foreach(mapcar ddsym setof(cell ddGetObj(techlibname)->cells
member("symbol" cell~>views~>name))
cv=dbOpenCellViewByType(ddsym->lib->name ddsym->name "symbol")
dbReopen( cv "s" ) ;this saves specifying cellViewType.
foreach(s cv~>shapes
unless(car(s->lpp)=="device" dbDeleteObject(s))
)
dbComputeBBox(cv)
dl=geCellViewToDlist(cv)
;; do this only as library owner and make an autoload
mechanism.;;dlSaveDlist(dl strcat("CmTechSch" "_" techlibname "_" ddsym->name
".displaylist.il") strcat("CmTechSch_DL" "_" techlibname "_" ddsym->name ) )
icon=dlDlistToIcon(dl iconwidth iconwidth )
iconsymname=strcat("CmTechSchFixedMenuIcon" "_" techlibname "_" ddsym->name)
set(stringToSymbol(iconsymname) copy(icon))
itemsymname=strcat("CmTechSchFixedMenuItem" "_" techlibname "_" ddsym->name)
menusymname=strcat("CmTechSchFixedMenu" "_" techlibname "_" ddsym->name)
callback=strcat("schHiCreateInst(\"" ddsym->lib->name "\" \"" ddsym->name "\"
\"" "symbol\"" ")" )
set(
stringToSymbol(itemsymname)
hiCreateMenuItem(
?name stringToSymbol(itemsymname)
?itemText ddsym->name
?itemIcon symeval(stringToSymbol(iconsymname))
?callback callback
)
);set item
dbPurge(cv)
stringToSymbol(itemsymname) ;;mapcar return value
);foreach ddsym

cols=1.0*iconwidth*length(CmTechSchItemList)/usablescreenheigth
if( (cols-floor(cols))/cols < 17%
cols=floor(cols) ;;cram it in
cols=ceiling(cols)
)
printf("%L\n" cols)
rows=ceiling(1.0*length(CmTechSchItemList)/cols)
handlename=strcat("CmTechSchFixedMenuHandle" "_" techlibname)
set(
stringToSymbol(strcat("CmTechSchFixedMenu" "_" techlibname))
hiCreateVerticalFixedMenu(
stringToSymbol(handlename)
CmTechSchItemList
rows
cols
)
)

;; look at schEnableSchFixedMenu() in schView/schFixMenu.il
;;2- trigger in schematic editor
;;CmTechSchFixedMenu_gpdk
;;
w=(isCallable('geGetEditCellViewWindow)&&geGetEditCellViewWindow(geGetEditCellView())
)||(isCallable('geGetCellViewWindow)&&geGetCellViewWindow(geGetEditCellView()))


hiAddFixedMenu(
?window w
?fixedMenu symeval(stringToSymbol(strcat("CmTechSchFixedMenu" "_" techlibname)))
)

);let
);proc

Back to top
fogh
Guest





Posted: Wed Dec 01, 2004 4:13 pm    Post subject: Re: christmas decorations for the schematic editor. Svenn s Reply with quote

Hey Svenn, you did not like it ?

fogh wrote:
Quote:
Hi All,

I have started writing a toolbar for placing instances in a schematic.
I am a bit too busy for this now, but please contribute if you want.
I should rephrase that: contribute any change you make. Consider this
code as GPL licensed : do not distribute it encrypted or in context-file
only format ; and do send back the improvements.

/*
Frederic Oghdayan , november 2004.
generate a schematic toolbar for the current technology.

TODO:
- group by category,
- skip categories||cells with names like "obsolete" "don t use" ...
- trigger with schematic editor.
- use dlSaveDlist and dlDlistToIcon to generate readymade icons as
library owner. If speed allows, appear/disappear with instance mode.
- find&use grey std color background
- avoid empty icons: make the symbol fatter before turning it to a DL.
X- make more columns depending on available screen height
X- close all cell in scratch mode (and refresh?)
- select by menu which libraries/categories/cells should be in the bar
*/

hiSetBindKey("Schematics" "CtrlShift<Key>t" "CmTechSchIcons()")

procedure(CmTechSchIcons() ;;this proc generates globals with name
"^CmTechSch"
let(
;nil
(techlibname cv dl icon iconsymname itemsymname menusymname callback
cols rows handlename w (usablescreenheigth 600) (iconwidth 32) )
usablescreenheigth=if(isCallable('getMaxScreenCoords)
round(80%*cadr(getMaxScreenCoords()))
usablescreenheigth)

;;techlibname="gpdk"
techlibname=techGetTechFile(geGetEditCellView())->libName
CmTechSchItemList=foreach(mapcar ddsym setof(cell
ddGetObj(techlibname)->cells member("symbol" cell~>views~>name))
cv=dbOpenCellViewByType(ddsym->lib->name ddsym->name "symbol")
dbReopen( cv "s" ) ;this saves specifying cellViewType.
foreach(s cv~>shapes
unless(car(s->lpp)=="device" dbDeleteObject(s))
)
dbComputeBBox(cv)
dl=geCellViewToDlist(cv)
;; do this only as library owner and make an autoload
mechanism.;;dlSaveDlist(dl strcat("CmTechSch" "_" techlibname "_"
ddsym->name ".displaylist.il") strcat("CmTechSch_DL" "_" techlibname "_"
ddsym->name ) )
icon=dlDlistToIcon(dl iconwidth iconwidth )
iconsymname=strcat("CmTechSchFixedMenuIcon" "_" techlibname "_"
ddsym->name)
set(stringToSymbol(iconsymname) copy(icon))
itemsymname=strcat("CmTechSchFixedMenuItem" "_" techlibname "_"
ddsym->name)
menusymname=strcat("CmTechSchFixedMenu" "_" techlibname "_" ddsym->name)
callback=strcat("schHiCreateInst(\"" ddsym->lib->name "\" \""
ddsym->name "\" \"" "symbol\"" ")" )
set(
stringToSymbol(itemsymname)
hiCreateMenuItem(
?name stringToSymbol(itemsymname)
?itemText ddsym->name
?itemIcon symeval(stringToSymbol(iconsymname))
?callback callback
)
);set item
dbPurge(cv)
stringToSymbol(itemsymname) ;;mapcar return value
);foreach ddsym

cols=1.0*iconwidth*length(CmTechSchItemList)/usablescreenheigth
if( (cols-floor(cols))/cols < 17%
cols=floor(cols) ;;cram it in
cols=ceiling(cols)
)
printf("%L\n" cols)
rows=ceiling(1.0*length(CmTechSchItemList)/cols)
handlename=strcat("CmTechSchFixedMenuHandle" "_" techlibname)
set(
stringToSymbol(strcat("CmTechSchFixedMenu" "_" techlibname))
hiCreateVerticalFixedMenu(
stringToSymbol(handlename)
CmTechSchItemList
rows
cols
)
)

;; look at schEnableSchFixedMenu() in schView/schFixMenu.il
;;2- trigger in schematic editor
;;CmTechSchFixedMenu_gpdk
;;
w=(isCallable('geGetEditCellViewWindow)&&geGetEditCellViewWindow(geGetEditCellView())

)||(isCallable('geGetCellViewWindow)&&geGetCellViewWindow(geGetEditCellView()))



hiAddFixedMenu(
?window w
?fixedMenu symeval(stringToSymbol(strcat("CmTechSchFixedMenu" "_"
techlibname)))
)

);let
);proc
Back to top
Roger Light
Guest





Posted: Wed Dec 01, 2004 4:59 pm    Post subject: Re: christmas decorations for the schematic editor. Svenn s Reply with quote

fogh wrote:
Quote:
Hey Svenn, you did not like it ?

fogh wrote:

Hi All,

I have started writing a toolbar for placing instances in a
schematic. I am a bit too busy for this now, but please contribute if
you want.
I should rephrase that: contribute any change you make. Consider this
code as GPL licensed : do not distribute it encrypted or in
context-file only format ; and do send back the improvements.

Well I like it even though I only just got it working. There are no
symbol views in the techlibs for AMS processes - they are all stored in
a separate library called PRIMLIB. I just had to specify the techlib
manually to "fix" it.

It'll be more useful when it can ignore the "don't use" cells. I am too
busy myself to look at it at the moment.

Ignoring "parasitics" type categories might be useful as well.

Cheers,

Roger
--
Nottingham One Day Juggling Convention
5th March 2005 - 10am-Late
http://www.nottsjuggling.co.uk

Back to top
Svenn Are Bjerkem
Guest





Posted: Fri Dec 03, 2004 11:43 am    Post subject: Re: christmas decorations for the schematic editor. Svenn s Reply with quote

fogh wrote:
Quote:
Hey Svenn, you did not like it ?


Hi,

I have been busy with internal training and haven't had time to test it
out. Give me a day or two...

--
Svenn
Back to top
Svenn Are Bjerkem
Guest





Posted: Fri Dec 10, 2004 12:40 pm    Post subject: Re: christmas decorations for the schematic editor. Svenn s Reply with quote

Roger Light wrote:
Quote:
fogh wrote:

Hey Svenn, you did not like it ?

fogh wrote:

Hi All,

I have started writing a toolbar for placing instances in a
schematic. I am a bit too busy for this now, but please contribute if
you want.
I should rephrase that: contribute any change you make. Consider
this code as GPL licensed : do not distribute it encrypted or in
context-file only format ; and do send back the improvements.


Well I like it even though I only just got it working. There are no
symbol views in the techlibs for AMS processes - they are all stored in
a separate library called PRIMLIB. I just had to specify the techlib
manually to "fix" it.

How did you do this? I get a division by zero error because
CmTechSchItemList is empty. That means that the foreach mapcar ddsym is
failing.

fogh:
I have a hard time understanding your code. The purpose of the program
is to create a schematic toolbar for the current technology, but I don't
quite get what the code will result in.

--
Svenn
Back to top
fogh
Guest





Posted: Tue Dec 14, 2004 11:05 am    Post subject: Re: christmas decorations for the schematic editor. Svenn s Reply with quote

Svenn Are Bjerkem wrote:
Quote:
Roger Light wrote:

fogh wrote:

Hey Svenn, you did not like it ?

fogh wrote:

Hi All,

I have started writing a toolbar for placing instances in a
schematic. I am a bit too busy for this now, but please contribute
if you want.
I should rephrase that: contribute any change you make. Consider
this code as GPL licensed : do not distribute it encrypted or in
context-file only format ; and do send back the improvements.



Well I like it even though I only just got it working. There are no
symbol views in the techlibs for AMS processes - they are all stored
in a separate library called PRIMLIB. I just had to specify the
techlib manually to "fix" it.


How did you do this? I get a division by zero error because
CmTechSchItemList is empty. That means that the foreach mapcar ddsym is
failing.

fogh:
I have a hard time understanding your code. The purpose of the program
is to create a schematic toolbar for the current technology, but I don't
quite get what the code will result in.

Ah. You must have a techfile pointing to a library that contains only

symbolics, while the symbols are located in another, less technology
specific, library.

The assumption in the script is that the techfile associated with your
schematic contains all the symbols you want to see on the bar. You can
force the name to the library that has the symbols, like I did at first
with "gpdk".

What the script does is
for every symbol in the PDK library
- open the symbol in scratch mode, so there is no risk of messing up
what is on disk.
- keep only the drawing of the symbol
- turn this drawing into an icon (with a intermediary step to
display-list format)
- make a callback for the icon that instantiates the symbol

and then collect the icons in a vertical menu.
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Cadence All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB