Hi All,
I’m working on bulk-configuring alarms for a group of tags. I noticed that if I run configuration on an alarm that doesn’t exist, it creates an alarm with the specified property. So, I ran the following script, hoping to create a bunch of alarms on a group of tags…
def makeTemperatureAlarms():
#This function makes all the temperature alarms
#this will hold our tag paths
paths = []
#grab the bottom platen tags
tags = system.tag.browseTagsSimple("[default]_TMMTags_/M0_Bottom/Ints","ASC")
for tag in tags:
if (tag.name[:4] == "PLTN") & (tag.name[-2:] == "FB"):
paths.append(tag.fullPath)
#grab the top platen tags
tags = system.tag.browseTagsSimple("[default]_TMMTags_/M0_Top/Ints","ASC")
for tag in tags:
if (tag.name[:4] == "PLTN") & (tag.name[-2:] == "FB"):
paths.append(tag.fullPath)
#this will hold all the changes we're making to the alarms.
alarmConfig = {
"Hi Alarm":[["name", "Value","Hi Temp"],["Mode", "Value", "Above Setpoint"],["Label","Value","Hi Temp Alarm"]],
"HiHi Alarm":[["name", "Value","HiHi Temp"],["Mode", "Value", "Above Setpoint"],["Label","Value","HiHi Temp Alarm"]],
"Lo Alarm":[["name", "Value","Lo Temp"],["Mode", "Value", "Below Setpoint"],["Label","Value","Lo Temp Alarm"]],
"LoLo Alarm":[["name", "Value","LoLo Temp"],["mode", "Value", "Below Setpoint"],["label","Value","LoLo Temp Alarm"]],
}
system.tag.editAlarmConfig(paths,alarmConfig)
And it broke my tags, so now I get the following error whenever I try to open the properties for any tag, not just the ones affected by the script.
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: class java.lang.String cannot be cast to class com.inductiveautomation.ignition.common.alarming.config.AlarmMode (java.lang.String is in module java.base of loader 'bootstrap'; com.inductiveautomation.ignition.common.alarming.config.AlarmMode is in unnamed module of loader java.net.URLClassLoader @54c0da92)
at com.inductiveautomation.ignition.designer.tags.editing.propeditors.alarms.AlarmListPanel$AlarmRenderer.getListCellRendererComponent(AlarmListPanel.java:325)
at java.desktop/javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
at java.desktop/javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
at java.desktop/javax.swing.plaf.basic.BasicListUI.getPreferredSize(Unknown Source)
at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
at java.desktop/javax.swing.JList.getPreferredScrollableViewportSize(Unknown Source)
at java.desktop/javax.swing.ViewportLayout.preferredLayoutSize(Unknown Source)
at java.desktop/java.awt.Container.preferredSize(Unknown Source)
at java.desktop/java.awt.Container.getPreferredSize(Unknown Source)
at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
at java.desktop/javax.swing.ScrollPaneLayout.preferredLayoutSize(Unknown Source)
at java.desktop/java.awt.Container.preferredSize(Unknown Source)
at java.desktop/java.awt.Container.getPreferredSize(Unknown Source)
at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
at java.desktop/java.awt.BorderLayout.preferredLayoutSize(Unknown Source)
at java.desktop/java.awt.Container.preferredSize(Unknown Source)
at java.desktop/java.awt.Container.getPreferredSize(Unknown Source)
at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
at java.desktop/java.awt.BorderLayout.preferredLayoutSize(Unknown Source)
at java.desktop/java.awt.Container.preferredSize(Unknown Source)
at java.desktop/java.awt.Container.getPreferredSize(Unknown Source)
at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
at java.desktop/javax.swing.plaf.basic.BasicSplitPaneUI$BasicHorizontalLayoutManager.preferredLayoutSize(Unknown Source)
at java.desktop/javax.swing.plaf.basic.BasicSplitPaneUI.getPreferredSize(Unknown Source)
at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
at net.miginfocom.swing.SwingComponentWrapper.getMinimumWidth(Unknown Source)
at net.miginfocom.layout.Grid$CompWrap.getSize(Unknown Source)
at net.miginfocom.layout.Grid$CompWrap.<init>(Unknown Source)
at net.miginfocom.layout.Grid$CompWrap.<init>(Unknown Source)
at net.miginfocom.layout.Grid.<init>(Unknown Source)
at net.miginfocom.swing.MigLayout.checkCache(Unknown Source)
at net.miginfocom.swing.MigLayout.getSizeImpl(Unknown Source)
at net.miginfocom.swing.MigLayout.preferredLayoutSize(Unknown Source)
at java.desktop/java.awt.Container.preferredSize(Unknown Source)
at java.desktop/java.awt.Container.getPreferredSize(Unknown Source)
at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
at net.miginfocom.swing.SwingComponentWrapper.getMinimumWidth(Unknown Source)
at net.miginfocom.layout.Grid$CompWrap.getSize(Unknown Source)
at net.miginfocom.layout.Grid$CompWrap.<init>(Unknown Source)
at net.miginfocom.layout.Grid$CompWrap.<init>(Unknown Source)
at net.miginfocom.layout.Grid.<init>(Unknown Source)
at net.miginfocom.swing.MigLayout.checkCache(Unknown Source)
at net.miginfocom.swing.MigLayout.getSizeImpl(Unknown Source)
at net.miginfocom.swing.MigLayout.preferredLayoutSize(Unknown Source)
at java.desktop/java.awt.Container.preferredSize(Unknown Source)
at java.desktop/java.awt.Container.getPreferredSize(Unknown Source)
at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
at java.desktop/java.awt.BorderLayout.preferredLayoutSize(Unknown Source)
at java.desktop/java.awt.Container.preferredSize(Unknown Source)
at java.desktop/java.awt.Container.getPreferredSize(Unknown Source)
at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
at net.miginfocom.swing.SwingComponentWrapper.getMinimumWidth(Unknown Source)
at net.miginfocom.layout.Grid$CompWrap.getSize(Unknown Source)
at net.miginfocom.layout.Grid$CompWrap.<init>(Unknown Source)
at net.miginfocom.layout.Grid$CompWrap.<init>(Unknown Source)
at net.miginfocom.layout.Grid.<init>(Unknown Source)
at net.miginfocom.swing.MigLayout.checkCache(Unknown Source)
at net.miginfocom.swing.MigLayout.layoutContainer(Unknown Source)
at java.desktop/java.awt.Container.layout(Unknown Source)
at java.desktop/java.awt.Container.doLayout(Unknown Source)
at java.desktop/java.awt.Container.validateTree(Unknown Source)
at java.desktop/java.awt.Container.validateTree(Unknown Source)
at java.desktop/java.awt.Container.validateTree(Unknown Source)
at java.desktop/java.awt.Container.validateTree(Unknown Source)
at java.desktop/java.awt.Container.validateTree(Unknown Source)
at java.desktop/java.awt.Container.validateTree(Unknown Source)
at java.desktop/java.awt.Container.validateTree(Unknown Source)
at java.desktop/java.awt.Container.validateTree(Unknown Source)
at java.desktop/java.awt.Container.validate(Unknown Source)
at java.desktop/java.awt.Container.validateUnconditionally(Unknown Source)
at java.desktop/java.awt.Dialog.conditionalShow(Unknown Source)
at java.desktop/java.awt.Dialog.show(Unknown Source)
at com.jidesoft.dialog.StandardDialog.show(Unknown Source)
at java.desktop/java.awt.Component.show(Unknown Source)
at java.desktop/java.awt.Component.setVisible(Unknown Source)
at java.desktop/java.awt.Window.setVisible(Unknown Source)
at java.desktop/java.awt.Dialog.setVisible(Unknown Source)
at com.inductiveautomation.ignition.designer.tags.editing.dialog.TagEditorDialog.prepUI(TagEditorDialog.java:493)
at com.inductiveautomation.ignition.designer.tags.editing.dialog.TagEditorDialog.editTags(TagEditorDialog.java:566)
at com.inductiveautomation.ignition.designer.tags.tree.nodes.EditableProviderNode.editTags(EditableProviderNode.java:28)
at com.inductiveautomation.ignition.designer.tags.tree.TagBrowserPanel$DoubleClickEditListener.mousePressed(TagBrowserPanel.java:900)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.desktop/java.awt.Component.processEvent(Unknown Source)
at java.desktop/java.awt.Container.processEvent(Unknown Source)
at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Any help? How do I recover from this?
Thanks!