Esempio n. 1
0
        public Signal(AnlagenElemente parent, Int32 iD, Int32 zoom, AnzeigeTyp anzeigeTyp, Point rasterPosition, bool inZeichenRichtung)
            : base(parent, iD, zoom, anzeigeTyp)
        {
            KurzBezeichnung         = "Sn";
            PositionRaster          = rasterPosition;
            Position                = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);
            Ausgang                 = new Adresse(parent);
            this._inZeichenRichtung = inZeichenRichtung;

            foreach (Gleis gl in Parent.GleisElemente.Elemente)
            {
                if (gl.GleisElementAnschluss(this))
                {
                    AnschlussGleis = gl;
                    Parent.SignalElemente.Hinzufügen(this);

                    this._stringFormat               = new StringFormat();
                    this._stringFormat.Alignment     = StringAlignment.Center;
                    this._stringFormat.LineAlignment = StringAlignment.Center;

                    this._graphicsPathHintergrund = new GraphicsPath();
                    this._graphicsPathKreis       = new GraphicsPath();
                    this._graphicsPathLinien      = new GraphicsPath();
                    this._graphicsPathText        = new GraphicsPath();

                    this._farbe = Color.Red;

                    this.Berechnung();

                    break;
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="ZugNummer"></param>
        /// <returns></returns>
        private int Konstruktor(AnlagenElemente parent, int ZugNummer)
        {
            InitializeComponent();
            _pa          = parent;
            _zugElemente = _pa.ZugElemente;
            _zugListe    = _zugElemente.Elemente;
            int aktiveZeile = -1;

            foreach (Zug x in this._zugListe)
            {
                string[] zeile =
                {
                    Convert.ToString(x.ID),
                    Convert.ToString(x.SignalNummer),
                    x.ZugTyp,
                    x.Lok,
                    x.Bezeichnung,
                    Convert.ToString(x.AnkunftsZeit),                                                             //A-Zeit
                    Convert.ToString(x.Geschwindigkeit),
                    Convert.ToString(x.DigitalAdresse),
                };
                dataGridView1.Rows.Add(zeile);
            }
            zugSuchen(3);
            //this.dataGridView1.CurrentCell = this.dataGridView1[5, 3];
            return(aktiveZeile);
        }
Esempio n. 3
0
        /// <summary>
        /// zum Laden aus der Text-Datei
        /// </summary>
        /// <param name="parent">AnlagenElemente</param>
        /// <param name="zoom"></param>
        /// <param name="anzeigeTyp"></param>
        /// <param name="elem">Zeile aus der Text-Datei</param>
        public EingangsSchalter(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, string[] elem)
            : base(parent, Convert.ToInt32(elem[1]), zoom, anzeigeTyp)
        {
            KurzBezeichnung = "Eing";
            string[] glAnschl = elem[2].Split(' ');

            Ausgang.SpeicherString = elem[3];
            Bezeichnung            = elem[4];
            Stecker = elem[5];

            Gleis gl = Parent.GleisElemente.Element(Convert.ToInt32(glAnschl[0]));

            Gleisposition = Convert.ToInt32(glAnschl[1]);
            if (gl != null)
            {
                PositionRaster = gl.GetRasterPosition(this, Convert.ToInt32(glAnschl[1]));
                Position       = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);
                {
                    AnschlussGleis = gl;
                    Parent.EingSchalterElemente.Hinzufügen(this);
                    _graphicsPath      = new GraphicsPath();
                    _graphicsPathKreis = new GraphicsPath();
                    this.Berechnung();
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Konstruktor zum laden aus der .anl-Datei
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="zoom"></param>
        /// <param name="anzeigeTyp"></param>
        /// <param name="elem"></param>
        public InfoFenster(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, string[] elem)
            : base(parent, Convert.ToInt32(elem[1]), zoom, anzeigeTyp)
        {
            string[] glAnschl = elem[2].Split(' ');
            Gleis    gl       = Parent.GleisElemente.Element(Convert.ToInt32(glAnschl[0]));

            Gleisposition = Convert.ToInt32(glAnschl[1]);
            if (elem[3] == "0")
            {
                _lage = false;
            }
            else
            {
                _lage = Convert.ToBoolean(elem[3]);
            }
            if (gl != null)
            {
                PositionRaster = gl.GetRasterPosition(this, Convert.ToInt32(glAnschl[1]));
                Position       = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);
                AnschlussGleis = gl;

                Parent.InfoElemente.Hinzufügen(this);
                this.Text = "";                //InfoString;
                this.Berechnung();
            }
        }
Esempio n. 5
0
        public FahrstrasseK(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, string[] elem, string fsListe, string befehle)
            : base(parent, Convert.ToInt32(elem[1]), zoom, anzeigeTyp)
        {
            _fahrStrassen = new List <FahrstrasseN>();
            if (!EinlesenFahrstrassenListe(_fahrStrassen, fsListe))
            {
                return;
            }

            this._startSignal = _fahrStrassen.First().StartSignal;
            this._endSignal   = _fahrStrassen.Last().EndSignal;

            string[] spString;
            spString = befehle.Trim().Split('\t');
            if (spString[0] == "Befehle")
            {
                _befehle = new List <Befehl>();
                if (!this.EinlesenBefehlsliste(_befehle, spString))
                {
                    return;
                }
            }
            else
            {
                return;
            }

            Parent.FahrstrassenKElemente.Hinzufügen(this);
            Berechnung();
        }
Esempio n. 6
0
        //private bool _aktiv = true;

        public BefehlsListe(AnlagenElemente Parent, bool AusgangsStellung, string Listenstring)
        {
            _parent = Parent;
            //_aktiv = AusgangsStellung;
            _listenString = Listenstring;
            ListeAktivieren();
        }
Esempio n. 7
0
        public Schalter(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, string[] elem)
            : base(parent, Convert.ToInt32(elem[1]), zoom, anzeigeTyp)
        {
            string[] glAnschl = elem[2].Split(' ');
            Gleis    gl       = Parent.GleisElemente.Element(Convert.ToInt32(glAnschl[0]));

            if (elem.Length > 4)
            {
                KoppelungsString = elem[4];
            }
            if (gl != null)
            {
                PositionRaster = gl.GetRasterPosition(this, Convert.ToInt32(glAnschl[1]));
                Position       = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);

                if (gl.GleisElementAnschluss(this))
                {
                    AnschlussGleis = gl;
                    Ausgang        = AnschlussGleis.Ausgang;

                    Parent.SchalterElemente.Hinzufügen(this);
                    _graphicsPath = new GraphicsPath();

                    this.Berechnung();
                }
            }
        }
Esempio n. 8
0
 public EditKommando(EditAction aktion, ElementTyp elementTyp, AnlagenElemente anlagenElemente, object value)
 {
     _aktion          = aktion;
     _elementTyp      = elementTyp;
     _neuerWert       = value;
     _anlagenElemente = anlagenElemente;
 }
Esempio n. 9
0
 public Zug(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, string[] elem)
     : base(parent, Convert.ToInt32(elem[1]), zoom, anzeigeTyp)
 {
     //infoFenster = null; //parent.InfoElemente.Element(Convert.ToInt32(elem[2]));
     //signalNr = Convert.ToInt32( elem[2] );
     Parent.ZugElemente.Hinzufügen(this);
     _signalNr = Convert.ToInt32(elem[2]);
     _lok      = elem[3];
     _typ      = elem[4];
     if (elem[5] != "")
     {
         _geschwindigkeit = Convert.ToInt16(elem[5]);
     }
     Bezeichnung = elem[6];
     if (elem.Length > 7)
     {
         _laenge = Convert.ToInt32(elem[7]);
     }
     if (elem.Length > 8)
     {
         _digitalAdresse = Convert.ToInt16(elem[8]);
     }
     if (elem.Length > 9)
     {
         _ankunftZeit = Convert.ToDateTime(elem[9]);
     }
 }
Esempio n. 10
0
 /// <summary>
 /// Konstruktor für Element Vorschau beim neuzeichnen
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="zoom"></param>
 /// <param name="anzeigeTyp"></param>
 /// <param name="rasterPosition"></param>
 public InfoFenster(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, Point rasterPosition)
     : base(parent, 0, zoom, anzeigeTyp)
 {
     PositionRaster = rasterPosition;
     Position       = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);
     _txt           = "Infofeld";
     this.Berechnung();
 }
Esempio n. 11
0
 public Haltestelle(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, string[] elem)
     : base(parent, Convert.ToInt32(elem[1]), zoom, anzeigeTyp)
 {
     infoFenster      = parent.InfoElemente.Element(Convert.ToInt32(elem[2]));
     text             = "HS " + ID;
     infoFenster.Text = text;
     Parent.HaltestellenElemente.Hinzufügen(this);
 }
Esempio n. 12
0
 public Anschluss(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, string[] elem)
     : base(parent, Convert.ToInt32(elem[1]), zoom, anzeigeTyp)
 {
     KurzBezeichnung  = "Anschl";
     this.Bezeichnung = elem[2];
     this.Stecker     = elem[3];
     Parent.AnschlussElemente.Hinzufügen(this);
 }
Esempio n. 13
0
 public Entkuppler(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, Point rasterPosition)
     : base(parent, 0, zoom, anzeigeTyp)
 {
     PositionRaster  = rasterPosition;
     Position        = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);
     KurzBezeichnung = "Ek";
     this.Berechnung();
 }
