Skip to content

Commit

Permalink
tests and code optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Paciente8159 committed Oct 24, 2024
1 parent dcc5ff8 commit 7a5d1dc
Show file tree
Hide file tree
Showing 17 changed files with 1,735 additions and 1,901 deletions.
111 changes: 111 additions & 0 deletions makefiles/virtual/expressions.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
n0010 g21 g1 x0 f20000
(msg,comment expression test)
(msg, x:#5420, y:#5421, z:#5422)
g0 x1(msg, can be printed via parameter 5420)
$#5420(msg, can be printed via parameter <_x>)
$#<_x>
g0 x0
n0020 x [1 + 2](msg,x should be 3)
$#<_x>
n0030 x [1 - 2](msg,x should be -1)
$#<_x>
n0040 x [1 --3](msg,x should be 4)
$#<_x>
n0050 x [2/5](msg,x should be 0.40)
$#<_x>
n0060 x [3.0 * 5](msg,x should be 15)
$#<_x>
n0070 x [0 OR 0](msg,x should be 0)
$#<_x>
n0080 x [0 OR 1](msg,x should be 1)
$#<_x>
n0090 x [2 or 2](msg,x should be 2)
$#<_x>
n0100 x [0 AND 0](msg,x should be 0)
$#<_x>
n0110 x [0 AND 1](msg,x should be 0)
$#<_x>
n0120 x [2 and 2](msg,x should be 1)
$#<_x>
n0130 x [0 XOR 0](msg,x should be 0)
$#<_x>
n0140 x [0 XOR 1](msg,x should be 1)
$#<_x>
n0150 x [2 xor 2](msg,x should be 0)
$#<_x>
n0160 x [15 MOD 4.0](msg,x should be 3)
$#<_x>
n0170 x [1 + 2 * 3 - 4 / 5](msg,x should be 6.2)
$#<_x>
n0180 x sin[30](msg,x should be 0.5)
$#<_x>
n0190 x cos[0.0](msg,x should be 1.0)
$#<_x>
n0200 x tan[60.0](msg,x should be 1.7321)
$#<_x>
n0210 x sqrt[3](msg,x should be 1.7321)
$#<_x>
n0220 x atan[1.7321]/[1.0](msg,x should be 60.0)
$#<_x>
n0230 x asin[1.0](msg,x should be 90.0)
$#<_x>
n0240 x acos[0.707107](msg,x should be 45.0000)
$#<_x>
n0250 x abs[20.0](msg,x should be 20)
$#<_x>
n0260 x abs[-1.23](msg,x should be 1.23)
$#<_x>
n0270 x round[-0.499](msg,x should be 0)
$#<_x>
n0280 x round[-0.5001](msg,x should be -1.0)
$#<_x>
n0290 x round[2.444](msg,x should be 2)
$#<_x>
n0300 x round[9.975](msg,x should be 10)
$#<_x>
n0310 x fix[-0.499](msg,x should be -1.0)
$#<_x>
n0320 x fix[-0.5001](msg,x should be -1.0)
$#<_x>
n0330 x fix[2.444](msg,x should be 2)
$#<_x>
n0340 x fix[9.975](msg,x should be 9)
$#<_x>
n0350 x fup[-0.499](msg,x should be 0.0)
$#<_x>
n0360 x fup[-0.5001](msg,x should be 0.0)
$#<_x>
n0370 x fup[2.444](msg,x should be 3)
$#<_x>
n0380 x fup[9.975](msg,x should be 10)
$#<_x>
n0390 x exp[2.3026](msg,x should be 10)
$#<_x>
n0400 x ln[10.0](msg,x should be 2.3026)
$#<_x>
$#1
n0410 x [2 ** 3.0] #1=2.(msg,x should be 8.0 and param 1 2.0)
$#<_x>
$#1
$#2
n0420 ##1 = 0.375(msg,#1 is 2, so parameter 2 is set to 0.375)
$#<_x>
$#1
$#2
n0430 x #2
$#<_x>
$#3
#3=7.0(msg,x should be 0.375)
$#<_x>
$#3
n0440 #3=5.0 x #3(msg,parameters set in parallel, so x should be 7, not 5)
$#<_x>
$#3
n0450 x #3 #3=1.1(msg,parameters set in parallel, so x should be 5, not 1.1)
$#<_x>
$#3
n0460 x [2 + asin[1/2.1+-0.345] / [atan[fix[4.4] * 2.1 * sqrt[16.8]] /[-18]]**2](msg, x should be aprox 2.0005)
$#<_x>
n0470 x sqrt[3**2 + 4**2](msg,x should be 5.0)
$#<_x>
n0480 m2
61 changes: 61 additions & 0 deletions makefiles/virtual/namedparams.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
$#<_vmajor>
$#<_vminor>
$#<_line>
g0x1y2z3
g92x10y20z30
G18G59.1G91G21
F1000S500M3
$G
$#<_motion_mode>
$#<_plane>
$#<_ccomp>
$#<_metric>
$#<_imperial>
$#<_absolute>
$#<_incremental>
$#<_inverse_time>
$#<_units_per_minute>
$#<_units_per_rev>
$#<_coord_system>
$#<_tool_offset>
$#<_retract_r_plane>
$#<_retract_old_z>
$#<_spindle_rpm_mode>
$#<_spindle_css_mode>
$#<_ijk_absolute_mode>
$#<_lathe_diameter_mode>
$#<_lathe_radius_mode>
$#<_spindle_on>
$#<_spindle_cw>
$#<_mist>
$#<_flood>
$#<_speed_override>
$#<_feed_override>
$#<_adaptive_feed>
$#<_feed_hold>
$#<_feed>
$#<_rpm>
$#<_x>
$#<_y>
$#<_z>
$#<_a>
$#<_b>
$#<_c>
$#<_u>
$#<_v>
$#<_w>
$#<_abs_x>
$#<_abs_y>
$#<_abs_z>
$#<_abs_a>
$#<_abs_b>
$#<_abs_c>
$#<_current_tool>
$#<_current_pocket>
$#<_selected_tool>
$#<_selected_pocket>
$#<_value>
$#<_value_returned>
$#<_task>
$#<_call_level>
$#<_remap_level>
4 changes: 2 additions & 2 deletions makefiles/virtual/uCNC-emulator.dev
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=1
CompilerSettings=000000e0g0000000001000000
UnitCount=93
UnitCount=94

[VersionInfo]
Major=1
Expand Down Expand Up @@ -1031,7 +1031,7 @@ OverrideBuildCmd=0
BuildCmd=

[Unit94]
FileName=..\..\uCNC\src\modules\o_codes\o_codes.c
FileName=..\..\uCNC\src\core\parser_expr.c
CompileCpp=1
Folder=
Compile=1
Expand Down
Loading

0 comments on commit 7a5d1dc

Please sign in to comment.