Commit c0fd0748 authored by rees_s's avatar rees_s
Browse files

Backup 2020-10-19

parent a76c34af
......@@ -51,23 +51,60 @@
}
},
"@psi/ilk-wc-factory": {
"version": "1.2.7-SNAPSHOT.1601334476862",
"resolved": "http://npm.psi.ch/@psi%2filk-wc-factory/-/ilk-wc-factory-1.2.7-SNAPSHOT.1601334476862.tgz",
"integrity": "sha512-f0ibk2sQIvja6bVxI1x1Zjh8aqJrGamupYsrbDsayMiwNv3TDngZ+xysnJYVn94JJNPYsp/lPtZ9OeouYGgymg==",
"version": "1.2.7-SNAPSHOT.1603080713722",
"resolved": "http://npm.psi.ch/@psi%2filk-wc-factory/-/ilk-wc-factory-1.2.7-SNAPSHOT.1603080713722.tgz",
"integrity": "sha512-7NzWQblwWX6va9C99JKVhN6xJb2SHG1E88hUIEpVGwyGApP5GWzHYsmHN/hBzPiQWYhMjM9xm2CMrllfhoKLnw==",
"requires": {
"@psi/wica-js": "^1.1.4-SNAPSHOT.1583886994447",
"json5": "^2.1.1",
"lit-element": "^2.2.1",
"lit-html": "^1.1.2",
"npm-auto-snapshot": "^0.5.3"
},
"dependencies": {
"@psi/wica-js": {
"version": "1.3.1",
"resolved": "http://npm.psi.ch/@psi%2fwica-js/-/wica-js-1.3.1.tgz",
"integrity": "sha512-l1WLEYUNtnlPkwY6t9DYWGWmFWUzAxglvYS4/C1aXaegEE2PN5whdr6QtJyCWMOn9uUWrx9mc9UIKF9auXhJZA==",
"requires": {
"json5": "^2.1.3"
}
}
}
},
"@psi/wica-js": {
"version": "1.2.1",
"resolved": "http://npm.psi.ch/@psi%2fwica-js/-/wica-js-1.2.1.tgz",
"integrity": "sha512-uSF6SIu2IavLo9XavIDWmYQjvwTYFtnri6Nx6wKxXk3eoIBwNlx+lYg4SOdMH80a7fFzoD5W+orLjY8rfwLGUw==",
"version": "1.3.1-SNAPSHOT.1603044996555",
"resolved": "http://npm.psi.ch/@psi%2fwica-js/-/wica-js-1.3.1-SNAPSHOT.1603044996555.tgz",
"integrity": "sha512-+aOkjKQVXUFvwc7k04lWDdHU6yWjk7k4dLcbSL6/VcKevCq1++WmgYRosOebRu0lBO1shaY6ba3K8ftaiIfQ1Q==",
"requires": {
"json5": "^2.1.0"
"json5": "^2.1.3"
}
},
"@rollup/pluginutils": {
"version": "3.1.0",
"resolved": "http://npm.psi.ch/@rollup%2fpluginutils/-/pluginutils-3.1.0.tgz",
"integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==",
"requires": {
"@types/estree": "0.0.39",
"estree-walker": "^1.0.1",
"picomatch": "^2.2.2"
},
"dependencies": {
"@types/estree": {
"version": "0.0.39",
"resolved": "http://npm.psi.ch/@types%2festree/-/estree-0.0.39.tgz",
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw=="
},
"estree-walker": {
"version": "1.0.1",
"resolved": "http://npm.psi.ch/estree-walker/-/estree-walker-1.0.1.tgz",
"integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg=="
},
"picomatch": {
"version": "2.2.2",
"resolved": "http://npm.psi.ch/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg=="
}
}
},
"@types/estree": {
......@@ -213,6 +250,11 @@
"lodash": "^4.17.14"
}
},
"atob": {
"version": "2.1.2",
"resolved": "http://npm.psi.ch/atob/-/atob-2.1.2.tgz",
"integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg=="
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
......@@ -421,6 +463,11 @@
}
}
},
"decode-uri-component": {
"version": "0.2.0",
"resolved": "http://npm.psi.ch/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
"integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU="
},
"deep-is": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
......@@ -1694,6 +1741,15 @@
"rollup-pluginutils": "^2.8.1"
}
},
"rollup-plugin-sourcemaps": {
"version": "0.6.3",
"resolved": "http://npm.psi.ch/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz",
"integrity": "sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==",
"requires": {
"@rollup/pluginutils": "^3.0.9",
"source-map-resolve": "^0.6.0"
}
},
"rollup-plugin-terser": {
"version": "5.3.1",
"resolved": "http://npm.psi.ch/rollup-plugin-terser/-/rollup-plugin-terser-5.3.1.tgz",
......@@ -1825,6 +1881,15 @@
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
"source-map-resolve": {
"version": "0.6.0",
"resolved": "http://npm.psi.ch/source-map-resolve/-/source-map-resolve-0.6.0.tgz",
"integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==",
"requires": {
"atob": "^2.1.2",
"decode-uri-component": "^0.2.0"
}
},
"source-map-support": {
"version": "0.5.19",
"resolved": "http://npm.psi.ch/source-map-support/-/source-map-support-0.5.19.tgz",
......
......@@ -22,11 +22,13 @@
"clean": "rm -rf build",
"dist_assemble_dev": "source .bashrc && dist_assemble_dev",
"dist_publish_dev": "source .bashrc && dist_publish_dev",
"dist_republish_dev": "source .bashrc && dist_assemble_dev && dist_publish_dev",
"dist_assemble_prod": "source .bashrc && dist_assemble_prod",
"dist_publish_prod": "source .bashrc && dist_publish_prod",
"dist_clean_all": "source .bashrc && dist_clean_all",
"lint": "eslint src/**/*.js",
"version": "echo $npm_package_version"
"version": "echo $npm_package_version",
"npm_update": "npm update"
},
"repository": {
"type": "git",
......@@ -35,11 +37,12 @@
"author": "",
"license": "ISC",
"dependencies": {
"@psi/ilk-wc-factory": "^1.2.7-SNAPSHOT.1601334476862",
"@psi/wica-js": "^1.2.1",
"@psi/ilk-wc-factory": "^1.2.7-SNAPSHOT.1603080713722",
"@psi/wica-js": "^1.3.1-SNAPSHOT.1603044996555",
"json5": "^2.1.3",
"lit-element": "^2.4.0",
"lit-html": "^1.3.0"
"lit-html": "^1.3.0",
"rollup-plugin-sourcemaps": "^0.6.3"
},
"devDependencies": {
"eslint": "^6.8.0",
......
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import copy from 'rollup-plugin-copy';
export default [
// {
// input: 'src/gen/gen-support.js',
// output: {
// dir: 'build',
// format: 'esm',
// beautify: true,
// sourcemap: true,
// },
// plugins: [
// copy({
// targets: [
// { src: "src/gen/interlock-database-query-tool.html", dest: "build" },
// { src: "src/gen/control-system-query-tool.html", dest: "build" },
// { src: "src/gen/rpmip-module-hardware-register-overview.html", dest: "build" },
// { src: "src/gen/rpmip-module-decoded-datasource-test.html", dest: "build" },
// { src: "src/gen/index.html", dest: "build" },
// { src: "src/gen/background.jpg", dest: "build" },
// ],
// }),
// resolve(),
// commonjs()
// ]
// },
{
input: 'src/gen/gen-support.js',
output: {
......@@ -13,9 +38,18 @@ export default [
plugins: [
copy({
targets: [
{ src: "src/gen/wica-data-group-test.html", dest: "build" },
{ src: "src/gen/usi-module-test.html", dest: "build" },
{ src: "src/gen/usi-system-test.html", dest: "build" },
{ src: "src/gen/usi-common-test.html", dest: "build" },
{ src: "src/gen/usi-board-test.html", dest: "build" },
{ src: "src/gen/rpmip-module-test.html", dest: "build" },
{ src: "src/gen/rpmip-module-visualiser-test.html", dest: "build" },
{ src: "src/gen/facility-ilktest-test.html", dest: "build" },
{ src: "src/gen/interlock-database-query-tool.html", dest: "build" },
{ src: "src/gen/control-system-query-tool.html", dest: "build" },
{ src: "src/gen/rpmip-module-hardware-register-overview.html", dest: "build" },
{ src: "src/gen/facility-module-hardware-register-overview.html", dest: "build" },
{ src: "src/gen/rpmip-module-decoded-datasource-test.html", dest: "build" },
{ src: "src/gen/index.html", dest: "build" },
{ src: "src/gen/background.jpg", dest: "build" },
......@@ -25,6 +59,7 @@ export default [
commonjs()
]
},
// {
// input: 'src/hipa/hipa-support.js',
// output: {
......@@ -45,24 +80,24 @@ export default [
// commonjs()
// ]
// },
{
input: 'src/proscan/proscan-support.js',
output: {
dir: 'build',
format: 'esm',
beautify: true,
sourcemap: true,
},
plugins: [
copy({
targets: [
{ src: "src/proscan/proscan-ilk-module-visualiser.html", dest: "build" }
],
}),
resolve(),
commonjs()
]
},
// {
// input: 'src/proscan/proscan-support.js',
// output: {
// dir: 'build',
// format: 'esm',
// beautify: true,
// sourcemap: true,
// },
// plugins: [
// copy({
// targets: [
// { src: "src/proscan/proscan-ilk-module-visualiser.html", dest: "build" }
// ],
// }),
// resolve(),
// commonjs()
// ]
// },
// {
// input: 'src/ilktest/ilktest-support.js',
// output: {
......
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>USI Module Test</title>
<script type="module" src="./gen-support.js"> </script>
<style>
* {
font-family: "Helvetica Neue",sans-serif;
}
body {
background-color: darkgrey;
}
:root {
--content-box-height: 75px;
--content-box-width: 250px;
--content-box-background-color: lightgreen;
--json-background-color: lemonchiffon;
}
label {
margin: auto;
color: blue;
}
.facility {
width: 60vw;
display: flex;
flex-flow: row nowrap;
background-color: lightgray;
justify-content: space-between;
align-items: flex-start;
border: solid 1px;
margin: 5px;
}
.board {
display: flex;
flex-flow: column nowrap;
background-color: darkgray;
justify-content: space-between;
align-items: stretch;
border: solid 1px;
margin: 5px;
}
.board-header {
color: black;
}
</style>
</head>
<body>
<h1>GFA Interlock Test Facility</h1>
<div class="facility">
<div class="board">
<label class="board-header">Board ID: J3001000</label>
<wc-event-visualiser eventTarget="ev-usi-system-update">
<slot name="title"><label>System: J3001000</label></slot>
<usi-system systemId="J3001000"></usi-system>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-common-update">
<slot name="title"><label>Common: J3001000</label></slot>
<usi-common commonId="J3001000"></usi-common>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-module-update">
<slot name="title"><label>Module: J3001001</label></slot>
<usi-module moduleId="J3001001"></usi-module>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-module-update">
<slot name="title"><label>Module: J3001002</label></slot>
<usi-module moduleId="J3001002"></usi-module>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-module-update">
<slot name="title"><label>Module: J3001003</label></slot>
<usi-module moduleId="J3001003"></usi-module>
</wc-event-visualiser>
</div>
<div class="board">
<label class="board-header">Board ID: J3002000</label>
<wc-event-visualiser eventTarget="ev-usi-system-update">
<slot name="title"><label>System: J3002000</label></slot>
<usi-system systemId="J3002000"></usi-system>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-common-update">
<slot name="title"><label>Common: J3002000</label></slot>
<usi-common commonId="J3002000"></usi-common>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-module-update">
<slot name="title"><label>Module: J3002001</label></slot>
<usi-module moduleId="J3002001"></usi-module>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-module-update">
<slot name="title"><label>Module: J3002002</label></slot>
<usi-module moduleId="J3002002"></usi-module>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-module-update">
<slot name="title"><label>Module: J3002003</label></slot>
<usi-module moduleId="J3002003"></usi-module>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-module-update">
<slot name="title"><label>Module: J3002004</label></slot>
<usi-module moduleId="J3002004"></usi-module>
</wc-event-visualiser>
</div>
<div class="board">
<label class="board-header">Board ID: J002004</label>
<wc-event-visualiser eventTarget="ev-rpmip-module-update">
<slot name="title"><label>Module: J002004</label></slot>
<rpmip-module moduleId="J002004"></rpmip-module>
</wc-event-visualiser>
</div>
<div class="board">
<label class="board-header">Board ID: J3003000</label>
<wc-event-visualiser eventTarget="ev-usi-system-update">
<slot name="title"><label>System: J3003000</label></slot>
<usi-system systemId="J3003000"></usi-system>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-common-update">
<slot name="title"><label>Common: J3003000</label></slot>
<usi-common commonId="J3003000"></usi-common>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-module-update">
<slot name="title"><label>Module: J3003001</label></slot>
<usi-module moduleId="J3003001"></usi-module>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-module-update">
<slot name="title"><label>Module: J3003002</label></slot>
<usi-module moduleId="J3003002"></usi-module>
</wc-event-visualiser>
<wc-event-visualiser eventTarget="ev-usi-module-update">
<slot name="title"><label>Module: J3003003</label></slot>
<usi-module moduleId="J3003003"></usi-module>
</wc-event-visualiser>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -128,13 +128,19 @@
color: var( --footer-text-color );
}
#ilk-level-column {
#ilk-level-column[facility=hipa], #ilk-level-column[facility=proscan] {
display: flex;
flex-direction: column;
flex: 0 0 4rem;
}
rpmip-module-epics-datasource {
#ilk-level-column[facility=ilktest] {
display: flex;
flex-direction: column;
flex: 0 0 11rem;
}
rpmip-module-visualiser, usi-module-visualiser {
background-color: lightgreen;
align-content: stretch;
margin: 0.15rem;
......@@ -142,26 +148,30 @@
font-size: 8px;
}
rpmip-module-epics-datasource[hardwareType="RPSM"] {
rpmip-module-visualiser[hardwareType="RPSM"] {
background-color: lightgreen;
}
rpmip-module-epics-datasource[hardwareType="SIIO1-TTL"] {
rpmip-module-visualiser[hardwareType="SIIO1-TTL"] {
background-color: violet;
}
rpmip-module-epics-datasource::part( module-id ) {
usi-module-visualiser[hardwareType="USI"] {
background-color: lemonchiffon;
}
rpmip-module-visualiser::part( module-id ), usi-module-visualiser::part( module-id ) {
text-align: center;
}
rpmip-module-epics-datasource::part( register-name ) {
rpmip-module-visualiser::part( register-name ), usi-module-visualiser::part( register-name ) {
color: white;
background-color: var( --register-name-background-color );
border: solid 2px darkgray;
flex: 2 0 0;
}
rpmip-module-epics-datasource::part( register-value ) {
rpmip-module-visualiser::part( register-value ), usi-module-visualiser::part( register-value ) {
background-color: white;
flex: 3 0 0;
border: solid 2px darkgray;
......@@ -208,7 +218,7 @@
const serverUrl="https://gfa-ilk-dev.psi.ch:9443";
const facilitySelector = document.getElementById( 'facility-selector' );
facilitySelector.addEventListener( "change", (ev) => loadRpmIpModules( ev ) );
facilitySelector.addEventListener( "change", (ev) => loadFacility( ev ) );
function removeAllChildren( element )
{
......@@ -231,15 +241,23 @@
return fetch( requestUrl );
}
function addModule( container, moduleId, hardwareType )
function addRpmipModule( container, moduleId, hardwareType )
{
const newEle = document.createElement( "rpmip-module-epics-datasource" );
newEle.setAttribute( "moduleId", moduleId );
const newEle = document.createElement( "rpmip-module-visualiser" );
newEle.setAttribute( "moduleId", "J" + moduleId );
newEle.setAttribute( "hardwareType", hardwareType );
container.appendChild( newEle );
}
function loadRpmIpModules( event )
function addUsiModule( container, moduleId, hardwareType )
{
const newEle = document.createElement( "usi-module-visualiser" );
newEle.setAttribute( "moduleId", "J" + moduleId );
newEle.setAttribute( "hardwareType", hardwareType );
container.appendChild( newEle );
}
function loadFacility( event )
{
if ( event.target.selectedIndex === 0 ) {
return
......@@ -258,6 +276,7 @@
const ilkLevelColumn = document.createElement("DIV");
ilkLevelColumn.id = "ilk-level-column";
ilkLevelColumn.setAttribute( "facility", facility );
container.appendChild(ilkLevelColumn);
const ilkLevelHeader = document.createElement("H3");
......@@ -266,10 +285,13 @@
json[key].forEach(module => {
if ( Array.isArray( rpmModules.typeA ) && rpmModules.typeA.includes( module )) {
addModule(ilkLevelColumn, module, "RPM" );
addRpmipModule( ilkLevelColumn, module, "RPM" );
}
if (Array.isArray( rpmModules.typeB ) && rpmModules.typeB.includes( module )) {
addModule(ilkLevelColumn, module, "SIIO1-TTL" );
addRpmipModule( ilkLevelColumn, module, "SIIO1-TTL" );
}
if (Array.isArray( rpmModules.typeC ) && rpmModules.typeC.includes( module )) {
addUsiModule( ilkLevelColumn, module, "USI" );
}
})
});
......
console.debug( "Executing script in gen-support.js module...");
import {WicaDataElement} from "@psi/ilk-wc-factory/wica-data-element.js";
import {RpmIpModuleEpicsDatasource} from "@psi/ilk-wc-factory/rpmip-module-epics-datasource.js";
import {RpmIpModuleDecodedDatasource} from "@psi/ilk-wc-factory/rpmip-module-decoded-datasource.js";
import {DocumentSupportLoader} from "@psi/wica-js/client-api.js";
import {WicaDataGroup} from "@psi/ilk-wc-factory/wica-data-group.js";
import {RpmipModule} from "@psi/ilk-wc-factory/rpmip-module.js";
import {UsiModule} from "@psi/ilk-wc-factory/usi-module.js";
import {UsiCommon} from "@psi/ilk-wc-factory/usi-common.js";
import {UsiSystem} from "@psi/ilk-wc-factory/usi-system.js";
import {UsiBoard} from "@psi/ilk-wc-factory/usi-board.js";
import {WebComponentEventVisualiser} from "@psi/ilk-wc-factory/wc-event-visualiser.js";
import {DocumentSupportLoader} from "@psi/wica-js/client-api";
import {RpmipModuleVisualiser} from "@psi/ilk-wc-factory/rpmip-module-visualiser.js";
import {UsiModuleVisualiser} from "@psi/ilk-wc-factory/usi-module-visualiser.js";
export {
WicaDataElement,
RpmIpModuleEpicsDatasource,
RpmIpModuleDecodedDatasource,
DocumentSupportLoader
WicaDataGroup,
RpmipModule,
UsiModule,
UsiCommon,
UsiSystem,
UsiBoard,
WebComponentEventVisualiser,
DocumentSupportLoader,
RpmipModuleVisualiser,
UsiModuleVisualiser
}
let documentSupportLoader = null;
// Provide a hook for restarting wica support of the current document
function restartDocumentSupportLoader() {
if ( documentSupportLoader === null ) {
console.log( "Wica is creating new DocumentSupportLoader..." );
documentSupportLoader = new DocumentSupportLoader( "../.." );
console.log( "Wica DocumentSupportLoader was created OK." );
}
else {
console.log( "Wica is shutting down support for the existing document..." );
documentSupportLoader.shutdown();
console.log( "Wica document support was shutdown OK." );
}
console.log( "Wica is activating support for a new document..." );
setTimeout( () => {
documentSupportLoader.activate( Number.MAX_VALUE, 500);
console.log("Wica document support has been activated OK.");
}, 0 );
}
document.wicaRestartDocumentSupportLoader = restartDocumentSupportLoader;
window.onload = function() {
restartDocumentSupportLoader();
}
\ No newline at end of file
......@@ -128,24 +128,24 @@