Skip to content

Commit 9bebc81

Browse files
committed
chore: prep for publish
1 parent 8bf2e0d commit 9bebc81

11 files changed

Lines changed: 90 additions & 80 deletions

File tree

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
# bcs-engineering-dsl
1+
# BCS Engineering Framework
22

3-
## 1. Prerequisites
3+
## 1 Prerequisites
44

55
- Windows with TcXaeShell Version 15.0 or higher
66

7-
## 2. Example
7+
## 2 Installation and Usage
88

9-
To run the example in the folder [language/example](language/example), you need to follow the following steps.
9+
To install the complete framework, you need to install three components:
1010

11-
### 2.1 Generate the artifacts
11+
1. VS Code extension: `BCS Engineering DSL`
12+
2. `bcs-engineering-cli` - The CLI to generate the artifacts from the DSL files.
13+
3. `TcAutomation` - The tool to create and deploy the TwinCAT project from the generated artifacts.
1214

13-
For this follow the installation instructions in the [bcs-engineering-dsl](language/README.md) README file.
15+
After the installation you can have a look at the [example](language/example) folder to see how to use the framework.
16+
17+
### 2.1 Install bcs-engineering-cli and VS Code Extension
18+
19+
To install the `bcs-engineering-cli` and `BCS Engineering DSL` VS Code extension, follow the installation and usage instructions in the [README](language/README.md) file.
1420

1521
### 2.2 Install TcAutomation
1622

17-
_TcAutomation_ is responsible for the creation of the corresponding TwinCAT project given the generated artifacts. To install it, you need to run the `TcAutomationInstaller.exe`.
23+
_TcAutomation_ is responsible for the creation and deployment of the corresponding TwinCAT project given the generated artifacts. To install it, you need to run the `TcAutomationInstaller.exe`.
1824
To create the installer, follow the steps described in the [TcAutomation](TcAutomation/README.md) README file.
1925

2026
### 2.3 Check TcAutomation Installation

