Search in sources :

Example 86 with DwrPermission

use of com.serotonin.m2m2.web.dwr.util.DwrPermission in project ma-core-public by infiniteautomation.

the class DataPointEditDwr method updateMultistateStateDetector.

@DwrPermission(user = true)
public void updateMultistateStateDetector(int pedId, String xid, String alias, int state, int duration, int durationType, int alarmLevel) {
    MultistateStateDetectorVO ped = (MultistateStateDetectorVO) getEventDetector(pedId);
    ped.setXid(xid);
    ped.setName(alias);
    ped.setState(state);
    ped.setDuration(duration);
    ped.setDurationType(durationType);
    ped.setAlarmLevel(alarmLevel);
}
Also used : MultistateStateDetectorVO(com.serotonin.m2m2.vo.event.detector.MultistateStateDetectorVO) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Example 87 with DwrPermission

use of com.serotonin.m2m2.web.dwr.util.DwrPermission in project ma-core-public by infiniteautomation.

the class DataPointEditDwr method updateAlphanumericStateDetector.

@DwrPermission(user = true)
public void updateAlphanumericStateDetector(int pedId, String xid, String alias, String state, int duration, int durationType, int alarmLevel) {
    AlphanumericStateDetectorVO ped = (AlphanumericStateDetectorVO) getEventDetector(pedId);
    ped.setXid(xid);
    ped.setName(alias);
    ped.setState(state);
    ped.setDuration(duration);
    ped.setDurationType(durationType);
    ped.setAlarmLevel(alarmLevel);
}
Also used : AlphanumericStateDetectorVO(com.serotonin.m2m2.vo.event.detector.AlphanumericStateDetectorVO) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Example 88 with DwrPermission

use of com.serotonin.m2m2.web.dwr.util.DwrPermission in project ma-core-public by infiniteautomation.

the class DataPointEditDwr method updateBinaryStateDetector.

@DwrPermission(user = true)
public void updateBinaryStateDetector(int pedId, String xid, String alias, boolean state, int duration, int durationType, int alarmLevel) {
    BinaryStateDetectorVO ped = (BinaryStateDetectorVO) getEventDetector(pedId);
    ped.setXid(xid);
    ped.setName(alias);
    ped.setState(state);
    ped.setDuration(duration);
    ped.setDurationType(durationType);
    ped.setAlarmLevel(alarmLevel);
}
Also used : BinaryStateDetectorVO(com.serotonin.m2m2.vo.event.detector.BinaryStateDetectorVO) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Example 89 with DwrPermission

use of com.serotonin.m2m2.web.dwr.util.DwrPermission in project ma-core-public by infiniteautomation.

the class DataPointEditDwr method updateNegativeCusumDetector.

@DwrPermission(user = true)
public void updateNegativeCusumDetector(int pedId, String xid, String alias, double limit, double weight, int duration, int durationType, int alarmLevel) {
    NegativeCusumDetectorVO ped = (NegativeCusumDetectorVO) getEventDetector(pedId);
    ped.setXid(xid);
    ped.setName(alias);
    ped.setLimit(limit);
    ped.setWeight(weight);
    ped.setDuration(duration);
    ped.setDurationType(durationType);
    ped.setAlarmLevel(alarmLevel);
}
Also used : NegativeCusumDetectorVO(com.serotonin.m2m2.vo.event.detector.NegativeCusumDetectorVO) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Example 90 with DwrPermission

use of com.serotonin.m2m2.web.dwr.util.DwrPermission in project ma-core-public by infiniteautomation.

the class DataSourceDwr method getCopy.

@DwrPermission(user = true)
@Override
public ProcessResult getCopy(int id) {
    // Get a Full Copy
    DataSourceVO<?> vo = dao.getFull(id);
    ProcessResult response = new ProcessResult();
    String name = StringUtils.abbreviate(TranslatableMessage.translate(getTranslations(), "common.copyPrefix", vo.getName()), 40);
    // Setup the Copy
    DataSourceVO<?> copy = vo.copy();
    copy.setId(Common.NEW_ID);
    copy.setName(name);
    copy.setXid(dao.generateUniqueXid());
    response.addData("vo", copy);
    return response;
}
Also used : ProcessResult(com.serotonin.m2m2.i18n.ProcessResult) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Aggregations

DwrPermission (com.serotonin.m2m2.web.dwr.util.DwrPermission)220 ProcessResult (com.serotonin.m2m2.i18n.ProcessResult)126 User (com.serotonin.m2m2.vo.User)56 DataPointVO (com.serotonin.m2m2.vo.DataPointVO)47 ArrayList (java.util.ArrayList)35 TranslatableMessage (com.serotonin.m2m2.i18n.TranslatableMessage)24 HashMap (java.util.HashMap)21 StringStringPair (com.serotonin.db.pair.StringStringPair)11 SystemSettingsDao (com.serotonin.m2m2.db.dao.SystemSettingsDao)11 DuplicateKeyException (org.springframework.dao.DuplicateKeyException)10 IOException (java.io.IOException)9 DateTime (org.joda.time.DateTime)9 DataIntegrityViolationException (org.springframework.dao.DataIntegrityViolationException)9 AbstractVO (com.serotonin.m2m2.vo.AbstractVO)8 AnonymousUser (com.serotonin.m2m2.vo.AnonymousUser)8 LinkedHashMap (java.util.LinkedHashMap)8 PointValueTime (com.serotonin.m2m2.rt.dataImage.PointValueTime)7 ShareUser (com.serotonin.m2m2.view.ShareUser)7 ResultsWithTotal (com.serotonin.m2m2.db.dao.ResultsWithTotal)6 ReportVO (com.serotonin.m2m2.reports.vo.ReportVO)6