Пример #1
0
        //机车牵引费
        public static double GetFee2(EQianYinType QianYinType,
                                     EGongDianType GongDianType,
                                     double TrainWeight, int YunXingLiCheng)
        {
            double Fee = 0;

            if (QianYinType == EQianYinType.内燃机车)
            {
                if (GongDianType == EGongDianType.直供电)
                {
                    Fee = QianYinFeeProfile.Fee01;
                }
                else
                {
                    Fee = QianYinFeeProfile.Fee02;
                }
            }
            else
            {
                if (GongDianType == EGongDianType.直供电)
                {
                    Fee = QianYinFeeProfile.Fee11;
                }
                else
                {
                    Fee = QianYinFeeProfile.Fee12;
                }
            }
            Fee = Fee / 10000d * TrainWeight * YunXingLiCheng * 2 * 365;
            return(Fee);
        }
Пример #2
0
        //设置线路的牵引费类型
        private static void SetLineQianYin(TrainLine line)
        {
            for (int i = 0; i < line.Nodes.Count; i++)
            {
                line.Nodes[i].QianYinType = EQianYinType.其他;      //设置为初值
            }

            int pos0 = 0;
            int pos2 = line.Nodes.Count - 1;

            while (pos0 < pos2)
            {
                int pos1 = -1;
                for (int i = pos0 + 1; i <= pos2; i++)
                {
                    if (line.Nodes[i].BigB)
                    {
                        pos1 = i;
                        break;
                    }
                }

                if (pos1 == -1)
                {
                    pos1 = pos2;
                }

                //其中有一段时内燃机车,则使用内燃机车
                EQianYinType type1 = EQianYinType.电力机车;
                for (int i = pos0; i <= pos1; i++)
                {
                    if (String.IsNullOrEmpty(line.Nodes[i].DqhFlag))
                    {
                        type1 = EQianYinType.内燃机车;
                        break;
                    }
                }
                for (int i = pos0; i <= pos1; i++)
                {
                    line.Nodes[i].QianYinType = type1;
                }

                //重新设置Pos1的值
                pos0 = pos1;
            }

            for (int i = 0; i < line.Nodes.Count; i++)
            {
                if (line.Nodes[i].QianYinType == EQianYinType.其他)
                {
                    line.Nodes[i].QianYinType = EQianYinType.电力机车;
                }
            }
        }
Пример #3
0
        //机车牵引费 Fee2--OK
        internal override double GetFee2()
        {
            double Fee  = 0;
            double Fee0 = 0;

            if (this.Line != null && this.Line.Nodes.Count > 0)
            {
                //设置线路牵引费
                this.Line.SetQianYinFee(trainType, this.GongDianType);
                foreach (LineNode node1 in this.Line.Nodes)
                {
                    EQianYinType qytype1 = node1.QianYinType;
                    if (FullNeiRangChe)  //表示全程为内燃机车
                    {
                        qytype1 = EQianYinType.内燃机车;
                    }

                    if (qytype1 == EQianYinType.电力机车)
                    {
                        Fee = node1.Fee2;
                    }
                    else
                    {
                        Fee = node1.Fee1;
                    }

                    if (this.IsYearFlag)
                    {
                        Fee0 = Fee0 + Fee / 10000d * this.GetTrainWeight() *
                               node1.Miles * 2 * 365;
                    }
                    else
                    {
                        Fee0 = Fee0 + Fee / 10000d * this.GetTrainWeight() *
                               node1.Miles * 2;
                    }
                }
            }

            Fee0 = Fee0 / UnitRate;
            return(JMath.Round1(Fee0, this.XiaoShou));
        }
Пример #4
0
        //机车牵引费 Fee2--OK
        internal double GetFee2OLD()
        {
            double Fee  = 0;
            double Fee0 = 0;

            int aPos = 0;
            int bPos = 0;

            if (this.Line != null && this.Line.Nodes.Count > 0)
            {
                while (aPos < this.Line.Nodes.Count)
                {
                    bPos = -1;
                    for (int j = aPos + 1; j < this.Line.Nodes.Count; j++)
                    {
                        if (this.Line.Nodes[j].BigA)
                        {
                            bPos = j;
                            break;
                        }
                    }
                    if (bPos == -1)
                    {
                        bPos = this.Line.Nodes.Count;
                    }


                    EQianYinType qy1 = EQianYinType.电力机车;
                    for (int k = aPos; k < bPos; k++)
                    {
                        if (this.Line.Nodes[k].DqhFlag.Trim() == String.Empty)
                        {
                            qy1 = EQianYinType.内燃机车;
                            break;
                        }
                    }

                    for (int k = aPos; k < bPos; k++)
                    {
                        this.Line.Nodes[k].QianYinType = qy1;
                    }

                    aPos = bPos;
                }


                foreach (LineNode node1 in this.Line.Nodes)
                {
                    EQianYinType qytype1 = node1.QianYinType;
                    if (FullNeiRangChe)  //表示全程为内燃机车
                    {
                        qytype1 = EQianYinType.内燃机车;
                    }

                    if (qytype1 == EQianYinType.电力机车)
                    {
                        if (this.trainType != ECommTrainType.空调车25T)
                        {
                            Fee = QianYinFeeProfile.Fee02;
                        }
                        else
                        {
                            Fee = QianYinFeeProfile.Fee03;
                        }

                        //增加直供电的附加费计算
                        if (this.GongDianType == EGongDianType.直供电)
                        {
                            Fee = Fee + TrainProfile.QianYinFjFee2;
                        }
                    }
                    else
                    {
                        if (this.trainType != ECommTrainType.空调车25T)
                        {
                            Fee = QianYinFeeProfile.Fee12;
                        }
                        else
                        {
                            Fee = QianYinFeeProfile.Fee13;
                        }

                        //增加直供电的附加费计算
                        if (this.GongDianType == EGongDianType.直供电)
                        {
                            Fee = Fee + TrainProfile.QianYinFjFee1;
                        }
                    }


                    if (this.IsYearFlag)
                    {
                        Fee0 = Fee0 + Fee / 10000d * this.GetTrainWeight() *
                               node1.Miles * 2 * 365;
                    }
                    else
                    {
                        Fee0 = Fee0 + Fee / 10000d * this.GetTrainWeight() *
                               node1.Miles * 2;
                    }
                }
            }

            Fee0 = Fee0 / UnitRate;
            return(JMath.Round1(Fee0, this.XiaoShou));
        }