trigger lifecycle

This commit is contained in:
rusefillc 2020-12-09 12:19:25 -05:00
parent 247d608c1e
commit e6bfd9a2ed
5 changed files with 11 additions and 6 deletions

View File

@ -1,6 +1,9 @@
/**
* @file trigger_structure.h
*
* rusEFI defines trigger shape programmatically in C code
* For integration we have exportAllTriggers export
*
* @date Dec 22, 2013
* @author Andrey Belomutskiy, (c) 2012-2020
*/

View File

@ -521,14 +521,13 @@ static void triggerShapeInfo(void) {
#include <stdlib.h>
extern trigger_type_e focusOnTrigger;
#define TRIGGERS_FILE_NAME "triggers.txt"
/**
* This is used to generate trigger info which is later used by TriggerImage java class
* to generate images for documentation
*/
extern bool printTriggerDebug;
void printAllTriggers() {
void exportAllTriggers() {
FILE * fp = fopen (TRIGGERS_FILE_NAME, "w+");

View File

@ -82,7 +82,11 @@ void hwHandleShaftSignal(trigger_event_e signal, efitick_t timestamp);
void hwHandleVvtCamSignal(trigger_value_e front, efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX);
void initTriggerCentral(Logging *sharedLogger);
void printAllTriggers();
/**
* this method is invoked by 'unit tests' project on PC to write triggers.txt representation of all rusEFI triggers
* That triggers.txt is later consumed by TriggerImage.java to render trigger images
*/
void exportAllTriggers();
int isSignalDecoderError(void);
void resetMaxValues();

View File

@ -28,7 +28,6 @@ import java.util.List;
public class TriggerImage {
private static final String TRIGGERTYPE = "TRIGGERTYPE";
private static final String OUTPUT_FOLDER = "triggers";
private static final String INPUT_FILE_NAME = "triggers.txt";
private static final String TOP_MESSAGE = StartupFrame.LINK_TEXT;
private static final String DEFAULT_WORK_FOLDER = ".." + File.separator + "unit_tests";
@ -126,7 +125,7 @@ public class TriggerImage {
}
private static void generateImages(String workingFolder, TriggerPanel trigger, JPanel topPanel, JPanel content) throws IOException {
String fileName = workingFolder + File.separator + INPUT_FILE_NAME;
String fileName = workingFolder + File.separator + Fields.TRIGGERS_FILE_NAME;
BufferedReader br = new BufferedReader(new FileReader(fileName));
System.out.println("Reading " + fileName);

View File

@ -45,7 +45,7 @@ GTEST_API_ int main(int argc, char **argv) {
// resizeMap();
printf("Success 20201203\r\n");
printAllTriggers();
exportAllTriggers();
if (focusOnTrigger != TT_UNUSED) {
return -1;
}