From 02fa247170fd28f904804ebb370d18c1c533f721 Mon Sep 17 00:00:00 2001 From: Eric Poulsen Date: Tue, 12 Dec 2017 15:04:44 -0800 Subject: [PATCH] pogo uncompressed length now configurable --- GenFixture.py | 12 +++++++++--- genfixture.sh | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/GenFixture.py b/GenFixture.py index 670580c..db7e04e 100755 --- a/GenFixture.py +++ b/GenFixture.py @@ -83,7 +83,7 @@ def __str__(self): self.min_y) def SetOptional(self, rev=None, washer_th=None, nut_f2f=None, nut_c2c=None, nut_th=None, - pivot_d=None, border=None): + pivot_d=None, border=None, pogo_uncompressed_length = None): self.rev = rev self.washer_th = washer_th self.nut_f2f = nut_f2f @@ -91,6 +91,7 @@ def SetOptional(self, rev=None, washer_th=None, nut_f2f=None, nut_c2c=None, nut_ self.nut_th = nut_th self.pivot_d = pivot_d self.border = border + self.pogo_uncompressed_length = pogo_uncompressed_length def SetParams(self, pcb_th, screw_len, screw_d): if pcb_th is not None: @@ -207,6 +208,9 @@ def Generate(self, path): args += " -D\'pivot_d=%.02f\'" % float (self.pivot_d) if self.border != None: args += " -D\'border=%.02f\'" % float (self.border) + if self.pogo_uncompressed_length != None: + args += " -D\'pogo_uncompressed_length=%.02f\'" % float(self.pogo_uncompressed_length) + # Create output file name dxfout = path + "/" + self.prj_name + "-fixture.dxf" @@ -335,7 +339,7 @@ def GetOriginDimensions(self): parser.add_argument ('--nut_th', help='hex nut thickness (mm)') parser.add_argument ('--pivot_d', help='Pivot diameter (mm)') parser.add_argument ('--border', help='Board (ledge) under pcb (mm)') - + parser.add_argument ('--pogo-uncompressed-length', help='Uncompress length that pogo pin emerges from enclosure') # Get args args = parser.parse_args () @@ -377,7 +381,9 @@ def GetOriginDimensions(self): nut_c2c=args.nut_c2c, nut_th=args.nut_th, pivot_d=args.pivot_d, - border=args.border) + border=args.border, + pogo_uncompressed_length=args.pogo_uncompressed_length + ) # Generate fixture fixture.Generate (out_dir) diff --git a/genfixture.sh b/genfixture.sh index de510b9..86bfc27 100755 --- a/genfixture.sh +++ b/genfixture.sh @@ -23,7 +23,8 @@ WASHER_TH=1.0 NUT_TH=2.4 NUT_F2F=5.45 NUT_C2C=6.10 +POGO_UNCOMPRESSED_LENGTH=16 # Call python wrapper -python GenFixture.py --board $BOARD --layer $LAYER --rev $REV --mat_th $MAT --pcb_th $PCB --out $OUTPUT --screw_len $SCREW_LEN --screw_d $SCREW_D --washer_th $WASHER_TH --nut_th $NUT_TH --nut_f2f $NUT_F2F --nut_c2c $NUT_C2C --border $BORDER +python GenFixture.py --board $BOARD --layer $LAYER --rev $REV --mat_th $MAT --pcb_th $PCB --out $OUTPUT --screw_len $SCREW_LEN --screw_d $SCREW_D --washer_th $WASHER_TH --nut_th $NUT_TH --nut_f2f $NUT_F2F --nut_c2c $NUT_C2C --border $BORDER --pogo-uncompressed-length $POGO_UNCOMPRESSED_LENGTH