Changed Zero Adc Integral Reset

Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
This commit is contained in:
2025-04-02 16:29:19 +00:00
parent b534a26ada
commit 9edd2218ee
2 changed files with 6 additions and 3 deletions

View File

@@ -145,6 +145,7 @@ p2.addLegend()
start = args.irange[0] - 1 start = args.irange[0] - 1
stop = args.irange[1] stop = args.irange[1]
# print("WO: ", end='') # print("WO: ", end='')
dataIntAll = []
for i in range(start, stop): for i in range(start, stop):
# mdsNode = tree.getNode(f"ATCAIOP1.ADC8INT") # mdsNode = tree.getNode(f"ATCAIOP1.ADC8INT")
if args.decimated: if args.decimated:
@@ -154,8 +155,8 @@ for i in range(start, stop):
node = ADC_INTEG.format(i) node = ADC_INTEG.format(i)
# mdsNode = tree.getNode(node) # mdsNode = tree.getNode(node)
try: try:
dataAdc = client.getData(node) dataAdcInt = client.getData(node)
# dataAdcInt = getMdsData(tree, node) dataIntAll.append(dataAdcInt[:, 0])
timeData = client.getTime(node) timeData = client.getTime(node)
total_samples = len(dataAdcInt[:, 0]) total_samples = len(dataAdcInt[:, 0])
y = dataAdcInt[:args.maxpoints, 0] / 2.0e6 # LSB * sec y = dataAdcInt[:args.maxpoints, 0] / 2.0e6 # LSB * sec
@@ -165,7 +166,6 @@ for i in range(start, stop):
x *= ADC_DECIM_RATE x *= ADC_DECIM_RATE
if (args.zero): if (args.zero):
y = y - dataAdcInt[0, 0] / 2.0e6 # LSB * sec y = y - dataAdcInt[0, 0] / 2.0e6 # LSB * sec
# wo = (dataAdcInt[-1, 0] - dataAdcInt[0, 0]) /total_samples
# print(f"{wo:0.4f} ", end='') # print(f"{wo:0.4f} ", end='')
p2.plot(x, y, pen=pg.mkPen(i, width=2), name=f"Ch {i+1}") p2.plot(x, y, pen=pg.mkPen(i, width=2), name=f"Ch {i+1}")
except Exception: except Exception:
@@ -176,6 +176,7 @@ print(" ")
p2.setLabel('bottom', "Time", units='s') p2.setLabel('bottom', "Time", units='s')
p2.setLabel('left', "Integ", units='lsb.s') p2.setLabel('left', "Integ", units='lsb.s')
p2.setDownsampling(ds=200, auto=False) p2.setDownsampling(ds=200, auto=False)
p2.setYRange(-4, 4)
# updatePlot() # updatePlot()

View File

@@ -339,11 +339,13 @@ namespace MARTe {
REPORT_ERROR(ErrorManagement::ParametersError, "Fail Write wo0:%6.3f", woValues[0]); REPORT_ERROR(ErrorManagement::ParametersError, "Fail Write wo0:%6.3f", woValues[0]);
ok = false; ok = false;
} }
/* Reset is done by fiber
rv = ioctl(devFileDescriptor, ATCA_PCIE_IOPT_RST_INTEG); rv = ioctl(devFileDescriptor, ATCA_PCIE_IOPT_RST_INTEG);
if (rv ) { if (rv ) {
REPORT_ERROR(ErrorManagement::ParametersError, "Fail reset Integrators"); REPORT_ERROR(ErrorManagement::ParametersError, "Fail reset Integrators");
ok = false; ok = false;
} }
*/
return ok; return ok;
} }