pcdshub / pytmc

Generate EPICS IOCs and records from TwinCAT projects - along with many TwinCAT project tools
https://pcdshub.github.io/pytmc/
Other
10 stars 11 forks source link

FIX: pragma parse failure with information about symbol/chain #200

Closed klauer closed 4 years ago

klauer commented 4 years ago

Result looks like this:

ERROR:pytmc.bin.db:Error creating record: Symbol GVL_FEE_Device.MR1K4_SOMS_PIP_01 failure: Found invalid pragma line(s):
--> | MR1K4_SOMS_PIP_01
ERROR:pytmc.bin.db:Error creating record: Symbol GVL_FEE_Device.ST1K4_TEST_PIP_01 failure: Found invalid pragma line(s):
--> | ST1K4_TEST_PIP_01
ERROR:pytmc.bin.db:Error creating record: Symbol GVL_FEE_Device.ST2K4_BCS_PIP_01 failure: Found invalid pragma line(s):
--> | ST2K4_BCS_PIP_01
ERROR:pytmc.bin.db:Error creating record: Symbol GVL_FEE_Device.ST3K4_PPS_PIP_01 failure: Found invalid pragma line(s):
--> | ST3K4_PPS_PIP_01
ERROR:pytmc.bin.db:Error creating record: Symbol GVL_FEE_Device.PC4K4_XTES_PIP_01 failure: Found invalid pragma line(s):
--> | PC4K4_XTES_PIP_01

The output would look better if there were multiple lines, something like:

    line1
    line2
--> bad line
n-wbrown commented 4 years ago

Really like the goal of this! Do you have a specific tmc file you've been testing this with? I might be doing something wrong but I haven't been able to come up with a line that actually trips the detailed error call-out.

klauer commented 4 years ago

This one should trigger it, I ran into them while trying to help Jing build her IOC: https://raw.githubusercontent.com/jyin999/lcls-plc-tmo-vac/27fd16e8ff17754c240024107af3f2b872856afb/plc-tmo-vac/plc-tmo-vac/PLC_TMO_VAC/PLC_TMO_VAC.tmc

The short of it is that a line didn't have a 'tag' in it, so it just bailed (e.g., use the pragma MR1K4_SOMS_PIP_01 and see what happens)

klauer commented 4 years ago

(Tests were failing due to a new version of flake8 now being more stringent, not really due to changes in this PR)