Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87995b5209 | ||
|
|
18e63e87a2 | ||
|
|
c9426db695 | ||
|
|
b557d84f50 | ||
|
|
cf5614fd29 | ||
|
|
9d3da17aaa |
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
electron
|
||||
];
|
||||
|
||||
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
|
||||
ELECTON_SKIP_BINARY_DOWNLOAD = 1;
|
||||
|
||||
hardeningDisable = [ "fortify" ];
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user