let buttons = [];
let GroupID = 0;
let SelectedGroupID = 0;

let counterGr = [0,0,0,0,0,0,0,0,0,0,0];

class CodeModuleClass {

	constructor(buttons) {
	    this.buttons = buttons;

	}

	init(mainViewModel) {
		this.mainViewModel = mainViewModel;

        buttons[0] = document.getElementById("lvd8b78334b2da14398ae599af1e9500492");
        buttons[1] = document.getElementById("lvdc1ac050991314a03902d7fd78bf29cd7");
        buttons[2] = document.getElementById("lvd6623901074e24b7885418c74b33ac5e0");
        buttons[3] = document.getElementById("lvd76fd4228ceb54c56a96cfa37adab778f");
        buttons[4] = document.getElementById("lvd7c33eb088de440b18e9b65b229c05cda");
        buttons[5] = document.getElementById("lvd3e5c6400d7dc436282426c02ef07038b");
        buttons[6] = document.getElementById("lvd2802955611c242b1a4149cbe6359520f");

        buttons[7] = document.getElementById("lvd395ce8bdeb6b4fa48de610dc1f8c6bf3");
        buttons[8] = document.getElementById("lvd557b0de6834b40f1a8af115893bd9167");
        buttons[9] = document.getElementById("lvdf7f38a10992a4b5fa0d993a788a0af48");
        buttons[10] = document.getElementById("lvd4a2a8bf6d23e4f12bd3b2b3078306c15");
        buttons[11] = document.getElementById("lvd5461b9c639524aca94f25553d53a2a75");
        buttons[12] = document.getElementById("lvd13d9a0c8150844cc8fb88509ee972e55");

        buttons[13] = document.getElementById("lvd52e58a8aa41f45feaab1689d8fb4f4a0");
        buttons[14] = document.getElementById("lvd0880d0f09eb54380a9145b7c62a4ac7b");
        buttons[15] = document.getElementById("lvd378a05de1717468789668ea080d98106");
        buttons[16] = document.getElementById("lvd7dadb064c11e4c4c8aaa333fc100158a");
        buttons[17] = document.getElementById("lvdb835488fa77a47a28e6d97937c4d1639");
        buttons[18] = document.getElementById("lvd011b91789cb546a08166c9f16519eed6");

        buttons[19] = document.getElementById("lvdd1355787223d4514add8e24c14170de3");
        buttons[20] = document.getElementById("lvd5069c724a9c14f589be285ddfb953b39");
        buttons[21] = document.getElementById("lvdfd3db6181d1c44cbb285c705e1f72e76");
        buttons[22] = document.getElementById("lvdda079ef8ac564c84812aacb2007b1304");
        buttons[23] = document.getElementById("lvdecd1f012b9fa4e65b6c1c05123fcc3c5");

        DatapointManagerGroupID.initDemoDatapointManager(buttons);

        this.initialized = true;
     }

cleanUp(mainViewModel) {
// Add your own cleanUp code

this.initialized = false;
}

onActiveChanged(active) {
// Add your own active state handling code
this.active = active;
}

static create(buttons) {
return new CodeModuleClass(buttons);
}

}

class DatapointManagerGroupID {

    static initDemoDatapointManager(buttons) {
        if (window.sigApi !== undefined) {
            const fm = new DatapointManagerGroupID(window.sigApi, buttons);
        } else {
        // ist sigApi noch nicht geladen, als EventListener fuer 'SigApiReady' registrieren
        window.addEventListener('SigApiReady', () => {
        const fm = new DatapointManagerGroupID(window.sigApi, buttons);
            });
                }
    }

constructor(api, buttons) {
this.events = null;
this.eventMediator = null;
this.datapointAPI = null;
this._initAPIs(api);

this. buttons =  buttons;

this._registerEvents(buttons);

}

//##################################################################################################
// Alle benoetigten APIs zuweisen
//##################################################################################################
_initAPIs(api) {
if ((api !== null) && (api !== undefined)) {
if (api.datapointManager !== undefined) {
 this.datapointAPI = api.datapointManager;
}
if (api.eventMediator !== undefined) {
 this.eventMediator = api.eventMediator;
}
if (api.events !== undefined) {
 this.events = api.events;
}
}
}

        _registerEvents(buttons) {

                let key = 0;
                let Button1 = 0;
                let Button2 = 0;
                let MultipleSelectionOn = 0;
                let RampOn;

                        for (let index = 0; index < buttons.length; index++) {
                            buttons[index].addEventListener("mouseover", () => {

                                this.datapointAPI.readDataPoint('10:Global_Set1.MultipleSelectionOfZones', 0)
                                    .then((resolve) => {
                                        MultipleSelectionOn = resolve.value;
                                        if (MultipleSelectionOn === 2) {


                                            this.datapointAPI.readDataPoint('10:SelectedGroup1.GroupID', 0)
                                                .then((resolve) => {
                                                    SelectedGroupID = resolve.value;

                                                    this.switchFunktion(index,RampOn);
                                                })
                                        }
                                    })

                            });
                        }


                        for (let index = 0; index < buttons.length; index++) {
                            buttons[index].addEventListener("click", () => {

                                this.datapointAPI.readDataPoint('10:Global_Set1.MultipleSelectionOfZones', 0)
                                    .then((resolve) => {
                                        MultipleSelectionOn = resolve.value;
                                        this.datapointAPI.readDataPoint('10:Global_Set1.GlobalRamp', 0)
                                            .then((resolve) => {
                                                RampOn = resolve.value;




                                    if (MultipleSelectionOn === 1) {

                                        key++;

                                        if (key === 1) {
                                            Button1 = index;
                                            buttons[index].style.border = "medium solid #0000FF";

                                            this.datapointAPI.readDataPoint('10:SelectedGroup1.GroupID', 0)
                                                .then((resolve) => {
                                                    SelectedGroupID = resolve.value;
                                                    this.switchFunktion(Button1,RampOn);
                                                })
                                        }

                                        if (key === 2) {
                                            Button2 = index;

                                            buttons[Button1].style.border = "";

                                            key = 0;

                                        /*    this.datapointAPI.readDataPoint('10:SelectedGroup1.GroupID', 0)
                                                .then((resolve) => {
                                                    SelectedGroupID = resolve.value;*/

                                                    if (Button1 < Button2) {
                                                        for (let ind = Button1+1; ind <= Button2; ind++) {
                                                            this.switchFunktion(ind,RampOn);
                                                        }
                                                    } else {
                                                        this.switchFunktion(Button2,RampOn);
                                                       // this.switchFunktion(Button1,RampOn);
                                                    }

                                                    // this.counter();

                                              //  })

                                        }
                                    } // END IF MULTIPLE SELECTION
                                    else if (MultipleSelectionOn === 0) {

                                        this.datapointAPI.readDataPoint('10:SelectedGroup1.GroupID', 0)
                                            .then((resolve) => {
                                                SelectedGroupID = resolve.value;
                                                this.switchFunktion(index,RampOn);

                                            })

                                    }  // END ELSE MULTIPLE SELECTION

                                    });});



                                }
                            );

                        } // END FOR






                this.eventMediator.subscribe(this.events.getUserDefinedInternalEvent('DeleteGroup'), () => {

                    this.datapointAPI.readDataPoint('10:SelectedGroup1.GroupID', 0)
                        .then((resolve) => {
                            SelectedGroupID = resolve.value;

                            for (let index = 0; index < buttons.length; index++) {
                                this.switchFunktionDelete(index,RampOn);

                            } // END FOR

                            // entsprechende Gruppe auf OFF setzen:

                            switch (SelectedGroupID) {
                                case 1:  // this.datapointAPI.writeDataPoint('10:HelperClass1.GroupOn', 0);
                                          this.datapointAPI.writeDataPoint('10:PIDGroup1.GroupName', '-');
                                          this.datapointAPI.writeDataPoint('10:PIDGroup1.GroupColorScheme', 2661195519);
                                          this.datapointAPI.writeDataPoint('10:SetPointManager1.GroupID_Backup', 0);
                                          counterGr[0]=0;
                                          break;

                                case 2: // this.datapointAPI.writeDataPoint('10:HelperClass2.GroupOn', 0);
                                          this.datapointAPI.writeDataPoint('10:PIDGroup2.GroupName', '-');
                                          this.datapointAPI.writeDataPoint('10:PIDGroup2.GroupColorScheme', 2661195519);
                                          this.datapointAPI.writeDataPoint('10:SetPointManager2.GroupID_Backup', 0);
                                          counterGr[1]=0;
                                          break;

                                case 3:  // this.datapointAPI.writeDataPoint('10:HelperClass3.GroupOn', 0);
                                          this.datapointAPI.writeDataPoint('10:PIDGroup3.GroupName', '-');
                                          this.datapointAPI.writeDataPoint('10:PIDGroup3.GroupColorScheme', 2661195519);
                                          this.datapointAPI.writeDataPoint('10:SetPointManager3.GroupID_Backup', 0);
                                          counterGr[2]=0;
                                          break;

                                case 4: //  this.datapointAPI.writeDataPoint('10:HelperClass4.GroupOn', 0);
                                          this.datapointAPI.writeDataPoint('10:PIDGroup4.GroupName', '-');
                                          this.datapointAPI.writeDataPoint('10:PIDGroup4.GroupColorScheme', 2661195519);
                                          this.datapointAPI.writeDataPoint('10:SetPointManager4.GroupID_Backup', 0);
                                          counterGr[3]=0;
                                          break;

                                case 5: //  this.datapointAPI.writeDataPoint('10:HelperClass5.GroupOn', 0);
                                          this.datapointAPI.writeDataPoint('10:PIDGroup5.GroupName', '-');
                                          this.datapointAPI.writeDataPoint('10:PIDGroup5.GroupColorScheme', 2661195519);
                                          this.datapointAPI.writeDataPoint('10:SetPointManager5.GroupID_Backup', 0);
                                          counterGr[4]=0;
                                          break;

                                case 6: //  this.datapointAPI.writeDataPoint('10:HelperClass6.GroupOn', 0);
                                          this.datapointAPI.writeDataPoint('10:PIDGroup6.GroupName', '-');
                                          this.datapointAPI.writeDataPoint('10:PIDGroup6.GroupColorScheme', 2661195519);
                                          this.datapointAPI.writeDataPoint('10:SetPointManager6.GroupID_Backup', 0);
                                          counterGr[5]=0;
                                          break;

                                case 7:  // this.datapointAPI.writeDataPoint('10:HelperClass7.GroupOn', 0);
                                          this.datapointAPI.writeDataPoint('10:PIDGroup7.GroupName', '-');
                                          this.datapointAPI.writeDataPoint('10:PIDGroup7.GroupColorScheme', 2661195519);
                                          this.datapointAPI.writeDataPoint('10:SetPointManager7.GroupID_Backup', 0);
                                          counterGr[6]=0;
                                          break;

                                case 8:  // this.datapointAPI.writeDataPoint('10:HelperClass8.GroupOn', 0);
                                          this.datapointAPI.writeDataPoint('10:PIDGroup8.GroupName', '-');
                                          this.datapointAPI.writeDataPoint('10:PIDGroup8.GroupColorScheme', 2661195519);
                                          this.datapointAPI.writeDataPoint('10:SetPointManager8.GroupID_Backup', 0);
                                          counterGr[7]=0;
                                          break;

                                case 9:  // this.datapointAPI.writeDataPoint('10:HelperClass9.GroupOn', 0);
                                          this.datapointAPI.writeDataPoint('10:PIDGroup9.GroupName', '-');
                                          this.datapointAPI.writeDataPoint('10:PIDGroup9.GroupColorScheme', 2661195519);
                                          this.datapointAPI.writeDataPoint('10:SetPointManager9.GroupID_Backup', 0);
                                          counterGr[8]=0;
                                          break;

                                case 10: // this.datapointAPI.writeDataPoint('10:HelperClass10.GroupOn', 0);
                                          this.datapointAPI.writeDataPoint('10:PIDGroup10.GroupName', '-');
                                          this.datapointAPI.writeDataPoint('10:PIDGroup10.GroupColorScheme', 2661195519);
                                          this.datapointAPI.writeDataPoint('10:SetPointManager10.GroupID_Backup', 0);
                                          counterGr[9]=0;
                                          break;
                            }

                        })


                });
    }

            selectZone(ZoneName) {
                    this.datapointAPI.readDataPoint(ZoneName, 0)
                    .then((resolve) => {
                        GroupID = resolve.value;
                        if (GroupID !== SelectedGroupID) {

                            this.datapointAPI.writeDataPoint(ZoneName, SelectedGroupID)
                                .then(() => {
                                    counterGr[SelectedGroupID-1] = counterGr[SelectedGroupID-1]+1;
                                });

                        } else {
                            this.datapointAPI.writeDataPoint(ZoneName, 0)
                                .then(() => {
                                    counterGr[SelectedGroupID-1] = counterGr[SelectedGroupID-1]-1;
                                });
                        }
                    });
            }

            switchFunktion(index,RampOn){

        if (RampOn === 0){

            switch (index) {
                /*case 0:  this.selectZone('10:Zone1.GroupID'); break;
                case 1:  this.selectZone('10:Zone2.GroupID'); break;
                case 2:  this.selectZone('10:Zone3.GroupID'); break;
                case 3:  this.selectZone('10:Zone4.GroupID'); break;
                case 4:  this.selectZone('10:Zone5.GroupID'); break;
                case 5:  this.selectZone('10:Zone6.GroupID'); break;
                case 6:  this.selectZone('10:Zone7.GroupID'); break;
                case 7:  this.selectZone('10:Zone8.GroupID'); break;
                case 8:  this.selectZone('10:Zone9.GroupID'); break;
                case 9:  this.selectZone('10:Zone10.GroupID'); break;
                case 10: this.selectZone('10:Zone11.GroupID'); break;
                case 11: this.selectZone('10:Zone12.GroupID'); break;
                case 12: this.selectZone('10:Zone13.GroupID'); break;
                case 13: this.selectZone('10:Zone14.GroupID'); break;
                case 14: this.selectZone('10:Zone15.GroupID'); break;
                case 15: this.selectZone('10:Zone16.GroupID'); break;
                case 16: this.selectZone('10:Zone17.GroupID'); break;
                case 17: this.selectZone('10:Zone18.GroupID'); break;
                case 18: this.selectZone('10:Zone19.GroupID'); break;
                case 19: this.selectZone('10:Zone20.GroupID'); break;
                case 20: this.selectZone('10:Zone21.GroupID'); break;
                case 21: this.selectZone('10:Zone22.GroupID'); break;
                case 22: this.selectZone('10:Zone23.GroupID'); break;
                case 23: this.selectZone('10:Zone24.GroupID'); break;*/
                case 0:  this.selectZone('10:SetPointManager1.GroupID_LVD'); break;
                case 1:  this.selectZone('10:SetPointManager2.GroupID_LVD'); break;
                case 2:  this.selectZone('10:SetPointManager3.GroupID_LVD'); break;
                case 3:  this.selectZone('10:SetPointManager4.GroupID_LVD'); break;
                case 4:  this.selectZone('10:SetPointManager5.GroupID_LVD'); break;
                case 5:  this.selectZone('10:SetPointManager6.GroupID_LVD'); break;
                case 6:  this.selectZone('10:SetPointManager7.GroupID_LVD'); break;
                case 7:  this.selectZone('10:SetPointManager8.GroupID_LVD'); break;
                case 8:  this.selectZone('10:SetPointManager9.GroupID_LVD'); break;
                case 9:  this.selectZone('10:SetPointManager10.GroupID_LVD'); break;
                case 10: this.selectZone('10:SetPointManager11.GroupID_LVD'); break;
                case 11: this.selectZone('10:SetPointManager12.GroupID_LVD'); break;
                case 12: this.selectZone('10:SetPointManager13.GroupID_LVD'); break;
                case 13: this.selectZone('10:SetPointManager14.GroupID_LVD'); break;
                case 14: this.selectZone('10:SetPointManager15.GroupID_LVD'); break;
                case 15: this.selectZone('10:SetPointManager16.GroupID_LVD'); break;
                case 16: this.selectZone('10:SetPointManager17.GroupID_LVD'); break;
                case 17: this.selectZone('10:SetPointManager18.GroupID_LVD'); break;
                case 18: this.selectZone('10:SetPointManager19.GroupID_LVD'); break;
                case 19: this.selectZone('10:SetPointManager20.GroupID_LVD'); break;
                case 20: this.selectZone('10:SetPointManager21.GroupID_LVD'); break;
                case 21: this.selectZone('10:SetPointManager22.GroupID_LVD'); break;
                case 22: this.selectZone('10:SetPointManager23.GroupID_LVD'); break;
                case 23: this.selectZone('10:SetPointManager24.GroupID_LVD'); break;
            }

        }
        else{
                switch (index) {
                    case 0:  this.selectZone('10:SetPointManager1.GroupID_LVD'); break;
                    case 1:  this.selectZone('10:SetPointManager2.GroupID_LVD'); break;
                    case 2:  this.selectZone('10:SetPointManager3.GroupID_LVD'); break;
                    case 3:  this.selectZone('10:SetPointManager4.GroupID_LVD'); break;
                    case 4:  this.selectZone('10:SetPointManager5.GroupID_LVD'); break;
                    case 5:  this.selectZone('10:SetPointManager6.GroupID_LVD'); break;
                    case 6:  this.selectZone('10:SetPointManager7.GroupID_LVD'); break;
                    case 7:  this.selectZone('10:SetPointManager8.GroupID_LVD'); break;
                    case 8:  this.selectZone('10:SetPointManager9.GroupID_LVD'); break;
                    case 9:  this.selectZone('10:SetPointManager10.GroupID_LVD'); break;
                    case 10: this.selectZone('10:SetPointManager11.GroupID_LVD'); break;
                    case 11: this.selectZone('10:SetPointManager12.GroupID_LVD'); break;
                    case 12: this.selectZone('10:SetPointManager13.GroupID_LVD'); break;
                    case 13: this.selectZone('10:SetPointManager14.GroupID_LVD'); break;
                    case 14: this.selectZone('10:SetPointManager15.GroupID_LVD'); break;
                    case 15: this.selectZone('10:SetPointManager16.GroupID_LVD'); break;
                    case 16: this.selectZone('10:SetPointManager17.GroupID_LVD'); break;
                    case 17: this.selectZone('10:SetPointManager18.GroupID_LVD'); break;
                    case 18: this.selectZone('10:SetPointManager19.GroupID_LVD'); break;
                    case 19: this.selectZone('10:SetPointManager20.GroupID_LVD'); break;
                    case 20: this.selectZone('10:SetPointManager21.GroupID_LVD'); break;
                    case 21: this.selectZone('10:SetPointManager22.GroupID_LVD'); break;
                    case 22: this.selectZone('10:SetPointManager23.GroupID_LVD'); break;
                    case 23: this.selectZone('10:SetPointManager24.GroupID_LVD'); break;
                }
            }
            }

    switchFunktionDelete(index,RampOn) {

        if (RampOn === 0){
            switch (index) {
              /*  case 0:
                    this.selectZoneDelete('10:Zone1.GroupID');
                    break;
                case 1:
                    this.selectZoneDelete('10:Zone2.GroupID');
                    break;
                case 2:
                    this.selectZoneDelete('10:Zone3.GroupID');
                    break;
                case 3:
                    this.selectZoneDelete('10:Zone4.GroupID');
                    break;
                case 4:
                    this.selectZoneDelete('10:Zone5.GroupID');
                    break;
                case 5:
                    this.selectZoneDelete('10:Zone6.GroupID');
                    break;
                case 6:
                    this.selectZoneDelete('10:Zone7.GroupID');
                    break;
                case 7:
                    this.selectZoneDelete('10:Zone8.GroupID');
                    break;
                case 8:
                    this.selectZoneDelete('10:Zone9.GroupID');
                    break;
                case 9:
                    this.selectZoneDelete('10:Zone10.GroupID');
                    break;
                case 10:
                    this.selectZoneDelete('10:Zone11.GroupID');
                    break;
                case 11:
                    this.selectZoneDelete('10:Zone12.GroupID');
                    break;
                case 12:
                    this.selectZoneDelete('10:Zone13.GroupID');
                    break;
                case 13:
                    this.selectZoneDelete('10:Zone14.GroupID');
                    break;
                case 14:
                    this.selectZoneDelete('10:Zone15.GroupID');
                    break;
                case 15:
                    this.selectZoneDelete('10:Zone16.GroupID');
                    break;
                case 16:
                    this.selectZoneDelete('10:Zone17.GroupID');
                    break;
                case 17:
                    this.selectZoneDelete('10:Zone18.GroupID');
                    break;
                case 18:
                    this.selectZoneDelete('10:Zone19.GroupID');
                    break;
                case 19:
                    this.selectZoneDelete('10:Zone20.GroupID');
                    break;
                case 20:
                    this.selectZoneDelete('10:Zone21.GroupID');
                    break;
                case 21:
                    this.selectZoneDelete('10:Zone22.GroupID');
                    break;
                case 22:
                    this.selectZoneDelete('10:Zone23.GroupID');
                    break;
                case 23:
                    this.selectZoneDelete('10:Zone24.GroupID');
                    break;*/
                case 0:
                    this.selectZoneDelete('10:SetPointManager1.GroupID_LVD');
                    break;
                case 1:
                    this.selectZoneDelete('10:SetPointManager2.GroupID_LVD');
                    break;
                case 2:
                    this.selectZoneDelete('10:SetPointManager3.GroupID_LVD');
                    break;
                case 3:
                    this.selectZoneDelete('10:SetPointManager4.GroupID_LVD');
                    break;
                case 4:
                    this.selectZoneDelete('10:SetPointManager5.GroupID_LVD');
                    break;
                case 5:
                    this.selectZoneDelete('10:SetPointManager6.GroupID_LVD');
                    break;
                case 6:
                    this.selectZoneDelete('10:SetPointManager7.GroupID_LVD');
                    break;
                case 7:
                    this.selectZoneDelete('10:SetPointManager8.GroupID_LVD');
                    break;
                case 8:
                    this.selectZoneDelete('10:SetPointManager9.GroupID_LVD');
                    break;
                case 9:
                    this.selectZoneDelete('10:SetPointManager10.GroupID_LVD');
                    break;
                case 10:
                    this.selectZoneDelete('10:SetPointManager11.GroupID_LVD');
                    break;
                case 11:
                    this.selectZoneDelete('10:SetPointManager12.GroupID_LVD');
                    break;
                case 12:
                    this.selectZoneDelete('10:SetPointManager13.GroupID_LVD');
                    break;
                case 13:
                    this.selectZoneDelete('10:SetPointManager14.GroupID_LVD');
                    break;
                case 14:
                    this.selectZoneDelete('10:SetPointManager15.GroupID_LVD');
                    break;
                case 15:
                    this.selectZoneDelete('10:SetPointManager16.GroupID_LVD');
                    break;
                case 16:
                    this.selectZoneDelete('10:SetPointManager17.GroupID_LVD');
                    break;
                case 17:
                    this.selectZoneDelete('10:SetPointManager18.GroupID_LVD');
                    break;
                case 18:
                    this.selectZoneDelete('10:SetPointManager19.GroupID_LVD');
                    break;
                case 19:
                    this.selectZoneDelete('10:SetPointManager20.GroupID_LVD');
                    break;
                case 20:
                    this.selectZoneDelete('10:SetPointManager21.GroupID_LVD');
                    break;
                case 21:
                    this.selectZoneDelete('10:SetPointManager22.GroupID_LVD');
                    break;
                case 22:
                    this.selectZoneDelete('10:SetPointManager23.GroupID_LVD');
                    break;
                case 23:
                    this.selectZoneDelete('10:SetPointManager24.GroupID_LVD');
                    break;
            }

        }
        else
        {

        switch (index) {
            case 0:
                this.selectZoneDelete('10:SetPointManager1.GroupID_LVD');
                break;
            case 1:
                this.selectZoneDelete('10:SetPointManager2.GroupID_LVD');
                break;
            case 2:
                this.selectZoneDelete('10:SetPointManager3.GroupID_LVD');
                break;
            case 3:
                this.selectZoneDelete('10:SetPointManager4.GroupID_LVD');
                break;
            case 4:
                this.selectZoneDelete('10:SetPointManager5.GroupID_LVD');
                break;
            case 5:
                this.selectZoneDelete('10:SetPointManager6.GroupID_LVD');
                break;
            case 6:
                this.selectZoneDelete('10:SetPointManager7.GroupID_LVD');
                break;
            case 7:
                this.selectZoneDelete('10:SetPointManager8.GroupID_LVD');
                break;            case 8:
                this.selectZoneDelete('10:SetPointManager9.GroupID_LVD');
                break;
            case 9:
                this.selectZoneDelete('10:SetPointManager10.GroupID_LVD');
                break;
            case 10:
                this.selectZoneDelete('10:SetPointManager11.GroupID_LVD');
                break;
            case 11:
                this.selectZoneDelete('10:SetPointManager12.GroupID_LVD');
                break;
            case 12:
                this.selectZoneDelete('10:SetPointManager13.GroupID_LVD');
                break;
            case 13:
                this.selectZoneDelete('10:SetPointManager14.GroupID_LVD');
                break;
            case 14:
                this.selectZoneDelete('10:SetPointManager15.GroupID_LVD');
                break;
            case 15:
                this.selectZoneDelete('10:SetPointManager16.GroupID_LVD');
                break;
            case 16:
                this.selectZoneDelete('10:SetPointManager17.GroupID_LVD');
                break;
            case 17:
                this.selectZoneDelete('10:SetPointManager18.GroupID_LVD');
                break;
            case 18:
                this.selectZoneDelete('10:SetPointManager19.GroupID_LVD');
                break;
            case 19:
                this.selectZoneDelete('10:SetPointManager20.GroupID_LVD');
                break;
            case 20:
                this.selectZoneDelete('10:SetPointManager21.GroupID_LVD');
                break;
            case 21:
                this.selectZoneDelete('10:SetPointManager22.GroupID_LVD');
                break;
            case 22:
                this.selectZoneDelete('10:SetPointManager23.GroupID_LVD');
                break;
            case 23:
                this.selectZoneDelete('10:SetPointManager24.GroupID_LVD');
                break;
        }

    }

    }

        selectZoneDelete(ZoneName) {
        this.datapointAPI.readDataPoint(ZoneName, 0)
                .then((resolve) => {
                    GroupID = resolve.value;
                    if (GroupID === SelectedGroupID) {
                        this.datapointAPI.writeDataPoint(ZoneName, 0);
                    }
                });
    }

    switchGroupID(GrID, counterGr){

        switch (GrID) {
            case 1:
                counterGr[0]=counterGr[0]+1;
                break;
            case 2:
                counterGr[1]=counterGr[1]+1;
                break;
            case 3:
                counterGr[2]=counterGr[2]+1;
                break;
            case 4:
                counterGr[3]=counterGr[3]+1;
                break;
            case 5:
                counterGr[4]=counterGr[4]+1;
                break;
            case 6:
                counterGr[5]=counterGr[5]+1;
                break;
            case 7:
                counterGr[6]=counterGr[6]+1;
                break;
            case 8:
                counterGr[7]=counterGr[7]+1;
                break;
            case 9:
                counterGr[8]=counterGr[8]+1;
                break;
            case 10:
                counterGr[9]=counterGr[9]+1;
                break;
            case 11:
                counterGr[10]=counterGr[10]+1;
                break;
        }
    }



}
window.registerDashboardModule('GroupDetail', CodeModuleClass.create);