-
Notifications
You must be signed in to change notification settings - Fork 20
983 refactor improve aquapath UI layout and add fan speed configuration page #990
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
Open
MLobsien
wants to merge
79
commits into
master
Choose a base branch
from
983-refactor-improve-aquapath-ui-layout-and-add-fan-speed-configuration-page
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
a57d4cd
auto-redirect to setup when machine disconnects
EinsPommes 417ffb2
update: redirect to setup when machine disconnects
EinsPommes 0e2bcfd
fix: handle machine disconnects properly
EinsPommes beb2e3c
remove console.log statement
EinsPommes af8ee60
fix: clarify machine existence check in SidebarLayout
EinsPommes 64f5727
fix: prettier formatting
EinsPommes b5c189a
transform roundness to percentage and update related components
EinsPommes cc009b3
fix: prettier formatting
EinsPommes d352e88
feat: add mock machine build step to CI workflow
TheBest6337 c620f1d
fix mock machines in dev build
TheBest6337 520f33b
fix: clean up import formatting in registry.rs
TheBest6337 ce2123c
added logic for initializing wago modules on a 750_354
kraemr c436085
wago modules detected and wrapped as an EtherCatDevice
kraemr 5660ddd
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
MLobsien 345e083
auto-redirect to setup when machine disconnects
MLobsien f50e32a
fix: prettier formatting
EinsPommes dd5f3e8
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
MLobsien f6a3aa6
Refactor: reorganize 'Control' Page of the AquaPath Machine
MLobsien f8b861c
WIP: add configpage for aquapath
Hamid-el 285ad59
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
Hamid-el 2bee030
set max temperature of aquapath to 80°C
MLobsien a814236
Add settings page and route for Aquapath1
6c78ff9
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
620974a
feat(aquapath): implement fan RPM monitoring and control API
bb3f6c0
Feat: Implement fan rpm
MLobsien 6f9e89d
fix(aquapath): correct SetFrontFan mutation name typo
d7aa976
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
MLobsien dead77b
Change intern representation of fan rpm to f32
MLobsien 32fe774
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
MLobsien 5beee78
Add a second slider to AquaPath Config Page
MLobsien 3715728
feat: Add fan RPM data to AquaPathV1 live values
3beed94
feat(aquapath): add fan RPM data and related schemas to live values (…
9b6912b
WIP: Added fan rpm to AquaPath API
MLobsien 1da64c9
WIP: AquaPath settings page can be rendered
MLobsien 4fcc8df
fix: Change fan RPM type from f32 to f64 for precision
6ad4b9c
WIP: add fan support
MLobsien df6b9e7
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
MLobsien 63a472a
refactor(aquapath1): rename fan RPM to revolutions and add target tra…
MLobsien 3d7bcfe
Feat: Add aquapath fan control to controllers update function
MLobsien 3e6b838
Refactor(aquapath1): rename zod fields to match backend
MLobsien 9fe5e58
Refactor: use EditValue components instead of TouchSlider
MLobsien 3121679
feat: control aquapath fans via UI
MLobsien 44d4c65
Fix: format
MLobsien 3dfb879
fix: clean up imports and destructure variables
15i1i-s7v 74505c6
fix: fmt issues resolved
15i1i-s7v 0f6f224
fix: electron fmt issues
15i1i-s7v 93d179a
WIP: adjust cooling automatically
MLobsien c96c962
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
MLobsien 6408010
Add heating tolerance for controller
MLobsien 8151c99
fix: simplify cooling logic and remove unnecessary `.clone()`
15i1i-s7v bb12f96
style: apply code formatting
15i1i-s7v 3604545
WIP: API for heating/cooling tolerance
MLobsien 75c528a
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
MLobsien 94d5a84
feat: add heating and cooling tolerance functions for front and back
15i1i-s7v bfabb5a
feat: UI for temperature tolerance control
MLobsien 172ad0a
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
MLobsien adc0662
Fix: website layout
MLobsien 1328c6c
Feat: display heating/cooling state in control page
MLobsien 2e028f0
fix: front and back cooling were switched
MLobsien 259ed30
style(aquapath): improve control layout spacing and remove unused import
15i1i-s7v e0548d9
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
15i1i-s7v 0fd47cf
fix: adjust fan speed in backend
MLobsien 19e2a33
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
MLobsien 5bf19af
fix: cargo fmt issues
15i1i-s7v 88f14e0
fix: emit max_revolutions
MLobsien 95feaf4
Merge branch '983-refactor-improve-aquapath-ui-layout-and-add-fan-spe…
MLobsien 66122ad
fix: rename target_revolutions to max_revolutions
MLobsien f9f67d3
fix: update fans periodically
MLobsien d3a5671
fix: format
MLobsien 0c8b838
auto-redirect to setup when machine disconnects
EinsPommes dec8ea4
Merge pull request #994 from qitechgmbh/master
JalleliAchraf d8a0039
fixed double import
JalleliAchraf 8b462d5
Fix: target_revolutions -> max_revolutions in controller
MLobsien 6411f9f
feat: display heating energy consumption in UI
MLobsien f24f312
fix: temperature calculation
MLobsien f80cdb0
fix: cooling state display in UI
MLobsien b4cce1d
fix: unued fields in controller
MLobsien 2d2415a
fix: unused imports
MLobsien e864a91
Merge remote-tracking branch 'origin/master' into 983-refactor-improv…
Oshgnacknak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,9 @@ | |
| import { useAquapath1 } from "./useAquapath"; | ||
| import { SelectionGroup } from "@/control/SelectionGroup"; | ||
| import { EditValue } from "@/control/EditValue"; | ||
| import { Badge } from "@/components/ui/badge"; | ||
| import { Label } from "@/control/Label"; | ||
| import { HeatingZone } from "../../extruder/HeatingZone"; | ||
|
|
||
| export function Aquapath1ControlPage() { | ||
| const { | ||
|
|
@@ -16,8 +18,12 @@ | |
| back_flow, | ||
| front_temperature, | ||
| back_temperature, | ||
| front_temp_reservoir, | ||
| back_temp_reservoir, | ||
| front_revolutions, | ||
| back_revolutions, | ||
| front_power, | ||
| back_power, | ||
| front_total_energy, | ||
| back_total_energy, | ||
| setAquapathMode, | ||
| setFrontTemperature, | ||
| setBackTemperature, | ||
|
|
@@ -29,111 +35,55 @@ | |
| const backTargetTemperature = | ||
| state?.temperature_states?.back.target_temperature ?? 0; | ||
|
|
||
| const frontCurrentTemperature = | ||
| state?.temperature_states?.front.temperature ?? 0; | ||
| const backCurrentTemperature = | ||
| state?.temperature_states?.back.temperature ?? 0; | ||
|
|
||
| const frontCoolingBoundary = | ||
| frontTargetTemperature + (state?.tolerance_states.front.cooling ?? 0); | ||
| const frontHeatingBoundary = | ||
| frontTargetTemperature - (state?.tolerance_states.front.heating ?? 0); | ||
| const backCoolingBoundary = | ||
| backTargetTemperature + (state?.tolerance_states.back.cooling ?? 0); | ||
| const backHeatingBoundary = | ||
| backTargetTemperature - (state?.tolerance_states.back.heating ?? 0); | ||
|
|
||
| const frontTargetFlow = state?.flow_states.front.should_flow ?? false; | ||
| const backTargetFlow = state?.flow_states.back.should_flow ?? false; | ||
|
|
||
| return ( | ||
| <Page> | ||
| <ControlGrid columns={2}> | ||
| <ControlCard title="Flow Measurements"> | ||
| <div className="grid grid-cols-2 gap-6"> | ||
| <div className="flex flex-col gap-8"> | ||
| <ControlCard title="Reservoir 1"> | ||
| <div className="grid grid-rows-5 gap-4"> | ||
| <div className="flex flex-row"> | ||
| <TimeSeriesValueNumeric | ||
| label="Flow 1" | ||
| label="Flow" | ||
| unit="l/min" | ||
| timeseries={front_flow} | ||
| renderValue={(value) => value.toFixed(1)} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className="flex flex-col gap-8"> | ||
| <div className="flex flex-row"> | ||
| <TimeSeriesValueNumeric | ||
| label="Flow 2" | ||
| unit="l/min" | ||
| timeseries={back_flow} | ||
| renderValue={(value) => value.toFixed(1)} | ||
| /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div className="mt-8"> | ||
| <Label label="Pump 1"> | ||
| <SelectionGroup<"On" | "Off"> | ||
| value={frontTargetFlow ? "On" : "Off"} | ||
| orientation="vertical" | ||
| className="grid h-full grid-cols-2 gap-2" | ||
| options={{ | ||
| Off: { | ||
| children: "Off", | ||
| icon: "lu:CirclePause", | ||
| isActiveClassName: "bg-green-600", | ||
| className: "h-full", | ||
| }, | ||
| On: { | ||
| children: "On", | ||
| icon: "lu:CirclePlay", | ||
| isActiveClassName: "bg-green-600", | ||
| className: "h-full", | ||
| }, | ||
| }} | ||
| onChange={(value) => { | ||
| if (value == "On") { | ||
| setFrontFlow(true); | ||
| } else { | ||
| setFrontFlow(false); | ||
| } | ||
| }} | ||
| /> | ||
| </Label> | ||
|
|
||
| <Label label="Pump 2"> | ||
| <SelectionGroup<"On" | "Off"> | ||
| value={backTargetFlow ? "On" : "Off"} | ||
| orientation="vertical" | ||
| className="grid h-full grid-cols-2 gap-2" | ||
| options={{ | ||
| Off: { | ||
| children: "Off", | ||
| icon: "lu:CirclePause", | ||
| isActiveClassName: "bg-green-600", | ||
| className: "h-full", | ||
| }, | ||
| On: { | ||
| children: "On", | ||
| icon: "lu:CirclePlay", | ||
| isActiveClassName: "bg-green-600", | ||
| className: "h-full", | ||
| }, | ||
| }} | ||
| onChange={(value) => { | ||
| if (value == "On") { | ||
| setBackFlow(true); | ||
| } else { | ||
| setBackFlow(false); | ||
| } | ||
| }} | ||
| /> | ||
| </Label> | ||
| </div> | ||
| </ControlCard> | ||
|
|
||
| <ControlCard title="Temperature Measurements"> | ||
| <div className="grid grid-cols-2 gap-6"> | ||
| <div className="flex flex-col gap-8"> | ||
| <TimeSeriesValueNumeric | ||
| label="Reservoir 1" | ||
| label="Temperature" | ||
| unit="C" | ||
| timeseries={front_temperature} | ||
| renderValue={(value) => value.toFixed(1)} | ||
| /> | ||
| <Label label="Set Reservoir 1 Target Temperature"> | ||
| </div> | ||
|
|
||
| <div className="flex flex-row gap-4"> | ||
| <Label label="Set Target Temperature"> | ||
| <EditValue | ||
| title="Set Reservoir 1 Target Temperature" | ||
| title="Set Target Temperature" | ||
| min={0} | ||
| value={frontTargetTemperature} | ||
| max={80} | ||
| unit="C" | ||
| step={0.1} | ||
| min={0.0} | ||
| max={80.0} | ||
| renderValue={(value) => value.toFixed(1)} | ||
| onChange={(val) => { | ||
| setFrontTemperature(val); | ||
|
|
@@ -143,23 +93,88 @@ | |
| } | ||
| /> | ||
| </Label> | ||
|
|
||
| {frontCurrentTemperature < frontHeatingBoundary && | ||
| (state?.flow_states.front.flow ?? 0) > 0 && ( | ||
| <Badge variant="default"> | ||
| Power: {front_power.current?.value} W<br /> | ||
| Total: {front_total_energy.current?.value} kWh | ||
| </Badge> | ||
| )} | ||
| {frontCurrentTemperature > frontCoolingBoundary && | ||
| frontTargetFlow && | ||
| (state?.flow_states.front.flow ?? 0) && ( | ||
| <Badge variant="secondary">Cooling</Badge> | ||
| )} | ||
| </div> | ||
|
|
||
| <div className="flex flex-row"> | ||
| <TimeSeriesValueNumeric | ||
| label="Revolution Speed" | ||
| unit="%" | ||
| timeseries={front_revolutions} | ||
| renderValue={(value) => value.toFixed(1)} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className="flex flex-row"> | ||
| <Label label="Pump"> | ||
| <SelectionGroup<"On" | "Off"> | ||
| value={frontTargetFlow ? "On" : "Off"} | ||
| orientation="vertical" | ||
| className="grid h-full grid-cols-2 gap-2" | ||
| options={{ | ||
| Off: { | ||
| children: "Off", | ||
| icon: "lu:CirclePause", | ||
| isActiveClassName: "bg-green-600", | ||
| className: "h-full", | ||
| }, | ||
| On: { | ||
| children: "On", | ||
| icon: "lu:CirclePlay", | ||
| isActiveClassName: "bg-green-600", | ||
| className: "h-full", | ||
| }, | ||
| }} | ||
| onChange={(value) => { | ||
| setFrontFlow(value == "On"); | ||
| }} | ||
| /> | ||
| </Label> | ||
| </div> | ||
| </div> | ||
| </ControlCard> | ||
|
|
||
| <ControlCard title="Reservoir 2"> | ||
| <div className="grid grid-rows-4 gap-4"> | ||
| <div className="flex flex-row"> | ||
| <TimeSeriesValueNumeric | ||
| label="Flow" | ||
| unit="l/min" | ||
| timeseries={back_flow} | ||
| renderValue={(value) => value.toFixed(1)} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className="flex flex-col gap-8"> | ||
| <div className="flex flex-row"> | ||
| <TimeSeriesValueNumeric | ||
| label="Reservoir 2" | ||
| label="Temperature" | ||
| unit="C" | ||
| timeseries={back_temperature} | ||
| renderValue={(value) => value.toFixed(1)} | ||
| /> | ||
| <Label label="Set Reservoir 2 Target Temperature"> | ||
| </div> | ||
|
|
||
| <div className="flex flex-row gap-4"> | ||
| <Label label="Set Target Temperature"> | ||
| <EditValue | ||
| title="Set Reservoir 2 Target Temperature" | ||
| title="Set Target Temperature" | ||
| min={0} | ||
| value={backTargetTemperature} | ||
| max={80} | ||
| unit="C" | ||
| step={0.1} | ||
| min={0.0} | ||
| max={80.0} | ||
| renderValue={(value) => value.toFixed(1)} | ||
| onChange={(val) => { | ||
| setBackTemperature(val); | ||
|
|
@@ -169,6 +184,56 @@ | |
| } | ||
| /> | ||
| </Label> | ||
|
|
||
| {backCurrentTemperature < backHeatingBoundary && | ||
| backTargetFlow && | ||
| (state?.flow_states.front.flow ?? 0) && ( | ||
| <Badge variant="default"> | ||
| Power: {back_power.current?.value} W<br /> | ||
| Total: {back_total_energy.current?.value} kWh | ||
| </Badge> | ||
| )} | ||
| {backCurrentTemperature > backCoolingBoundary && | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might have an easier life if you'd just introduce helpers returning a boolean for code like that instead of repeatedly writing similar conditions all over the place. |
||
| frontTargetFlow && | ||
| (state?.flow_states.front.flow ?? 0) && ( | ||
| <Badge variant="secondary">Cooling</Badge> | ||
| )} | ||
| </div> | ||
|
|
||
| <div className="flex flex-row"> | ||
| <TimeSeriesValueNumeric | ||
| label="Revolution Speed" | ||
| unit="%" | ||
| timeseries={back_revolutions} | ||
| renderValue={(value) => value.toFixed(1)} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className="flex flex-row"> | ||
| <Label label="Pump"> | ||
| <SelectionGroup<"On" | "Off"> | ||
| value={backTargetFlow ? "On" : "Off"} | ||
| orientation="vertical" | ||
| className="grid h-full grid-cols-2 gap-2" | ||
| options={{ | ||
| Off: { | ||
| children: "Off", | ||
| icon: "lu:CirclePause", | ||
| isActiveClassName: "bg-green-600", | ||
| className: "h-full", | ||
| }, | ||
| On: { | ||
| children: "On", | ||
| icon: "lu:CirclePlay", | ||
| isActiveClassName: "bg-green-600", | ||
| className: "h-full", | ||
| }, | ||
| }} | ||
| onChange={(value) => { | ||
| setBackFlow(value == "On"); | ||
| }} | ||
| /> | ||
| </Label> | ||
| </div> | ||
| </div> | ||
| </ControlCard> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Out of curiosity: does your backend receive and clamp those values to avoid tampering?