Esempio n. 14
0
 public Adresse(AnlagenElemente parent, int nrArduino, int nrAdresse, int nrBit)
 {
     _parent    = parent;
     MCNr       = nrArduino;
     _adresseNr = nrAdresse;
     _bitNr     = nrBit;
     MCSpeicherEintragen();
 }
Esempio n. 15
0
 public Schalter(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, Point rasterPosition)
     : base(parent, 0, zoom, anzeigeTyp)
 {
     _graphicsPath  = new GraphicsPath();
     PositionRaster = rasterPosition;
     Position       = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);
     this.Berechnung();
 }
Esempio n. 16
0
        public Knoten(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, Point positionRaster)
            : base(parent, 0, zoom, anzeigeTyp)
        {
            PositionRaster     = positionRaster;
            Position           = new Point(positionRaster.X * zoom, positionRaster.Y * zoom);
            this._graphicsPath = new GraphicsPath();

            this._füllFarbe = Color.White;
            this.Berechnung();
        }
Esempio n. 17
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="iD"></param>
 /// <param name="zoom"></param>
 /// <param name="anzeigeTyp"></param>
 public AnlagenElement(AnlagenElemente parent, Int32 iD, Int32 zoom, AnzeigeTyp anzeigeTyp)
 {
     this._parent                = parent;
     this._iD                    = iD;
     this._zoom                  = zoom;
     this._anzeigenTyp           = anzeigeTyp;
     this._passiv                = false;
     this._bezeichnung           = "";
     this._kopplungsBefehlsListe = null;
 }
