コード例 #1
0
 public void cmdConnect1_Click(object sender, object e)
 {
     try
     {
         if (!UVDLPApp.Instance().m_deviceinterface.Connected) //
         {
             // configure the main device interface
             UVDLPApp.Instance().m_deviceinterface.Configure(UVDLPApp.Instance().m_printerinfo.m_driverconfig.m_connection);
             //get the name of the main serial interface
             String com = UVDLPApp.Instance().m_printerinfo.m_driverconfig.m_connection.comname;
             if (com.ToUpper().Equals("AUTODETECT"))
             {
                 com = SerialAutodetect.Instance().DeterminePort(UVDLPApp.Instance().m_printerinfo.m_driverconfig.m_connection.speed);
                 if (!com.Equals("invalid"))
                 {
                     UVDLPApp.Instance().m_printerinfo.m_driverconfig.m_connection.comname = com;
                 }
                 else
                 {
                     DebugLogger.Instance().LogError("Serial port not auto-detected");
                     return;
                 }
             }
             DebugLogger.Instance().LogRecord("Connecting to Printer on " + com + " using " + UVDLPApp.Instance().m_printerinfo.m_driverconfig.m_drivertype.ToString());
             if (!UVDLPApp.Instance().m_deviceinterface.Connect())
             {
                 DebugLogger.Instance().LogRecord("Cannot connect printer driver on " + com);
                 //don't try to connect the monitor serial port unless the main machine connection is made first
                 // this prevents the problem of having a connected serial port and no way to disconnect it
             }
             else
             {
                 UVDLPApp.Instance().RaiseAppEvent(eAppEvent.eMachineConnected, "Printer connected");
                 // check to see if we're uv dlp
                 // configure the projector
                 if (UVDLPApp.Instance().m_printerinfo.m_machinetype == MachineConfig.eMachineType.UV_DLP)
                 {
                     DisplayManager.Instance().ConnectMonitorSerials();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         DebugLogger.Instance().LogRecord(ex.Message);
     }
 }
コード例 #2
0
 public ctlMainManual()
 {
     InitializeComponent();
     //UVDLPApp.Instance().m_gui_config.AddControl("ctlManualControl", ctlManualControl1);
     if (!(DesignMode))
     {
         var com = SerialAutodetect.Instance().DeterminePort(UVDLPApp.Instance().m_printerinfo.m_driverconfig.m_connection.speed);
         if (com.Equals(((DesignMode) ? "Invalid" : UVDLPApp.Instance().resman.GetString("Invalid", UVDLPApp.Instance().cul))))
         {
             ctlStandardManual1.Enabled         = ctlFluidSuply1.Enabled =
                 ctlCheckPowder1.Enabled        = ctlTemprature1.Enabled =
                     ctlAdvancedManual1.Enabled = ctlSeviceStation1.Enabled = false;
         }
         else
         {
             ctlAdvancedPritControl1.Enabled    = ctlStandardManual1.Enabled = ctlFluidSuply1.Enabled =
                 ctlCheckPowder1.Enabled        = ctlTemprature1.Enabled =
                     ctlAdvancedManual1.Enabled = ctlSeviceStation1.Enabled = true;
         }
     }
 }