From: Bdale Garbee Date: Wed, 7 May 2025 22:46:02 +0000 (-0600) Subject: now displaying UTC date and time too X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=97c13ca9dd6c6cd4f49b6a3b5f9240699df20c8c;p=fw%2Fquantimotor now displaying UTC date and time too --- diff --git a/application/app.py b/application/app.py index 5aaa322..f870275 100755 --- a/application/app.py +++ b/application/app.py @@ -12,6 +12,7 @@ from gpiod.line import Direction, Value import iio import signal import sys +import time n = 0 pressure = 0 @@ -90,6 +91,7 @@ class App: @cherrypy.expose @cherrypy.tools.json_out() + def getData(self): global n global pressure @@ -97,6 +99,9 @@ class App: global pyro global battery + t = time.localtime() + current_time = time.strftime("%Y:%m:%d %H:%M:%S", t) + for id in VOLTAGES: chan = ctrl.find_channel(id) rawstring = chan.attrs['raw'].value @@ -114,6 +119,7 @@ class App: armed = sense_armed() return { + 'time' : current_time, 'pressure' : pressure, 'thrust' : thrust, 'pyro' : pyro, diff --git a/application/index.html b/application/index.html index 2fdf1b6..aaeca09 100644 --- a/application/index.html +++ b/application/index.html @@ -12,6 +12,7 @@ var request = $.ajax({'url': '/getData'}); request.done(function(response) { + $('#time').text(response.time); $('#pressure').text(response.pressure); $('#thrust').text(response.thrust); $('#pyro').text(response.pyro); @@ -29,6 +30,8 @@

QuantiMotor

+

Time

+

Pressure

Thrust