import org.lsst.ccs.description.groovy.CCSBuilder;
import org.lsst.ccs.subsystem.demo.main.DemoSubsystemWithMonitoring;
import org.lsst.ccs.subsystem.demo.main.device.DemoDevice;
import org.lsst.ccs.monitor.Channel;
import org.lsst.ccs.monitor.Alarm;

CCSBuilder builder = ["demo-subsystem-with-monitoring"]

taskConfig = ["monitor-update/taskPeriodMillis":1234,"monitor-publish/taskPeriodMillis":2333, "update-component-state/taskPeriodMillis":-1, "update-limits/taskPeriodMillis":-1]

builder.main(DemoSubsystemWithMonitoring, nodeTags:taskConfig) {
    
    Alarm1  (Alarm, [description:"Trips off all power", lineName:null, eventParm:0])
        
    DemoDevice1  (DemoDevice, id:"1", meta:1) {
        for (int i = 0; i < 100; i++) {
    "DemoChannel$i"  (Channel, description:"channel number $i", format:"f", devcName:"DemoDevice1",
                hwChan:6, type:"VOLTS", subtype:"10V", checkLo:"flag",
                limitLo:-10.0, alarmLo:null, checkHi:"alarm", limitHi:10.0, alarmHi:"Alarm1")
        }
    }
}
