Skip to content

Commit 84ba4e5

Browse files
committed
show banner PVs under runstate
1 parent 39e5b0c commit 84ba4e5

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

app/components/Instrument.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ export class Instrument {
2929
this.dashboard.set(`${this.prefix}DAE:WDUSERS`, {
3030
pvaddress: `${this.prefix}DAE:WDUSERS`,
3131
});
32+
33+
for (const place of ["LEFT", "MIDDLE", "RIGHT"]) {
34+
this.dashboard.set(`${this.prefix}CS:DASHBOARD:BANNER:${place}:LABEL`, {
35+
pvaddress: `${this.prefix}CS:DASHBOARD:BANNER:${place}:LABEL`,
36+
});
37+
this.dashboard.set(`${this.prefix}CS:DASHBOARD:BANNER:${place}:VALUE`, {
38+
pvaddress: `${this.prefix}CS:DASHBOARD:BANNER:${place}:VALUE`,
39+
});
40+
}
41+
3242
for (const col of [1, 2]) {
3343
for (const row of [1, 2, 3]) {
3444
this.dashboard.set(`${this.dashboard_prefix}${row}:${col}:LABEL`, {

app/components/TopBar.tsx

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,32 @@ const TopBar = function TopBar({
4444
id="instNameDiv"
4545
className="w-full flex justify-center items-center flex-col"
4646
>
47-
<h2
48-
className={`text-center p-4 text-xl rounded-t-lg w-full
49-
${getStatusColour(getRunstate(prefix, runInfoPVs))}
50-
51-
${getForegroundColour(getRunstate(prefix, runInfoPVs))}
52-
53-
`}
54-
id={"instNameLabel"}
47+
<div
48+
id={"runstateDiv"}
49+
className={`p-2 rounded-t-lg w-full flex-col justify-center items-center text-center ${getStatusColour(getRunstate(prefix, runInfoPVs))} ${getForegroundColour(getRunstate(prefix, runInfoPVs))}`}
5550
>
56-
{instName.toUpperCase()} is{" "}
57-
<span id={"runStateSpan"}>{getRunstate(prefix, runInfoPVs)}</span>
58-
</h2>
51+
<h2 className={"text-xl"} id={"instNameLabel"}>
52+
{instName.toUpperCase()} is{" "}
53+
<span id={"runStateSpan"}>{getRunstate(prefix, runInfoPVs)}</span>
54+
</h2>
55+
<div
56+
id={"banner"}
57+
className={"flex flex-col md:flex-row text-center w-full"}
58+
>
59+
{["LEFT", "MIDDLE", "RIGHT"].map((place) => (
60+
<div key={place} className={"flex-row md:w-1/3"}>
61+
{
62+
dashboard.get(`${prefix}CS:DASHBOARD:BANNER:${place}:LABEL`)!
63+
.value
64+
}{" "}
65+
{
66+
dashboard.get(`${prefix}CS:DASHBOARD:BANNER:${place}:VALUE`)!
67+
.value
68+
}
69+
</div>
70+
))}
71+
</div>
72+
</div>
5973
<h3 className="text-black text-wrap max-w-full break-all py-2 font-semibold">
6074
Config:{" "}
6175
<span id={"configNameSpan"}>

0 commit comments

Comments
 (0)