println( "******************load MY USER CUSTOMISATION**************************" )

loadi("/user/ra115c/FloorplanSkill/pin_opt.il")

;drLoadDrf("/user/ra115c/cdsUser44/display_10.drf" nil)

;;; for Assura density custom checks:
;load "/user/ra115c/bin/density_custom.il"
;load "/user/ra115c/bin/layers_density_report.il"
;load "/user/ra115c/bin/generate_alcap_square.il"

load "/user/ra115c/cdsUser44/bindkeys.txt"

legRpDelta=0.6



hiSetBindKey("Layout" "`" "leHiSetRefPoint()")
hiSetBindKey("Layout" "<Key>F9" "lxHiSwapComps()")
hiSetBindKey("Layout" "<Key>F1" "leSetEnv(\"orientation\" \"MY\")")
hiSetBindKey("Layout" "<Key>F1" "leSetEnv(\"orientation\" \"MY\")")
hiSetBindKey("Layout" "<Key>F2" "leSetEnv(\"orientation\" \"MX\")")
hiSetBindKey("Layout" "<Key>d" "leSetFormSnapMode(\"diagonal\")")
hiSetBindKey("Layout" "<Key>a" "leSetFormSnapMode(\"anyangle\")")
hiSetBindKey("Layout" "Ctrl<Key>n" "leSetFormSnapMode(\"orthogonal\")")
;hiSetBindKey("Layout" "<Key>F9" "CalculEchelle()")
;bk("Layout" "<Key>x" "hiZoomRelativeScale(hiGetCurrentWindow() 4)")
hiSetBindKey("Layout" "Shift<Key>x" "hiZoomRelativeScale(hiGetCurrentWindow() 0. 25)")
;hiSetBindKey("Layout" "Shift<Key>Left" "leMoveCursor( -legRpDelta  0)")
;hiSetBindKey("Layout" "Shift<Key>Right" "leMoveCursor( legRpDelta  0)")
hiSetBindKey("Layout" "<Key>F7" "tlsDisplay_GetCustomLayer()")
hiSetBindKey("Layout" "<Key>F6" "tlsDisplay_CustomLayer()")
hiSetBindKey("Layout" "<Key>F8" "leSetAllLayerVisible(t) leSetAllLayerSelectable(t) leSetPinSelectable(t) leSetInstSelectable(t) hiRedraw()")
hiSetBindKey("Layout" "None<Btn4Down>"           "hiZoomInAtMouse()")
hiSetBindKey("Layout" "None<Btn5Down>"           "hiZoomOutAtMouse()")
hiSetBindKey("Layout" "<Key>F10" "leHiCreateMPP()")
hiSetBindKey("Layout" "0" "(let (layer elem) foreach(layer setof(elem leGetValidLayerList(techGetTechFile(geGetEditCellView())) rexMatchp(\"tile\" car(elem))) leSetLayerVisible(layer nil)) (hiRedraw))")
;hiSetBindKey("Layout" "8" "(let (layer elem) foreach(layer setof(elem leGetValidLayerList(techGetTechFile(geGetEditCellView())) rexMatchp(\"tile\" car(elem))) leSetLayerVisible(layer t)) (hiRedraw))")
hiSetBindKey("Layout" "<Key>F11" "lxHiShowIncNets()")
hiSetBindKey("Layout" "Shift<Key>F11" "lxHiHideIncNets()")


;hiSetBindKey("Layout" "1" "leiMouseSetEntryLayer(16)")
;hiSetBindKey("Layout" "2" "leiMouseSetEntryLayer(18)")
;hiSetBindKey("Layout" "3" "leiMouseSetEntryLayer(20)")
;hiSetBindKey("Layout" "4" "leiMouseSetEntryLayer(26)")


hiSetBindKey("Layout" "Alt<Key>1" "leMoveCursor(0  legRpDelta)")
hiSetBindKey("Layout" "Alt<Key>2" "leMoveCursor(0 -legRpDelta)")
hiSetBindKey("Layout" "Alt<Key>3" "leMoveCursor(-legRpDelta 0)")
hiSetBindKey("Layout" "Alt<Key>4" "leMoveCursor(legRpDelta 0)")





;hiSetBindKey("Layout" "Ctrl<Key>1" "le0PathForm->pathWidth->value = 1.0")
;hiSetBindKey("Layout" "Ctrl<Key>2" "le0PathForm->pathWidth->value = 2.2")
;hiSetBindKey("Layout" "Ctrl<Key>3" "le0PathForm->pathWidth->value = 3.8")
;hiSetBindKey("Layout" "Ctrl<Key>4" "le0PathForm->pathWidth->value = 0.6")
;hiSetBindKey("Layout" "Ctrl<Key>5" "le0PathForm->pathWidth->value = 0.7")

loadi("/user/ra115c/rod/smos10w/ring_nwell.il")
loadi("/user/ra115c/rod/smos10w/ring_nwell_m1.il")
loadi("/user/ra115c/rod/smos10w/sub_1.il")
loadi("/user/ra115c/rod/smos10w/sub_2.il")
loadi("/user/ra115c/rod/smos10w/sub_3.il")
loadi("/user/ra115c/rod/smos10w/sub_4.il")
loadi("/user/ra115c/rod/smos10w/sub_5.il")
loadi("/user/ra115c/rod/smos10w/sub_2_p_a.il")
loadi("/user/ra115c/rod/smos10w/allmetals.il")
loadi("/user/ra115c/rod/smos10w/sub_esd_protect.il")





procedure(tlsDisplay_CustomLayer()
	let(()
	NewLAYERSAVE_user = nil
	listLAYERSAVE_user = leGetValidLayerList(techGetTechFile(ddGetObj("smos10w_ams")))
	foreach(layerelem listLAYERSAVE_user
		if(leIsLayerVisible(layerelem) then
			NewLAYERSAVE_user = cons(layerelem NewLAYERSAVE_user)
		)
		)
	leSetAllLayerVisible(nil)
	leSetPinSelectable(nil)
	leSetInstSelectable(nil) 
	hiRedraw()
	
);end let
);end procedure

procedure(tlsDisplay_GetCustomLayer()
	let((layerelem)
	leSetAllLayerVisible(nil)
	foreach(layerelem NewLAYERSAVE_user
		leSetLayerVisible( layerelem t )
	)
	leSetPinSelectable(t)
	leSetInstSelectable(t)
	hiRedraw()
	
);end let
);end procedure



