Import LinuxCNC source tree

This commit is contained in:
Wang Dequan
2026-08-20 06:17:39 +08:00
commit 2c814634c3
9429 changed files with 10556013 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
This is a simulation of an XYZ plasma cutter (with metric units).
The main purpose of this is to show the possibilities offered by gscreen / gmoccapy to design custom screens.
This special layout has been made to control plasma cutters, many work has be done by Marius.
The original coolant and spindle frames are hidden, also the tool info frame and the spindle speed label in active gcode frame is hidden.
Feel free to send any comment to:
gmoccapy@web.de

View File

@@ -0,0 +1,208 @@
# EMC controller parameters for a simulated machine.
# General note: Comments can either be preceded with a # or ; - either is
# acceptable, although # is in keeping with most linux config files.
# General section -------------------------------------------------------------
[EMC]
VERSION = 1.1
MACHINE = gmoccapy
#DEBUG = 0x7FFFFFFF
DEBUG = 0
# for details see nc_files/subroutines/maco_instructions.txt
[DISPLAY]
DISPLAY = gmoccapy
#PREFERENCE_FILE_PATH = gmoccapy_preferences
EMBED_TAB_NAME = tool_replacement_panel
EMBED_TAB_LOCATION = box_tool_and_code_info
EMBED_TAB_COMMAND = gladevcp -x {XID} -u signals.py -H signals.hal signals.glade
EMBED_TAB_NAME = coolant_spindle_panel
EMBED_TAB_LOCATION = box_coolant_and_spindle
EMBED_TAB_COMMAND = gladevcp -x {XID} -u plasma.py -H plasma.hal plasma.glade
# Cycle time, in milliseconds, that display will sleep between polls
CYCLE_TIME = 100
# Highest value that will be allowed for feed override, 1.0 = 100%
MAX_FEED_OVERRIDE = 1.5
MAX_SPINDLE_OVERRIDE = 1.2
MIN_SPINDLE_OVERRIDE = .5
# Max and default jog speeds in units per second
MAX_LINEAR_VELOCITY = 166
DEFAULT_LINEAR_VELOCITY = 5
MAX_ANGULAR_VELOCITY = 234
# Prefix to be used
PROGRAM_PREFIX = ../../nc_files/
# Introductory graphic
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
# list of selectable jog increments
INCREMENTS = 1mm, 0.1mm, 0.01mm, 0.001mm
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python3
# Task controller section -----------------------------------------------------
[RS274NGC]
RS274NGC_STARTUP_CODE = G17 G21 G40 G43H0 G54 G64P0.005 G80 G90 G94 G97 M5 M9
PARAMETER_FILE = sim.var
SUBROUTINE_PATH = ./macros
# Motion control section ------------------------------------------------------
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
BASE_PERIOD = 100000
SERVO_PERIOD = 1000000
# Hardware Abstraction Layer section --------------------------------------------------
[TASK]
TASK = milltask
CYCLE_TIME = 0.001
# Part program interpreter section --------------------------------------------
[HAL]
HALFILE = core_sim.hal
HALFILE = simulated_home.hal
# Single file that is executed after the GUI has started.
POSTGUI_HALFILE = gmoccapy_postgui.hal
HALUI = halui
# Trajectory planner section --------------------------------------------------
[HALUI]
#No Content
[TRAJ]
COORDINATES = X Y Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 9.0
MAX_LINEAR_VELOCITY = 234
POSITION_FILE = position.txt
#NO_FORCE_HOMING = 1
# First axis
[EMCIO]
# tool table file
TOOL_TABLE = torches.tbl
TOOL_CHANGE_POSITION = 100 100 -10
TOOL_CHANGE_QUILL_UP = 1
[KINS]
KINEMATICS = trivkins
JOINTS = 3
[AXIS_X]
MIN_LIMIT = -400.0
MAX_LIMIT = 400.0
MAX_VELOCITY = 166
MAX_ACCELERATION = 1500.0
[JOINT_0]
TYPE = LINEAR
MAX_VELOCITY = 166
MAX_ACCELERATION = 1500.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -400.0
MAX_LIMIT = 400.0
FERROR = 0.050
MIN_FERROR = 0.010
HOME_OFFSET = 0.0
HOME = 10
HOME_SEARCH_VEL = 200.0
HOME_LATCH_VEL = 20.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 1
# Second axis
[AXIS_Y]
MIN_LIMIT = -400.0
MAX_LIMIT = 400.0
MAX_VELOCITY = 166
MAX_ACCELERATION = 1500.0
[JOINT_1]
TYPE = LINEAR
MAX_VELOCITY = 166
MAX_ACCELERATION = 1500.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -400.0
MAX_LIMIT = 400.0
FERROR = 0.050
MIN_FERROR = 0.010
HOME_OFFSET = 0.0
HOME = 10
HOME_SEARCH_VEL = 200.0
HOME_LATCH_VEL = 20.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 1
# Third axis
[AXIS_Z]
MIN_LIMIT = -400.0
MAX_LIMIT = 0.001
MAX_VELOCITY = 166
MAX_ACCELERATION = 1500.0
[JOINT_2]
TYPE = LINEAR
MAX_VELOCITY = 166
MAX_ACCELERATION = 1500.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -400.0
MAX_LIMIT = 0.001
FERROR = 0.050
MIN_FERROR = 0.010
HOME_OFFSET = 1.0
HOME = -10
HOME_SEARCH_VEL = 200.0
HOME_LATCH_VEL = 20.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 0
# section for main IO controller parameters -----------------------------------
[MACROS]
MACRO = i_am_lost
MACRO = halo_world
MACRO = jog_around
MACRO = increment xinc yinc
MACRO = go_to_position X-pos Y-pos Z-pos
# Sections for display options ------------------------------------------------
[PLASMA]
# Note that setting Ignition timeout to high can cause issues with very short cuts, problems can arise when the timeout has not expired and starting to cut a new part
#- Ignition fault timeout, the time allowed from TorchOn until ArcOK before re-probing and re-initiating, in seconds
IGNITION_TIMEOUT = 3
#- ArcOK timeout, a filter, for a signal to be valid it needs to exceed the specified time period, in seconds
ARC_OK_FILTER_TIME = 0.2
#- Ignition Retries before abort, the number of attempts to re-probe and start the torch before estop
MAX_FAILED_IGNITIONS = 5
#- Extinguish Timeout, a grace period after losing ArcOK before shutting off the torch and re-probing, in seconds
EXTINGUISH_TIMEOUT = 0.2

