pcdshub / lcls-twincat-general

A PLC code toolkit for LCLS TwinCAT PLC projects
https://pcdshub.github.io/lcls-twincat-general/
Other
16 stars 20 forks source link

MAINT: address static analysis messages, drop tmc #76

Closed ZLLentz closed 1 year ago

ZLLentz commented 1 year ago

Description

Motivation and Context

closes #75 Once merged, I get to see if the Jenkins pipeline runs all the way through (have not figured out PR config yet)

How Has This Been Tested?

The TcUnit tests build and pass now without modifying the project image

Where Has This Been Documented?

N/A

Pre-merge checklist

ZLLentz commented 1 year ago

Oops!

(For the record, I deleted that file because there is an identical structure with the same name in Tc2_Ethercat)

ZLLentz commented 1 year ago

Ok, I feel good about this so I'm merging with just one review. We can revise these later if there was a good reason for any of the things I removed. I also just really want to see the jenkins pipeline run

ZLLentz commented 1 year ago

Huh, apparently the tmc was functional in this project as per #14, so I'll need to make a follow-up PR Locally the build still succeeded because, despite no longer being tracked, I hadn't deleted the tmc file

On CI the project doesn't build at all

klauer commented 1 year ago

Argghh, the event classes! You asked me specifically about the tmc and I had forgotten - sorry, @ZLLentz...

ZLLentz commented 1 year ago

The good news is that the CI pipeline catches these things

ZLLentz commented 1 year ago

I'm personally somewhat surprised that TwinCAT relies on what is nominally a built file for things like this, seems unstable

sagatowski commented 1 year ago

I'm copy-pasting what I wrote in #74: @ZLLentz & @klauer The reason I did a reverted commit is because the TMC-file is functional in your application. For some reason (don't know why, and didn't even know it was possible), the events are stored in your TMC-file. So this file needs to be there, otherwise you won't be able to build!

What I normally do for projects that use the Tc3_EventLogger is to make sure to store them in a separate file, which is possible to do in TwinCAT. You basically create a separate type in the type system where you store your events, and then you exclude ONLY THAT file in your gitignore but ignore all other TMC-files. Then you don't get the annoying behaviour of a changing TMC-file for every re-compilation.

So if you create a separate type system class (TMC): image Then you get all your events here: image

Then you can ignore ALL tmc-files except this one (this will remove the annoying tmc-file that changes everytime you do a compilation).

ZLLentz commented 1 year ago

That's a really helpful trick, I'll try it