public Part Convert() { Part part = new Part(); part.Length = SizeA; part.Width = SizeB; part.Quantity = Amount; return part; }
static void Test3() { Part part = new Part(); part.Length = 400M; part.Width = 400M; part.Quantity = 4; part.CanRotate = true; optimizer.Parts.Add(part); Sheet sheet = new Sheet(); sheet.Width = 1024M; sheet.Height = 1024M; sheet.Thickness = 16M; optimizer.Sheets.Add(sheet); optimizer.Parameters.CutterThickness = 10M; while (optimizer.NextResult()) { //schemes.Add(optimizer.CurrentResult); } }
static void Test2() { Part part = new Part(); part.Length = 200M; part.Width = 200M; part.Quantity = 3; part.CanRotate = false; optimizer.Parts.Add(part); Sheet sheet = new Sheet(); sheet.Width = 2730M; sheet.Height = 1830M; sheet.Thickness = 16M; optimizer.Sheets.Add(sheet); optimizer.Parameters.CutterThickness = 4.4M; optimizer.Parameters.CutOffBottom = 13M; while (optimizer.NextResult()) { //schemes.Add(optimizer.CurrentResult); } }
static void Test5() { Part part = new Part(); part.Length = 2383M; part.Width = 600M; part.Quantity = 2; part.CanRotate = true; optimizer.Parts.Add(part); part = new Part(); part.Length = 2296M; part.Width = 500M; part.Quantity = 1; part.CanRotate = true; optimizer.Parts.Add(part); Sheet sheet = new Sheet(); sheet.Width = 2730M; sheet.Height = 1830M; sheet.Thickness = 16M; optimizer.Sheets.Add(sheet); optimizer.Parameters.CutterThickness = 4.4M; List<CuttingScheme> schemes = new List<CuttingScheme>(); while (optimizer.NextResult()) { schemes.Add(optimizer.CurrentResult); } Denisenko.Cutting.LC4.LC4Document doc = convertor.Convert(schemes); doc.InternalName = "SOKOLOV"; doc.Description = "manually generated"; doc.Cuttings[0].Name = "00001"; doc.Serialize(@"SOKOLOV2.xml"); }