Esempio n. 18
0
        public Gleis(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, Knoten startKnoten, Knoten endKnoten)
            : base(parent, 0, zoom, anzeigeTyp)
        {
            _graphicsPath   = new GraphicsPath();
            KurzBezeichnung = "Gl";
            StartKn         = startKnoten;
            EndKn           = endKnoten;

            this.Berechnung();
        }
Esempio n. 19
0
 public StartSignalGruppe(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, string[] elem)
     : base(parent, Convert.ToInt32(elem[1]), zoom, anzeigeTyp)
 {
     Parent.SsgElemente.Hinzufügen(this);
     this._stringFormat = new StringFormat();
     PositionRaster     = new Point(Convert.ToInt32(elem[2]), Convert.ToInt32(elem[3]));
     TypeListenString   = elem[4];
     Bezeichnung        = elem[5];
     SignalString       = elem[6];
 }
Esempio n. 20
0
 public FSS(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, Point rasterPosition)
     : base(parent, 0, zoom, anzeigeTyp)
 {
     KurzBezeichnung         = "Fss";
     this._graphicsPath      = new GraphicsPath();
     this._graphicsPathKreis = new GraphicsPath();
     PositionRaster          = rasterPosition;
     Position = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);
     this.Berechnung();
 }
Esempio n. 21
0
        ///// <summary>
        /////
        ///// </summary>
        ///// <param name="elementListe"></param>
        //public FahrstrasseK(AnlagenElement[] elementListe)
        //: base(elementListe[0].Parent, elementListe[0].Parent.FahrstrassenElemente.SucheFreieNummer(), elementListe[0].Zoom, elementListe[0].AnzeigenTyp) {
        //	Berechnung();
        //}

        public FahrstrasseK(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, List <FahrstrasseN> fsListe, string befehlsString)
            : base(parent, parent.FahrstrassenKElemente.SucheFreieNummer(), zoom, anzeigeTyp)
        {
            _fahrStrassen      = fsListe;
            this.BefehleString = befehlsString;
            this._startSignal  = _fahrStrassen.First().StartSignal;
            this._endSignal    = _fahrStrassen.Last().EndSignal;

            Parent.FahrstrassenKElemente.Hinzufügen(this);
            Berechnung();
        }
