public ControlContainer(MMI.EBuLa.Tools.XMLLoader XMLConf)
        {
            InitializeComponent();

            m_XMLConf = XMLConf;

            try
            {
                //m_parent = gotParent;
                m_widget = new EbulaControl(XMLConf);
                P_Display.Controls.Add(m_widget);
                if (m_XMLConf.Inverse)
                {
                    m_widget.Inverse();
                }
                else
                {
                    m_widget.Inverse();
                    m_widget.Inverse();
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Fehler beim Erstellen des Widgets! ("+e.Message.ToString()+")");
            }

            try
            {
                pB_EBuLa.Image = new Bitmap(BACKGROUND_IMAGE);
            }
            catch(Exception)
            {
                MessageBox.Show("Fehler! Das Hintergrundbild \""+BACKGROUND_IMAGE+"\" konnte nicht geladen werden!");
            }
        }
Example #2
0
        public FIS(ref MMI.EBuLa.Tools.XMLLoader state, ref SoundInterface sound)
        {
            /*
            NaechsterHalt = "Ostbahnhof";
            Netz = "München";
            Linie = "S1";
            Start = "Ostbahnhof";
            Ziel = "München Flughafen";
            Zugnummer = "99132";*/

            /*
            NaechsterHalt = "Neunkirchen(Saar)Hbf";
            Netz = "Saarland";
            Linie = "RB73";
            Start = "Saarbrücken Hbf";
            Ziel = "Türkismühle";
            Zugnummer = "";*/

            NaechsterHalt = "";
            Netz = "";
            Linie = "";
            Start = "";
            Ziel = "";
            Zugnummer = "";
            dx = sound;

            localconf = state;

            FillFIS();
        }
        public ControlContainer(MMI.EBuLa.Tools.XMLLoader XMLConf, int side)
        {
            InitializeComponent();

            m_XMLConf = XMLConf;

            try
            {
                //m_parent = gotParent;
                m_widget = new ICE3Control(XMLConf, this);
                P_Display.Controls.Add(m_widget);
                if (m_XMLConf.Inverse)
                {
                    m_widget.Inverse = true;
                }
                else
                {
                    m_widget.Inverse = false;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Fehler beim Erstellen des Widgets! ("+e.Message+")");
            }

            try
            {
                pB_EBuLa.Image = new Bitmap(BACKGROUND_IMAGE);
            }
            catch(Exception)
            {
                MessageBox.Show("Fehler! Das Hintergrundbild \""+BACKGROUND_IMAGE+"\" konnte nicht geladen werden!");
            }

            if (side == 1)
                net = new Network(ref m_widget, "(links)");
            else if (side == 2)
                net = new Network(ref m_widget, "(rechts)");
            else
                return;

            if (t == null)
            {
                t = new Thread(new ThreadStart(net.Connect));
                t.IsBackground = true;
                t.Priority = m_XMLConf.thread_prio;
                t.Start();
                Thread.Sleep(1);
            }

            /*
            MMI.EBuLa.Network ebula_net = null;
            m_widget_ebula = new MMI.EBuLa.EbulaControl(m_XMLConf, ref ebula_net);
            m_widget_ebula.Visible = false;
            P_Display.Controls.Add(m_widget_ebula);
            /*if (m_XMLConf.Inverse)
            {
                m_widget_ebula.Inverse();
            }*/
        }
Example #4
0
        public Switcher(ref MMI.DAVID.DavidState s, bool topMost)
        {
            //
            // Erforderlich für die Windows Form-Designerunterstützung
            //
            InitializeComponent();
            m_state = s;

            if (s.ICEtype == ICETYPE.ICE1)
                rb_ICE1.Checked = true;
            else if (s.ICEtype == ICETYPE.ICE2_ET)
                rb_ICE2_ET_TK.Checked = true;
            else if (s.ICEtype == ICETYPE.ICE2_DT)
                rb_ICE2_DT.Checked = true;

            /*			if (s.Türschliesung == TÜRSCHlIESSUNG.TB0)
                rb_TB0.Checked = true;
            else if (s.Türschliesung == TÜRSCHlIESSUNG.ICE)
                rb_ICE.Checked = true;
            else if (s.Türschliesung == TÜRSCHlIESSUNG.SAT)
                rb_SAT.Checked = true;*/

            if (m_state.addtionalhours)
                cb_12std.Checked = true;

            this.TopMost = topMost;
        }
Example #5
0
 public ET42XState(ref MMI.EBuLa.Tools.XMLLoader conf, ref SoundInterface sound)
 {
     HBL_Druck = 5f;
     HL_Druck = 5f;
     //störungmgr.Add(new Störung(ENUMStörung.S02_Trennschütz));
     störungmgr.Add(new Störung(ENUMStörung.S01_ZUSIKomm));
     localconf = conf;
     fis = new FIS(ref conf, ref sound);
 }
        public DavidControl(MMI.EBuLa.Tools.XMLLoader conf, ControlContainer cc)
        {
            if (!conf.DoubleBuffer)
            {
                //This turns off internal double buffering of all custom GDI+ drawing
                this.SetStyle(ControlStyles.DoubleBuffer, true);
                this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                this.SetStyle(ControlStyles.UserPaint, true);
                USE_DOUBLE_BUFFER = false;
            }
            else
            {
                USE_DOUBLE_BUFFER = true;
            }

            InitializeComponent();

            m_conf = conf;
            this.cc = cc;

            localstate = new DavidState();

            localstate.ICEtype = ICETYPE.ICE1;
            localstate.Type = TYPE.David2;
            localstate.DISPLAY = CURRENT_DISPLAY.D2_B;
            olddisplay = CURRENT_DISPLAY.D1_I;

            //SetButtons();
            vtime = DateTime.Now;

            InitC_druck();

            int interval = Convert.ToInt32(Math.Round((1d/(double)FramesPerSecond)*1000d));
            timer1.Interval = interval;
            timer1.Enabled = true;

            switch (m_conf.Sound)
            {
                case 1:
                    sound = new APISound();
                    break;
                case 2:
                    sound = new DxSound();
                    break;
                default:
                    sound = new NullSound();
                    break;
            }
            Button_SW_Pressed(this, new EventArgs());
        }
        public ControlContainer(MMI.EBuLa.Tools.XMLLoader XMLConf)
        {
            InitializeComponent();

            m_XMLConf = XMLConf;

            try
            {
                //m_parent = gotParent;
                m_widget = new ET42XControl(XMLConf, ref net);
                P_Display.Controls.Add(m_widget);
                if (m_XMLConf.Inverse)
                {
                    m_widget.Inverse();
                }
                else
                {
                    /*m_widget.Inverse();
                    m_widget.Inverse();*/
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Fehler beim Erstellen des Widgets! ("+e.Message+")");
            }

            try
            {
                pB_EBuLa.Image = new Bitmap(BACKGROUND_IMAGE);
            }
            catch(Exception)
            {
                MessageBox.Show("Fehler! Das Hintergrundbild \""+BACKGROUND_IMAGE+"\" konnte nicht geladen werden!");
            }

            net = new Network(ref m_widget);

            if (t == null)
            {
                t = new Thread(new ThreadStart(net.Connect));
                t.IsBackground = true;
                t.Priority = m_XMLConf.thread_prio;
                t.Start();
                Thread.Sleep(1);
            }

            m_widget.m_net = net;
        }
Example #8
0
        public Switcher(ref MMI.ICE3.ICE3State s, bool topMost)
        {
            //
            // Erforderlich für die Windows Form-Designerunterstützung
            //
            InitializeComponent();
            m_state = s;

            if (s.ICEtype1 == ICE3TYPE.ICE403)
                rb_403_1.Checked = true;
            else if (s.ICEtype1 == ICE3TYPE.ICE406)
                rb_406_1.Checked = true;
            else if (s.ICEtype1 == ICE3TYPE.ICE411)
                rb_411_1.Checked = true;
            else if (s.ICEtype1 == ICE3TYPE.ICE415)
                rb_415_1.Checked = true;
            else if (s.ICEtype1 == ICE3TYPE.ICE415_2)
                rb_415_415_1.Checked = true;
            else if (s.ICEtype1 == ICE3TYPE.ICE605)
                rb_605_1.Checked = true;
            else if (s.ICEtype1 == ICE3TYPE.ICE605_2)
                rb_605_605_1.Checked = true;

            if (s.ICEtype2 == ICE3TYPE.ICE403)
                rb_403_2.Checked = true;
            else if (s.ICEtype2 == ICE3TYPE.ICE406)
                rb_406_2.Checked = true;
            else if (s.ICEtype2 == ICE3TYPE.ICE411)
                rb_411_2.Checked = true;
            else if (s.ICEtype2 == ICE3TYPE.ICE415)
                rb_415_2.Checked = true;
            else if (s.ICEtype2 == ICE3TYPE.ICE415_2)
                rb_415_415_2.Checked = true;
            else if (s.ICEtype2 == ICE3TYPE.ICE605)
                rb_605_2.Checked = true;
            else if (s.ICEtype2 == ICE3TYPE.ICE605_2)
                rb_605_605_2.Checked = true;

            if (m_state.addtionalhours)
                cb_12std.Checked = true;

            tB_ZugNr.Text = s.Zugnummer;

            this.TopMost = topMost;
        }
Example #9
0
        public Switcher(ref MMI.VT612.VT612State s, bool topMost)
        {
            //
            // Erforderlich für die Windows Form-Designerunterstützung
            //
            InitializeComponent();
            m_state = s;

            if (s.VT612type1 == VT612TYPE.VT611)
            {
                rb_611_1.Checked = true;
                rb_611_1_CheckedChanged(this, new EventArgs());
            }
            else if (s.VT612type1 == VT612TYPE.VT612)
            {
                rb_612_1.Checked = true;
                rb_612_1_CheckedChanged(this, new EventArgs());
            }

            if (s.VT612type2 == VT612TYPE.VT611)
                rb_611_2.Checked = true;
            else if (s.VT612type2 == VT612TYPE.VT612)
                rb_612_2.Checked = true;
            else
                rb_kein_2.Checked = true;

            if (s.VT612type3 == VT612TYPE.VT611)
                rb_611_3.Checked = true;
            else if (s.VT612type3 == VT612TYPE.VT612)
                rb_612_3.Checked = true;
            else
                rb_kein_3.Checked = true;

            if (s.VT612type4 == VT612TYPE.VT611)
                rb_611_4.Checked = true;
            else if (s.VT612type4 == VT612TYPE.VT612)
                rb_612_4.Checked = true;
            else
                rb_kein_4.Checked = true;

            if (m_state.addtionalhours)
                cb_12std.Checked = true;

            this.TopMost = topMost;
        }
Example #10
0
        public vStripsPlugin()
        {
            // Get IP address of vStrips host from config
            IPAddress ip;

            if (IPAddress.TryParse(Properties.Settings.Default.vStripsHost, out ip))
            {
                vStripsConnector.HostIP = ip;
            }
            else
            {
                vStripsConnector.HostIP = IPAddress.Loopback;
                Properties.Settings.Default.vStripsHost = IPAddress.Loopback.ToString();
            }

            vStripsConnector.Start();
            setupWindowMenu             = new CustomToolStripMenuItem(CustomToolStripMenuItemWindowType.Main, CustomToolStripMenuItemCategory.Settings, new ToolStripMenuItem("vStrips INTAS"));
            setupWindowMenu.Item.Click += SetupWindowMenu_Click;
            MMI.AddCustomMenuItem(setupWindowMenu);

            MMI.SelectedTrackChanged += MMI_SelectedTrackChanged;                                           // Subscribe to Selected Track change event JMG
        }
Example #11
0
        private void ProcessData(string packet)
        {
            if (packet.Length == 0)
            {
                return;
            }

            string msg = packet.Substring(1);

            string[] msg_fields = msg.Split(':');

            FDP2.FDR fdr = null;
            if (msg_fields.Length > 0)
            {
                fdr = FDP2.GetFDRs.FirstOrDefault(f => f.Callsign == msg_fields[0]);
            }

            switch (packet[0])
            {
            case 'U':
                if (!connected)
                {
                    OnConnected();
                }
                SendControllerInfo();
                break;

            case 'r':                            // Runway request
                if (Airport?.ICAOName != msg)    // || setRunways == false)                            // Commented out as part of  runway supression
                {
                    getMetar(msg);               // Call before we update 'Airport'
                    Airport    = Airspace2.GetAirport(msg);
                    setRunways = false;
                    //vStripsPlugin.ShowSetupWindow();                                             // Commented out to stop popup JMG
                }
                else
                {
                    //SendRunways();

                    Airport = Airspace2.GetAirport(msg);
                }
                break;

            case 'S':                                                                                   // State
                if (msg_fields.Length > 1 && fdr != null)
                {
                    switch (msg_fields[1])
                    {
                    case "TAXI":
                        MMI.EstFDR(fdr);
                        break;
                    }
                }
                break;

            /*
             * JMG
             * vStrips doesn't send Arrival Runway, so we use Dep runway in vStrips for Arrival runway allocation.
             * We need to keep an eye out when Route changes received that have a Dep runway and reassign to Arr runway.
             *
             */
            case 'R':                                                                                       // Route
                if (msg_fields.Length > 3 && fdr != null)
                {
                    if (fdr.DepAirport == msg_fields[1] && fdr.DesAirport == msg_fields[2])
                    {
                        string   rte        = msg_fields[3];
                        string[] rte_fields = rte.Split(' ');                                               // parse route on space


                        if (rte_fields[0].Contains('/'))                                                    // If the first field has a slash,  it's a Dep runway assignment.
                        {
                            string[] start_fields = rte_fields[0].Split('/');
                            String   NewRwy       = start_fields[1];                                        // get the runway

                            if (fdr.CoupledTrack?.OnGround == false)                                        // if we're airborne apply the runway to Arrivals
                            {
                                FDP2.SetArrivalRunway(fdr, Airspace2.GetRunway(fdr.DesAirport, NewRwy));
                            }
                            else                                                                            // Apply the Route change, or Dep runway change
                            {
                                string temprwy = "";
                                if (fdr.DepartureRunway != null)
                                {
                                    temprwy = fdr.DepartureRunway.ToString();
                                }

                                if (temprwy != NewRwy)                                                      // if the Dep runway has changed
                                {
                                    FDP2.SetDepartureRunway(fdr, Airspace2.GetRunway(fdr.DepAirport, NewRwy));
                                }
                                else                                                                        // Not a runway change, so update the route
                                {
                                    FDP2.ModifyRoute(fdr, rte);
                                }
                            }
                        }
                    }
                    else
                    {
                        FDP2.ModifyFDR(fdr, fdr.Callsign, fdr.FlightRules, msg_fields[1], msg_fields[2], msg_fields[3], fdr.Remarks, fdr.AircraftCount.ToString(), fdr.AircraftType, fdr.AircraftWake, fdr.AircraftEquip, fdr.AircraftSurvEquip, fdr.TAS.ToString(), fdr.RFL.ToString(), fdr.ETD.ToString("HHmm"), fdr.EET.ToString("HHmm"));
                    }
                }
                break;

            case 'H':                                                                                       // Heading
                if (msg_fields.Length > 1 && fdr != null)
                {
                    vStripsAssignedHeadings.AddOrUpdate(fdr.Callsign, int.Parse(msg_fields[1]), (s, i) => int.Parse(msg_fields[1]));

                    if (!string.IsNullOrEmpty(msg_fields[1]) && msg_fields[1] != "0")
                    {
                        FDP2.SetGlobalOps(fdr, $"H{msg_fields[1]}");
                    }

                    if (msg_fields.Length > 2 && msg_fields[2] != "0")
                    {
                        FDP2.SetCFL(fdr, FDP2.FDR.LEVEL_NONE, int.Parse(msg_fields[2]), false);
                    }
                }
                break;

            case '>':                                                                                   // Select Callsign
                // Edited JMG to ensure when strip is selected in vStrips, track is selected in vatSys
                if (fdr != null)
                {
                    var currentSelection = MMI.SelectedTrack;                                           // Deselect old
                    if (MMI.SelectedTrack != null)
                    {
                        MMI.SelectOrDeselectTrack(currentSelection);
                    }

                    var trk = MMI.FindTrack(fdr);
                    if (trk != null)
                    {
                        MMI.SelectOrDeselectTrack(trk);
                    }
                }
                break;
            }

            PacketReceived?.Invoke(this, new PacketReceivedEventArgs(packet));
            Console.WriteLine(packet);
        }
Example #12
0
        public Switcher(ref MMI.ET42X.ET42XState s, bool topMost)
        {
            //
            // Erforderlich für die Windows Form-Designerunterstützung
            //
            InitializeComponent();
            m_state = s;

            if (s.ET42Xtype1 == ET42XTYPE.ET423)
            {
                rb_423_1.Checked = true;
                rb_423_1_CheckedChanged(this, new EventArgs());
            }
            else if (s.ET42Xtype1 == ET42XTYPE.ET424)
            {
                rb_424_1.Checked = true;
                rb_424_1_CheckedChanged(this, new EventArgs());
            }
            else if (s.ET42Xtype1 == ET42XTYPE.ET425)
            {
                if (s.FISType == FIS_TYPE.GPS_FIS)
                {
                    rb_425_2BS_1.Checked = true;
                    rb_425_1_CheckedChanged(this, new EventArgs());
                }
                else if (s.FISType == FIS_TYPE.FIS)
                {
                    rb_425_1.Checked = true;
                    rb_425_1_CheckedChanged(this, new EventArgs());
                }
            }
            else if (s.ET42Xtype1 == ET42XTYPE.ET426)
            {
                rb_426_1.Checked = true;
                rb_425_1_CheckedChanged(this, new EventArgs());
            }

            if (s.ET42Xtype2 == ET42XTYPE.ET423)
                rb_423_2.Checked = true;
            else if (s.ET42Xtype2 == ET42XTYPE.ET424)
                rb_424_2.Checked = true;
            else if (s.ET42Xtype2 == ET42XTYPE.ET425)
                rb_425_2.Checked = true;
            else if (s.ET42Xtype2 == ET42XTYPE.ET426)
                rb_426_2.Checked = true;
            else
                rb_kein_2.Checked = true;

            if (s.ET42Xtype3 == ET42XTYPE.ET423)
                rb_423_3.Checked = true;
            else if (s.ET42Xtype3 == ET42XTYPE.ET424)
                rb_424_3.Checked = true;
            else if (s.ET42Xtype3 == ET42XTYPE.ET425)
                rb_425_3.Checked = true;
            else if (s.ET42Xtype3 == ET42XTYPE.ET426)
                rb_426_3.Checked = true;
            else
                rb_kein_3.Checked = true;

            if (m_state.addtionalhours)
                cb_12std.Checked = true;

            l_Energie.Text = Math.Round(m_state.Energie / 1000d,0).ToString() + " kWh";

            this.TopMost = topMost;
        }
        public VT612Control(MMI.EBuLa.Tools.XMLLoader conf)
        {
            if (!conf.DoubleBuffer)
            {
                //This turns off internal double buffering of all custom GDI+ drawing
                this.SetStyle(ControlStyles.DoubleBuffer, true);
                this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                this.SetStyle(ControlStyles.UserPaint, true);
                USE_DOUBLE_BUFFER = false;
            }
            else
                USE_DOUBLE_BUFFER = true;

            InitializeComponent();

            uhrAußen = new ISphere(468+80, 41+80, 74);
            uhrInnengr = new ISphere(468+80, 41+80, 62);
            uhrInnenkl = new ISphere(468+80, 41+80, 69);
            uhrsec = new ISphere(468+80, 41+80, 60);
            uhrmin = new ISphere(468+80, 41+80, 60);
            uhrstd = new ISphere(468+80, 41+80, 47);
            uhrrest = new ISphere(468+80, 41+80, 10);
            center = new Point(468+80, 41+80);

            m_conf = conf;

            localstate = new MMI.VT612.VT612State();

            // NOTBREMSE und E-BREMSE fehlen

            SetButtons();

            vtime = DateTime.Now;

            zugkraft_thread = new Thread(new ThreadStart(MoveZugkraft));

            int interval = Convert.ToInt32(Math.Round((1d/(double)conf.FramesPerSecondLow)*1000d));
            timer1.Interval = interval;
            timer1.Enabled = true;
        }
        public DIAGNOSEControl(MMI.EBuLa.Tools.XMLLoader conf, ref MMI.MMIBR185.BR185Control mmi)
        {
            if (!conf.DoubleBuffer)
            {
                //This turns off internal double buffering of all custom GDI+ drawing
                this.SetStyle(ControlStyles.DoubleBuffer, true);
                this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                this.SetStyle(ControlStyles.UserPaint, true);
                USE_DOUBLE_BUFFER = false;
            }
            else
                USE_DOUBLE_BUFFER = true;

            InitializeComponent();

            center = new Point(468+80, 30+80);

            uhrAußenList = (new ISphere(468+80, 30+80, 74)).PointList();
            uhrInnenklList = (new ISphere(468+80, 30+80, 69)).PointList();
            uhrInnengrList = (new ISphere(468+80, 30+80, 62)).PointList();
            uhrminList = (new ISphere(468+80, 30+80, 60)).PointList();
            uhrstdList = (new ISphere(468+80, 30+80, 47)).PointList();
            uhrsecList = (new ISphere(468+80, 30+80, 60)).PointList();
            uhrrestList = (new ISphere(468+80, 30+80, 10)).PointList();

            m_conf = conf;

            mmi_widget = mmi;

            localstate = new MMI.DIAGNOSE.DIAGNOSEState();

            localstate.Energie = conf.Energie;

            something_changed = true;

            // NOTBREMSE und E-BREMSE fehlen

            vtime = DateTime.Now;

            zugkraft_thread = new Thread(new ThreadStart(MoveZugkraft));

            int interval = Convert.ToInt32(Math.Round((1d/(double)conf.FramesPerSecondLow)*1000d));
            timer1.Interval = interval;
            timer1.Enabled = true;

            switch (m_conf.Sound)
            {
                case 1:
                    Sound = new APISound();
                    break;
                case 2:
                    Sound = new DxSound();
                    break;
                default:
                    Sound = new NullSound();
                    break;
            }
            Button_SW_Pressed(this, new EventArgs());

            mmi_widget.PREVENT_DRAW = true;
            /*
            try
            {
                // Now  setup our D3D stuff
                Microsoft.DirectX.Direct3D.PresentParameters presentParams = new Microsoft.DirectX.Direct3D.PresentParameters();
                presentParams.Windowed=true;
                presentParams.SwapEffect = Microsoft.DirectX.Direct3D.SwapEffect.Discard;
                device = new Microsoft.DirectX.Direct3D.Device(0, Microsoft.DirectX.Direct3D.DeviceType.Hardware, this,
                    Microsoft.DirectX.Direct3D.CreateFlags.HardwareVertexProcessing, presentParams);
            }
            catch (Exception) {}
            */
        }
        public EbulaControl(MMI.EBuLa.Tools.XMLLoader XMLConf, bool isDAVID)
        {
            //This turns off internal double buffering of all custom GDI+ drawing
            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);

            // Dieser Aufruf ist für den Windows Form-Designer erforderlich.
            InitializeComponent();

            try
            {
                InitSpeedBar();

                // Setze Virtuelle Zeit auf Reale Zeit
                vtime = new DateTime(System.DateTime.Now.Ticks);

                // Zeitmesser (basiert auf RealZeit)
                vdifftime = new DateTime(System.DateTime.Now.Ticks);

                vtimer = new System.Timers.Timer();
                vtimer.Enabled = true;
                vtimer.Interval = 950;
                vtimer.SynchronizingObject = this;
                vtimer.Elapsed += new System.Timers.ElapsedEventHandler(this.vtimer_Elapsed);

                g = this.CreateGraphics();

                verspaetung = 0;
                B_GNT.Enabled = false;

                control = new Control(verspaetung, XMLConf);
                control.use_DB = XMLConf.UseDB;

                //control.LoadTrainDEBUG();
                control.Route = new Route("", "");
                control.Route.Position = -1;

                control.vtime = vtime;

                m_conf = XMLConf;

                if (XMLConf.Sound == 0)
                {
                    Sound = new NullSound();
                    control.sound = false;
                }
                else
                {
                    switch (XMLConf.Sound)
                    {
                        case 1:
                            Sound = new APISound();
                            break;
                        case 2:
                            Sound = new DxSound();
                            break;
                    }
                    control.sound = true;
                }

                net = new Network(isDAVID);
                if (net != null)
                {
                    net.setControl(ref control);

                    if (t == null)
                    {
                        t = new Thread(new ThreadStart(net.Connect));
                        t.IsBackground = true;
                        t.Start();
                        Thread.Sleep(0);
                    }
                }

                L_TOP.Location = new Point(260, L_TOP.Location.Y);
                L_DOWN.Location = new Point(260, L_DOWN.Location.Y);

                fsdwason = true;
                SetButtons(false);

                if (control.sound) Sound.PlaySound();

                UpdateControl();

                this.Focus();
            }
            catch (Exception e)
            {
               MessageBox.Show("Fehler beim Erstellen der EBuLa Anzeige! ("+e.Message.ToString()+")");
            }
        }
 public EbulaControl(MMI.EBuLa.Tools.XMLLoader XMLConf)
     : this(XMLConf, false)
 {
 }
Example #17
0
 public static void ShowSetupWindow()
 {
     MMI.InvokeOnGUI((System.Windows.Forms.MethodInvoker) delegate() { DoShowSetupWindow(); });
 }
        public ControlContainer(MMI.EBuLa.Tools.XMLLoader XMLConf)
        {
            InitializeComponent();

            m_XMLConf = XMLConf;

            try
            {
                //m_parent = gotParent;
                mmi_widget = new MMI.MMIBR185.BR185Control(XMLConf, true);
                mmi_widget.Button_6_Pressed(this, new EventArgs());

                m_widget = new DIAGNOSEControl(XMLConf,ref mmi_widget);
                P_Display.Controls.Add(m_widget);
                if (m_XMLConf.Inverse)
                {
                    m_widget.Inverse();
                }
                else
                {
                    /*m_widget.Inverse();
                    m_widget.Inverse();*/
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Fehler beim Erstellen des Widgets! ("+e.Message+")");
            }

            try
            {
                if (m_widget.IsSiemens())
                {
                    if (System.IO.File.Exists(BACKGROUND_IMAGE_SIEMENS))
                    {
                        // change to siemens
                        pB_EBuLa.Image = new Bitmap(BACKGROUND_IMAGE_SIEMENS);
                    }
                }
                else
                {
                    if (m_widget.IsBR101())
                    {
                        if (System.IO.File.Exists(BACKGROUND_IMAGE_ADTRANZ))
                        {
                            // change to adtranz
                            pB_EBuLa.Image = new Bitmap(BACKGROUND_IMAGE_ADTRANZ);
                        }
                    }
                    else
                    {
                        if (System.IO.File.Exists(BACKGROUND_IMAGE_BOMBARDIER))
                        {
                            // change to bombardier
                            pB_EBuLa.Image = new Bitmap(BACKGROUND_IMAGE_BOMBARDIER);
                        }
                    }
                }
            }
            catch(Exception)
            {
                MessageBox.Show("Fehler! Das Hintergrundbild \""+BACKGROUND_IMAGE_BOMBARDIER+"\" konnte nicht geladen werden!");
            }

            net = new Network(ref m_widget);
            net2 = new MMIBR185.Network(ref mmi_widget);
            net2.isEmbeded = true;

            if (t == null)
            {
                t = new Thread(new ThreadStart(net.Connect));
                t.IsBackground = true;
                t.Priority = m_XMLConf.thread_prio;
                t.Start();
                Thread.Sleep(1);
            }

            if (t2 == null)
            {
                t2 = new Thread(new ThreadStart(net2.Connect));
                t2.IsBackground = true;
                t2.Priority = m_XMLConf.thread_prio;
                t2.Start();
                Thread.Sleep(1);
            }
        }
Example #19
0
 public void SetStatus(MMI.EBuLa.Tools.ENUMStörung Stoerung, bool delete)
 {
     if (delete)
     {
         if (Stoerung == MMI.EBuLa.Tools.ENUMStörung.S11_ZUSIKomm)
             c.ZUSI_AT_TCP_SERVER = false;
     }
     else
     {
         if (Stoerung == MMI.EBuLa.Tools.ENUMStörung.S11_ZUSIKomm)
             c.ZUSI_AT_TCP_SERVER = true;
     }
     c.something_changed = true;
 }
        public ET42XControl(MMI.EBuLa.Tools.XMLLoader conf, ref Network net)
        {
            if (!conf.DoubleBuffer)
            {
                //This turns off internal double buffering of all custom GDI+ drawing
                this.SetStyle(ControlStyles.DoubleBuffer, true);
                this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                this.SetStyle(ControlStyles.UserPaint, true);
                USE_DOUBLE_BUFFER = false;
            }
            else
                USE_DOUBLE_BUFFER = true;

            InitializeComponent();

            m_net = net;

            uhrAußen = new ISphere(508+60, 41+60, 57);
            uhrInnengr = new ISphere(508+60, 41+60, 45);
            uhrInnenkl = new ISphere(508+60, 41+60, 52);
            uhrsec = new ISphere(508+60, 41+60, 43);
            uhrmin = new ISphere(508+60, 41+60, 43);
            uhrstd = new ISphere(508+60, 41+60, 28);
            uhrrest = new ISphere(508+60, 41+60, 7);
            center = new Point(508+60, 41+60);

            m_conf = conf;

            // NOTBREMSE und E-BREMSE fehlen

            switch (m_conf.Sound)
            {
                case 1:
                    Sound = new APISound();
                    break;
                case 2:
                    Sound = new DxSound();
                    break;
                default:
                    Sound = new NullSound();
                    break;
            }

            localstate = new MMI.ET42X.ET42XState(ref conf, ref Sound);

            SetButtons();

            localstate.Energie = conf.Energie;

            vtime = DateTime.Now;

            zugkraft_thread = new Thread(new ThreadStart(MoveZugkraft));

            int interval = Convert.ToInt32(Math.Round((1d/(double)conf.FramesPerSecondLow)*1000d));
            timer1.Interval = interval;
            timer1.Enabled = true;

            Button_SW_Pressed(this, new EventArgs());

            /*if (localstate.ET42Xtype1 == ET42XTYPE.ET423)
                localstate.FISType = FIS_TYPE.FIS;*/

            timer2.Enabled = true;

            if (vtime.DayOfYear > 100 && vtime.DayOfYear < 300)
                localstate.Kuehlung = true;
            else
                localstate.Kuehlung = false;
        }
Example #21
0
 public void SetStatus(MMI.EBuLa.Tools.ENUMStörung Stoerung, bool delete)
 {
     if (delete)
     {
         c.localstate.störungmgr.DeleteStörung(Stoerung);
     }
     else
     {
         MMI.EBuLa.Tools.Störung st = new MMI.EBuLa.Tools.Störung(MMI.EBuLa.Tools.ENUMStörung.S11_ZUSIKomm);
         c.localstate.störungmgr.Add(st);
     }
 }
Example #22
0
 public Control(int vers, MMI.EBuLa.Tools.XMLLoader xc)
 {
     verspaetung = vers;
     XMLConf = xc;
     LoadProps();
 }
Example #23
0
 public void SetStatus(MMI.EBuLa.Tools.ENUMStörung Stoerung)
 {
     SetStatus(Stoerung, false);
 }
Example #24
0
 public void setControl(ref MMI.EBuLa.Control cont)
 {
     c = cont;
 }
        public ICE3Control(MMI.EBuLa.Tools.XMLLoader conf, ControlContainer cc)
        {
            if (!conf.DoubleBuffer)
            {
                //This turns off internal double buffering of all custom GDI+ drawing
                this.SetStyle(ControlStyles.DoubleBuffer, true);
                this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                this.SetStyle(ControlStyles.UserPaint, true);
                USE_DOUBLE_BUFFER = false;
            }
            else
                USE_DOUBLE_BUFFER = true;

            InitializeComponent();

            schw.Initialize();
            tür.Initialize();

            m_conf = conf;
            this.cc = cc;
            localstate = new ICE3State();

            localstate.ICEtype1 = ICE3TYPE.ICE403;
            localstate.ICEtype2 = ICE3TYPE.NONE;
            //localstate.Type = TYPE.David2;
            if (localstate.Type == TYPE.David1)
            {
                localstate.DISPLAY = CURRENT_DISPLAY.D1_Grundb;
            }
            else
            {
                localstate.DISPLAY = CURRENT_DISPLAY.D2_Zustand;
            }
            //olddisplay = CURRENT_DISPLAY.D1_Grundb;

            switch (m_conf.Sound)
            {
                case 1:
                    sound = new APISound();
                    break;
                case 2:
                    sound = new DxSound();
                    break;
                default:
                    sound = new NullSound();
                    break;
            }

            //SetButtons();
            vtime = DateTime.Now;

            InitC_druck();

            threadDelegate_Türen = new ThreadStart(SetUpTüren);

            int interval = Convert.ToInt32(Math.Round((1d/(double)FramesPerSecond)*1000d));
            timer1.Interval = interval;
            timer1.Enabled = true;

            Button_SW_Pressed(this, new EventArgs());
        }
Example #26
0
        public Switcher(ref MMI.DIAGNOSE.DIAGNOSEState s, bool topMost)
        {
            //
            // Erforderlich für die Windows Form-Designerunterstützung
            //
            InitializeComponent();
            m_state = s;

            switch(m_state.type)
            {
                case TRAIN_TYPE.BR101:
                    rb_101.Checked = true;
                    break;
                case TRAIN_TYPE.BR101_MET:
                    rb_101MET.Checked = true;
                    break;
                case TRAIN_TYPE.BR145:
                    rb_145.Checked = true;
                    break;
                case TRAIN_TYPE.BR146:
                    rb_146.Checked = true;
                    break;
                case TRAIN_TYPE.BR146_1:
                    rb_146_1.Checked = true;
                    break;
                case TRAIN_TYPE.BR152:
                    rb_152.Checked = true;
                    break;
                case TRAIN_TYPE.BR182:
                    if (m_state.IsOEBB)
                        rb_1016_1116.Checked = true;
                    else
                        rb_182.Checked = true;
                    break;
                case TRAIN_TYPE.BR185:
                    rb_185.Checked = true;
                    break;
                case TRAIN_TYPE.BR189:
                    rb_189.Checked = true;
                    break;
                case TRAIN_TYPE.ER20:
                    rb_er20.Checked = true;
                    break;
            }

            switch(m_state.traction)
            {
                case 1:
                    rb_single.Checked = true;
                    break;
                case 2:
                    rb_double.Checked = true;
                    break;
                case 3:
                    rb_3times.Checked = true;
                    break;
                case 4:
                    rb_4times.Checked = true;
                    break;
            }

            if (m_state.addtionalhours)
                cb_12std.Checked = true;

            l_Energie.Text = Math.Round(m_state.Energie / 1000d,0).ToString() + " kWh";

            this.TopMost = topMost;
        }