trigger lifecycle
This commit is contained in:
parent
247d608c1e
commit
e6bfd9a2ed
|
@ -1,6 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* @file trigger_structure.h
|
* @file trigger_structure.h
|
||||||
*
|
*
|
||||||
|
* rusEFI defines trigger shape programmatically in C code
|
||||||
|
* For integration we have exportAllTriggers export
|
||||||
|
*
|
||||||
* @date Dec 22, 2013
|
* @date Dec 22, 2013
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2020
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -521,14 +521,13 @@ static void triggerShapeInfo(void) {
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
extern trigger_type_e focusOnTrigger;
|
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
|
* This is used to generate trigger info which is later used by TriggerImage java class
|
||||||
* to generate images for documentation
|
* to generate images for documentation
|
||||||
*/
|
*/
|
||||||
extern bool printTriggerDebug;
|
extern bool printTriggerDebug;
|
||||||
void printAllTriggers() {
|
void exportAllTriggers() {
|
||||||
|
|
||||||
FILE * fp = fopen (TRIGGERS_FILE_NAME, "w+");
|
FILE * fp = fopen (TRIGGERS_FILE_NAME, "w+");
|
||||||
|
|
||||||
|
|
|
@ -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 hwHandleVvtCamSignal(trigger_value_e front, efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
void initTriggerCentral(Logging *sharedLogger);
|
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);
|
int isSignalDecoderError(void);
|
||||||
void resetMaxValues();
|
void resetMaxValues();
|
||||||
|
|
|
@ -28,7 +28,6 @@ import java.util.List;
|
||||||
public class TriggerImage {
|
public class TriggerImage {
|
||||||
private static final String TRIGGERTYPE = "TRIGGERTYPE";
|
private static final String TRIGGERTYPE = "TRIGGERTYPE";
|
||||||
private static final String OUTPUT_FOLDER = "triggers";
|
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 TOP_MESSAGE = StartupFrame.LINK_TEXT;
|
||||||
private static final String DEFAULT_WORK_FOLDER = ".." + File.separator + "unit_tests";
|
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 {
|
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));
|
BufferedReader br = new BufferedReader(new FileReader(fileName));
|
||||||
|
|
||||||
System.out.println("Reading " + fileName);
|
System.out.println("Reading " + fileName);
|
||||||
|
|
|
@ -45,7 +45,7 @@ GTEST_API_ int main(int argc, char **argv) {
|
||||||
|
|
||||||
// resizeMap();
|
// resizeMap();
|
||||||
printf("Success 20201203\r\n");
|
printf("Success 20201203\r\n");
|
||||||
printAllTriggers();
|
exportAllTriggers();
|
||||||
if (focusOnTrigger != TT_UNUSED) {
|
if (focusOnTrigger != TT_UNUSED) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue