mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-08-03 04:47:47 +00:00
Compare commits
58 Commits
v0.9.7-pre
...
v0.9.8-pre
| Author | SHA1 | Date | |
|---|---|---|---|
| ab09029d77 | |||
| 57c59da0b6 | |||
| 238b27bae6 | |||
| 72601b3c97 | |||
| 419bf52ebb | |||
| 6f690bb48c | |||
| 401b599d33 | |||
| 09ced85677 | |||
| 368f1700ee | |||
| 97bd436785 | |||
| eb50088c06 | |||
| 8d6a9614e8 | |||
| fb9fc42b59 | |||
| 6f0a31b3bc | |||
| 936a42ae31 | |||
| a1877873b2 | |||
| a5fa08ccfa | |||
| 997c4f8ee5 | |||
| 1963e40efb | |||
| f18539c703 | |||
| 934dd89b21 | |||
| 4068199a03 | |||
| 13bcee1181 | |||
| 7089b1d3fa | |||
| 3daf347062 | |||
| 5e21544a81 | |||
| 93225fc00e | |||
| 00bffef062 | |||
| d88f0e2350 | |||
| e781b783f3 | |||
| 487123538a | |||
| 2df89da36d | |||
| 421fe8e3f3 | |||
| 1690661868 | |||
| ba2b7aadd8 | |||
| 4b00c4f807 | |||
| 54d04a7c44 | |||
| c38f5c34a3 | |||
| 32ce970b05 | |||
| ffe6f00a83 | |||
| 4e0d531658 | |||
| 413374f633 | |||
| 6a01863ea6 | |||
| 26ed323bb4 | |||
| 5d69d05b85 | |||
| ee26671997 | |||
| e69ea6ca6d | |||
| f0d36ce2dd | |||
| 3c19746b7a | |||
| e9adf29897 | |||
| 65844d25fe | |||
| e2ac66b564 | |||
| 4f302bcdf5 | |||
| 54046cc53a | |||
| 95dc21a55c | |||
| c74e208144 | |||
| 1aaf5857b6 | |||
| 63c501e71f |
@@ -1,10 +1,13 @@
|
||||
name: release
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- github-actions
|
||||
- main
|
||||
paths-ignore:
|
||||
- '**/README.md'
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
@@ -27,6 +30,11 @@ jobs:
|
||||
- run: npm run release
|
||||
build-macos:
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
CSC_LINK: ${{ secrets.MACOS_CSC_LINK }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.MACOS_CSC_KEY_PASSWORD }}
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
@@ -34,4 +42,4 @@ jobs:
|
||||
node-version: 18
|
||||
- run: npm ci
|
||||
- run: npm run release
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||

