Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method for saving PLC project as a library #4

Merged
merged 28 commits into from
Feb 17, 2024

Conversation

ahuca
Copy link
Owner

@ahuca ahuca commented Dec 12, 2023

This can be considered done, because one can access the PLC projects in an AutomationInterface instance by, for example, doing this.

- Build copy `TestTwincatProject` to binary
- Added `DteInstanceIsNullException`
Added `Directory.CopyDirectory()`
During test setup, copy `TestTwincatProject` to a new temporary test directory. This helps isolate the test subjects between tests.
`FileNotFoundException` is a more appropriate exception to throw.
Added `TestProject` class for cleaner test setup and tear-down.
This way when creating a source stream it can share access with other threads.
With classes for deserialize TwinCAT xml project files, including `.tsproj`, `.tspproj`, and `.plcproj`
Acting as wrapper classes for TwinCAT project and a PLC project, respectively.
- To avoid two classes having the same name `PlcProject`
- Added more tests to `TwincatProjectTests`
- Rearranged and added new files to `TestUtils` folder
This will make tests more lightweight as we don't need to use the whole `AutomationInterface` class everytime we setup.
Added usage guide regarding `TestProject` class
Added null check in case the cleanup is done simultaneously in different processes
- Added more test data to `PlcProjectDataTests` regarding unmanaged library project
- Added test to `AutomationInterfaceTests` to save all managed library projects (as libraries)
- Added `TestPlcProject3` to `TestTwincatProject2` which is an unmanaged project
@ahuca ahuca requested a review from Colho December 12, 2023 22:03
@ahuca ahuca linked an issue Dec 12, 2023 that may be closed by this pull request
Copy link
Collaborator

@Colho Colho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly the exception naming can be changed, other than that not much to comment

@Colho
Copy link
Collaborator

Colho commented Feb 13, 2024

There was an issue created for the exception naming and creating a more sensible collection of the exceptions, so marking as approved

@ahuca ahuca merged commit fbe0874 into main Feb 17, 2024
1 check passed
@ahuca ahuca deleted the 3-add-method-for-saving-twincat-project-as-a-library branch February 17, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add method for saving TwinCAT project as a library
2 participants