예제 #1
0
 private void FrmPrinterFlyout_onPrinterAdded(object sender, EventArgs e)
 {
     if (sender is AtumPrinter)
     {
         PrinterManager.Save();
         LoadPrinters();
     }
 }
예제 #2
0
        private void printerCorrectionFactorTabPanel1_ButtonNext_Click(object sender, EventArgs e)
        {
            PrinterManager.DefaultPrinter.CorrectionFactorX = (float)this.printerCorrectionFactorTabPanel1.txtCorrectionFactorX.Value / 10;
            PrinterManager.DefaultPrinter.CorrectionFactorY = (float)this.printerCorrectionFactorTabPanel1.txtCorrectionFactorY.Value / 10;
            PrinterManager.Save();


            this.Close();
        }
예제 #3
0
 private void PrinterAddControl_onSaved(object sender, EventArgs e)
 {
     if (sender is AtumPrinter)
     {
         var atumPrinter = sender as AtumPrinter;
         PrinterManager.AvailablePrinters.Add(atumPrinter);
         PrinterManager.Save();
         LoadPrinters(atumPrinter);
     }
 }
예제 #4
0
        //private void RefreshMonitors()
        //{
        //    try
        //    {
        //        this.lstMonitors.Items.Clear();
        //        foreach (Screen screen in Screen.AllScreens)
        //        {
        //            this.lstMonitors.Items.Add(new ScreenListItem(screen));
        //        }
        //        if (this.lstMonitors.Items.Count > 0)
        //            this.lstMonitors.SelectedIndex = 0;
        //    }
        //    catch (Exception)
        //    {

        //    }

        //}

        private void btnWizard_Click(object sender, EventArgs e)
        {
            using (var printerManager = new PrinterConnectionManagerPopup())
            {
                var result = printerManager.ShowDialog();
                if (result == DialogResult.OK)
                {
                    PrinterManager.Save();
                }
            }
        }
