diff --git a/tools/inputfile_old2new.py b/tools/inputfile_old2new.py index 5f555a94..d7324f48 100644 --- a/tools/inputfile_old2new.py +++ b/tools/inputfile_old2new.py @@ -157,18 +157,24 @@ while(lindex < len(inputlines)): if model2D: # Syntax of old command: #tx_steps: dx dy replacement = '#src_steps: {} {} {}'.format(params[0], params[1], 0) - print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) - inputlines.pop(lindex) - inputlines.insert(lindex, replacement) + else + # Syntax of old command: #tx_steps: dx dy dz + replacement = '#src_steps: {} {} {}'.format(params[0], params[1], params[2]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) lindex += 1 elif cmdname == '#rx_steps': if model2D: # Syntax of old command: #rx_steps: dx dy replacement = '#rx_steps: {} {} {}'.format(params[0], params[1], 0) - print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) - inputlines.pop(lindex) - inputlines.insert(lindex, replacement) + else + # Syntax of old command: #rx_steps: dx dy dz + replacement = '#rx_steps: {} {} {}'.format(params[0], params[1], params[2]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) lindex += 1 elif cmdname == '#medium':