use of us.mn.state.dot.tms.AlertPeriod in project iris by mnit-rtmc.
the class AlertMessageModel method createColumns.
/**
* Create the columns in the model
*/
@Override
protected ArrayList<ProxyColumn<AlertMessage>> createColumns() {
ArrayList<ProxyColumn<AlertMessage>> cols = new ArrayList<ProxyColumn<AlertMessage>>(2);
cols.add(new ProxyColumn<AlertMessage>("alert.period", 100) {
public Object getValueAt(AlertMessage am) {
return AlertPeriod.fromOrdinal(am.getAlertPeriod());
}
public boolean isEditable(AlertMessage am) {
return canWrite(am);
}
public void setValueAt(AlertMessage am, Object value) {
if (value instanceof AlertPeriod) {
AlertPeriod ap = (AlertPeriod) value;
am.setAlertPeriod(ap.ordinal());
}
}
protected TableCellEditor createCellEditor() {
return new DefaultCellEditor(new JComboBox<AlertPeriod>(AlertPeriod.VALUES));
}
});
cols.add(new ProxyColumn<AlertMessage>("alert.quick.message", 120) {
public Object getValueAt(AlertMessage am) {
return am.getQuickMessage();
}
public boolean isEditable(AlertMessage am) {
return canWrite(am);
}
public void setValueAt(AlertMessage am, Object value) {
am.setQuickMessage(lookupQuickMessage(value));
}
});
return cols;
}
use of us.mn.state.dot.tms.AlertPeriod in project iris by mnit-rtmc.
the class AlertData method createDmsActions.
/**
* Create DMS actions
*/
private void createDmsActions(AlertConfig cfg, ActionPlanImpl plan, AlertMessage msg, SignGroup grp) throws SonarException {
AlertPeriod ap = AlertPeriod.fromOrdinal(msg.getAlertPeriod());
QuickMessage qm = msg.getQuickMessage();
if (ap == null || qm == null) {
log("invalid alert message: " + msg);
return;
}
switch(ap) {
case BEFORE:
if (cfg.getBeforePeriodHours() > 0)
createDmsAction(plan, grp, "alert_before", qm);
break;
case DURING:
createDmsAction(plan, grp, "alert_during", qm);
break;
case AFTER:
if (cfg.getAfterPeriodHours() > 0)
createDmsAction(plan, grp, "alert_after", qm);
break;
}
}
Aggregations