mirror of https://github.com/rusefi/rusefi-1.git
trigger image progress
This commit is contained in:
parent
923a5e97a2
commit
5db803a2bd
|
@ -384,21 +384,21 @@ void printAllTriggers() {
|
||||||
TriggerShape *s = &engine->triggerCentral.triggerShape;
|
TriggerShape *s = &engine->triggerCentral.triggerShape;
|
||||||
s->initializeTriggerShape(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
s->initializeTriggerShape(NULL PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
fprintf(fp, "TRIGGERTYPE %d %d %s %.2f\r\n", triggerId, s->getLength(), getTrigger_type_e(tt), s->tdcPosition);
|
fprintf(fp, "TRIGGERTYPE %d %d %s %.2f\n", triggerId, s->getLength(), getTrigger_type_e(tt), s->tdcPosition);
|
||||||
|
|
||||||
fprintf(fp, "# duty %.2f %.2f\r\n", s->expectedDutyCycle[0], s->expectedDutyCycle[1]);
|
fprintf(fp, "# duty %.2f %.2f\n", s->expectedDutyCycle[0], s->expectedDutyCycle[1]);
|
||||||
|
|
||||||
for (int i = 0; i < s->getLength(); i++) {
|
for (int i = 0; i < s->getLength(); i++) {
|
||||||
|
|
||||||
int triggerDefinitionCoordinate = (s->getTriggerShapeSynchPointIndex() + i) % s->getSize();
|
int triggerDefinitionCoordinate = (s->getTriggerShapeSynchPointIndex() + i) % s->getSize();
|
||||||
|
|
||||||
|
|
||||||
fprintf(fp, "event %d %d %.2f\r\n", i, s->triggerSignals[triggerDefinitionCoordinate], s->eventAngles[i]);
|
fprintf(fp, "event %d %d %.2f\n", i, s->triggerSignals[triggerDefinitionCoordinate], s->eventAngles[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
printf("All triggers exported to %s\r\n", TRIGGERS_FILE_NAME);
|
printf("All triggers exported to %s\n", TRIGGERS_FILE_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -65,8 +65,10 @@ public class TriggerImage {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void generateImages(String workingFolder, TriggerPanel trigger) throws IOException {
|
private static void generateImages(String workingFolder, TriggerPanel trigger) throws IOException {
|
||||||
BufferedReader br = new BufferedReader(new FileReader(workingFolder + File.separator + INPUT_FILE_NAME));
|
String fileName = workingFolder + File.separator + INPUT_FILE_NAME;
|
||||||
|
BufferedReader br = new BufferedReader(new FileReader(fileName));
|
||||||
|
|
||||||
|
System.out.println("Reading " + fileName);
|
||||||
String line;
|
String line;
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
if (line.trim().startsWith("#")) {
|
if (line.trim().startsWith("#")) {
|
||||||
|
@ -85,6 +87,7 @@ public class TriggerImage {
|
||||||
String idStr = tokens[1];
|
String idStr = tokens[1];
|
||||||
String eventCountStr = tokens[2];
|
String eventCountStr = tokens[2];
|
||||||
String triggerName = tokens[3];
|
String triggerName = tokens[3];
|
||||||
|
System.out.println("Processing " + line + " " + idStr);
|
||||||
triggerPanel.tdcPosition = Double.parseDouble(tokens[4]);
|
triggerPanel.tdcPosition = Double.parseDouble(tokens[4]);
|
||||||
int eventCount = Integer.parseInt(eventCountStr);
|
int eventCount = Integer.parseInt(eventCountStr);
|
||||||
int id = Integer.parseInt(idStr);
|
int id = Integer.parseInt(idStr);
|
||||||
|
@ -152,6 +155,8 @@ public class TriggerImage {
|
||||||
if (line.trim().startsWith("#"))
|
if (line.trim().startsWith("#"))
|
||||||
continue;
|
continue;
|
||||||
tokens = line.split(" ");
|
tokens = line.split(" ");
|
||||||
|
if (tokens.length < 4)
|
||||||
|
throw new IllegalStateException("Unexpected [" + line + "]");
|
||||||
String signalStr = tokens[2];
|
String signalStr = tokens[2];
|
||||||
int signal = Integer.parseInt(signalStr);
|
int signal = Integer.parseInt(signalStr);
|
||||||
String angleStr = tokens[3];
|
String angleStr = tokens[3];
|
||||||
|
|
|
@ -44,6 +44,7 @@ public class UiUtils {
|
||||||
|
|
||||||
public static void saveImage(String fileName, Component component) {
|
public static void saveImage(String fileName, Component component) {
|
||||||
BufferedImage img = getScreenShot(component);
|
BufferedImage img = getScreenShot(component);
|
||||||
|
System.out.println("Saving " + fileName);
|
||||||
try {
|
try {
|
||||||
ImageIO.write(img, "png", new File(fileName));
|
ImageIO.write(img, "png", new File(fileName));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
.dep*
|
.dep*
|
||||||
build/
|
build/
|
||||||
triggers.txt
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue