forked from ddrilling/asb_cloud_front
Добавлена фильтрация отображаемых данных на телеметрии
This commit is contained in:
parent
59b1d49286
commit
bd81aa0401
@ -21,7 +21,7 @@ export const getLoadingInterval = (loaded, endDate, interval) => {
|
|||||||
end: loadingEndDate
|
end: loadingEndDate
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loaded && (loaded.start ?? null) !== null && (loaded.end ?? null) !== null) {
|
if (loadingStartDate <= loaded?.end && loadingEndDate >= loaded.start) {
|
||||||
if (loadingStartDate >= loaded.start) loadingStartDate = loaded.end
|
if (loadingStartDate >= loaded.start) loadingStartDate = loaded.end
|
||||||
if (loadingEndDate <= loaded.end) loadingEndDate = loaded.start
|
if (loadingEndDate <= loaded.end) loadingEndDate = loaded.start
|
||||||
newLoaded.start = Math.min(loaded.start, loadingStartDate)
|
newLoaded.start = Math.min(loaded.start, loadingStartDate)
|
||||||
|
@ -72,8 +72,6 @@ const makeSubjectSubsription = (subject$, handler) => {
|
|||||||
return () => subscribtion.unsubscribe()
|
return () => subscribtion.unsubscribe()
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRowDate = (row) => (row && isRawDate(row.date)) ? +new Date(row.date) : null
|
|
||||||
|
|
||||||
const TelemetryView = memo(() => {
|
const TelemetryView = memo(() => {
|
||||||
const [well, updateWell] = useWell()
|
const [well, updateWell] = useWell()
|
||||||
const [searchParams, setSearchParams] = useSearchParams()
|
const [searchParams, setSearchParams] = useSearchParams()
|
||||||
@ -85,7 +83,7 @@ const TelemetryView = memo(() => {
|
|||||||
const [rop, setRop] = useState(null)
|
const [rop, setRop] = useState(null)
|
||||||
const [chartMethods, setChartMethods] = useState()
|
const [chartMethods, setChartMethods] = useState()
|
||||||
|
|
||||||
const [loadedDataRange, setLoadedDataRange] = useState({})
|
const [loadedDataRange, setLoadedDataRange] = useState(null)
|
||||||
const [chartInterval, setChartInterval] = useState(defaultPeriod * 1000)
|
const [chartInterval, setChartInterval] = useState(defaultPeriod * 1000)
|
||||||
const [endDate, setEndDate] = useState(defaultDate)
|
const [endDate, setEndDate] = useState(defaultDate)
|
||||||
const [dateLimit, setDateLimit] = useState({ from: 0, to: Date.now() })
|
const [dateLimit, setDateLimit] = useState({ from: 0, to: Date.now() })
|
||||||
@ -249,6 +247,8 @@ const TelemetryView = memo(() => {
|
|||||||
setEndDate(new Date(saubLast.date))
|
setEndDate(new Date(saubLast.date))
|
||||||
}, [archiveMode, saubLast])
|
}, [archiveMode, saubLast])
|
||||||
|
|
||||||
|
const filteredData = useMemo(() => cutData(dataSaub, domain.min, domain.max), [dataSaub, domain])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LoaderPortal show={showLoader} style={{ flexGrow: 1 }}>
|
<LoaderPortal show={showLoader} style={{ flexGrow: 1 }}>
|
||||||
<div className={'telemetry-view-page'}>
|
<div className={'telemetry-view-page'}>
|
||||||
@ -305,7 +305,7 @@ const TelemetryView = memo(() => {
|
|||||||
<D3MonitoringCharts
|
<D3MonitoringCharts
|
||||||
{...chartProps}
|
{...chartProps}
|
||||||
yDomain={domain}
|
yDomain={domain}
|
||||||
data={dataSaub}
|
data={filteredData}
|
||||||
methods={setChartMethods}
|
methods={setChartMethods}
|
||||||
datasetGroups={chartGroups}
|
datasetGroups={chartGroups}
|
||||||
onWheel={onWheel}
|
onWheel={onWheel}
|
||||||
|
Loading…
Reference in New Issue
Block a user