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

Pytmc Can't Build xpp jjslit project #291

Closed ZLLentz closed 2 years ago

ZLLentz commented 2 years ago

Ran into this today with Aalayah

I ended up hotfixing a local dev like so (should not make it into pytmc like this obviously):

$ git diff
diff --git a/pytmc/parser.py b/pytmc/parser.py
index 92c51b4..70d235f 100644
--- a/pytmc/parser.py
+++ b/pytmc/parser.py
@@ -1484,11 +1484,14 @@ class Symbol_DUT_MotionStage(Symbol):
         plc = self.plc
         if self.plc is None:
             return None
-        expected = '^' + self.name.lower() + '.axis.nctoplc'
+        # expected = '^' + self.name.lower() + '.axis.nctoplc'
+        expected = self.name.lower() + '.axis.nctoplc'
         links = [link
                  for link in plc.find(Link, recurse=False)
                  if expected in link.a[1].lower()
                  ]
+        # debug_links = [link for link in plc.find(Link, recurse=False)]
+        # breakpoint()

         if not links:
             raise RuntimeError(f'No NC link to DUT_MotionStage found for '

So that's weird, right? It's because the linkage information in the jjslits project doesn't look like the other projects: https://github.com/pcdshub/lcls-plc-xpp-jjslit-motion/blob/8c4ae216a4cbe06d12f68f539102df50f633146a/lcls-plc-xpp-jjslit-motion/_Config/PLC/xpp_jjslit_motion.xti#L218 https://github.com/pcdshub/lcls-plc-kfe-motion/blob/535f31eeeba800dc2eec5a8cfdfb63fc49425bfc/plc-kfe-motion/_Config/PLC/kfe_motion.xti#L7686

Further investigation needed

The IOC built normally aside from that hiccup

ZLLentz commented 2 years ago

This might have been due to a weird intermediate build state where the project wasn't fully committed

ZLLentz commented 2 years ago

Confirmed this was caused by an intermediately-built project