Last active
December 21, 2015 10:38
-
-
Save jsrn/6292867 to your computer and use it in GitHub Desktop.
Because nobody likes getting RSI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# offset to start row number from - probably set it absurdly high to avoid conflicts | |
count = 200 | |
baseheight = 552 # y coord of the first row | |
height_inc = 283 # default field height | |
num_rows = 30 # duh | |
row = 1 # row var | |
# Given the important details, returns a properly formatted Control element | |
def format_text_field( name, width, x ): | |
global count, row | |
ret = '<Control \n' | |
ret += 'Type="AR.Field"\n' | |
ret += 'Name="Field{0}"\n'.format( count ) | |
ret += 'DataField="Body:L{0}{1}"\n'.format( row, name ) | |
ret += 'Left="{0}"\n'.format( x ) | |
ret += 'Top="{0}"\n'.format( baseheight + ( ( i - 1) * height_inc ) ) | |
ret += 'Width="{0}"\n'.format( width ) | |
ret += 'Height="283"\n' | |
ret += 'Text="Body:L{0}{1}"\n'.format( row, name ) | |
ret += 'ClassName="Normal"\n' | |
ret += '>\n' | |
ret += '</Control>' | |
count += 1 | |
return ret | |
for i in xrange( 1, num_rows + 1 ): | |
row = i | |
print format_text_field( 'Location', 2693, 283 ) | |
print format_text_field( 'Fuel', 1134, 2976 ) | |
print format_text_field( 'Test Pressure', 1418, 4110 ) | |
print format_text_field( 'Test Duration', 1559, 5528 ) | |
print format_text_field( 'Let By', 1140, 7080 ) | |
print format_text_field( 'Test', 1134, 8220 ) | |
print format_text_field( 'ECV Accessible and Identified', 1701, 9354 ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment