Search in sources :

Example 1 with AbstractMemoryMapParser

use of net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser in project memory-map-plugin by Praqma.

the class MemoryMapParserDelegateTest method findFilePatternWorks_test.

@Test
public void findFilePatternWorks_test() throws IOException {
    MemoryMapMapParserDelegate delegate = new MemoryMapMapParserDelegate();
    MemoryMapGraphConfiguration gc = new MemoryMapGraphConfiguration(null, null);
    gc.setGraphDataList("CODE,DATA,CONST");
    gc.setGraphCaption("Config Memory Graph");
    List<MemoryMapGraphConfiguration> graphConfig = Collections.singletonList(gc);
    AbstractMemoryMapParser parser = new TexasInstrumentsMemoryMapParser("TI", "TexasInstrumentsMapFile.txt", "28069_RAM_lnk.cmd", 16, graphConfig, Boolean.TRUE);
    List<AbstractMemoryMapParser> parsers = Collections.singletonList(parser);
    delegate.setParsers(parsers);
    assertNotNull(delegate.getParsers());
    assertNotNull(parser.getMapFile());
    File test = new File(file.getAbsolutePath().substring(0, file.getAbsolutePath().lastIndexOf(File.separator)));
    assertTrue(test.isDirectory());
    try {
        delegate.findFile(test, "*.map");
    } catch (Exception ex) {
        fail("Parser did not find the file" + ex);
    }
}
Also used : MemoryMapGraphConfiguration(net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration) TexasInstrumentsMemoryMapParser(net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser) AbstractMemoryMapParser(net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser) File(java.io.File) MemoryMapMapParserDelegate(net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate) IOException(java.io.IOException) Test(org.junit.Test)

Example 2 with AbstractMemoryMapParser

use of net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser in project memory-map-plugin by Praqma.

the class MemoryMapJobDslContext method parser.

public void parser(String parserType, String parserUniqueName, String commandFile, String mapFile, Runnable closure) {
    checkArgument(parserTypes.contains(parserType), "Parser type must be one of " + parserTypes);
    MemoryMapParserDslContext context = new MemoryMapParserDslContext();
    executeInContext(closure, context);
    AbstractMemoryMapParser parser = null;
    switch(parserType) {
        case "GCC":
            parser = new GccMemoryMapParser(parserUniqueName, mapFile, commandFile, wordSize, showBytesOnGraphs, context.graphConfigurations);
            break;
        case "TI":
            parser = new TexasInstrumentsMemoryMapParser(parserUniqueName, mapFile, commandFile, wordSize, context.graphConfigurations, showBytesOnGraphs);
            break;
        default:
            System.out.println("Unable to allocate parser: " + parserType);
            break;
    }
    if (parser != null) {
        parser.setParserTitle(context.parserTitle);
        parsers.add(parser);
    }
}
Also used : TexasInstrumentsMemoryMapParser(net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser) AbstractMemoryMapParser(net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser) GccMemoryMapParser(net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser)

Example 3 with AbstractMemoryMapParser

use of net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser in project memory-map-plugin by Praqma.

the class MemoryMapProjectAction method getAssociatedMemoryAreas.

public String getAssociatedMemoryAreas(String graphTitle, String id) {
    String result = null;
    List<AbstractMemoryMapParser> parsers = parsersChosen();
    for (AbstractMemoryMapParser parser : parsers) {
        if (parser.getParserUniqueName().equals(id)) {
            for (MemoryMapGraphConfiguration conf : parser.getGraphConfiguration()) {
                if (conf.getGraphCaption().equals(graphTitle)) {
                    result = conf.getGraphDataList();
                }
            }
        }
    }
    return result;
}
Also used : MemoryMapGraphConfiguration(net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration) AbstractMemoryMapParser(net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser)

Example 4 with AbstractMemoryMapParser

use of net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser in project memory-map-plugin by Praqma.

the class MemoryMapProjectAction method getGraphTitles.

public List<String> getGraphTitles() {
    ArrayList<String> titles = new ArrayList<>();
    List<AbstractMemoryMapParser> parsers = parsersChosen();
    for (AbstractMemoryMapParser parser : parsers) {
        List<MemoryMapGraphConfiguration> graphConfigurations = parser.getGraphConfiguration();
        for (MemoryMapGraphConfiguration gc : graphConfigurations) {
            titles.add(gc.getGraphCaption());
        }
    }
    return titles;
}
Also used : MemoryMapGraphConfiguration(net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration) ArrayList(java.util.ArrayList) AbstractMemoryMapParser(net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser)

Example 5 with AbstractMemoryMapParser

use of net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser in project memory-map-plugin by Praqma.

the class MemoryMapProjectAction method getGraphTitles.

public List<String> getGraphTitles(String parserId) {
    List<String> graphTitles = new ArrayList<>();
    List<AbstractMemoryMapParser> parsers = parsersChosen();
    for (AbstractMemoryMapParser parser : parsers) {
        if (parser.getParserUniqueName().equals(parserId)) {
            for (MemoryMapGraphConfiguration conf : parser.getGraphConfiguration()) {
                graphTitles.add(conf.getGraphCaption());
            }
        }
    }
    return graphTitles;
}
Also used : MemoryMapGraphConfiguration(net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration) ArrayList(java.util.ArrayList) AbstractMemoryMapParser(net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser)

Aggregations

AbstractMemoryMapParser (net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser)5 MemoryMapGraphConfiguration (net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration)4 ArrayList (java.util.ArrayList)2 TexasInstrumentsMemoryMapParser (net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser)2 File (java.io.File)1 IOException (java.io.IOException)1 MemoryMapMapParserDelegate (net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate)1 GccMemoryMapParser (net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser)1 Test (org.junit.Test)1