2026-04-24 FE Backup
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
def exportAlarms():
|
||||
state = ['ActiveUnacked']
|
||||
|
||||
alarms_list = system.alarm.queryStatus(state = state)
|
||||
# Define column headers for your dataset
|
||||
headers = ["Source", "Display Path", "Current State", "Priority"]
|
||||
|
||||
# Create a list of lists to hold the alarm data
|
||||
data = []
|
||||
for alarm in alarms_list:
|
||||
row = [
|
||||
alarm.getSource(),
|
||||
alarm.getDisplayPath(),
|
||||
alarm.getState(),
|
||||
alarm.getPriority(),
|
||||
]
|
||||
data.append(row)
|
||||
|
||||
alarms_dataset = system.dataset.toDataSet(headers, data)
|
||||
|
||||
filepath = system.dataset.exportCSV("data.csv", 1, alarms_dataset)
|
||||
|
||||
if fielPath != None:
|
||||
system.net.openURL("file:///"+filePath.replace('\\','/'))
|
||||
Reference in New Issue
Block a user