update to array diagnostics and sensor control

This commit is contained in:
Douglas Gillespie 2023-11-15 09:43:39 +00:00
parent d5f504dcd1
commit 8e60ad2eff
5 changed files with 8 additions and 4 deletions

View File

@ -10,7 +10,7 @@ public class ArraySensorParams implements Serializable, Cloneable, ManagedParame
public static final long serialVersionUID = 1L; public static final long serialVersionUID = 1L;
public int readIntervalMillis = 1000; public volatile int readIntervalMillis = 1000;
private ArrayDisplayParameters arrayDisplayParameters; private ArrayDisplayParameters arrayDisplayParameters;

View File

@ -45,7 +45,8 @@ public class ArraySensorProcess extends PamProcess {
while(true) { while(true) {
readData(); readData();
try { try {
Thread.sleep(analogSensorControl.getAnalogSensorParams().readIntervalMillis); int slptime = analogSensorControl.getAnalogSensorParams().readIntervalMillis;
Thread.sleep(slptime);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -139,7 +139,7 @@ public class BrainBoxDevices implements AnalogDeviceType, PamSettings{
double sensData = BBED549.hexToEngineering(bbRanges[item], sensInts); double sensData = BBED549.hexToEngineering(bbRanges[item], sensInts);
double paramValue = calibration.rawToValue(sensData, calibrationData[item]); double paramValue = calibration.rawToValue(sensData, calibrationData[item]);
analogDevicesManager.notifyData(new ItemAllData(item, sensInts, sensData, paramValue)); analogDevicesManager.notifyData(new ItemAllData(item, sensInts, sensData, paramValue));
// System.out.printf("Read item %d, chan %d, int %d, real %3.5f, param %3.5f\n", iChan, chan, sensInts, sensData, paramValue); // System.out.printf("Read item %d, chan %d, int %d, real %3.5f, param %3.5f\n", 0, chan, sensInts, sensData, paramValue);
sayError(null); sayError(null);
return new AnalogSensorData(sensData, paramValue); return new AnalogSensorData(sensData, paramValue);

View File

@ -221,7 +221,7 @@ public class AnalogDiagnosticsDisplay extends UserDisplayComponentAdapter implem
break; break;
case 3: case 3:
if (lastUpdate[rowIndex] > 0) { if (lastUpdate[rowIndex] > 0) {
return PamCalendar.formatTime(lastUpdate[rowIndex]); return PamCalendar.formatTime(lastUpdate[rowIndex], true);
} }
break; break;
case 4: case 4:

View File

@ -1041,6 +1041,9 @@ public abstract class SQLLogging {
* @return a result set * @return a result set
*/ */
protected ResultSet createViewResultSet(PamConnection con, PamViewParameters pamViewParameters) { protected ResultSet createViewResultSet(PamConnection con, PamViewParameters pamViewParameters) {
if (con == null) {
return null;
}
String viewerClause = getViewerLoadClause(con.getSqlTypes(), pamViewParameters); String viewerClause = getViewerLoadClause(con.getSqlTypes(), pamViewParameters);
return createViewResultSet(con, viewerClause); return createViewResultSet(con, viewerClause);
} }