View File

@@ -0,0 +1,10 @@
###################################################################
# moccapy_postgui.hal file from Norbert Schechner #
###################################################################
unlinkp iocontrol.0.tool-change
unlinkp iocontrol.0.tool-changed
net tool-change gmoccapy.toolchange-change iocontrol.0.tool-change
net tool-changed gmoccapy.toolchange-changed iocontrol.0.tool-changed
net tool-prep-number gmoccapy.toolchange-number iocontrol.0.tool-prep-number

View File

@@ -0,0 +1 @@
../macros

View File

@@ -0,0 +1,940 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<requires lib="gladevcp" version="0.0"/>
<object class="GtkAdjustment" id="adj_CHL_threshold">
<property name="lower">10</property>
<property name="upper">99</property>
<property name="value">60</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkWindow" id="window1">
<property name="width-request">500</property>
<property name="height-request">250</property>
<property name="can-focus">False</property>
<child>
<object class="GtkHBox" id="hbox_plasma_settings">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkFrame" id="frm_control">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label-xalign">0.5</property>
<child>
<object class="GtkVBox" id="vbx_correction">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lbl_correction">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Corr.</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="HAL_Label" id="hal-lbl-corr">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">0.0</property>
<property name="label-pin-type">1</property>
<property name="text-template">%3.1f</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="lbl_frm_control">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Control&lt;/b&gt;</property>
<property name="use-markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frm_limit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label-xalign">0.5</property>
<child>
<object class="GtkAlignment" id="ali_limits">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="top-padding">2</property>
<property name="bottom-padding">2</property>
<property name="left-padding">2</property>
<property name="right-padding">2</property>
<child>
<object class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="n-rows">4</property>
<child>
<object class="HAL_LED" id="led-pos-limit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="led-blink-rate">0</property>
<property name="led-size">7</property>
<property name="pick-color-off">#7d7d7d7d7d7d</property>
<property name="pick-color-on">#ffff00000000</property>
</object>
<packing>
<property name="top-attach">1</property>
<property name="bottom-attach">2</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="HAL_LED" id="led-neg-limit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="led-blink-rate">0</property>
<property name="led-size">7</property>
<property name="pick-color-off">#7d7d7d7d7d7d</property>
<property name="pick-color-on">#ffff00000000</property>
</object>
<packing>
<property name="top-attach">3</property>
<property name="bottom-attach">4</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_pos_limit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Pos.</property>
</object>
</child>
<child>
<object class="GtkLabel" id="lbl_neg_limit">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Neg.</property>
</object>
<packing>
<property name="top-attach">2</property>
<property name="bottom-attach">3</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;limits&lt;/b&gt;</property>
<property name="use-markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="HAL_ToggleButton" id="hal-btn-THC">
<property name="label" translatable="yes">THC</property>
<property name="width-request">48</property>
<property name="height-request">48</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frm_cutting">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label-xalign">0.5</property>
<child>
<object class="GtkAlignment" id="ali_cutting">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="top-padding">2</property>
<property name="bottom-padding">2</property>
<property name="left-padding">2</property>
<property name="right-padding">2</property>
<child>
<object class="GtkTable" id="tbl_cutting">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="n-rows">6</property>
<property name="n-columns">2</property>
<property name="row-spacing">1</property>
<child>
<object class="GtkHBox" id="hbx_cutting_speed">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lbl_cut_speed">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">15</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_cut_pct">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">%</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="right-attach">2</property>
<property name="x-options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbx_cut_gap">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lbl_cut_gap">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">4.123</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_cut_mm">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">mm</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="right-attach">2</property>
<property name="top-attach">2</property>
<property name="bottom-attach">3</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbx_g0_gap">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lbl_g0_gap">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">52.123</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_g0_mi">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">mm</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="right-attach">2</property>
<property name="top-attach">4</property>
<property name="bottom-attach">5</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_cut_gap_plus">
<property name="label" translatable="yes">Cut Gap +</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="right-attach">2</property>
<property name="top-attach">3</property>
<property name="bottom-attach">4</property>
<property name="x-options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_cut_gap_minus">
<property name="label" translatable="yes">Cut Gap -</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="top-attach">3</property>
<property name="bottom-attach">4</property>
<property name="x-options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_g0_minus">
<property name="label" translatable="yes">G0 Gap -</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="top-attach">5</property>
<property name="bottom-attach">6</property>
<property name="x-options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_g0_plus">
<property name="label" translatable="yes">G0 Gap +</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="right-attach">2</property>
<property name="top-attach">5</property>
<property name="bottom-attach">6</property>
<property name="x-options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_THC_speed_plus">
<property name="label" translatable="yes">THC Spd +</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="right-attach">2</property>
<property name="top-attach">1</property>
<property name="bottom-attach">2</property>
<property name="x-options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_THC_speed_minus">
<property name="label" translatable="yes">THC Spd -</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="top-attach">1</property>
<property name="bottom-attach">2</property>
<property name="x-options">GTK_SHRINK | GTK_FILL</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="lbl_frm_cutting">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Cutting&lt;/b&gt;</property>
<property name="use-markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frm_piercing">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label-xalign">0.5</property>
<child>
<object class="GtkAlignment" id="ali_piercing">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="top-padding">2</property>
<property name="bottom-padding">2</property>
<property name="left-padding">2</property>
<property name="right-padding">2</property>
<child>
<object class="GtkTable" id="tbl_piercing">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="n-rows">5</property>
<property name="n-columns">2</property>
<child>
<object class="HAL_CheckButton" id="Piercing-autostart">
<property name="label" translatable="yes">Autostart</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="active">True</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="right-attach">2</property>
<property name="x-options">GTK_SHRINK</property>
<property name="x-padding">10</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_pierce_delay_minus">
<property name="label" translatable="yes">Delay
-</property>
<property name="width-request">48</property>
<property name="height-request">48</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="top-attach">4</property>
<property name="bottom-attach">5</property>
<property name="x-options">GTK_SHRINK</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_pierce_delay_plus">
<property name="label" translatable="yes">Delay
+</property>
<property name="width-request">48</property>
<property name="height-request">48</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="right-attach">2</property>
<property name="top-attach">4</property>
<property name="bottom-attach">5</property>
<property name="x-options">GTK_SHRINK</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_pierce_gap_minus">
<property name="label" translatable="yes">Gap
-</property>
<property name="width-request">48</property>
<property name="height-request">48</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="top-attach">2</property>
<property name="bottom-attach">3</property>
<property name="x-options">GTK_SHRINK</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_pierce_gap_plus">
<property name="label" translatable="yes">Gap
+</property>
<property name="width-request">48</property>
<property name="height-request">48</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="right-attach">2</property>
<property name="top-attach">2</property>
<property name="bottom-attach">3</property>
<property name="x-options">GTK_SHRINK</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbx_pierce_gap">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lbl_pierce_gap">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">7.123</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_pierce_gap_mm">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">mm</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="right-attach">2</property>
<property name="top-attach">1</property>
<property name="bottom-attach">2</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbx_pierce_delay">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lbl_pierce_delay">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">0.5</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_pierce_sec">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">s</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="right-attach">2</property>
<property name="top-attach">3</property>
<property name="bottom-attach">4</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="lbl_frm_piercing">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Piercing&lt;/b&gt;</property>
<property name="use-markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbx_corner_lock">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkFrame" id="frm_corner_height_lock">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label-xalign">0</property>
<child>
<object class="GtkAlignment" id="ali_corner_lock">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="top-padding">2</property>
<property name="bottom-padding">2</property>
<property name="left-padding">2</property>
<property name="right-padding">2</property>
<child>
<object class="GtkTable" id="table_corner_lock">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="n-rows">3</property>
<property name="n-columns">2</property>
<child>
<object class="HAL_CheckButton" id="enable-HeightLock">
<property name="label" translatable="yes">Enable</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="relief">none</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="right-attach">2</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_threshold">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Threshold %</property>
</object>
<packing>
<property name="right-attach">2</property>
<property name="top-attach">1</property>
<property name="bottom-attach">2</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="HAL_HScale" id="CHL-Threshold">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">adj_CHL_threshold</property>
<property name="show-fill-level">True</property>
<property name="digits">0</property>
</object>
<packing>
<property name="right-attach">2</property>
<property name="top-attach">2</property>
<property name="bottom-attach">3</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="lbl_frm_corner_height_lock">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Corner lock&lt;/b&gt;</property>
<property name="use-markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="HAL_ToggleButton" id="hal-btn-torch">
<property name="width-request">48</property>
<property name="height-request">48</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<child>
<object class="GtkImage" id="img_torch">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixbuf">torch.svg</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">2</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frm_THC_voltage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label-xalign">0.5</property>
<child>
<object class="GtkAlignment" id="ali_THC_voltage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="top-padding">2</property>
<property name="bottom-padding">2</property>
<property name="left-padding">2</property>
<property name="right-padding">2</property>
<child>
<object class="GtkTable" id="tbl_voltage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="n-rows">4</property>
<property name="n-columns">2</property>
<child>
<object class="GtkButton" id="btn_THC_target_minus">
<property name="label" translatable="yes">-</property>
<property name="width-request">48</property>
<property name="height-request">48</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="top-attach">3</property>
<property name="bottom-attach">4</property>
<property name="x-options">GTK_SHRINK</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_THC_target_plus">
<property name="label" translatable="yes">+</property>
<property name="width-request">48</property>
<property name="height-request">48</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="right-attach">2</property>
<property name="top-attach">3</property>
<property name="bottom-attach">4</property>
<property name="x-options">GTK_SHRINK</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_act_volt">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Actual Tip Volts</property>
</object>
<packing>
<property name="right-attach">2</property>
<property name="x-options">GTK_SHRINK | GTK_FILL</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbx_actual_volt">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="HAL_Label" id="hal-lbl-cur-volt">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">000</property>
<property name="label-pin-type">1</property>
<property name="text-template">%3.0f</property>
<attributes>
<attribute name="style" value="normal"/>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="2"/>
</attributes>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_actual_volts">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">V</property>
<attributes>
<attribute name="style" value="normal"/>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="2"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="right-attach">2</property>
<property name="top-attach">1</property>
<property name="bottom-attach">2</property>
<property name="x-options">GTK_SHRINK | GTK_FILL</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbx_programmed_volt">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="lbl_prog_volt">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">100</property>
<attributes>
<attribute name="style" value="normal"/>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="2"/>
</attributes>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_volt">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">V</property>
<attributes>
<attribute name="style" value="normal"/>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="2"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="right-attach">2</property>
<property name="top-attach">2</property>
<property name="bottom-attach">3</property>
<property name="x-options">GTK_SHRINK | GTK_FILL</property>
<property name="y-options">GTK_EXPAND | GTK_SHRINK</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="lbl_frm_voltage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;THC Voltage&lt;/b&gt;</property>
<property name="use-markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkAdjustment" id="adj_G0_gap">
<property name="lower">-50</property>
<property name="upper">50</property>
<property name="value">7</property>
<property name="step-increment">0.01</property>
<property name="page-increment">1</property>
</object>
<object class="GtkAdjustment" id="adj_THC_Voltage">
<property name="lower">1</property>
<property name="upper">255</property>
<property name="value">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adj_THC_speed">
<property name="lower">0.0001</property>
<property name="upper">1</property>
<property name="value">0.0005</property>
<property name="step-increment">0.001</property>
</object>
<object class="GtkAdjustment" id="adj_cut_gap">
<property name="lower">1</property>
<property name="upper">99</property>
<property name="value">54</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adj_pierce_delay">
<property name="upper">10</property>
<property name="value">0.5</property>
<property name="step-increment">0.01</property>
</object>
<object class="GtkAdjustment" id="adj_pierce_gap">
<property name="lower">0.01</property>
<property name="upper">10</property>
<property name="value">5</property>
<property name="step-increment">0.10</property>
</object>
</interface>

