// For copy
        public FreightAnimationContinuous(FreightAnimationContinuous freightAnimContin, MSTSWagon wagon)
        {
            if (freightAnimContin.LinkedIntakePoint != null)
            {
                wagon.IntakePointList.Add(new IntakePoint(freightAnimContin.LinkedIntakePoint));
                wagon.IntakePointList.Last().LinkedFreightAnim = this;
                LinkedIntakePoint = wagon.IntakePointList.Last();
            }
            ShapeFileName         = freightAnimContin.ShapeFileName;
            MaxHeight             = freightAnimContin.MaxHeight;
            MinHeight             = freightAnimContin.MinHeight;
            FreightWeightWhenFull = freightAnimContin.FreightWeightWhenFull;
            FullAtStart           = freightAnimContin.FullAtStart;
            LoadPerCent           = freightAnimContin.LoadPerCent;

            // additions to manage consequences of variable weight on friction and brake forces
            FullORTSDavis_A            = freightAnimContin.FullORTSDavis_A;
            FullORTSDavis_B            = freightAnimContin.FullORTSDavis_B;
            FullORTSDavis_C            = freightAnimContin.FullORTSDavis_C;
            FullORTSWagonFrontalAreaM2 = freightAnimContin.FullORTSWagonFrontalAreaM2;
            FullORTSDavisDragConstant  = freightAnimContin.FullORTSDavisDragConstant;
            FullMaxBrakeForceN         = freightAnimContin.FullMaxBrakeForceN;
            FullMaxHandbrakeForceN     = freightAnimContin.FullMaxHandbrakeForceN;
            FullCentreOfGravityM_Y     = freightAnimContin.FullCentreOfGravityM_Y;
        }
        public float FullCentreOfGravityM_Y     = -9999; // get centre of gravity after adjusted for freight animation

        public FreightAnimationContinuous(STFReader stf, MSTSWagon wagon)
        {
            stf.MustMatch("(");
            stf.ParseBlock(new STFReader.TokenProcessor[] {
                new STFReader.TokenProcessor("intakepoint", () =>
                {
                    wagon.IntakePointList.Add(new IntakePoint(stf));
                    wagon.IntakePointList.Last().LinkedFreightAnim = this;
                    LinkedIntakePoint = wagon.IntakePointList.Last();
                }),
                new STFReader.TokenProcessor("shape", () => { ShapeFileName = stf.ReadStringBlock(null); }),
                new STFReader.TokenProcessor("maxheight", () => { MaxHeight = stf.ReadFloatBlock(STFReader.UNITS.Distance, 0); }),
                new STFReader.TokenProcessor("minheight", () => { MinHeight = stf.ReadFloatBlock(STFReader.UNITS.Distance, 0); }),
                new STFReader.TokenProcessor("freightweightwhenfull", () => { FreightWeightWhenFull = stf.ReadFloatBlock(STFReader.UNITS.Mass, 0); }),
                new STFReader.TokenProcessor("fullatstart", () => { FullAtStart = stf.ReadBoolBlock(true); }),

                // additions to manage consequences of variable weight on friction and brake forces
                new STFReader.TokenProcessor("fullortsdavis_a", () => { FullORTSDavis_A = stf.ReadFloatBlock(STFReader.UNITS.Force, -1); }),
                new STFReader.TokenProcessor("fullortsdavis_b", () => { FullORTSDavis_B = stf.ReadFloatBlock(STFReader.UNITS.Resistance, -1); }),
                new STFReader.TokenProcessor("fullortsdavis_c", () => { FullORTSDavis_C = stf.ReadFloatBlock(STFReader.UNITS.ResistanceDavisC, -1); }),
                new STFReader.TokenProcessor("fullortswagonfrontalarea", () => { FullORTSWagonFrontalAreaM2 = stf.ReadFloatBlock(STFReader.UNITS.AreaDefaultFT2, -1); }),
                new STFReader.TokenProcessor("fullortsdavisdragconstant", () => { FullORTSDavisDragConstant = stf.ReadFloatBlock(STFReader.UNITS.Any, -1); }),
                new STFReader.TokenProcessor("fullmaxbrakeforce", () => { FullMaxBrakeForceN = stf.ReadFloatBlock(STFReader.UNITS.Force, -1); }),
                new STFReader.TokenProcessor("fullmaxhandbrakeforce", () => { FullMaxHandbrakeForceN = stf.ReadFloatBlock(STFReader.UNITS.Force, -1); }),
                new STFReader.TokenProcessor("fullcentreofgravity_y", () => { FullCentreOfGravityM_Y = stf.ReadFloatBlock(STFReader.UNITS.Distance, -1); })
            });
        }
Exemple #3
0
 // For copy
 public FreightAnimationContinuous(FreightAnimationContinuous freightAnimContin, MSTSWagon wagon)
 {
     wagon.IntakePointList.Add(new IntakePoint(freightAnimContin.LinkedIntakePoint));
     wagon.IntakePointList.Last().LinkedFreightAnim = this;
     LinkedIntakePoint     = wagon.IntakePointList.Last();
     ShapeFileName         = freightAnimContin.ShapeFileName;
     MaxHeight             = freightAnimContin.MaxHeight;
     MinHeight             = freightAnimContin.MinHeight;
     FreightWeightWhenFull = freightAnimContin.FreightWeightWhenFull;
     FullAtStart           = freightAnimContin.FullAtStart;
     LoadPerCent           = freightAnimContin.LoadPerCent;
 }
Exemple #4
0
 public FreightAnimationContinuous(STFReader stf, MSTSWagon wagon)
 {
     stf.MustMatch("(");
     stf.ParseBlock(new STFReader.TokenProcessor[] {
         new STFReader.TokenProcessor("intakepoint", () =>
         {
             wagon.IntakePointList.Add(new IntakePoint(stf));
             wagon.IntakePointList.Last().LinkedFreightAnim = this;
             LinkedIntakePoint = wagon.IntakePointList.Last();
         }),
         new STFReader.TokenProcessor("shape", () => { ShapeFileName = stf.ReadStringBlock(null); }),
         new STFReader.TokenProcessor("maxheight", () => { MaxHeight = stf.ReadFloatBlock(STFReader.UNITS.Distance, 0); }),
         new STFReader.TokenProcessor("minheight", () => { MinHeight = stf.ReadFloatBlock(STFReader.UNITS.Distance, 0); }),
         new STFReader.TokenProcessor("freightweightwhenfull", () => { FreightWeightWhenFull = stf.ReadFloatBlock(STFReader.UNITS.Mass, 0); }),
         new STFReader.TokenProcessor("fullatstart", () => { FullAtStart = stf.ReadBoolBlock(true); }),
     });
 }