Example #1
0
        public override void Apply(Manhole manhole)
        {
            base.Apply(manhole);

            //TODO: Check diameter - B 3.2 12
            var minimumDiameter = 0.0;

            if (manhole.LargestInternalPipeDiameter < 375)
            {
                minimumDiameter = 1200;
            }
            if (manhole.LargestInternalPipeDiameter >= 375 && manhole.LargestInternalPipeDiameter < 450)
            {
                minimumDiameter = 1350;
            }
            if (manhole.LargestInternalPipeDiameter >= 450 && manhole.LargestInternalPipeDiameter < 700)
            {
                minimumDiameter = 1500;
            }
            if (manhole.LargestInternalPipeDiameter >= 700 && manhole.LargestInternalPipeDiameter < 900)
            {
                minimumDiameter = 1800;
            }
            if (manhole.LargestInternalPipeDiameter >= 900)
            {
                minimumDiameter = manhole.LargestInternalPipeDiameter + 900;
            }

            if (manhole.Diameter < minimumDiameter)
            {
                throw new ArgumentException("Manhole does not meet minimum dimensions size for pipes - increase to " + minimumDiameter);
            }
        }
 public virtual void Apply(Manhole manhole)
 {
     if (manhole.IncomingPipes.Capacity == 0)
     {
         throw new ArgumentException("Manhole does not have any incoming pipes.");
     }
 }
Example #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            Manhole manhole = db.manholes.Find(id);

            db.manholes.Remove(manhole);
            db.SaveChanges();
            //return RedirectToAction("Index");
            return(RedirectToRoute(new { controller = "Site", id = manhole.SiteID, action = "SiteDetails" }));
        }
Example #4
0
 public ActionResult Edit([Bind(Include = "ManholeID,ManholeName,HeavyTraffic,H2S,Oxygen,LEL,SiteID")] Manhole manhole)
 {
     if (ModelState.IsValid)
     {
         db.Entry(manhole).State = EntityState.Modified;
         db.SaveChanges();
         //return RedirectToAction("Index");
         return(RedirectToRoute(new { controller = "Site", id = manhole.SiteID, action = "SiteDetails" }));
     }
     return(View(manhole));
 }
Example #5
0
 //bool permaon;
 // Use this for initialization
 void Start()
 {
     audioSource = GetComponent <AudioSource>();
     ButtonLight = PushMe.GetComponent <Renderer>().material;
     doorscript  = Door.GetComponent <ButtonDoor>();
     if (doorscript == null)
     {
         manholescript = Door.GetComponent <Manhole>();
     }
     ButtonLight.SetColor("_EmissionColor", OffColor);
 }
Example #6
0
        public ActionResult Create([Bind(Include = "ManholeName,HeavyTraffic,H2S,Oxygen,LEL,SiteID")] Manhole manhole)
        {
            if (ModelState.IsValid)
            {
                db.manholes.Add(manhole);
                db.SaveChanges();
                //Once it has been added we want to call the sitedetails method

                return(RedirectToRoute(new { controller = "Site", id = manhole.SiteID, action = "SiteDetails" }));
            }

            return(View(manhole));
        }
Example #7
0
        // GET: Manhole/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Manhole manhole = db.manholes.Find(id);

            if (manhole == null)
            {
                return(HttpNotFound());
            }
            return(View(manhole));
        }
Example #8
0
        public override void Apply(Manhole manhole)
        {
            base.Apply(manhole);

            if (manhole.LargestInternalPipeDiameter <= 525 && manhole.DepthToSoffitLevel < 6)
            {
                manhole.Type = "TYPE 1";
            }
            else
            {
                throw new ArgumentException("Manhole not Type 1 compliant");
            }

            manhole.MinimumMinorBenching = 325; //TODO: Need to check...
            manhole.SafetyChain          = manhole.LargestInternalPipeDiameter > 525;
            manhole.SafetyRail           = manhole.LargestInternalPipeDiameter > 525;

            //Set benching
            manhole.MinimumMajorBenching = manhole.LargestInternalPipeDiameter <= 375 ? 600 : manhole.LargestInternalPipeDiameter <= 525 ? 750 : 1100;

            SetManholeCover(manhole);
        }
