Skip to content
Snippets Groups Projects
Commit 3c1d831c authored by Jean-Marie  FAVREAU's avatar Jean-Marie FAVREAU
Browse files

Intégration des modifications suggérées il y a quelques mois (fin)

parent 92b84230
No related branches found
No related tags found
No related merge requests found
......@@ -17,8 +17,8 @@ class GenerateurExercice(GammeTemperee):
GammeTemperee.__init__(self, bpm)
self.dureeFrappe = dureeFrappe
self.margeDocument = 1.0
self.margeDuree = 0.5
self.margeFrequence = 50
self.margeDuree = 0.
self.margeFrequence = 100
self.margeFrequenceLegende = 20
self.margeLegende = 2.0
......@@ -330,7 +330,7 @@ class GenerateurExercice(GammeTemperee):
return result
def lignesVerticales(self):
def lignesVerticales(self, premier = False):
result = ""
espace = self.doublecroche
......@@ -338,14 +338,15 @@ class GenerateurExercice(GammeTemperee):
nbsteps = int(self.duree / espace) + 1
for i in range(0, nbsteps):
h = i * espace
hinc = self.dureeEnCm(h + self.margeDuree)
if i % 4 == 0:
result += "\draw[lightgray, ultra thin] (" + str(hinc) + ", 0) -- ";
else:
result += "\draw[lightgray!30, ultra thin] (" + str(hinc) + ", 0) -- ";
result += "(" + str(hinc) + ", " + str(self.hauteur) + ");\n";
if i != 0 or premier:
h = i * espace
hinc = self.dureeEnCm(h + self.margeDuree)
if i % 4 == 0:
result += "\draw[lightgray, ultra thin] (" + str(hinc) + ", 0) -- ";
else:
result += "\draw[lightgray!30, ultra thin] (" + str(hinc) + ", 0) -- ";
result += "(" + str(hinc) + ", " + str(self.hauteur) + ");\n";
return result
def lignesHorizontales(self, partitions):
......@@ -375,9 +376,15 @@ class GenerateurExercice(GammeTemperee):
result += "\\begin{tikzpicture}[]"
# lignes verticales
result += self.lignesVerticales()
# lignes horizontales
result += self.lignesHorizontales(partitions)
# axe des abscisses
result += "\draw[->, black] (0, 0) -- ";
result += "(" + str(self.largeur) + ", 0) node[below]{durée (s)};\n";
result += "(" + str(self.largeur) + ", 0) node[below]{temps (s)};\n";
# axe des ordonnées
result += "\draw[black, dashed] (0, 0) -- ";
......@@ -385,11 +392,6 @@ class GenerateurExercice(GammeTemperee):
result += "\draw[->, black] (0, " + str(self.frequenceEnCm(self.fmin)) + ") -- ";
result += "(0," + str(self.hauteur) + ") node[above]{fréquence (Hz)};\n";
# lignes verticales
result += self.lignesVerticales()
# lignes horizontales
result += self.lignesHorizontales(partitions)
# gradations sur les axes
result += self.graduationAbscisses()
......
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