private static Pipe GeneratePipe() { long pipeID = GetNextID(); Pipe pipe = new Pipe() { PipeID = pipeID, Barcode = pipeID + "bc", Number = pipeID + "nm", VendorID = parsedArgs.VendorID, JobID = parsedArgs.JobID, Coating = "ARO-L", Diameter = "10", CurrentLocation = "Austin, TX", Latitude = "30.25", Longitude = "97.75", Length = "60", Status = "IN", Type = "HFW", Wall = "0.365", Heat = "ZM1610", Grade = "X52", Manufacturer = "SeAH", Image = string.Empty, Thumbnail = string.Empty, Issue = true, Class = "class", Owner = "owner", Alert = "alert", Cut = false, Bend = false, Verify = false, MillLength = "1", Station = "Station X", LastUpdated = DateTime.Now.ToString(), NoteCount = 0, InspectionPassed = true, ImageData = new JointImageData[0] }; pipe.AdditionalBarcodes = new string[] { pipe.Barcode + "_1", pipe.Barcode + "_2", pipe.Barcode + "_3", pipe.Barcode + "_4", pipe.Barcode + "_5", pipe.Barcode + "_6" }; //every pipe has 1 stencil image pipe.StencilData = new JointStencilData[] { GenerateJointStencilImage(pipe) }; //roughly 1 in every 30 pipes has a damage image if (rand.Next(0, 30) == 0) pipe.ImageData = new JointImageData[] { GenerateJointImage(pipe) }; return pipe; }
private static JointStencilData GenerateJointStencilImage(Pipe pipe) { return new JointStencilData() { JointStencilDataID = Guid.NewGuid(), PipeID = pipe.PipeID, ContentType = "image/png", Image = string.Empty, JobID = pipe.JobID, ReferenceNumber = "somerefnum", LastUpdated = DateTime.Now }; }