Fixed language problems. Menu is totally independent from constant strings now, all messages are taken from dedicated include file "MenuText.h"
Makefile is adapted Added "Dispay_writeCentered" function, which safes a lot of code git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@281 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -261,6 +261,26 @@ extern ErrorStatus Display_backspace(struct Display* self);
|
||||
extern ErrorStatus Display_write(struct Display* self, const char* buffer, size_t row, size_t column);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* Display_writeCentered
|
||||
* Puts a string on the specified row of the display in centered mode
|
||||
*
|
||||
* @param self The display object
|
||||
* @param buffer String/message to write
|
||||
* @param row The row to put the message to
|
||||
*
|
||||
* @return ErrorStatus SUCCESS if putting message to display was
|
||||
* successful
|
||||
* ERROR otherwise, especially
|
||||
* - Message too long
|
||||
* - Row outside display boundaries
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern ErrorStatus Display_writeCentered(struct Display* self, const char* buffer, unsigned int row);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* Display_feedRefreshCounter
|
||||
* Feeds the refresh counter for display content
|
||||
|
||||
@@ -38,7 +38,319 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#define MENUTEXT_NUMBER_OF_LANGUAGES (2)
|
||||
#define MENUTEXT_ENGLISH (0)
|
||||
|
||||
// DEFINE STRING LENGTH FOR DIFFERENT ENTRIES
|
||||
#define MENUTEXT_ROW1_POPUP_MAX_LENGTH (17)
|
||||
#define MENUTEXT_POPUP_MESSAGE_LENGTH (21)
|
||||
|
||||
// Repairscreen string length
|
||||
#define MENUTEXT_REPAIRSCREEN_LENGTH (7)
|
||||
|
||||
#define MENUTEXT_PRESET_MAX_LENGTH (7)
|
||||
|
||||
#define MENUTEXT_CHANGEPIN_MAX_LENGTH (15)
|
||||
|
||||
|
||||
// -----------------------
|
||||
// WARNINGS
|
||||
// -----------------------
|
||||
static const char MenuText_WARNING[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_ROW1_POPUP_MAX_LENGTH] =
|
||||
{
|
||||
{
|
||||
"!!WARNING!!"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_WARNING_COVER_OPEN[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"COVER OPEN"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// -----------------------
|
||||
// ERRORS
|
||||
// -----------------------
|
||||
static const char MenuText_ERROR[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_ROW1_POPUP_MAX_LENGTH] =
|
||||
{
|
||||
{
|
||||
"!!ERROR!!"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_ERROR_COVER_OPEN[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"COVER OPEN"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static const char MenuText_ERROR_PROCESS_FAILED[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"PROCESS FAILED"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_ERROR_CRC_PIN[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"PIN CRC ERROR"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_ERROR_CRC_PARAMETERS[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"PARAMETERS CRC ERROR"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_ERROR_CRC_PRESETS[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"PRESETS CRC ERROR"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
// -----------------------
|
||||
// Common screen messages
|
||||
// -----------------------
|
||||
|
||||
static const char MenuText_X_CONTINUE[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"Hit X to continue"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_REPAIR_SCREEN[MENUTEXT_NUMBER_OF_LANGUAGES][4][MENUTEXT_REPAIRSCREEN_LENGTH] =
|
||||
{
|
||||
{
|
||||
"total", // Indicates the total repair time
|
||||
"remain", // Indicates the remaining repair time
|
||||
"R", // Row identifier. DO NOT USE MORE THAN ONE LETTER! The number of the row (1,2,3) is attached dynamically
|
||||
"ERROR" // Error identifier in case a ROW is in error-state. Will be written instead of the current voltage
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_REPAIR_SCREEN_INIT[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_ROW1_POPUP_MAX_LENGTH] =
|
||||
{
|
||||
{
|
||||
"Initialising" // Indicates start of a repair
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_PAUSE[MENUTEXT_NUMBER_OF_LANGUAGES][5][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"REPAIR BUSY",
|
||||
"Hit X to PAUSE",
|
||||
"!!PAUSE!!",
|
||||
"Hit ENT to continue",
|
||||
"Hit X to RESET"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_FINISH[MENUTEXT_NUMBER_OF_LANGUAGES][2][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"REPAIR FINISHED",
|
||||
"Hit ENT to continue",
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_PRINT_PRESET[MENUTEXT_NUMBER_OF_LANGUAGES][5][MENUTEXT_PRESET_MAX_LENGTH] =
|
||||
{
|
||||
{
|
||||
"Preset",
|
||||
"info",
|
||||
"Start:",
|
||||
"Time:",
|
||||
"Volt:"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_CHANGE_PIN[MENUTEXT_NUMBER_OF_LANGUAGES][2][MENUTEXT_CHANGEPIN_MAX_LENGTH] =
|
||||
{
|
||||
{
|
||||
" New PIN:",
|
||||
" Repeat PIN:"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_INTERLOCK_STATUS[MENUTEXT_NUMBER_OF_LANGUAGES][3][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"Cover Interlock is",
|
||||
"closed",
|
||||
"open"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_CONFIRM_PIN[MENUTEXT_NUMBER_OF_LANGUAGES][2][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"PIN OK",
|
||||
"PIN DENIED"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_CONFIRM_NEW_PIN[MENUTEXT_NUMBER_OF_LANGUAGES][2][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"New PIN accepted",
|
||||
"New PIN denied"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_SAFE_PRESET[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"Preset saved"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_SELECT_PRESET[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH - 3] =
|
||||
{
|
||||
{
|
||||
"Selected preset:"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static const char MenuText_SAFE_CONSTANTS[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"Constants saved"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_INSERT_PIN[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"Insert PIN"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_VOLTAGE_IN_HEADER[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_ROW1_POPUP_MAX_LENGTH] =
|
||||
{
|
||||
{
|
||||
"Voltage input"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_VOLTAGE_OUT_HEADER[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_ROW1_POPUP_MAX_LENGTH] =
|
||||
{
|
||||
{
|
||||
"Voltage output"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_VOLTAGE_ROW[MENUTEXT_NUMBER_OF_LANGUAGES][5] =
|
||||
{
|
||||
{
|
||||
"Row"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_CONSTANTS_HEADER[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_ROW1_POPUP_MAX_LENGTH] =
|
||||
{
|
||||
{
|
||||
"PID constants"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_VOLTAGE_OUT_CLEANUP[MENUTEXT_NUMBER_OF_LANGUAGES][2][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
{
|
||||
"All rows reset to 0V",
|
||||
"Press X to continue"
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
}
|
||||
};
|
||||
|
||||
// -----------------------
|
||||
// OPERATOR MENU
|
||||
|
||||
Reference in New Issue
Block a user