static void Main(string[] args) { string filePath = @"D:\GitHub\StackBuilder\Sources\Samples\testFGA.csv"; using (FileStream fs = File.OpenRead(filePath)) { ExporterCSV_TechBSA exporter = new ExporterCSV_TechBSA(); Vector3D dimCase = Vector3D.Zero; Vector3D dimPallet = Vector3D.Zero; double weightCase = 0.0, weightPallet = 0.0, maxPalletHeight = 0.0; List <BoxPosition> boxPositions = new List <BoxPosition>(); bool layerMirrorX = false, layerMirrorY = false; List <bool> interlayers = new List <bool>(); ExporterCSV_TechBSA.Import(fs, ref boxPositions, ref dimCase, ref weightCase, ref dimPallet, ref weightPallet, ref maxPalletHeight, ref layerMirrorX, ref layerMirrorY, ref interlayers); Console.WriteLine("Box positions:"); foreach (var bp in boxPositions) { Console.WriteLine(bp.ToString()); } Console.WriteLine($"DimCase:{dimCase}"); Console.WriteLine($"WeightCase:{weightCase}"); Console.WriteLine($"DimPallet:{dimPallet}"); Console.WriteLine($"WeightPallet:{weightPallet}"); } }
static void Main(string[] args) { string filePath = @"D:\GitHub\StackBuilder\Sources\Samples\testFGA.csv"; using (FileStream fs = File.OpenRead(filePath)) { ExporterCSV_TechBSA exporter = new ExporterCSV_TechBSA(); Vector3D dimCase = Vector3D.Zero; Vector3D dimPallet = Vector3D.Zero; double weightCase = 0.0, weightPallet = 0.0, maxPalletHeight = 0.0; List <BoxPosition> boxPositions = new List <BoxPosition>(); bool hasInterlayerBottom = false, hasInterlayerTop = false, hasInterlayersMiddle = false, alternateLayers = false; ExporterCSV_TechBSA.Import(fs, ref boxPositions, ref dimCase, ref weightCase, ref dimPallet, ref weightPallet, ref maxPalletHeight, ref alternateLayers, ref hasInterlayerBottom, ref hasInterlayerTop, ref hasInterlayersMiddle); Console.WriteLine("Box positions:"); foreach (var bp in boxPositions) { Console.WriteLine(bp.ToString()); } Console.WriteLine($"DimCase:{dimCase.ToString()}"); Console.WriteLine($"WeightCase:{weightCase}"); Console.WriteLine($"DimPallet:{dimPallet.ToString()}"); Console.WriteLine($"WeightPallet:{weightPallet}"); Console.WriteLine($"InterlayerBottom:{hasInterlayerBottom}"); Console.WriteLine($"InterlayerTop:{hasInterlayerTop}"); Console.WriteLine($"InterlayerMiddle:{hasInterlayersMiddle}"); } }
protected void OnOpenProject(object sender, EventArgs e) { // get selected file name var dimCase = Vector3D.Zero; double weightCase = 0.0; var dimPallet = Vector3D.Zero; double weightPallet = 0.0; bool MirrorX = false, MirrorY = false; int numberOfLayers = 0; List <BoxPositionIndexed> boxPositions = new List <BoxPositionIndexed>(); List <bool> interlayers = new List <bool>(); int layerDesignMode = 0; string filePath = DropDownListFiles.SelectedValue; byte[] fileContent = null; FtpHelpers.Download(ref fileContent, ConfigSettings.FtpDirectory, filePath, ConfigSettings.FtpUsername, ConfigSettings.FtpPassword); ExporterCSV_TechBSA.Import(new MemoryStream(fileContent), ref boxPositions, ref dimCase, ref weightCase, ref dimPallet, ref weightPallet, ref numberOfLayers, ref MirrorX, ref MirrorY, ref interlayers, ref layerDesignMode); DimCase = dimCase; WeightCase = weightCase; PalletIndex = 0; WeightPallet = weightPallet; NumberOfLayers = numberOfLayers; BoxPositions = boxPositions; LayersMirrorX = MirrorX; LayersMirrorY = MirrorY; LayerEdited = true; FileName = filePath; Interlayers = string.Concat(interlayers.Select(p => p ? "1" : "0").ToArray()); LayerDesignMode = layerDesignMode; if (ConfigSettings.WebGLMode) { Response.Redirect("ValidationWebGL.aspx"); } else { Response.Redirect("Validation.aspx"); } }
protected void OnOpenProject(object sender, EventArgs e) { // get selected file name Vector3D dimCase = Vector3D.Zero; double weightCase = 0.0; Vector3D dimPallet = Vector3D.Zero; double weightPallet = 0.0; double maxPalletHeight = 0.0; bool MirrorX = false, MirrorY = false;; bool interlayerBottom = false, interlayerTop = false, interlayerMiddle = false; List <BoxPosition> boxPositions = new List <BoxPosition>(); string filePath = DropDownListFiles.SelectedValue; byte[] fileContent = null; FtpHelpers.Download(ref fileContent, ConfigSettings.FtpDirectory, filePath, ConfigSettings.FtpUsername, ConfigSettings.FtpPassword); ExporterCSV_TechBSA.Import(new MemoryStream(fileContent), ref boxPositions, ref dimCase, ref weightCase, ref dimPallet, ref weightPallet, ref maxPalletHeight, ref MirrorX, ref MirrorY, ref interlayerBottom, ref interlayerTop, ref interlayerMiddle); DimCase = dimCase; WeightCase = weightCase; DimPallet = dimPallet; WeightPallet = weightPallet; MaxPalletHeight = maxPalletHeight; BoxPositions = boxPositions; LayersMirrorX = MirrorX; LayersMirrorY = MirrorY; InterlayerBottom = interlayerBottom; InterlayerTop = interlayerTop; InterlayersIntermadiate = interlayerMiddle; FileName = filePath; if (ConfigSettings.WebGLMode) { Response.Redirect("ValidationWebGL.axpx"); } else { Response.Redirect("Validation.aspx"); } }
protected void OnOpenProject(object sender, EventArgs e) { // get selected file name var dimCase = Vector3D.Zero; double weightCase = 0.0; var dimPallet = Vector3D.Zero; double weightPallet = 0.0; bool MirrorX = false, MirrorY = false; int numberOfLayers = 0; List <BoxPositionIndexed> boxPositions = new List <BoxPositionIndexed>(); List <bool> interlayers = new List <bool>(); string filePath = DropDownListFiles.SelectedValue; byte[] fileContent = null; FtpHelpers.Download(ref fileContent, ConfigSettings.FtpDirectory, filePath, ConfigSettings.FtpUsername, ConfigSettings.FtpPassword); ExporterCSV_TechBSA.Import(new MemoryStream(fileContent), ref boxPositions, ref dimCase, ref weightCase, ref dimPallet, ref weightPallet, ref numberOfLayers, ref MirrorX, ref MirrorY, ref interlayers); string queryString = string.Empty; if (ConfigSettings.UseSessionState) { DimCase = dimCase; WeightCase = weightCase; PalletIndex = 0; WeightPallet = weightPallet; NumberOfLayers = numberOfLayers; BoxPositions = boxPositions; LayersMirrorX = MirrorX; LayersMirrorY = MirrorY; LayerEdited = true; FileName = filePath; Interlayers = string.Concat(interlayers.Select(p => p ? "1" : "0").ToArray());; } else { string interlayerArray = string.Concat(interlayers.Select(p => p ? "1" : "0").ToArray()); string fileBoxPositions = string.Empty; StringBuilder sb = new StringBuilder(); sb.Append(" ? "); sb.Append($"DimCase={dimCase}"); sb.Append($"WeightCase={weightCase}"); sb.Append($"&DimPallet={dimPallet}"); sb.Append($"&WeightPallet={weightPallet}"); sb.Append($"&NumberOfLayers={numberOfLayers}"); sb.Append($"&BoxPositionsFile={fileBoxPositions}"); sb.Append($"&LayerMirrorX={MirrorX}"); sb.Append($"&LayerMirrorY={MirrorY}"); sb.Append($"LayerEdited={true}"); sb.Append($"FileName={filePath}"); sb.Append($"Interlayers={interlayerArray}"); queryString = sb.ToString(); } if (ConfigSettings.WebGLMode) { Response.Redirect("ValidationWebGL.aspx" + queryString); } else { Response.Redirect("Validation.aspx" + queryString); } }