更新遗传算法默认参数;更新漏损流量单位为m3/h
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
} from "@mui/material";
|
||||
import { FormatListBulleted } from "@mui/icons-material";
|
||||
import dayjs from "dayjs";
|
||||
import { getAreaColor } from "./utils";
|
||||
import { DMA_FLOW_DISPLAY_UNIT, getAreaColor, toM3h } from "./utils";
|
||||
import { LeakageResultDetail } from "./types";
|
||||
|
||||
interface Props {
|
||||
@@ -125,11 +125,13 @@ const RecognitionResults: React.FC<Props> = ({ result }) => {
|
||||
{(() => {
|
||||
const val = (result.scheme_detail as any)?.algorithm_params
|
||||
?.q_sum;
|
||||
const unit =
|
||||
const unit = String(
|
||||
(result.scheme_detail as any)?.algorithm_params?.q_sum_unit ||
|
||||
"m3/s";
|
||||
return val !== undefined
|
||||
? `${Number(val).toFixed(3)} ${unit}`
|
||||
"m3/s",
|
||||
);
|
||||
const qSumM3h = toM3h(Number(val), unit);
|
||||
return Number.isFinite(qSumM3h)
|
||||
? `${qSumM3h.toFixed(3)} ${DMA_FLOW_DISPLAY_UNIT}`
|
||||
: "-";
|
||||
})()}
|
||||
</Typography>
|
||||
@@ -163,8 +165,9 @@ const RecognitionResults: React.FC<Props> = ({ result }) => {
|
||||
{(() => {
|
||||
const maxL = (result.scheme_detail as any)?.result_summary
|
||||
?.max_leakage;
|
||||
return maxL !== undefined
|
||||
? `${Number(maxL).toFixed(3)} m3/s`
|
||||
const maxLeakageM3h = toM3h(Number(maxL), "m3/s");
|
||||
return Number.isFinite(maxLeakageM3h)
|
||||
? `${maxLeakageM3h.toFixed(3)} ${DMA_FLOW_DISPLAY_UNIT}`
|
||||
: "-";
|
||||
})()}
|
||||
</Typography>
|
||||
@@ -212,7 +215,7 @@ const RecognitionResults: React.FC<Props> = ({ result }) => {
|
||||
align="right"
|
||||
sx={{ fontWeight: 600, color: "#64748b", py: 1.5, pr: 3 }}
|
||||
>
|
||||
漏损量 (m3/s)
|
||||
漏损量 ({DMA_FLOW_DISPLAY_UNIT})
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
@@ -244,7 +247,7 @@ const RecognitionResults: React.FC<Props> = ({ result }) => {
|
||||
align="right"
|
||||
sx={{ pr: 3, py: 1.2, fontWeight: 500, color: "#334155" }}
|
||||
>
|
||||
{row.LeakageFlow_m3_per_s.toFixed(3)}
|
||||
{toM3h(Number(row.LeakageFlow_m3_per_s), "m3/s").toFixed(3)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user