예제 #5
0
        private void PrinterValueEditorControl_onTextChanged(object sender, EventArgs e)
        {
            var printerValueEditorControl = sender as PrinterValueEditorControl;

            foreach (PrinterSummaryControl printerSummary in this.newGUIContentSplitContainerBase1.LeftPanel.Controls.OfType <PrinterSummaryControl>())
            {
                if (printerSummary.Selected)
                {
                    printerSummary.SelectedPrinter = printerValueEditorControl.SelectedPrinter;
                }
            }

            printerValueEditorControl.Focus();
            PrinterManager.Save();
        }
        private void btnSetAsDefault_Click(object sender, EventArgs e)
        {
            if (this.dgAvailablePrinters.SelectedRows.Count == 1)
            {
                var selectedPrinter = this.dgAvailablePrinters.SelectedRows[0].DataBoundItem as AtumPrinter;
                foreach (var atumPrinter in PrinterManager.SelectedPrinters)
                {
                    atumPrinter.Default = false;
                }

                selectedPrinter.Default = true;
                PrinterManager.Save();

                //update ground pane
                ObjectView.GroundPane.UpdateVertexArray((PrinterManager.DefaultPrinter.ProjectorResolutionX / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorX, (PrinterManager.DefaultPrinter.ProjectorResolutionY / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorY, 0.5f);
                ObjectView.GroundPane.UpdateBinding();
            }
        }
예제 #7
0
        private void btnAddPrinter_Click(object sender, EventArgs e)
        {
            using (var printerManager = new PrinterConnectionManagerPopup())
            {
                printerManager.StartPosition = FormStartPosition.Manual;
                printerManager.Location      =
                    new Point(
                        UserProfileManager.UserProfile.MainWindowLocation.X + (UserProfileManager.UserProfile.MainWindowSize.Width / 2) - (printerManager.Size.Width / 2),
                        UserProfileManager.UserProfile.MainWindowLocation.Y + (UserProfileManager.UserProfile.MainWindowSize.Height / 2) - (printerManager.Size.Height / 2)
                        );
                if (printerManager.ShowDialog() == DialogResult.OK)
                {
                    PrinterManager.Save();

                    this.RefreshPrinters();
                }
            }
        }
예제 #8
0
        private void btnSetAsDefault_Click(object sender, EventArgs e)
        {
            var selected = (this.plList.Controls.OfType <PrinterSummary>()).Where(o => o.Selected).FirstOrDefault();

            if (selected != null)
            {
                var selectedPrinter = selected.AtumPrinter as AtumPrinter;
                foreach (var atumPrinter in PrinterManager.SelectedPrinters)
                {
                    atumPrinter.Default = false;
                }

                selectedPrinter.Default = true;
                PrinterManager.Save();

                //update ground pane
                ObjectView.GroundPane.UpdateVertexArray((PrinterManager.DefaultPrinter.ProjectorResolutionX / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorX, (PrinterManager.DefaultPrinter.ProjectorResolutionY / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorY, 0.5f);
                ObjectView.GroundPane.UpdateBinding();

                UpdateControls();
            }
        }
예제 #9
0
        internal static AtumPrinter CalibratePrinter(string printerId, string printerName)
        {
            if (!string.IsNullOrEmpty(printerId) && !string.IsNullOrEmpty(printerName))
            {
                var availablePrinters = PrinterManager.AvailablePrinters;
                var existingPrinter   = availablePrinters.Where(x => x.SerialNumber == printerId).FirstOrDefault();
                if (existingPrinter != null)
                {
                    //printer already available in the list
                    Console.WriteLine(printerName + " with the serial key " + printerId + " is already exist.");
                }
                else
                {
                    AtumPrinter atumPrinter = new LoctiteV10();
                    atumPrinter.SerialNumber = printerId;
                    atumPrinter.DisplayName  = printerName;
                    atumPrinter.SetDefaultPrinterResolution(AtumPrinter.PrinterXYResolutionType.Micron100);
                    (atumPrinter as LoctiteV10).CalcDefaultTrapezoidValues();
                    atumPrinter.ID = Guid.NewGuid().ToString().ToUpper();
                    PrinterManager.AvailablePrinters.Add(atumPrinter);
                    PrinterManager.Save();
                    Console.WriteLine(printerName + " added successfully.");
                }
            }
            else
            {
                Console.WriteLine("PrinterId and PrinterName must be provided.");
                return(null);
            }

            var selectedPrinter          = PrinterManager.AvailablePrinters.Where(x => x.SerialNumber == printerId).FirstOrDefault();
            var printerCalibrationDialog = new frmCalibratePrinter(selectedPrinter);

            printerCalibrationDialog.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            var result = printerCalibrationDialog.ShowDialog();

            PrinterManager.Save();
            return(selectedPrinter);
        }
예제 #10
0
 private void lightFieldCalibrationCalibrationTabPanel1_ButtonNext_Click(object sender, EventArgs e)
 {
     PrinterManager.Save();
     this.Close();
 }
예제 #11
0
 private void frmPrinterEditor_FormClosing(object sender, FormClosingEventArgs e)
 {
     PrinterManager.Save();
 }
예제 #12
0
        private void btnProperties_Click(object sender, EventArgs e)
        {
            var selected = (this.plList.Controls.OfType <PrinterSummary>()).Where(o => o.Selected).FirstOrDefault();

            if (selected != null)
            {
                if (selected.AtumPrinter is AtumV15Printer)
                {
                    var selectedPrinter = selected.AtumPrinter as AtumV15Printer;
                    using (var printerPropertiesPopup = new PrinterEditor.AtumV15PrinterConfigurationPopup())
                    {
                        printerPropertiesPopup.DataSource    = selectedPrinter;
                        printerPropertiesPopup.StartPosition = FormStartPosition.CenterParent;
                        if (printerPropertiesPopup.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                        {
                            selectedPrinter.DisplayName = printerPropertiesPopup.DataSource.DisplayName;
                            PrinterManager.Save();

                            //update ground pane
                            if (selectedPrinter.Default)
                            {
                                ObjectView.GroundPane.UpdateVertexArray((PrinterManager.DefaultPrinter.ProjectorResolutionX / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorX, (PrinterManager.DefaultPrinter.ProjectorResolutionY / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorY, 0.5f);
                                ObjectView.GroundPane.UpdateBinding();
                            }
                        }
                        else
                        {
                            selectedPrinter.RevertChanges();
                        }
                    }
                }
                else if (selected.AtumPrinter is AtumV20Printer)
                {
                    var selectedPrinter = selected.AtumPrinter as AtumV20Printer;
                    using (var printerPropertiesPopup = new PrinterEditor.AtumV20PrinterConfigurationPopup())
                    {
                        printerPropertiesPopup.DataSource    = selectedPrinter;
                        printerPropertiesPopup.StartPosition = FormStartPosition.CenterParent;
                        if (printerPropertiesPopup.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                        {
                            selectedPrinter.DisplayName = printerPropertiesPopup.DataSource.DisplayName;
                            PrinterManager.Save();

                            //update ground pane
                            if (selectedPrinter.Default)
                            {
                                ObjectView.GroundPane.UpdateVertexArray((PrinterManager.DefaultPrinter.ProjectorResolutionX / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorX, (PrinterManager.DefaultPrinter.ProjectorResolutionY / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorY, 0.5f);
                                ObjectView.GroundPane.UpdateBinding();
                            }
                        }
                        else
                        {
                            selectedPrinter.RevertChanges();
                        }
                    }
                }
                else if (selected.AtumPrinter is AtumDLPStation5)
                {
                    var selectedPrinter = selected.AtumPrinter as AtumDLPStation5;
                    using (var printerPropertiesPopup = new PrinterEditor.AtumDLPStation5PrinterConfigurationPopup())
                    {
                        printerPropertiesPopup.DataSource    = selectedPrinter;
                        printerPropertiesPopup.StartPosition = FormStartPosition.CenterParent;
                        if (printerPropertiesPopup.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                        {
                            selectedPrinter.DisplayName = printerPropertiesPopup.DataSource.DisplayName;
                            PrinterManager.Save();

                            //update ground pane
                            if (selectedPrinter.Default)
                            {
                                ObjectView.GroundPane.UpdateVertexArray((PrinterManager.DefaultPrinter.ProjectorResolutionX / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorX, (PrinterManager.DefaultPrinter.ProjectorResolutionY / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorY, 0.5f);
                                ObjectView.GroundPane.UpdateBinding();
                            }
                        }
                        else
                        {
                            selectedPrinter.RevertChanges();
                        }
                    }
                }

                else if (selected.AtumPrinter is LoctiteV10)
                {
                    var selectedPrinter = selected.AtumPrinter as LoctiteV10;
                    using (var printerPropertiesPopup = new PrinterEditor.LoctiteV10PrinterConfigurationPopup())
                    {
                        printerPropertiesPopup.DataSource    = selectedPrinter;
                        printerPropertiesPopup.StartPosition = FormStartPosition.CenterParent;
                        if (printerPropertiesPopup.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                        {
                            selectedPrinter.DisplayName = printerPropertiesPopup.DataSource.DisplayName;
                            PrinterManager.Save();

                            //update ground pane
                            if (selectedPrinter.Default)
                            {
                                ObjectView.GroundPane.UpdateVertexArray((PrinterManager.DefaultPrinter.ProjectorResolutionX / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorX, (PrinterManager.DefaultPrinter.ProjectorResolutionY / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorY, 0.5f);
                                ObjectView.GroundPane.UpdateBinding();
                            }
                        }
                        else
                        {
                            selectedPrinter.RevertChanges();
                        }
                    }
                }
            }
        }
        private void btnProperties_Click(object sender, EventArgs e)
        {
            if (this.dgAvailablePrinters.SelectedRows.Count == 1)
            {
                if (this.dgAvailablePrinters.SelectedRows[0].DataBoundItem is AtumV15Printer)
                {
                    var selectedPrinter = this.dgAvailablePrinters.SelectedRows[0].DataBoundItem as AtumV15Printer;
                    using (var printerPropertiesPopup = new PrinterEditor.AtumV15PrinterConfigurationPopup())
                    {
                        printerPropertiesPopup.DataSource    = selectedPrinter;
                        printerPropertiesPopup.StartPosition = FormStartPosition.CenterParent;
                        if (printerPropertiesPopup.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                        {
                            selectedPrinter.DisplayName = printerPropertiesPopup.DataSource.DisplayName;
                            PrinterManager.Save();

                            //update ground pane
                            if (selectedPrinter.Default)
                            {
                                ObjectView.GroundPane.UpdateVertexArray((PrinterManager.DefaultPrinter.ProjectorResolutionX / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorX, (PrinterManager.DefaultPrinter.ProjectorResolutionY / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorY, 0.5f);
                                ObjectView.GroundPane.UpdateBinding();
                            }
                        }
                        else
                        {
                            selectedPrinter.RevertChanges();
                        }
                    }
                }
                else if (this.dgAvailablePrinters.SelectedRows[0].DataBoundItem is AtumV20Printer)
                {
                    var selectedPrinter = this.dgAvailablePrinters.SelectedRows[0].DataBoundItem as AtumV20Printer;
                    using (var printerPropertiesPopup = new PrinterEditor.AtumV20PrinterConfigurationPopup())
                    {
                        printerPropertiesPopup.DataSource    = selectedPrinter;
                        printerPropertiesPopup.StartPosition = FormStartPosition.CenterParent;
                        if (printerPropertiesPopup.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                        {
                            selectedPrinter.DisplayName = printerPropertiesPopup.DataSource.DisplayName;
                            PrinterManager.Save();

                            //update ground pane
                            if (selectedPrinter.Default)
                            {
                                ObjectView.GroundPane.UpdateVertexArray((PrinterManager.DefaultPrinter.ProjectorResolutionX / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorX, (PrinterManager.DefaultPrinter.ProjectorResolutionY / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorY, 0.5f);
                                ObjectView.GroundPane.UpdateBinding();
                            }
                        }
                        else
                        {
                            selectedPrinter.RevertChanges();
                        }
                    }
                }
                else if (this.dgAvailablePrinters.SelectedRows[0].DataBoundItem is AtumDLPStation5)
                {
                    var selectedPrinter = this.dgAvailablePrinters.SelectedRows[0].DataBoundItem as AtumDLPStation5;
                    using (var printerPropertiesPopup = new PrinterEditor.AtumDLPStation5PrinterConfigurationPopup())
                    {
                        printerPropertiesPopup.DataSource    = selectedPrinter;
                        printerPropertiesPopup.StartPosition = FormStartPosition.CenterParent;
                        if (printerPropertiesPopup.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                        {
                            selectedPrinter.DisplayName = printerPropertiesPopup.DataSource.DisplayName;
                            PrinterManager.Save();

                            //update ground pane
                            if (selectedPrinter.Default)
                            {
                                ObjectView.GroundPane.UpdateVertexArray((PrinterManager.DefaultPrinter.ProjectorResolutionX / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorX, (PrinterManager.DefaultPrinter.ProjectorResolutionY / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorY, 0.5f);
                                ObjectView.GroundPane.UpdateBinding();
                            }
                        }
                        else
                        {
                            selectedPrinter.RevertChanges();
                        }
                    }
                }

                else if (this.dgAvailablePrinters.SelectedRows[0].DataBoundItem is LoctiteV10)
                {
                    var selectedPrinter = this.dgAvailablePrinters.SelectedRows[0].DataBoundItem as LoctiteV10;
                    using (var printerPropertiesPopup = new PrinterEditor.LoctiteV10PrinterConfigurationPopup())
                    {
                        printerPropertiesPopup.DataSource    = selectedPrinter;
                        printerPropertiesPopup.StartPosition = FormStartPosition.CenterParent;
                        if (printerPropertiesPopup.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                        {
                            selectedPrinter.DisplayName = printerPropertiesPopup.DataSource.DisplayName;
                            PrinterManager.Save();

                            //update ground pane
                            if (selectedPrinter.Default)
                            {
                                ObjectView.GroundPane.UpdateVertexArray((PrinterManager.DefaultPrinter.ProjectorResolutionX / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorX, (PrinterManager.DefaultPrinter.ProjectorResolutionY / 10) * PrinterManager.DefaultPrinter.TrapeziumCorrectionFactorY, 0.5f);
                                ObjectView.GroundPane.UpdateBinding();
                            }
                        }
                        else
                        {
                            selectedPrinter.RevertChanges();
                        }
                    }
                }
            }
        }