<lcnc-ncam>
  <feature src="lathe/material.cfg" after="" help="&lt;b&gt;Workpiece or raw material used&lt;/b&gt;" old-selected="False" before="" id="workpiece_001" expanded="False" name="Workpiece" init="" version="1.14" new-selected="False" path="0" call="&#10;(begin #sub_name)&#10;(author : Fernand Veilleux)&#10;&#10;G#param_wmode (Diameter = 7, Radius = 8)&#10;#&lt;_diameter_mode&gt; = [#&lt;_lathe_diameter_mode&gt; + 1] (value is 1 for radius and 2 for diameter)&#10;&#10;#&lt;_wp_dia_od&gt; = [#param_od / 2 * #&lt;_diameter_mode&gt;]&#10;#&lt;_wp_dia_id&gt; = [#param_id / 2 * #&lt;_diameter_mode&gt;]&#10;&#10;#&lt;_x_rapid&gt;  = [#param_x_rap * #&lt;_diameter_mode&gt;]&#10;#&lt;_z_rapid&gt;  = #param_z_rap&#10;&#10;/ o&lt;#self_id1&gt; if [#param_sh EQ 1]&#10;&#9;/ o&lt;show_stock&gt; CALL [#param_z] [#param_l]&#10;/ o&lt;#self_id1&gt; endif&#10;&#10;(end #sub_name)" definitions="" hidden_count="0" type="workpiece" order="['PARAM_SH', 'PARAM_H1', 'PARAM_OD', 'PARAM_ID', 'PARAM_L', 'PARAM_Z', 'PARAM_H2', 'PARAM_WMODE', 'PARAM_X_RAP', 'PARAM_Z_RAP']" validation="&#10;if self.check_hash('#param_od', 1) &lt;= self.check_hash('#param_id', 1) :&#10;&#9;VALIDATED = False&#10;&#9;self.msg_inv(_('External diameter must be greater than the internal'), 1)" icon="l-stock.png">
    <param call="#param_sh" type="bool" name="Show limits" value="0" path="0:0"/>
    <param call="#param_h1" type="sub-header" name="Size and coord" path="0:1"/>
    <param name="Ext. diameter" metric_value="50.0" value="2.0" header="h1" call="#param_od" path="0:1:0" not_allowed="0" icon="e-diam.png" type="float" minimum_value="0.0"/>
    <param tool_tip="Only if hollow" name="Int. diameter" metric_value="0.0" value="0.0" header="h1" call="#param_id" path="0:1:1" icon="i-diam.png" type="float" minimum_value="0.0"/>
    <param name="Length" metric_value="250.0" value="10.0" header="h1" call="#param_l" path="0:1:2" not_allowed="0" icon="width.png" type="float" minimum_value="0.0"/>
    <param tool_tip="Z coord at tip" name="Begin position" metric_value="0.0" value="0.0" header="h1" call="#param_z" path="0:1:3" type="float" icon="z.png"/>
    <param call="#param_h2" type="sub-header" name="Params" path="0:2"/>
    <param name="Work mode" value="7" header="h2" call="#param_wmode" path="0:2:0" type="combo" options="Diameter=7:Radius=8" icon="circle-rad-dia.png"/>
    <param tool_tip="When job is done" name="Safe X rapid" metric_value="25.0" value="0.50" header="h2" call="#param_x_rap" path="0:2:1" not_allowed="0" icon="lathe-rappid-x.png" type="float" minimum_value="0.0"/>
    <param tool_tip="When job is done" name="Safe Z rapid" metric_value="25.0" value="0.50" header="h2" call="#param_z_rap" path="0:2:2" not_allowed="0" minimum_value="0.0" type="float" icon="lathe-rappid-z.png"/>
  </feature>
  <feature src="lathe/tool-change.cfg" after="" help="&lt;b&gt;Change Tool and/or settings&lt;/b&gt;&amp;#10;Changes setting accordingly even if disabled" old-selected="False" before="" id="tool_change_001" expanded="False" name="Tool Change" init="&#10;a = parent.get_param('param_mode').get_attr('value')&#10;parent.get_param('param_surf_speed').set_grayed(a == '1')&#10;if a == '1' :&#10;&#9;parent.get_param('param_speed').attr['name'] = 'Spindle speed'&#10;else :&#10;&#9;parent.get_param('param_speed').attr['name'] = 'Max spindle'" version="1.14" new-selected="False" path="1" call="&#10;(begin #sub_name)&#10;(author : Fernand Veilleux)&#10;&#10;o&lt;#self_id_tlc&gt; if [[#param_tlc EQ 3] AND [#param_dnum GT 0]]&#10;&#9;M61 Q#param_dnum&#10;o&lt;#self_id_tlc&gt; endif&#10;&#10;o&lt;#self_id_act&gt; if [#param_act AND [#param_dnum NE #5400]]&#10;&#9;M9  (coolant off)&#10;&#9;T#param_dnum M6&#10;&#9;o&lt;#self_id_lc&gt; if [#param_tlc GE 1]&#10;&#9;&#9;G43 H#param_dnum&#10;&#9;o&lt;#self_id_lc&gt; endif&#10;o&lt;#self_id_act&gt; endif&#10;&#10;#&lt;_tool_usage&gt;   =  #param_us&#10;#&lt;_spindle_dir&gt;  =  #param_spindle_dir&#10;#&lt;_cooling_mode&gt; =  #param_cooling&#10;&#10;#&lt;_rough_feed&gt;   =  #param_r_feed&#10;#&lt;_rough_cut&gt;    =  #param_c_dpt&#10;&#10;#&lt;_finish_feed&gt;  =  #param_f_feed&#10;#&lt;_finish_cut&gt;   =  #param_fc_dpt&#10;&#10;o&lt;#self_id1&gt; if [#param_mode EQ 0]&#10;&#9;G96 D#param_speed S#param_surf_speed&#10;o&lt;#self_id1&gt; else&#10;&#9;G97 S#param_speed&#10;o&lt;#self_id1&gt; endif&#10;&#10;o&lt;#self_id2&gt; if [#&lt;_spindle_dir&gt; GT 0]&#10;&#9;M#&lt;_spindle_dir&gt;&#10;&#9;G4 P#&lt;_spindle_speed_up_delay&gt;&#10;o&lt;#self_id2&gt; endif&#10;&#10;#&lt;_z_clear&gt;  = [#5410 + #param_rz]&#10;#&lt;_x_clear&gt;  = [[#5410 + #param_rx] * #&lt;_diameter_mode&gt;]&#10;#&lt;_ix_clear&gt; = [#param_rix * #&lt;_diameter_mode&gt;]&#10;&#10;F#&lt;_rough_feed&gt;&#10;&#10;(end #sub_name)" definitions="" hidden_count="0" type="tool_change" order="['PARAM_ACT', 'PARAM_H1', 'PARAM_DNUM', 'PARAM_US', 'PARAM_TLC', 'PARAM_SPINDLE_DIR', 'PARAM_COOLING', 'PARAM_H2', 'PARAM_MODE', 'PARAM_SPEED', 'PARAM_SURF_SPEED', 'PARAM_H8', 'PARAM_R_FEED', 'PARAM_C_DPT', 'PARAM_H4', 'PARAM_F_FEED', 'PARAM_FC_DPT', 'PARAM_HC', 'PARAM_RX', 'PARAM_RIX', 'PARAM_RZ']" validation="&#10;TOOL_TABLE.save_tool_orient(#param_dnum)" icon="lathe-tool-change.png">
    <param tool_tip="Params will be set even if disabled" name="Active" value="1" call="#param_act" path="1:0" type="bool" icon="enable.png"/>
    <param call="#param_h1" type="sub-header" name="Tool and usage" path="1:1"/>
    <param tool_tip="Select from tool table" name="Tool number" value="0" header="h1" call="#param_dnum" path="1:1:0" type="tool" icon="lathe-tool.png"/>
    <param tool_tip="Select usage for this tool" name="Usage" value="0" header="h1" call="#param_us" path="1:1:1" type="combo" options="Roughing and finishing=0:Roughing=1:Finishing=2" icon="tool-usage.png"/>
    <param tool_tip="Use G43 and probe if setup" name="Use length comp" value="1" header="h1" call="#param_tlc" path="1:1:2" type="combo" options="No=0:Already mounted and touched=3:From tool table=1:Table and probe=2" icon="comp-l.png"/>
    <param tool_tip="Select spindle rotation" name="Start spindle" value="3" header="h1" call="#param_spindle_dir" path="1:1:3" type="combo" options="No=5:Clockwise=3:Counter-clockwise=4" icon="lathe-dir.png"/>
    <param tool_tip="Use flood, mist or none" name="Use cooling" value="8" header="h1" call="#param_cooling" path="1:1:4" type="combo" options="None=9:Flood=8:Mist=7" icon="snowflake.png"/>
    <param call="#param_h2" type="sub-header" name="Spindle control" path="1:2"/>
    <param name="Mode" value="0" header="h2" call="#param_mode" value_changed="&#10;parent.get_param('param_surf_speed').set_grayed(new_val == '1')&#10;if new_val == '1' :&#10;&#9;parent.get_param('param_speed').attr['name'] = 'Spindle speed'&#10;else :&#10;&#9;parent.get_param('param_speed').attr['name'] = 'Max spindle'" path="1:2:0" type="combo" options="Constant surface speed=0:RPM=1" icon="lathe-chuck.png"/>
    <param tool_tip="RPM spindle speed" name="Max spindle" value="1000" header="h2" call="#param_speed" path="1:2:1" minimum_value="10" type="int" icon="tool-spindle.png"/>
    <param tool_tip="Constant spindle speed" name="Surface speed" grayed="0" value="250" header="h2" call="#param_surf_speed" path="1:2:2" minimum_value="100" type="int" icon="tool-spindle.png"/>
    <param tool_tip="Set these when usage is roughing" call="#param_h8" type="sub-header" name="Roughing" path="1:3"/>
    <param tool_tip="Feed at 100% engagement" name="Feed" metric_value="75.0" value="5.0" header="h8" call="#param_r_feed" path="1:3:0" not_allowed="0" icon="lathe-feed.png" type="float" minimum_value="0.0"/>
    <param tool_tip="Depth of cutter engagment in machine units per pass" name="Cut depth" metric_value="0.5" value="0.02" header="h8" call="#param_c_dpt" path="1:3:1" not_allowed="0" icon="lathe-depth-step.png" type="float" minimum_value="0.0"/>
    <param tool_tip="Set these when usage include finishing" call="#param_h4" type="sub-header" name="Finishing" path="1:4"/>
    <param tool_tip="Feed at 100% engagement" name="Feed" metric_value="50.0" value="2.0" header="h4" call="#param_f_feed" path="1:4:0" not_allowed="0" icon="lathe-feed.png" type="float" minimum_value="0.0"/>
    <param tool_tip="Depth of cutter engagment in machine units per pass" name="Cut depth" metric_value="0.25" value="0.01" header="h4" call="#param_fc_dpt" path="1:4:1" not_allowed="0" icon="lathe-depth-step.png" type="float" minimum_value="0.0"/>
    <param call="#param_hc" type="sub-header" name="Clearances" path="1:5"/>
    <param tool_tip="Retract distance on multiple passes" name="Retract X" metric_value="1.0" value="0.04" header="hc" call="#param_rx" not_allowed="0" path="1:5:0" icon="lx-clear.png" type="float" minimum_value="0.0"/>
    <param tool_tip="Retract distance" name="Int. retract X" metric_value="1.0" value="0.040" header="hc" call="#param_rix" not_allowed="0" path="1:5:1" icon="ix-clear.png" type="float" minimum_value="0.0"/>
    <param tool_tip="Retract distance on multiple passes" name="Retract Z" metric_value="1.0" value="0.04" header="hc" call="#param_rz" not_allowed="0" path="1:5:2" icon="lz-clear.png" type="float" minimum_value="0.0"/>
  </feature>
  <feature src="lathe/facing.cfg" expanded="False" help="&lt;b&gt;Face end and optionnaly set this face to 0.0&lt;/b&gt;&amp;#10; Verify cutter orientation" icon="lathe-facing.png" old-selected="True" name="Facing" after="" order="['PARAM_ACT', 'PARAM_HX', 'PARAM_B_X', 'PARAM_E_X', 'PARAM_HZ', 'PARAM_SZ', 'PARAM_ZU_S', 'PARAM_ZUGC', 'PARAM_LR', 'PARAM_HF', 'PARAM_FIN', 'PARAM_HT', 'PARAM_T']" init="" version="1.14" hidden_count="0" definitions="" call="&#10;(begin #sub_name)&#10;(author : Fernand Veilleux)&#10;&#10;o&lt;#self_id_act&gt; if [#param_act]&#10;&#9;o&lt;select&gt;  CALL [42] [#param_sz] [#param_zu_s] [#&lt;_z&gt;] [#param_zugc]&#10;&#10;&#9;o&lt;facing&gt; CALL [#param_b_x] [#param_e_x] [#42] [#42 + #param_lr] [#param_fin] [#param_t]&#10;&#10;o&lt;#self_id_act&gt; endif&#10;&#10;(end #sub_name)&#10;" new-selected="False" path="2" validation="&#10;if #param_act == 1 :&#10;&#9;if self.check_hash('#param_b_x', 1) &lt; self.check_hash('#param_e_x', 0) :&#10;&#9;&#9;self.msg_inv(_('Begin X must be greater than End X'), 1)&#10;&#9;&#9;VALIDATED = False&#10;&#10;&#9;lr = self.check_hash('#param_lr', 0)&#10;&#9;if lr &lt; 0.0 and TOOL_TABLE.get_tool_orient() not in [0, 2, 3, 7, 9] :&#10;&#9;&#9;self.msg_inv(_('Cutter orientation should be 7, 2, 9, 3 or 0'), 2)&#10;&#9;elif lr &gt; 0.0 and TOOL_TABLE.get_tool_orient() not in [0, 1, 4, 5, 9] :&#10;&#9;&#9;self.msg_inv(_('Cutter orientation should be 5, 1, 9, 4 or 0'), 2)&#10;" type="facing" id="facing_001" before="">
    <param name="Active" value="1" call="#param_act" path="2:0" type="bool" icon="enable.png"/>
    <param type="sub-header" call="#param_hx" name="X axis" path="2:1"/>
    <param name="Begin diameter" metric_value="25.0" value="1.0" header="hx" call="#param_b_x" path="2:1:0" not_allowed="0" minimum_value="0.0" type="float" icon="x.png"/>
    <param name="End diameter" metric_value="0.0" value="0.0" header="hx" call="#param_e_x" path="2:1:1" type="float" icon="x-end.png"/>
    <param type="sub-header" call="#param_hz" name="Z axis" path="2:2"/>
    <param tool_tip="Pre or user defined" name="Begin" links="zu_s=0:zugc=2" value="1" header="hz" call="#param_sz" path="2:2:0" type="combo-user" options="User defined=0:Current position=1:G-Code=2" icon="z.png"/>
    <param metric_value="0.0" value="0.0" header="hz" call="#param_zu_s" path="2:2:1" hidden="1" type="float"/>
    <param value="" header="hz" call="#param_zugc" path="2:2:2" hidden="1" type="gcode"/>
    <param tool_tip="Length to remove" name="End offset" metric_value="-0.75" value="-0.03" header="hz" call="#param_lr" path="2:2:3" type="float" icon="dx.png"/>
    <param type="sub-header" call="#param_hf" name="Finishing" path="2:3"/>
    <param tool_tip="Or spring passes" name="Number of passes" value="1" header="hf" call="#param_fin" path="2:3:0" minimum_value="0" type="int" icon="finish.png"/>
    <param type="sub-header" call="#param_ht" name="Touch off" path="2:4"/>
    <param tool_tip="Set finished face to Z0" name="Set Z to 0" value="1" header="ht" call="#param_t" path="2:4:0" type="bool" icon="00.png"/>
  </feature>
</lcnc-ncam>
