Skip to content

Commit

Permalink
Merge due to GitVersion calc (#65)
Browse files Browse the repository at this point in the history
* some more comments to corleone context/identity example

* sequencer example moved to 'Sequencer' folder

* Object tree viewer moved to TcoCore.Wpf library
Examples visulized with object tree viewer

* Object tree viewer moved to TcoCore.Wpf library
Examples visulized with object tree viewer

* (examples) sequencers have separate instances of components

* (examples) sequencers have not shared instances of components

* Links to code examples research

* merged with remote

* test publish in trx format

* #17 TcoSequencer.Step method protected, OnSequencerError() Sequencer.Reset() => Sequencer.Restore()

* TcoTask API docu, eTaskState refactoring, all tests passed, some comments in the test needs to be checked to fullfill the refatored values of the etskState.

* TcoTask._taskState=> Readonly

* TcoTask Enabled property added

* #12
Each object has its own messeger; post method for each main category, activ/inactive flag; unit tests

* TcoMessenger performance tests

* packages update 1.9.6-nightly.260

* Time sync research

* fix after update to 1.9.4-nightly.260, implementation of missing GetKids member in manually created IVortexObject wrapper (DynamicTreeView)

* fixed binding exception on 'TcoContextView'

* RTC

* TcoRTC + tests, Messenger tests timestamp modification

* TcoRtc + tests

* small cleanup in messenger test instance

* Output text logs to xml

* TcoRtc - Clock PRG removed, Update method implementation moved to TcoRtc FB

* rtc refactoring - start @TomKovac continues

* task example started, not finished yet

* TcoRtc diff in _messenger.Mime.Timestamp issue

* Messanger performence tests commented out due to Rtc issues~

* Rtc my fucking last attempt to solve this fucking issue

* minor clup

* before modyfying T801-T812 tests

* Messenger tests-added cyclicall call of the rtcupdate

* test publishing

* messaging feature and compatibility aligment

* task example

* solving compatibility issues VortexCore

* before sync

* #12 cont. messaging

* before restorer added

* restorer added + rtc issues

* get ready for nuget publish on TcOpenGroup config

* generated meta file removed from tracking

* removes generate and meta, fixed an issue with TcoCoreExamples slnf (missing project)

* add missing files to nuget TcoCore

* #23 net5.0 platform added, test projects kept on net48

* build script improvements
git version bump 0.4.0

* Changeable restorer removed

* package updates v1.10.0+

* TcoTaskExample added, also into the documentation

* prevent nre on missing context in messenger

* #36 method EqualsTo added to TcoObject

* removed super^ in TcoObject (some refactoring problem in tc3?)

* minor refac

* Fixed wording in documentation

Fixed wording in documentation of TcoObject.EqualsTo()

* Update TcoObjectTest.TcPOU

* remote nuget publishing at this point to prevent build and publish on each change in the PR Inxon/dev -> TcOpenGroup/dev

* #38 In addition to A.EqualsTo(B), B.EqualsTo(A) test case added.

* ignore .vscode folder

* #28 sStepforward, stepbackward restore call after reaching done state

* readme prior to PR to TcOpenGroup

* + repo structure description start

* #39 Invoke returns new ITcoTaskStatus interface + refactoring

* #41 add implementation and tests for messaging MinLevel, Suspend, Resume.

* additions to TcoContex, Messaging, TcoObject API documentation,

* Minor additions to TcoObject, TcoTask API documentation

* TcoSequencer, unexpected OnStateChange method call after changing from step mode to cyclic mode issue solved

* removed webinar submodule

* remove webinar reference from the solution file

* station example

* Display in the render tree in the order they occur and do not render ignored ones.

* Hiding implementation TcoCore.TcoSequencer #32 and TcoCore.TcoState #33

* TcoCequencer min max step id number

* TcoCore.TcoSequencer RequestStep is already able to jump to very first step of the sequence so as to stepId 0

* Min / max StepId changed to constants, RequestStep change _currentStep.Status to Done #55

* Cleanup tree, and display selected item from tree in renderable content control

* Remove unnecessary code

* asp

* Implemention of UI dispatcher for calls arising from different threads.
Implementation of ICommand (CanExecute()) in TcoCore.TcoTask

* - fixing documentation comment

* synch with dev

* docu sequencer

* TcoSequencer  Invalid mode tests

* asp

* WIP

* asp

* #53 Use enum instead of boolean for sequencer constructor.

* An attempt to removed LineIds

* Removed line ids

* Leftover lineids

* Changed the summary for the enum

* asp

* WIP

* Make the startup sequence more user friendly

* Added sequencer view

* wip

* simple sequence wip

* TcoContext OnEntry OnExit tests added

* Solved isssue when on calling Restore() method inside OnStateChange() causes pagefault #29

* Initial implementation of ITcoServiceable in TcoComponent. Allows to tell tasks of the component that in service mode active and tasks can be invoked remotely (HMI/SCADA)

* Color examples 101 and Connecting sequences 201

* 301 - Invoking tasks to run sequences.

* #66 Implementation of public member TcoSequencer.CurrentStep

* #66 api documentation comments

* asp

* Update README.md

* Update README.md

* Task execution 302

* TcoCore.TcoComponent ServiceMode implementation added + unit tests #65

* Hiding _restoringSequence ~variable

* wip

* CurrentStep in not REFERENCE TO StepDetails
#24

* Added code from webinar
replaced textblocks with markdown

* Adds auto-renderable TcoObjectDiagnosticsView TcoObjectDiagnosticsViewModel will render on 'PresentationType' = 'Diagnostics'
https://github.com/Inxton/TcOpen/issues/70

* Adds auto-renderable TcoContextDiagnosticsView TcoContextDiagnosticsViewModel will render on 'PresentationType' = 'Diagnostics'
https://github.com/Inxton/TcOpen/issues/70

* diagnostics view usage

* ++Adds auto-renderable TcoContextDiagnosticsView TcoContextDiagnosticsViewModel will render on 'PresentationType' = 'Diagnostics'
https://github.com/Inxton/TcOpen/issues/70

* Get diagnostics from context

* Autoupdate messages hotfix

* remove MD

* Update README.md

* Update README.md

* Update README.md

* TcoTaskView, TcoObjectView -> TcoObjectControlView

* package update inxton 1.10.0-nightly.436

* added package material design package

* removed mahapp dependencies added noticies for new added depencencies

* Update README.md

* removed ivc script - replaced with modified behaviour of IVC CLI

* minor to TaskView

* + library tempate + script

* Added RelayCommand
Task can be aborted from GUI

* Swallow an exception in the VisibleTaskStateConverter

* library template + script

* Update scaffoldnewlibrary.ps1

fixed a stupid logic mistake I made

* Tests runners move to TcoCore + refactoring
Arrange in .net - execute on plc task - assert in .net

* library tempate script fix (not break but continue you silly boy)

* basic scaffolding of TcoElements... digital sensor

* Scaffolding TcoDrivesBeckhoff
+ build scripts updates

* DI monitoring propreties attributes

* Refactor fbCylinder to Cylinder

* #40 Add cylinder info messages.

* remove beckhof drive testing (missing hw)

* solving merge issues - drive does not build in pipeline

* version bump

* #40 redesigned cylinder view
fixed typo cyclinder  :)