Example #9
0
        private static void WriteSimpleFile()
        {
            Console.WriteLine("Writing simple test file");

            JkumWriter writer = new JkumWriter();

            writer.SetHead("25832", "Hans Martin Eikerol");

            Guid guid = Guid.NewGuid();

            Manhole manhole = new Manhole();

            manhole.Guid         = guid.ToString("D");
            manhole.ElementId    = "556001";
            manhole.BottomCenter = new Point3d(588447.155, 6642743.891, 52.714);
            manhole.Shape        = "Circular";
            manhole.Diameter     = 1600;
            manhole.Rotation     = 0;
            manhole.Lids         = new List <Lid>()
            {
                new Lid()
                {
                    Position = new Point3d(588447.155, 6642743.826, 55.145),
                    Diameter = 650
                }
            };
            manhole.Links = new List <ManholeLink>()
            {
                new ManholeLink()
                {
                    Guid          = Guid.NewGuid().ToString(),
                    ElementId     = "548861",
                    Medium        = "Water",
                    Pressurized   = true,
                    Elevation     = 53.11,
                    ClockPosition = 20,
                    Diameter      = 150
                },
                new ManholeLink()
                {
                    Guid          = Guid.NewGuid().ToString(),
                    ElementId     = "548862",
                    Medium        = "Water",
                    Pressurized   = true,
                    Elevation     = 53.11,
                    ClockPosition = 200,
                    Diameter      = 150
                },
                new ManholeLink()
                {
                    Guid          = Guid.NewGuid().ToString(),
                    ElementId     = "548864",
                    Medium        = "Water",
                    Pressurized   = true,
                    Elevation     = 53.11,
                    ClockPosition = 110,
                    Diameter      = 150
                },
            };

            writer.AddManhole(manhole);


            Manhole manhole2 = new Manhole();

            manhole2.Guid         = Guid.NewGuid().ToString("D");
            manhole2.ElementId    = "522431";
            manhole2.BottomCenter = new Point3d(588429.23, 6642811.51, 53.218);
            manhole2.Shape        = "Rectangular";
            manhole2.Width        = 3000;
            manhole2.Length       = 1200;
            manhole2.Rotation     = 20;
            manhole2.Lids         = new List <Lid>()
            {
                new Lid()
                {
                    Position       = new Point3d(588428.23, 6642811.71, 55.16),
                    Diameter       = 650,
                    Ladder         = "Yes",
                    Classification = "D400"
                },
                new Lid()
                {
                    Position = new Point3d(588430.23, 6642811.31, 55.16),
                    Diameter = 650
                },
            };
            manhole2.Links = new List <ManholeLink>()
            {
                new ManholeLink()
                {
                    Guid          = Guid.NewGuid().ToString(),
                    Medium        = "Water",
                    Pressurized   = true,
                    Elevation     = 53.65,
                    ClockPosition = 20,
                    Diameter      = 150
                },
                new ManholeLink()
                {
                    Guid          = Guid.NewGuid().ToString(),
                    Medium        = "Water",
                    Pressurized   = true,
                    Elevation     = 53.65,
                    ClockPosition = 200,
                    Diameter      = 150
                },
                new ManholeLink()
                {
                    Guid          = Guid.NewGuid().ToString(),
                    Medium        = "Water",
                    Pressurized   = true,
                    Elevation     = 53.65,
                    ClockPosition = 110,
                    Diameter      = 150
                },
                new ManholeLink()
                {
                    Guid          = Guid.NewGuid().ToString(),
                    Medium        = "StormWater",
                    Direction     = "Ingoing",
                    Pressurized   = false,
                    Elevation     = 53.11,
                    ClockPosition = 110,
                    Diameter      = 160
                },
                new ManholeLink()
                {
                    Guid          = Guid.NewGuid().ToString(),
                    Medium        = "StormWater",
                    Direction     = "Outgoing",
                    Pressurized   = false,
                    Elevation     = 53.07,
                    ClockPosition = 230,
                    Diameter      = 300
                },
            };

            writer.AddManhole(manhole2);

            string path = Path.Combine(debugFolder, simpleTestFile);

            writer.SaveAs(path);
        }
Example #10
0
 private static void SetManholeCover(Manhole manhole)
 {
 }