Beispiel #1
0
        /// <summary>
        /// Internal constructor
        /// </summary>
        /// <param name="baseline">The baseline that holds the baseline region.</param>
        /// <param name="blr">The internal AeccBaselineRegion</param>
        /// <param name="i">The baseline region index</param>
        internal BaselineRegion(Baseline baseline, AeccBaselineRegion blr, int i)
        {
            this._baseline = baseline;

            this._blr = blr;

            this._index = i;

            try
            {
                this._assembly = blr.AssemblyDbEntity.DisplayName;
            }
            catch (Exception ex)
            {
                Utils.Log(string.Format("ERROR: Assembly Name Failed\t{0}", ex.Message));

                this._assembly = this._index.ToString();
            }

            try
            {
                this._start = blr.StartStation; //  Math.Round(blr.StartStation, 5);  // TODO get rid of the roundings
            }
            catch (Exception ex)
            {
                Utils.Log(string.Format("ERROR: Start Station Failed\t{0}", ex.Message));

                throw new Exception("Start Station Failed\n\n" + ex.Message);
            }

            try
            {
                this._end = blr.EndStation; //  Math.Round(blr.EndStation, 5);
            }
            catch (Exception ex)
            {
                Utils.Log(string.Format("ERROR: End Station Failed\t{0}", ex.Message));

                throw new Exception("End Station Failed\n\n" + ex.Message);
            }

            try
            {
                this._stations = blr.GetSortedStations();
            }
            catch (Exception ex)
            {
                Utils.Log(string.Format("ERROR: Sorted Stations Failed\t{0}", ex.Message));

                throw new Exception("Sorted Stations Failed\n\n" + ex.Message);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Internal constructor
        /// </summary>
        /// <param name="baseline">The baseline that holds the baseline region.</param>
        /// <param name="blr">The internal AeccBaselineRegion</param>
        /// <param name="i">The baseline region index</param>
        internal BaselineRegion(Baseline baseline, AeccBaselineRegion blr, int i)
        {
            this._baseline = baseline;

            this._blr = blr;

            this._index = i;

            try
            {
                this._assembly = blr.AssemblyDbEntity.DisplayName;
            }
            catch (Exception ex)
            {
                Utils.Log(string.Format("ERROR: Assembly Name Failed\t{0}", ex.Message));

                this._assembly = this._index.ToString();

                //throw new Exception("Assembly Name Failed\n\n" + ex.Message);
            }

            try
            {
                this._start = blr.StartStation; //  Math.Round(blr.StartStation, 5);  // TODO get rid of the roundings
            }
            catch (Exception ex)
            {
                Utils.Log(string.Format("ERROR: Start Station Failed\t{0}", ex.Message));

                throw new Exception("Start Station Failed\n\n" + ex.Message);
            }

            try
            {
                this._end = blr.EndStation; //  Math.Round(blr.EndStation, 5);
            }
            catch (Exception ex)
            {
                Utils.Log(string.Format("ERROR: End Station Failed\t{0}", ex.Message));

                throw new Exception("End Station Failed\n\n" + ex.Message);
            }

            try
            {
                this._stations = blr.GetSortedStations();
            }
            catch (Exception ex)
            {
                Utils.Log(string.Format("ERROR: Sorted Stations Failed\t{0}", ex.Message));

                throw new Exception("Sorted Stations Failed\n\n" + ex.Message);
            }

            #region OLDCODE
            //foreach (AeccAppliedAssembly a in blr.AppliedAssemblies)
            //{
            //    try
            //    {
            //        this._appliedAssemblies.Add(new AppliedAssembly(this, a, a.Corridor));  // TODO: verify why this is a list instead of a single applied assembly...
            //        // break;
            //    }
            //    catch (Exception ex)
            //    {
            //        throw new Exception("Applied Assemblies Failed\n\n" + ex.Message);
            //    }
            //}

            //foreach (AppliedAssembly aa in this._appliedAssemblies)
            //{
            //    foreach (AeccAppliedSubassembly asa in aa._appliedSubassemblies)
            //    {
            //        try
            //        {
            //            this.Subassemblies.Add(new Subassembly(asa.SubassemblyDbEntity, asa.Corridor));
            //        }
            //        catch (Exception ex)
            //        {
            //            this.Subassemblies.Add(null);
            //            throw new Exception("Applied Subassemblies Failed\n\n" + ex.Message);
            //        }
            //    }
            //}
            #endregion
        }