Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pogo uncompressed length now configurable #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions GenFixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@ 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
self.nut_c2c = nut_c2c
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:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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 ()

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion genfixture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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