Search in sources :

Example 41 with SignalMast

use of jmri.SignalMast in project JMRI by JMRI.

the class LayoutTurnout method setSignalCMast.

public void setSignalCMast(String signalMast) {
    if (signalMast == null || signalMast.equals("")) {
        signalCMastNamed = null;
        return;
    }
    SignalMast mast = InstanceManager.getDefault(jmri.SignalMastManager.class).getSignalMast(signalMast);
    if (mast != null) {
        signalCMastNamed = InstanceManager.getDefault(jmri.NamedBeanHandleManager.class).getNamedBeanHandle(signalMast, mast);
    } else {
        log.error("Signal Mast " + signalMast + " Not found for turnout " + getTurnoutName());
        signalCMastNamed = null;
    }
}
Also used : SignalMast(jmri.SignalMast)

Example 42 with SignalMast

use of jmri.SignalMast in project JMRI by JMRI.

the class LevelXing method setSignalDMast.

public void setSignalDMast(String signalMast) {
    if (signalMast == null || signalMast.equals("")) {
        signalDMastNamed = null;
        return;
    }
    try {
        SignalMast mast = InstanceManager.getDefault(jmri.SignalMastManager.class).provideSignalMast(signalMast);
        signalDMastNamed = InstanceManager.getDefault(jmri.NamedBeanHandleManager.class).getNamedBeanHandle(signalMast, mast);
    } catch (IllegalArgumentException ex) {
        signalDMastNamed = null;
    }
}
Also used : SignalMast(jmri.SignalMast)

Example 43 with SignalMast

use of jmri.SignalMast in project JMRI by JMRI.

the class LevelXing method setSignalCMast.

public void setSignalCMast(String signalMast) {
    if (signalMast == null || signalMast.equals("")) {
        signalCMastNamed = null;
        return;
    }
    try {
        SignalMast mast = InstanceManager.getDefault(jmri.SignalMastManager.class).provideSignalMast(signalMast);
        signalCMastNamed = InstanceManager.getDefault(jmri.NamedBeanHandleManager.class).getNamedBeanHandle(signalMast, mast);
    } catch (IllegalArgumentException ex) {
        signalCMastNamed = null;
    }
}
Also used : SignalMast(jmri.SignalMast)

Example 44 with SignalMast

use of jmri.SignalMast in project JMRI by JMRI.

the class DefaultSignalGroup method setSignalMast.

@Override
public void setSignalMast(String pName) {
    SignalMast mMast = InstanceManager.getDefault(jmri.SignalMastManager.class).getBySystemName(pName);
    if (mMast == null) {
        mMast = InstanceManager.getDefault(jmri.SignalMastManager.class).getByUserName(pName);
    }
    if (mMast == null) {
        log.warn("did not find a Signal Mast named {}", pName);
        return;
    }
    setSignalMast(mMast, pName);
}
Also used : SignalMast(jmri.SignalMast)

Example 45 with SignalMast

use of jmri.SignalMast in project JMRI by JMRI.

the class DefaultSignalMastLogic method dispose.

@Override
public void dispose() {
    if (thr != null) {
        thr.interrupt();
    }
    disposing = true;
    getSourceMast().removePropertyChangeListener(propertySourceMastListener);
    Enumeration<SignalMast> en = destList.keys();
    while (en.hasMoreElements()) {
        SignalMast dm = en.nextElement();
        destList.get(dm).dispose();
    }
}
Also used : SignalMast(jmri.SignalMast)

Aggregations

SignalMast (jmri.SignalMast)80 Test (org.junit.Test)19 NamedBean (jmri.NamedBean)11 Sensor (jmri.Sensor)11 SignalHead (jmri.SignalHead)11 Turnout (jmri.Turnout)10 SignalMastManager (jmri.SignalMastManager)9 JsonException (jmri.server.json.JsonException)9 ArrayList (java.util.ArrayList)8 JmriException (jmri.JmriException)8 Block (jmri.Block)7 SignalMastLogic (jmri.SignalMastLogic)7 Hashtable (java.util.Hashtable)6 Element (org.jdom2.Element)5 JsonNode (com.fasterxml.jackson.databind.JsonNode)4 IOException (java.io.IOException)4 NamedBeanHandle (jmri.NamedBeanHandle)4 Section (jmri.Section)4 LayoutTurnout (jmri.jmrit.display.layoutEditor.LayoutTurnout)4 PropertyChangeEvent (java.beans.PropertyChangeEvent)3