Major updates:
- added DAConverter(s) - added ADConverter(s) - Fixed some display issues - Made repair process and signalProfileGenerator calculate with voltages (signed) instead of DAC/ADC values - Fixed several bugs in task handlings - Put display data mirror into dedicated file displaycontent git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@261 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -31,7 +31,9 @@
|
||||
#include "repairProcess.h"
|
||||
#include "repairProcesses.h"
|
||||
|
||||
#include "ADConverters.h"
|
||||
#include "CathodeMCP.h"
|
||||
#include "DAConverters.h"
|
||||
#include "Display.h"
|
||||
#include "Error.h"
|
||||
#include "hsb-mrts.h"
|
||||
@@ -69,7 +71,7 @@ static const char cursorValue[2] = {0x7E, '\0'};
|
||||
|
||||
|
||||
// TEMPORARY PRESET STORAGE
|
||||
static const struct RepairPreset preset1 = {.numberOfStages = 1, .preset[0].softstartDuration = 100, .preset[0].duration = 200, .preset[0].voltage = 1000};
|
||||
static const struct RepairPreset preset1 = {.numberOfStages = 1, .preset[0].softstartDuration = 200, .preset[0].duration = 60, .preset[0].voltage = 1000};
|
||||
static const struct RepairPreset preset2 = {.numberOfStages = 1, .preset[0].softstartDuration = 200, .preset[0].duration = 400, .preset[0].voltage = 3000};
|
||||
static const struct RepairPreset preset3 = {.numberOfStages = 1, .preset[0].softstartDuration = 300, .preset[0].duration = 600, .preset[0].voltage = 300};
|
||||
static const struct RepairPreset preset4 = {.numberOfStages = 1, .preset[0].softstartDuration = 400, .preset[0].duration = 800, .preset[0].voltage = 400};
|
||||
@@ -77,7 +79,7 @@ static const struct RepairPreset preset5 = {.numberOfStages = 1, .preset[0].soft
|
||||
static const struct RepairPreset preset6 = {.numberOfStages = 1, .preset[0].softstartDuration = 600, .preset[0].duration = 1200, .preset[0].voltage = 600};
|
||||
static const struct RepairPreset preset7 = {.numberOfStages = 1, .preset[0].softstartDuration = 700, .preset[0].duration = 1400, .preset[0].voltage = 700};
|
||||
static const struct RepairPreset preset8 = {.numberOfStages = 1, .preset[0].softstartDuration = 800, .preset[0].duration = 1600, .preset[0].voltage = 800};
|
||||
static const struct RepairPreset preset9 = {.numberOfStages = 1, .preset[0].softstartDuration = 900, .preset[0].duration = 1800, .preset[0].voltage = 900};
|
||||
static const struct RepairPreset preset9 = {.numberOfStages = 2, .preset[0].softstartDuration = 900, .preset[0].duration = 1800, .preset[0].voltage = 6000, .preset[1].softstartDuration = 100, .preset[1].duration = 1800, .preset[1].voltage = 8000};
|
||||
static const struct RepairPreset* presetArray[9] = {&preset1, &preset2, &preset3, &preset4, &preset5, &preset6, &preset7, &preset8, &preset9};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -204,6 +206,7 @@ void repairMenu_destruct (struct RepairMenu* self)
|
||||
void repairMenu_interlockFailed(struct RepairMenu* self, T_INTERLOCK_ID interlockID)
|
||||
{
|
||||
repairMenu_changeState(self, ERROR_STATE);
|
||||
|
||||
if (interlockID == COMMON_INTERLOCK)
|
||||
{
|
||||
snprintf(self->errorMessage, sizeof(self->errorMessage) / sizeof(self->errorMessage[0]), "COVER OPEN");
|
||||
@@ -275,13 +278,12 @@ static void repairMenu_task(void* parameters)
|
||||
else if (self->menuState == REPAIR_ASK_PAUSE)
|
||||
{
|
||||
uint32_t remainingTime = repairProcess_getRemainingRepairTime(repairProcesses_getMainRepairProcess());
|
||||
repairMenu_printAskPause(self);
|
||||
if (tempScreenCounter >= remainingTime)
|
||||
{
|
||||
// POPUP screen time is over, return to previous state
|
||||
repairMenu_changeState(self, tempMenuState);
|
||||
}
|
||||
|
||||
repairMenu_printAskPause(self);
|
||||
}
|
||||
else if (self->menuState == REPAIR_PAUSE)
|
||||
{
|
||||
@@ -358,7 +360,6 @@ static void repairMenu_printRepair(struct RepairMenu* self)
|
||||
|
||||
snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), " %02d:%02d:%02d remain ", remainingTime.hours, remainingTime.minutes, remainingTime.seconds);
|
||||
Display_write(self->display, buffer, 1, 1);
|
||||
LOGGER_DEBUG(mainLog, "%s", buffer);
|
||||
|
||||
// Regulation is unique for each row
|
||||
// For TESLA repair only row 1 (out of 0,1,2) is used
|
||||
@@ -369,14 +370,14 @@ static void repairMenu_printRepair(struct RepairMenu* self)
|
||||
row = repairProcess_getRowInformation(repairProcess, loopCounter);
|
||||
|
||||
snprintf (buffer, sizeof(buffer) / sizeof(buffer[0]), "R%d", loopCounter + 1);
|
||||
Display_write(self->display, buffer, 2, ((loopCounter * (self->display->displayDevice->parameters.numberOfColumns / REPAIRPROCESS_NUMBER_OF_ROWS)) + (self->display->displayDevice->parameters.numberOfColumns / REPAIRPROCESS_NUMBER_OF_ROWS) / strlen(buffer)));
|
||||
Display_write(self->display, buffer, 2, ((loopCounter * (self->display->displayDevice->parameters.numberOfColumns / REPAIRPROCESS_NUMBER_OF_ROWS) + loopCounter) + (self->display->displayDevice->parameters.numberOfColumns / REPAIRPROCESS_NUMBER_OF_ROWS) / strlen(buffer)));
|
||||
|
||||
if (!row->errorData.rowHasError)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%05dV", row->lastADCValue);
|
||||
snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%5dV", row->lastADCValue);
|
||||
Display_write(self->display, buffer, 3, (loopCounter + (loopCounter * (self->display->displayDevice->parameters.numberOfColumns / REPAIRPROCESS_NUMBER_OF_ROWS)) + (self->display->displayDevice->parameters.numberOfColumns / REPAIRPROCESS_NUMBER_OF_ROWS) / strlen(buffer)));
|
||||
|
||||
snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%04dER", row->pidError);
|
||||
snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%4dER", row->pidError);
|
||||
Display_write(self->display, buffer, 4, (loopCounter + (loopCounter * (self->display->displayDevice->parameters.numberOfColumns / REPAIRPROCESS_NUMBER_OF_ROWS)) + (self->display->displayDevice->parameters.numberOfColumns / REPAIRPROCESS_NUMBER_OF_ROWS) / strlen(buffer)));
|
||||
}
|
||||
else
|
||||
@@ -631,12 +632,12 @@ static void repairMenu_solenoidUnlock(struct RepairMenu* self, int cursorIndex)
|
||||
static void repairMenu_startRepairProcess(struct RepairMenu* self, int cursorIndex)
|
||||
{
|
||||
ErrorStatus returnValue = SUCCESS;
|
||||
self->rpParameters.adcRow1 = &adc1->channel[0];
|
||||
self->rpParameters.adcRow2 = &adc1->channel[1];
|
||||
self->rpParameters.adcRow3 = &adc1->channel[2];
|
||||
self->rpParameters.dacRow1 = &max5715->dac[0];
|
||||
self->rpParameters.dacRow2 = &max5715->dac[1];
|
||||
self->rpParameters.dacRow3 = &max5715->dac[2];
|
||||
self->rpParameters.adcR1 = adcRow1;
|
||||
self->rpParameters.adcR2 = adcRow2;
|
||||
self->rpParameters.adcR3 = adcRow3;
|
||||
self->rpParameters.dacR1 = dacRow1;
|
||||
self->rpParameters.dacR2 = dacRow2;
|
||||
self->rpParameters.dacR3 = dacRow3;
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
@@ -700,11 +701,13 @@ static void repairMenu_pauseRepairProcess(struct RepairMenu* self, int cursorInd
|
||||
{
|
||||
repairMenu_changeState(self, REPAIR_PAUSE);
|
||||
repairProcess_pauseProcess(repairProcesses_getMainRepairProcess());
|
||||
hsb_disableSafety();
|
||||
}
|
||||
|
||||
|
||||
static void repairMenu_continueRepairProcess(struct RepairMenu* self, int cursorIndex)
|
||||
{
|
||||
hsb_enableSafety();
|
||||
repairMenu_changeState(self, REPAIR_RUNNING);
|
||||
repairProcess_continueProcess(repairProcesses_getMainRepairProcess());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user