Exemplo n.º 1
0
        public Principal()
        {
            logger.Info("Iniciando Aplicación.");

            InitializeComponent();

            //cargamos informacion en la barra de estado
            this.lblUserName.Text = "User: "******"OS Version: " + Environment.OSVersion;
            this.lblMachName.Text = "PC: " + Environment.MachineName;

            mViewer = this.MG_Viewer1;
            //mProcessor.OnAddBlock += new clsProcessor.OnAddBlockEventHandler(mProcessor_OnAddBlock);

            MG_CS_BasicViewer.OnSelection += new MG_CS_BasicViewer.OnSelectionEventHandler(mViewer_OnSelection);
            MG_CS_BasicViewer.MouseLocation += new MG_CS_BasicViewer.MouseLocationEventHandler(mViewer_MouseLocation);
            MG_CS_BasicViewer.OnStatus += new MG_CS_BasicViewer.OnStatusEventHandler(mViewer_OnStatus);

            mSetup.MachineActivated += new clsSettings.MachineActivatedEventHandler(mSetup_MachineActivated);

            mSetup.LoadAllMachines(System.IO.Directory.GetCurrentDirectory() + "\\Data");
            mProcessor.Init(mSetup.Machine);

            logger.Info("Aplicación Iniciada.");
        }
Exemplo n.º 2
0
	    public frmViewer(){
	        InitializeComponent();
	        
	        getSerialPorts();
			
	        mViewer = this.MG_Viewer1; 
	        mProcessor.OnAddBlock += new clsProcessor.OnAddBlockEventHandler(mProcessor_OnAddBlock);
	        
	        MG_CS_BasicViewer.OnSelection += new MG_CS_BasicViewer.OnSelectionEventHandler(mViewer_OnSelection);
	        MG_CS_BasicViewer.MouseLocation += new MG_CS_BasicViewer.MouseLocationEventHandler(mViewer_MouseLocation);
	        mSetup.MachineActivated+=new clsSettings.MachineActivatedEventHandler(mSetup_MachineActivated);
	
	        mSetup.LoadAllMachines(System.IO.Directory.GetCurrentDirectory() + "\\Data");
	        mProcessor.Init(mSetup.Machine);
	        cancelled = false;
	        workThread = null;
	        sw = new Stopwatch();
			currentMode = eMode.DISCONNECTED;
			setMode(currentMode);
			UpdateInterval = 200; // 5 updates sec
			doStatusUpdates = false; // when enabled
			feedHold = false;
	    }
Exemplo n.º 3
0
	    private void ViewportActivated(object sender, System.EventArgs e) 
	    { 
	        mViewer = (MG_CS_BasicViewer)sender; 
	    } 
Exemplo n.º 4
0
    public frmViewer()
    {
        InitializeComponent();
		settingsForm = null;
        getSerialPorts();
        mViewer = this.MG_Viewer1;
        mProcessor.OnAddBlock += new clsProcessor.OnAddBlockEventHandler(mProcessor_OnAddBlock);
        MG_CS_BasicViewer.OnSelection += new MG_CS_BasicViewer.OnSelectionEventHandler(mViewer_OnSelection);
        MG_CS_BasicViewer.MouseLocation += new MG_CS_BasicViewer.MouseLocationEventHandler(mViewer_MouseLocation);
        mSetup.MachineActivated+=new clsSettings.MachineActivatedEventHandler(mSetup_MachineActivated);

        mSetup.LoadAllMachines(System.IO.Directory.GetCurrentDirectory() + "\\Data");
        mProcessor.Init(mSetup.Machine);
        cancelled = false;
        workThread = null;
        sw = new Stopwatch();

        // create delegate functions for use in threads
        TX_LED = new TransmitLEDDelegate(TransmitLED);
        RX_LED = new ReceiveLEDDelegate(ReceiveLED);
        FinishActions = new ThreadFinishActionsDelegate(ThreadFinishActions);
        UpdateGUIAction = new UpdateGUIThreadDelegate(UpdateGUI);
        UpdatePositionLEDSAction = new UpdatePositionLEDSDelegate(UpdatePositionLEDS);
        
        setMode(eMode.DISCONNECTED);
        UpdateInterval = 200; // 5 updates sec
        statusUpdates = false; // when enabled
        feedHold = false;
        PreprocessorMode = true;
        GrblReportsInches = false;
        
        TXLEDoff = new System.Timers.Timer(10);
        TXLEDoff.Elapsed += TXLEDoffElapsed;
        RXLEDoff = new System.Timers.Timer(10);
       	RXLEDoff.Elapsed += RXLEDoffElapsed; 
		
       	Reportrgx = new Regex(
	      "MPos:\\[([-+]?[0-9]*[\\\\.,]?[0-9]*),([-+]?[0-9]*[\\\\.,]?[0"+
	      "-9]*),([-+]?[0-9]*[\\\\.,]?[0-9]*)\\],WPos:\\[([-+]?[0-9]*[\\\\."+
	      ",]?[0-9]*),([-+]?[0-9]*[\\\\.,]?[0-9]*),([-+]?[0-9]*[\\\\.,]"+
	      "?[0-9]*)\\].*",  
	      RegexOptions.CultureInvariant | RegexOptions.Compiled
	    );       	
    }