Skip to content

Commit

Permalink
fix users not showing - they arent base64 encoded
Browse files Browse the repository at this point in the history
  • Loading branch information
rerpha committed Oct 2, 2024
1 parent 2029080 commit 389bc19
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions app/components/InstrumentData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,18 @@ export default function InstrumentData({
updatedPVbytes != null
) {
// this is a top bar column zero value
const row = updatedPVName.endsWith("TITLE") ? 0 : 1; // if title, column 1
// Both of these are base64 encoded. PVWS gives a null byte back if there is no value, so replace with null.
const value =
atob(updatedPVbytes) != "\x00" ? atob(updatedPVbytes) : null;
const isTitle = updatedPVName.endsWith("TITLE")

let value;
if (isTitle) {
// The title is base64 encoded. PVWS gives a null byte back if there is no value, so replace with null.
value = atob(updatedPVbytes) != "\x00" ? atob(updatedPVbytes) : null;
} else {
value = updatedPV.text
}

const row = isTitle ? 0 : 1; // if title, column 1

currentInstrument.topBarPVs.set(updatedPVName, [
row,
0,
Expand Down

0 comments on commit 389bc19

Please sign in to comment.