Skip to content

Commit 5d77751

Browse files
authored
Update and rename Multiples_SR.py to VisionCodeRenamer.py
1 parent 0faef87 commit 5d77751

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed
Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
# FROM https://raw.githubusercontent.com/bruderstein/PythonScript/master/scripts/Samples/
23

34
import re
45

@@ -54,19 +55,49 @@
5455
# - Modify the NAME of the file, containing the SEARCH and REPLACEMENT regexes
5556
# - Indicate an ABSOLUTE or RELATIVE path, before the filename
5657

57-
with open(r'SR_list.txt') as f: sr_list = f.readlines()
58+
#with open(r'SR_list.txt') as f: sr_list = f.readlines()
5859

5960
# You may, as well, insert the SEARCH and REPLACE regexes, directly, in THIS script :
6061

61-
#sr_list = [
62-
# '!(?-s)(^.*?);.+!\\1!',
63-
# '@(?-i)notepad\\+\\+@NOTEPAD++@',
64-
# '&(Smith)|TEST|(James)&(?1Name)(?2First name)&',
65-
# '%\\\\% 123 %',
66-
# # or the syntax '%\x5c\x5c% 123 %',
67-
# '+(?i)Fix ++',
68-
# '*###*\\\\\\\\\\\\*',
69-
# ]
62+
sr_list = [
63+
r'!G90!G90 \(Absolute Programming\)!',
64+
r'!G40!G40 \(Kerf Off\)!',
65+
r'!G41!G41 \(Kerf Left\)!',
66+
r'!G42!G42 \(Kerf Right\)!',
67+
r'!G91!G91 \(Incremental Programming\)!',
68+
r'!G70!G70 \(Inch Mode\)!',
69+
r'!G84!G84 \(Deselect all Stations\)!',
70+
r'!G85\s?I(\d)(\d)\s?J(-?\d*.\d*)(\r|\n)!G85 I($1)($2) J($3) \(Fix St ($1), Move St ($2) Spacing=($3)\)!',
71+
r'!G83\s?I(\d)\s?(\r|\n)!G83 I($1)\(Select Station ($1)\)($2)!',
72+
r'!G83\s?I(\d)\s?J(\d)!G83 I($1) ($2)\(Select Station ($1) Clamp Mode=($2)\)!',
73+
r'!AL\s?(-?\d*.\d*)!AL ($1) \(Tilt to ($1) Degrees\)!',
74+
r'!(M178\s?D1)!($1) \(Send Y1 to Home\)!',
75+
r'!(M178\s?D2)!($1) \(Send Y2 to Home\)!',
76+
r'!G71!G71 \(Metric Mode\)!',
77+
r'!M65!M65 \(Plasma Start\)!',
78+
r'!M02!M02 \(Program Stop\)!',
79+
r'!M66!M66 \(Plasma Stop\)!',
80+
r'!M177!M177 \(Foot Up\)!',
81+
r'!M174!M174 \(Flying Stop\)!',
82+
r'!M176!M176 \(Foot Down\)!',
83+
r'!M35!M35 \(Rotation look ahead 1 block\)!',
84+
r'!M34!M34 \(Rotation skip block\)!',
85+
r'!M58!M58 \(AVHC Enable\)!',
86+
r'!M57!M57 \(AVHC Disable\)!',
87+
r'!M145 D0!M145 D0 \(Straight/I ORG Selection\)!',
88+
r'!M145 D1!M145 D1 \(Y ORG Selection\)!',
89+
r'!M145 D2!M145 D2 \(K ORG Selection\)!',
90+
r'!G160 P1!G160 P1 \(Plasma Process\)!',
91+
r'!G160 P2!G160 P2 \(Oxy-Fuel Process\)!',
92+
r'!M62!M62 \(Rotation Stop\Freeze\)!',
93+
r'!M63!M63 \(Rotation On\)!',
94+
r'!M64!M64 \(Rotation Off\)!',
95+
r'!D3(\r|\n)!D3 \(Comment Block Start\)($1)!',
96+
r'!D4(\r|\n)!D4 \(Comment Block End\)($1)!',
97+
r'!(M129 D(.\d)*)!($1) \(Total Material Thickness\)!',
98+
r'!(M120 D(.\d)*)!($1) \(Feature Height\)!',
99+
r'!(T\d)!($1) \(Tool Offset Select\)!'
100+
]
70101

71102
# The use of RAW strings r'.......' is also possible, in order to SIMPLIFY some regexes
72103

0 commit comments

Comments
 (0)