TcAutomation/README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
# Build
1+
# TcAutomation Deployment Tool
2+
3+
## 1 Prerequisites
4+
5+
- [Inno Setup](https://jrsoftware.org/isinfo.php)
6+
7+
## 2 Build Project
28

39
```bash
410
msbuild /p:Configuration=Release TcAutomation.csproj
511
```
612

7-
# Windows Installer
8-
9-
## Pre-requisites
10-
- Build the project in Release mode.
11-
- [Inno Setup](https://jrsoftware.org/isinfo.php)
13+
## 3 Create Installer
1214

13-
## Build
14-
- Open the `TcAutomation.iss` file in Inno Setup.
15+
- Open the [TcAutomationInstaller.iss](TcAutomationInstaller.iss) file within the Inno Setup.
1516
- Click the "Build/Compile" button (or press Ctrl+F9)."
16-
- The installer will be created in the `output` folder.
17+
- The installer will be created in the [output](output) folder.

language/README.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,44 @@
11
[![CI](https://github.com/elkoDev/bcs-engineering-dsl/actions/workflows/ci.yml/badge.svg)](https://github.com/elkoDev/bcs-engineering-dsl/actions/workflows/ci.yml)
22

3-
# 1. Setup
3+
# BCS Engineering DSL
44

5-
## 1.1 Install Dependencies
5+
## 1 Publishing
6+
7+
### 1.1 Install Dependencies
68

79
```bash
810
npm install
911
```
1012

11-
## 1.2 Build
13+
### 1.2 Build
1214

1315
```bash
1416
npm run langium:generate && npm run build
1517
```
1618

17-
## 1.3 Generate Extension
19+
### 1.3 Generate Extension
1820

1921
Before generating the extension, make sure to run the build commands first.
2022

2123
```bash
2224
vsce package
2325
```
2426

25-
## 1.4 Publish CLI
27+
### 1.4 Publish CLI
28+
NOTE: Previous versions have been published under the name `bcs-engineering-dsl` on my personal npm account. To avoid confusion, you might want to publish under a different name.
2629

2730
```bash
2831
npm login
2932
npm publish --access public
3033
```
3134

32-
## 1.5 Install CLI
35+
## 2 Installation
36+
37+
### 2.1 Install VS Code Extension
38+
39+
Right click on the `bcs-engineering-dsl-<version>.vsix` file and select `Install Extension VSIX`.
40+
41+
### 2.2 Install the CLI:
3342

3443
```bash
3544
npm install -g bcs-engineering-dsl
@@ -41,28 +50,30 @@ or link the local version
4150
npm link
4251
```
4352

44-
# 2. Usage
53+
## 3 Usage
4554

46-
## 2.1 Generate Code
55+
### 3.1 Generate Code
4756

4857
```bash
4958
bcs-engineering-cli beckhoff generate <path-to-bcsctrl-file>
5059
```
5160

52-
## 2.2 Generate Code and Deploy
61+
### 3.2 Generate Code and Deploy
5362

5463
```bash
5564
bcs-engineering-cli beckhoff deploy <path-to-bcsctrl-file>
5665
```
5766

5867
**NOTE:** The working directory will be set to the root of the provided file. This means that the .bcsctrl file can contain cross-references to other files in the same directory.
5968

60-
## 2.3 Supported Target Platforms
69+
### 3.3 Supported Target Platforms
6170

6271
Currently the following target platforms are supported:
6372

64-
### 2.3.1 Beckhoff TwinCAT 3
73+
#### 3.3.1 Beckhoff
6574

6675
In addition to the standard libraries provided by Beckhoff, the following libraries are supported:
6776

68-
- `Tc3_DALI`
77+
- `Tc3_DALI`: Please note that this library integration is not fully tested.
78+
79+
## 4 Future Work

language/src/cli/cli-util.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ import {
1313
isHardwareModel,
1414
} from "../language/generated/ast.js";
1515

16-
/**
17-
* Read a requirement document with the complete workspace (with requirements and
18-
* tests) located in the folder of the file.
19-
* @param fileName the main requirement model file
20-
* @param services the language services
21-
* @returns a tuple with the document indicated by the fileName and a list of
22-
* documents from the workspace.
23-
*/
2416
export async function extractDocuments(
2517
fileName: string,
2618
services: LangiumCoreServices,

language/src/cli/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ export default function () {
1414
program.version(pkg.version);
1515

1616
program.addCommand(defineBeckhoffSubcommands());
17-
// program.addCommand(defineSiemensSubcommands());
18-
// program.addCommand(defineKnxSubcommands());
1917

2018
program.parse();
2119
}

language/src/cli/platform/beckhoff/application/main-program-generator.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export class MainProgramGenerator {
8080
);
8181

8282
const declFilePath = path.join(this.destination, `MAIN_decl.st`);
83-
// Ensure the destination directory exists
8483
fs.mkdirSync(this.destination, { recursive: true });
8584
fs.writeFileSync(declFilePath, declContent);
8685
const implFilePath = path.join(this.destination, `MAIN_impl.st`);

language/src/cli/platform/beckhoff/application/qualified_reference_name.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ export function getReferenceName(ref: Reference<NamedElement>): string {
2525

2626
/**
2727
* Check if a referenced element belongs to a control unit
28-
* This helps us determine if we need to qualify the variable name
28+
* @param ref Reference to check
29+
* @return Tuple where the first element indicates if it's in a control unit,
30+
* and the second element is the control unit name or null
2931
*/
30-
export function isControlUnitVariable(
32+
function isControlUnitVariable(
3133
ref: Reference<NamedElement>
3234
): [boolean, string | null] {
3335
const container = ref?.ref?.$container;

language/src/cli/platform/index.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@ import type {
44
} from "../../language/generated/ast.js";
55
import { generate as genBeckhoff } from "./beckhoff/generate.js";
66
import { deploy as depBeckhoff } from "./beckhoff/deploy.js";
7-
//import { generate as genSiemens } from "./siemens/generator.js";
8-
//import { deploy as depSiemens } from "./siemens/deploy.js";
9-
//import { generate as genKnx } from "./knx/generator.js";
10-
//import { deploy as depKnx } from "./knx/deploy.js";
117

128
export type Platform = "Beckhoff" | "Siemens" | "KNX";
139

1410
export interface GenerateResult {
1511
files: string[];
16-
// …any other metadata…
1712
}
1813

1914
export interface DeployOptions {
@@ -26,7 +21,6 @@ export interface DeployOptions {
2621
tcExe?: string;
2722
adsUsername?: string;
2823
adsPassword?: string;
29-
// Siemens/KNX could have their options here
3024
}
3125

3226
export function generateFor(
@@ -40,10 +34,8 @@ export function generateFor(
4034
return genBeckhoff(control, hardware, destination);
4135
case "Siemens":
4236
throw new Error("Siemens generation not implemented yet");
43-
//return genSiemens(control, hardware, destination);
4437
case "KNX":
4538
throw new Error("KNX generation not implemented yet");
46-
//return genKnx(control, hardware, destination);
4739
default:
4840
throw new Error(`Unsupported platform: ${platform}`);
4941
}
@@ -55,10 +47,8 @@ export function deployTo(platform: Platform, opts: DeployOptions): void {
5547
return depBeckhoff(opts);
5648
case "Siemens":
5749
throw new Error("Siemens deployment not implemented yet");
58-
//return depSiemens(opts);
5950
case "KNX":
6051
throw new Error("KNX deployment not implemented yet");
61-
//return depKnx(opts);
6252
default:
6353
throw new Error(`Unsupported platform: ${platform}`);
6454
}

0 commit comments

Comments
 (0)