system.user.getSchedules
This feature is new in Ignition version 7.8.0
Description
Returns a sequence of all of the schedules available.
Syntax
-
Parameters
none
-
Returns
List - A list of schedule names. Schedules can be a Basic Schedule, Composite Schedule (composed of exactly two other schedules), or another type registered by a module.
-
Scope
All
Code Examples
Code Snippet
# This example will print a list of all available schedules:
# This function handles recursive printing of the different schedule types. Modules can register more types than listed here.
def
printScheduleInfo(aSchedule):
if
aSchedule.getType()
=
=
"basic schedule"
:
print
"Basic schedule type: "
,aSchedule.getName(), aSchedule.getDescription(), aSchedule.isAllDays(), aSchedule.getAllDayTime()
elif
aSchedule.getType()
=
=
"composite schedule"
:
compositePieces
=
aSchedule.getModels()
print
"Composite schedule type:"
,aSchedule.getName(), aSchedule.getDescription(),
" which is made up of..."
for
piece
in
compositePieces:
printScheduleInfo(piece)
else
:
print
"Other schedule type: "
, aSchedule.getName(), aSchedule.getDescription(), aSchedule.getType(), aSchedule.isObserveHolidays()
# The main function
schedules
=
system.user.getSchedules()
for
schedule
in
schedules:
printScheduleInfo(schedule)
Output
Basic schedule type: A None True 0:00-24:00
Basic schedule type: Always Built-in schedule that is always available: 24x7x365 True 0:00-24:00
Basic schedule type: B None True 0:00-24:00
Basic schedule type: C None True 0:00-24:00
Basic schedule type: Example An example of a M-F 8am-5pm schedule with a lunch break False 0:00-24:00
Composite schedule type: MyComposite a composite schedule which is made up of...
Basic schedule type: A None True 0:00-24:00
Basic schedule type: B None True 0:00-24:00
Basic schedule type: MySchedule A description False 0:00-24:00