Ejemplo n.º 1
0
        public new static Catenary Default(ProjectUnits projectUnits)
        {
            var f_length = Unit.ft.FactorTo(projectUnits.LengthUnit);
            var f_force  = Unit.lbf.FactorTo(projectUnits.ForceUnit);

            return(new Catenary(Span.Default(projectUnits), (f_force / f_length) * DefaultWeight, f_force * DefaultHorizontalTension));
        }
Ejemplo n.º 2
0
 public ChangeEventArgs(ProjectUnits old_units, ProjectUnits new_units)
 {
     this.old_units     = new_units;
     this.new_units     = new_units;
     this.time_factor   = 1;
     this.length_factor = 1;
     this.mass_factor   = 1;
     this.force_factor  = 1;
     if (old_units.TimeUnit.IsOk && new_units.TimeUnit.IsOk)
     {
         this.time_factor = old_units.TimeUnit.Scale / new_units.TimeUnit.Scale;
     }
     if (old_units.LengthUnit.IsOk && new_units.LengthUnit.IsOk)
     {
         this.length_factor = old_units.LengthUnit.Scale / new_units.LengthUnit.Scale;
     }
     if (old_units.MassUnit.IsOk && new_units.MassUnit.IsOk)
     {
         this.mass_factor = old_units.MassUnit.Scale / new_units.MassUnit.Scale;
     }
     if (old_units.ForceUnit.IsOk && new_units.ForceUnit.IsOk)
     {
         this.force_factor = old_units.ForceUnit.Scale / new_units.ForceUnit.Scale;
     }
 }
Ejemplo n.º 3
0
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
 {
     if (value is string)
     {
         return(ProjectUnits.Parse(value as string));
     }
     return(base.ConvertFrom(context, culture, value));
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Define a new catenary using defaults
        /// </summary>
        /// <returns></returns>
        public Catenary NewCatenary()
        {
            var last = Last;

            if (last == null)
            {
                return(Catenary.Default(ProjectUnits.Default()));
            }
            return(new Catenary(last.EndPosition, last.StepX, 0.0, last.CableWeight, last.HorizontalTension));
        }
Ejemplo n.º 5
0
 public void SetProjectUnits(ProjectUnits target)
 {
     if (Units == null)
     {
         OnProjectUnitsSet(new ProjectUnits.SetEventArgs(target));
         this.Units = target;
     }
     else if (!Units.Equals(target))
     {
         OnProjectUnitsChange(new ProjectUnits.ChangeEventArgs(Units, target));
         ConvertUnits(target);
         this.Units = target;
     }
 }
Ejemplo n.º 6
0
        public RulingSpan(ProjectUnits units) : base(units)
        {
            this.Spans = new BindingList <Catenary>
            {
                AllowNew               = true,
                AllowRemove            = true,
                AllowEdit              = true,
                RaiseListChangedEvents = true
            };
            //Span Events
            this.Spans.AddingNew   += new AddingNewEventHandler(spans_AddingNew);
            this.Spans.ListChanged += new ListChangedEventHandler(spans_ListChanged);

            //Ruling Span Events
            this.RulingSpanChanged += new EventHandler <ItemChangeEventArgs>(RulingSpan_RulingSpanChanged);
        }
Ejemplo n.º 7
0
        public ItemList(ProjectUnits units, params T[] items) : base(units)
        {
            this.Items = new BindingList <T>
            {
                AllowNew    = true,
                AllowRemove = true,
                AllowEdit   = true
            };

            //Item Events
            this.Items.AddingNew   += new AddingNewEventHandler(items_AddingNew);
            this.Items.ListChanged += new ListChangedEventHandler(items_ListChanged);
            //Units Events
            this.ProjectUnitsChanged += new EventHandler <ProjectUnits.ChangeEventArgs>(BindableList_ProjectUnitsChanged);

            this.AddArray(items);
        }
Ejemplo n.º 8
0
 public SetEventArgs(ProjectUnits new_units)
 {
     this.new_units = new_units;
 }
Ejemplo n.º 9
0
 public RulingSpan(ProjectUnits units, Span[] list, double weight, double H) : this(units)
 {
     AddSpans(list, weight, H);
 }
Ejemplo n.º 10
0
 public RulingSpan(Span[] list, double weight, double H) : this(ProjectUnits.Default(), list, weight, H)
 {
 }
Ejemplo n.º 11
0
 protected HasUnitsBase()
 {
     Units = new ProjectUnits();
 }
Ejemplo n.º 12
0
 protected override void ConvertUnits(ProjectUnits target)
 {
     ScaleForUnits(new ProjectUnits.ChangeEventArgs(Units, target), false);
 }
Ejemplo n.º 13
0
 public RulingSpan() : this(ProjectUnits.Default())
 {
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Create a catenary using the default values defined in <see cref="Catenary"/>.
 /// </summary>
 public Catenary() : this(Default(ProjectUnits.Default()))
 {
 }
Ejemplo n.º 15
0
 public RulingSpan(params Catenary[] list) : this(ProjectUnits.Default(), list)
 {
 }
Ejemplo n.º 16
0
 protected abstract void ConvertUnits(ProjectUnits target);
Ejemplo n.º 17
0
 public RulingSpan(ProjectUnits units, params Catenary[] list) : this(units)
 {
     //Set Units
     this.AddSpans(list);
 }
Ejemplo n.º 18
0
 protected HasUnitsBase(ProjectUnits units)
 {
     this.Units = units;
 }
Ejemplo n.º 19
0
        public static Span Default(ProjectUnits projectUnits)
        {
            var f_length = Unit.ft.FactorTo(projectUnits.LengthUnit);

            return(new Span(f_length * Vector2.UnitY * DefaultTowerHeight, f_length * DefaultSpanLength, f_length * DefaultSpanRise));
        }