Ejemplo n.º 1
0
def getStatus():
    sensor.update()
    payload = {
        "status": {
            "laser": laser.isActive(),
            "usb": laser.isInit(),
            "airAssist": sensor.airAssist.val,
            "waterTemp": sensor.waterTemp.val,
            "waterFlow": sensor.waterFlow.val
        },
        "alert": {
            "laser": sensor.general.alert,
            "usb": not (laser.isInit()),
            "airAssist": False,
            "waterTemp": sensor.waterTemp.alert,
            "waterFlow": sensor.waterFlow.alert
        },
        "messages": msg.get_list(),
        "pos": {
            "x": laser.x,
            "y": laser.y
        },
        "jobs": laser.jobList,
        "workspace": workspace.toJson(),
        "profile": taskmanager.toJson()
    }
    payload['debug'] = str(logDebug)
    return payload
Ejemplo n.º 2
0
def index():
    list = messages.get_list()
    visits.add_visit()
    counter = visits.get_counter()
    return render_template("index.html",
                           counter=counter,
                           count=len(list),
                           messages=list)
Ejemplo n.º 3
0
def thread(id):
	if is_user_banned():
		return redirect("/banned")
	if not threads.does_thread_exist(id):
		error_statement = "Thread does not exist"
		return default_homepage_with_error(error_statement)
	thread_details = threads.get_thread_details(id)
	list = messages.get_list(id)
	if not threads.does_thread_exist(id):
		error_statement = "Thread not found"
		return default_homepage_with_error(error_statement)
	user_id = users.user_id()
	return render_template("thread.html", id=id, messages=list, thread_details = thread_details)
Ejemplo n.º 4
0
def index():
    list = messages.get_list()
    return render_template("index.html", count=len(list), messages=list)
Ejemplo n.º 5
0
def show_thread():
    list = messages.get_list()
    return render_template("thread.html", count=len(list), messages=list, user_id=session["user_id"], admin = users.is_admin())
Ejemplo n.º 6
0
def chain(id):
    subject = chains.get_subject(id)
    opening_message = chains.get_opening_message(id)
    list = messages.get_list(id)
    return render_template("chain.html", id=id, subject=subject, opening_message=opening_message, count=len(list), messages=list)