correct the Problem with the react route/urls in flask
This commit is contained in:
@@ -19,6 +19,7 @@ import io
|
||||
import fcntl
|
||||
import mmap
|
||||
|
||||
from vrpmdvntlink import trySend
|
||||
from vrpmdvstatusmoncmd import VRPMDV_StatusMonCmd
|
||||
from vrpmdvstatusmonschema import VRPMDV_StatusMonSchema
|
||||
|
||||
@@ -80,7 +81,7 @@ class VRPMDV_Monitoring(VRPMDV_MonReq):
|
||||
self.created_at = created_at
|
||||
#TODO ML: uncomment
|
||||
self.rtservice = None #rts.RT_Service()
|
||||
self.rtMon = None #rts.RTSMonitoringTask()
|
||||
self.rtMon = None
|
||||
self.monTask = None
|
||||
self.run_thread = False
|
||||
self.fdesc = -1
|
||||
@@ -97,8 +98,8 @@ class VRPMDV_Monitoring(VRPMDV_MonReq):
|
||||
schemaCreateCmd = VRPMDV_CreateMonSchema()
|
||||
logging.info("MainThread: try send start monitoring starting %s", schemaCreateCmd.dumps(vrpmdCreateCmd))
|
||||
# TODO ML: uncomment this
|
||||
# res = trySend(schemaCreateCmd.dumps(vrpmdCreateCmd))
|
||||
res = 'Test'
|
||||
res = trySend(schemaCreateCmd.dumps(vrpmdCreateCmd))
|
||||
#res = 'Test'
|
||||
logging.info("MainThread: try send start monitoring done %s", res)
|
||||
|
||||
# start the receiving thread
|
||||
@@ -109,10 +110,29 @@ class VRPMDV_Monitoring(VRPMDV_MonReq):
|
||||
# self.monTask = threading.Thread(target=self.run, args=())
|
||||
# self.monTask.start()
|
||||
# logging.info("MainThread: strated Mon Thread %s started", self.id)
|
||||
self.status = 'started'
|
||||
logging.info("startmonitoring: create RTSMonitoringTask")
|
||||
strid = str(self.id)
|
||||
logging.info("rts.RTSMonitoringTask: self.id:%s", strid)
|
||||
self.rtMon = rts.RTSMonitoringTask(str(self.id), str(self.name), self.samplerate, self.sampleperiod, self.downtime, '/home/root/monfiles/')
|
||||
# self.rtMon.id = self.id
|
||||
# self.rtMon.name = self.name
|
||||
# self.rtMon.samplerate = self.samplerate
|
||||
# self.rtMon.samplePeriod = self.sampleperiod
|
||||
# self.rtMon.downtime = self.downtime
|
||||
# self.rtMon.path = '/home/root/monfiles'
|
||||
#logging.info("startmonitoring: created RTSMonitoringTask: id:%s name:%s samplerate:%d sampleperiod:%d downtime:%d path:%s", self.rtMon.id, self.rtMon.name, self.rtMon.samplerate, self.rtMon.samplePeriod, self.rtMon.downtime, self.rtMon.path)
|
||||
|
||||
##new ML 09.07.2024
|
||||
if (self.rtMon.start()) :
|
||||
logging.info("startmonitoring - self.rtMon.start(): Monitoring started")
|
||||
|
||||
self.status = 'started'
|
||||
else :
|
||||
self.status = 'stopped'
|
||||
return self.status
|
||||
except :
|
||||
self.status = "stopped"
|
||||
self.rtMon = None
|
||||
return self.status
|
||||
|
||||
def stopMonitoring(self) :
|
||||
@@ -120,27 +140,32 @@ class VRPMDV_Monitoring(VRPMDV_MonReq):
|
||||
logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S")#
|
||||
logging.info("MainThread: stopping Mon Thread %s ", self.id)
|
||||
#send delete cmd to M4
|
||||
logging.info("MainThread: stop monitoring")
|
||||
#logging.info("MainThread: stop monitoring")
|
||||
|
||||
|
||||
if (self.monTask != None) :
|
||||
# if (self.monTask != None) :
|
||||
# set the value Runthread to fals that the thread terminate
|
||||
self.run_thread = False
|
||||
self.monTask.join(None)
|
||||
self.monTask = None
|
||||
logging.info("MonThread %s: closing fdesc=%s", str(self.id), str(self.fdesc))
|
||||
self.rtMon.closeChannel(self.fdesc)
|
||||
logging.info("MonThread %s: closed fdesc=%s", str(self.id), str(self.fdesc))
|
||||
# self.run_thread = False
|
||||
# self.monTask.join(None)
|
||||
|
||||
##new ML 09.07.2024
|
||||
if (self.rtMon != None) :
|
||||
self.rtMon.stop()
|
||||
# self.monTask = None
|
||||
# logging.info("MonThread %s: closing fdesc=%s", str(self.id), str(self.fdesc))
|
||||
# # self.rtMon.closeChannel(self.fdesc)
|
||||
# logging.info("MonThread %s: closed fdesc=%s", str(self.id), str(self.fdesc))
|
||||
|
||||
logging.info("MainThread: stopped Mon Thread %s ", self.id)
|
||||
|
||||
vrpmdDeleteCmd = VRPMDV_DeleteMonCmd(self.no)
|
||||
schemaDeleteCmd = VRPMDV_DeleteMonSchema()
|
||||
# TODO ML: uncomment this
|
||||
# res = trySend(schemaDeleteCmd.dumps(vrpmdDeleteCmd))
|
||||
res = 'Stop'
|
||||
res = trySend(schemaDeleteCmd.dumps(vrpmdDeleteCmd))
|
||||
#res = 'Stopped'
|
||||
logging.info("MainThread: try send stop monitoring done %s", res)
|
||||
|
||||
self.rtMon = None
|
||||
# if (isstopped) :
|
||||
self.status = 'stopped'
|
||||
return self.status
|
||||
|
||||
Reference in New Issue
Block a user