Skip to content

Commit

Permalink
Merge pull request #3 from phillipivan/main
Browse files Browse the repository at this point in the history
Add action recorder
  • Loading branch information
phillipivan committed Jun 24, 2024
2 parents ae1d40e + 9d57028 commit 8acdc99
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
7 changes: 7 additions & 0 deletions companion/HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@ Interrogate on Connect will interrogate all destinations when a connection is es
## Feedbacks
- **Crosspoint** True when the specified crosspoint is connected

## Action Recorder
The Action Recorder will translate any recieved tally or connected messages into new connect actions, to quickly build salvos.

## Version History

### Version 1.1.0
- Action Recorder
- Update dependencies

### Version 1.0.4
- Better status updates
- Update companion-module-base to 1.8.0
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generic-swp02",
"version": "1.0.4",
"version": "1.1.0",
"main": "src/main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand All @@ -17,7 +17,7 @@
"@companion-module/base": "~1.8.0"
},
"devDependencies": {
"@companion-module/tools": "^1.5.0"
"@companion-module/tools": "^1.5.1"
},
"prettier": "@companion-module/tools/.prettierrc.json"
}
5 changes: 5 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ class SW_P_02 extends InstanceBase {
}
}

// Track whether actions are being recorded
handleStartStopRecordActions(isRecording) {
this.isRecordingActions = isRecording
}

updateActions() {
UpdateActions(this)
}
Expand Down
9 changes: 9 additions & 0 deletions src/processcmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ module.exports = {
varList[`dst${dstSrc[0]}`] = this.connections[dstSrc[0]]
this.checkFeedbacks('checkCrosspoint')
this.setVariableValues(varList)
if (this.isRecordingActions) {
this.recordAction(
{
actionId: 'connect',
options: { dst: dstSrc[0], src: dstSrc[1] },
},
`connect ${dstSrc[0]}`
)
}
break
case cmd.connectOnGo:
if (reply.length != msgLength.connectOnGo) {
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
p-timeout "^4.1.0"
tslib "^2.6.2"

"@companion-module/tools@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@companion-module/tools/-/tools-1.5.0.tgz#ce3cc1fc8aa71ebcbb8fcc65ccaad22099bb3c9e"
integrity sha512-J9sY2DE6i7bWYZ1uoPE8Drux53StYVqpVe+xHF0mERvV9QXOvPQ5AqxM12ts/Jd0vzd94jqLEUzm1I/y/KEWtw==
"@companion-module/tools@^1.5.1":
version "1.5.1"
resolved "https://registry.yarnpkg.com/@companion-module/tools/-/tools-1.5.1.tgz#5f5d3e65eee22926e704de3084e3f66de9d841d0"
integrity sha512-9KJC0mZLpg7dlS3MKCYzbUbOjiDMpjjwHgeAxMzh9AOM1ybgsEkmYLfIyZ/EWWSSJ/1s75IJmOtIUWVkZUuqhQ==
dependencies:
"@typescript-eslint/eslint-plugin" "^5.59.9"
"@typescript-eslint/parser" "^5.59.9"
Expand All @@ -38,7 +38,7 @@
find-up "^7.0.0"
parse-author "^2.0.0"
prettier "^2.8.8"
tar "^6.2.0"
tar "^6.2.1"
webpack "^5.90.0"
webpack-cli "^5.1.4"
zx "^7.2.3"
Expand Down Expand Up @@ -1965,7 +1965,7 @@ tapable@^2.1.1, tapable@^2.2.0:
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==

tar@^6.2.0:
tar@^6.2.1:
version "6.2.1"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a"
integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==
Expand Down

0 comments on commit 8acdc99

Please sign in to comment.