def __init__(self): self.logger = log.create_logger('camera') self.stop_flag = False paths.init_path_to_libs() import numpy as np import cv2 as cv2 self.np = np self.cv2 = cv2 signal.signal(signal.SIGINT, self.intercept_signal) signal.signal(signal.SIGTERM, self.intercept_signal) if len(sys.argv) > 2: self.user_token = sys.argv[1] mac = sys.argv[2] else: ul = user_login.UserLogin(self) ul.wait() self.user_token = ul.user_token mac = None self.image_extension = config.get_settings()["camera"]["img_ext"] self.image_quality = config.get_settings()["camera"]["img_qual"] self.hardware_resize = config.get_settings( )["camera"]["hardware_resize"] self.min_loop_time = config.get_settings()["camera"]["min_loop_time"] self.search_cameras() self.http_client = http_client.HTTPClient(self, keep_connection_flag=True) if mac: self.http_client.mac = mac #we need to use MAC from client to ensure that it's not changed on camera restart self.main_loop()
def __init__(self): self.logger = log.create_logger('camera') self.stop_flag = False paths.init_path_to_libs() import numpy as np import cv2 as cv2 self.np = np self.cv2 = cv2 signal.signal(signal.SIGINT, self.intercept_signal) signal.signal(signal.SIGTERM, self.intercept_signal) if len(sys.argv) > 2: self.user_token = sys.argv[1] mac = sys.argv[2] else: ul = user_login.UserLogin(self) ul.wait() self.user_token = ul.user_token mac = None self.image_extension = config.get_settings()["camera"]["img_ext"] self.image_quality = config.get_settings()["camera"]["img_qual"] self.hardware_resize = config.get_settings()["camera"]["hardware_resize"] self.min_loop_time = config.get_settings()["camera"]["min_loop_time"] self.search_cameras() self.http_client = http_client.HTTPClient(self, keep_connection_flag=True) if mac: self.http_client.mac = mac #we need to use MAC from client to ensure that it's not changed on camera restart self.main_loop()
def __init__(self): self.logger = log.create_logger("app.camera") self.stop_flag = False paths.init_path_to_libs() import numpy as np import cv2 as cv2 self.np = np self.cv2 = cv2 signal.signal(signal.SIGINT, self.intercept_signal) signal.signal(signal.SIGTERM, self.intercept_signal) ul = user_login.UserLogin(self) ul.wait() self.user_token = ul.user_token self.image_extension = config.get_settings()["camera"]["img_ext"] self.image_quality = config.get_settings()["camera"]["img_qual"] self.hardware_resize = config.get_settings()["camera"]["hardware_resize"] self.min_loop_time = config.get_settings()["camera"]["min_loop_time"] self.search_cameras() self.http_client = http_client.HTTPClient(keep_connection_flag=True) self.main_loop()
def __init__(self): self.logger = log.create_logger("app.camera") self.stop_flag = False paths.init_path_to_libs() import numpy as np import cv2 as cv2 self.np = np self.cv2 = cv2 signal.signal(signal.SIGINT, self.intercept_signal) signal.signal(signal.SIGTERM, self.intercept_signal) ul = user_login.UserLogin(self) ul.wait_for_login() self.user_token = ul.user_token self.image_extension = config.get_settings()["camera"]["img_ext"] self.image_quality = config.get_settings()["camera"]["img_qual"] self.hardware_resize = config.get_settings( )["camera"]["hardware_resize"] self.min_loop_time = config.get_settings()["camera"]["min_loop_time"] self.search_cameras() self.http_client = http_client.HTTPClient(keep_connection_flag=True) self.main_loop()
#but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU Affero General Public License for more details. #You should have received a copy of the GNU Affero General Public License #along with 3DPrinterOS client. If not, see <http://www.gnu.org/licenses/>. # Author: Vladimir Avdeev <*****@*****.**> import time import signal import platform import log import paths paths.init_path_to_libs() import usb_detect import http_client import camera_controller import cloud_sync_controller import user_login import updater import version import printer_interface import config import rights import makerware_utils reboot_flag = True # should be True for first boot, even if it isn't re boot class App(object):
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU Affero General Public License for more details. #You should have received a copy of the GNU Affero General Public License #along with 3DPrinterOS client. If not, see <http://www.gnu.org/licenses/>. # Author: Vladimir Avdeev <*****@*****.**> import time import signal import platform import log import paths paths.init_path_to_libs() import usb_detect import http_client import camera_controller import cloud_sync_controller import user_login import updater import version import printer_interface import config import rights import makerware_utils class App(object):