From: Hugo Villeneuve Date: Fri, 9 Oct 2015 14:12:53 +0000 (-0400) Subject: Ajouts pour AddÉnergie X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=f130efbc79517a5c3ec3d3ba7a3fd7a756acaef5;p=eda-utils.git Ajouts pour AddÉnergie --- diff --git a/scripts/altium/sch-align-refdes.pas b/scripts/altium/sch-align-refdes.pas index 1575f11..9dce304 100644 --- a/scripts/altium/sch-align-refdes.pas +++ b/scripts/altium/sch-align-refdes.pas @@ -5,7 +5,7 @@ Const DEFAULT_FONT_NAME = 'Arial'; - DEFAULT_FONT_SIZE = 8; + DEFAULT_FONT_SIZE = 10; R_SYMBOL_LENGTH_MILS = 400; // Longueur du symbole R_SYMBOL_HEIGHT_MILS = 050; // Hauteur du symbole @@ -137,6 +137,7 @@ Begin // Process Parameter, not designator If CompareString(UpperCase(Parameter.Name), 'VALUE', 5) Then Begin + Parameter.IsHidden := False; ParamOffset := VALUE_POS; End; @@ -161,6 +162,11 @@ Begin ParamOffset := MPN_POS; End; + If CompareString(UpperCase(Parameter.Name), 'NIA', 5) Then + Begin + Parameter.IsHidden := True; + End; + If ParamOffset < 0 Then Begin ParamOffset := 2; // TEMP!!!!!!! @@ -204,7 +210,6 @@ Begin Parameter.SetState_Location(ParamLoc); Parameter.SetState_Orientation(eRotate0); End; - End; // Standardisation de la police de caractère @@ -218,12 +223,39 @@ Begin Parameter.FontId := FontID; End; +// Check if VALUE parameter exists +Function SCH_check_value(Comp : ISch_Component) : Boolean; +Var + found : Boolean; + PIterator : ISch_Iterator; + Parameter : ISch_Parameter; +Begin + Try + found := False; + PIterator := Comp.SchIterator_Create; + PIterator.AddFilter_ObjectSet(MkSet(eParameter)); + + Parameter := PIterator.FirstSchObject; + While Parameter <> Nil Do + Begin + If CompareString(UpperCase(Parameter.Name), 'VALUE', 5) Then + found := True; + Parameter := PIterator.NextSchObject; + End; + Finally + Comp.SchIterator_Destroy(PIterator); + Result := found; + End; +End; + Function SCH_AlignRefDes(Comp : ISch_Component); Var + value_found : boolean; PIterator : ISch_Iterator; Parameter : ISch_Parameter; Begin FontID := SchServer.FontManager.GetFontID(DEFAULT_FONT_SIZE,0,False,False,False,False, DEFAULT_FONT_NAME); + value_found := SCH_check_value(Comp); Try VALUE_POS := -1; @@ -255,7 +287,7 @@ Begin SCH_SetFont(Comp, Parameter); Parameter := PIterator.NextSchObject; - End; + End; Finally Comp.SchIterator_Destroy(PIterator); End;