예제 #1
0
        public WebSocketService NewServiceMap(WebSocketServiceManager _manager, IWebSocketConnection socket)
        {
            WebSocketService service = null;

            switch (_manager.managerName)
            {
            case "/gps":
                service = new GPSService(_manager, socket);
                //service.
                break;

            case "/uhf":
                service = new UHFService(_manager, socket);
                break;

            case "/green_light":
                service = new GreenLightService(_manager, socket);
                break;

            case "/red_light":
                service = new RedLightService(_manager, socket);
                break;

            case "/yellow_light":
                service = new YellowLightService(_manager, socket);
                break;

            case "/fan":
                service = new FanService(_manager, socket);
                break;

            case "/engine":
                service = new EngineService(_manager, socket);
                break;
            }
            return(service);
        }
예제 #2
0
        public WebSocketService NewServiceMap(WebSocketServiceManager _manager, IWebSocketConnection socket)
        {
            WebSocketService service = null;

            switch (_manager.managerName)
            {
            case "/" + TargetDeiveName.GPS:
                service = new GPSService(_manager, socket);
                break;

            case "/" + TargetDeiveName.UHF:
                service = new UHFService(_manager, socket);
                break;

            case "/" + TargetDeiveName.绿灯:
                service = new GreenLightService(_manager, socket);
                break;

            case "/" + TargetDeiveName.红灯:
                service = new RedLightService(_manager, socket);
                break;

            case "/" + TargetDeiveName.黄灯:
                service = new YellowLightService(_manager, socket);
                break;

            case "/" + TargetDeiveName.电风扇:
                service = new FanService(_manager, socket);
                break;

            case "/" + TargetDeiveName.电机:
                service = new EngineService(_manager, socket);
                break;
            }
            return(service);
        }