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

Som devel 20 #57

Merged
merged 49 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
88b88a1
typos
sorgom Apr 20, 2024
6cdb73a
memory leak detection with valgrind
sorgom Apr 21, 2024
07c8b85
data types
sorgom Apr 21, 2024
02cd402
doc
sorgom Apr 22, 2024
72dfdb3
reovered IL and systests
sorgom Apr 23, 2024
35ffe61
M_Base private
sorgom Apr 23, 2024
196018a
minor before removal of include guards
sorgom Apr 23, 2024
4dbd58f
removed include guards -> #pragma once
sorgom Apr 24, 2024
9556336
getting into tcp
sorgom Apr 24, 2024
ef9849e
ref #58: TCP features build untested
sorgom Apr 25, 2024
2141e1a
ref #58: submodules?
sorgom Apr 25, 2024
298b9a3
ref #58: submodules?
sorgom Apr 25, 2024
13903ab
ref #58: submodules?
sorgom Apr 25, 2024
23ea4b4
ref #58: just builds, no test failures
sorgom Apr 25, 2024
c01d0cd
ref #58: just builds, working on coverage
sorgom Apr 25, 2024
63464f2
ref #58: just builds, working on coverage
sorgom Apr 25, 2024
86f97ae
ref #58: just builds and runs, working on coverage
sorgom Apr 26, 2024
bf2a194
ref #58: just builds and runs, working on coverage
sorgom Apr 26, 2024
f15243c
ref #58: just builds and runs, working on coverage
sorgom Apr 26, 2024
3b7b4c2
ref #58: coverage should be ok now; some methods not yet implemented
sorgom Apr 27, 2024
931cacb
ref #58: interim
sorgom Apr 27, 2024
9019e4f
ref #58: interim: renaming
sorgom Apr 27, 2024
04baa49
ref #58: establishing runtime tests
sorgom Apr 27, 2024
0be8f33
ref #58: establishing runtime tests
sorgom Apr 27, 2024
f50d38f
ref #58: added coverage; establishing system tests
sorgom Apr 28, 2024
91d291b
ref #58: added coverage; establishing system tests
sorgom Apr 28, 2024
0757024
ref #58: added coverage; establishing system tests
sorgom Apr 28, 2024
d7b4a43
ref #58: added coverage; establishing system tests
sorgom Apr 28, 2024
f38c323
ref #58: more system tests; renameing would make sense
sorgom Apr 28, 2024
6deefc0
ref #57, #58: removed old system tests, renamed others
sorgom Apr 28, 2024
535fb3e
ref #57, #58: findings rework
sorgom Apr 28, 2024
0139e8a
ref #57, #58: findings rework: removed the plugs
sorgom Apr 28, 2024
e0851f9
ref #57, #58: findings rework
sorgom Apr 28, 2024
211cd4b
ref #57, #58: mainly system tests
sorgom Apr 29, 2024
ce08b87
ref #57, #58: interim
sorgom Apr 30, 2024
8ad7e1d
ref #57, #58: interim
sorgom Apr 30, 2024
74d9343
ref #57, #58: Log enables error output
sorgom Apr 30, 2024
44e229d
ref #57, #58: system tests also run on win
sorgom Apr 30, 2024
ca16a83
ref #57, #58: more or less stable state
sorgom Apr 30, 2024
4695d11
ref #57, #58: sys tests linux / win
sorgom May 1, 2024
0db0c26
ref #57, #58: doc
sorgom May 1, 2024
5b851b0
ref #57, #58: doc, instances
sorgom May 2, 2024
8d4824a
ref #57, #58: doc, instances
sorgom May 2, 2024
b18a1b9
ref #57, #58: link to submodule
sorgom May 2, 2024
7662271
ref #57, #58: mainly doc
sorgom May 2, 2024
6092b09
ref #57, #58
sorgom May 5, 2024
ed136ed
ref #57, #58: review rework
sorgom May 9, 2024
5c38b2e
ref #57, #58: review rework
sorgom May 9, 2024
7e9376e
ref #57, #58: review rework
sorgom May 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
*.mdj text eol=lf
*.md text eol=lf
*.make text eol=lf
.git* text eol=lf

