Repository for import to local machine

Dependencies:   DMBasicGUI DMSupport

Committer:
jmitc91516
Date:
Mon Jul 24 15:57:36 2017 +0000
Revision:
5:aceac1035d71
Parent:
1:a5258871b33d
Child:
6:dba3fbdfd5da
Daily backup 24 July 2017

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jmitc91516 0:47c880c1463d 1 #ifndef GETGCSTATUSLOOP_H
jmitc91516 0:47c880c1463d 2 #define GETGCSTATUSLOOP_H
jmitc91516 0:47c880c1463d 3
jmitc91516 0:47c880c1463d 4 #include "USBHostGC.h"
jmitc91516 0:47c880c1463d 5 #include "GuiLib.h"
jmitc91516 0:47c880c1463d 6
jmitc91516 0:47c880c1463d 7 #include "GCComponentStatusEnums.h"
jmitc91516 0:47c880c1463d 8 #include "GCComponentStatusColorArea.h"
jmitc91516 1:a5258871b33d 9 #include "GCComponentTypeEnums.h"
jmitc91516 1:a5258871b33d 10 #include "GCIgnitionStateEnum.h"
jmitc91516 1:a5258871b33d 11
jmitc91516 1:a5258871b33d 12 #include "GCStateAndFaultCodes.h"
jmitc91516 1:a5258871b33d 13 #include "TouchPanelPageSelector.h"
jmitc91516 1:a5258871b33d 14 #include "EasyGUITouchAreaIndices.h"
jmitc91516 1:a5258871b33d 15 #include "SimplifiedTouchListener.h"
jmitc91516 1:a5258871b33d 16 #include "EthernetHandler.h"
jmitc91516 1:a5258871b33d 17 #include "ProgressBar.h"
jmitc91516 1:a5258871b33d 18 #include "QSPIBitmap.h"
jmitc91516 5:aceac1035d71 19 #include "ColumnMethodRampData.h"
jmitc91516 1:a5258871b33d 20
jmitc91516 1:a5258871b33d 21 #include "EthernetInterface.h"
jmitc91516 1:a5258871b33d 22
jmitc91516 1:a5258871b33d 23 #include "GuiLibGraph.h"
jmitc91516 0:47c880c1463d 24
jmitc91516 0:47c880c1463d 25
jmitc91516 1:a5258871b33d 26 /*
jmitc91516 1:a5258871b33d 27 Together with functions in main.cpp - especially TouchCallback - this class does most of the work
jmitc91516 1:a5258871b33d 28 of interfacing with and controlling the GC. After the appropriate setting up and initialisation,
jmitc91516 1:a5258871b33d 29 the main() function calls this class's member function MainLoopWithEthernet - which never returns.
jmitc91516 1:a5258871b33d 30
jmitc91516 1:a5258871b33d 31 Note that GetGCStatusLoop is a singleton - we do not need or want there to be more than one instance of it
jmitc91516 1:a5258871b33d 32 (there is only one GC, and only one LPC4088). On creation, the instance is passed pointers to the USBHostGC instance
jmitc91516 1:a5258871b33d 33 and the USB device corresponding to the GC.
jmitc91516 1:a5258871b33d 34 */
jmitc91516 0:47c880c1463d 35 class GetGCStatusLoop {
jmitc91516 0:47c880c1463d 36 public:
jmitc91516 0:47c880c1463d 37 /**
jmitc91516 0:47c880c1463d 38 * Static method to create (if necessary) and retrieve the single GetGCStatusLoop instance
jmitc91516 0:47c880c1463d 39 */
jmitc91516 0:47c880c1463d 40 static GetGCStatusLoop * GetInstance(USBDeviceConnected* newUsbDevice, USBHostGC* newUsbHostGC);
jmitc91516 0:47c880c1463d 41
jmitc91516 1:a5258871b33d 42 /*
jmitc91516 1:a5258871b33d 43 * Static method to return the current instance, if it exists. If not, this function
jmitc91516 1:a5258871b33d 44 * will return NULL - it will *not* create a new instance
jmitc91516 1:a5258871b33d 45 */
jmitc91516 1:a5258871b33d 46 static GetGCStatusLoop * GetInstance(void);
jmitc91516 1:a5258871b33d 47
jmitc91516 0:47c880c1463d 48 GuiConst_INT16U GetCurrentPage(void);
jmitc91516 0:47c880c1463d 49 void SetCurrentPage(GuiConst_INT16U newCurrentPage);
jmitc91516 0:47c880c1463d 50
jmitc91516 0:47c880c1463d 51 void SetHomePageGCComponentStatusColorAreas(HomePageGCComponentStatusColorAreas* newColorAreas);
jmitc91516 0:47c880c1463d 52
jmitc91516 0:47c880c1463d 53 void SetSingleGCComponentPageStatusColorAreas(SingleGCComponentPageStatusColorAreas* newColorAreas);
jmitc91516 0:47c880c1463d 54
jmitc91516 1:a5258871b33d 55 void UpdateHomePageGCComponentStatusColorAreas(void);
jmitc91516 1:a5258871b33d 56
jmitc91516 1:a5258871b33d 57 void UpdateSingleGCComponentPageStatusColorArea(GCComponent component);
jmitc91516 1:a5258871b33d 58
jmitc91516 1:a5258871b33d 59 void UpdateAllGCComponentStatusColorAreas(void);
jmitc91516 1:a5258871b33d 60
jmitc91516 0:47c880c1463d 61 void SetupAllEasyGUIVariables(void);
jmitc91516 0:47c880c1463d 62
jmitc91516 0:47c880c1463d 63 void ExitedGCStandbyMode(void);
jmitc91516 1:a5258871b33d 64
jmitc91516 1:a5258871b33d 65 void UpdateGCMethodRunningProfiles(void);
jmitc91516 0:47c880c1463d 66
jmitc91516 1:a5258871b33d 67 // Need to call this from DisplayEasyGuiStructure function in main.cpp
jmitc91516 1:a5258871b33d 68 void DisplayInjectorTempProfilePageGraph(void);
jmitc91516 1:a5258871b33d 69
jmitc91516 1:a5258871b33d 70 // Need to call this from DisplayEasyGuiStructure function in main.cpp
jmitc91516 1:a5258871b33d 71 void DisplayGasFlowProfilePageGraph(void);
jmitc91516 1:a5258871b33d 72
jmitc91516 1:a5258871b33d 73 // Need to call this from DisplayEasyGuiStructure function in main.cpp
jmitc91516 1:a5258871b33d 74 void DisplayColumnTempProfilePageGraph(ColumnType columnType);
jmitc91516 1:a5258871b33d 75
jmitc91516 1:a5258871b33d 76 void ForceUpdateOfGasCalibrationPage(void);
jmitc91516 1:a5258871b33d 77
jmitc91516 1:a5258871b33d 78 void ForceUpdateOfColumnDHAutoCalibrationPage(void);
jmitc91516 1:a5258871b33d 79 void ForceUpdateOfColumnDHManualCalibrationPage(void);
jmitc91516 1:a5258871b33d 80 void ForceUpdateOfColumnDHSensorCalibrationPage(void);
jmitc91516 1:a5258871b33d 81 void ForceUpdateOfColumnDHPSUDACPage(void);
jmitc91516 1:a5258871b33d 82
jmitc91516 1:a5258871b33d 83 void ForceUpdateOfGasBackPressureDACPage(void);
jmitc91516 1:a5258871b33d 84 void ForceUpdateOfGasChannelDACAndADCPage(void);
jmitc91516 1:a5258871b33d 85
jmitc91516 1:a5258871b33d 86 void SetGCIsRunning(void);
jmitc91516 1:a5258871b33d 87 void ClearGCIsRunning(void);
jmitc91516 1:a5258871b33d 88 bool GetGCIsRunningFlag(void);
jmitc91516 1:a5258871b33d 89
jmitc91516 1:a5258871b33d 90 bool UpdateMethodRunTimeEasyGUIVariables(bool runHasCompleted);
jmitc91516 1:a5258871b33d 91 void UpdateAndDisplayRunningPage1ProgressBar(bool runHasCompleted);
jmitc91516 1:a5258871b33d 92 void SetRunningPage1ProgressBarToZero(void);
jmitc91516 1:a5258871b33d 93
jmitc91516 1:a5258871b33d 94 void UpdateColumnStatusEasyGUIVariable(void);
jmitc91516 1:a5258871b33d 95 void UpdateInjectorStatusEasyGUIVariable(void);
jmitc91516 1:a5258871b33d 96
jmitc91516 1:a5258871b33d 97 static void TimerCallback(void const * argument);
jmitc91516 1:a5258871b33d 98
jmitc91516 1:a5258871b33d 99 void ForceRestart(void);
jmitc91516 1:a5258871b33d 100
jmitc91516 1:a5258871b33d 101 void RedisplayColumnCalibrationPage(void);
jmitc91516 1:a5258871b33d 102
jmitc91516 1:a5258871b33d 103 void RedisplayColumnPage(void);
jmitc91516 1:a5258871b33d 104
jmitc91516 1:a5258871b33d 105 static void DisplayColumnLockAndReleaseButtons(void);
jmitc91516 1:a5258871b33d 106
jmitc91516 1:a5258871b33d 107 void SetQSPIBitmaps(QSPIBitmaps* ptrToQSPIBitmaps);
jmitc91516 1:a5258871b33d 108
jmitc91516 1:a5258871b33d 109 void SetupTemperatureWhileRunningEasyGUIVariables(void);
jmitc91516 1:a5258871b33d 110
jmitc91516 1:a5258871b33d 111 void SetupGCNotReadyStateEasyGUIVariable(void);
jmitc91516 1:a5258871b33d 112
jmitc91516 1:a5258871b33d 113 /* ** This never returns ** */
jmitc91516 1:a5258871b33d 114 void MainLoopWithEthernet(DMBoard* board);
jmitc91516 0:47c880c1463d 115
jmitc91516 0:47c880c1463d 116 private:
jmitc91516 0:47c880c1463d 117 static GetGCStatusLoop * theGetGCStatusLoop;
jmitc91516 0:47c880c1463d 118
jmitc91516 0:47c880c1463d 119 // singleton class -> constructor is private
jmitc91516 0:47c880c1463d 120 GetGCStatusLoop(USBDeviceConnected* newUsbDevice, USBHostGC* newUsbHostGC);
jmitc91516 0:47c880c1463d 121 ~GetGCStatusLoop();
jmitc91516 0:47c880c1463d 122
jmitc91516 0:47c880c1463d 123 USBDeviceConnected* usbDevice;
jmitc91516 0:47c880c1463d 124 USBHostGC* usbHostGC;
jmitc91516 0:47c880c1463d 125
jmitc91516 0:47c880c1463d 126 GuiConst_INT16U currentPage; // This is the easyGUI 'Structure' value (see GuiStruct.h)
jmitc91516 0:47c880c1463d 127
jmitc91516 1:a5258871b33d 128 ProgressBar* runningPage1ProgressBar;
jmitc91516 1:a5258871b33d 129
jmitc91516 1:a5258871b33d 130 GuiLibGraph* runningColumnPageGraph; // Graph index 0
jmitc91516 1:a5258871b33d 131 GuiLibGraphDataSet* runningColumnPageGraphCompleteProfileDataSet; // Line representing the complete temperature profile from start to finish
jmitc91516 1:a5258871b33d 132 // We do not display the above data set in the graph - we use it to generate the data sets below.
jmitc91516 1:a5258871b33d 133 // The data set numbers correspond with those set for the graph in easyGUI (as do the colours).
jmitc91516 1:a5258871b33d 134 GuiLibGraphDataSet* runningColumnPageGraphDataSet0; // Line representing the temperature profile from 'now' to finish (green)
jmitc91516 1:a5258871b33d 135 GuiLibGraphDataSet* runningColumnPageGraphDataSet1; // Bars representing the temperature profile from 'now' to finish (green)
jmitc91516 1:a5258871b33d 136 GuiLibGraphDataSet* runningColumnPageGraphDataSet2; // Line representing the temperature profile from start to 'now' (red)
jmitc91516 1:a5258871b33d 137 GuiLibGraphDataSet* runningColumnPageGraphDataSet3; // Bars representing the temperature profile from start to 'now' (red)
jmitc91516 1:a5258871b33d 138 GuiLibGraphDataSet* runningColumnPageGraphDataSet4; // Dot representing the temperature 'now' (red)
jmitc91516 1:a5258871b33d 139 float previousColumnMethodRunTime;
jmitc91516 1:a5258871b33d 140 bool columnMethodFinished;
jmitc91516 1:a5258871b33d 141
jmitc91516 1:a5258871b33d 142 GuiLibGraph* runningGasPageGraph; // Graph index 1
jmitc91516 1:a5258871b33d 143 GuiLibGraphDataSet* runningGasPageGraphCompleteProfileDataSet; // Line representing the complete flow profile from start to finish
jmitc91516 1:a5258871b33d 144 // We do not display the above data set in the graph - we use it to generate the data sets below.
jmitc91516 1:a5258871b33d 145 // The data set numbers correspond with those set for the graph in easyGUI.
jmitc91516 1:a5258871b33d 146 GuiLibGraphDataSet* runningGasPageGraphDataSet0; // Line representing the flow profile from 'now' to finish (green)
jmitc91516 1:a5258871b33d 147 GuiLibGraphDataSet* runningGasPageGraphDataSet1; // Bars representing the flow profile from 'now' to finish (green)
jmitc91516 1:a5258871b33d 148 GuiLibGraphDataSet* runningGasPageGraphDataSet2; // Line representing the flow profile from start to 'now' (blue)
jmitc91516 1:a5258871b33d 149 GuiLibGraphDataSet* runningGasPageGraphDataSet3; // Bars representing the flow profile from start to 'now' (blue)
jmitc91516 1:a5258871b33d 150 GuiLibGraphDataSet* runningGasPageGraphDataSet4; // Dot representing the temperature 'now' (blue)
jmitc91516 1:a5258871b33d 151 float previousGasMethodRunTime;
jmitc91516 1:a5258871b33d 152 bool gasMethodFinished;
jmitc91516 1:a5258871b33d 153
jmitc91516 1:a5258871b33d 154 GuiLibGraph* injectorTempProfilePageGraph; // Graph index 2
jmitc91516 1:a5258871b33d 155 GuiLibGraphDataSet* injectorTempProfilePageGraphCompleteProfileDataSet; // Line representing the complete temperature profile from start to finish
jmitc91516 1:a5258871b33d 156 // We do not display the above data set in the graph - we use it to generate the data sets below.
jmitc91516 1:a5258871b33d 157 // The data set numbers correspond with those set for the graph in easyGUI (as do the colours).
jmitc91516 1:a5258871b33d 158 GuiLibGraphDataSet* injectorTempProfilePageGraphDataSet0; // Line representing the temperature profile from 'now' to finish (green)
jmitc91516 1:a5258871b33d 159 GuiLibGraphDataSet* injectorTempProfilePageGraphDataSet1; // Bars representing the temperature profile from 'now' to finish (green)
jmitc91516 1:a5258871b33d 160 GuiLibGraphDataSet* injectorTempProfilePageGraphDataSet2; // Line representing the temperature profile from start to 'now' (red)
jmitc91516 1:a5258871b33d 161 GuiLibGraphDataSet* injectorTempProfilePageGraphDataSet3; // Bars representing the temperature profile from start to 'now' (red)
jmitc91516 1:a5258871b33d 162 GuiLibGraphDataSet* injectorTempProfilePageGraphDataSet4; // Dot representing the temperature 'now' (red)
jmitc91516 1:a5258871b33d 163
jmitc91516 1:a5258871b33d 164 GuiLibGraph* gasFlowProfilePageGraph; // Graph index 3
jmitc91516 1:a5258871b33d 165 GuiLibGraphDataSet* gasFlowProfilePageGraphCompleteProfileDataSet; // Line representing the complete flow profile from start to finish
jmitc91516 1:a5258871b33d 166 // We do not display the above data set in the graph - we use it to generate the data sets below.
jmitc91516 1:a5258871b33d 167 // The data set numbers correspond with those set for the graph in easyGUI.
jmitc91516 1:a5258871b33d 168 GuiLibGraphDataSet* gasFlowProfilePageGraphDataSet0; // Line representing the flow profile from 'now' to finish (green)
jmitc91516 1:a5258871b33d 169 GuiLibGraphDataSet* gasFlowProfilePageGraphDataSet1; // Bars representing the flow profile from 'now' to finish (green)
jmitc91516 1:a5258871b33d 170 GuiLibGraphDataSet* gasFlowProfilePageGraphDataSet2; // Line representing the flow profile from start to 'now' (blue)
jmitc91516 1:a5258871b33d 171 GuiLibGraphDataSet* gasFlowProfilePageGraphDataSet3; // Bars representing the flow profile from start to 'now' (blue)
jmitc91516 1:a5258871b33d 172 GuiLibGraphDataSet* gasFlowProfilePageGraphDataSet4; // Dot representing the temperature 'now' (blue)
jmitc91516 1:a5258871b33d 173
jmitc91516 1:a5258871b33d 174 GuiLibGraph* columnTempProfilePageGraph; // Graph index 4
jmitc91516 1:a5258871b33d 175 GuiLibGraphDataSet* columnTempProfilePageGraphCompleteProfileDataSet; // Line representing the complete temperature profile from start to finish
jmitc91516 1:a5258871b33d 176 // We do not display the above data set in the graph - we use it to generate the data sets below.
jmitc91516 1:a5258871b33d 177 // The data set numbers correspond with those set for the graph in easyGUI (as do the colours).
jmitc91516 1:a5258871b33d 178 GuiLibGraphDataSet* columnTempProfilePageGraphDataSet0; // Line representing the temperature profile from 'now' to finish (green)
jmitc91516 1:a5258871b33d 179 GuiLibGraphDataSet* columnTempProfilePageGraphDataSet1; // Bars representing the temperature profile from 'now' to finish (green)
jmitc91516 1:a5258871b33d 180 GuiLibGraphDataSet* columnTempProfilePageGraphDataSet2; // Line representing the temperature profile from start to 'now' (red)
jmitc91516 1:a5258871b33d 181 GuiLibGraphDataSet* columnTempProfilePageGraphDataSet3; // Bars representing the temperature profile from start to 'now' (red)
jmitc91516 1:a5258871b33d 182 GuiLibGraphDataSet* columnTempProfilePageGraphDataSet4; // Dot representing the temperature 'now' (red)
jmitc91516 1:a5258871b33d 183
jmitc91516 1:a5258871b33d 184 GuiLibGraph* runningInjectorPageGraph; // Graph index 6
jmitc91516 1:a5258871b33d 185 GuiLibGraphDataSet* runningInjectorPageGraphCompleteProfileDataSet; // Line representing the complete injector temperature profile from start to finish
jmitc91516 1:a5258871b33d 186 // We do not display the above data set in the graph - we use it to generate the data sets below.
jmitc91516 1:a5258871b33d 187 // The data set numbers correspond with those set for the graph in easyGUI.
jmitc91516 1:a5258871b33d 188 GuiLibGraphDataSet* runningInjectorPageGraphDataSet0; // Line representing the injector temperature profile from 'now' to finish (green)
jmitc91516 1:a5258871b33d 189 GuiLibGraphDataSet* runningInjectorPageGraphDataSet1; // Bars representing the injector temperature profile from 'now' to finish (green)
jmitc91516 1:a5258871b33d 190 GuiLibGraphDataSet* runningInjectorPageGraphDataSet2; // Line representing the injector temperature profile from start to 'now' (yellow)
jmitc91516 1:a5258871b33d 191 GuiLibGraphDataSet* runningInjectorPageGraphDataSet3; // Bars representing the injector temperature profile from start to 'now' (yellow)
jmitc91516 1:a5258871b33d 192 GuiLibGraphDataSet* runningInjectorPageGraphDataSet4; // Dot representing the temperature 'now' (yellow)
jmitc91516 1:a5258871b33d 193 float previousInjectorMethodRunTime;
jmitc91516 1:a5258871b33d 194 bool injectorMethodFinished;
jmitc91516 1:a5258871b33d 195
jmitc91516 1:a5258871b33d 196 void RedrawSingleEasyGUIVariableOnComponentPage(GuiConst_INT16S X, GuiConst_INT16S Y, void *varPtr, GuiConst_INT8U alignment, GCComponent gcComponent);
jmitc91516 1:a5258871b33d 197 void RedrawSingleEasyGUIVariableOnHomePage(GuiConst_INT16S X, GuiConst_INT16S Y, void *varPtr, GuiConst_INT8U alignment);
jmitc91516 1:a5258871b33d 198
jmitc91516 1:a5258871b33d 199 void DrawColumnTemperatureVariableOnHomePage(void);
jmitc91516 1:a5258871b33d 200 void DrawInjectorTemperatureVariableOnHomePage(void);
jmitc91516 1:a5258871b33d 201 void DrawDetectorTemperatureVariableOnHomePage(void);
jmitc91516 1:a5258871b33d 202 void DrawColumnTargetTemperatureVariableOnHomePage(void);
jmitc91516 1:a5258871b33d 203 void DrawInjectorTargetTemperatureVariableOnHomePage(void);
jmitc91516 1:a5258871b33d 204 void DrawDetectorTargetTemperatureVariableOnHomePage(void);
jmitc91516 1:a5258871b33d 205 void DrawGasPressureVariableOnHomePage(void);
jmitc91516 1:a5258871b33d 206 void DrawGasTargetPressureVariableOnHomePage(void);
jmitc91516 1:a5258871b33d 207 void DrawGCRealTimeClockVariableOnHomePage(void);
jmitc91516 1:a5258871b33d 208
jmitc91516 1:a5258871b33d 209 void DrawDetectorTemperatureVariableOnDetectorPage(void);
jmitc91516 1:a5258871b33d 210 void DrawDetectorTargetTemperatureVariableOnDetectorPage(void);
jmitc91516 1:a5258871b33d 211
jmitc91516 1:a5258871b33d 212 void UpdateGasTargetPressuresOnHomePage(char *buffer);
jmitc91516 1:a5258871b33d 213
jmitc91516 0:47c880c1463d 214 void DisplayHomePageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 215 void DisplayColumnPageData(bool mustUpdateDisplay, ColumnType columnType, int pageNumber);
jmitc91516 1:a5258871b33d 216 void DisplayColumnInformationPageData(bool mustUpdateDisplay, ColumnType columnType, int pageNumber);
jmitc91516 5:aceac1035d71 217 void DisplayColumnMethodPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 218 void DisplayColumnTempProfilePageData(bool mustUpdateDisplay, ColumnType columnType, int pageNumber);
jmitc91516 1:a5258871b33d 219 void DisplayColumnDHAutoCalibrationPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 220 void DisplayColumnDHManualCalibrationPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 221 void DisplayColumnDHSensorCalibrationPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 222 void DisplayColumnDHPSUDACPageData(bool mustUpdateDisplay);
jmitc91516 0:47c880c1463d 223 void DisplayInjectorPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 224 void DisplayInjectorTempProfilePageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 225 void DisplayInjectorGasStatusPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 226 void DisplayInjectorConsumablesPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 227 void DisplayDetectorPageData(bool mustUpdateDisplay, DetectorType detectorType, int pageNumber);
jmitc91516 1:a5258871b33d 228 void DisplayGasInformationPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 229 void DisplayGasFlowProfilePageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 230 void DisplayGasCalibrationPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 231 void DisplayGasBackPressureDACPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 232 void DisplayGasChannelDACAndADCPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 233
jmitc91516 1:a5258871b33d 234 void DisplaySimplePageData(int pageNumber, bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 235 void DisplayColumnOvenNudgeAndDampPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 236 void DisplayColumnDHNudgeAndDampPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 237 void DisplayInjectorNudgeAndDampPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 238 void DisplayDetectorNudgeAndDampPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 239 void DisplayAuxiliaryNudgeAndDampPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 240 void DisplayFanPowerPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 241 void DisplayDebugCommandsPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 242
jmitc91516 1:a5258871b33d 243 void DisplayRunningPageData(bool mustUpdateDisplay, bool runHasCompleted);
jmitc91516 0:47c880c1463d 244 void DisplaySettingsPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 245 void DisplayRunningColumnPageData(bool mustUpdateDisplay, bool runHasCompleted);
jmitc91516 1:a5258871b33d 246 void DisplayRunningDetectorPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 247 void DisplayRunningGasPageData(bool mustUpdateDisplay, bool runHasCompleted);
jmitc91516 1:a5258871b33d 248 void DisplayRunningInjectorPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 249 void DisplayRunningInjectorProfilePageData(bool mustUpdateDisplay, bool runHasCompleted);
jmitc91516 1:a5258871b33d 250
jmitc91516 1:a5258871b33d 251 void DisplayServicingRequiredPage(void);
jmitc91516 1:a5258871b33d 252 void DisplayServicingPage(void);
jmitc91516 1:a5258871b33d 253
jmitc91516 1:a5258871b33d 254 void SetupServicingPageEasyGUIVariables(void);
jmitc91516 0:47c880c1463d 255
jmitc91516 0:47c880c1463d 256 void DisplayCurrentPageData(bool mustUpdateDisplay);
jmitc91516 1:a5258871b33d 257
jmitc91516 1:a5258871b33d 258 void DisplayEthernetConnectionPage(void);
jmitc91516 1:a5258871b33d 259
jmitc91516 1:a5258871b33d 260 void DisplayFailedToFindBitmapsPage(void);
jmitc91516 0:47c880c1463d 261
jmitc91516 1:a5258871b33d 262 void DisplayDownloadingMethodPage(void);
jmitc91516 1:a5258871b33d 263 void UndisplayDownloadingMethodPage(void);
jmitc91516 1:a5258871b33d 264
jmitc91516 1:a5258871b33d 265 void CreateGuiLibGraphsAndDataSets(void);
jmitc91516 1:a5258871b33d 266
jmitc91516 1:a5258871b33d 267 void SetupColumnAndInjectorAndGasProfileData(void);
jmitc91516 1:a5258871b33d 268
jmitc91516 1:a5258871b33d 269 void SetupColumnTempProfilePageGraphDataFromGC(void);
jmitc91516 1:a5258871b33d 270 void SetupInjectorTempProfilePageGraphDataFromGC(void);
jmitc91516 1:a5258871b33d 271 void SetupGasFlowProfilePageGraphDataFromGC(void);
jmitc91516 1:a5258871b33d 272
jmitc91516 1:a5258871b33d 273 void SetupColumnTempProfilePageXAxisLabel(TimeUnit timeUnit);
jmitc91516 1:a5258871b33d 274 void SetupInjectorTempProfilePageXAxisLabel(TimeUnit timeUnit);
jmitc91516 1:a5258871b33d 275 void SetupGasFlowProfilePageXAxisLabel(TimeUnit timeUnit);
jmitc91516 1:a5258871b33d 276
jmitc91516 1:a5258871b33d 277 void SetupRunningColumnPageGraphCompleteProfileDataSetFromGC(void);
jmitc91516 1:a5258871b33d 278 bool SetupRunningColumnPageGraphPartialDataSetsToMatchCurrentRunTime(bool runHasCompleted);
jmitc91516 1:a5258871b33d 279
jmitc91516 1:a5258871b33d 280 void SetupRunningGasPageGraphCompleteProfileDataSetFromGC(void);
jmitc91516 1:a5258871b33d 281 bool SetupRunningGasPageGraphPartialDataSetsToMatchCurrentRunTime(bool runHasCompleted);
jmitc91516 1:a5258871b33d 282
jmitc91516 1:a5258871b33d 283 void SetupRunningInjectorPageGraphCompleteProfileDataSetFromGC(void);
jmitc91516 1:a5258871b33d 284 bool SetupRunningInjectorPageGraphPartialDataSetsToMatchCurrentRunTime(bool runHasCompleted);
jmitc91516 1:a5258871b33d 285
jmitc91516 1:a5258871b33d 286 void GetComponentTemperature(char *cmd, char *temp, bool wantPrefix, bool wantDegSuffix, bool oneTenthDegree = true);
jmitc91516 1:a5258871b33d 287 void GetComponentTemperature(char *cmd, float *temp, bool oneTenthDegree = true);
jmitc91516 1:a5258871b33d 288
jmitc91516 1:a5258871b33d 289 void GetColumnTemperature(char *temp, bool wantPrefix, bool wantSuffix);
jmitc91516 1:a5258871b33d 290 void GetColumnTemperature(char *temp, bool wantPrefix);
jmitc91516 0:47c880c1463d 291 void GetColumnTemperature(float *temp);
jmitc91516 1:a5258871b33d 292
jmitc91516 1:a5258871b33d 293 void GetDirectlyHeatedColumnTemperature(char *temp, bool wantPrefix);
jmitc91516 1:a5258871b33d 294 void GetDirectlyHeatedColumnTemperature(float *temp);
jmitc91516 1:a5258871b33d 295
jmitc91516 1:a5258871b33d 296 void GetColumnTargetTemperature(char *temp, char *format);
jmitc91516 1:a5258871b33d 297
jmitc91516 0:47c880c1463d 298 void GetDetectorTemperature(char *temp);
jmitc91516 0:47c880c1463d 299 void GetDetectorTemperature(float *temp);
jmitc91516 1:a5258871b33d 300 void GetDetectorTargetTemperature(char *temp, char *format);
jmitc91516 1:a5258871b33d 301
jmitc91516 1:a5258871b33d 302 void GetInjectorTemperature(char *temp, bool wantPrefix);
jmitc91516 0:47c880c1463d 303 void GetInjectorTemperature(float *temp);
jmitc91516 1:a5258871b33d 304 void GetInjectorTargetTemperature(char *temp, char *format);
jmitc91516 1:a5258871b33d 305
jmitc91516 1:a5258871b33d 306 void GetPressure(char *cmd, char *press, bool wantPrefix, bool wantUnits);
jmitc91516 1:a5258871b33d 307
jmitc91516 1:a5258871b33d 308 void GetGasPressure(char *press, bool wantPrefix, bool wantUnits);
jmitc91516 0:47c880c1463d 309 void GetGasPressure(float *press);
jmitc91516 1:a5258871b33d 310 void GetGasPulsedPressure(char *pulsedPress);
jmitc91516 1:a5258871b33d 311 void GetCurrentGasPressure(char *press, bool wantPrefix, bool wantUnits);
jmitc91516 1:a5258871b33d 312
jmitc91516 1:a5258871b33d 313 bool GetGasControlMode(char *mode, bool wantFullPrefix, bool wantAnyPrefix);
jmitc91516 1:a5258871b33d 314 void GetCarrierGasType(char *type);
jmitc91516 1:a5258871b33d 315 void GetGasFilterDateChanged(char *date);
jmitc91516 1:a5258871b33d 316
jmitc91516 1:a5258871b33d 317 void GetColumnMaxTemperature(char *maxTemp, bool wantFullPrefix, bool wantAnyPrefix, bool wantUnits = false);
jmitc91516 0:47c880c1463d 318 void GetColumnMaxTemperature(float *temp);
jmitc91516 1:a5258871b33d 319 void GetColumnType(char *type);
jmitc91516 1:a5258871b33d 320 ColumnType GetColumnType(void);
jmitc91516 1:a5258871b33d 321
jmitc91516 1:a5258871b33d 322 void GetInjectionMode(char *mode);
jmitc91516 1:a5258871b33d 323 void GetInjectorType(char *mode, bool wantPrefix);
jmitc91516 1:a5258871b33d 324 void GetInjectorSplitTime(char *splitTime);
jmitc91516 1:a5258871b33d 325 void GetInjectionCountSinceLinerChanged(char *injCount);
jmitc91516 1:a5258871b33d 326 void GetInjectionCountSinceSeptaChanged(char *injCount);
jmitc91516 1:a5258871b33d 327 void GetInjectionCountSinceOringChanged(char *injCount);
jmitc91516 1:a5258871b33d 328
jmitc91516 1:a5258871b33d 329 void GetInjectionCountSinceColumnInstalled(char *injCount);
jmitc91516 1:a5258871b33d 330 void GetColumnLength(char *columnLengthBuffer);
jmitc91516 1:a5258871b33d 331 void GetColumnInnerDiameter(char *columnIDBuffer);
jmitc91516 1:a5258871b33d 332 void GetColumnOuterDiameter(char *columnODBuffer);
jmitc91516 1:a5258871b33d 333
jmitc91516 1:a5258871b33d 334 void GetTotalFlow(char *totalFlow);
jmitc91516 1:a5258871b33d 335 void GetTotalFlow(float *totalFlow);
jmitc91516 1:a5258871b33d 336 void GetColumnFlow(char *columnFlow);
jmitc91516 1:a5258871b33d 337 void GetColumnFlow(float *columnFlow);
jmitc91516 1:a5258871b33d 338
jmitc91516 1:a5258871b33d 339 void GetSplitFlow(float *splitFlow);
jmitc91516 1:a5258871b33d 340 void GetSplitFlow(char *splitFlow);
jmitc91516 1:a5258871b33d 341 void GetSplitRatio(float *splitRatio);
jmitc91516 1:a5258871b33d 342 void GetSplitRatio(char *splitRatio);
jmitc91516 1:a5258871b33d 343
jmitc91516 1:a5258871b33d 344 void GetDetectorTypeOld(char *type, bool wantFullPrefix);
jmitc91516 1:a5258871b33d 345 void GetDetectorType(char *type, bool wantFullPrefix, bool wantPrefix);
jmitc91516 1:a5258871b33d 346 void GetDetectorRange(char *range);
jmitc91516 1:a5258871b33d 347 void GetDetectorIgnitionState(char *state);
jmitc91516 1:a5258871b33d 348 IgnitionState GetDetectorIgnitionState(void);
jmitc91516 1:a5258871b33d 349
jmitc91516 1:a5258871b33d 350 void GetTCDDetectorFilamentPolarity(char *polarity);
jmitc91516 1:a5258871b33d 351 void GetTCDDetectorFilamentTemperature(char *temp);
jmitc91516 1:a5258871b33d 352 void GetTCDDetectorRange(char *range);
jmitc91516 1:a5258871b33d 353
jmitc91516 1:a5258871b33d 354 void GetECDDetectorCurrent(char *current);
jmitc91516 1:a5258871b33d 355
jmitc91516 1:a5258871b33d 356 void GetFPDDetectorRange(char *range);
jmitc91516 1:a5258871b33d 357 void GetFPDDetectorSensitivity(char *sensitivity);
jmitc91516 1:a5258871b33d 358
jmitc91516 1:a5258871b33d 359 void GetFlowRate(char *cmd, char *rate);
jmitc91516 1:a5258871b33d 360 void GetFuelFlowRate(char *rate);
jmitc91516 1:a5258871b33d 361 void GetAirFlowRate(char *rate);
jmitc91516 1:a5258871b33d 362
jmitc91516 1:a5258871b33d 363 bool ExecuteCommandWithDACKResponse(char *cmd);
jmitc91516 1:a5258871b33d 364
jmitc91516 1:a5258871b33d 365 void GetGCSoftwareVersion(char *version);
jmitc91516 1:a5258871b33d 366 void GetActuatorSoftwareVersion(char *version);
jmitc91516 0:47c880c1463d 367 void GetRunTime(char *time);
jmitc91516 1:a5258871b33d 368 void GetRunTime(float *time);
jmitc91516 1:a5258871b33d 369 void GetSerialNumber(char *serialNumber);
jmitc91516 1:a5258871b33d 370 void GetGCRealTimeClockTime(char *clockTime);
jmitc91516 1:a5258871b33d 371
jmitc91516 5:aceac1035d71 372 void GetInitialHoldTime(char *time);
jmitc91516 5:aceac1035d71 373
jmitc91516 1:a5258871b33d 374 float GetColumnMethodTimeRemaining(void);
jmitc91516 0:47c880c1463d 375
jmitc91516 0:47c880c1463d 376 bool pageJustChanged;
jmitc91516 0:47c880c1463d 377 bool displayingData;
jmitc91516 1:a5258871b33d 378 bool needToUpdateProfileGraphs;
jmitc91516 1:a5258871b33d 379
jmitc91516 1:a5258871b33d 380 bool IsSendMethodCommand(char *gcCommand);
jmitc91516 1:a5258871b33d 381
jmitc91516 1:a5258871b33d 382 bool sendingMethod;
jmitc91516 0:47c880c1463d 383
jmitc91516 0:47c880c1463d 384 bool gcInStandbyMode;
jmitc91516 0:47c880c1463d 385
jmitc91516 0:47c880c1463d 386 bool GCIsInStandbyMode(void);
jmitc91516 0:47c880c1463d 387 void DisplayStandbyModePage(void);
jmitc91516 1:a5258871b33d 388 bool ExitGCStandbyMode(void);
jmitc91516 1:a5258871b33d 389
jmitc91516 1:a5258871b33d 390 bool ClearGCErrors(void);
jmitc91516 1:a5258871b33d 391
jmitc91516 1:a5258871b33d 392 bool AbortGCRun(void);
jmitc91516 0:47c880c1463d 393
jmitc91516 0:47c880c1463d 394 HomePageGCComponentStatusColorAreas* homePageGCComponentStatusColorAreas;
jmitc91516 0:47c880c1463d 395 SingleGCComponentPageStatusColorAreas* singleGCComponentPageStatusColorAreas;
jmitc91516 0:47c880c1463d 396
jmitc91516 0:47c880c1463d 397 void SetGCDeviceReport(char *cmd, char *response);
jmitc91516 0:47c880c1463d 398
jmitc91516 0:47c880c1463d 399 int GetGCStatusOrFaultCode(char *cmd);
jmitc91516 0:47c880c1463d 400 int GetGCStatus(void);
jmitc91516 0:47c880c1463d 401 int GetGCFaultCode(void);
jmitc91516 0:47c880c1463d 402 void GetGCStateAsInfoString(int gcStateCode, int gcFaultCode, char *statusString);
jmitc91516 1:a5258871b33d 403 bool GCHasFaulted(int gcStatus, char* statusString);
jmitc91516 1:a5258871b33d 404 bool GCHasFaulted(void);
jmitc91516 1:a5258871b33d 405 void DisplayGCInFaultStatePage(bool clearDisplay);
jmitc91516 1:a5258871b33d 406 void DisplayRunCompletePage(void);
jmitc91516 1:a5258871b33d 407 void DisplayRunAbortedPage(void);
jmitc91516 0:47c880c1463d 408
jmitc91516 0:47c880c1463d 409 bool IsHeatOn(void);
jmitc91516 0:47c880c1463d 410
jmitc91516 0:47c880c1463d 411 int GetInstrumentStatus(void);
jmitc91516 1:a5258871b33d 412 bool GCIsRunning(void);
jmitc91516 1:a5258871b33d 413 bool realGCIsRunning;
jmitc91516 1:a5258871b33d 414 bool GCIsStabilising(void);
jmitc91516 1:a5258871b33d 415
jmitc91516 1:a5258871b33d 416 GCComponentStatus GetComponentStatus(GCComponent component);
jmitc91516 1:a5258871b33d 417 void GetComponentStatusString(GCComponent component, char *buff);
jmitc91516 1:a5258871b33d 418
jmitc91516 1:a5258871b33d 419 bool HomePageGCComponentStatusesHaveChanged(void);
jmitc91516 0:47c880c1463d 420
jmitc91516 1:a5258871b33d 421 bool SinglePageGCComponentStatusHasChanged(GCComponent component);
jmitc91516 1:a5258871b33d 422 bool SinglePageGCComponentStatusHasChanged(GCComponent component, GCComponentStatus lastStatusDisplayed);
jmitc91516 1:a5258871b33d 423
jmitc91516 1:a5258871b33d 424 GCComponentStatus lastColumnStatusDisplayedOnHomePage;
jmitc91516 1:a5258871b33d 425 GCComponentStatus lastInjectorStatusDisplayedOnHomePage;
jmitc91516 1:a5258871b33d 426 GCComponentStatus lastDetectorStatusDisplayedOnHomePage;
jmitc91516 1:a5258871b33d 427 GCComponentStatus lastGasStatusDisplayedOnHomePage;
jmitc91516 1:a5258871b33d 428
jmitc91516 1:a5258871b33d 429 GCComponentStatus lastColumnStatusDisplayedOnColumnPage;
jmitc91516 1:a5258871b33d 430 GCComponentStatus lastInjectorStatusDisplayedOnInjectorPage;
jmitc91516 1:a5258871b33d 431 GCComponentStatus lastDetectorStatusDisplayedOnDetectorPage;
jmitc91516 1:a5258871b33d 432 GCComponentStatus lastGasStatusDisplayedOnGasInformationPage;
jmitc91516 0:47c880c1463d 433
jmitc91516 1:a5258871b33d 434 bool SuccessfulRunCommand(char* gcCommand, char* gcResponse);
jmitc91516 1:a5258871b33d 435 bool SuccessfulAbortCommand(char* gcCommand, char* gcResponse);
jmitc91516 1:a5258871b33d 436
jmitc91516 1:a5258871b33d 437 void ShortEthernetThreadWait(Thread* ethernetThread, int debugValue);
jmitc91516 1:a5258871b33d 438 void ShortTouchThreadWait(SimplifiedTouchListener* stl, int debugValue);
jmitc91516 1:a5258871b33d 439 void ShortThreadWait(SimplifiedTouchListener* stl, Thread* ethernetThread, int debugValue);
jmitc91516 0:47c880c1463d 440
jmitc91516 1:a5258871b33d 441 void PollGC(SimplifiedTouchListener* stl, Thread* ethernetThread);
jmitc91516 1:a5258871b33d 442
jmitc91516 1:a5258871b33d 443 void HandleEthernetMessage(Thread* ethernetThread, int debugValue);
jmitc91516 1:a5258871b33d 444 bool handlingEthernetMessage;
jmitc91516 1:a5258871b33d 445
jmitc91516 1:a5258871b33d 446 void HandleTouchEvent(short touchX, short touchY, short touchZ, int debugValue);
jmitc91516 1:a5258871b33d 447 bool handlingTouchEvent;
jmitc91516 1:a5258871b33d 448
jmitc91516 1:a5258871b33d 449 bool PageIncludesComponentStatus(int pageNumber);
jmitc91516 1:a5258871b33d 450
jmitc91516 1:a5258871b33d 451 void HandleUserInterfaceAndEthernet(SimplifiedTouchListener* stl, Thread* ethernetThread);
jmitc91516 1:a5258871b33d 452
jmitc91516 1:a5258871b33d 453 GCStateAndFaultCodes gcStateAndFaultCodes;
jmitc91516 1:a5258871b33d 454
jmitc91516 1:a5258871b33d 455 bool gotAtLeastOneTimeout;
jmitc91516 0:47c880c1463d 456
jmitc91516 1:a5258871b33d 457 bool runWasAborted;
jmitc91516 1:a5258871b33d 458
jmitc91516 1:a5258871b33d 459 int ethernetPort;
jmitc91516 1:a5258871b33d 460 char ethernetIP[20];
jmitc91516 1:a5258871b33d 461 char ethernetMask[20];
jmitc91516 1:a5258871b33d 462 char ethernetGateway[20];
jmitc91516 1:a5258871b33d 463 bool useDHCPForEthernet;
jmitc91516 1:a5258871b33d 464
jmitc91516 1:a5258871b33d 465 bool restartRequired;
jmitc91516 1:a5258871b33d 466
jmitc91516 1:a5258871b33d 467 GCStateSimplified lastSimplifiedGCState;
jmitc91516 1:a5258871b33d 468
jmitc91516 1:a5258871b33d 469 Timer gcResponseTimer;
jmitc91516 1:a5258871b33d 470 Timer touchTimer;
jmitc91516 1:a5258871b33d 471
jmitc91516 1:a5258871b33d 472 QSPIBitmaps* qspiBitmaps;
jmitc91516 5:aceac1035d71 473
jmitc91516 5:aceac1035d71 474 ColumnMethodRampData* columnMethodRampData;
jmitc91516 0:47c880c1463d 475
jmitc91516 1:a5258871b33d 476 ColumnType runningColumnType;
jmitc91516 1:a5258871b33d 477
jmitc91516 5:aceac1035d71 478 void UpdateColumnMethodPageData(void);
jmitc91516 5:aceac1035d71 479
jmitc91516 1:a5258871b33d 480 // RTosTimer stuff
jmitc91516 1:a5258871b33d 481 RtosTimer* rtosTimer;
jmitc91516 1:a5258871b33d 482 int lastTouchEventTickCount;
jmitc91516 1:a5258871b33d 483 short lastTouchEventX;
jmitc91516 1:a5258871b33d 484 short lastTouchEventY;
jmitc91516 1:a5258871b33d 485 static osThreadId timerCallbackThreadToSignal;
jmitc91516 1:a5258871b33d 486 static const int waitTimeMs;
jmitc91516 1:a5258871b33d 487 static const int shortWaitTimeMs;
jmitc91516 1:a5258871b33d 488 static int timerTickCount;
jmitc91516 1:a5258871b33d 489 static const uint32_t timerIntervalMilliSec;
jmitc91516 1:a5258871b33d 490 static const uint32_t minTimerTicksBetweenTouchEvents;
jmitc91516 1:a5258871b33d 491
jmitc91516 1:a5258871b33d 492 static const float graphBarIntervalMinutes;
jmitc91516 1:a5258871b33d 493 static const float graphBarIntervalSeconds;
jmitc91516 1:a5258871b33d 494
jmitc91516 1:a5258871b33d 495 static const float methodTimeUnitsThreshold;
jmitc91516 1:a5258871b33d 496
jmitc91516 1:a5258871b33d 497 static const int defaultEthernetPort;
jmitc91516 1:a5258871b33d 498 static const char* defaultEthernetIP;
jmitc91516 1:a5258871b33d 499 static const char* defaultEthernetMask;
jmitc91516 1:a5258871b33d 500 static const char* defaultEthernetGateway;
jmitc91516 1:a5258871b33d 501
jmitc91516 1:a5258871b33d 502 static const char* startDHColumnCalibration;
jmitc91516 1:a5258871b33d 503 static const char* exitDHColumnCalibration;
jmitc91516 1:a5258871b33d 504
jmitc91516 1:a5258871b33d 505 static void DisplayText(char *text, short X, short Y, GuiConst_INT8U alignment, GuiConst_INT16U fontNo, GuiConst_INTCOLOR foreColor);
jmitc91516 0:47c880c1463d 506 };
jmitc91516 0:47c880c1463d 507
jmitc91516 0:47c880c1463d 508 #endif // GETGCSTATUSLOOP_H