Compare commits

..
Author SHA1 Message Date
JalleliAchraf 87995b5209 testing the flow sensor 2026-02-27 17:44:11 +01:00
JalleliAchraf 18e63e87a2 more fixes 2026-02-27 17:26:12 +01:00
JalleliAchraf c9426db695 cooling badge visual improvement 2026-02-27 17:13:16 +01:00
JalleliAchraf b557d84f50 cooling badge modification 2026-02-27 15:26:54 +01:00
JalleliAchraf cf5614fd29 swap front back reservoirs 2026-02-26 15:41:09 +01:00
JalleliAchraf 9d3da17aaa first aquapath fixes 2026-02-26 15:08:27 +01:00
10 changed files with 72 additions and 52 deletions

No files matched your search

+17 -4
View File
@@ -53,11 +53,11 @@ export function createChart({
}
// Build uPlot data for ALL series (including hidden ones)
const uPlotData: uPlot.AlignedData = [timestamps as uPlot.AlignedData[0]];
const uPlotData: uPlot.AlignedData = [timestamps as any];
allOriginalSeries.forEach(({ series }) => {
const [, values] = seriesToUPlotData(series.long);
uPlotData.push(values as uPlot.AlignedData[1]);
uPlotData.push(values as any);
});
// Add config lines data
@@ -70,7 +70,7 @@ export function createChart({
line.value,
)
: new Array(timestamps.length).fill(line.value);
uPlotData.push(lineData as uPlot.AlignedData[number]);
uPlotData.push(lineData as any);
}
});
@@ -367,13 +367,26 @@ export function createChart({
return ticks.map((ts) => {
const date = new Date(ts);
if (timeRange <= 5 * 60 * 1000) {
if (timeRange <= 30 * 1000) {
return date.toLocaleTimeString(undefined, {
hour12: false,
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
});
} else if (timeRange <= 5 * 60 * 1000) {
return date.toLocaleTimeString(undefined, {
hour12: false,
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
});
} else if (timeRange <= 60 * 60 * 1000) {
return date.toLocaleTimeString(undefined, {
hour12: false,
hour: "2-digit",
minute: "2-digit",
});
} else if (timeRange <= 24 * 60 * 60 * 1000) {
return date.toLocaleTimeString(undefined, {
hour12: false,
+1
View File
@@ -13,6 +13,7 @@ const badgeVariants = cva(
"border-transparent bg-neutral-900 text-neutral-50 dark:bg-neutral-50 dark:text-neutral-900",
secondary:
"border-transparent bg-neutral-100 text-neutral-900 dark:bg-neutral-800 dark:text-neutral-50",
cold: "border-blue-300/80 bg-gradient-to-r from-blue-100 to-cyan-100 text-blue-900 focus-visible:ring-blue-500/20 dark:border-blue-800 dark:from-blue-900/50 dark:to-cyan-900/40 dark:text-blue-100 dark:focus-visible:ring-blue-300/30",
destructive:
"border-transparent bg-red-500 text-white focus-visible:ring-red-500/20 dark:focus-visible:ring-red-500/40 dark:bg-red-500/70 dark:bg-red-900 dark:focus-visible:ring-red-900/20 dark:dark:focus-visible:ring-red-900/40 dark:dark:bg-red-900/70",
outline: "text-neutral-950 dark:text-neutral-50",
+6 -1
View File
@@ -38,6 +38,7 @@ type Props = {
step?: number;
inverted?: boolean;
confirmation?: string;
triggerClassName?: string;
renderValue: (value: number) => string;
onChange?: (value: number) => void;
};
@@ -96,6 +97,7 @@ export function EditValue({
minSlider,
maxSlider,
confirmation,
triggerClassName,
onChange,
}: Props) {
const defaultOrZero = defaultValue ?? 0;
@@ -473,7 +475,10 @@ export function EditValue({
>
<PopoverTrigger className="w-min" asChild>
<TouchButton
className={buttonStyle({ open, class: "py-4" })}
className={buttonStyle({
open,
class: `py-4 ${triggerClassName ?? ""}`,
})}
variant="outline"
disabled={!valueIsDefined}
>
@@ -7,6 +7,7 @@ import { useAquapath1 } from "./useAquapath";
import { SelectionGroup } from "@/control/SelectionGroup";
import { EditValue } from "@/control/EditValue";
import { Badge } from "@/components/ui/badge";
import { Icon } from "@/components/Icon";
import { Label } from "@/control/Label";
import { HeatingZone } from "../../extruder/HeatingZone";
@@ -20,10 +21,6 @@ export function Aquapath1ControlPage() {
back_temperature,
front_revolutions,
back_revolutions,
front_power,
back_power,
front_total_energy,
back_total_energy,
setAquapathMode,
setFrontTemperature,
setBackTemperature,
@@ -75,7 +72,7 @@ export function Aquapath1ControlPage() {
/>
</div>
<div className="flex flex-row gap-4">
<div className="flex flex-row items-end gap-4">
<Label label="Set Target Temperature">
<EditValue
title="Set Target Temperature"
@@ -84,6 +81,7 @@ export function Aquapath1ControlPage() {
max={80}
unit="C"
step={0.1}
triggerClassName="h-21"
renderValue={(value) => value.toFixed(1)}
onChange={(val) => {
setFrontTemperature(val);
@@ -94,17 +92,16 @@ export function Aquapath1ControlPage() {
/>
</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>
(state?.flow_states.front.flow ?? 0) > 0 && (
<Badge
variant="cold"
className="h-21 min-w-28 justify-center self-end px-4 text-sm"
>
<Icon name="lu:Snowflake" className="size-4" />
Cooling
</Badge>
)}
</div>
@@ -166,7 +163,7 @@ export function Aquapath1ControlPage() {
/>
</div>
<div className="flex flex-row gap-4">
<div className="flex flex-row items-end gap-4">
<Label label="Set Target Temperature">
<EditValue
title="Set Target Temperature"
@@ -175,6 +172,7 @@ export function Aquapath1ControlPage() {
max={80}
unit="C"
step={0.1}
triggerClassName="h-21"
renderValue={(value) => value.toFixed(1)}
onChange={(val) => {
setBackTemperature(val);
@@ -185,18 +183,16 @@ export function Aquapath1ControlPage() {
/>
</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 &&
frontTargetFlow &&
(state?.flow_states.front.flow ?? 0) && (
<Badge variant="secondary">Cooling</Badge>
backTargetFlow &&
(state?.flow_states.back.flow ?? 0) > 0 && (
<Badge
variant="cold"
className="h-21 min-w-28 justify-center self-end px-4 text-sm"
>
<Icon name="lu:Snowflake" className="size-4" />
Cooling
</Badge>
)}
</div>
@@ -134,7 +134,7 @@ export function useAquapath1() {
const setFrontRevolutions = (revolutions: number) => {
updateStateOptimistically(
(current) => {
current.data.fan_states.back.revolutions = revolutions;
current.data.fan_states.front.revolutions = revolutions;
},
() => {
requestFrontRevolutions({
+1 -1
View File
@@ -63,7 +63,7 @@
electron
];
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
ELECTON_SKIP_BINARY_DOWNLOAD = 1;
hardeningDisable = [ "fortify" ];
+3 -1
View File
@@ -308,7 +308,9 @@ impl Controller {
if self.temperature.cooling {
self.turn_cooling_off();
}
if self.heating_allowed && current_flow > VolumeRate::new::<liter_per_minute>(0.0) {
// Gate heating on commanded pump state rather than measured flow.
// A missing/miswired flow signal would otherwise block heating forever.
if self.heating_allowed && self.flow.pump {
self.turn_heating_on();
self.total_energy += self.get_current_power() * elapsed.as_secs_f64() / 3600.0;
+17 -17
View File
@@ -136,23 +136,6 @@ impl MachineNewTrait for AquaPathV1 {
let ao2 = AnalogOutput::new(el4002.clone(), EL4002Port::AO2);
let front_controller = Controller::new(
0.10,
0.0,
0.015,
Temperature::default(),
ThermodynamicTemperature::new::<degree_celsius>(25.0),
ao1,
do4,
do2,
t1,
t2,
AngularVelocity::new::<revolution_per_minute>(100.0),
Flow::default(),
do1,
enc1,
);
let back_controller = Controller::new(
0.10,
0.0,
0.015,
@@ -168,6 +151,23 @@ impl MachineNewTrait for AquaPathV1 {
do5,
enc2,
);
let back_controller = Controller::new(
0.10,
0.0,
0.015,
Temperature::default(),
ThermodynamicTemperature::new::<degree_celsius>(25.0),
ao1,
do4,
do2,
t1,
t2,
AngularVelocity::new::<revolution_per_minute>(100.0),
Flow::default(),
do1,
enc1,
);
let (sender, receiver) = smol::channel::unbounded();
let mut water_cooling = Self {
main_sender: params.main_thread_channel.clone(),
+1 -1
View File
@@ -42,7 +42,7 @@ in {
# - CONS: Vulnerable to Spectre, Meltdown, Foreshadow, ZombieLoad, etc.
# Should ONLY be used in completely trusted environments
# - Improves performance by 7-43%
"mitigations=off"
"mitigation=off"
"intel_pstate=performance" # Intel CPU-specific performance mode (if applicable)
# Memory Management
+3
View File
@@ -30,6 +30,9 @@ docker run --rm \
--workdir /workspace \
nixos/nix:latest \
sh -c "
whoami
ls -lh
cd /workspace
echo 'Enabling flakes and nix-command...'
mkdir -p ~/.config/nix
echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf