connect KilnInfo
This commit is contained in:
@@ -6,30 +6,30 @@ import { stateNameMap } from "../../../store/features/kilnSlice";
|
||||
|
||||
export default function Kiln() {
|
||||
const kilnInfo = useSelector((state) => state.kiln);
|
||||
const dispatch = useDispatch();
|
||||
// const dispatch = useDispatch();
|
||||
|
||||
const infos = Object.keys(kilnInfo).map((key) => ({
|
||||
label: stateNameMap[key],
|
||||
value: kilnInfo[key],
|
||||
}));
|
||||
|
||||
useEffect(() => {
|
||||
setInterval(() => {
|
||||
dispatch({
|
||||
type: "kiln/setKilnInfo",
|
||||
payload: {
|
||||
kilnPressure: Math.ceil(Math.random() * 100) + "Pa",
|
||||
waterTemp: Math.ceil(Math.random() * 100) + "℃",
|
||||
waterFlow: Math.ceil(Math.random() * 100) + "m³/h",
|
||||
waterPressure: Math.ceil(Math.random() * 100) + "Pa",
|
||||
combustionAirPressure: Math.ceil(Math.random() * 100) + "Pa",
|
||||
topTemp: Math.ceil(Math.random() * 100) + "℃",
|
||||
compressedAirPressure: Math.ceil(Math.random() * 100) + "Pa",
|
||||
meltTemp: Math.ceil(Math.random() * 100) + "℃",
|
||||
},
|
||||
});
|
||||
}, 30000);
|
||||
}, [dispatch]);
|
||||
// useEffect(() => {
|
||||
// setInterval(() => {
|
||||
// dispatch({
|
||||
// type: "kiln/setKilnInfo",
|
||||
// payload: {
|
||||
// kilnPressure: Math.ceil(Math.random() * 100) + "Pa",
|
||||
// waterTemp: Math.ceil(Math.random() * 100) + "℃",
|
||||
// waterFlow: Math.ceil(Math.random() * 100) + "m³/h",
|
||||
// waterPressure: Math.ceil(Math.random() * 100) + "Pa",
|
||||
// combustionAirPressure: Math.ceil(Math.random() * 100) + "Pa",
|
||||
// topTemp: Math.ceil(Math.random() * 100) + "℃",
|
||||
// compressedAirPressure: Math.ceil(Math.random() * 100) + "Pa",
|
||||
// meltTemp: Math.ceil(Math.random() * 100) + "℃",
|
||||
// },
|
||||
// });
|
||||
// }, 30000);
|
||||
// }, [dispatch]);
|
||||
|
||||
// const infos = [
|
||||
// { label: "窑炉压力", value: ctx?.runState?.kilnPressure || "0Pa" },
|
||||
|
||||
Reference in New Issue
Block a user