#include <Xm/Xm.h>#include <Xm/Form.h>#include <Xm/Label.h>#include <Xm/LabelG.h>#include <Xm/MainW.h>#include <Xm/PanedW.h>#include <Xm/RowColumn.h>#include <Xm/Text.h>#include <Xm/PushB.h>#include <Xm/PushBP.h>#include <Xm/ToggleB.h>#include <Xm/CascadeB.h>#include <Xm/Separator.h>#include <Xm/MessageB.h>#include <Xm/FileSB.h>#include <Xm/DialogS.h>#include <Xm/PrimitiveP.h>#include <Xm/List.h>#include <X11/keysym.h>#include <X11/xpm.h>#include <stdlib.h>#include "estop.xpm"#include "estop_off.xpm"#include "GuiStrings.hh"#include "Jog.hh"#include "Spindle.hh"Include dependency graph for XmEmc.hh:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Functions | |
| void | buttonsCB (Widget mw, XtPointer cd, XtPointer cb) |
Variables | |
| Widget | estopbutton = NULL |
| Widget | brakebutton = NULL |
| Widget | floodbutton = NULL |
| Widget | mistbutton = NULL |
| Widget | machinebutton = NULL |
|
||||||||||||||||
|
Definition at line 572 of file XmEmc.cc. Referenced by main().
00573 {
00574 XmString valueLabel = NULL;
00575 switch ((int) cd)
00576 {
00577 case BT_MACHINE:
00578 TOGGLE (mw);
00579
00580 if (isMachineOn)
00581 turnMachineOff ();
00582 else
00583 turnMachineOn ();
00584
00585 // If the machine was off and now its on, do the following:
00586 if (isMachineOn)
00587 {
00588 UNLOCK (brakebutton);
00589 PRESS (brakebutton);
00590 UNLOCK (mistbutton);
00591 UNLOCK (floodbutton);
00592 HIDE_MANUAL ();
00593 HIDE_AUTO ();
00594 HIDE_MDI ();
00595 do_home ();
00596 }
00597 // If the machine was on and now its off, do the following:
00598 else
00599 {
00600 turnMistOff ();
00601 turnFloodOff ();
00602 turnBrakeOn ();
00603 hideSpindle ();
00604 stopSpindle ();
00605 jogDone ();
00606
00607 switch (runMode)
00608 {
00609 case MANUAL_MODE:
00610 LOCK (brakebutton);
00611 PRESS (brakebutton);
00612 LOCK (mistbutton);
00613 UNPRESS (mistbutton);
00614 LOCK (floodbutton);
00615 UNPRESS (floodbutton);
00616 SHOW_MANUAL ();
00617 break;
00618 case AUTO_MODE:
00619 SHOW_AUTO ();
00620 HIDE (scrolledText);
00621 break;
00622 case MDI_MODE:
00623 SHOW_MDI ();
00624 HIDE (scrolledText);
00625 break;
00626 }
00627 }
00628
00629 break;
00630
00631 case BT_ABORT:
00632 wasAborted = True;
00633 isRunning = False;
00634
00635 turnMachineOff ();
00636 HIDE (abortbutton);
00637 UNLOCK (machinebutton);
00638 UNPRESS (machinebutton);
00639
00640 // Turn off all other that the AUTO might have turned on
00641 turnMistOff ();
00642 turnFloodOff ();
00643 turnBrakeOn ();
00644 stopSpindle ();
00645 hideSpindle ();
00646
00647 LOCK (runModes); // We want to see where it stopped, but not allow to continue
00648 LOCK (scrolledText);
00649 LOCK (pauseButton);
00650 LOCK (stepButton);
00651 valueLabel =
00652 XmStringCreateLtoR ((char *) ABORTED_STR, XmSTRING_DEFAULT_CHARSET);
00653 XtVaSetValues (runButton, XmNlabelString, valueLabel, NULL);
00654 XmStringFree (valueLabel);
00655
00656 processAbort ();
00657
00658 break;
00659
00660 case BT_MIST:
00661 TOGGLE (mw);
00662
00663 if (isMistOn)
00664 turnMistOff ();
00665 else
00666 turnMistOn ();
00667
00668 break;
00669 case BT_FLOOD:
00670 TOGGLE (mw);
00671
00672 if (isFloodOn)
00673 turnFloodOff ();
00674 else
00675 turnFloodOn ();
00676
00677 break;
00678 case BT_BRAKE:
00679 TOGGLE (mw);
00680
00681 if (isBrakeOn)
00682 {
00683 turnBrakeOff ();
00684 showSpindle ();
00685 }
00686 else
00687 {
00688 turnBrakeOn ();
00689 stopSpindle ();
00690 hideSpindle ();
00691 }
00692
00693 break;
00694 case BT_ESTOP:
00695
00696 do_estop ();
00697
00698 turnBrakeOn ();
00699 stopSpindle ();
00700 hideSpindle ();
00701
00702 turnMachineOff ();
00703 turnMistOff ();
00704 turnFloodOff ();
00705
00706 TOGGLE (mw);
00707
00708 XtVaSetValues (mw, XmNlabelInsensitivePixmap, pixmap_off, NULL);
00709
00710 LOCK (mw);
00711
00712 PRESS (brakebutton);
00713 LOCK (brakebutton);
00714
00715 UNPRESS (mistbutton);
00716 LOCK (mistbutton);
00717
00718 UNPRESS (machinebutton);
00719 LOCK (machinebutton);
00720
00721 UNPRESS (floodbutton);
00722 LOCK (floodbutton);
00723
00724 jogDone ();
00725
00726 setSpindleSpeed (INITIAL_SPINDLE_SPEED);
00727 run_finished ();
00728 call_resume ();
00729 unsetLimitOverride ();
00730
00731 HIDE_MANUAL ();
00732 HIDE_AUTO ();
00733 HIDE_MDI ();
00734 SHOW (resetbutton);
00735
00736 break;
00737 case BT_RESET:
00738
00739 HIDE (resetbutton);
00740 TOGGLE (estopbutton);
00741 UNLOCK (estopbutton);
00742
00743 // Act as if one pressed the Machine button if it's turned on
00744 SHOW (machinebutton);
00745 UNLOCK (machinebutton);
00746 if (isMachineOn)
00747 {
00748 buttonsCB (machinebutton, (XtPointer) BT_MACHINE, (XtPointer) NULL);
00749 }
00750
00751 break;
00752
00753 case COORD_RELATIVE:
00754
00755 if (!isCoordRelative)
00756 setCoordRelative ();
00757 break;
00758
00759 case COORD_MACHINE:
00760
00761 if (isCoordRelative)
00762 setCoordMachine ();
00763 break;
00764
00765 case POSITION_ACTUAL:
00766
00767 if (!isPosActual)
00768 setPosActual ();
00769 break;
00770
00771 case POSITION_COMMANDED:
00772
00773 if (isPosActual)
00774 setPosCommanded ();
00775 break;
00776
00777 case DO_RUN:
00778 call_run ();
00779 break;
00780
00781 case PAUSE_RESUME:
00782 if (!isPaused)
00783 call_pause ();
00784 else
00785 call_resume ();
00786 break;
00787
00788 case STEP:
00789 call_step ();
00790 break;
00791
00792 case LIMIT_OVERRIDE:
00793 setLimitOverride ();
00794 break;
00795
00796 case JOG_BUTTON:
00797 showJogPopup ();
00798 break;
00799
00800 case AUTO_MODE:
00801 if (runMode != AUTO_MODE)
00802 setModeAuto ();
00803 break;
00804
00805 case MDI_MODE:
00806 if (runMode != MDI_MODE)
00807 setModeMDI ();
00808 break;
00809
00810 case MANUAL_MODE:
00811 if (runMode != MANUAL_MODE)
00812 setModeManual ();
00813 break;
00814 }
00815 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001