Esempio n. 22
0
        public Knoten(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, string[] elem)
            : base(parent, Convert.ToInt32(elem[1]), zoom, anzeigeTyp)
        {
            PositionRaster = new Point(Convert.ToInt32(elem[2]), Convert.ToInt32(elem[3]));
            Parent.KnotenElemente.Hinzufügen(this);

            Position           = new Point(PositionRaster.X * zoom, PositionRaster.Y * zoom);
            this._graphicsPath = new GraphicsPath();
            this._füllFarbe    = Color.White;
            this.Berechnung();
        }
Esempio n. 23
0
        /// <summary>
        /// zum Laden aus der Text-Datei
        /// </summary>
        /// <param name="parent">AnlagenElemente</param>
        /// <param name="zoom"></param>
        /// <param name="anzeigeTyp"></param>
        /// <param name="elem">Zeile aus der Text-Datei</param>
        public FSS(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, string[] elem)
            : base(parent, Convert.ToInt32(elem[1]), zoom, anzeigeTyp)
        {
            KurzBezeichnung = "Fss";
            string[] glAnschl = elem[2].Split(' ');
            _reglerNrQuelle[0] = Convert.ToInt32(elem[3]);
            _reglerNrQuelle[1] = Convert.ToInt32(elem[4]);
            _reglerNr[0]       = Convert.ToInt32(elem[3]);
            _reglerNr[1]       = Convert.ToInt32(elem[4]);
            _fss[0]            = null;
            _regler[0]         = null;
            if (_reglerNr[0] > 0)
            {
                _regler[0] = Parent.ReglerElemente.Element(_reglerNr[0]);
            }
            _fss[1]    = null;
            _regler[1] = null;
            if (_reglerNr[1] > 0)
            {
                _regler[1] = Parent.ReglerElemente.Element(_reglerNr[1]);
            }
            Ausgang.SpeicherString = elem[5];
            if (elem.Length > 7)
            {
                Bezeichnung = elem[6];
                Stecker     = elem[7];
            }
            if (elem.Length > 8)
            {
                KoppelungsString = elem[8];
            }
            if (elem.Length > 9)
            {
                sichtbarkeit = Convert.ToBoolean(elem[9]);
            }

            Gleis gl = Parent.GleisElemente.Element(Convert.ToInt32(glAnschl[0]));

            Gleisposition = Convert.ToInt32(glAnschl[1]);
            if (gl != null)
            {
                PositionRaster = gl.GetRasterPosition(this, Convert.ToInt32(glAnschl[1]));
                Position       = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);
                {
                    AnschlussGleis = gl;
                    Parent.FssElemente.Hinzufügen(this);
                    _graphicsPath      = new GraphicsPath();
                    _graphicsPathKreis = new GraphicsPath();
                    this.Berechnung();
                }
            }
        }
Esempio n. 24
0
        public Signal(AnlagenElemente parent, Int32 zoom, AnzeigeTyp anzeigeTyp, Point rasterPosition, bool inZeichenRichtung)
            : base(parent, 0, zoom, anzeigeTyp)
        {
            KurzBezeichnung         = "Sn";
            PositionRaster          = rasterPosition;
            Position                = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);
            this._inZeichenRichtung = inZeichenRichtung;

            this._graphicsPathHintergrund = new GraphicsPath();
            this._graphicsPathKreis       = new GraphicsPath();
            this._graphicsPathLinien      = new GraphicsPath();

            this._farbe = Color.Red;

            this.Berechnung();
        }
Esempio n. 25
0
        /// <summary>
        /// Konstruktor für neuzeichnen abschließen und in Liste eintragen
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="iD"></param>
        /// <param name="zoom"></param>
        /// <param name="anzeigeTyp"></param>
        /// <param name="rasterPosition"></param>
        public InfoFenster(AnlagenElemente parent, Int32 iD, Int32 zoom, AnzeigeTyp anzeigeTyp, Point rasterPosition)
            : base(parent, iD, zoom, anzeigeTyp)
        {
            PositionRaster = rasterPosition;
            Position       = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);
            foreach (Gleis gl in Parent.GleisElemente.Elemente)
            {
                if (gl.GleisElementAnschluss(this))
                {
                    AnschlussGleis = gl;
                    Parent.InfoElemente.Hinzufügen(this);

                    this.Berechnung();
                    break;
                }
            }
        }
Esempio n. 26
0
        public Weiche(AnlagenElemente parent, Int32 iD, Int32 zoom, AnzeigeTyp anzeigeTyp, Knoten node, Gleis gleis1, Gleis gleis2)
            : base(parent, iD, zoom, anzeigeTyp)
        {
            Ausgang         = new Adresse(parent);
            KurzBezeichnung = "We";
            _gleise[0]      = gleis1;
            _gleise[1]      = gleis2;
            _knoten         = node;
            Parent.WeicheElemente.Hinzufügen(this);
            this.stringFormat               = new StringFormat();
            this.stringFormat.Alignment     = StringAlignment.Far;
            this.stringFormat.LineAlignment = StringAlignment.Far;

            this.farbeFillEllipse = Color.Red;
            this.farbeLinien      = Color.Black;
            this.Berechnung();
        }
Esempio n. 27
0
 public EditKommando(EditAction aktion, AnlagenElement element, AnlagenElemente anlagenElemente, object value)
 {
     if (element is Gleis)
     {
         _elementTyp = ElementTyp.Gleis;
     }
     else if (element is Knoten)
     {
         _elementTyp = ElementTyp.Knoten;
         _alterWert  = ((Knoten)element).PositionRaster;
     }
     else if (element is Signal)
     {
         _elementTyp = ElementTyp.Signal;
         _alterWert  = ((Signal)element).PositionRaster;
     }
     else if (element is Schalter)
     {
         _elementTyp = ElementTyp.Schalter;
         _alterWert  = ((Schalter)element).PositionRaster;
     }
     else if (element is Entkuppler)
     {
         _elementTyp = ElementTyp.Entkuppler;
         _alterWert  = ((Entkuppler)element).PositionRaster;
     }
     else if (element is FSS)
     {
         _elementTyp = ElementTyp.FSS;
         _alterWert  = ((FSS)element).PositionRaster;
     }
     else if (element is InfoFenster)
     {
         _elementTyp = ElementTyp.InfoElement;
         _alterWert  = ((InfoFenster)element).PositionRaster;
     }
     else if (element is EingangsSchalter)
     {
         _elementTyp = ElementTyp.EingangsSchalter;
         _alterWert  = ((EingangsSchalter)element).PositionRaster;
     }
     _aktion          = aktion;
     _element         = element;
     _neuerWert       = value;
     _anlagenElemente = anlagenElemente;
 }
Esempio n. 28
0
 public Entkuppler(AnlagenElemente parent, Int32 iD, Int32 zoom, AnzeigeTyp anzeigeTyp, Point rasterPosition)
     : base(parent, iD, zoom, anzeigeTyp)
 {
     Ausgang         = new Adresse(parent);
     PositionRaster  = rasterPosition;
     Position        = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);
     KurzBezeichnung = "Ek";
     foreach (Gleis gl in Parent.GleisElemente.Elemente)
     {
         if (gl.GleisElementAnschluss(this))
         {
             AnschlussGleis = gl;
             Parent.EntkupplerElemente.Hinzufügen(this);
             this.Berechnung();
             break;
         }
     }
 }
Esempio n. 29
0
 public frmZugEditor(AnlagenElemente parent, int ZugNummer)
 {
     Konstruktor(parent, ZugNummer);
     foreach (DataGridViewRow zeile in this.dataGridView1.Rows)
     {
         zeile.Selected = false;
     }
     foreach (DataGridViewRow zeile in this.dataGridView1.Rows)
     {
         string zug          = (string)zeile.Cells[0].Value;
         int    tabelleZugNr = Convert.ToInt32(zug);
         if (ZugNummer == tabelleZugNr)
         {
             zeile.Cells[1].Selected = true;
             break;
         }
     }
 }
Esempio n. 30
0
 public Schalter(AnlagenElemente parent, Int32 iD, Int32 zoom, AnzeigeTyp anzeigeTyp, Point rasterPosition)
     : base(parent, iD, zoom, anzeigeTyp)
 {
     _graphicsPath  = new GraphicsPath();
     PositionRaster = rasterPosition;
     Position       = new Point(PositionRaster.X * Zoom, PositionRaster.Y * Zoom);
     foreach (Gleis gl in Parent.GleisElemente.Elemente)
     {
         if (gl.GleisElementAnschluss(this))
         {
             AnschlussGleis = gl;
             Ausgang        = AnschlussGleis.Ausgang;
             Parent.SchalterElemente.Hinzufügen(this);
             this.Berechnung();
             break;
         }
     }
 }