View File

@@ -0,0 +1,31 @@
############### plasma hal pins ####################
# out pin
# plasma.CHL-Threshold (float)
# plasma.enable-HeightLock (bool)
# plasma.enable-HeightLock-not (bool)
# plasma.hal-btn-torch-not (bool)
# plasma.hal-btn-torch (bool)
# plasma.Target-Voltage (float)
# plasma.THC-Speed (float)
# plasma.Piercing-autostart-not (bool)
# plasma.Piercing-autostart (bool)
# plasma.Pierce-Gap (float)
# plasma.Pierce-Delay (float)
# plasma.G0-Gap (float)
# plasma.Cut-Gap (float)
# in pin
# plasma.led-pos-limit (bool)
# plasma.led-neg-limit (bool)
# plasma.hal-lbl-corr (float)
# plasma.hal-lbl-cur-volt (float)
# Hook up plasma pins using the net command
# for simulation mode we connect them directly
net torch plasma.hal-btn-torch => signals.led-torch-on => signals.led-arc-ok
net curvolt plasma.Target-Voltage => plasma.hal-lbl-cur-volt

View File

@@ -0,0 +1,313 @@
#!/usr/bin/env python3
# -*- coding:UTF-8 -*-
"""
This file will control some options of the gmoccapy plasma screen
and demonstrates at the same time the possibilities you have introducing
your own handler files and functions to that screen, showing the
possibilities to modify the layout and behavior
Copyright 2013 Norbert Schechner
nieson@web.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
import hal_glib # needed to make our own hal pins
import hal # needed to make our own hal pins
from gladevcp.persistence import IniFile # we use this one to save the states of the widgets on shut down and restart
from gladevcp.persistence import widget_defaults
from gladevcp.persistence import select_widgets
import gtk
from gmoccapy import preferences
from gmoccapy import getiniinfo
class PlasmaClass:
def __init__(self, halcomp, builder, useropts):
self.builder = builder
self.halcomp = halcomp
self.defaults = { IniFile.vars : { "thcspeedval" : 15.0 ,
"thcspeedmax" : 20.0 ,
"thcspeedmin" : 1.0 ,
"thcspeedincr" : 1.0 ,
"cutgapval" : 4.0 ,
"cutgapmax" : 10.0 ,
"cutgapmin" : 0.1 ,
"cutgapincr" : 0.1 ,
"g0gapval" : 45.0 ,
"g0gapmax" : 55.0 ,
"g0gapmin" : 0.5 ,
"g0gapincr" : 0.5 ,
"pierceutostart" : True ,
"piercegapval" : 5.0 ,
"piercegapmax" : 12.0 ,
"piercegapmin" : 2.0 ,
"piercegapincr" : 0.5 ,
"piercedelayval" : 0.5 ,
"piercedelaymax" : 10.0 ,
"piercedelaymin" : 0.01 ,
"piercedelayincr" : 0.01 ,
"enableheightlock" : False,
"chlthresholdval" : 60.0 ,
"chlthresholdmax" : 100.0,
"chlthresholdmin" : 10.0 ,
"chlthresholdincr" : 10.0 ,
"thctargetvoltval" : 100.0,
"thctargetvoltmax" : 255.0,
"thctargetvoltmin" : 55.0 ,
"thctargetvoltincr" : 5.0 ,
},
IniFile.widgets: widget_defaults(select_widgets([self.builder.get_object("hal-btn-THC"),
], hal_only = True, output_only = True)),
}
get_ini_info = getiniinfo.GetIniInfo()
prefs = preferences.preferences(get_ini_info.get_preference_file_path())
theme_name = prefs.getpref("gtk_theme", "Follow System Theme", str)
if theme_name == "Follow System Theme":
theme_name = gtk.settings_get_default().get_property("gtk-theme-name")
gtk.settings_get_default().set_string_property("gtk-theme-name", theme_name, "")
self.ini_filename = __name__ + ".var"
self.ini = IniFile(self.ini_filename, self.defaults, self.builder)
self.ini.restore_state(self)
# lets make our pins
self.THC_speed = hal_glib.GPin(halcomp.newpin("THC-Speed", hal.HAL_FLOAT, hal.HAL_OUT))
self.cut_gap = hal_glib.GPin(halcomp.newpin("Cut-Gap", hal.HAL_FLOAT, hal.HAL_OUT))
self.g0_gap = hal_glib.GPin(halcomp.newpin("G0-Gap", hal.HAL_FLOAT, hal.HAL_OUT))
self.pierce_deley = hal_glib.GPin(halcomp.newpin("Pierce-Delay", hal.HAL_FLOAT, hal.HAL_OUT))
self.pierce_gap = hal_glib.GPin(halcomp.newpin("Pierce-Gap", hal.HAL_FLOAT, hal.HAL_OUT))
self.target_voltage = hal_glib.GPin(halcomp.newpin("Target-Voltage", hal.HAL_FLOAT, hal.HAL_OUT))
# get all widgets and connect them
self.lbl_prog_volt = self.builder.get_object("lbl_prog_volt")
self.lbl_cut_speed = self.builder.get_object("lbl_cut_speed")
self.lbl_cut_gap = self.builder.get_object("lbl_cut_gap")
self.lbl_g0_gap = self.builder.get_object("lbl_g0_gap")
self.lbl_pierce_gap = self.builder.get_object("lbl_pierce_gap")
self.lbl_pierce_delay = self.builder.get_object("lbl_pierce_delay")
self.btn_THC_speed_minus = self.builder.get_object("btn_THC_speed_minus")
self.btn_THC_speed_minus.connect("pressed", self.on_btn_THC_speed_pressed, -1)
self.btn_THC_speed_plus = self.builder.get_object("btn_THC_speed_plus")
self.btn_THC_speed_plus.connect("pressed", self.on_btn_THC_speed_pressed, 1)
self.adj_THC_speed = self.builder.get_object("adj_THC_speed")
self.adj_THC_speed.connect("value_changed", self.on_adj_THC_speed_value_changed)
self.adj_THC_speed.upper = self.thcspeedmax
self.adj_THC_speed.lower = self.thcspeedmin
self.adj_THC_speed.set_value(self.thcspeedval)
self.tbl_cutting = self.builder.get_object("tbl_cutting")
self.tbl_cutting.connect("destroy", self._on_destroy)
self.btn_cut_gap_minus = self.builder.get_object("btn_cut_gap_minus")
self.btn_cut_gap_minus.connect("pressed", self.on_btn_cut_gap_pressed, -1)
self.btn_cut_gap_plus = self.builder.get_object("btn_cut_gap_plus")
self.btn_cut_gap_plus.connect("pressed", self.on_btn_cut_gap_pressed, 1)
self.adj_cut_gap = self.builder.get_object("adj_cut_gap")
self.adj_cut_gap.connect("value_changed", self.on_adj_cut_gap_value_changed)
self.adj_cut_gap.upper = self.cutgapmax
self.adj_cut_gap.lower = self.cutgapmin
self.adj_cut_gap.set_value(self.cutgapval)
self.btn_g0_minus = self.builder.get_object("btn_g0_minus")
self.btn_g0_minus.connect("pressed", self.on_btn_g0_pressed, -1)
self.btn_g0_plus = self.builder.get_object("btn_g0_plus")
self.btn_g0_plus.connect("pressed", self.on_btn_g0_pressed, 1)
self.adj_G0_gap = self.builder.get_object("adj_G0_gap")
self.adj_G0_gap.connect("value_changed", self.on_adj_G0_gap_value_changed)
self.adj_G0_gap.upper = self.g0gapmax
self.adj_G0_gap.lower = self.g0gapmin
self.adj_G0_gap.set_value(self.g0gapval)
self.Piercing_autostart = self.builder.get_object("Piercing-autostart")
self.Piercing_autostart.connect("toggled", self.on_Piercing_autostart_toggled)
self.Piercing_autostart.set_active(self.pierceutostart)
self.btn_pierce_gap_minus = self.builder.get_object("btn_pierce_gap_minus")
self.btn_pierce_gap_minus.connect("pressed", self.on_btn_pierce_gap_pressed, -1)
self.btn_pierce_gap_plus = self.builder.get_object("btn_pierce_gap_plus")
self.btn_pierce_gap_plus.connect("pressed", self.on_btn_pierce_gap_pressed, 1)
self.adj_pierce_gap = self.builder.get_object("adj_pierce_gap")
self.adj_pierce_gap.connect("value_changed", self.on_adj_pierce_gap_value_changed)
self.adj_pierce_gap.upper = self.piercegapmax
self.adj_pierce_gap.lower = self.piercegapmin
self.adj_pierce_gap.set_value(self.piercegapval)
self.btn_pierce_delay_minus = self.builder.get_object("btn_pierce_delay_minus")
self.btn_pierce_delay_minus.connect("pressed", self.on_btn_pierce_delay_pressed, -1)
self.btn_pierce_delay_plus = self.builder.get_object("btn_pierce_delay_plus")
self.btn_pierce_delay_plus.connect("pressed", self.on_btn_pierce_delay_pressed, 1)
self.adj_pierce_delay = self.builder.get_object("adj_pierce_delay")
self.adj_pierce_delay.connect("value_changed", self.on_adj_pierce_delay_value_changed)
self.adj_pierce_delay.upper = self.piercedelaymax
self.adj_pierce_delay.lower = self.piercedelaymin
self.adj_pierce_delay.set_value(self.piercedelayval)
self.enable_HeightLock = self.builder.get_object("enable-HeightLock")
self.enable_HeightLock.connect("toggled", self.on_enable_HeightLock_toggled)
self.enable_HeightLock.set_active(self.enableheightlock)
self.adj_CHL_threshold = self.builder.get_object("adj_CHL_threshold")
self.adj_CHL_threshold.connect("value_changed", self.on_adj_CHL_threshold_value_changed)
self.adj_CHL_threshold.upper = self.chlthresholdmax
self.adj_CHL_threshold.lower = self.chlthresholdmin
self.adj_CHL_threshold.set_value(self.chlthresholdval)
self.btn_THC_target_minus = self.builder.get_object("btn_THC_target_minus")
self.btn_THC_target_minus.connect("pressed", self.on_btn_THC_target_pressed, -1)
self.btn_THC_target_plus = self.builder.get_object("btn_THC_target_plus")
self.btn_THC_target_plus.connect("pressed", self.on_btn_THC_target_pressed, 1)
self.adj_THC_Voltage = self.builder.get_object("adj_THC_Voltage")
self.adj_THC_Voltage.connect("value_changed", self.on_adj_THC_Voltage_value_changed)
self.adj_THC_Voltage.upper = self.thctargetvoltmax
self.adj_THC_Voltage.lower = self.thctargetvoltmin
self.adj_THC_Voltage.set_value(self.thctargetvoltval)
def _on_destroy(self, obj, data = None):
self.ini.save_state(self)
# What to do on button press events?
def on_btn_THC_speed_pressed(self, widget, dir):
increment = self.thcspeedincr * dir
self.thcspeedval = self.adj_THC_speed.get_value() + increment
self.adj_THC_speed.set_value(self.thcspeedval)
def on_btn_cut_gap_pressed(self, widget, dir):
increment = self.cutgapincr * dir
self.cutgapval = self.adj_cut_gap.get_value() + increment
self.adj_cut_gap.set_value(self.cutgapval)
def on_btn_g0_pressed(self, widget, dir):
increment = self.g0gapincr * dir
self.g0gapval = self.adj_G0_gap.get_value() + increment
self.adj_G0_gap.set_value(self.g0gapval)
def on_btn_pierce_gap_pressed(self, widget, dir):
increment = self.piercegapincr * dir
self.piercegapval = self.adj_pierce_gap.get_value() + increment
self.adj_pierce_gap.set_value(self.piercegapval)
def on_btn_pierce_delay_pressed(self, widget, dir):
increment = self.piercedelayincr * dir
self.piercedelayval = self.adj_pierce_delay.get_value() + increment
self.adj_pierce_delay.set_value(self.piercedelayval)
def on_btn_THC_target_pressed(self, widget, dir):
increment = self.thctargetvoltincr * dir
self.thctargetvoltval = self.adj_THC_Voltage.get_value() + increment
self.adj_THC_Voltage.set_value(self.thctargetvoltval)
# and the behavior of the adjustments to control max and min values
def on_adj_THC_speed_value_changed(self, widget, data = None):
if widget.get_value() >= widget.upper:
self.btn_THC_speed_plus.set_sensitive(False)
elif widget.get_value() <= widget.lower:
self.btn_THC_speed_minus.set_sensitive(False)
else:
self.btn_THC_speed_plus.set_sensitive(True)
self.btn_THC_speed_minus.set_sensitive(True)
self.halcomp["THC-Speed"] = widget.get_value()
self.lbl_cut_speed.set_label("%.1f" % (widget.get_value()))
def on_adj_cut_gap_value_changed(self, widget, data = None):
if widget.get_value() >= widget.upper:
self.btn_cut_gap_plus.set_sensitive(False)
elif widget.get_value() <= widget.lower:
self.btn_cut_gap_minus.set_sensitive(False)
else:
self.btn_cut_gap_plus.set_sensitive(True)
self.btn_cut_gap_minus.set_sensitive(True)
self.halcomp["Cut-Gap"] = widget.get_value()
self.lbl_cut_gap.set_label("%.3f" % (widget.get_value()))
def on_adj_G0_gap_value_changed(self, widget, data = None):
if widget.get_value() >= widget.upper:
self.btn_g0_plus.set_sensitive(False)
elif widget.get_value() <= widget.lower:
self.btn_g0_minus.set_sensitive(False)
else:
self.btn_g0_plus.set_sensitive(True)
self.btn_g0_minus.set_sensitive(True)
self.halcomp["G0-Gap"] = widget.get_value()
self.lbl_g0_gap.set_label("%.3f" % (widget.get_value()))
def on_adj_pierce_gap_value_changed(self, widget, data = None):
if widget.get_value() >= widget.upper:
self.btn_pierce_gap_plus.set_sensitive(False)
elif widget.get_value() <= widget.lower:
self.btn_pierce_gap_minus.set_sensitive(False)
else:
self.btn_pierce_gap_plus.set_sensitive(True)
self.btn_pierce_gap_minus.set_sensitive(True)
self.halcomp["Pierce-Gap"] = widget.get_value()
self.lbl_pierce_gap.set_label("%.3f" % (widget.get_value()))
def on_adj_pierce_delay_value_changed(self, widget, data = None):
if widget.get_value() >= widget.upper:
self.btn_pierce_delay_plus.set_sensitive(False)
elif widget.get_value() <= widget.lower:
self.btn_pierce_delay_minus.set_sensitive(False)
else:
self.btn_pierce_delay_plus.set_sensitive(True)
self.btn_pierce_delay_minus.set_sensitive(True)
self.halcomp["Pierce-Delay"] = widget.get_value()
self.lbl_pierce_delay.set_label("%.2f" % (widget.get_value()))
def on_adj_CHL_threshold_value_changed(self, widget, data = None):
self.chlthresholdval = widget.get_value()
def on_adj_THC_Voltage_value_changed(self, widget, data = None):
if widget.get_value() >= widget.upper:
self.btn_THC_target_plus.set_sensitive(False)
elif widget.get_value() <= widget.lower:
self.btn_THC_target_minus.set_sensitive(False)
else:
self.btn_THC_target_plus.set_sensitive(True)
self.btn_THC_target_minus.set_sensitive(True)
self.halcomp["Target-Voltage"] = widget.get_value()
self.lbl_prog_volt.set_label("%d" % (widget.get_value()))
def on_Piercing_autostart_toggled(self, widget, data = None):
self.pierceutostart = widget.get_active()
def on_enable_HeightLock_toggled(self, widget, data = None):
self.enableheightlock = widget.get_active()
def get_handlers(halcomp, builder, useropts):
return[PlasmaClass(halcomp, builder, useropts)]

View File

@@ -0,0 +1,281 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.16"/>
<requires lib="gladevcp" version="0.0"/>
<object class="GtkWindow" id="window1">
<property name="can-focus">False</property>
<child>
<object class="GtkFrame" id="frm_signals">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label-xalign">0.5</property>
<child>
<object class="GtkAlignment" id="ali_signals">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="top-padding">5</property>
<property name="bottom-padding">5</property>
<property name="left-padding">5</property>
<property name="right-padding">5</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">10</property>
<child>
<object class="GtkTable" id="tbl_signals">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="n-rows">3</property>
<property name="n-columns">2</property>
<child>
<object class="GtkLabel" id="lbl_flood_switch">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Float Sw</property>
<property name="width-chars">8</property>
<property name="xalign">0</property>
<attributes>
<attribute name="style" value="normal"/>
<attribute name="scale" value="0.75"/>
</attributes>
</object>
<packing>
<property name="y-options">GTK_EXPAND | GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="HAL_LED" id="led-torch-on">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="led-blink-rate">0</property>
<property name="led-size">5</property>
<property name="pick-color-off">#7d7d7d7d7d7d</property>
<property name="pick-color-on">#ffffffff0000</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="right-attach">2</property>
<property name="top-attach">1</property>
<property name="bottom-attach">2</property>
<property name="x-options">GTK_SHRINK</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_torch_on">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Torch On</property>
<property name="width-chars">8</property>
<property name="xalign">0</property>
<attributes>
<attribute name="scale" value="0.75"/>
</attributes>
</object>
<packing>
<property name="top-attach">1</property>
<property name="bottom-attach">2</property>
<property name="y-options">GTK_EXPAND | GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="HAL_LED" id="led-float-switch">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="led-blink-rate">0</property>
<property name="led-size">5</property>
<property name="pick-color-off">#7d7d7d7d7d7d</property>
<property name="pick-color-on">#ffffffff0000</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="right-attach">2</property>
<property name="x-options">GTK_SHRINK</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_arc_ok">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Arc OK</property>
<property name="width-chars">8</property>
<property name="xalign">0</property>
<attributes>
<attribute name="scale" value="0.75"/>
</attributes>
</object>
<packing>
<property name="top-attach">2</property>
<property name="bottom-attach">3</property>
<property name="y-options">GTK_EXPAND | GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="HAL_LED" id="led-arc-ok">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="led-blink-rate">0</property>
<property name="led-size">5</property>
<property name="pick-color-off">#7d7d7d7d7d7d</property>
<property name="pick-color-on">#0000ffff0000</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="right-attach">2</property>
<property name="top-attach">2</property>
<property name="bottom-attach">3</property>
<property name="x-options">GTK_SHRINK</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVSeparator" id="vsep">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkTable" id="tbl_adjustment">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="n-rows">3</property>
<property name="n-columns">2</property>
<child>
<object class="GtkLabel" id="lbl_move_up">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Z up</property>
<property name="xalign">0</property>
<attributes>
<attribute name="scale" value="0.75"/>
</attributes>
</object>
<packing>
<property name="y-options">GTK_EXPAND | GTK_SHRINK</property>
<property name="x-padding">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_move_down">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Z down</property>
<property name="xalign">0</property>
<attributes>
<attribute name="scale" value="0.75"/>
</attributes>
</object>
<packing>
<property name="top-attach">1</property>
<property name="bottom-attach">2</property>
<property name="y-options">GTK_EXPAND | GTK_SHRINK</property>
<property name="x-padding">5</property>
</packing>
</child>
<child>
<object class="HAL_LED" id="led-move-up">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="led-blink-rate">0</property>
<property name="led-size">5</property>
<property name="pick-color-off">#7d7d7d7d7d7d</property>
<property name="pick-color-on">#0000ffff0000</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="right-attach">2</property>
<property name="x-options">GTK_SHRINK</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="HAL_LED" id="led-move-down">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="led-blink-rate">0</property>
<property name="led-size">5</property>
<property name="pick-color-off">#7d7d7d7d7d7d</property>
<property name="pick-color-on">#0000ffff0000</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="right-attach">2</property>
<property name="top-attach">1</property>
<property name="bottom-attach">2</property>
<property name="x-options">GTK_SHRINK</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_height_lock">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Cnr lock</property>
<property name="xalign">0</property>
<attributes>
<attribute name="scale" value="0.75"/>
</attributes>
</object>
<packing>
<property name="top-attach">2</property>
<property name="bottom-attach">3</property>
<property name="y-options">GTK_EXPAND | GTK_SHRINK</property>
<property name="x-padding">5</property>
</packing>
</child>
<child>
<object class="HAL_LED" id="led-height-lock">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="led-blink-rate">0</property>
<property name="led-size">5</property>
<property name="pick-color-off">#7d7d7d7d7d7d</property>
<property name="pick-color-on">#0000ffff0000</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="right-attach">2</property>
<property name="top-attach">2</property>
<property name="bottom-attach">3</property>
<property name="x-options">GTK_SHRINK</property>
<property name="y-options">GTK_SHRINK</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="lbl_frm_tool_info">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Signals&lt;/b&gt;</property>
<property name="use-markup">True</property>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@@ -0,0 +1,10 @@
# Hook up signal pins connecting
# Out pin
#net ArcOK => signals.led-arc-ok
#net TorchOn => signals.led-torch-on
#net MoveUp => signals.led-move-up
#net MoveDown => signals.led-move-down
#net HeightLock => signals.led-height-lock
#net FloatSwitch => signals.led-float-switch

View File

@@ -0,0 +1,47 @@
#!/usr/bin/env python3
# -*- coding:UTF-8 -*-
"""
This file will control some options of the gmoccapy plasma screen
and demonstrates at the same time the possibilities you have introducing
your own handler files and functions to that screen, showing the
possibilities to modify the layout and behavior
for signals it is only needed to get the theme correct, so the glade file
fit with the rest of the screen from users, using non Default Themes
Copyright 2013 Norbert Schechner
nieson@web.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
import gtk
from gmoccapy import preferences
from gmoccapy import getiniinfo
class SignalsClass:
def __init__(self, halcomp, builder, useropts):
get_ini_info = getiniinfo.GetIniInfo()
prefs = preferences.preferences(get_ini_info.get_preference_file_path())
theme_name = prefs.getpref("gtk_theme", "Follow System Theme", str)
if theme_name == "Follow System Theme":
theme_name = gtk.settings_get_default().get_property("gtk-theme-name")
gtk.settings_get_default().set_string_property("gtk-theme-name", theme_name, "")
def get_handlers(halcomp, builder, useropts):
return[SignalsClass(halcomp, builder, useropts)]