3 changes: 3 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
- name: check coverage
run: make/runGcov.sh

- name: run system tests
run: make/runSystemTests.sh

# - name: check env
# run: make/checkEnv.sh

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ __pycache__
# temporary
tmp.*
tmp_*
old_*

# vscode
tempCodeRunnerFile.py
Expand All @@ -81,5 +82,7 @@ transitions_*.md
# runtime test
*.proj

# valgrind
*.out.[0-9]*

.obsidian
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "cpputest"]
path = cpputest
url = [email protected]:cpputest/cpputest.git
[submodule "CppUTestSteps"]
path = CppUTestSteps
url = [email protected]:sorgom/CppUTestSteps.git
branch = dev
[submodule "cpputest"]
path = cpputest
url = [email protected]:cpputest/cpputest.git
24 changes: 12 additions & 12 deletions CLOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,50 @@
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++ 14 95 17 825
C/C++ Header 15 155 132 548
C++ 14 146 26 1174
C/C++ Header 17 167 150 647
-------------------------------------------------------------------------------
SUM: 29 250 149 1373
SUM: 31 313 176 1821
-------------------------------------------------------------------------------
```
**testenv**
```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C/C++ Header 17 184 134 767
C++ 11 35 0 164
C/C++ Header 24 237 174 1124
C++ 9 37 0 217
-------------------------------------------------------------------------------
SUM: 28 219 134 931
SUM: 33 274 174 1341
-------------------------------------------------------------------------------
```
**moduletests**
```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++ 11 181 182 1809
C++ 14 286 297 2358
-------------------------------------------------------------------------------
SUM: 11 181 182 1809
SUM: 14 286 297 2358
-------------------------------------------------------------------------------
```
**systemtests**
```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++ 2 18 24 99
C++ 2 14 22 117
-------------------------------------------------------------------------------
SUM: 2 18 24 99
SUM: 2 14 22 117
-------------------------------------------------------------------------------
```
**specification**
```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C/C++ Header 13 81 127 302
C/C++ Header 14 85 143 314
-------------------------------------------------------------------------------
SUM: 13 81 127 302
SUM: 14 85 143 314
-------------------------------------------------------------------------------
```
15 changes: 10 additions & 5 deletions Clinch.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# The model driven approach
## the plan
I happened to work for a project by the Clinch* that had (maybe still has) the following plan:
- develop software for a digital interlocking from the scratch.
- development should be model based.
- use the IMB* toolchain including the Raggedy* modeling tool.
I happened to work for a project of the Clinch* company that had (maybe still has) the following plan:
- develop software for a digital interlocking (DSTW) from the scratch
- development should be model based
- use the IMB* toolchain including the Raggedy* modeling tool

## SIL4
A DSTW software has to meet the standards of SIL4 / EN 50 129.

Security Integrity Level 4 requires following some rules, e.g.:

Before code can be checked in into a main branch it has to
Expand All @@ -26,12 +28,15 @@ What the tools don’t provide is:
- a working source control
- a working review facility
- a continuous integration
- an understandable documentation
- a community

What they provide is:
- the permanent need of workarounds and repetitive click surface work down
- a great collection of pitfalls and error driven frustration
- permanent dysfunction
- a high demand on support by specialists
- a high demand on support by doubtful specialists
- repetitive "hm, last time it worked" in so called trainings
- crappy C-code in bits and pieces
- 90 % of the effort spent for the tools and not for work to be done

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ It consists of the following components:
- LCR: level crossings
- SEG: track segments
- SYS: commonly used system
- COM: TCP communication to field and GUI

The project does not intend an implementation that would work in a real digital interlocking (DSTW).

Expand All @@ -23,5 +24,5 @@ It shows a completely different approach than the [model driven](Clinch.md) one
- [testing](testing/README.md)
- [transition tables](specification/doc/transition_tables.md)
- [code coverage](testing/coverage.md)
- [how to build](make/howto_build.md)
- [how to build](make/README.md)
- [current lines of code](CLOC.md)
2 changes: 1 addition & 1 deletion SIL4.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Visual Studio turned out to be an even more pedantic code analyzer with the righ
|/W4|highest warning level|
|/MP|multi processor build|

Additional flags see header of [premake5_vs.lua](make/README.md####premake5_vs.lua)
Additional flags see header of [premake5_vs.lua](make/premake5_vs.lua)

## code coverage
Application code coverage by tests must be 100%.
Expand Down
5 changes: 0 additions & 5 deletions application/components/BAS/BAS_Provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
// created by Manfred Sorgo

#pragma once
#ifndef BAS_PROVIDER_H
#define BAS_PROVIDER_H

#include <BAS/Containers.h>
#include <ifs/I_Provider.h>
Expand Down Expand Up @@ -46,6 +44,3 @@ class BAS_Provider : public I_Provider

PolyVec<I_Elem> mElems;
};


#endif // H_
4 changes: 0 additions & 4 deletions application/components/BAS/Containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// created by Manfred Sorgo

#pragma once
#ifndef CONTAINERS_H
#define CONTAINERS_H

#include <BAS/coding.h>
#include <ifs/DataTypes.h>
Expand Down Expand Up @@ -192,5 +190,3 @@ class Index
return dups;
}
};

#endif // _H
4 changes: 0 additions & 4 deletions application/components/BAS/NcpIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// created by Manfred Sorgo

#pragma once
#ifndef NCPINDEX_H
#define NCPINDEX_H

#include <BAS/coding.h>
#include <BAS/Containers.h>
Expand Down Expand Up @@ -48,5 +46,3 @@ class NcpIndex : public Index<const ComName&, Ncp>
return ntp.name;
}
};

#endif // H_
4 changes: 0 additions & 4 deletions application/components/BAS/coding.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// ============================================================
// created by Manfred Sorgo
#pragma once
#ifndef CODING_H
#define CODING_H

#include <codebase/BaseTypes.h>
#include <codebase/nocopy.h>
Expand All @@ -26,5 +24,3 @@ inline void pass() {}
static NAME instance; \
return instance; \
}

#endif // H_
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
// created by Manfred Sorgo

#pragma once
#ifndef COM_H
#define COM_H

#include <ifs/I_Com.h>
#include <BAS/coding.h>

class Com : public I_Com
{
public:
inline Com() = default;
inline void toFld(const ComTele& tele) const {}
inline void toGui(const ComTele& tele) const {}
void run() override;
void stop() override;
void toFld(const ComTele& tele) const;
void toGui(const ComTele& tele) const;

INSTANCE_DEC(Com)

NOCOPY(Com)
};

#endif // H_
private:
inline Com() = default;
bool mRunning = false;
};
43 changes: 43 additions & 0 deletions application/components/COM/TCP.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// ============================================================
// implementation TCP base system
// ============================================================
// created by Manfred Sorgo

#pragma once

#include <ifs/I_TCP.h>
#include <BAS/coding.h>

class TCP : public I_TCP
{
public:
void setTimeout(UINT32 ms);

bool init();

void cleanup();

INT32 socket() const;

bool bind(INT32 socket, UINT16 port) const;

bool listen(INT32 socket) const;

INT32 select(INT32 socket) const;

INT32 accept(INT32 socket) const;

INT32 recv(INT32 socket, PTR buffer, size_t size) const;

INT32 send(INT32 socket, CPTR buffer, size_t size) const;

void close(INT32& socket) const;

INSTANCE_DEC(TCP)

NOCOPY(TCP)
private:
TCP() = default;
UINT32 mSec = 0;
UINT32 mMicro = 10000;
};
Loading
Loading