Search in sources :

Example 81 with DwrPermission

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

the class DataPointEditDwr method updateStateChangeCountDetector.

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

Example 82 with DwrPermission

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

the class DataPointEditDwr method updateAlphanumericRegexStateDetector.

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

Example 83 with DwrPermission

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

the class DataPointEditDwr method purgeNow.

// 
// Data purge
// 
@DwrPermission(user = true)
public long purgeNow(int purgeType, int purgePeriod, boolean allData) {
    DataPointVO point = getDataPoint();
    Long count;
    if (allData)
        count = Common.runtimeManager.purgeDataPointValues(point.getId());
    else
        count = Common.runtimeManager.purgeDataPointValues(point.getId(), purgeType, purgePeriod);
    return count;
}
Also used : DataPointVO(com.serotonin.m2m2.vo.DataPointVO) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Example 84 with DwrPermission

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

the class DataPointEditDwr method ensureEditingPointMatch.

@DwrPermission(user = true)
public ProcessResult ensureEditingPointMatch(int uiPointId) {
    ProcessResult result = new ProcessResult();
    User user = Common.getHttpUser();
    DataPointVO dataPoint = user.getEditPoint();
    if (dataPoint.getId() == uiPointId) {
        result.addData("match", true);
    } else {
        result.addData("message", Common.translate("pointEdit.error.uiPointMismatch"));
        result.addData("match", false);
    }
    return result;
}
Also used : DataPointVO(com.serotonin.m2m2.vo.DataPointVO) User(com.serotonin.m2m2.vo.User) ProcessResult(com.serotonin.m2m2.i18n.ProcessResult) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Example 85 with DwrPermission

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

the class DataPointEditDwr method updateNoChangeDetector.

@DwrPermission(user = true)
public void updateNoChangeDetector(int pedId, String xid, String alias, int duration, int durationType, int alarmLevel) {
    NoChangeDetectorVO ped = (NoChangeDetectorVO) getEventDetector(pedId);
    ped.setXid(xid);
    ped.setName(alias);
    ped.setDuration(duration);
    ped.setDurationType(durationType);
    ped.setAlarmLevel(alarmLevel);
}
Also used : NoChangeDetectorVO(com.serotonin.m2m2.vo.event.detector.NoChangeDetectorVO) 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