public static LensWarpCorrectionItems FromPrinterSettings(DAL.Hardware.AtumPrinter selectedPrinter) { if (selectedPrinter.LensWarpingCorrection.HorizontalValues == null) { selectedPrinter.LensWarpingCorrection.CreateDefaultValues(); } var lensWarpCorrectionItems = new LensWarpCorrectionItems(); if (selectedPrinter.LensWarpingCorrection != null && selectedPrinter.LensWarpingCorrection.HorizontalValues != null) { for (var itemRowIndex = 0; itemRowIndex < 8; itemRowIndex++) { for (var itemColumnIndex = 0; itemColumnIndex < 8; itemColumnIndex++) { lensWarpCorrectionItems.Add(new LensWarpCorrectionItem() { Number = (itemRowIndex * 8) + itemColumnIndex + 1, Horizontal = selectedPrinter.LensWarpingCorrection.HorizontalValues[itemRowIndex][itemColumnIndex], Vertical = selectedPrinter.LensWarpingCorrection.VerticalValues[itemRowIndex][itemColumnIndex], }); } } } return(lensWarpCorrectionItems); }
private void FrmMaterialDisplay_Load(object sender, EventArgs e) { this.SelectedPrinter = PrintJobManager.SelectedPrinter; if (this.SelectedPrinter != null) { DownloadMaterialsAsync(this.SelectedPrinter); } }
internal void DownloadMaterialsAsycn(Form parentForm, DAL.Hardware.AtumPrinter selectedPrinter) { this._allOnlineMaterials = new MaterialCatalogOnline(); this.treeView1.Nodes.Clear(); var t = new BackgroundWorker(); this._waitWindowManager = new WaitWindowManager(); this._waitWindowManager.Start(parentForm, t); t.DoWork += new DoWorkEventHandler(DownloadingMaterialsAsync); t.RunWorkerCompleted += new RunWorkerCompletedEventHandler(DownloadingMaterialsAsync_Completed); t.RunWorkerAsync(selectedPrinter); }
internal static Bitmap CreateMeasurementGrid(DAL.Hardware.AtumPrinter selectedPrinter) { var bitmap = new Bitmap(selectedPrinter.ProjectorResolutionX, selectedPrinter.ProjectorResolutionY); var rowIndex = 0; var columnIndex = 0; var rowHeight = 80; var columnWidth = 128; var maxRows = 15; var maxColumns = 15; var currentAlphabeticIndex = 1; StringFormat sf = new StringFormat(); sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Center; var whiteBrush = new SolidBrush(Color.White); var blackBrush = new SolidBrush(Color.Black); using (var g = Graphics.FromImage(bitmap)) { g.Clear(Color.Black); for (var y = 0; y < maxRows; y++) { columnIndex = 0; for (var x = 0; x < maxColumns; x++) { //if (projectionGrid[rowIndex, columnIndex].Active) //{ if (x % 2 == 0) { if (y % 2 == 0) { g.FillRectangle(whiteBrush, x * columnWidth, ((y) * (rowHeight)), columnWidth, rowHeight); g.DrawString(currentAlphabeticIndex.ToString(), new Font(FontFamily.GenericSansSerif, 52, FontStyle.Bold), blackBrush, x * columnWidth + (columnWidth / 2), y * rowHeight + (rowHeight / 2) + 5, sf); currentAlphabeticIndex++; } } rowIndex++; } columnIndex++; } } bitmap.RotateFlip(RotateFlipType.Rotate180FlipNone); return(bitmap); }
internal void DownloadMaterialsAsync(DAL.Hardware.AtumPrinter selectedPrinter) { try { // MessageBox.Show("1"); this._allOnlineMaterials = new MaterialCatalogOnline(); Task.Factory.StartNew(() => { // MessageBox.Show("2"); DownloadingMaterialsAsync(selectedPrinter); }).ContinueWith(s => DownloadingMaterialsAsync_Completed(null, null)); } catch (Exception exc) { MessageBox.Show(exc.Message); } }
public static void ToPrinterSettings(LensWarpCorrectionItems lensWarpCorrectionItems, DAL.Hardware.AtumPrinter selectedPrinter) { selectedPrinter.LensWarpingCorrection.HorizontalValues = new List <List <float> >(); selectedPrinter.LensWarpingCorrection.VerticalValues = new List <List <float> >(); for (var itemRowIndex = 0; itemRowIndex < 8; itemRowIndex++) { var horizontalValues = new List <float>(); var verticalValues = new List <float>(); for (var itemColumnIndex = 0; itemColumnIndex < 8; itemColumnIndex++) { var rowIndex = (itemRowIndex * 8) + itemColumnIndex; horizontalValues.Add(lensWarpCorrectionItems[rowIndex].Horizontal); verticalValues.Add(lensWarpCorrectionItems[rowIndex].Vertical); } selectedPrinter.LensWarpingCorrection.HorizontalValues.Add(horizontalValues); selectedPrinter.LensWarpingCorrection.VerticalValues.Add(verticalValues); } }
internal void DownloadingMaterialsAsync(DAL.Hardware.AtumPrinter selectedPrinter) { // MessageBox.Show("3"); try { // MessageBox.Show("4"); var currentProgress = 5f; ProgressBarManager.UpdateOnlineMaterialPercentage(currentProgress); // MessageBox.Show("5"); var materialRootFileStream = string.Empty; if (selectedPrinter is DAL.Hardware.AtumDLPStation5 || selectedPrinter is DAL.Hardware.LoctiteV10) { if (!DAL.ApplicationSettings.Settings.UseOfflineMaterialCatalog) { //use online catalog switch (selectedPrinter.PrinterXYResolution) { case DAL.Hardware.AtumPrinter.PrinterXYResolutionType.Micron50: materialRootFileStream = DownloadManager.DownloadString(BrandingManager.AdditiveManufacturingDeviceDLPStation5_XY50); break; case DAL.Hardware.AtumPrinter.PrinterXYResolutionType.Micron75: materialRootFileStream = DownloadManager.DownloadString(BrandingManager.AdditiveManufacturingDeviceDLPStation5_XY75); break; case DAL.Hardware.AtumPrinter.PrinterXYResolutionType.Micron100: materialRootFileStream = DownloadManager.DownloadString(BrandingManager.AdditiveManufacturingDeviceDLPStation5_XY100); break; } } } else { materialRootFileStream = DownloadManager.DownloadString(Properties.Settings.Default.atum3D_MaterialCatalog_AtumVxx); } var materialRootFile = new System.Xml.Serialization.XmlSerializer(typeof(MaterialCatalogDownloadAllFiles)); materialRootFileStream = materialRootFileStream.Replace("&", "&"); var materialRootDownloadFile = (MaterialCatalogDownloadAllFiles)materialRootFile.Deserialize(new StringReader(materialRootFileStream)); if (materialRootDownloadFile != null) { var materialDownloadPercentage = (float)(80f / materialRootDownloadFile.AvailableMaterialURLs.Count); foreach (var materialDownloadFile in materialRootDownloadFile.AvailableMaterialURLs) { currentProgress = (currentProgress + materialDownloadPercentage); if (currentProgress > 100) { currentProgress = 100; } ProgressBarManager.UpdateOnlineMaterialPercentage(currentProgress); try { //download material if ((int)materialDownloadFile.XYMicron == selectedPrinter.PrinterXYResolutionAsInt) { materialRootFileStream = DownloadManager.DownloadString(materialDownloadFile.URL); materialRootFileStream = materialRootFileStream.Substring(materialRootFileStream.IndexOf('<')); materialRootFileStream = materialRootFileStream.Replace("&", "&"); var materialsBySupplierSerializer = new System.Xml.Serialization.XmlSerializer(typeof(MaterialsBySupplier)); var materialBySupplier = (MaterialsBySupplier)materialsBySupplierSerializer.Deserialize(new StringReader(materialRootFileStream)); if (materialBySupplier != null && materialBySupplier.Materials.Count > 0) { if (!this._allOnlineMaterials.ContainsKey((int)materialDownloadFile.XYMicron)) { this._allOnlineMaterials.Add((int)materialDownloadFile.XYMicron, new MaterialsCatalog()); } this._allOnlineMaterials[(int)materialDownloadFile.XYMicron].Add(materialBySupplier); } } } catch (Exception exc) { } } } currentProgress = 100; ProgressBarManager.UpdateOnlineMaterialPercentage(currentProgress); } catch (Exception exc) { MessageBox.Show(exc.Message); } }
public void PostSlice(Slices.Slice renderSlice, DAL.Hardware.AtumPrinter selectedPrinter, PluginTypes.PostSliceActionType postSliceActions) { }