Added _pos to all position formats in the ID field.

This commit is contained in:
Salvador E. Tropea 2020-07-12 18:59:50 -03:00
parent 9d10c991da
commit 3822a39671
4 changed files with 15 additions and 15 deletions

View File

@ -17,7 +17,7 @@ class PositionOptions(BaseOptions):
self.only_smd = True
""" only include the surface mount components """
self.output = '%f-%i.%x'
""" output file name (%i='top'|'bottom'|'both', %x='pos'|'csv') """
""" output file name (%i='top_pos'|'bottom_pos'|'both_pos', %x='pos'|'csv') """
self.units = 'millimeters'
""" [millimeters,inches] units used for the positions """ # pragma: no cover
@ -26,10 +26,10 @@ class PositionOptions(BaseOptions):
botf = None
bothf = None
if self.separate_files_for_front_and_back:
topf = open(self.expand_filename(output_dir, self.output, 'top', 'pos'), 'w')
botf = open(self.expand_filename(output_dir, self.output, 'bottom', 'pos'), 'w')
topf = open(self.expand_filename(output_dir, self.output, 'top_pos', 'pos'), 'w')
botf = open(self.expand_filename(output_dir, self.output, 'bottom_pos', 'pos'), 'w')
else:
bothf = open(self.expand_filename(output_dir, self.output, 'both', 'pos'), 'w')
bothf = open(self.expand_filename(output_dir, self.output, 'both_pos', 'pos'), 'w')
files = [f for f in [topf, botf, bothf] if f is not None]
for f in files:
@ -84,10 +84,10 @@ class PositionOptions(BaseOptions):
botf = None
bothf = None
if self.separate_files_for_front_and_back:
topf = open(self.expand_filename(output_dir, self.output, 'top', 'csv'), 'w')
botf = open(self.expand_filename(output_dir, self.output, 'bottom', 'csv'), 'w')
topf = open(self.expand_filename(output_dir, self.output, 'top_pos', 'csv'), 'w')
botf = open(self.expand_filename(output_dir, self.output, 'bottom_pos', 'csv'), 'w')
else:
bothf = open(self.expand_filename(output_dir, self.output, 'both', 'csv'), 'w')
bothf = open(self.expand_filename(output_dir, self.output, 'both_pos', 'csv'), 'w')
files = [f for f in [topf, botf, bothf] if f is not None]

View File

@ -88,7 +88,7 @@ def test_3Rs_position_unified():
def test_3Rs_position_unified_th():
ctx = context.TestContext('3Rs_position_unified_th', '3Rs', 'simple_position_unified_th', POS_DIR)
ctx.run()
expect_position(ctx, os.path.join(POS_DIR, ctx.board_name+'-both-pos.pos'), ['R1', 'R2', 'R3'])
expect_position(ctx, os.path.join(POS_DIR, ctx.board_name+'-position.pos'), ['R1', 'R2', 'R3'])
ctx.clean_up()

View File

@ -96,22 +96,22 @@ class TestContext(object):
return os.path.join(self.sub_dir, self.board_name+'-'+layer_slug+ext)
def get_pos_top_filename(self):
return os.path.join(self.sub_dir, self.board_name+'-top.pos')
return os.path.join(self.sub_dir, self.board_name+'-top_pos.pos')
def get_pos_bot_filename(self):
return os.path.join(self.sub_dir, self.board_name+'-bottom.pos')
return os.path.join(self.sub_dir, self.board_name+'-bottom_pos.pos')
def get_pos_both_filename(self):
return os.path.join(self.sub_dir, self.board_name+'-both.pos')
return os.path.join(self.sub_dir, self.board_name+'-both_pos.pos')
def get_pos_top_csv_filename(self):
return os.path.join(self.sub_dir, self.board_name+'-top.csv')
return os.path.join(self.sub_dir, self.board_name+'-top_pos.csv')
def get_pos_bot_csv_filename(self):
return os.path.join(self.sub_dir, self.board_name+'-bottom.csv')
return os.path.join(self.sub_dir, self.board_name+'-bottom_pos.csv')
def get_pos_both_csv_filename(self):
return os.path.join(self.sub_dir, self.board_name+'-both.csv')
return os.path.join(self.sub_dir, self.board_name+'-both_pos.csv')
def get_pth_drl_filename(self):
return os.path.join(self.sub_dir, self.board_name+'-PTH.drl')

View File

@ -12,5 +12,5 @@ outputs:
format: ASCII # CSV or ASCII format
units: millimeters # millimeters or inches
separate_files_for_front_and_back: false
output: '%f-%i-pos.%x'
output: '%f-position.%x'
only_smd: false