|
||||
# Cue View
|
||||
|
||||
A dashboard for everything in your show.
|
||||
@@ -38,31 +39,33 @@ A Cue View "plugin" is a system for communicating with a type of device, for exa
|
||||
### plugin.js
|
||||
|
||||
```js
|
||||
exports.defaultName = 'Example Plugin';
|
||||
exports.connectionType = 'osc' or 'TCPsocket' or 'UDPsocket'
|
||||
exports.searchOptions = {
|
||||
type: 'Bonjour',
|
||||
bonjourNane: 'device'
|
||||
exports.config = {
|
||||
defaultName: 'Example Plugin',
|
||||
connectionType: 'osc' or 'TCPsocket' or 'UDPsocket',
|
||||
searchOptions: {
|
||||
type: 'Bonjour',
|
||||
bonjourNane: 'device'
|
||||
},
|
||||
searchOptions: {
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x00, 0x01, 0x02]),
|
||||
devicePort: 1234, // port the device receives messages on
|
||||
listenPort: 2345, // port Cue View should listen for responses on
|
||||
validateResponse: function(msg, info){
|
||||
// if this function returns true, Cue View adds the responding IP address to the list
|
||||
}
|
||||
},
|
||||
searchOptions: {
|
||||
type: 'TCPport',
|
||||
searchBuffer: Buffer.from('are you there'),
|
||||
testPort: 1234, // port the device receives messages on
|
||||
validateResponse: function(msg, info){
|
||||
// if this function returns true, Cue View adds the responding IP address to the list
|
||||
}
|
||||
},
|
||||
defaultPort: 1234, // only available for TCPsocket and UDPsocket devices
|
||||
heartbeatInterval: 5000 // how frequently, in ms, to send the heartbeat message
|
||||
}
|
||||
exports.searchOptions = {
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x00, 0x01, 0x02]),
|
||||
devicePort: 1234, // port the device receives messages on
|
||||
listenPort: 2345, // port Cue View should listen for responses on
|
||||
validateResponse: function(msg, info){
|
||||
// if this function returns true, Cue View adds the responding IP address to the list
|
||||
}
|
||||
}
|
||||
exports.searchOptions = {
|
||||
type: 'TCPport',
|
||||
searchBuffer: Buffer.from('are you there'),
|
||||
testPort: 1234, // port the device receives messages on
|
||||
validateResponse: function(msg, info){
|
||||
// if this function returns true, Cue View adds the responding IP address to the list
|
||||
}
|
||||
}
|
||||
exports.defaultPort = 1234; // only available for TCPsocket and UDPsocket devices
|
||||
exports.heartbeatInterval = 5000; // how frequently, in ms, to send the heartbeat message
|
||||
|
||||
exports.ready = function (device){
|
||||
// runs when Cue View identifies a new device. send all data requests here
|
||||
|
||||
+59
-54
@@ -35,62 +35,67 @@
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div id="device-tools">
|
||||
<select
|
||||
class="left button"
|
||||
id="add-device-button"
|
||||
title="Add Device..."></select>
|
||||
<button
|
||||
class="left"
|
||||
id="search-button"
|
||||
title="Search network for devices">
|
||||
<img src="src/img/outline_search_white_18dp.png" />
|
||||
</button>
|
||||
<button
|
||||
class="left"
|
||||
id="refresh-device-button"
|
||||
title="Refresh Device"
|
||||
disabled>
|
||||
<img src="src/img/outline_refresh_white_18dp.png" />
|
||||
</button>
|
||||
<div id="device-inspector">
|
||||
<div id="device-tools">
|
||||
<select
|
||||
class="left button"
|
||||
id="add-device-button"
|
||||
title="Add Device..."></select>
|
||||
<button
|
||||
class="left"
|
||||
id="search-button"
|
||||
title="Search network for devices">
|
||||
<img src="src/img/outline_search_white_18dp.png" />
|
||||
</button>
|
||||
<button
|
||||
class="left"
|
||||
id="refresh-device-button"
|
||||
title="Refresh Device"
|
||||
disabled>
|
||||
<img src="src/img/outline_refresh_white_18dp.png" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="device-settings">
|
||||
<table id="device-settings-table">
|
||||
<tr>
|
||||
<th>Name:</th>
|
||||
<td colspan="3">
|
||||
<input id="device-settings-name" type="text" maxlength="30" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Type:</th>
|
||||
<td colspan="3">
|
||||
<select id="device-settings-plugin-dropdown"></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Addr:</th>
|
||||
<td colspan="3">
|
||||
<input id="device-settings-ip" type="text" maxlength="30" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Port:</th>
|
||||
<td>
|
||||
<input
|
||||
id="device-settings-port"
|
||||
type="number"
|
||||
value="53000"
|
||||
maxlength="5" />
|
||||
</td>
|
||||
<th>Pin:</th>
|
||||
<td><input id="device-settings-pin" type="checkbox" /></td>
|
||||
</tr>
|
||||
<tbody id="device-settings-fields">
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>No Device Selected</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="device-settings">
|
||||
<table id="device-settings-table">
|
||||
<tr>
|
||||
<th>Name:</th>
|
||||
<td colspan="3">
|
||||
<input id="device-settings-name" type="text" maxlength="30" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Type:</th>
|
||||
<td colspan="3">
|
||||
<select id="device-settings-plugin-dropdown"></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Addr:</th>
|
||||
<td colspan="3">
|
||||
<input id="device-settings-ip" type="text" maxlength="30" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Port:</th>
|
||||
<td>
|
||||
<input
|
||||
id="device-settings-port"
|
||||
type="number"
|
||||
value="53000"
|
||||
maxlength="5" />
|
||||
</td>
|
||||
<th>Pin:</th>
|
||||
<td><input id="device-settings-pin" type="checkbox" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>No Device Selected</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="all-devices"></div>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
const { app, BrowserWindow, Menu, ipcMain, nativeTheme, dialog, shell } = require('electron');
|
||||
const { app, BrowserWindow, Menu, ipcMain, nativeTheme, dialog } = require('electron');
|
||||
const { autoUpdater } = require('electron-updater');
|
||||
const path = require('path');
|
||||
|
||||
const isMac = process.platform === 'darwin';
|
||||
const isWin = process.platform === 'win32';
|
||||
|
||||
let autoUpdate = false;
|
||||
let manualUpdateCheck = false;
|
||||
let menuObj;
|
||||
let mainWindow;
|
||||
|
||||
@@ -41,7 +43,7 @@ const menuTemplate = [
|
||||
id: 'window1',
|
||||
enabled: true,
|
||||
click (menuItem, window, event) {
|
||||
mainWindow.webContents.send('doSlots1');
|
||||
mainWindow.webContents.send('loadSlot',1);
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -50,7 +52,7 @@ const menuTemplate = [
|
||||
id: 'window2',
|
||||
enabled: true,
|
||||
click (menuItem, window, event) {
|
||||
mainWindow.webContents.send('doSlots2');
|
||||
mainWindow.webContents.send('loadSlot',2);
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -59,7 +61,7 @@ const menuTemplate = [
|
||||
id: 'window3',
|
||||
enabled: true,
|
||||
click (menuItem, window, event) {
|
||||
mainWindow.webContents.send('doSlots3');
|
||||
mainWindow.webContents.send('loadSlot',3);
|
||||
}
|
||||
},
|
||||
{ type: 'separator' },
|
||||
@@ -75,7 +77,7 @@ const menuTemplate = [
|
||||
id: 'deviceSearch',
|
||||
enabled: true,
|
||||
click (menuItem, window, event) {
|
||||
mainWindow.webContents.send('doSearch');
|
||||
mainWindow.webContents.send('searchAll');
|
||||
}
|
||||
},
|
||||
{ type: 'separator' },
|
||||
@@ -99,7 +101,7 @@ const menuTemplate = [
|
||||
id: 'deviceDelete',
|
||||
enabled: false,
|
||||
click (menuItem, window, event) {
|
||||
mainWindow.webContents.send('doDelete');
|
||||
mainWindow.webContents.send('deleteActive');
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -115,8 +117,16 @@ const menuTemplate = [
|
||||
{
|
||||
label: 'Check for Updates',
|
||||
click: ()=>{
|
||||
// set manual update flag
|
||||
manualUpdateCheck = true
|
||||
autoUpdater.checkForUpdates();
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Enable Auto Update',
|
||||
click: ()=>{
|
||||
mainWindow.webContents.send('setAutoUpdate',!autoUpdate);
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -216,18 +226,30 @@ ipcMain.on('setDevicePin', (event, arg) => {
|
||||
|
||||
|
||||
// Autoupdate logic
|
||||
ipcMain.on('checkForUpdates', (event, arg)=>{
|
||||
autoUpdater.checkForUpdates();
|
||||
})
|
||||
|
||||
ipcMain.on('setAutoUpdate', (event, _autoUpdate)=>{
|
||||
autoUpdate = _autoUpdate
|
||||
|
||||
// update menu item for enabling/disabling auto update
|
||||
menuTemplate[menuTemplate.length-1].submenu[2].label = autoUpdate ? 'Disable Auto Update' : 'Enable Auto Update';
|
||||
menuObj = Menu.buildFromTemplate(menuTemplate);
|
||||
Menu.setApplicationMenu(menuObj);
|
||||
})
|
||||
|
||||
// this can be set to true to bypass the download update dialog and skip straight to install prompt
|
||||
autoUpdater.autoDownload = false;
|
||||
|
||||
autoUpdater.on('update-available', (updateInfo)=>{
|
||||
autoUpdater.on('update-available', (updateInfo) => {
|
||||
|
||||
// skip prompting to download if autoDownload is set
|
||||
if(autoUpdater.autoDownload){
|
||||
return;
|
||||
}
|
||||
|
||||
const msg = `Version ${updateInfo.version} is available: Would you like to download?`
|
||||
const msg = `Version v${updateInfo.version} is available. Would you like to download it?`
|
||||
const title = 'Update Available';
|
||||
|
||||
let dialogOpts = {}
|
||||
@@ -238,7 +260,7 @@ autoUpdater.on('update-available', (updateInfo)=>{
|
||||
buttons: ['Download', 'Cancel'],
|
||||
title: 'Update Available',
|
||||
message: title,
|
||||
detail: `Auto updating is not yet automatic on MacOS. Please manually download and install version ${updateInfo.version}.`
|
||||
detail: msg
|
||||
}
|
||||
}else{
|
||||
dialogOpts = {
|
||||
@@ -252,21 +274,14 @@ autoUpdater.on('update-available', (updateInfo)=>{
|
||||
dialog.showMessageBox(mainWindow,dialogOpts).then((returnValue) => {
|
||||
// download was clicked
|
||||
if (returnValue.response === 0){
|
||||
if(!isMac){
|
||||
autoUpdater.downloadUpdate();
|
||||
}else{
|
||||
// TODO: get code signing working
|
||||
// temp solution to direct user to download
|
||||
shell.openExternal("https://github.com/stagehacks/Cue-View/releases/")
|
||||
}
|
||||
|
||||
autoUpdater.downloadUpdate();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
autoUpdater.on('update-downloaded',(event)=>{
|
||||
const title = 'Update Downloaded';
|
||||
const msg = `Version ${event.version} has been downloaded. Would you like to install this update now?`
|
||||
const msg = `Version v${event.version} has been downloaded. Would you like to install this update now?`
|
||||
|
||||
let dialogOpts = {}
|
||||
|
||||
@@ -293,26 +308,29 @@ autoUpdater.on('update-downloaded',(event)=>{
|
||||
})
|
||||
|
||||
autoUpdater.on('update-not-available',(updateInfo)=>{
|
||||
let dialogOpts = {}
|
||||
const msg = `There is no update available at this time. Latest version is v${updateInfo.version}`
|
||||
if(isMac){
|
||||
dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: ['Ok'],
|
||||
title: 'No Update Available',
|
||||
message: 'No Update Available',
|
||||
detail: msg
|
||||
}
|
||||
}else{
|
||||
dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: ['Ok'],
|
||||
title: 'No Update Available',
|
||||
message: msg
|
||||
if(manualUpdateCheck){
|
||||
let dialogOpts = {}
|
||||
const msg = `There is no update available at this time. Latest version is v${updateInfo.version}`
|
||||
if(isMac){
|
||||
dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: ['Ok'],
|
||||
title: 'No Update Available',
|
||||
message: 'No Update Available',
|
||||
detail: msg
|
||||
}
|
||||
}else{
|
||||
dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: ['Ok'],
|
||||
title: 'No Update Available',
|
||||
message: msg
|
||||
}
|
||||
}
|
||||
dialog.showMessageBox(mainWindow,dialogOpts)
|
||||
// revert manual update flag
|
||||
manualUpdateCheck = false;
|
||||
}
|
||||
|
||||
dialog.showMessageBox(mainWindow,dialogOpts)
|
||||
})
|
||||
|
||||
autoUpdater.on('error',(error,message)=>{
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
const notarize = require('@electron/notarize');
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
module.exports = async function (params) {
|
||||
if (process.platform !== 'darwin') {
|
||||
console.log('Only need to notarize MacOS, skipping')
|
||||
return
|
||||
}
|
||||
|
||||
const appId = 'com.stagehacks.cueview'
|
||||
|
||||
const appPath = path.join(
|
||||
params.appOutDir,
|
||||
`${params.packager.appInfo.productFilename}.app`
|
||||
)
|
||||
|
||||
if (!fs.existsSync(appPath)) {
|
||||
console.error('App file not found skipping notarization.');
|
||||
return;
|
||||
}
|
||||
|
||||
if(process.env.APPLE_ID === undefined || process.env.APPLE_ID_PASSWORD === undefined){
|
||||
console.log('Apple ID and Password must be set in order to notarize.')
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
console.log(`Notarizing ${appId} found at ${appPath}`)
|
||||
await notarize.notarize({
|
||||
appBundleId: appId,
|
||||
appPath,
|
||||
appleId: process.env.APPLE_ID,
|
||||
appleIdPassword: process.env.APPLE_ID_PASSWORD,
|
||||
})
|
||||
console.log(`Done notarizing ${appId}`)
|
||||
} catch (error) {
|
||||
console.log('There was an error notarizing.')
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
Generated
+41
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cue-view",
|
||||
"version": "0.9.6-pre",
|
||||
"version": "0.9.8-pre",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -37,6 +37,46 @@
|
||||
"sumchecker": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"@electron/notarize": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-1.2.3.tgz",
|
||||
"integrity": "sha512-9oRzT56rKh5bspk3KpAVF8lPKHYQrBnRwcgiOeR0hdilVEQmszDaAu0IPCPrwwzJN0ugNs0rRboTreHMt/6mBQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "^4.1.1",
|
||||
"fs-extra": "^9.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs-extra": {
|
||||
"version": "9.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
|
||||
"integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"at-least-node": "^1.0.0",
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.6",
|
||||
"universalify": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"universalify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
||||
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@electron/universal": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.2.1.tgz",
|
||||
|
||||
+4
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "cue-view",
|
||||
"productName": "Cue View",
|
||||
"version": "0.9.7-pre",
|
||||
"version": "0.9.8-pre",
|
||||
"description": "A dashboard for everything in your show",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
@@ -19,6 +19,7 @@
|
||||
"homepage": "https://github.com/stagehacks/Cue-View",
|
||||
"repository": "https://github.com/stagehacks/Cue-View",
|
||||
"devDependencies": {
|
||||
"@electron/notarize": "^1.2.3",
|
||||
"electron": "^21.3.0",
|
||||
"electron-builder": "^23.6.0",
|
||||
"eslint": "^8.27.0",
|
||||
@@ -40,9 +41,11 @@
|
||||
"appId": "com.stagehacks.cueview",
|
||||
"icon": "./src/img/",
|
||||
"artifactName": "${name}.${os}.v${version}.${ext}",
|
||||
"afterSign": "notarize.js",
|
||||
"mac": {
|
||||
"category": "Utilities",
|
||||
"icon": "./src/img/icon.icns",
|
||||
"hardenedRuntime": true,
|
||||
"electronLanguages": [
|
||||
"en"
|
||||
],
|
||||
|
||||
+50
-67
@@ -1,119 +1,102 @@
|
||||
const _ = require('lodash');
|
||||
|
||||
exports.defaultName = "Art-Net";
|
||||
exports.connectionType = 'UDPsocket';
|
||||
exports.heartbeatInterval = 10000;
|
||||
exports.searchOptions = {
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x00]),
|
||||
devicePort: 6454,
|
||||
listenPort: 6454,
|
||||
validateResponse (msg, info, devices) {
|
||||
return msg.toString('utf8', 0, 7) === "Art-Net";
|
||||
exports.config = {
|
||||
defaultName: "Art-Net",
|
||||
connectionType: "UDPsocket",
|
||||
heartbeatInterval: 10000,
|
||||
searchOptions: {
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x00]),
|
||||
devicePort: 6454,
|
||||
listenPort: 6454,
|
||||
mayChangePort: false,
|
||||
validateResponse (msg, info, devices) {
|
||||
return msg.toString('utf8', 0, 7) === "Art-Net";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.defaultPort = 6454;
|
||||
|
||||
exports.ready = function ready(device) {
|
||||
const d = device;
|
||||
d.data.universes = {};
|
||||
d.data.orderedUniverses = [];
|
||||
|
||||
exports.ready = function ready(_device) {
|
||||
const device = _device;
|
||||
device.data.universes = {};
|
||||
device.data.orderedUniverses = [];
|
||||
};
|
||||
|
||||
exports.data = function data(device, buf) {
|
||||
exports.data = function data(_device, buf) {
|
||||
if(buf.length < 18){
|
||||
return
|
||||
}
|
||||
const univ = buf.readUInt8(14);
|
||||
const d = device;
|
||||
let u = d.data.universes[univ];
|
||||
const universeIndex = buf.readUInt8(14);
|
||||
const device = _device;
|
||||
let universe = device.data.universes[universeIndex];
|
||||
|
||||
if(!u){
|
||||
d.data.universes[univ] = {};
|
||||
u = d.data.universes[univ];
|
||||
if(!universe){
|
||||
device.data.universes[universeIndex] = {};
|
||||
universe = device.data.universes[universeIndex];
|
||||
}
|
||||
|
||||
u.sequence = buf.readUInt8(12);
|
||||
u.net = buf.readUInt8(15);
|
||||
u.opCode = buf.readUInt8(9);
|
||||
u.version = buf.readUInt16BE(10);
|
||||
u.slots = Array.prototype.slice.call(buf, 18);
|
||||
d.data.ip = d.addresses[0];
|
||||
universe.sequence = buf.readUInt8(12);
|
||||
universe.subnet = buf.readUInt8(15);
|
||||
universe.opCode = buf.readUInt8(9);
|
||||
universe.version = buf.readUInt16BE(10);
|
||||
universe.slots = buf.slice(18)
|
||||
device.data.ip = device.addresses[0];
|
||||
|
||||
if(!_.includes(d.data.orderedUniverses, univ)){
|
||||
d.data.orderedUniverses.push(univ);
|
||||
d.data.orderedUniverses.sort();
|
||||
u.slotElems = [];
|
||||
u.slotElemsSet = false;
|
||||
|
||||
d.draw();
|
||||
updateElementsCache(d, d.data.universes, d.data.orderedUniverses);
|
||||
if(!_.includes(device.data.orderedUniverses, universeIndex)){
|
||||
device.data.orderedUniverses.push(universeIndex);
|
||||
device.data.orderedUniverses.sort();
|
||||
universe.slotElems = [];
|
||||
universe.slotElemsSet = false;
|
||||
|
||||
device.draw();
|
||||
device.update('elementCache');
|
||||
}
|
||||
|
||||
device.update("universeData", {
|
||||
u: univ,
|
||||
universe: u
|
||||
universeIndex,
|
||||
universe
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
exports.heartbeat = function heartbeat(device) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
let lastUpdate = Date.now();
|
||||
exports.update = function update(device, document, updateType, updateData){
|
||||
|
||||
exports.update = function update(_device, _document, updateType, updateData){
|
||||
const device = _device
|
||||
const data = updateData;
|
||||
const doc = document;
|
||||
const document = _document;
|
||||
|
||||
if(updateType === "universeData" && data.universe){
|
||||
|
||||
if(Date.now() - lastUpdate > 1000){
|
||||
lastUpdate = Date.now();
|
||||
updateElementsCache(device, device.data.universes, device.data.orderedUniverses);
|
||||
device.update("elementCache");
|
||||
}
|
||||
|
||||
const $elem = doc.getElementById(`universe-${data.u}`);
|
||||
const $elem = document.getElementById(`universe-${data.universeIndex}`);
|
||||
|
||||
if($elem && data.universe.slotElemsSet){
|
||||
|
||||
for(let i = 0; i < 512; i++){
|
||||
data.universe.slotElems[i].innerText = data.universe.slots[i];
|
||||
}
|
||||
|
||||
doc.getElementById(`universe-${data.u}-sequence`).innerText = data.universe.sequence;
|
||||
|
||||
|
||||
document.getElementById(`universe-${data.universeIndex}-sequence`).innerText = data.universe.sequence;
|
||||
}else{
|
||||
device.draw();
|
||||
updateElementsCache(device, device.data.universes, device.data.orderedUniverses);
|
||||
device.update("elementCache");
|
||||
}
|
||||
|
||||
}else if(updateType === "elementCache"){
|
||||
|
||||
data.orderedUniverses.forEach(univ => {
|
||||
device.data.orderedUniverses.forEach(universeIndex => {
|
||||
for(let i = 0; i < 512; i++){
|
||||
data.universes[univ].slotElems[i] = doc.getElementById(`${univ}-${i}`);
|
||||
device.data.universes[universeIndex].slotElems[i] = document.getElementById(`${universeIndex}-${i}`);
|
||||
}
|
||||
data.universes[univ].slotElemsSet = true;
|
||||
device.data.universes[universeIndex].slotElemsSet = true;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function updateElementsCache(device, univ, ordered){
|
||||
device.update("elementCache", {
|
||||
universes: univ,
|
||||
orderedUniverses: ordered
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -4,23 +4,23 @@
|
||||
|
||||
|
||||
<div id="universes">
|
||||
<% data.orderedUniverses.forEach(univ => {
|
||||
let universe = data.universes[univ];
|
||||
<% data.orderedUniverses.forEach(universeIndex => {
|
||||
let universe = data.universes[universeIndex];
|
||||
%>
|
||||
|
||||
<table id="universe-<%= univ %>">
|
||||
<table id="universe-<%= universeIndex %>">
|
||||
<tr>
|
||||
<td class="data" colspan="2">
|
||||
Universe
|
||||
<br><em><%= univ %></em>
|
||||
<br><em><%= universeIndex %></em>
|
||||
</td>
|
||||
<td class="data" colspan="2">
|
||||
Sub-Net
|
||||
<br><em><%= universe.net %></em>
|
||||
<br><em><%= universe.subnet %></em>
|
||||
</td>
|
||||
<td class="data" colspan="2">
|
||||
Sequence
|
||||
<br><em id="universe-<%= univ %>-sequence"><%= universe.sequence %></em>
|
||||
<br><em id="universe-<%= universeIndex %>-sequence"><%= universe.sequence %></em>
|
||||
</td>
|
||||
<td class="data" colspan="2">
|
||||
OpCode
|
||||
@@ -35,7 +35,6 @@
|
||||
<br><em><%= data.ip %></em>
|
||||
</td>
|
||||
<td class="data" colspan="3"></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -51,14 +50,10 @@
|
||||
<th><%= row*16+1 %></th>
|
||||
<% for(col=0; col<16; col++){ %>
|
||||
<% slot++%>
|
||||
<td id="<%= univ %>-<%= row*16+col %>" title="<%= univ %>/<%= slot %>"><%= universe.slots[slot-1] %></td>
|
||||
<td id="<%= universeIndex %>-<%= row*16+col %>" title="<%= universeIndex %>/<%= slot %>"><%= universe.slots[slot-1] %></td>
|
||||
<% } %>
|
||||
</tr>
|
||||
<% } %>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
<% }); %>
|
||||
|
||||
</div>
|
||||
+3
-3
@@ -45,13 +45,13 @@
|
||||
<% } %>
|
||||
|
||||
<td class="black hide-medium">
|
||||
<%= part.prettyDuration(part.focusDimeDuration, true) %>
|
||||
<%= part.prettyDuration(part.focusTimeDuration, true) %>
|
||||
</td>
|
||||
<td class="black hide-medium">
|
||||
<%= part.prettyDuration(part.colorDimeDuration, true) %>
|
||||
<%= part.prettyDuration(part.colorTimeDuration, true) %>
|
||||
</td>
|
||||
<td class="black hide-medium">
|
||||
<%= part.prettyDuration(part.beamDimeDuration, true) %>
|
||||
<%= part.prettyDuration(part.beamTimeDuration, true) %>
|
||||
</td>
|
||||
<td class="hide-small"><%= part.prettyDuration(part.duration) %></td>
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ class Cue {
|
||||
|
||||
const num = Math.round(milliseconds / 100) / 10;
|
||||
if (box) {
|
||||
return `<div class="time">"${num}"</div>`;
|
||||
return `<div class="time">${num}</div>`;
|
||||
}
|
||||
|
||||
return num;
|
||||
|
||||
+48
-43
@@ -3,29 +3,35 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
const Cue = require('./cue');
|
||||
|
||||
exports.defaultName = 'ETC Eos';
|
||||
exports.connectionType = 'osc';
|
||||
exports.searchOptions = {
|
||||
type: 'TCPport',
|
||||
searchBuffer: Buffer.from(
|
||||
'\xc0/eos/ping\x00\x00\x2c\x00\x00\x00\xc0',
|
||||
'ascii'
|
||||
),
|
||||
testPort: 3032,
|
||||
validateResponse(msg, info) {
|
||||
return msg.toString().indexOf('/eos/out');
|
||||
},
|
||||
};
|
||||
exports.defaultPort = 3032;
|
||||
exports.config = {
|
||||
defaultName: "ETC Eos",
|
||||
connectionType: "osc",
|
||||
defaultPort: 3032,
|
||||
mayChangePort: false,
|
||||
searchOptions: {
|
||||
type: 'TCPport',
|
||||
searchBuffer: Buffer.from(
|
||||
'\xc0/eos/ping\x00\x00\x2c\x00\x00\x00\xc0',
|
||||
'ascii'
|
||||
),
|
||||
testPort: 3032,
|
||||
validateResponse(msg, info) {
|
||||
return msg.toString().indexOf('/eos/out');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.ready = function ready(device) {
|
||||
exports.ready = function ready(_device) {
|
||||
const device = _device;
|
||||
device.data.EOS = new EOS();
|
||||
device.send('/eos/get/cuelist/count');
|
||||
device.send('/eos/get/version');
|
||||
device.send('/eos/subscribe', [{ type: 'i', value: 1 }]);
|
||||
};
|
||||
|
||||
exports.data = function data(device, osc) {
|
||||
exports.data = function data(_device, osc) {
|
||||
const device = _device;
|
||||
|
||||
const addressParts = osc.address.split('/');
|
||||
addressParts.shift();
|
||||
|
||||
@@ -47,13 +53,17 @@ exports.data = function data(device, osc) {
|
||||
device.send(`/eos/get/cue/${addressParts[4]}/index/${i}`);
|
||||
}
|
||||
} else if (
|
||||
match(addressParts, ['eos', 'out', 'get', 'cue', '*', '*', '*', 'list', '*', '*'])
|
||||
match(addressParts, [ 'eos', 'out', 'get','cue', '*', '*', '*', 'list', '*', '*',])
|
||||
) {
|
||||
this.deviceInfoUpdate(device, 'status', 'ok');
|
||||
if (device.data.EOS.cueLists[addressParts[4]][addressParts[5]] === undefined) {
|
||||
if (
|
||||
device.data.EOS.cueLists[addressParts[4]][addressParts[5]] === undefined
|
||||
) {
|
||||
device.data.EOS.cueLists[addressParts[4]][addressParts[5]] = {};
|
||||
}
|
||||
device.data.EOS.cueLists[addressParts[4]][addressParts[5]][addressParts[6]] = new Cue(osc.args);
|
||||
device.data.EOS.cueLists[addressParts[4]][addressParts[5]][
|
||||
addressParts[6]
|
||||
] = new Cue(osc.args);
|
||||
|
||||
device.update('cueData', {
|
||||
cue: device.data.EOS.cueLists[addressParts[4]][addressParts[5]],
|
||||
@@ -66,28 +76,23 @@ exports.data = function data(device, osc) {
|
||||
delete device.data.EOS.cueLists[addressParts[4]][addressParts[5]];
|
||||
device.draw();
|
||||
} else if (
|
||||
match(addressParts, [
|
||||
'eos',
|
||||
'out',
|
||||
'get',
|
||||
'cue',
|
||||
'*',
|
||||
'*',
|
||||
'*',
|
||||
'actions',
|
||||
'list',
|
||||
'*',
|
||||
'*',
|
||||
])
|
||||
match(addressParts, ['eos', 'out', 'get', 'cue', '*', '*', '*', 'actions', 'list', '*', '*'])
|
||||
) {
|
||||
if (osc.args.length === 3) {
|
||||
device.data.EOS.cueLists[addressParts[4]][addressParts[5]][0].extLinks = osc.args[2];
|
||||
device.data.EOS.cueLists[addressParts[4]][addressParts[5]][0].extLinks =
|
||||
osc.args[2];
|
||||
}
|
||||
} else if (match(addressParts, ['eos', 'out', 'event', 'cue', '*', '*', 'fire'])) {
|
||||
} else if (
|
||||
match(addressParts, ['eos', 'out', 'event', 'cue', '*', '*', 'fire'])
|
||||
) {
|
||||
device.data.EOS.activeCue = addressParts[5];
|
||||
device.draw();
|
||||
device.update('activeCue', { uid: device.data.EOS.cueLists[addressParts[4]][addressParts[5]][0].uid });
|
||||
} else if (match(addressParts, ['eos', 'out', 'notify', 'cue', '*', '*', '*', '*'])) {
|
||||
device.update('activeCue', {
|
||||
uid: device.data.EOS.cueLists[addressParts[4]][addressParts[5]][0].uid,
|
||||
});
|
||||
} else if (
|
||||
match(addressParts, ['eos', 'out', 'notify', 'cue', '*', '*', '*', '*'])
|
||||
) {
|
||||
const cueList = addressParts[4];
|
||||
const cueNumber = osc.args[1];
|
||||
device.send(`/eos/get/cue/${cueList}/${cueNumber}`);
|
||||
@@ -125,18 +130,18 @@ exports.heartbeat = function heartbeat(device) {
|
||||
device.send('/eos/ping');
|
||||
};
|
||||
|
||||
function match(addressParts, array) {
|
||||
if (addressParts.length !== array.length) {
|
||||
function match(testArray, patternArray){
|
||||
let out = true;
|
||||
if(testArray.length !== patternArray.length){
|
||||
return false;
|
||||
}
|
||||
array.forEach((m, i) => {
|
||||
if (addressParts[i] !== m && m !== '*') {
|
||||
return false;
|
||||
patternArray.forEach((patternPart, i)=> {
|
||||
if(testArray[i] !== patternPart && patternPart !== "*"){
|
||||
out = false;
|
||||
}
|
||||
});
|
||||
return true;
|
||||
return out;
|
||||
}
|
||||
|
||||
class EOS {
|
||||
constructor() {
|
||||
this.version = '';
|
||||
|
||||
+125
-91
@@ -1,125 +1,159 @@
|
||||
const md5 = require('md5');
|
||||
|
||||
exports.defaultName = 'PJLink Projector';
|
||||
exports.connectionType = 'TCPsocket';
|
||||
exports.heartbeatInterval = 5000;
|
||||
exports.heartbeatTimeout = 15000;
|
||||
exports.searchOptions = {
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x25, 0x32, 0x53, 0x52, 0x43, 0x48, 0x0d]),
|
||||
devicePort: 4352,
|
||||
listenPort: 4352,
|
||||
validateResponse (msg, info) {
|
||||
return msg.toString().indexOf('%2ACKN=') >= 0;
|
||||
exports.config = {
|
||||
defaultName: 'PJLink Projector',
|
||||
connectionType: "TCPsocket",
|
||||
heartbeatInterval: 5000,
|
||||
heartbeatTimeout: 15000,
|
||||
defaultPort: 4352,
|
||||
mayChangePort: false,
|
||||
searchOptions: {
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x25, 0x32, 0x53, 0x52, 0x43, 0x48, 0x0d]),
|
||||
devicePort: 4352,
|
||||
listenPort: 4352,
|
||||
validateResponse (msg, info) {
|
||||
console.log(msg.toString());
|
||||
return msg.toString().indexOf('%2ACKN=') >= 0;
|
||||
}
|
||||
},
|
||||
};
|
||||
exports.defaultPort = 4352;
|
||||
fields: [{
|
||||
key: "password",
|
||||
label: "Pass",
|
||||
type: "textinput",
|
||||
value: "",
|
||||
action: function(device){
|
||||
device.plugin.heartbeat(device);
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
exports.ready = function ready(device) {
|
||||
// Power status query
|
||||
// device.send("%1POWR ?\r");
|
||||
};
|
||||
let password = false;
|
||||
|
||||
function processPJLink(device, str, that) {
|
||||
|
||||
const PJLinkCmds = [
|
||||
'%1POWR=',
|
||||
'%1INPT=',
|
||||
'%1AVMT=',
|
||||
'%1ERST=',
|
||||
'%1LAMP=',
|
||||
'%1NAME=',
|
||||
'%1INF1=',
|
||||
'%1INF2=',
|
||||
'%2SNUM=',
|
||||
'%2SVER='
|
||||
]
|
||||
|
||||
let passwordMD5 = false;
|
||||
let passwordSeed = false;
|
||||
|
||||
function processPJLink(_device, str, that) {
|
||||
const arr = str.split('%');
|
||||
arr.shift();
|
||||
const d = device;
|
||||
const device = _device;
|
||||
|
||||
arr.forEach((s) => {
|
||||
const split = s.split('=');
|
||||
const key = split[0];
|
||||
const value = split[1];
|
||||
arr.forEach((response) => {
|
||||
const parts = response.split('=');
|
||||
const cmd = parts[0];
|
||||
const value = parts[1];
|
||||
|
||||
if(key === '1POWR'){
|
||||
d.data.power = value;
|
||||
switch (cmd) {
|
||||
case '1POWR':
|
||||
device.data.power = value;
|
||||
break;
|
||||
|
||||
}else if(key === '1INPT'){
|
||||
d.data.input = value;
|
||||
|
||||
}else if(key === '1AVMT'){
|
||||
d.data.avmute = value;
|
||||
|
||||
}else if(key === '1ERST'){
|
||||
d.data.fanError = value[0];
|
||||
d.data.lampError = value[1];
|
||||
d.data.tempError = value[2];
|
||||
d.data.coverError = value[3];
|
||||
d.data.filterError = value[4];
|
||||
d.data.otherError = value[5];
|
||||
|
||||
}else if(key === '1LAMP'){
|
||||
d.data.lamp = value.split(' ');
|
||||
|
||||
}else if(key === '1NAME'){
|
||||
d.data.name = value;
|
||||
that.deviceInfoUpdate(d, 'defaultName', d.data.name);
|
||||
|
||||
}else if(key === '1INF1'){
|
||||
d.data.info1 = value;
|
||||
|
||||
}else if(key === '1INF2'){
|
||||
d.data.info2 = value;
|
||||
|
||||
}else if(key === '2SNUM'){
|
||||
d.data.serial = value;
|
||||
|
||||
}else if(key === '2SVER'){
|
||||
d.data.version = value;
|
||||
|
||||
case '1INPT':
|
||||
device.data.input = value;
|
||||
break;
|
||||
|
||||
case '1AVMT':
|
||||
device.data.avmute = value;
|
||||
break;
|
||||
|
||||
case '1ERST':
|
||||
device.data.fanError = value[0];
|
||||
device.data.lampError = value[1];
|
||||
device.data.tempError = value[2];
|
||||
device.data.coverError = value[3];
|
||||
device.data.filterError = value[4];
|
||||
device.data.otherError = value[5];
|
||||
break;
|
||||
|
||||
case '1LAMP':
|
||||
device.data.lamp = value.split(' ');
|
||||
break;
|
||||
|
||||
case '1NAME':
|
||||
device.data.name = value;
|
||||
that.deviceInfoUpdate(device, 'defaultName', device.data.name);
|
||||
break;
|
||||
|
||||
case '1INF1':
|
||||
device.data.info1 = value;
|
||||
break;
|
||||
|
||||
case '1INF2':
|
||||
device.data.info2 = value;
|
||||
break;
|
||||
|
||||
case '2SNUM':
|
||||
device.data.serial = value;
|
||||
break;
|
||||
|
||||
case '2SVER':
|
||||
device.data.version = value;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
d.draw();
|
||||
|
||||
device.draw();
|
||||
}
|
||||
|
||||
exports.data = function data(device, message) {
|
||||
this.deviceInfoUpdate(device, 'status', 'ok');
|
||||
const msg = message.toString();
|
||||
|
||||
//console.log(msg);
|
||||
|
||||
if (msg.substring(0, 8) === 'PJLINK 1') {
|
||||
password = md5(`${msg.substring(9, 17)}JBMIAProjectorLink`);
|
||||
passwordSeed = msg.substring(9, 17);
|
||||
passwordMD5 = md5(`${passwordSeed}${device.fields.password}`);
|
||||
device.data.authentication = "ON";
|
||||
|
||||
device.send(
|
||||
`${password}%1POWR ?\r%1INPT ?\r%1AVMT ?\r%1ERST ?\r%1LAMP ?\r%1NAME ?\r%1INF1 ?\r%1INF2 ?\r%2SNUM ?\r%2SVER ?\r`
|
||||
`${passwordMD5}%1POWR ?\r%1INPT ?\r%1AVMT ?\r%1ERST ?\r%1LAMP ?\r%1NAME ?\r%1INF1 ?\r%1INF2 ?\r%2SNUM ?\r%2SVER ?\r`
|
||||
);
|
||||
device.draw();
|
||||
|
||||
}else if(msg.substring(0, 8) === 'PJLINK 0') {
|
||||
device.data.authentication = "OFF";
|
||||
device.draw();
|
||||
|
||||
}else if(msg.startsWith('PJLINK ERRA')) {
|
||||
device.data.passwordOK = false;
|
||||
device.draw();
|
||||
}
|
||||
if (msg.substring(0, 7) === '%1POWR=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) === '%1INPT=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) === '%1AVMT=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) === '%1ERST=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) === '%1LAMP=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) === '%1NAME=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) === '%1INF1=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) === '%1INF2=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) === '%2SNUM=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) === '%2SVER=') {
|
||||
processPJLink(device, msg, this);
|
||||
|
||||
if(PJLinkCmds.includes(msg.substring(0,7))){
|
||||
processPJLink(device,msg,this);
|
||||
device.data.passwordOK = true;
|
||||
}
|
||||
};
|
||||
|
||||
exports.heartbeat = function heartbeat(device) {
|
||||
if (password) {
|
||||
passwordMD5 = md5(`${passwordSeed}${device.fields.password}`);
|
||||
if (device.fields.password.length>0) {
|
||||
device.send(
|
||||
`${password}%1POWR ?\r%1INPT ?\r%1AVMT ?\r%1ERST ?\r%1LAMP ?\r%1NAME ?\r%1INF1 ?\r%1INF2 ?\r%2SNUM ?\r%2SVER ?\r`
|
||||
`${passwordMD5}%1POWR ?\r%1INPT ?\r%1AVMT ?\r%1ERST ?\r%1LAMP ?\r%1NAME ?\r%1INF1 ?\r%1INF2 ?\r%2SNUM ?\r%2SVER ?\r`
|
||||
);
|
||||
}else{
|
||||
device.send(
|
||||
`%1POWR ?\r%1INPT ?\r%1AVMT ?\r%1ERST ?\r%1LAMP ?\r%1NAME ?\r%1INF1 ?\r%1INF2 ?\r%2SNUM ?\r%2SVER ?\r`
|
||||
);
|
||||
}
|
||||
device.draw();
|
||||
|
||||
@@ -7,3 +7,7 @@
|
||||
.ok {
|
||||
color: #79b757;
|
||||
}
|
||||
table{
|
||||
margin-bottom: 30px;
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<h1><%= listName %></h1>
|
||||
</header>
|
||||
|
||||
|
||||
<table class="cv-table">
|
||||
<tr>
|
||||
<td>Power</td>
|
||||
@@ -73,7 +72,6 @@
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td><div><%= data.name %></div></td>
|
||||
@@ -94,4 +92,19 @@
|
||||
<td>Version</td>
|
||||
<td><div><%= data.version %></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="cv-table">
|
||||
<tr>
|
||||
<td>Authentication</td>
|
||||
<td>
|
||||
<% if(!data.passwordOK){ %>
|
||||
<div class='error'>INCORRECT PASSWORD</div>
|
||||
<% }else if(data.authentication=="ON"){ %>
|
||||
<div class='ok'>ON</div>
|
||||
<% }else{ %>
|
||||
<div class='error'><%= data.authentication %></div>
|
||||
<% } %>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
+31
-17
@@ -24,31 +24,45 @@
|
||||
<% } %>
|
||||
</center></td>
|
||||
|
||||
<% if(cue.type == "Group" && cue.groupMode){ %>
|
||||
<td><img src="./plugins/qlab/img/v5/group-<%= cue.groupMode %>.png" height="20px"></td>
|
||||
|
||||
<% }else{ %>
|
||||
<td><img src="./plugins/qlab/img/<%= cue.type.toLowerCase().replace(' ','-') %>.png" height="20px"></td>
|
||||
|
||||
<% } %>
|
||||
|
||||
|
||||
|
||||
|
||||
<td><img src="./plugins/qlab/img/<%= cue.type.toLowerCase().replace(' ','-') %>.png" height="20px"></td>
|
||||
<td><center><%= cue.number || " " %></center></td>
|
||||
|
||||
|
||||
<% for(let i=0; i<cue.nestedGroupModes.length; i++){ %>
|
||||
|
||||
<% if(cue.cues && cue.cues.length==0 && i==cue.nestedGroupModes.length-1){ %>
|
||||
<td class="gMode-<%= cue.nestedGroupModes[i] %> gLeft gBot gTop group-arrow"></td>
|
||||
|
||||
<% }else if(cue.cues && i==cue.nestedGroupModes.length-1){ %>
|
||||
<td class="gMode-<%= cue.nestedGroupModes[i] %> gLeft gTop group-arrow"></td>
|
||||
|
||||
<% for(let i=cue.nestedGroupModes.length; i>0; i--){ %>
|
||||
<% }else if(cue.nestedGroupPosition[i]<=0){ %>
|
||||
<% if(i<cue.nestedGroupModes.length-1){ %>
|
||||
<td class="gMode-<%= cue.nestedGroupModes[i] %> gLeft gBot"></td>
|
||||
|
||||
<% if(cue.type=="Group" && i==1 && cue.cues.length==0){ %>
|
||||
<td class="gMode-<%= cue.nestedGroupModes[i-1] %> gLeft gTop gBot group-arrow"></td>
|
||||
<% }else{ %>
|
||||
<td class="gMode-<%= cue.nestedGroupModes[i] %> gBot"></td>
|
||||
|
||||
<% }else if(cue.type=="Group" && i==1){ %>
|
||||
<td class="gMode-<%= cue.nestedGroupModes[i-1] %> gLeft gTop group-arrow"></td>
|
||||
<% } %>
|
||||
|
||||
<% }else if(cue.nestedGroupPosition[i-1]==0 && cue.nestedGroupPosition[i-2]==0){ %>
|
||||
<td class="gMode-<%= cue.nestedGroupModes[i-1] %> gLeft gBot"></td>
|
||||
<% }else if(i<cue.nestedGroupModes.length-1){ %>
|
||||
<td class="gMode-<%= cue.nestedGroupModes[i] %> gLeft"></td>
|
||||
|
||||
<% }else if(i==1 && cue.nestedGroupPosition[i]==0){ %>
|
||||
<td class="gMode-<%= cue.nestedGroupModes[i] %> gBot"></td>
|
||||
<% }else{ %>
|
||||
<td class="gMode-<%= cue.nestedGroupModes[i] %>"></td>
|
||||
|
||||
<% }else{ %>
|
||||
<td class="gMode-<%= cue.nestedGroupModes[i-1] %> gLeft"></td>
|
||||
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
|
||||
<% } %>
|
||||
|
||||
@@ -67,10 +81,10 @@
|
||||
<% } %>
|
||||
|
||||
<% }else if(cue.nestedGroupPosition[1]==0){ %>
|
||||
<td colspan="<%= 11-cue.nestedGroupModes.length %>" class="cue-name gMode-<%= cue.nestedGroupModes[1] %> gBot gRight"><%= cue.listName %></td>
|
||||
<td colspan="<%= 11-cue.nestedGroupModes.length %>" class="cue-name gMode-<%= cue.nestedGroupModes[cue.nestedGroupModes.length-1] %> gBot gRight"><%= cue.listName %></td>
|
||||
|
||||
<% }else{ %>
|
||||
<td colspan="<%= 11-cue.nestedGroupModes.length %>" class="cue-name gMode-<%= cue.nestedGroupModes[1] %> gRight"><%= cue.listName %></td>
|
||||
<td colspan="<%= 11-cue.nestedGroupModes.length %>" class="cue-name gMode-<%= cue.nestedGroupModes[cue.nestedGroupModes.length-1] %> gRight"><%= cue.listName %></td>
|
||||
|
||||
<% } %>
|
||||
|
||||
@@ -81,7 +95,7 @@
|
||||
|
||||
|
||||
<% if(cue.preWait){ %>
|
||||
<td class="q-time hide-medium"><%= elapsedTime(cue.preWait, cue.preWaitElapsed, "preWait", cue) %></td>
|
||||
<td class="q-time hide-small"><%= elapsedTime(cue.preWait, cue.preWaitElapsed, "preWait", cue) %></td>
|
||||
|
||||
<% }else{ %>
|
||||
<td class="q-time q-gray-text hide-small">00:00.00</td>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -1,4 +1,5 @@
|
||||
<h3>Connection Requirements</h3>
|
||||
<ul>
|
||||
<li>No Passcode</li>
|
||||
<li><em>View</em> permission enabled in OSC Access</li>
|
||||
<li>Provide passcode if necessary</li>
|
||||
</ul>
|
||||
+80
-34
@@ -2,6 +2,27 @@ const _ = require('lodash');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
exports.config = {
|
||||
defaultName: "QLab",
|
||||
connectionType: "osc",
|
||||
heartbeatInterval: 50,
|
||||
heartbeatTimeout: 2000,
|
||||
mayChangePort: true,
|
||||
searchOptions: {
|
||||
type: 'Bonjour',
|
||||
bonjourName: 'qlab',
|
||||
},
|
||||
fields: [{
|
||||
key: "passcode",
|
||||
label: "Pass",
|
||||
type: "textinput",
|
||||
value: "",
|
||||
action: function(device){
|
||||
device.send('/workspaces');
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
let lastElapsedUpdate = Date.now();
|
||||
let interval = 5;
|
||||
let heartbeatCount = 0;
|
||||
@@ -16,14 +37,6 @@ const cueTemplate = _.template(fs.readFileSync(path.join(__dirname, `cue.ejs`)))
|
||||
const tileTemplate = _.template(fs.readFileSync(path.join(__dirname, `tile.ejs`)));
|
||||
const cartTemplate = _.template(fs.readFileSync(path.join(__dirname, `cart.ejs`)));
|
||||
|
||||
exports.defaultName = 'QLab 4';
|
||||
exports.connectionType = 'osc';
|
||||
exports.heartbeatInterval = 50;
|
||||
exports.heartbeatTimeout = 2000;
|
||||
exports.searchOptions = {
|
||||
type: 'Bonjour',
|
||||
bonjourName: 'qlab',
|
||||
};
|
||||
|
||||
exports.ready = function ready(device) {
|
||||
device.send(`/version`);
|
||||
@@ -54,7 +67,7 @@ exports.data = function data(_device, oscData) {
|
||||
cueLists: {},
|
||||
cues: {}
|
||||
}
|
||||
device.send(`/workspace/${wksp.uniqueID}/connect`);
|
||||
device.send(`/workspace/${wksp.uniqueID}/connect`, device.fields.passcode);
|
||||
});
|
||||
}else if(match(oscAddressParts, ["reply", "workspace", "*", "connect"])){
|
||||
|
||||
@@ -73,25 +86,32 @@ exports.data = function data(_device, oscData) {
|
||||
workspace.cueLists = {};
|
||||
workspace.cues = {};
|
||||
|
||||
json.data.forEach(cueList => {
|
||||
workspace.cueLists[cueList.uniqueID] = cueList;
|
||||
addCueToWorkspace(workspace, cueList);
|
||||
});
|
||||
if(json.status=="denied"){
|
||||
device.data.permission = false;
|
||||
|
||||
device.draw();
|
||||
}else if(json.data){
|
||||
device.data.permission = true;
|
||||
|
||||
setTimeout(() => {
|
||||
json.data.forEach(ql => {
|
||||
workspace.cueLists[ql.uniqueID] = ql;
|
||||
getValuesForKeys(device, json.workspace_id, ql);
|
||||
json.data.forEach(cueList => {
|
||||
workspace.cueLists[cueList.uniqueID] = cueList;
|
||||
addCueToWorkspace(workspace, cueList);
|
||||
});
|
||||
}, 0);
|
||||
|
||||
}else if(match(oscAddressParts, ["reply", "cue_id", "*", "children"])){
|
||||
device.draw();
|
||||
|
||||
setTimeout(() => {
|
||||
json.data.forEach(ql => {
|
||||
workspace.cueLists[ql.uniqueID] = ql;
|
||||
getValuesForKeys(device, json.workspace_id, ql);
|
||||
});
|
||||
}, 0);
|
||||
}
|
||||
|
||||
}else if(match(oscAddressParts, ["reply", "cue_id", "*", "children"]) || match(oscAddressParts, ["reply", "workspace", "*", "cue_id", "*", "children"])){
|
||||
|
||||
const json = JSON.parse(oscData.args[0]);
|
||||
const workspace = device.data.workspaces[json.workspace_id];
|
||||
const cueID = oscAddressParts[2];
|
||||
const cueID = json.address.substring(55, 91);
|
||||
const cue = workspace.cues[cueID];
|
||||
|
||||
if(!_.isEqual(cue.cues, json.data)){
|
||||
@@ -101,7 +121,7 @@ exports.data = function data(_device, oscData) {
|
||||
getValuesForKeys(device, json.workspace_id, cue);
|
||||
}
|
||||
|
||||
}else if(match(oscAddressParts, ["reply", "cue_id", "*", "valuesForKeys"])){
|
||||
}else if(match(oscAddressParts, ["reply", "cue_id", "*", "valuesForKeys"]) || match(oscAddressParts, ["reply", "workspace", "*", "cue_id", "*", "valuesForKeys"])){
|
||||
|
||||
const json = JSON.parse(oscData.args[0]);
|
||||
const cueValues = json.data;
|
||||
@@ -124,7 +144,7 @@ exports.data = function data(_device, oscData) {
|
||||
cue.flagged = cueValues.isFlagged;
|
||||
cue.paused = cueValues.isPaused;
|
||||
cue.type = cueValues.type;
|
||||
cue.cues = cueValues.children;
|
||||
//cue.cues = cueValues.children;
|
||||
cue.preWait = cueValues.preWait;
|
||||
cue.postWait = cueValues.postWait;
|
||||
cue.duration = cueValues.currentDuration;
|
||||
@@ -139,20 +159,46 @@ exports.data = function data(_device, oscData) {
|
||||
cue.actionElapsed = cueValues.actionElapsed;
|
||||
cue.postWaitElapsed = cueValues.postWaitElapsed;
|
||||
|
||||
// QLab 5 fix
|
||||
if(cueValues.type=="Group" || cueValues.type=="Cue List"){
|
||||
cue.cues = cueValues.children;
|
||||
}else{
|
||||
cue.cues = undefined;
|
||||
}
|
||||
|
||||
const nestedGroupModes = [];
|
||||
const nestedGroupPosition = [0];
|
||||
const nestedGroupPosition = [];
|
||||
|
||||
|
||||
let obj = cue;
|
||||
let sum = 0;
|
||||
|
||||
if(obj.cues){
|
||||
sum+=obj.cues.length;
|
||||
}
|
||||
|
||||
while(obj.parent !== "[root group of cue lists]"){
|
||||
nestedGroupModes.push(obj.groupMode);
|
||||
|
||||
let pos = _.findIndex(workspace.cues[obj.parent].cues, {uniqueID: obj.uniqueID});
|
||||
pos = Math.abs(pos - workspace.cues[obj.parent].cues.length) - 1;
|
||||
nestedGroupPosition.push(pos)
|
||||
pos = Math.abs(pos - workspace.cues[obj.parent].cues.length)-1;
|
||||
|
||||
if(obj.cues === undefined){
|
||||
sum += pos;
|
||||
}
|
||||
|
||||
nestedGroupPosition.unshift(sum);
|
||||
|
||||
if(obj.cues){
|
||||
sum+=pos;
|
||||
nestedGroupModes.unshift(obj.groupMode);
|
||||
}else{
|
||||
nestedGroupModes.unshift(workspace.cues[obj.parent].groupMode);
|
||||
}
|
||||
|
||||
obj = workspace.cues[obj.parent];
|
||||
|
||||
}
|
||||
|
||||
cue.nestedGroupModes = nestedGroupModes;
|
||||
cue.nestedGroupPosition = nestedGroupPosition;
|
||||
|
||||
@@ -162,7 +208,7 @@ exports.data = function data(_device, oscData) {
|
||||
|
||||
const json = JSON.parse(oscData.args[0]);
|
||||
const workspace = device.data.workspaces[json.workspace_id];
|
||||
const cue = workspace.cues[oscAddressParts[2]];
|
||||
const cue = workspace.cues[json.address.substring(55, 91)];
|
||||
|
||||
cue.preWaitElapsed = json.data;
|
||||
lastElapsedUpdate = Date.now();
|
||||
@@ -173,7 +219,7 @@ exports.data = function data(_device, oscData) {
|
||||
|
||||
const json = JSON.parse(oscData.args[0]);
|
||||
const workspace = device.data.workspaces[json.workspace_id];
|
||||
const cue = workspace.cues[oscAddressParts[2]];
|
||||
const cue = workspace.cues[json.address.substring(55, 91)];
|
||||
|
||||
cue.actionElapsed = json.data;
|
||||
lastElapsedUpdate = Date.now();
|
||||
@@ -184,7 +230,7 @@ exports.data = function data(_device, oscData) {
|
||||
|
||||
const json = JSON.parse(oscData.args[0]);
|
||||
const workspace = device.data.workspaces[json.workspace_id];
|
||||
const cue = workspace.cues[oscAddressParts[2]];
|
||||
const cue = workspace.cues[json.address.substring(55, 91)];
|
||||
|
||||
cue.postWaitElapsed = json.data;
|
||||
lastElapsedUpdate = Date.now();
|
||||
@@ -333,14 +379,14 @@ exports.heartbeat = function heartbeat(device) {
|
||||
heartbeatCount++;
|
||||
|
||||
if(Date.now() - lastElapsedUpdate > 300){
|
||||
interval = 5;
|
||||
interval = 24;
|
||||
}else{
|
||||
interval = 1;
|
||||
}
|
||||
|
||||
if(heartbeatCount % interval === 0){
|
||||
device.send(`/cue/active/preWaitElapsed`);
|
||||
device.send(`/cue/active/actionElapsed`);
|
||||
device.send(`/cue/active/postWaitElapsed`);
|
||||
device.send(`/cue_id/active/preWaitElapsed`);
|
||||
device.send(`/cue_id/active/actionElapsed`);
|
||||
device.send(`/cue_id/active/postWaitElapsed`);
|
||||
}
|
||||
};
|
||||
@@ -151,13 +151,19 @@ tr.playback-position .q-gray-text {
|
||||
.gMode-4 {
|
||||
border-color: #925fc0;
|
||||
}
|
||||
.gMode-4 {
|
||||
border-color: #925fc0;
|
||||
}
|
||||
.gMode-6 {
|
||||
border-color: #D05B15;
|
||||
}
|
||||
.gMode-,
|
||||
.gMode-0 {
|
||||
border-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
.group-arrow {
|
||||
width: 13px;
|
||||
background-image: url('img/arrow-down.png');
|
||||
background-image: url('img/new_group_arrow.png');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
|
||||
<%
|
||||
if(data.permission){
|
||||
|
||||
for(const workspace_id in data.workspaces){
|
||||
const workspace = data.workspaces[workspace_id];
|
||||
|
||||
@@ -40,7 +42,9 @@
|
||||
|
||||
|
||||
|
||||
<% }} %>
|
||||
<% }}}else{ %>
|
||||
<h3>Incorrect Passcode or OSC Access Permissions</h3>
|
||||
<% } %>
|
||||
|
||||
|
||||
|
||||
|
||||
+53
-77
@@ -1,18 +1,21 @@
|
||||
const _ = require('lodash');
|
||||
|
||||
exports.defaultName = 'sACN';
|
||||
exports.connectionType = 'multicast';
|
||||
exports.defaultPort = 5568;
|
||||
exports.heartbeatInterval = 5000;
|
||||
exports.searchOptions = {
|
||||
type: "multicast",
|
||||
address: getMulticastGroup(1),
|
||||
port: 5568,
|
||||
validateResponse (msg, info) {
|
||||
return msg.toString('utf8', 4, 13) === "ASC-E1.17";
|
||||
},
|
||||
};
|
||||
exports.defaultPort = 5568;
|
||||
exports.config = {
|
||||
defaultName: "sACN",
|
||||
connectionType: "multicast",
|
||||
defaultPort: 5568,
|
||||
heartbeatInterval: 5000,
|
||||
defaultPort: 5568,
|
||||
mayChangePort: false,
|
||||
searchOptions: {
|
||||
type: "multicast",
|
||||
address: getMulticastGroup(1),
|
||||
port: 5568,
|
||||
validateResponse (msg, info) {
|
||||
return msg.toString('utf8', 4, 13) === "ASC-E1.17";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.ready = function ready(device) {
|
||||
|
||||
@@ -28,72 +31,67 @@ exports.ready = function ready(device) {
|
||||
|
||||
};
|
||||
|
||||
exports.data = function data(_device, buf) {
|
||||
|
||||
exports.data = function data(device, buf) {
|
||||
const universeIndex = buf.readUInt16BE(113);
|
||||
const device = _device;
|
||||
|
||||
const univ = buf.readUInt16BE(113);
|
||||
const d = device;
|
||||
let universe = device.data.universes[universeIndex];
|
||||
|
||||
let u = d.data.universes[univ];
|
||||
|
||||
if(!u){
|
||||
d.data.universes[univ] = {};
|
||||
u = d.data.universes[univ];
|
||||
if(!universe){
|
||||
device.data.universes[universeIndex] = {};
|
||||
universe = device.data.universes[universeIndex];
|
||||
}
|
||||
|
||||
u.sequence = buf.readUInt8(111);
|
||||
u.priority = buf.readUInt8(108);
|
||||
u.cid = buf.toString('hex', 22, 38);
|
||||
u.slots = Array.prototype.slice.call(buf, 126);
|
||||
universe.sequence = buf.readUInt8(111);
|
||||
universe.priority = buf.readUInt8(108);
|
||||
universe.cid = buf.toString('hex', 22, 38);
|
||||
universe.slots = buf.slice(126);
|
||||
|
||||
if(buf.readUInt8(125) !== 0){
|
||||
u.startCode = buf.readUInt8(125);
|
||||
universe.startCode = buf.readUInt8(125);
|
||||
}
|
||||
|
||||
device.data.source = buf.toString('utf8', 44, 108);
|
||||
device.displayName = `${device.data.source} sACN`;
|
||||
device.data.ip = device.addresses[0];
|
||||
|
||||
d.data.source = buf.toString('utf8', 44, 108);
|
||||
d.displayName = `${d.data.source} sACN`;
|
||||
d.data.ip = d.addresses[0];
|
||||
|
||||
if(!_.includes(d.data.orderedUniverses, univ)){
|
||||
d.data.orderedUniverses.push(univ);
|
||||
d.data.orderedUniverses.sort();
|
||||
u.slotElems = [];
|
||||
u.slotElemsSet = false;
|
||||
|
||||
d.draw();
|
||||
updateElementsCache(d, d.data.universes, d.data.orderedUniverses);
|
||||
if(!_.includes(device.data.orderedUniverses, universeIndex)){
|
||||
device.data.orderedUniverses.push(universeIndex);
|
||||
device.data.orderedUniverses.sort();
|
||||
universe.slotElems = [];
|
||||
universe.slotElemsSet = false;
|
||||
|
||||
device.draw();
|
||||
device.update("elementCache")
|
||||
}
|
||||
|
||||
d.update("universeData", {
|
||||
u: univ,
|
||||
universe: u,
|
||||
startCode: u.startCode
|
||||
device.update("universeData", {
|
||||
universeIndex,
|
||||
universe,
|
||||
startCode: universe.startCode
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
exports.heartbeat = function heartbeat(device) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
let lastUpdate = Date.now();
|
||||
exports.update = function update(device, doc, updateType, updateData){
|
||||
exports.update = function update(_device, doc, updateType, updateData){
|
||||
|
||||
const d = device;
|
||||
const device = _device;
|
||||
const data = updateData;
|
||||
|
||||
if(updateType === "universeData" && data.universe){
|
||||
|
||||
if(Date.now() - lastUpdate > 1000){
|
||||
lastUpdate = Date.now();
|
||||
updateElementsCache(d, d.data.universes, d.data.orderedUniverses);
|
||||
device.update("elementCache")
|
||||
}
|
||||
|
||||
const $elem = doc.getElementById(`universe-${data.u}`);
|
||||
const $elem = doc.getElementById(`universe-${data.universeIndex}`);
|
||||
|
||||
if($elem && data.universe.slotElemsSet){
|
||||
|
||||
@@ -102,7 +100,7 @@ exports.update = function update(device, doc, updateType, updateData){
|
||||
data.universe.slotElems[i].innerText = data.universe.slots[i];
|
||||
}
|
||||
|
||||
const $code = doc.getElementById(`universe-${data.u}-code`);
|
||||
const $code = doc.getElementById(`universe-${data.universeIndex}-code`);
|
||||
if(data.startCode === 0xDD){
|
||||
$code.innerText = "Net3"
|
||||
}else if(data.startCode === 0x17){
|
||||
@@ -112,47 +110,25 @@ exports.update = function update(device, doc, updateType, updateData){
|
||||
}else if(data.startCode === 0xCC){
|
||||
$code.innerText = "RDM"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
d.draw();
|
||||
updateElementsCache(d, d.data.universes, d.data.orderedUniverses);
|
||||
device.draw();
|
||||
device.update("elementCache")
|
||||
}
|
||||
|
||||
}else if(updateType === "elementCache"){
|
||||
|
||||
data.orderedUniverses.forEach(univ => {
|
||||
device.data.orderedUniverses.forEach(universeIndex => {
|
||||
for(let i = 0; i < 512; i++){
|
||||
data.universes[univ].slotElems[i] = doc.getElementById(`${univ}-${i}`);
|
||||
device.data.universes[universeIndex].slotElems[i] = doc.getElementById(`${universeIndex}-${i}`);
|
||||
}
|
||||
data.universes[univ].slotElemsSet = true;
|
||||
device.data.universes[universeIndex].slotElemsSet = true;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function updateElementsCache(device, univ, ordered){
|
||||
device.update("elementCache", {
|
||||
universes: univ,
|
||||
orderedUniverses: ordered
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// From https://github.com/hhromic/e131-node/blob/master/lib/e131.js
|
||||
function getMulticastGroup(universe) {
|
||||
if (universe < 1 || universe > 63999) {
|
||||
throw new RangeError('universe should be in the range [1-63999]');
|
||||
}
|
||||
return `239.255.${universe >> 8}.${universe & 0xff}`;
|
||||
|
||||
}
|
||||
@@ -4,15 +4,15 @@
|
||||
|
||||
|
||||
<div id="universes">
|
||||
<% data.orderedUniverses.forEach(univ => {
|
||||
let universe = data.universes[univ];
|
||||
<% data.orderedUniverses.forEach(universeIndex => {
|
||||
let universe = data.universes[universeIndex];
|
||||
%>
|
||||
|
||||
<table id="universe-<%= univ %>">
|
||||
<table id="universe-<%= universeIndex %>">
|
||||
<tr>
|
||||
<td class="data" colspan="2">
|
||||
Universe
|
||||
<br><em><%= univ %></em>
|
||||
<br><em><%= universeIndex %></em>
|
||||
</td>
|
||||
<td class="data" colspan="2">
|
||||
Priority
|
||||
@@ -28,7 +28,7 @@
|
||||
</td>
|
||||
<td class="data" colspan="2">
|
||||
Flavor
|
||||
<br><em id="universe-<%= univ %>-code">0</em>
|
||||
<br><em id="universe-<%= universeIndex %>-code">0</em>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<th><%= row*16+1 %></th>
|
||||
<% for(col=0; col<16; col++){ %>
|
||||
<% slot++%>
|
||||
<td id="<%= univ %>-<%= row*16+col %>" title="<%= univ %>/<%= slot %>"><%= universe.slots[slot-1] %></td>
|
||||
<td id="<%= universeIndex %>-<%= row*16+col %>" title="<%= universeIndex %>/<%= slot %>"><%= universe.slots[slot-1] %></td>
|
||||
<% } %>
|
||||
</tr>
|
||||
<% } %>
|
||||
|
||||
+38
-37
@@ -1,58 +1,59 @@
|
||||
exports.defaultName = 'Dataton Watchout';
|
||||
exports.connectionType = 'TCPsocket';
|
||||
exports.heartbeatInterval = 500;
|
||||
exports.searchOptions = {
|
||||
type: 'TCPport',
|
||||
searchBuffer: Buffer.from('authenticate 1\n', 'ascii'),
|
||||
testPort: 3040,
|
||||
validateResponse (msg, info) {
|
||||
return msg.toString().substring(0, 5) === 'Ready';
|
||||
},
|
||||
};
|
||||
exports.defaultPort = 3040;
|
||||
exports.config = {
|
||||
defaultName: "Dataton Watchout",
|
||||
connectionType: "TCPsocket",
|
||||
heartbeatInterval: 500,
|
||||
defaultPort: 3040,
|
||||
mayChangePort: false,
|
||||
searchOptions: {
|
||||
type: 'TCPport',
|
||||
searchBuffer: Buffer.from('authenticate 1\n', 'ascii'),
|
||||
testPort: 3040,
|
||||
validateResponse (msg, info) {
|
||||
return msg.toString().substring(0, 5) === 'Ready';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.ready = function ready(device) {
|
||||
device.send('authenticate 1\n');
|
||||
};
|
||||
|
||||
exports.data = function data(device, message) {
|
||||
const msg = message.toString();
|
||||
const d = device;
|
||||
exports.data = function data(_device, _message) {
|
||||
const message = message.toString();
|
||||
const device = _device;
|
||||
|
||||
if (msg.substring(0, 5) === 'Ready') {
|
||||
d.send('getStatus\n');
|
||||
if (message.substring(0, 5) === 'Ready') {
|
||||
device.send('getStatus\n');
|
||||
|
||||
}else if (msg.substring(0, 5) === 'Reply') {
|
||||
const arr = msg.split(' ');
|
||||
}else if (message.substring(0, 5) === 'Reply') {
|
||||
const arr = message.split(' ');
|
||||
|
||||
d.data.showName = '';
|
||||
device.data.showName = '';
|
||||
|
||||
let i = 0;
|
||||
while (arr[i][arr[i].length - 1] !== '"') {
|
||||
i++;
|
||||
d.data.showName += `${arr[i]} `;
|
||||
device.data.showName += `${arr[i]} `;
|
||||
}
|
||||
d.data.showName = d.data.showName.substring(
|
||||
|
||||
device.data.showName = device.data.showName.substring(
|
||||
1,
|
||||
d.data.showName.length - 2
|
||||
device.data.showName.length - 2
|
||||
);
|
||||
|
||||
i--;
|
||||
d.data.busy = arr[i + 2];
|
||||
d.data.health = arr[i + 3];
|
||||
d.data.displayOpen = arr[i + 4];
|
||||
d.data.showActive = arr[i + 5];
|
||||
d.data.programmerOnline = arr[i + 6];
|
||||
d.data.position = Number(arr[i + 7]).toFixed(2);
|
||||
d.data.rate = arr[i + 8];
|
||||
d.data.standby = arr[i + 9];
|
||||
device.data.busy = arr[i + 2];
|
||||
device.data.health = arr[i + 3];
|
||||
device.data.displayOpen = arr[i + 4];
|
||||
device.data.showActive = arr[i + 5];
|
||||
device.data.programmerOnline = arr[i + 6];
|
||||
device.data.position = Number(arr[i + 7]).toFixed(2);
|
||||
device.data.rate = arr[i + 8];
|
||||
device.data.standby = arr[i + 9];
|
||||
|
||||
this.deviceInfoUpdate(d, 'defaultName', d.data.showName);
|
||||
d.draw();
|
||||
this.deviceInfoUpdate(device, 'defaultName', device.data.showName);
|
||||
device.draw();
|
||||
}
|
||||
// if(msg.substring(0, 5)=="Error"){
|
||||
// device.data.error = msg.substring(6, 7);
|
||||
// }
|
||||
// console.log(msg)
|
||||
};
|
||||
|
||||
exports.heartbeat = function heartbeat(device) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<h1><%= listName %></h1>
|
||||
</header>
|
||||
|
||||
|
||||
<table class="cv-table">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
@@ -20,13 +19,10 @@
|
||||
<td colspan="2"><h1><%= minutes %>:<%= ((seconds%60)+"").padStart(2, "0") %>.<%= millis%1000 %></h1></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td>Busy</td>
|
||||
<td><div><%= data.busy %></div></td></td>
|
||||
</tr>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Display Open</td>
|
||||
<td><div><%= data.displayOpen %></td></td>
|
||||
|
||||
+16
-13
@@ -1,16 +1,19 @@
|
||||
exports.defaultName = 'X32 Mixer';
|
||||
exports.connectionType = 'osc-udp';
|
||||
exports.heartbeatInterval = 9000;
|
||||
exports.searchOptions = {
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x2f, 0x78, 0x69, 0x6e, 0x66, 0x6f]),
|
||||
devicePort: 10023,
|
||||
listenPort: 0,
|
||||
validateResponse(msg, info) {
|
||||
return msg.toString().indexOf('/xinfo') === 0;
|
||||
},
|
||||
};
|
||||
exports.defaultPort = 10023;
|
||||
exports.config = {
|
||||
defaultName: "X32 Mixer",
|
||||
connectionType: "osc-udp",
|
||||
heartbeatInterval: 9000,
|
||||
defaultPort: 10023,
|
||||
mayChangePort: false,
|
||||
searchOptions: {
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x2f, 0x78, 0x69, 0x6e, 0x66, 0x6f]),
|
||||
devicePort: 10023,
|
||||
listenPort: 0,
|
||||
validateResponse(msg, info) {
|
||||
return msg.toString().indexOf('/xinfo') === 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.ready = function ready(device) {
|
||||
const d = device;
|
||||
|
||||
+16
-13
@@ -1,16 +1,19 @@
|
||||
exports.defaultName = 'X Air Mixer';
|
||||
exports.connectionType = 'UDPsocket';
|
||||
exports.heartbeatInterval = 10000;
|
||||
exports.searchOptions = {
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x2f, 0x78, 0x69, 0x6e, 0x66, 0x6f]),
|
||||
devicePort: 10024,
|
||||
listenPort: 0,
|
||||
validateResponse(msg, info) {
|
||||
return msg.toString().indexOf('/xinfo') === 0;
|
||||
},
|
||||
};
|
||||
exports.defaultPort = 10024;
|
||||
exports.config = {
|
||||
defaultName: "X Air Mixer",
|
||||
connectionType: "UDPsocket",
|
||||
heartbeatInterval: 10000,
|
||||
defaultPort: 10024,
|
||||
mayChangePort: false,
|
||||
searchOptions: {
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x2f, 0x78, 0x69, 0x6e, 0x66, 0x6f]),
|
||||
devicePort: 10024,
|
||||
listenPort: 0,
|
||||
validateResponse(msg, info) {
|
||||
return msg.toString().indexOf('/xinfo') === 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.ready = function ready(device) {
|
||||
const d = device;
|
||||
|
||||
+28
-10
@@ -15,6 +15,16 @@ window.init = function init() {
|
||||
ipcRenderer.send('enableDeviceDropdown');
|
||||
ipcRenderer.send('enableSearchAll');
|
||||
|
||||
// load autoUpdate setting from storage and send to main process
|
||||
const autoUpdate = JSON.parse(localStorage.getItem('autoUpdate'))
|
||||
if(autoUpdate !== undefined && autoUpdate !== null){
|
||||
if(autoUpdate){
|
||||
ipcRenderer.send('checkForUpdates');
|
||||
}
|
||||
// send message so main process knows the state of autoUpdate
|
||||
ipcRenderer.send('setAutoUpdate', autoUpdate)
|
||||
}
|
||||
|
||||
PLUGINS.init(() => {
|
||||
VIEW.init();
|
||||
SAVESLOTS.loadDevices();
|
||||
@@ -58,6 +68,7 @@ window.init = function init() {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
document.getElementById('save-slot-1').onclick = function slot1click(e) {
|
||||
e.stopPropagation();
|
||||
SAVESLOTS.loadSlot(1);
|
||||
@@ -145,29 +156,36 @@ ipcRenderer.on('setActiveDevicePinned', (event, message) => {
|
||||
}
|
||||
});
|
||||
|
||||
ipcRenderer.on('doSearch', (event, message) => {
|
||||
ipcRenderer.on('searchAll', (event, message) => {
|
||||
window.searchAll();
|
||||
});
|
||||
|
||||
ipcRenderer.on('doDelete', (event, message) => {
|
||||
ipcRenderer.on('deleteActive', (event, message) => {
|
||||
DEVICE.deleteActive();
|
||||
VIEW.selectPreviousDevice();
|
||||
});
|
||||
|
||||
ipcRenderer.on('resetViews', (event, message) => {
|
||||
SAVESLOTS.resetSlots();
|
||||
});
|
||||
|
||||
ipcRenderer.on('doSlots1', (event, message) => {
|
||||
SAVESLOTS.loadSlot(1);
|
||||
ipcRenderer.on('loadSlot', (event, slot) => {
|
||||
if(slot){
|
||||
SAVESLOTS.loadSlot(slot);
|
||||
}
|
||||
});
|
||||
|
||||
ipcRenderer.on('doSlots2', (event, message) => {
|
||||
SAVESLOTS.loadSlot(2);
|
||||
});
|
||||
|
||||
ipcRenderer.on('doSlots3', (event, message) => {
|
||||
SAVESLOTS.loadSlot(3);
|
||||
});
|
||||
// message from main process to set autoUpdate state
|
||||
ipcRenderer.on('setAutoUpdate',(event,autoUpdate)=>{
|
||||
localStorage.setItem('autoUpdate',autoUpdate);
|
||||
if(autoUpdate){
|
||||
ipcRenderer.send('checkForUpdates');
|
||||
}
|
||||
// message to main process that we have updated the state
|
||||
ipcRenderer.send('setAutoUpdate',autoUpdate);
|
||||
})
|
||||
|
||||
|
||||
function switchClass(element, className) {
|
||||
try {
|
||||
|
||||
+22
-6
@@ -49,6 +49,7 @@ function registerDevice(newDevice) {
|
||||
port: newDevice.port,
|
||||
addresses: newDevice.addresses,
|
||||
data: {},
|
||||
fields: newDevice.fields || {},
|
||||
pinIndex: false,
|
||||
lastDrawn: 0,
|
||||
lastHeartbeat: 0,
|
||||
@@ -65,6 +66,17 @@ function registerDevice(newDevice) {
|
||||
},
|
||||
};
|
||||
|
||||
devices[id].plugin = PLUGINS.all[newDevice.type];
|
||||
|
||||
if (
|
||||
Object.keys(devices[id].fields).length == 0 &&
|
||||
PLUGINS.all[newDevice.type].config.fields
|
||||
) {
|
||||
PLUGINS.all[newDevice.type].config.fields.forEach((field) => {
|
||||
devices[id].fields[field.key] = field.value;
|
||||
});
|
||||
}
|
||||
|
||||
VIEW.addDeviceToList(devices[id]);
|
||||
initDeviceConnection(id);
|
||||
return true;
|
||||
@@ -76,6 +88,10 @@ function initDeviceConnection(id) {
|
||||
|
||||
infoUpdate(device, 'status', 'new');
|
||||
|
||||
if (device.port === undefined) {
|
||||
device.port = device.plugin.config.defaultPort;
|
||||
}
|
||||
|
||||
if (device.port === undefined || device.addresses.length === 0) {
|
||||
return true;
|
||||
}
|
||||
@@ -89,8 +105,8 @@ function initDeviceConnection(id) {
|
||||
const { type } = devices[id];
|
||||
const plugins = PLUGINS.all;
|
||||
|
||||
if (plugins[type].connectionType.includes('osc')) {
|
||||
if (plugins[type].connectionType.includes('udp')) {
|
||||
if (plugins[type].config.connectionType.includes('osc')) {
|
||||
if (plugins[type].config.connectionType.includes('udp')) {
|
||||
device.connection = new osc.UDPPort({
|
||||
localAddress: '0.0.0.0',
|
||||
remoteAddress: device.addresses[0],
|
||||
@@ -124,8 +140,7 @@ function initDeviceConnection(id) {
|
||||
device.send = (address, args) => {
|
||||
device.connection.send({ address, args });
|
||||
};
|
||||
device.plugin = plugins[type];
|
||||
} else if (plugins[type].connectionType === 'TCPsocket') {
|
||||
} else if (plugins[type].config.connectionType === 'TCPsocket') {
|
||||
device.connection = new net.Socket();
|
||||
|
||||
device.connection.connect(
|
||||
@@ -155,7 +170,7 @@ function initDeviceConnection(id) {
|
||||
// log("SOCK OUT", data);
|
||||
device.connection.write(data);
|
||||
};
|
||||
} else if (plugins[type].connectionType === 'UDPsocket') {
|
||||
} else if (plugins[type].config.connectionType === 'UDPsocket') {
|
||||
device.connection = udp.createSocket('udp4');
|
||||
|
||||
device.connection.bind({ port: plugins[type].defaultPort }, () => {
|
||||
@@ -177,7 +192,7 @@ function initDeviceConnection(id) {
|
||||
}
|
||||
);
|
||||
};
|
||||
} else if (plugins[type].connectionType === 'multicast') {
|
||||
} else if (plugins[type].config.connectionType === 'multicast') {
|
||||
device.connection = udp.createSocket('udp4');
|
||||
|
||||
device.connection.bind(device.port, () => {
|
||||
@@ -191,6 +206,7 @@ function initDeviceConnection(id) {
|
||||
|
||||
device.send = (data) => {};
|
||||
}
|
||||
//device.plugin = plugins[type];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+15
-12
@@ -56,10 +56,6 @@ a {
|
||||
user-select: text;
|
||||
-webkit-app-region: drag;
|
||||
z-index: 1000;
|
||||
/*border-bottom: black 1px solid;*/
|
||||
/*background: linear-gradient(#3f3f3f 0%, #343434 100%);*/
|
||||
/*background-color: #363636;*/
|
||||
/*background-color: rgba(0, 0, 0, 0.4);*/
|
||||
}
|
||||
#view-buttons-bar button {
|
||||
background-color: rgba(255, 255, 255, 0.07);
|
||||
@@ -123,11 +119,15 @@ a {
|
||||
width: 210px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#device-tools {
|
||||
#device-inspector{
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
#device-tools {
|
||||
/* position: absolute;
|
||||
bottom: 210px;
|
||||
left: 0px;
|
||||
left: 0px;*/
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
padding-right: 10px;
|
||||
@@ -142,10 +142,7 @@ a {
|
||||
}
|
||||
|
||||
#device-settings {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
height: 200px;
|
||||
height: 300px;
|
||||
padding: 5px;
|
||||
color: white;
|
||||
font-weight: 300;
|
||||
@@ -165,7 +162,7 @@ a {
|
||||
display: none;
|
||||
}
|
||||
#device-settings h3 {
|
||||
padding-top: 20px;
|
||||
padding-top: 90px;
|
||||
text-align: center;
|
||||
font-weight: 300;
|
||||
}
|
||||
@@ -220,6 +217,7 @@ input {
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
cursor: text;
|
||||
}
|
||||
select {
|
||||
display: block;
|
||||
@@ -250,6 +248,7 @@ input[type='checkbox'] {
|
||||
width: 14px;
|
||||
padding: 2px;
|
||||
-webkit-appearance: none;
|
||||
cursor: default;
|
||||
}
|
||||
input[type='checkbox']:checked {
|
||||
background-color: #616064;
|
||||
@@ -267,6 +266,10 @@ input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
input:disabled{
|
||||
color: gray;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
button,
|
||||
select.button {
|
||||
box-sizing: content-box;
|
||||
|
||||
+23
-7
@@ -47,17 +47,33 @@ module.exports.init = function init(callback) {
|
||||
);
|
||||
|
||||
|
||||
if (p.heartbeatTimeout === undefined || p.heartbeatTimeout < 50) {
|
||||
if(p.heartbeatInterval){
|
||||
p.heartbeatTimeout = p.heartbeatInterval * 1.5;
|
||||
//if (p.heartbeatTimeout === undefined || p.heartbeatTimeout < 50) {
|
||||
if(p.config.heartbeatTimeout){
|
||||
p.heartbeatTimeout = p.config.heartbeatInterval * 1.5;
|
||||
}else{
|
||||
p.heartbeatTimeout = 10000;
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
if (p.heartbeatInterval === undefined || p.heartbeatInterval < 50) {
|
||||
p.heartbeatInterval = 5000;
|
||||
}
|
||||
if(p.config.heartbeatInterval){
|
||||
p.heartbeatInterval = Math.max(50, p.config.heartbeatInterval);
|
||||
}else{
|
||||
p.heartbeatInterval = 5000;
|
||||
}
|
||||
|
||||
// p.fields = {};
|
||||
// if(p.config.fields){
|
||||
// p.config.fields.forEach(field => {
|
||||
// p.fields[field.key] = field.value;
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// if (p.heartbeatInterval === undefined || p.heartbeatInterval < 50) {
|
||||
// p.heartbeatInterval = 5000;
|
||||
// }
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
+3
-1
@@ -60,6 +60,7 @@ module.exports.loadDevices = function loadDevices() {
|
||||
port: savedDevices[i].port,
|
||||
addresses: savedDevices[i].addresses,
|
||||
id: savedDevices[i].id,
|
||||
fields: savedDevices[i].fields
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -74,7 +75,7 @@ module.exports.saveAll = function saveAll() {
|
||||
savedSlots[activeSlot][i] = {
|
||||
addresses: currentPins[i].addresses,
|
||||
type: currentPins[i].type,
|
||||
id: currentPins[i].id,
|
||||
id: currentPins[i].id
|
||||
};
|
||||
}
|
||||
localStorage.setItem('savedSlots', JSON.stringify(savedSlots));
|
||||
@@ -93,6 +94,7 @@ module.exports.saveAll = function saveAll() {
|
||||
defaultName: device.defaultName,
|
||||
port: device.port,
|
||||
id: device.id,
|
||||
fields: device.fields
|
||||
};
|
||||
i++;
|
||||
});
|
||||
|
||||
+15
-10
@@ -20,10 +20,12 @@ function getServers() {
|
||||
const addresses = interfaces[key];
|
||||
for (let i = addresses.length; i--; ) {
|
||||
const address = addresses[i];
|
||||
if (address.family === 'IPv4' && !address.internal) {
|
||||
|
||||
if (address.family === 'IPv4' && !address.internal && address.address.substring(0, 3)!="169") {
|
||||
const subnet = ip.subnet(address.address, address.netmask);
|
||||
let current = ip.toLong(subnet.firstAddress);
|
||||
const last = ip.toLong(subnet.lastAddress) - 1;
|
||||
console.log(`range ${subnet.firstAddress} - ${subnet.lastAddress}`);
|
||||
while (current++ < last) result.push(ip.fromLong(current));
|
||||
}
|
||||
}
|
||||
@@ -41,9 +43,12 @@ function searchAll() {
|
||||
ipcRenderer.send('disableSearchAll', '');
|
||||
document.getElementById('search-button').style.opacity = 0.2;
|
||||
|
||||
Object.keys(DEVICE.all).forEach((i) => {
|
||||
DEVICE.infoUpdate(DEVICE.all[i], 'status', 'refresh');
|
||||
});
|
||||
// Removed this block to fix #21
|
||||
// "After adding devices via search, searching again leaves all devices stuck in reload state"
|
||||
//
|
||||
// Object.keys(DEVICE.all).forEach((i) => {
|
||||
// DEVICE.infoUpdate(DEVICE.all[i], 'status', 'refresh');
|
||||
// });
|
||||
|
||||
console.log('Searching...');
|
||||
|
||||
@@ -60,21 +65,21 @@ function searchAll() {
|
||||
const plugin = PLUGINS.all[p];
|
||||
|
||||
try {
|
||||
const t = plugin.searchOptions.type;
|
||||
const t = plugin.config.searchOptions.type;
|
||||
|
||||
if(t === 'TCPport'){
|
||||
if (TCPFlag) {
|
||||
searchTCP(p, plugin);
|
||||
searchTCP(p, plugin.config);
|
||||
}
|
||||
|
||||
}else if(t === 'Bonjour'){
|
||||
searchBonjour(p, plugin);
|
||||
searchBonjour(p, plugin.config);
|
||||
|
||||
}else if(t === 'UDPsocket'){
|
||||
searchUDP(p, plugin);
|
||||
searchUDP(p, plugin.config);
|
||||
|
||||
}else if(t === 'multicast'){
|
||||
searchMulticast(p, plugin);
|
||||
searchMulticast(p, plugin.config);
|
||||
|
||||
}
|
||||
|
||||
@@ -96,7 +101,7 @@ function searchAll() {
|
||||
}
|
||||
|
||||
ipcRenderer.send('enableSearchAll', '');
|
||||
}, 5000);
|
||||
}, 10000);
|
||||
};
|
||||
module.exports.searchAll = searchAll;
|
||||
|
||||
|
||||
+34
-3
@@ -1,6 +1,7 @@
|
||||
const { ipcRenderer } = require('electron');
|
||||
const DEVICE = require('./device.js');
|
||||
const PLUGINS = require('./plugins.js');
|
||||
const { saveAll } = require('./saveSlots.js');
|
||||
// const _ = require('lodash/function');
|
||||
|
||||
const pinnedDevices = [];
|
||||
@@ -197,6 +198,36 @@ function switchDevice(id) {
|
||||
document.getElementById('device-settings-port').value = activeDevice.port || '';
|
||||
document.getElementById('device-settings-pin').checked = activeDevice.pinIndex;
|
||||
|
||||
if(activeDevice.plugin.config.mayChangePort){
|
||||
document.getElementById('device-settings-port').disabled = false;
|
||||
}else{
|
||||
document.getElementById('device-settings-port').disabled = true;
|
||||
}
|
||||
|
||||
document.getElementById('device-settings-fields').innerHTML = "";
|
||||
|
||||
if(activeDevice.plugin.config.fields){
|
||||
let fields = activeDevice.plugin.config.fields;
|
||||
|
||||
fields.forEach(field => {
|
||||
let $elem = document.createElement("input");
|
||||
$elem.type = "text";
|
||||
$elem.value = activeDevice.fields[field.key];// || field.value;
|
||||
$elem.name = field.key;
|
||||
$elem.onchange = function(e){
|
||||
activeDevice.fields[field.key] = $elem.value;
|
||||
field.action(activeDevice);
|
||||
saveAll();
|
||||
}
|
||||
|
||||
if(field.type=="textinput"){
|
||||
let rowHTML =`<tr><th>${field.label}:</th><td colspan="3" id="${field.key}"></td></tr>`;
|
||||
document.getElementById('device-settings-fields').insertAdjacentHTML("beforeend", rowHTML);
|
||||
document.getElementById(field.key).appendChild($elem);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ipcRenderer.send('enableDeviceDropdown', '');
|
||||
ipcRenderer.send('setDevicePin', !DEVICE.all[id].pinIndex === false);
|
||||
};
|
||||
@@ -299,12 +330,12 @@ module.exports.selectNextDevice = function selectNextDevice() {
|
||||
|
||||
function populatePluginLists() {
|
||||
let typeSelect = '';
|
||||
let addSelect = '<option value="" disabled selected hidden>+</option>';
|
||||
let addSelect = '<option value="" disabled selected hidden> + </option>';
|
||||
|
||||
Object.keys(PLUGINS.all).forEach((pluginType) => {
|
||||
const plugin = PLUGINS.all[pluginType];
|
||||
addSelect += `<option value='${pluginType}'>${plugin.defaultName}</option>`;
|
||||
typeSelect += `<option value='${pluginType}'>${plugin.defaultName}</option>`;
|
||||
addSelect += `<option value='${pluginType}'>${plugin.config.defaultName}</option>`;
|
||||
typeSelect += `<option value='${pluginType}'>${plugin.config.defaultName}</option>`;
|
||||
});
|
||||
|
||||
document.getElementById('device-settings-plugin-dropdown').innerHTML = typeSelect;
|
||||
|
||||
Reference in New Issue
Block a user