View File

@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48"
height="48"
id="svg2"
version="1.1"
inkscape:version="0.47 r22583"
sodipodi:docname="torch.svg">
<defs
id="defs4">
<linearGradient
id="linearGradient2846">
<stop
style="stop-color:#ff0000;stop-opacity:1;"
offset="0"
id="stop2848" />
<stop
id="stop3656"
offset="0.82235008"
style="stop-color:#ffff00;stop-opacity:1;" />
<stop
style="stop-color:#ffff00;stop-opacity:1"
offset="1"
id="stop2850" />
</linearGradient>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective10" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2846"
id="radialGradient3626"
cx="24.107141"
cy="30.902298"
fx="24.107141"
fy="30.902298"
r="4.1607141"
gradientTransform="matrix(0.87982804,-3.6463843e-7,1.3215927e-6,3.1888414,2.4505348,929.89141)"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="11.2"
inkscape:cx="47.803572"
inkscape:cy="20.000001"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1280"
inkscape:window-height="949"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1004.3622)">
<path
style="fill:#ff0000;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 15.357143,2.9999999 16.160714,0 -2.857143,17.6785711 -9.375,0.08929 -3.928571,-17.7678571 z"
id="path2832"
transform="translate(0,1004.3622)" />
<path
style="fill:#ff0000;fill-opacity:1"
d="M 16.883837,11.982142 C 15.762704,6.8995527 14.827682,2.6908474 14.806011,2.6294634 c -0.03134,-0.088787 1.724233,-0.1116071 8.586222,-0.1116071 7.157287,0 8.625624,0.020402 8.625624,0.1198476 0,0.090589 -2.223555,13.9501191 -2.86317,17.8462871 -0.09474,0.577122 -0.109313,0.601892 -0.381063,0.647901 -0.155403,0.02631 -2.435535,0.05762 -5.066958,0.06958 l -4.784405,0.02174 -2.038424,-9.241071 z m 11.348499,8.190284 c 0.04906,-0.04906 2.707728,-16.2825976 2.71227,-16.5608197 0.0014,-0.088416 -1.558812,-0.1116072 -7.508591,-0.1116072 -7.108614,0 -7.508256,0.00836 -7.470086,0.15625 0.02218,0.085937 0.860046,3.8680114 1.861924,8.4046079 l 1.821596,8.248359 4.263795,-0.04075 c 2.345087,-0.02241 4.288678,-0.06563 4.319092,-0.09604 z"
id="path2834"
transform="translate(0,1004.3622)" />
<path
style="opacity:1;fill:url(#radialGradient3626);fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 20,1025.5765 7.321428,-0.089 -1.696428,25.5357 -4.375,0 -1.25,-25.4464 z"
id="path2836" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -0,0 +1,4 @@
T1 P1 D0.125000 Z+0.511000 ;1/8 end mill
T2 P2 D0.062500 Z+0.100000 ;1/16 end mill
T3 P3 D0.201000 Z+1.273000 ;#7 tap drill
T99999 P99999 Z+0.100000 ;big tool number