move profiler option into cam module

pull/258/head
Joe Marshall 2024-02-01 12:13:04 +00:00
rodzic 69e12c8c9b
commit 2f21a3d423
3 zmienionych plików z 7 dodań i 4 usunięć

4
.gitignore vendored
Wyświetl plik

@ -24,4 +24,6 @@ forceSyncWithUpstream
.pydevproject
__pycache__/
temp_cam/
temp_cam/
# profiler output files
*.prof

Wyświetl plik

@ -34,6 +34,8 @@ import time
from pathlib import Path
USE_PROFILER = False
try:
import shapely
except ImportError:

Wyświetl plik

@ -33,6 +33,7 @@ import numpy
from cam import chunk
from cam.chunk import *
from cam import USE_PROFILER
from cam import collision
from cam.collision import *
@ -59,8 +60,6 @@ from cam.image_utils import *
from cam.opencamlib.opencamlib import *
from cam.nc import iso
PROFILING=False # set this true to run cprofile on code
def pointonline(a, b, c, tolerence):
b = b - a # convert to vector by subtracting origin
c = c - a
@ -543,7 +542,7 @@ async def getPath(context, operation): # should do all path calculations.
print(operation.machine_axes)
if operation.machine_axes == '3':
if PROFILING==True: # profiler
if USE_PROFILER == True: # profiler
import cProfile, pstats, io
pr = cProfile.Profile()
pr.enable()