Skip to content
Snippets Groups Projects
Commit 0e7b787a authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

Updating avatar model checker documentation

parent a8140871
No related branches found
No related tags found
No related merge requests found
# Tools
LATEXFLAGS ?= -interaction=nonstopmode -file-line-error
PDFLATEX = pdflatex $(LATEXFLAGS)
BIBTEX =
FIG2DEV = fig2dev
RUBBER ?= $(shell which rubber 2> /dev/null)
RUBBERFLAGS = --pdf --short --warn refs --warn misc
# Files and directories FIGDIR := fig
FIGDIR = figures BUILDDIR := build
FIGS = $(wildcard $(FIGDIR)/*.fig)
FIGPDFS = $(patsubst $(FIGDIR)/%.fig,$(FIGDIR)/%.pdf,$(FIGURES))
FIGPDFTS = $(patsubst $(FIGDIR)/%.fig,$(FIGDIR)/%.pdf_t,$(FIGURES))
FIGURES = $(filter-out $(FIGS) $(FIGPDFS) $(FIGPDFTS), $(wildcard $(FIGDIR)/*))
JOB = ttool_avatarmodelchecker include ../mli.mk
TEXS = $(wildcard *.tex) $(wildcard *.sty) $(wildcard *.cls)
PICS = $(wildcard *.png) $(filter-out $(JOB).pdf,$(wildcard *.pdf))
BIBS = $(wildcard *.bib) $(wildcard *.bst)
TOPS = $(shell grep -l '[^%]*\\begin{document}' *.tex) $(BUILDDIR)/sysmlsec_documentation.pdf: $(FIGURES)
PDFTARGETS = $(patsubst %.tex,%.pdf,$(TOPS))
TARGETS = $(patsubst %.tex,%,$(TOPS))
.DEFAULT: help
.PHONY: all help clean ultraclean
help:
@echo '----------------------------------------------------------------'; \
echo 'available targets:'; \
echo ' "make" or "make help": print this help'; \
echo ' "make foo" or "make foo.pdf": build the foo.pdf document'; \
echo ' "make all": build all documents'; \
echo ' "make clean": delete non-essential generated files'; \
echo ' "make ultraclean": delete all generated files'; \
echo '----------------------------------------------------------------'; \
echo 'Buildable documents:'; \
echo -n $(sort $(TARGETS)) | sed -e 's/\([^ ]\+\) */ \1\n/g'; \
echo '----------------------------------------------------------------'; \
echo 'if you encounter problems please contact:'; \
echo ' Renaud Pacalet <renaud.pacalet@telecom-paristech.fr>'; \
echo '----------------------------------------------------------------'
all: $(PDFTARGETS)
$(TARGETS): % : %.pdf
ifeq ($(RUBBER),)
# Bootstrap aux file, then keep running pdflatex until it reaches a fixpoint
$(JOB).aux: | $(TEXS) $(PICS)
$(PDFLATEX) $(JOB)
$(JOB).bbl: $(JOB).aux $(BIBS)
$(BIBTEX) $(JOB)
$(JOB).pdf: $(TEXS) $(PICS) $(JOB).aux $(JOB).bbl
@cp -p $(JOB).aux $(JOB).aux.bak
$(PDFLATEX) $(JOB)
@if cmp -s $(JOB).aux $(JOB).aux.bak; \
then touch -r $(JOB).aux.bak $(JOB).aux; \
else NEWS="$$NEWS -W $(JOB).aux"; fi; rm $(JOB).aux.bak; \
if [ -n "$$NEWS" ]; then $(MAKE) $$NEWS $@; fi
$(FIGDIR)/%.pdf: $(FIGDIR)/%.fig
$(FIG2DEV) -L pdftex $< $@
$(FIGDIR)/%.pdf_t: $(FIGDIR)/%.fig $(FIGDIR)/%.pdf
$(FIG2DEV) -L pdftex_t -p $(patsubst %.pdf_t,%.pdf,$@) $< $@
clean:
rm -f $(JOB).aux $(JOB).log $(JOB).blg $(JOB).bbl $(JOB).out $(JOB).pdf
else
.NOTPARALLEL:
.PHONY: $(PDFTARGETS)
$(PDFTARGETS): %.pdf: %.tex
@$(RUBBER) $(RUBBERFLAGS) $<
clean:
@$(RUBBER) $(RUBBERFLAGS) --clean $(TOPS)
endif
This diff is collapsed.
...@@ -40,11 +40,15 @@ ...@@ -40,11 +40,15 @@
package cli; package cli;
import common.ConfigurationTTool; import common.ConfigurationTTool;
import launcher.LauncherException;
import launcher.RTLLauncher; import launcher.RTLLauncher;
import launcher.RshClient;
import myutil.Conversion; import myutil.Conversion;
import myutil.IntExpressionEvaluator; import myutil.IntExpressionEvaluator;
import myutil.PluginManager; import myutil.PluginManager;
import myutil.TraceManager; import myutil.TraceManager;
import remotesimulation.RemoteConnection;
import remotesimulation.RemoteConnectionException;
import ui.MainGUI; import ui.MainGUI;
import ui.util.IconManager; import ui.util.IconManager;
import avatartranslator.*; import avatartranslator.*;
...@@ -64,6 +68,7 @@ import java.util.*; ...@@ -64,6 +68,7 @@ import java.util.*;
public class SimulatorScript extends Command { public class SimulatorScript extends Command {
public SimulatorScript() { public SimulatorScript() {
} }
...@@ -80,7 +85,7 @@ public class SimulatorScript extends Command { ...@@ -80,7 +85,7 @@ public class SimulatorScript extends Command {
return "sc"; return "sc";
} }
public String getUsage() { return "simulatorscript <simulatorexecutable> <inputFile> <outputFile>"; } public String getUsage() { return "simulatorscript <path_to_simulator_executable> <inputFile> <outputFile>"; }
public String getDescription() { return "Starting a simulation script test. Reserved for Development purpose"; } public String getDescription() { return "Starting a simulation script test. Reserved for Development purpose"; }
...@@ -91,8 +96,11 @@ public class SimulatorScript extends Command { ...@@ -91,8 +96,11 @@ public class SimulatorScript extends Command {
public String executeCommand(String command, Interpreter interpreter) { public String executeCommand(String command, Interpreter interpreter) {
try { try {
executeSimulatorScript(); String[] commands = command.split(" ");
return null; if (commands.length < 3) {
return Interpreter.BAD;
}
return executeSimulatorScript(commands[0], commands[1], commands[2], interpreter);
} catch (Exception e) { } catch (Exception e) {
TraceManager.addDev("Exception: " + e.getMessage()); TraceManager.addDev("Exception: " + e.getMessage());
return "Test failed"; return "Test failed";
...@@ -105,14 +113,43 @@ public class SimulatorScript extends Command { ...@@ -105,14 +113,43 @@ public class SimulatorScript extends Command {
} }
private void executeSimulatorScript() { private String executeSimulatorScript(String simuPath, String file1, String file2, Interpreter interpreter) throws java.io.IOException, java
// starts simulation .lang.InterruptedException {
// Checking arguments
// Test all files
File simuFile = new File(simuPath);
if (!simuFile.exists()) {
return interpreter.BAD_FILE_NAME + ": " + simuPath;
}
File inputFile = new File(file1);
if (!simuFile.exists()) {
return interpreter.BAD_FILE_NAME + ": " + file1;
}
// If the output file does not exist, its is not important: we create it!
File outputFile = new File(file2);
// connects to the simulator // Starts simulation
Process simuProcess = Runtime.getRuntime().exec(simuPath + " -server");
// Wait for one second
Thread.sleep(1000);
// Connects to the simulator
RemoteConnection rc = new RemoteConnection("localhost");
try {
rc.connect();
} catch (RemoteConnectionException rce) {
return "Could not connect";
}
// Opens the two files // Opens the two files
// Loop: as soon as there is a new input, read it, see if value change -> compute // Loop: as soon as there is a new input, read it, see if value change -> compute
// simulation time. Append this simulation time to the output file // simulation time. Append this simulation time to the output file
// To compute the simulation time: simulate until read time. Erase all past transactions // To compute the simulation time: simulate until read time. Erase all past transactions
...@@ -121,9 +158,11 @@ public class SimulatorScript extends Command { ...@@ -121,9 +158,11 @@ public class SimulatorScript extends Command {
// Then execute until event2. Note the new time time2. Compute (time2-time1) // Then execute until event2. Note the new time time2. Compute (time2-time1)
// append time2-time1 to the output file // append time2-time1 to the output file
return null;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment