Search in sources :

Example 1 with Location

use of alma.acs.alarmsystem.generated.Location in project ACS by ACS-Community.

the class ACSAlarmDAOImplTest method testAddFaultFamily.

public void testAddFaultFamily() {
    boolean exception;
    Alarm al1;
    cern.laser.business.data.Location l;
    //Delete Entry if it exists due to an error in previous test
    {
        FaultFamily ff = new FaultFamily();
        ff.setName("ffTest1");
        try {
            _alarmDAO.removeFaultFamily(ff);
        } catch (Exception e) {
        //This happens when FaultFamily "ffTest1" doesn't exist
        }
    }
    //Check Null Argument
    exception = false;
    try {
        _alarmDAO.addFaultFamily(null);
    } catch (Exception e) {
        exception = true;
    }
    assertTrue(exception);
    //Check new FaultFamily
    FaultFamily ff = new FaultFamily();
    ff.setName("ffTest1");
    ff.setAlarmSource("ALARM_SYSTEM_SOURCES");
    ff.setHelpUrl("http://www.test.com");
    Contact ct = new Contact();
    ct.setEmail("em1");
    ct.setGsm("gsm1");
    ct.setName("cont1");
    ff.setContact(ct);
    FaultCode fc = new FaultCode();
    fc.setValue(1);
    fc.setPriority(0);
    fc.setAction("action1");
    fc.setCause("cause1");
    fc.setConsequence("conseq1");
    fc.setProblemDescription("problem1");
    ff.addFaultCode(fc);
    FaultMemberDefault fmd = new FaultMemberDefault();
    Location lc = new Location();
    lc.setBuilding("b1");
    lc.setFloor("f1");
    lc.setMnemonic("m1");
    lc.setPosition("p1");
    lc.setRoom("r1");
    fmd.setLocation(lc);
    ff.setFaultMemberDefault(fmd);
    FaultMember fm = new FaultMember();
    fm.setName("fmTest1");
    lc = new Location();
    lc.setBuilding("b2");
    lc.setFloor("f2");
    lc.setMnemonic("m2");
    lc.setPosition("p2");
    lc.setRoom("r2");
    fm.setLocation(lc);
    ff.addFaultMember(fm);
    exception = false;
    try {
        _alarmDAO.addFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest1:1");
    assertNotNull(al1);
    assertEquals("ALARM_SYSTEM_SOURCES", al1.getSource().getName());
    assertEquals("http://www.test.com", al1.getHelpURL().toString());
    assertEquals("em1", al1.getPiquetEmail());
    assertEquals("gsm1", al1.getPiquetGSM());
    assertEquals("cont1", al1.getResponsiblePerson().getFamilyName());
    assertEquals(0, al1.getPriority().intValue());
    assertEquals("action1", al1.getAction());
    assertEquals("cause1", al1.getCause());
    assertEquals("conseq1", al1.getConsequence());
    assertEquals("problem1", al1.getProblemDescription());
    l = al1.getLocation();
    assertNotNull(l);
    //assertEquals("b2",l.getBuilding()); //Null
    assertEquals("f2", l.getFloor());
    assertEquals("m2", l.getMnemonic());
    assertEquals("p2", l.getPosition());
    assertEquals("r2", l.getRoom());
    //Check if it already exists
    exception = false;
    try {
        _alarmDAO.addFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertTrue(exception);
}
Also used : FaultCode(alma.acs.alarmsystem.generated.FaultCode) FaultMember(alma.acs.alarmsystem.generated.FaultMember) FaultFamily(alma.acs.alarmsystem.generated.FaultFamily) Alarm(cern.laser.business.data.Alarm) Contact(alma.acs.alarmsystem.generated.Contact) FaultMemberDefault(alma.acs.alarmsystem.generated.FaultMemberDefault) Location(alma.acs.alarmsystem.generated.Location)

Example 2 with Location

use of alma.acs.alarmsystem.generated.Location in project ACS by ACS-Community.

the class ACSAlarmDAOImplTest method testUpdateFaultFamily.

public void testUpdateFaultFamily() {
    boolean exception;
    Alarm al1;
    cern.laser.business.data.Location l;
    //Delete Entry if it exists due to an error in previous test
    {
        FaultFamily ff = new FaultFamily();
        ff.setName("ffTest1");
        try {
            _alarmDAO.removeFaultFamily(ff);
        } catch (Exception e) {
        //This happens when FaultFamily "ffTest1" doesn't exist
        }
    }
    //Check Null Argument
    exception = false;
    try {
        _alarmDAO.updateFaultFamily(null);
    } catch (Exception e) {
        exception = true;
    }
    assertTrue(exception);
    //Update a FaultFamily that doesn't exist
    FaultFamily ff = new FaultFamily();
    ff.setName("ffTest1");
    exception = false;
    try {
        _alarmDAO.updateFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertTrue(exception);
    //Check updating FaultFamily
    ff.setAlarmSource("ALARM_SYSTEM_SOURCES");
    ff.setHelpUrl("http://www.test.com");
    Contact ct = new Contact();
    ct.setEmail("em1");
    ct.setGsm("gsm1");
    ct.setName("cont1");
    ff.setContact(ct);
    FaultCode fc = new FaultCode();
    fc.setValue(1);
    fc.setPriority(0);
    fc.setAction("action1");
    fc.setCause("cause1");
    fc.setConsequence("conseq1");
    fc.setProblemDescription("problem1");
    ff.addFaultCode(fc);
    FaultMember fm = new FaultMember();
    fm.setName("fmTest1");
    Location lc = new Location();
    lc.setBuilding("b2");
    lc.setFloor("f2");
    lc.setMnemonic("m2");
    lc.setPosition("p2");
    lc.setRoom("r2");
    fm.setLocation(lc);
    ff.addFaultMember(fm);
    exception = false;
    try {
        _alarmDAO.addFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    //Update FF information
    //ff.setAlarmSource("ALARM_SYSTEM_SOURCES2");//Can't be changed at the moment.
    ff.setHelpUrl("http://www.test2.com");
    ct.setEmail("em2");
    ct.setGsm("gsm2");
    ct.setName("cont2");
    try {
        _alarmDAO.updateFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest1:1");
    assertNotNull(al1);
    assertEquals("ALARM_SYSTEM_SOURCES", al1.getSource().getName());
    //assertEquals("ALARM_SYSTEM_SOURCES2",al1.getSource().getName());
    assertEquals("http://www.test2.com", al1.getHelpURL().toString());
    assertEquals("em2", al1.getPiquetEmail());
    assertEquals("gsm2", al1.getPiquetGSM());
    assertEquals("cont2", al1.getResponsiblePerson().getFamilyName());
    assertEquals(0, al1.getPriority().intValue());
    assertEquals("action1", al1.getAction());
    assertEquals("cause1", al1.getCause());
    assertEquals("conseq1", al1.getConsequence());
    assertEquals("problem1", al1.getProblemDescription());
    l = al1.getLocation();
    //assertEquals("b2",l.getBuilding());
    assertEquals("f2", l.getFloor());
    assertEquals("m2", l.getMnemonic());
    assertEquals("p2", l.getPosition());
    assertEquals("r2", l.getRoom());
    //Update FM Information
    fm.setName("fmTest2");
    lc.setBuilding("b3");
    lc.setFloor("f3");
    lc.setMnemonic("m3");
    lc.setPosition("p3");
    lc.setRoom("r3");
    try {
        _alarmDAO.updateFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest2:1");
    assertNotNull(al1);
    //assertEquals("ALARM_SYSTEM_SOURCES2",al1.getSource().getName());
    assertEquals("ALARM_SYSTEM_SOURCES", al1.getSource().getName());
    assertEquals("http://www.test2.com", al1.getHelpURL().toString());
    assertEquals("em2", al1.getPiquetEmail());
    assertEquals("gsm2", al1.getPiquetGSM());
    assertEquals("cont2", al1.getResponsiblePerson().getFamilyName());
    assertEquals(0, al1.getPriority().intValue());
    assertEquals("action1", al1.getAction());
    assertEquals("cause1", al1.getCause());
    assertEquals("conseq1", al1.getConsequence());
    assertEquals("problem1", al1.getProblemDescription());
    l = al1.getLocation();
    //assertEquals("b3",l.getBuilding());
    assertEquals("f3", l.getFloor());
    assertEquals("m3", l.getMnemonic());
    assertEquals("p3", l.getPosition());
    assertEquals("r3", l.getRoom());
    //Update FC Information
    fc.setValue(2);
    fc.setPriority(1);
    fc.setAction("action2");
    fc.setCause("cause2");
    fc.setConsequence("conseq2");
    fc.setProblemDescription("problem2");
    try {
        _alarmDAO.updateFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest2:2");
    assertNotNull(al1);
    //assertEquals("ALARM_SYSTEM_SOURCES2",al1.getSource().getName());
    assertEquals("ALARM_SYSTEM_SOURCES", al1.getSource().getName());
    assertEquals("http://www.test2.com", al1.getHelpURL().toString());
    assertEquals("em2", al1.getPiquetEmail());
    assertEquals("gsm2", al1.getPiquetGSM());
    assertEquals("cont2", al1.getResponsiblePerson().getFamilyName());
    assertEquals(1, al1.getPriority().intValue());
    assertEquals("action2", al1.getAction());
    assertEquals("cause2", al1.getCause());
    assertEquals("conseq2", al1.getConsequence());
    assertEquals("problem2", al1.getProblemDescription());
    l = al1.getLocation();
    //assertEquals("b3",l.getBuilding());
    assertEquals("f3", l.getFloor());
    assertEquals("m3", l.getMnemonic());
    assertEquals("p3", l.getPosition());
    assertEquals("r3", l.getRoom());
    //Update Add FM
    FaultMember fm2 = new FaultMember();
    fm2.setName("fmTest3");
    Location lc2 = new Location();
    lc2.setBuilding("b4");
    lc2.setFloor("f4");
    lc2.setMnemonic("m4");
    lc2.setPosition("p4");
    lc2.setRoom("r4");
    fm2.setLocation(lc2);
    ff.addFaultMember(fm2);
    exception = false;
    try {
        _alarmDAO.updateFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest3:2");
    assertNotNull(al1);
    //assertEquals("ALARM_SYSTEM_SOURCES2",al1.getSource().getName());
    assertEquals("ALARM_SYSTEM_SOURCES", al1.getSource().getName());
    assertEquals("http://www.test2.com", al1.getHelpURL().toString());
    assertEquals("em2", al1.getPiquetEmail());
    assertEquals("gsm2", al1.getPiquetGSM());
    assertEquals("cont2", al1.getResponsiblePerson().getFamilyName());
    assertEquals(1, al1.getPriority().intValue());
    assertEquals("action2", al1.getAction());
    assertEquals("cause2", al1.getCause());
    assertEquals("conseq2", al1.getConsequence());
    assertEquals("problem2", al1.getProblemDescription());
    l = al1.getLocation();
    //assertEquals("b4",l.getBuilding());
    assertEquals("f4", l.getFloor());
    assertEquals("m4", l.getMnemonic());
    assertEquals("p4", l.getPosition());
    assertEquals("r4", l.getRoom());
    //Update Add FC
    FaultCode fc2 = new FaultCode();
    fc2.setValue(3);
    fc2.setPriority(2);
    fc2.setAction("action3");
    fc2.setCause("cause3");
    fc2.setConsequence("conseq3");
    fc2.setProblemDescription("problem3");
    ff.addFaultCode(fc2);
    exception = false;
    try {
        _alarmDAO.updateFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest3:3");
    assertNotNull(al1);
    //assertEquals("ALARM_SYSTEM_SOURCES2",al1.getSource().getName());
    assertEquals("ALARM_SYSTEM_SOURCES", al1.getSource().getName());
    assertEquals("http://www.test2.com", al1.getHelpURL().toString());
    assertEquals("em2", al1.getPiquetEmail());
    assertEquals("gsm2", al1.getPiquetGSM());
    assertEquals("cont2", al1.getResponsiblePerson().getFamilyName());
    assertEquals(2, al1.getPriority().intValue());
    assertEquals("action3", al1.getAction());
    assertEquals("cause3", al1.getCause());
    assertEquals("conseq3", al1.getConsequence());
    assertEquals("problem3", al1.getProblemDescription());
    l = al1.getLocation();
    //assertEquals("b4",l.getBuilding());
    assertEquals("f4", l.getFloor());
    assertEquals("m4", l.getMnemonic());
    assertEquals("p4", l.getPosition());
    assertEquals("r4", l.getRoom());
    //Update Remove FM
    ff.removeFaultMember(fm);
    exception = false;
    try {
        _alarmDAO.updateFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest2:2");
    assertNull(al1);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest2:3");
    assertNull(al1);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest3:2");
    assertNotNull(al1);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest3:3");
    assertNotNull(al1);
    //Update Remove FC
    ff.removeFaultCode(fc);
    exception = false;
    try {
        _alarmDAO.updateFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest3:2");
    assertNull(al1);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest3:3");
    assertNotNull(al1);
    //Update Add Default FM
    FaultMemberDefault fmd = new FaultMemberDefault();
    lc = new Location();
    lc.setBuilding("b1");
    lc.setFloor("f1");
    lc.setMnemonic("m1");
    lc.setPosition("p1");
    lc.setRoom("r1");
    fmd.setLocation(lc);
    ff.setFaultMemberDefault(fmd);
    exception = false;
    try {
        _alarmDAO.updateFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    al1 = _alarmDAO.getAlarm("ffTest1:any:3");
    assertNotNull(al1);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest3:3");
    assertNotNull(al1);
//Update Remove Default FM
//ff.removeFaultMemberDefault(); Missing method?
/*
		exception = false;
		try{
			_alarmDAO.updateFaultFamily(ff);
		}catch(Exception e){
			exception = true;
		}
		assertFalse(exception);
		al1 = _alarmDAO.getAlarm("ffTest1:any:3");
		assertNull(al1);
		al1 = _alarmDAO.getAlarm("ffTest1:fmTest3:3");
		assertNotNull(al1);
		*/
}
Also used : FaultCode(alma.acs.alarmsystem.generated.FaultCode) FaultMember(alma.acs.alarmsystem.generated.FaultMember) FaultFamily(alma.acs.alarmsystem.generated.FaultFamily) Alarm(cern.laser.business.data.Alarm) Contact(alma.acs.alarmsystem.generated.Contact) Location(alma.acs.alarmsystem.generated.Location) FaultMemberDefault(alma.acs.alarmsystem.generated.FaultMemberDefault)

Example 3 with Location

use of alma.acs.alarmsystem.generated.Location in project ACS by ACS-Community.

the class ACSAlarmDAOImplTest method testRemoveFaultFamily.

public void testRemoveFaultFamily() {
    Alarm al1;
    boolean exception;
    //Delete Entry if it exists due to an error in previous test
    {
        FaultFamily ff = new FaultFamily();
        ff.setName("ffTest1");
        try {
            _alarmDAO.removeFaultFamily(ff);
        } catch (Exception e) {
        //This happens when FaultFamily "ffTest1" doesn't exist
        }
    }
    //Check null argument
    exception = false;
    try {
        _alarmDAO.removeFaultFamily(null);
    } catch (Exception e) {
        exception = true;
    }
    assertTrue(exception);
    //Check Remove FF that doesn't exist
    FaultFamily ff = new FaultFamily();
    ff.setName("ffTest1");
    exception = false;
    try {
        _alarmDAO.removeFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertTrue(exception);
    //Check Remove FF
    ff.setAlarmSource("ALARM_SYSTEM_SOURCES");
    ff.setHelpUrl("http://www.test.com");
    Contact ct = new Contact();
    ct.setEmail("em1");
    ct.setGsm("gsm1");
    ct.setName("cont1");
    ff.setContact(ct);
    FaultCode fc = new FaultCode();
    fc.setValue(1);
    fc.setPriority(0);
    fc.setAction("action1");
    fc.setCause("cause1");
    fc.setConsequence("conseq1");
    fc.setProblemDescription("problem1");
    ff.addFaultCode(fc);
    FaultMemberDefault fmd = new FaultMemberDefault();
    Location lc = new Location();
    lc.setBuilding("b1");
    lc.setFloor("f1");
    lc.setMnemonic("m1");
    lc.setPosition("p1");
    lc.setRoom("r1");
    fmd.setLocation(lc);
    ff.setFaultMemberDefault(fmd);
    FaultMember fm = new FaultMember();
    fm.setName("fmTest1");
    lc = new Location();
    lc.setBuilding("b2");
    lc.setFloor("f2");
    lc.setMnemonic("m2");
    lc.setPosition("p2");
    lc.setRoom("r2");
    fm.setLocation(lc);
    ff.addFaultMember(fm);
    exception = false;
    try {
        _alarmDAO.addFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest1:1");
    assertNotNull(al1);
    try {
        _alarmDAO.removeFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    al1 = _alarmDAO.getAlarm("ffTest1:fmTest1:1");
    assertNull(al1);
}
Also used : FaultCode(alma.acs.alarmsystem.generated.FaultCode) FaultMember(alma.acs.alarmsystem.generated.FaultMember) FaultFamily(alma.acs.alarmsystem.generated.FaultFamily) Alarm(cern.laser.business.data.Alarm) Contact(alma.acs.alarmsystem.generated.Contact) FaultMemberDefault(alma.acs.alarmsystem.generated.FaultMemberDefault) Location(alma.acs.alarmsystem.generated.Location)

Example 4 with Location

use of alma.acs.alarmsystem.generated.Location in project ACS by ACS-Community.

the class AlarmManagerTest method testSaveToCDB.

public void testSaveToCDB() {
    boolean exception;
    _am = AlarmManager.getInstance(_daoManager.getAlarmDAO());
    _am.loadFromCDB();
    List<FaultFamily> ff1 = _am.getAllAlarms();
    assertNotNull(ff1);
    int size1 = ff1.size();
    int size2;
    exception = false;
    FaultFamily ff = new FaultFamily();
    size1 = ff1.size();
    ff.setName("foobar");
    ff.setHelpUrl("http://www.foobar.cl/");
    Contact ct = new Contact();
    ct.setEmail("test@foobar.cl");
    ct.setGsm("da");
    ct.setName("Foobar");
    ff.setContact(ct);
    FaultCode fc = new FaultCode();
    fc.setValue(1);
    fc.setAction("a1");
    fc.setCause("c1");
    fc.setConsequence("co1");
    fc.setPriority(1);
    fc.setProblemDescription("pd1");
    ff.addFaultCode(fc);
    FaultMember fm = new FaultMember();
    fm.setName("fmFoobar");
    Location lc = new Location();
    lc.setBuilding("b1");
    lc.setFloor("f1");
    lc.setMnemonic("m1");
    lc.setPosition("p1");
    lc.setRoom("r1");
    fm.setLocation(lc);
    try {
        _am.addFaultFamily(ff);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    size2 = ff1.size();
    assertEquals(size1, size2 - 1);
    _am.saveToCDB();
    _am.loadFromCDB();
    FaultFamily fft = _am.getFaultFamily("foobar");
    assertNotNull(fft);
    assertEquals(fft.getName(), ff.getName());
    assertEquals(fft.getHelpUrl(), ff.getHelpUrl());
    exception = false;
    try {
        _am.deleteFaultFamily(fft);
    } catch (Exception e) {
        exception = true;
    }
    assertFalse(exception);
    _am.saveToCDB();
    _am.loadFromCDB();
    fft = _am.getFaultFamily("foobar");
    assertNull(fft);
}
Also used : FaultCode(alma.acs.alarmsystem.generated.FaultCode) FaultMember(alma.acs.alarmsystem.generated.FaultMember) FaultFamily(alma.acs.alarmsystem.generated.FaultFamily) Contact(alma.acs.alarmsystem.generated.Contact) Location(alma.acs.alarmsystem.generated.Location)

Example 5 with Location

use of alma.acs.alarmsystem.generated.Location in project ACS by ACS-Community.

the class AlarmsView method createFMWidgets.

private void createFMWidgets() {
    Listener updateFaultMember = new Listener() {

        public void handleEvent(Event event) {
            TreeItem tmp = _tree.getSelection()[0];
            String tfm = tmp.getText();
            String tff = tmp.getParentItem().getParentItem().getText();
            FaultMember fmt = new FaultMember();
            //TODO: Error icon or something similar
            if (_fmNameText.getText().isEmpty()) {
                _fmErrorMessageLabel.setText("FaultMember Name Missing!");
                return;
            }
            if (_fmNameText.getText().contains(" ")) {
                _fmErrorMessageLabel.setText("Invalid FaultMember Name. No spaces allowed.");
                return;
            }
            fmt.setName(_fmNameText.getText());
            Location lt = new Location();
            if (!_fmLocBuildingText.getText().isEmpty())
                lt.setBuilding(_fmLocBuildingText.getText());
            if (!_fmLocFloorText.getText().isEmpty())
                lt.setFloor(_fmLocFloorText.getText());
            if (!_fmLocRoomText.getText().isEmpty())
                lt.setRoom(_fmLocRoomText.getText());
            if (!_fmLocMnemonicText.getText().isEmpty())
                lt.setMnemonic(_fmLocMnemonicText.getText());
            if (!_fmLocPositionText.getText().isEmpty())
                lt.setPosition(_fmLocPositionText.getText());
            fmt.setLocation(lt);
            _fmErrorMessageLabel.setText("");
            try {
                _alarmManager.updateFaultMember(_alarmManager.getFaultFamily(tff), _alarmManager.getFaultMember(tff, tfm), fmt);
                tmp.setText(_fmNameText.getText());
                if (tfm.compareTo(fmt.getName()) != 0) {
                    sortFaultFamilyList();
                    selectElementFromTree(tff, fmt.getName(), null);
                }
            } catch (IllegalOperationException e) {
                _fmErrorMessageLabel.setText(e.getMessage());
            } catch (NullPointerException e) {
                _fmErrorMessageLabel.setText(e.getMessage());
            }
        }
    };
    _FMgroup = new Group(_compInitial, SWT.SHADOW_ETCHED_IN);
    _FMgroup.setText("Fault Member detail");
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.verticalAlignment = SWT.FILL;
    gd.grabExcessVerticalSpace = true;
    _FMgroup.setLayoutData(gd);
    GridLayout gl = new GridLayout();
    gl.numColumns = 2;
    _FMgroup.setLayout(gl);
    _fmNameLabel = new Label(_FMgroup, SWT.NONE);
    _fmNameLabel.setText("Name");
    _fmNameText = new Text(_FMgroup, SWT.SINGLE | SWT.BORDER);
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    _fmNameText.setLayoutData(gd);
    _fmNameText.addListener(SWT.Modify, updateFaultMember);
    _fmLocGroup = new Group(_FMgroup, SWT.SHADOW_ETCHED_IN);
    _fmLocGroup.setText("Location");
    gl = new GridLayout();
    gl.numColumns = 2;
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 2;
    _fmLocGroup.setLayout(gl);
    _fmLocGroup.setLayoutData(gd);
    _fmLocBuildingLabel = new Label(_fmLocGroup, SWT.NONE);
    _fmLocBuildingLabel.setText("Building");
    _fmLocBuildingText = new Text(_fmLocGroup, SWT.SINGLE | SWT.BORDER);
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    _fmLocBuildingText.setLayoutData(gd);
    _fmLocBuildingText.addListener(SWT.Modify, updateFaultMember);
    _fmLocFloorLabel = new Label(_fmLocGroup, SWT.NONE);
    _fmLocFloorLabel.setText("Floor");
    _fmLocFloorText = new Text(_fmLocGroup, SWT.SINGLE | SWT.BORDER);
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    _fmLocFloorText.setLayoutData(gd);
    _fmLocFloorText.addListener(SWT.Modify, updateFaultMember);
    _fmLocRoomLabel = new Label(_fmLocGroup, SWT.NONE);
    _fmLocRoomLabel.setText("Room");
    _fmLocRoomText = new Text(_fmLocGroup, SWT.SINGLE | SWT.BORDER);
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    _fmLocRoomText.setLayoutData(gd);
    _fmLocRoomText.addListener(SWT.Modify, updateFaultMember);
    _fmLocMnemonicLabel = new Label(_fmLocGroup, SWT.NONE);
    _fmLocMnemonicLabel.setText("Mnemonic");
    _fmLocMnemonicText = new Text(_fmLocGroup, SWT.SINGLE | SWT.BORDER);
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    _fmLocMnemonicText.setLayoutData(gd);
    _fmLocMnemonicText.addListener(SWT.Modify, updateFaultMember);
    _fmLocPositionLabel = new Label(_fmLocGroup, SWT.NONE);
    _fmLocPositionLabel.setText("Position");
    _fmLocPositionText = new Text(_fmLocGroup, SWT.SINGLE | SWT.BORDER);
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    _fmLocPositionText.setLayoutData(gd);
    _fmLocPositionText.addListener(SWT.Modify, updateFaultMember);
    _fmErrorMessageLabel = new Label(_FMgroup, SWT.NONE);
    _fmErrorMessageLabel.setText("");
    _fmErrorMessageLabel.setForeground(getViewSite().getShell().getDisplay().getSystemColor(SWT.COLOR_RED));
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    gd.horizontalSpan = 2;
    _fmErrorMessageLabel.setLayoutData(gd);
}
Also used : FaultMember(alma.acs.alarmsystem.generated.FaultMember) Group(org.eclipse.swt.widgets.Group) SelectionListener(org.eclipse.swt.events.SelectionListener) Listener(org.eclipse.swt.widgets.Listener) TreeItem(org.eclipse.swt.widgets.TreeItem) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) IllegalOperationException(cl.utfsm.acs.acg.core.IllegalOperationException) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) Event(org.eclipse.swt.widgets.Event) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Location(alma.acs.alarmsystem.generated.Location)

Aggregations

Location (alma.acs.alarmsystem.generated.Location)6 FaultMember (alma.acs.alarmsystem.generated.FaultMember)5 Contact (alma.acs.alarmsystem.generated.Contact)4 FaultCode (alma.acs.alarmsystem.generated.FaultCode)4 FaultFamily (alma.acs.alarmsystem.generated.FaultFamily)4 FaultMemberDefault (alma.acs.alarmsystem.generated.FaultMemberDefault)4 Alarm (cern.laser.business.data.Alarm)3 IllegalOperationException (cl.utfsm.acs.acg.core.IllegalOperationException)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 SelectionListener (org.eclipse.swt.events.SelectionListener)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Event (org.eclipse.swt.widgets.Event)2 Group (org.eclipse.swt.widgets.Group)2 Label (org.eclipse.swt.widgets.Label)2 Listener (org.eclipse.swt.widgets.Listener)2 Text (org.eclipse.swt.widgets.Text)2 TreeItem (org.eclipse.swt.widgets.TreeItem)2