From 01d444cb75e7f9011c8ea6b94fb77febaa038265 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Tue, 28 Apr 2026 10:01:10 -0400 Subject: [PATCH 1/6] make interpolation mode more clear --- i18n/english.yml | 4 ++-- lib/editor/components/pattern/NormalizeStopTimesModal.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/i18n/english.yml b/i18n/english.yml index b34b9e679..c94a7b3e0 100644 --- a/i18n/english.yml +++ b/i18n/english.yml @@ -804,7 +804,7 @@ components: substitutionInvalid: Some substitution patterns are invalid. NormalizeStopTimesModal: close: Close - interpolateStopTimes: Interpolate stop times between timepoints? + interpolateStopTimes: Assume timepoint travel times are since last timepoint? (Interpolate non-timepoint stops) normalizeStopTimes: Normalize stop times normalizeStopTimesQuestion: Normalize stop times? selectBeginningPatternStop: "Select beginning pattern stop:" @@ -820,7 +820,7 @@ components: based on the shape distance and the default travel times. This speed is then applied to the shape distance traveled for each intermediate non-timepoint stop to provide interpolated travel times. The default travel time for non-timepoint - stops will not be modified. + stops will not be modified. This feature assumes that the timepoint travel times refer to the time since the last timepoint! usageNotes: " Usage notes" NormalizeStopTimesTip: info: "Tip: when changing travel times, consider diff --git a/lib/editor/components/pattern/NormalizeStopTimesModal.js b/lib/editor/components/pattern/NormalizeStopTimesModal.js index cb274a735..8950fdb79 100644 --- a/lib/editor/components/pattern/NormalizeStopTimesModal.js +++ b/lib/editor/components/pattern/NormalizeStopTimesModal.js @@ -89,12 +89,13 @@ export default class NormalizeStopTimesModal extends Component { > {/* Separate label so that tooltip appears over checkbox. Hack: Padding to align center with checkbox */} - {this.messages('interpolateStopTimes')} +
From 4e0defa989be0ea550b7e485ec1d0d26de884c1e Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Wed, 6 May 2026 12:34:48 -0400 Subject: [PATCH 2/6] add ignore non-blank stoptimes mode --- lib/editor/actions/tripPattern.js | 4 ++-- .../pattern/NormalizeStopTimesModal.js | 20 ++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lib/editor/actions/tripPattern.js b/lib/editor/actions/tripPattern.js index fbafa8b6d..3ef3507f2 100644 --- a/lib/editor/actions/tripPattern.js +++ b/lib/editor/actions/tripPattern.js @@ -51,12 +51,12 @@ export type EditorTripPatternActions = ActionType | * provides a way to bulk update existing trips when pattern stops are modified * (e.g., a pattern stop is inserted, removed, or its travel times modified). */ -export function normalizeStopTimes (patternId: number, beginStopSequence: number, interpolateStopTimes: boolean) { +export function normalizeStopTimes (patternId: number, beginStopSequence: number, interpolateStopTimes: boolean, ignoreNonBlank: boolean) { return function (dispatch: dispatchFn, getState: getStateFn) { const {data} = getState().editor const {feedSourceId} = data.active const sessionId = data.lock.sessionId || '' - const url = `/api/editor/secure/pattern/${patternId}/stop_times?feedId=${feedSourceId || ''}&sessionId=${sessionId}&stopSequence=${beginStopSequence}&interpolateStopTimes=${interpolateStopTimes.toString()}` + const url = `/api/editor/secure/pattern/${patternId}/stop_times?feedId=${feedSourceId || ''}&sessionId=${sessionId}&stopSequence=${beginStopSequence}&interpolateStopTimes=${interpolateStopTimes.toString()}&ignoreNonBlankStopTimes=${ignoreNonBlank.toString()}` return dispatch(secureFetch(url, 'put')) .then(res => res.json()) .then(json => toast.info(`ⓘ ${json.updateResult}`, { diff --git a/lib/editor/components/pattern/NormalizeStopTimesModal.js b/lib/editor/components/pattern/NormalizeStopTimesModal.js index 8950fdb79..1d0f0a2cf 100644 --- a/lib/editor/components/pattern/NormalizeStopTimesModal.js +++ b/lib/editor/components/pattern/NormalizeStopTimesModal.js @@ -23,14 +23,16 @@ export default class NormalizeStopTimesModal extends Component { state = { interpolateStopTimes: false, + ignoreNonBlank: false, patternStopIndex: 0, // default to zeroth pattern stop show: false } _onClickNormalize = () => { const { activePattern, normalizeStopTimes } = this.props - normalizeStopTimes(activePattern.id, this.state.patternStopIndex, this.state.interpolateStopTimes) - this.setState({interpolateStopTimes: false}) + normalizeStopTimes(activePattern.id, this.state.patternStopIndex, this.state.interpolateStopTimes, this.state.ignoreNonBlank) + this.setState({interpolateStopTimes: false, ignoreNonBlank: false}) + this.props.onClose() } _onChangeStop = (evt: SyntheticInputEvent) => { @@ -38,7 +40,7 @@ export default class NormalizeStopTimesModal extends Component { } _onClose = () => { - this.setState({ show: false, interpolateStopTimes: false }) + this.setState({ show: false, interpolateStopTimes: false, ignoreNonBlank: false }) this.props.onClose() } @@ -46,6 +48,10 @@ export default class NormalizeStopTimesModal extends Component { this.setState({interpolateStopTimes: !this.state.interpolateStopTimes}) } + _onChangeNonBlank = () => { + this.setState({ignoreNonBlank: !this.state.ignoreNonBlank, interpolateStopTimes: false}) + } + render () { const { Body, Footer, Header, Title } = Modal const { activePattern, stops } = this.props @@ -97,6 +103,14 @@ export default class NormalizeStopTimesModal extends Component { {/* Separate label so that tooltip appears over checkbox. Hack: Padding to align center with checkbox */} +
+ + +

{this.state.patternStopIndex === 0 From 54e00e52a301a584ad94b45ebfa0d7bd1136cd21 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Wed, 6 May 2026 12:39:45 -0400 Subject: [PATCH 3/6] fix flow --- lib/editor/components/pattern/NormalizeStopTimesModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/editor/components/pattern/NormalizeStopTimesModal.js b/lib/editor/components/pattern/NormalizeStopTimesModal.js index 1d0f0a2cf..349efbd2e 100644 --- a/lib/editor/components/pattern/NormalizeStopTimesModal.js +++ b/lib/editor/components/pattern/NormalizeStopTimesModal.js @@ -16,7 +16,7 @@ type Props = { stops: Array } -type State = { interpolateStopTimes: boolean, patternStopIndex: number, show: boolean } +type State = { ignoreNonBlank: boolean, interpolateStopTimes: boolean, patternStopIndex: number, show: boolean } export default class NormalizeStopTimesModal extends Component { messages = getComponentMessages('NormalizeStopTimesModal') From e40b077f0190432bbf9aaa529ab9b35da6b06beb Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Thu, 7 May 2026 16:48:50 -0400 Subject: [PATCH 4/6] address pr feedback --- lib/editor/components/pattern/NormalizeStopTimesModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/editor/components/pattern/NormalizeStopTimesModal.js b/lib/editor/components/pattern/NormalizeStopTimesModal.js index 349efbd2e..f9ba257d2 100644 --- a/lib/editor/components/pattern/NormalizeStopTimesModal.js +++ b/lib/editor/components/pattern/NormalizeStopTimesModal.js @@ -22,8 +22,8 @@ export default class NormalizeStopTimesModal extends Component { messages = getComponentMessages('NormalizeStopTimesModal') state = { - interpolateStopTimes: false, ignoreNonBlank: false, + interpolateStopTimes: false, patternStopIndex: 0, // default to zeroth pattern stop show: false } From c252f5ca5185bbeb56bd0d7f928f12e9744d2dc9 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Thu, 14 May 2026 11:56:50 +0200 Subject: [PATCH 5/6] pr feedback first round --- i18n/english.yml | 7 ++++--- lib/editor/components/pattern/NormalizeStopTimesModal.js | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/i18n/english.yml b/i18n/english.yml index c94a7b3e0..f049bf7af 100644 --- a/i18n/english.yml +++ b/i18n/english.yml @@ -804,6 +804,7 @@ components: substitutionInvalid: Some substitution patterns are invalid. NormalizeStopTimesModal: close: Close + ignoreNonBlank: Only update blank stop times interpolateStopTimes: Assume timepoint travel times are since last timepoint? (Interpolate non-timepoint stops) normalizeStopTimes: Normalize stop times normalizeStopTimesQuestion: Normalize stop times? @@ -817,10 +818,10 @@ components: you can normalize the stop times to bring them into alignment with the updated travel times reflected in the pattern stops. usageExplanationTwo: Interpolating stop times calculates the implicit speed between timepoints - based on the shape distance and the default travel times. This speed is + based on the shape distance and the default travel times of timepoints. This speed is then applied to the shape distance traveled for each intermediate non-timepoint - stop to provide interpolated travel times. The default travel time for non-timepoint - stops will not be modified. This feature assumes that the timepoint travel times refer to the time since the last timepoint! + stop to provide interpolated stop times. + This feature assumes that the timepoint travel times refer to the time since the last timepoint! usageNotes: " Usage notes" NormalizeStopTimesTip: info: "Tip: when changing travel times, consider diff --git a/lib/editor/components/pattern/NormalizeStopTimesModal.js b/lib/editor/components/pattern/NormalizeStopTimesModal.js index f9ba257d2..22357e43e 100644 --- a/lib/editor/components/pattern/NormalizeStopTimesModal.js +++ b/lib/editor/components/pattern/NormalizeStopTimesModal.js @@ -109,10 +109,10 @@ export default class NormalizeStopTimesModal extends Component { onChange={this._onChangeNonBlank} value={this.state.ignoreNonBlank} /> - +
- + {!this.state.ignoreNonBlank && {this.state.patternStopIndex === 0 // TODO: figure out how yml messages with html tags can be rendered // correctly. @@ -126,7 +126,7 @@ export default class NormalizeStopTimesModal extends Component { prior will be unmodified). } - + }
{this.messages('usageNotes')}
From 91f8556c31465cdcb7d9cc4375ec9154d7618580 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Wed, 27 May 2026 13:09:39 +0200 Subject: [PATCH 6/6] address pr feedback --- docs/user/editor/patterns.md | 9 +++++++++ i18n/english.yml | 6 +++--- i18n/german.yml | 1 + i18n/polish.yml | 1 + lib/editor/components/pattern/NormalizeStopTimesModal.js | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/user/editor/patterns.md b/docs/user/editor/patterns.md index 401d595ca..8db1d82a4 100644 --- a/docs/user/editor/patterns.md +++ b/docs/user/editor/patterns.md @@ -84,6 +84,13 @@ Once you have adjusted the stop timings, another warning will appear prompting y ![normalize pattern stops](../../img/normalize-stop-times.png) +#### Interpolation +Datatools features two interpolation modes. + +"Interpolate stop times between timepoints" ignores all non-timepoint pattern info. The timepoint timings are assumed to be in realation *to the previous timepoint*. + +"Only update blank stop times" only updates blank stop times. Datatools will use shape data and non-blank stop times to calculate likely stoptimes. Stop times with values will be ignored. + ### Calculate timings The average speed for the route can be used to calculate all the time gaps between stops in one go. A few parameters can be specified before calculating times: @@ -101,6 +108,8 @@ Specific timings for each pattern stop can be set by either clicking on the stop - **Travel time:** the time it took to get from the previous station (should be 00:00 on the first stop of the sequence) - **Dwell time:** the time the vehicle rests at the stop +###### When using timepoint interpolation, these timings are assumed to be in relation to the previous timepoint. Otherwise, they are assumed to be in relation to the previous stop. + ### Tutorial Video: Editing/Creating Patterns The following video demonstrates how to create patterns as outlined above, in a step by step manner.