New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TGUI TEG #1965
TGUI TEG #1965
Conversation
changelog |
fixed |
@@ -19,6 +19,7 @@ | |||
#define KELVIN *1 | |||
#define MOLES *1 | |||
#define CANDELAS *1 | |||
#define PASCALS *1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically *(1 KILOGRAM)/(1 METER * ((0.1 SECONDS)**2))
but I'll let this slide
Co-authored-by: ZeWaka <zewakagamer@gmail.com>
if(src.circ1) | ||
data["hotCircStatus"] = src.circ1 | ||
data["hotInletTemp"] = src.circ1.air1.temperature | ||
data["hotOutletTemp"] = src.circ1.air2.temperature | ||
data["hotInletPres"] = MIXTURE_PRESSURE(src.circ1.air1) KILO PASCALS | ||
data["hotOutletPres"] = MIXTURE_PRESSURE(src.circ1.air2) KILO PASCALS | ||
else | ||
data["hotCircStatus"] = null | ||
data["hotInletTemp"] = 0 | ||
data["hotOutletTemp"] = 0 | ||
data["hotInletPres"] = 0 | ||
data["hotOutletPres"] = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also consider doing as a nested list, then just having null
if src.circ1
isn't set. Would mean handling a little more in the UI, but I don't think that's necessarily a bad thing.
This is absolutely simple and readable enough that I think the if
/else
is absolutely fine here. Educating for more complex cases.
const { | ||
output, | ||
history, | ||
hotCircStatus, | ||
hotInletTemp, | ||
hotOutletTemp, | ||
hotInletPres, | ||
hotOutletPres, | ||
coldCircStatus, | ||
coldInletTemp, | ||
coldOutletTemp, | ||
coldInletPres, | ||
coldOutletPres, | ||
} = data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, if using the nested object thing as mentioned in the DM file, this would look like:
const {
output,
history,
hot: {
circStatus: hotCircStatus = null,
inletTemp: hotInletTemp = 0,
outletTemp: hotOutletTemp = 0,
inletPres: hotInletPres = 0,
outletPres: hotOutletPres = 0,
} = {},
cold: {
circStatus: coldCircStatus = null,
inletTemp: coldInletTemp = 0,
outletTemp: coldOutletTemp = 0,
inletPres: coldInletPres = 0,
outletPres: coldOutletPres = 0,
} = {},
} = data;
strokeColor="rgba(1, 184, 170, 1)" | ||
fillColor="rgba(1, 184, 170, 0.25)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fairly arbitrary colors. They look nice here, but should probably be moved to (and then drawn from) the theme.
About the PR
TGUI TEG
edit: Now featuring our first chart!
the misspelling on inlet in these images has been corrected
Why's this needed?
Consistency with the rest of the new TGUI engineering UI's
Changelog