private string GetTypePrefix(TLCObjectType type)
        {
            switch (type)
            {
            case TLCObjectType.TLCFacilities:
                return("_f_");

            case TLCObjectType.Intersection:
                return("_int_");

            case TLCObjectType.SignalGroup:
                return("_sg_");

            case TLCObjectType.Detector:
                return("_d_");

            case TLCObjectType.Input:
                return("_i_");

            case TLCObjectType.Output:
                return("_o_");

            case TLCObjectType.SpecialVehicleEventGenerator:
                return("_sp_");

            case TLCObjectType.Variable:
                return("_v_");

            case TLCObjectType.Session:
                return("_ses_");

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
 internal void SetObjectStateChanged(string id, TLCObjectType type)
 {
     lock (_locker)
     {
         _changedObjects.Add(new Tuple <string, TLCObjectType>(id, type));
     }
 }
        private Type GetOJtype(TLCObjectType t)
        {
            switch (t)
            {
            case TLCObjectType.Session:
                return(typeof(ControlApplication));

            case TLCObjectType.TLCFacilities:
                return(typeof(TLCFacilities));

            case TLCObjectType.Intersection:
                return(typeof(Intersection));

            case TLCObjectType.SignalGroup:
                return(typeof(SignalGroup));

            case TLCObjectType.Detector:
                return(typeof(Detector));

            case TLCObjectType.Input:
                return(typeof(Input));

            case TLCObjectType.Output:
                return(typeof(Output));

            case TLCObjectType.SpecialVehicleEventGenerator:
                return(typeof(SpecialVehicleEventGenerator));

            case TLCObjectType.Variable:
                return(typeof(Variable));

            default:
                throw new ArgumentOutOfRangeException(nameof(t), t, null);
            }
        }
Esempio n. 4
0
        private static string GetMessage(string objectId, TLCObjectType type)
        {
            string stype;

            switch (type)
            {
            case TLCObjectType.Session:
                stype = "Session";
                break;

            case TLCObjectType.TLCFacilities:
                stype = "TLCFacilities";
                break;

            case TLCObjectType.Intersection:
                stype = "Intersection";
                break;

            case TLCObjectType.SignalGroup:
                stype = "SignalGroup";
                break;

            case TLCObjectType.Detector:
                stype = "Detector";
                break;

            case TLCObjectType.Input:
                stype = "Input";
                break;

            case TLCObjectType.Output:
                stype = "Output";
                break;

            case TLCObjectType.SpecialVehicleEventGenerator:
                stype = "SpecialVehicleEventGenerator";
                break;

            case TLCObjectType.Variable:
                stype = "Variable";
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
            return($"Object of type {stype} with Id \"{objectId}\" could not be found");
        }
Esempio n. 5
0
 public TLCObjectNotFoundException(string objectId, TLCObjectType type) : base(GetMessage(objectId, type))
 {
 }