Étape 4: Non - problème 4: le logiciel d’écriture
Je travaille sur des logiciels 3D temps réel beaucoup, ce qui signifie que je suis habitué à faire des choses qui ne fonctionnent pas dans un premier temps et puis après que j’ai débogué, encore ne fonctionnent pas. Je suis habitué à regarder un écran plein de texte avec une marque de ponctuation unique hors de propos, s’arrêtant tout et incapable de déceler, à 03:00.
Ce que j’avais ici était un programme qui permettrait de construire et de positionner tous les engrenages pour moi automatiquement, basée sur le nombre de dents et d’autres infos que j’ai fourni. En outre, il faut prendre aux dates de naissance des deux personnes et de construire les engins spécifiquement pour pointer les aiguilles dans le bon sens pour eux. Tout cela finit par prendre un certain temps.
J’ai écrit le logiciel en C++, en utilisant un cadre appelé Qt pour gagner du temps sur la partie « boutons et windows » standard. (Soit dit en passant, depuis de HotSharpToxic chose de rouge à lèvres qui se passait dans le même temps, j’ai décidé de faire un programme qui fait les deux, pour gagner du temps.)
Pour ce logiciel travailler, j’avais besoin d’un format pour stocker une description d’une machine à engrenage.
De cette façon je peux changer la spécification pour salir avec la machine, au lieu du code C++.
Le format de fichier texte, que j’ai choisi est bancal et laid, mais très vite fait le travail.
La description paramétrique complète pour les engrenages de la machine est ici :
(Même si vous n’êtes pas un programmeur, vous pouvez probablement chercher certaines parties.
La clé est le groupe de mots juste après la section "expr".)
//______________________________________________________________________
GearMachine.tsu - Bio gear machine, version 49 b
//
Expr, épaisseur, 0,3
Expr, extraThick, (1.0 * épaisseur)
Expr, stackOffset, (1,25 * épaisseur)
Expr, toothSize, 0,30
Expr, axleDiameter, 0,5
Gear, id, numTeeth, toothSize, épaisseur, axleDiameter, addAxle, u1, u2, v1, v2
image, gears/plainGear1.png
Expr, baseDrop, -0,5
Expr, timeAngle, 0,0
Expr, Florian, 220,0
Expr, emoArch1Angle, (Alain - 60,0)
Expr, emoArch2Angle, (Alain + 60,0)
vitesses réelles sont inférieures à
nom dents toothSize épaisseur axleDiameter verticalOff parent connecter angle inclinaison backWidth backOffset stackOffCenter fixArrowLen fixArrowAngle fixArrowOffset topAxleExtend bottomAxleExtend
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Gear, rootGear89, 89, toothSize, extraThick, axleDiameter, 0,0, zéro, empiler, 0.0, 0.0, 1.00, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, rootGear79, 79, toothSize, extraThick, axleDiameter, stackOffset, rootGear89, empiler, 0.0, 0.0, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, 3monthStandoff, 18, toothSize, épaisseur, axleDiameter, 0,0, rootGear79, lien, timeAngle, 0.0, 1.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, 3monthStandoff2, 18, toothSize, épaisseur, axleDiameter, 4.5, 3monthStandoff, empiler, 0.0, 0.0, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, 3months55, 55, toothSize, épaisseur, axleDiameter, 0,0, 3monthStandoff2, lier, 180,0, 0,0, 0.00, -1.0, 0.0, 10.0, 0,0, 0,3, 0,3, 0,0
Gear, 3months55, 55, toothSize, épaisseur, axleDiameter, 0,0, rootGear79, lier, 0,0, 110.0, 0.00, -1,0, 0,0, 10.0, 0,0, 0,3, 0,3, 0,0
Gear, 3months10, 10, toothSize, épaisseur, axleDiameter, (-1,0 * stackOffset), 3months55, empiler, 0.0, 0.0, 2.50, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, monthsToYears30, 30, toothSize, épaisseur, axleDiameter, 0,0, 3months10, lier,-130.0, 0,0, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, monthsToYears10, 10, toothSize, épaisseur, axleDiameter, (-1,5 * stackOffset), monthsToYears30, empiler, 0.0, 0.0, 2.50, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, 3years40, 40, toothSize, épaisseur, axleDiameter, 0,0, monthsToYears10, lier, 90,0 0,0, 0.00, 0.0, 0.0, 7.0, 0,0, 0,3, 0,3, 0,0
Gear, 3years10, 10, toothSize, épaisseur, axleDiameter, (-3,0 * stackOffset), 3years40, empiler, 0.0, 0.0, 2.50, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, yearsToCentury60, 60, toothSize, épaisseur, axleDiameter, 0,0, 3years10, lier, 123,0, 0,0, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, yearsToCentury10, 10, toothSize, épaisseur, axleDiameter, (-2.0 * stackOffset), yearsToCentury60, empiler, 0.0, 0.0, 2.50, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, century60, 60, toothSize, épaisseur, axleDiameter, 0,0, yearsToCentury10, lier, 180,0, 0,0, 1.00, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, emoStandoff, 10, toothSize, épaisseur, axleDiameter, 0,0, rootGear89, lien, Florian, 68,0, 1.00, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, emotional19, 19, toothSize, épaisseur, axleDiameter, 0,0, emoStandoff, lier, 0,0, 68,0, 1.50, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, emotional19, 19, toothSize, épaisseur, axleDiameter, 0,0, rootGear89, lier, 120,0, 120,0, 1.50, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, emotional28, 28, toothSize, épaisseur, - stackOffset, axleDiameter, emotional19, empiler, 0.0, 0.0, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, physical23, 23, toothSize, épaisseur, axleDiameter, 0,0, emotional28, lier, -90.0, 0,0, 1.50, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, intellectual33, 33, toothSize, épaisseur, axleDiameter, 0,0, emotional28, lier, 90,0, 0,0, 1.50, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Gear, [emotionalArrow], 10, toothSize, épaisseur, axleDiameter, -0,21, emotional28, lier, 0,0, 0,0, 1.50, -0,1, 0,0, 0,0, 0.0, 0.0, 0.0, 0,6
Gear, [physicalArrow], 10, toothSize, épaisseur, axleDiameter, 0,0, physical23, lier, 90,0, 0,0, 1.50, -0,1, 0,0, 0,0, 0.0, 0.0, 0.0, 0,6
Gear, [intellectualArrow], 10, toothSize, épaisseur, axleDiameter, 0,0, intellectual33, lier, -90.0, 0,0, 1.50, -0,1, 0,0, 0,0, 0.0, 0.0, 0.0, 0,6
_________________________________________________________________________________