-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(automatic): Introduce Flow Control Page with dynamic setpoint ma…
…nagement * Added FlowmeterWidgets and InputConfirmed components * Implemented setpoint state management with confirmation logging issue #29
- Loading branch information
1 parent
fb4c62f
commit f3ae213
Showing
1 changed file
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,5 +1,43 @@ | ||
export default function Page () { | ||
return ( | ||
<div>Hello World!</div> | ||
) | ||
} | ||
"use client"; | ||
|
||
import { useState } from "react"; | ||
import { FlowmeterWidgets } from "../sensors/ui/flowmeterWidgets"; | ||
import { InputConfirmed } from "../actuators/ui/inputConfirmed"; | ||
import { InputNumber } from "antd"; | ||
|
||
export default function Page() { | ||
let [setpoint, setSetpoint] = useState<number>(0); | ||
|
||
const onSetpointChange = (newSetpoint: number) => { | ||
setSetpoint(newSetpoint); | ||
}; | ||
|
||
const onSetpointConfirm = () => { | ||
console.log("Setpoint confirmed: ", setpoint); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<div> | ||
<h1>Flow Control Page</h1> | ||
{/* Flowmeter Value */} | ||
<h2> | ||
<span className="material-symbols-outlined">gas_meter</span>{" "} | ||
Flowmeters | ||
</h2> | ||
<FlowmeterWidgets /> | ||
</div> | ||
<div> | ||
<InputConfirmed | ||
min={0.0} | ||
max={25} | ||
precision={2} | ||
value={setpoint} | ||
onValueChange={onSetpointChange} | ||
onConfirm={onSetpointConfirm} | ||
/> | ||
<InputNumber min={0} max={25} defaultValue={0} precision={2} changeOnWheel/> | ||
</div> | ||
</div> | ||
); | ||
} |