debugging session dazu

This commit is contained in:
2025-04-28 11:39:05 +02:00
parent 376a3da86a
commit 75fbff75d0
3 changed files with 46 additions and 6 deletions
+35
View File
@@ -0,0 +1,35 @@
{
// Verwendet IntelliSense zum Ermitteln möglicher Attribute.
// Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen.
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python-Debugger: Aktuelle Datei mit Argumenten",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": "${command:pickArgs}"
},
{
"name": "Python: Aktuelle Datei",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "use filename and default",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true,
"args": [
"--filename ST_6300_Steuerungstestlayout1_neueBloecke.dxf"
],
}
]
}
+4
View File
@@ -0,0 +1,4 @@
@echo off
CALL manage_interpreter.bat activate_interpreter
python %PROJECT_LIB%\getpositions.py
CALL manage_interpreter.bat deactivate_interpreter
+7 -6
View File
@@ -2,6 +2,7 @@ import argparse
import configparser
import ezdxf
import os
import sys
"""
Dieses Programm:
@@ -50,11 +51,11 @@ def get_dxf_file(filepath):
return doc
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='fetches positions from a dxf file', prog='get_positions')
parser.add_argument('-f', '--filename', action='store', required=True, default="ST_6300_Steuerungstestlayout1_neueBloecke.dwg", help='which file should be fetched', metavar='file')
parser.add_argument('-i', '--input', action='store_true', help='fetch all position of inputs', metavar='input')
parser.add_argument('-o', '--output', action='store_true', help='fetch all positions of outputs', metavar='output')
parser.add_argument('-r', '--rack', action='store_true', help='fetch all positions of all cable racks', metavar='output')
parser = argparse.ArgumentParser(description='fetches the x/y positions from a dxf file', prog='getpositions')
parser.add_argument('-f', '--filename', action='store', default="ST_6300_Steuerungstestlayout1_neueBloecke.dwg", help='which file should be fetched', metavar='myfile.dwg')
parser.add_argument('-i', '--input', action='store_true', help='fetch all position of inputs')
parser.add_argument('-o', '--output', action='store_true', help='fetch all positions of outputs')
parser.add_argument('-r', '--rack', action='store_true', help='fetch all positions of all cable racks')
args = parser.parse_args()
@@ -62,7 +63,7 @@ if __name__ == '__main__':
work_dir = os.environ.get('PROJECT_WORK')
filename = args.filename
doc = get_dxf_file(os.path.join(out_dir, filename))
doc = get_dxf_file(os.path.join(work_dir, filename))
res = dict()
if args.input: