Esempio n. 1
0
        public VehicleLoad(vdDocument doc_elevation, vdDocument doc_plan, MLoadData ld_data)
        {
            //Skew_Angle = skew_ang;
            Loads    = ld_data;
            XINC     = 0.2;
            X        = 0;
            Y        = 0;
            Z        = 0.0;
            LoadCase = 0;

            vDoc_elevation = doc_elevation;
            vDoc_Plan      = doc_plan;

            WheelAxis = new List <IAxial>();
            //WheelPlan = new List<PlanWheel>();


            //Environment.SetEnvironmentVariable("COMP_RAD", "50");
            string rad = Environment.GetEnvironmentVariable("COMP_RAD");

            if (rad != null)
            {
                if (rad != "")
                {
                    Radius = MyList.StringToDouble(rad, 0.0);
                }
            }

            Set_Wheel_Distance();
            //Axial ax = new Axial(doc_elevation);
            //ax.Width = Width;
            //ax.Load = Loads.LoadValues.StringList[0];
            //ax.WheelRadius = (Loads.LoadWidth == 0.0) ? 0.2d : Loads.LoadWidth / 9.0;

            //ax.Wheel1.ToolTip = Loads.Code + ", Axial Load = " + Loads.LoadValues.StringList[0];
            //ax.Wheel2.ToolTip = Loads.Code + ", Axial Load = " + Loads.LoadValues.StringList[0];
            //ax.Axis.ToolTip = Loads.Code + ", Load Width = " + Loads.LoadWidth + ", Distance = " + Loads.Distances.StringList[0];
            //WheelAxis.Add(ax);

            //double last_x = 0.0;
            //Loads.Distances.StringList.Remove("");
            //Loads.LoadValues.StringList.Remove("");
            //for (int i = 0; i < Loads.Distances.Count; i++)
            //{
            //    last_x += Loads.Distances.GetDouble(i);
            //    ax = new Axial(doc_elevation);
            //    ax.X = -last_x;
            //    ax.Width = Width;
            //    ax.Load = Loads.LoadValues.StringList[i];
            //    ax.WheelRadius = (Loads.LoadWidth == 0.0) ? 0.2d : Loads.LoadWidth / 9.0;

            //    ax.Wheel1.ToolTip = Loads.Code + ", Axial Load = " + Loads.LoadValues.StringList[i] + ", Distance = " + Loads.Distances.StringList[i];
            //    ax.Wheel2.ToolTip = Loads.Code + ", Axial Load = " + Loads.LoadValues.StringList[i] + ", Distance = " + Loads.Distances.StringList[i];
            //    ax.Axis.ToolTip = Loads.Code + ", Load Width = " + Loads.LoadWidth + ", Distance = " + Loads.Distances.StringList[i];
            //    WheelAxis.Add(ax);
            //}
        }
Esempio n. 2
0
        public static List <MLoadData> GetLiveLoads(string file_path)
        {
            if (!File.Exists(file_path))
            {
                return(null);
            }

            //TYPE1 IRCCLASSA
            //68 68 68 68 114 114 114 27
            //3.00 3.00 3.00 4.30 1.20 3.20 1.10
            //1.80
            List <MLoadData> LL_list      = new List <MLoadData>();
            List <string>    file_content = new List <string>(File.ReadAllLines(file_path));
            MyList           mlist        = null;
            string           kStr         = "";

            int icount = 0;

            for (int i = 0; i < file_content.Count; i++)
            {
                kStr = MyList.RemoveAllSpaces(file_content[i]);
                //kStr = MyList.RemoveAllSpaces(file_content[i].Trim().TrimStart().TrimEnd());
                kStr  = kStr.Replace(' ', ',');
                kStr  = kStr.Replace(',', ' ');
                kStr  = MyList.RemoveAllSpaces(kStr);
                mlist = new MyList(kStr, ' ');

                if (mlist.StringList[0].Contains("TYPE"))
                {
                    MLoadData ld = new MLoadData();
                    if (mlist.Count == 2)
                    {
                        kStr          = mlist.StringList[0].Replace("TYPE", "");
                        ld.TypeNoText = "TYPE " + kStr;
                        ld.Code       = mlist.StringList[1];
                        LL_list.Add(ld);
                    }
                    else if (mlist.Count == 3)
                    {
                        ld.TypeNoText = "TYPE " + mlist.StringList[1];
                        ld.Code       = mlist.StringList[2];
                        LL_list.Add(ld);
                    }
                    if ((i + 3) < file_content.Count)
                    {
                        ld.LoadWidth = MyList.StringToDouble(file_content[i + 3], 0.0);
                    }

                    try
                    {
                        ld.LoadValues = new MyList(file_content[i + 1], ' ');
                        ld.Distances  = new MyList(file_content[i + 2], ' ');
                    }
                    catch (Exception) { }
                }
            }
            return(LL_list);

            //TYPE 2 IRCCLASSB
            //20.5 20.5 20.5 20.5 34.0 34.0 8.0 8.0
            //3.00 3.00 3.00 4.30 1.20 3.20 1.10
            //1.80

            //TYPE 3 IRC70RTRACK
            //70 70 70 70 70 70 70 70 70 70
            //0.457 0.457 0.457 0.457 0.457 0.457 0.457 0.457 0.457
            //0.84

            //TYPE 4 IRC70RWHEEL
            //85 85 85 85 60 60 40
            //1.37 3.05 1.37 2.13 1.52 3.96
            //0.450 1.480 0.450

            //TYPE 5 IRCCLASSAATRACK
            //70 70 70 70 70 70 70 70 70 70
            //0.360 0.360 0.360 0.360 0.360 0.360 0.360 0.360 0.360
            //0.85

            //TYPE 6 IRC24RTRACK
            //62.5 62.5 62.5 62.5 62.5 62.5 62.5 62.5 62.5 62.5
            //0.366 0.366 0.366 0.366 0.366 0.366 0.366 0.366 0.366
            //0.36
        }