-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved arduino code to another folder Completed french part of readme
- Loading branch information
Showing
37 changed files
with
1,531 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
File renamed without changes.
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -xe | ||
|
||
echo "Creating ssl certificates..." | ||
cd ~/.arduinozore/certs >/dev/null 2>/dev/null | ||
yes "" | openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout myserver.crt.key -out myserver.crt.pem >/dev/null 2>/dev/null |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/bin/sh | ||
|
||
set -xe | ||
|
||
echo "Installing static files..." | ||
#semantic | ||
cd ~/.arduinozore/static >/dev/null 2>/dev/null | ||
|
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 @@ | ||
$clean_ext = "xdv"; |
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,68 @@ | ||
ifeq ('$(SOURCE_EXT)', '') | ||
SOURCE_EXT=rst md | ||
endif | ||
SOURCES:=$(foreach ext, $(SOURCE_EXT), $(wildcard *.$(ext))) | ||
ifeq ('$(DEST_EXT)', '') | ||
DEST_EXT=pdf | ||
endif | ||
DESTINATIONS:=$(foreach source, $(SOURCES), $(addsuffix .$(DEST_EXT),$(basename $(source)))) | ||
GENERATED_DIR=generated | ||
|
||
# clean files | ||
CLEAN_EXT=pdf aux fdb_latexmk fls out tex toc xdv | ||
CLEAN_SOURCES:=$(foreach ext, $(CLEAN_EXT), $(wildcard *.$(ext))) | ||
|
||
help: ## Show help | ||
@printf "Technical report Creator using pandoc\ | ||
\n\n\ | ||
Usage : make all \ | ||
SOURCE_EXT=<SOURCE_EXT> \ | ||
DEST_EXT=<DEST_EXT>\n\n\ | ||
SOURCE_EXT: Source file(s) extension.\n\tCan either be rst, md or tex. If not supplied, rst and md files are searched by default.\n\n\ | ||
DEST_EXT: Destination file(s) extension.\n\tCan either be md, tex or pdf. If not supplied, pdf is made by default.\n"; | ||
|
||
.PHONY: all | ||
|
||
all: ${DESTINATIONS} ## Build all rst or md files to pdf | ||
|
||
%.md: %.rst ## Converts from rst to md | ||
pandoc $< \ | ||
--filter tools/rst_filter.py \ | ||
--output $@ | ||
|
||
%.tex: %.rst tools/project_infos.yaml ## Converts from rst to tex | ||
pandoc $< \ | ||
--filter tools/rst_filter.py \ | ||
--lua-filter tools/getMetadata.lua \ | ||
--standalone \ | ||
--listings \ | ||
--to latex \ | ||
--template tools/template.tex \ | ||
--top-level-division section \ | ||
--output $@ | ||
|
||
%.tex: %.md tools/project_infos.yaml ## Converts from md to tex | ||
pandoc $< \ | ||
--filter tools/md_filter.py \ | ||
--lua-filter tools/getMetadata.lua \ | ||
--standalone \ | ||
--listings \ | ||
--to latex \ | ||
--template tools/template.tex \ | ||
--top-level-division section \ | ||
--output $@ | ||
|
||
%.pdf: %.tex ## Converts from tex to pdf | ||
latexmk -pdf -xelatex $< | ||
latexmk -c $< | ||
"C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe" $@ & | ||
|
||
%.json: %.md | ||
pandoc $< --to json --lua-filter=getMetadata.lua | python -m json.tool > ${<:.md=.json} | ||
|
||
|
||
%.json: %.rst | ||
pandoc $< --to json --lua-filter=getMetadata.lua | python -m json.tool > ${<:.rst=.json} | ||
|
||
clean: | ||
rm $(CLEAN_SOURCES) |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,20 @@ | ||
-- read metadata file into string | ||
local metafile = io.open('tools/project_infos.yaml', 'r') | ||
local content = metafile:read("*a") | ||
metafile:close() | ||
-- get metadata | ||
local default_meta = pandoc.read(content, "markdown").meta | ||
|
||
return { | ||
{ | ||
Meta = function(meta) | ||
-- use default metadata field if it hasn't been defined yet. | ||
for k, v in pairs(default_meta) do | ||
if meta[k] == nil then | ||
meta[k] = v | ||
end | ||
end | ||
return meta | ||
end, | ||
} | ||
} |
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,48 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
Pandoc filter to convert all regular text to uppercase. | ||
Code, link URLs, etc. are not affected. | ||
""" | ||
|
||
import re | ||
|
||
from pandocfilters import Image | ||
from pandocfilters import RawInline | ||
from pandocfilters import toJSONFilter | ||
|
||
|
||
def mdFilter(key, value, format, meta): | ||
""" | ||
Filter datas. | ||
First part search for latex reference to figure and writes them | ||
as RawInline thereby backslashes are not escaped. It also removes | ||
the extra $ symbols. | ||
Second part search for images and set a label in the description | ||
in order to be able to make a reference to them. | ||
""" | ||
if key == 'Str': | ||
if re.search("\$ref.*\$", value): | ||
# if we find a link, set it as raw link and re-add a | ||
# backslash before the ref keyword and remote | ||
value = value.replace("$", "") | ||
val = RawInline('latex', "\\" + value) | ||
return val | ||
|
||
if key == 'Image': | ||
[attrs, caption, src] = value | ||
# this means the image label hasn't been modified yet | ||
# (the mardown file doesn't come from a rst file) | ||
if caption[-1]['t'] != 'RawInline': | ||
new_capt = src[0] | ||
# add \label{IMAGE_LABEL} to the picture description | ||
new_desc = "\\" + "label{" + new_capt + "}" | ||
caption.append(RawInline('latex', new_desc)) | ||
return Image(attrs, caption, src) | ||
|
||
|
||
if __name__ == "__main__": | ||
toJSONFilter(mdFilter) |
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,54 @@ | ||
--- | ||
title: Arduinozore | ||
subtitle: Conception OS | ||
lang: fr | ||
language: french | ||
author: | ||
- lastname: Pedretti | ||
firstname: Maël | ||
- lastname: Neto Da Silva | ||
firstname: André | ||
- lastname: Gander | ||
firstname: Laurent | ||
|
||
responsable: | ||
- lastname: Cortinovis | ||
firstname: Claudio | ||
|
||
date: \today | ||
pagesize: a4 | ||
|
||
institut: | ||
name: HE-Arc | ||
logo: img/logo.jpg | ||
logo_scale: 0.6 | ||
|
||
# project_logo: | ||
# project_logo_scale: 0.4 | ||
|
||
# styles | ||
#alignment: <alignment> | ||
fontsize: 12pt | ||
colorlinks: darkblue | ||
|
||
documentclass: scrreprt | ||
documentoptions: twoside | ||
|
||
numbersections: true | ||
|
||
abstractontitlepage: true | ||
|
||
toc: true | ||
toc-depth: 2 | ||
lof: true | ||
|
||
abstract: | | ||
\section*{Résumé} | ||
Le projet Arduinozore a été réalisé dans le cadre du cours de Conception OS, un module de 3ème année de Bachelor au sein de la Haute-École Arc — Ingénierie, section Développement Logiciel et Multimédia. Le présent document décrit l'installation et l'utilisation du logiciel. | ||
Arduinozore est un programme en Python qui permet de visualiser les valeurs de capteurs branchés sur un Arduino et connectés à un ordinateur ou un RaspberryPi. Au travers d'un interface web, il facilite la configuration et la récupération des données. | ||
\section*{Abstract} | ||
The Arduinozore project was realized within the context of the OS conception course, a 3rd year Bachelor module within the Arc-Engineering High School, section Software and Multimedia Development. This document describes the install and use of the software. | ||
Arduinozore is a program in Python that allows you to vizualise datas from sensors wired to an Arduino and connected to a computer or a RaspberryPi. Through a web interface it facilitates the configuration and fetch of datas. | ||
--- |
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,44 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
Pandoc filter to convert all regular text to uppercase. | ||
Code, link URLs, etc. are not affected. | ||
""" | ||
|
||
import re | ||
|
||
from pandocfilters import Image | ||
from pandocfilters import RawInline | ||
from pandocfilters import toJSONFilter | ||
|
||
|
||
def rstFilter(key, value, format, meta): | ||
""" | ||
Filter datas. | ||
First part search for latex reference to figure and writes them | ||
as RawInline thereby backslashes are not escaped. | ||
Second part search for images and set a label in the description | ||
in order to be able to make a reference to them. | ||
""" | ||
if key == 'Str': | ||
if re.search("\$ref", value): | ||
# if we find a link, set it as raw link and re-add a | ||
# backslash before the ref keyword | ||
return RawInline('latex', value[:1] + "\\" + value[1:]) | ||
elif re.search(".*}\$", value): | ||
return RawInline('latex', value) | ||
|
||
elif key == 'Image': | ||
[attrs, caption, src] = value | ||
new_capt = src[0] | ||
# add \label{IMAGE_LABEL} to the picture description | ||
new_desc = "\\" + "label{" + new_capt + "}" | ||
caption.append(RawInline('latex', new_desc)) | ||
return Image(attrs, caption, src) | ||
|
||
|
||
if __name__ == "__main__": | ||
toJSONFilter(rstFilter) |
Oops, something went wrong.