Exemple #1
0
        private ModelSystem(string ipAddres, int clientPort, int serverPort)
        {
            Dictionary <int, string> indexToNames = new Dictionary <int, string>();

            indexToNames.Add(0, "/instrumentation/airspeed-indicator/indicated-speed-kt");
            indexToNames.Add(1, "/instrumentation/altimeter/indicated-altitude-ft");
            indexToNames.Add(2, "/instrumentation/altimeter/pressure-alt-ft");
            indexToNames.Add(3, "/instrumentation/attitude-indicator/indicated-pitch-deg");
            indexToNames.Add(4, "/instrumentation/attitude-indicator/indicated-roll-deg");
            indexToNames.Add(5, "/instrumentation/attitude-indicator/internal-pitch-deg");
            indexToNames.Add(6, "/instrumentation/attitude-indicator/internal-roll-deg");
            indexToNames.Add(7, "/instrumentation/encoder/indicated-altitude-ft");
            indexToNames.Add(8, "/instrumentation/encoder/pressure-alt-ft");
            indexToNames.Add(9, "/instrumentation/gps/indicated-altitude-ft");
            indexToNames.Add(10, "/instrumentation/gps/indicated-ground-speed-kt");
            indexToNames.Add(11, "/instrumentation/gps/indicated-vertical-speed");
            indexToNames.Add(12, "/instrumentation/heading-indicator/indicated-heading-deg");
            indexToNames.Add(13, "/instrumentation/magnetic-compass/indicated-heading-deg");
            indexToNames.Add(14, "/instrumentation/slip-skid-ball/indicated-slip-skid");
            indexToNames.Add(15, "/instrumentation/turn-indicator/indicated-turn-rate");
            indexToNames.Add(16, "/instrumentation/vertical-speed-indicator/indicated-speed-fpm");
            indexToNames.Add(17, "/controls/flight/aileron");
            indexToNames.Add(18, "/controls/flight/elevator");
            indexToNames.Add(19, "/controls/flight/rudder");
            indexToNames.Add(20, "/controls/flight/flaps");
            indexToNames.Add(21, "/controls/engines/engine/throttle");
            indexToNames.Add(22, "/engines/engine/rpm");
            netManager = new NetWorkManager();
            dataHolder = new DataBase();
            parser     = new Parser(indexToNames);
            netManager.addToGotDataEvent(updateDataBase);
            dataHolder.dataUpdateEvent += sendSet;
            openInfo();
            netManager.commandsConnect(ipAddres, clientPort);
        }
Exemple #2
0
 private ModelSystem(Dictionary <int, string> indexToNames)
 {
     netManager = new NetWorkManager();
     dataHolder = new DataBase();
     parser     = new Parser(indexToNames);
     netManager.addToGotDataEvent(updateDataBase);
     dataHolder.dataUpdateEvent += sendSet;
     openInfo();
 }