* fixed an issue with duplicate assembly info and missing namespace imports for assembly attributes

* #39 Simple digital signal UI

* running rabbit

* running rabbit killed while running

* ()()()()() - next time ammend ()()()()()

* + DigitalActuator + DigitalSensor components + tests

* various build fixied

* rebuild the complete solution

* Use material colors

* Fixed regarding material design dependency.

* Naming refactoring: TcoDi and TcoDo instead of TcoDigitalSignal and TcoDigitalActuator

* - build and test fixies

* Update README.md

* Update README.md

* Update README.md

* Components use outside TcOpenFramework/minor fixies to Cylinder component (#54)

* Fixed returns from taks method  (ITcoTask to ITcoTaskStatus)

* Non framework context block for compnents use outside TcOpen framework.
Fixed fbPiston in test examples.

* fixed layout of piston component

* Additions to Non framework use of components

* Workaround an issue when at startup the connector may deadlock if batched operations are started prior to R/W loop operations are propertly initiated. Reported to Inxton core team as FOXTROTH #564

* fixed some typos

* Added tasks to TcoDi/TcoDo for serviceablity,
Update/refactor WPF UI components

* line IDs removal from some blocks

* exising line ids removed from everywhere I could find it

Co-authored-by: PTKu <me@me.me>

* Stringbuilder using fleunt interface (#51)

* #37 Implementation of StringBuilder

* Unit tests for stringbuilder

Co-authored-by: Jozef Chmelar ml <jozef.chmelar.ml@mts.sk>
Co-authored-by: Peter <61538034+PTKu@users.noreply.github.com>

* Update README.md

Removed build badge Azure will be replaced by gh actions

* Test to setup Github Actions (#63)

* Create main.yml

* Update main.yml

* Update main.yml

Just a dummy edit, because I can't trigger the actions manually

* Update main.yml

* Use community version of msbuild

Co-authored-by: Jozef Chmelar <jozef.chmelar.ml@mts.sk>

* Copy files in separate step. (#64)

* Copy files in separate step.

* Consolidate strings
Display executing command by defualt

Co-authored-by: Jozef Chmelar <jozef.chmelar.ml@mts.sk>

Co-authored-by: PTKu <p@nowhere.com>
Co-authored-by: Tomas Kovac <tomas.kovac@mts.sk>
Co-authored-by: Jozef Chmelar <jozef.chmelar.ml@mts.sk>
Co-authored-by: MTS\peto.kurhajec <me@me.me>
Co-authored-by: TomKovac <61820360+TomKovac@users.noreply.github.com>
Co-authored-by: Jokinko <jozefchmelar@users.noreply.github.com>
Co-authored-by: Gerhard Barteling <33071638+Barteling@users.noreply.github.com>
  • Loading branch information
8 people committed May 12, 2021
1 parent 5726918 commit de7b036
Show file tree
Hide file tree
Showing 661 changed files with 82,171 additions and 35,182 deletions.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/development.md
@@ -0,0 +1,10 @@
---
name: Development
about: Suggestion for improvement in development process
title: ''
labels: ''
assignees: ''

---


17 changes: 17 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,17 @@
name: Build

on: [push, pull_request, workflow_dispatch]
# Allows you to run this workflow manually from the Actions tab
jobs:
build:
runs-on: self-hosted
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it. Dummy edit
- uses: actions/checkout@v2
# Check if the action works
- name: Run a one-line script
run: echo Hello, world!
# Run psake
- name: Run a multi-line script
run: |
.\pipelines\runbuild.ps1 -properties @{"buildConfig" = "Release"; "msbuild" = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" }
13 changes: 12 additions & 1 deletion .gitignore
Expand Up @@ -27,6 +27,9 @@ bld/
*.VisualState.xml
TestResult.xml

# dotnet test results
*.trx

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
Expand Down Expand Up @@ -216,6 +219,12 @@ _Vortex/
CompilerCache.md
log.txt
pal.txt
_meta/
_generated/
*.g.cs
*.lbz
version.info
*.plcproj.version.update

# IVF Tools
_toolz/
Expand All @@ -224,5 +233,7 @@ nugets/
# CodeRush
.cr/

*.TcCD


# VSCode
.vscode/
3 changes: 2 additions & 1 deletion GitVersion.yml
@@ -1,4 +1,5 @@
mode: ContinuousDelivery
mode: ContinuousDeployment
next-version: 0.4.1
branches: {}
ignore:
sha: []
Expand Down
57 changes: 0 additions & 57 deletions README.MD

This file was deleted.

187 changes: 171 additions & 16 deletions README.md
Expand Up @@ -4,50 +4,205 @@
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/TcOpenGroup/TcOpen/pulls)
[![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/TcOpenGroup/TcOpen)
[![TcOpen Slack ](https://img.shields.io/badge/Slack-channel-ff69b4.svg)](https://tcopendevelopment.slack.com/)
[![Join the chat at https://gitter.im/dotnet/coreclr](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/TcOpenGroup/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Awesome Badges](https://img.shields.io/badge/badges-awesome-green.svg)](https://github.com/TcOpenGroup/TcOpen#awesome-twincat-3-projects-)
![Azure DevOps builds (branch)](https://img.shields.io/azure-devops/build/petokurhajec0964/tc3/TcOpenGroup.TcOpen/dev)


# TcOpen

**Open Source TwinCAT 3 code by Automation Professionals for Automation Professionals.**

TcOpen aims to provide standard classes to start building any real deployable application. TcOpen will help you by providing well tested components you can use in your project free of charge.
TcOpen aims to provide standard classes to start building any **real deployable application**. TcOpen will help you by providing well-tested components you can use in your project free of charge.

## Why?

Introduce modern software development practices to the PLC world so developers can shift from low-value work to high-value work. OpenSource offers a solid ground upon which many can build and bring ideas from all over the world.
We want to introduce modern software development practices to the PLC world so developers can shift from low-value work to high-value work. Open-source offers a solid ground upon which many can build and bring ideas from all over the world.

## Goals

- Introduce software engineering patterns to PLC development.
- Modular, extensible and observable code.
- Modular, extensible, and observable code and applications.
- Bring the TwinCAT community together.
- Basic components for every project.
- Basic libraries and components for every project.
- Cultivate a place for sharing knowledge.

## What is TwinCAT?

TwinCAT software system turns almost any compatible PC into a real-time controller with a multi-PLC system, NC axis control, programming environment and operating station. TwinCAT replaces conventional PLC and NC/CNC controllers. It runs in Visual Studio with CodeSyS
TwinCAT software system turns almost any compatible PC into a real-time controller with a multi-PLC system, NC axis control, programming environment, and operating station. TwinCAT replaces conventional PLC and NC/CNC controllers. It runs in Visual Studio with CodeSys.

# Where are we - Development process

The initial momentum of ```TcOpen``` project was powerful; however, we have seen a slow decline in activity over the past months. [Inxton](https://inxton.com/), [MTS](https://www.mts.sk/en/) team and some other heroic knights decided to keep the lights on and to carry on this initiative.

We understand that many of you guys have hard times at work, a lot of late hours, endless traveling. Life in industrial automation is very demanding. We see this as one of the reasons for the declined activity. Also, many automation engineers are not that familiar with modern software development tooling and workflows. It may scare some people off. Unfamiliarity should not be the reason not to participate. We want this place to be welcoming to everyone that sees it as a meaningful path to industrial automation. The community is going to learn along the path. There are not that many open-source projects for industrial automation; we got to start somewhere and somehow.

## Recent developments merging to TcOpenGroup

There has been much activity without visible tracking in recent times. We are developing a set of base classes to help us craft components and projects in industrial automation. Most of the discussions were in pair-programming and online/in-person meetings. We did it this way to speed up initial development when transferring legacy libraries and concepts to TcOpen.

[Here](https://docs.tcopengroup.org/articles/TcOpenFramework/application.html) is a conceptual description of the work done so far.

[Here](https://docs.tcopengroup.org/articles/Conventions/Conventions.html) is the document describing conventions to adhere to.

## Workflow (modified GitHub flow)

We adopt a modified version of [**GitHub flow**](https://guides.github.com/introduction/flow/) with proper tracking and discussions under PRs. It is a very simple workflow; we would like to work in a continuous integration/deployment fashion. However, we have to consider the need for the LTS versions for stable and long time support. How do we exactly do it is open to discussion. At this point, we work with the following modification of *GitHub flow*: our default branch is ```dev```, and all PRs must be directed there instead of ```main``` (previously ``` master```). We release in the ```main``` branch once we see the version is stable and battle-tested in production by early adopters.

## Versioning

We adopt [semantic versioning](https://semver.org/). The pipeline uses [GitVersion tool](https://gitversion.net/docs/) for the version calculation.

At this point, we keep the major version at ```0``` (0.x.x) since we do expect changes to the public interfaces, and time is needed before the public contracts are stable.

## Monorepo

We have also decided to work in a [monorepo](https://en.wikipedia.org/wiki/Monorepo) at this point. About the structure later down. Each unit (TcoCore, TcoPneumatics, TcoDrives, etc.) has its filtered solution (*.slnf) for that unit for faster IDE opening and manipulation. Monorepo makes it easier to work with the dependencies and prevent possible dependency hell scenarios, which is a genuine risk at this early stage of the project. Once the framework is stable, we may move to a poly-repository solution with separate maintainers.

## The role of Inxton.Vortex.Framework (IVF)

IVF is a set of tools and libraries for creating industrial .NET applications based on the TwinCAT 3 platform. Some libraries of IVF are commercial. However, there is no need for TcOpen developers to purchase any license for this project. The contributors can acquire the free developer license [here](https://inxton.com/register) or drop an email to team@inxton.com.

All PLC libraries developed in TcOpen are under MIT license. [MIT](https://tldrlegal.com/license/mit-license) gives you the freedom to use, modify, sublicense, redistribute the libraries freely for private and commercial use.

IVF will aid in the development of this project. It provides the infrastructure for testing, debugging, and tooling for the delivery pipeline (library compilation, version number updates, etc.).

Inxton and MTS teams will contribute to the development of PLC libraries. There will also be a transfer of some existing codebases from MTS and Inxton internal repositories (WPF/Blazor UI components, data acquisition libraries); some may require Inxton commercial license when deployed in production.

## Repository structure

Some of the information here might be self-evident for traditional users of GitHub and open source in general. We provide here more details to aid people that are not familiar with similar structures.

### Root

| FOLDER | DESCRIPTION |
|--------------------|----------------------------------------------------------------------------------------------------------------|
| .github | GitHub related files, templates, ... |
| _Vortex | Inxton tools, builder, CLIs, config files, output files, and folders, ... |
| assets | misc files, logo, pictures |
| docs | temporary folder for documentation, notes, etc (about documentain repo later in this document). |
| pipelines | delivery pipeline scripts and configurations |
| src | all sources, tests, UI controls |
| GitVersion.yml | GitVersion configuration file |
| README.md | This file |
| TcoOpen.build.slnf | Filtered solution contains all other projects except for TwinCAT project (NuGet restore/build in the pipeline) |
| TcoOpen.plc.send | Filtered solution, contains only TwinCAT projects (bulk library compilation) |
| TcoOpen.sln | Full solution file |
| notices.MD | Licenses of other open-source projects used in this repository |

### src

| FOLDER | DESCRIPTION |
|------------------------|----------------------------------------------------------------|
| Tc.Prober | Unit testing libraries |
| TcoApplicationExamples | Contains application examples that use TcOpen libraries |
| TcoCore | Core libraries of TcOpen framework (task, coordinations, etc.) |
| TcoIoBeckhoff | Beckhoff hardware (I/O) library |
| TcoPeumatics | Pneumatic components library |
| Others..... | _each group of components will have its separate folder_ |


### Typical structure of library folder

| FOLDER | DESCRIPTION |
|-----------------|-----------------------------------------------------------|
| src | library source files |
| src/..Wpf | Inxton WPF components |
| src/..Connector | Inxton compiler connector |
| src/Xae.. | Plc project/sources |
| tests | unit, and integration tests and sandbox project(s) folder |


## Testing

Testing is vital to this project. We will be using two unit testing frameworks [**TcUnit**](https://github.com/tcunit/TcUnit) and **TcProber**, which is part of this repository. [Here is an article](https://alltwincat.com/2021/02/16/unit-testing-in-the-world-of-industrial-automation/) that briefly explains what those frameworks are and how they differ.

## Documentation

There is a separate documentation repository for this project [here](https://github.com/TcOpenGroup/TcOpen.Documentation). In this moment we use [docfx](https://github.com/dotnet/docfx) to generate documentation. The ```docfx``` uses IVF twin objects of PLC code to generate the API documentation. There is room for improvement in generated documentation; we do plan - in the course of the development of TcOpen - to improve that.

## How to get started with TcOpen

### Prerequisites

1. [Visual Studio 2019 (at least Community Edition)](https://visualstudio.microsoft.com/vs/older-downloads/) v16.8.3+
1. [TwinCAT 3.1 eXtended Automation Engineering (XAE)](https://www.beckhoff.com/english.asp?download/tc3-downloads.htm) TwinCAT 3.1 4024.4+
1. [.NET Framework 4.8 developer pack](https://dotnet.microsoft.com/download/dotnet-framework/thank-you/net48-developer-pack-offline-installer)
1. [.NET5 developer pack](https://dotnet.microsoft.com/download/dotnet/5.0)
1. [Inxton Vortex Builder extension](https://marketplace.visualstudio.com/items?itemName=Inxton.InxtonVortexBuilderExtensionPre)

**Clone this repository**

~~~bash
git clone https://github.com/TcOpenGroup/TcOpen.git
~~~

**Environment variables**

You should setup Windows environment variable ```Tc3Target``` with the value of AMS ID of you testing target system.

![Environment](assets/pics/environment.png)

**Build project to restore necessary tooling and packages**

_build in Debug profile_
~~~ PowerShell
cd your_tcopen_folder
.\pipelines\runbuild.ps1 -properties @{"buildConfig" = "Debug"}
~~~

_build in Release profile_
~~~ PowerShell
cd your_tcopen_folder
.\pipelines\runbuild.ps1 -properties @{"buildConfig" = "Release"}
~~~

**In the initial part of the build, you may see some errors popping up due to missing g.cs files (untracked by git). You can ignore those messages as long as the build completes like this:**

![build](assets/pics/build.png)


**Open visual studio TcOpen.sln**

Switch profile to Debug|TwinCAT RT (x64)

![Profile set](assets/pics/compile_profile.png)

> The build process might be susceptible to some issues due to configuration and evnironment differences. Should you encounter a problem please report the issue [here](https://github.com/TcOpenGroup/TcOpen/issues)
## Communication channels

Some of you complained you were unable to join the Slack Channel for various reasons. After a discussion with @dhullett08 we are opening a new gitter channel:

[![Join the chat at https://gitter.im/dotnet/coreclr](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/TcOpenGroup/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## Code of Conduct

We do not adopt any document describing conduct at this point. However, there are few straightforward rules to observe:

1. Treat others as you would like others to treat you
1. Everyone is free to express his/her ideas.
1. Truth is more important than kindness, but be kind.
1. Your contributions are under MIT license.

## Docs

See [Introduction](/docs/Introduction.md)
## Contributions? Suggestions? Issues?

## Contributing
You can submit your ideas in the form of [PullRequests](https://github.com/TcOpenGroup/TcOpen/pulls)

Awesome! See [Conventions](/docs/Conventions.md) for a style guide. Clone the library, and submit a PR.
Please submit questions, suggestions, bug reports [here](https://github.com/TcOpenGroup/TcOpen/issues).

Consider joining our [![TcOpen Slack](https://img.shields.io/badge/Slack-channel-ff69b4.svg)](https://tcopendevelopment.slack.com/)
Various discussion [here](https://github.com/TcOpenGroup/TcOpen/discussions).

## Who is using TcOpen
## Code format
TcOpen is powered by STweep for TwinCAT a source code formatter for Structured Text.

Is your company using TcOpen? Submit a PR or write to our Slack channel and we will mention you here.
When contributing to TcOpen please use this set of settings for STweep: [TCOpen.zip](https://github.com/Barteling/TcOpen/files/6455049/TCOpen.zip)

- example.org
STweep is free of charge for active contributers to this project.

## Suggestions? Issues?
For requesting a license for STweep visit www.stweep.com/Opensource

Open an issue here and / or join the slack channel for discussion.
<a href="https://www.STweep.com"><img src="https://user-images.githubusercontent.com/33071638/117724819-9b3c1d00-b1e4-11eb-89f1-ead8de7889e9.png" height="125" width="250" ></a>

### Awesome TwinCAT 3 projects 🌐

Expand Down

0 comments on commit de7b036

Please sign in to comment.