Skip to content

Commit 31abb5e

Browse files
support for ScheduleList
1 parent 9679f9b commit 31abb5e

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/components/EventsTab.jsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ const eventDefaults = {
99
func_act: '',
1010
tolerance: '1e-16'
1111
},
12+
'ScheduleList': {
13+
times_evt: '',
14+
func_act: '',
15+
tolerance: '1e-16'
16+
},
1217
'ZeroCrossingDown': {
1318
func_evt: '',
1419
func_act: '',
@@ -47,7 +52,8 @@ const EventsTab = ({ events, setEvents }) => {
4752

4853
const eventTypes = [
4954
'Condition',
50-
'Schedule',
55+
'Schedule',
56+
'ScheduleList',
5157
'ZeroCrossing',
5258
'ZeroCrossingUp',
5359
'ZeroCrossingDown'
@@ -75,13 +81,13 @@ const EventsTab = ({ events, setEvents }) => {
7581
// Validate required fields based on event type
7682

7783
// For Schedule, func_act is required
78-
if (currentEvent.type === 'Schedule' && !currentEvent.func_act) {
84+
if (['Schedule', 'ScheduleList'].includes(currentEvent.type) && !currentEvent.func_act) {
7985
alert('func_act is required for Schedule events');
8086
return;
8187
}
8288

8389
// For other event types, both func_evt and func_act are typically required
84-
if (currentEvent.type !== 'Schedule' && (!currentEvent.func_evt || !currentEvent.func_act)) {
90+
if (!['Schedule', 'ScheduleList'].includes(currentEvent.type) && (!currentEvent.func_evt || !currentEvent.func_act)) {
8591
alert('Both func_evt and func_act are required for this event type');
8692
return;
8793
}

src/python/pathsim_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"ZeroCrossingUp": pathsim.events.ZeroCrossingUp,
9494
"ZeroCrossing": pathsim.events.ZeroCrossing,
9595
"Schedule": pathsim.events.Schedule,
96+
"ScheduleList": pathsim.events.ScheduleList,
9697
"Condition": pathsim.events.Condition,
9798
}
9899

0 commit comments

Comments
 (0)