-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* stub sd logs * framing for SD log output * make old and new match * only grab one struct, prefix * sd log seems to just work? * wiring * wiring * wiring * array-of-struct handling * handle array of struct * array of structs doesn't really work right * sd log end file
- Loading branch information
Showing
8 changed files
with
152 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...tools/configuration_definition/src/main/java/com/rusefi/newparse/outputs/SdLogWriter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.rusefi.newparse.outputs; | ||
|
||
import com.rusefi.newparse.ParseState; | ||
import com.rusefi.newparse.layout.StructLayout; | ||
import com.rusefi.newparse.parsing.Struct; | ||
|
||
import java.io.FileNotFoundException; | ||
import java.io.FileOutputStream; | ||
import java.io.PrintStream; | ||
|
||
public class SdLogWriter { | ||
private final PrintStream ps; | ||
|
||
public SdLogWriter(String outputFile) throws FileNotFoundException { | ||
this(new PrintStreamAlwaysUnix(new FileOutputStream(outputFile))); | ||
} | ||
|
||
public SdLogWriter(PrintStream ps) { | ||
this.ps = ps; | ||
|
||
ps.println("static constexpr LogField fields[] = {"); | ||
ps.println("\t{packedTime, GAUGE_NAME_TIME, \"sec\", 0},"); | ||
} | ||
|
||
public void endFile() { | ||
ps.println("};"); | ||
} | ||
|
||
public void writeSdLogs(ParseState parser, String sourceName) { | ||
// Assume the last struct is the one we want... | ||
Struct s = parser.getStructs().get(parser.getStructs().size() - 1); | ||
|
||
StructLayout sl = new StructLayout(0, "root", s); | ||
sl.writeSdLogLayout(ps, sourceName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters