Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
fc43d553
Commit
fc43d553
authored
Jun 12, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse bitarray for boolean properties
parent
1c41072a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
17 deletions
+19
-17
gcoder_line.pyx
printrun/gcoder_line.pyx
+19
-17
No files found.
printrun/gcoder_line.pyx
View file @
fc43d553
...
...
@@ -59,10 +59,12 @@ cdef inline uint32_t has_var(uint32_t status, uint32_t pos):
cdef inline uint32_t set_has_var(uint32_t status, uint32_t pos):
return status | pos
cdef inline uint32_t unset_has_var(uint32_t status, uint32_t pos):
return status & ~pos
cdef class GLine(object):
cdef float _x, _y, _z, _e, _f, _i, _j, _s, _p
cdef bool _is_move, _relative, _relative_e, _extruding
cdef float _current_x, _current_y, _current_z
cdef char _current_tool
cdef uint32_t _gcview_end_vertex
...
...
@@ -148,32 +150,32 @@ cdef class GLine(object):
self._status = set_has_var(self._status, pos_p)
property is_move:
def __get__(self):
if has_var(self._status, pos_is_move): return
self._is_mov
e
else: return
Non
e
if has_var(self._status, pos_is_move): return
Tru
e
else: return
Fals
e
def __set__(self, value):
self._is_move = value
self._status =
set_has_var(self._status, pos_is_move)
if value: self._status = set_has_var(self._status, pos_is_move)
else: self._status = un
set_has_var(self._status, pos_is_move)
property relative:
def __get__(self):
if has_var(self._status, pos_relative): return
self._relativ
e
else: return
Non
e
if has_var(self._status, pos_relative): return
Tru
e
else: return
Fals
e
def __set__(self, value):
self._relative = value
self._status =
set_has_var(self._status, pos_relative)
if value: self._status = set_has_var(self._status, pos_relative)
else: self._status = un
set_has_var(self._status, pos_relative)
property relative_e:
def __get__(self):
if has_var(self._status, pos_relative_e): return
self._relative_
e
else: return
Non
e
if has_var(self._status, pos_relative_e): return
Tru
e
else: return
Fals
e
def __set__(self, value):
self._relative_e = value
self._status =
set_has_var(self._status, pos_relative_e)
if value: self._status = set_has_var(self._status, pos_relative_e)
else: self._status = un
set_has_var(self._status, pos_relative_e)
property extruding:
def __get__(self):
if has_var(self._status, pos_extruding): return
self._extruding
else: return
Non
e
if has_var(self._status, pos_extruding): return
True
else: return
Fals
e
def __set__(self, value):
self._extruding = value
self._status =
set_has_var(self._status, pos_extruding)
if value: self._status = set_has_var(self._status, pos_extruding)
else: self._status = un
set_has_var(self._status, pos_extruding)
property current_x:
def __get__(self):
if has_var(self._status, pos_current_x): return self._current_x
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment