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
|
||||
}
|
||||
|
||||
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 (loadingEndDate <= loaded.end) loadingEndDate = loaded.start
|
||||
newLoaded.start = Math.min(loaded.start, loadingStartDate)
|
||||
|
@ -72,8 +72,6 @@ const makeSubjectSubsription = (subject$, handler) => {
|
||||
return () => subscribtion.unsubscribe()
|
||||
}
|
||||
|
||||
const getRowDate = (row) => (row && isRawDate(row.date)) ? +new Date(row.date) : null
|
||||
|
||||
const TelemetryView = memo(() => {
|
||||
const [well, updateWell] = useWell()
|
||||
const [searchParams, setSearchParams] = useSearchParams()
|
||||
@ -85,7 +83,7 @@ const TelemetryView = memo(() => {
|
||||
const [rop, setRop] = useState(null)
|
||||
const [chartMethods, setChartMethods] = useState()
|
||||
|
||||
const [loadedDataRange, setLoadedDataRange] = useState({})
|
||||
const [loadedDataRange, setLoadedDataRange] = useState(null)
|
||||
const [chartInterval, setChartInterval] = useState(defaultPeriod * 1000)
|
||||
const [endDate, setEndDate] = useState(defaultDate)
|
||||
const [dateLimit, setDateLimit] = useState({ from: 0, to: Date.now() })
|
||||
@ -249,6 +247,8 @@ const TelemetryView = memo(() => {
|
||||
setEndDate(new Date(saubLast.date))
|
||||
}, [archiveMode, saubLast])
|
||||
|
||||
const filteredData = useMemo(() => cutData(dataSaub, domain.min, domain.max), [dataSaub, domain])
|
||||
|
||||
return (
|
||||
<LoaderPortal show={showLoader} style={{ flexGrow: 1 }}>
|
||||
<div className={'telemetry-view-page'}>
|
||||
@ -305,7 +305,7 @@ const TelemetryView = memo(() => {
|
||||
<D3MonitoringCharts
|
||||
{...chartProps}
|
||||
yDomain={domain}
|
||||
data={dataSaub}
|
||||
data={filteredData}
|
||||
methods={setChartMethods}
|
||||
datasetGroups={chartGroups}
|
||||
onWheel={onWheel}
|
||||
|
Loading…
Reference in New Issue
Block a user