4
« le: novembre 12, 2020, 05:18:27 pm »
Bonjour Pierre,
Avec un ami nous avons créé un TCO complet (ou presque !)
Nous avons un petit souci sur l'un des pavés, le TJD.
Sur le principe ci-joint, comment rendre automatique la définition des divers options de direction de ce pavé.
/*=========================================================================
// Remplissage de la table de branchement Pave L/C > macro pour Arduino
'*========================================================================
*/
int paveIndex = 0;
//--------------------------------------------------- Début collage Excel
public paveLcClic[] paveClic = new paveLcClic[73];
void paveLcClickPopulateArray()
{
paveClic[0] = new paveLcClic ("G1", paveTypeAiguille, 16, 7, "D", "G1");
paveClic[1] = new paveLcClic ("A1", paveTypeAiguille, 16, 10, "D", "A1");
paveClic[2] = new paveLcClic ("A3", paveTypeAiguille, 16, 11, "D", "A3");
paveClic[3] = new paveLcClic ("B1", paveTypeAiguille, 17, 8, "D", "B1");
paveClic[4] = new paveLcClic ("B3", paveTypeAiguille, 18, 8, "D", "B3");
paveClic[5] = new paveLcClic ("A2", paveTypeAiguille, 17, 10, "D", "A2");
paveClic[6] = new paveLcClic ("A4", paveTypeAiguille, 17, 11, "D", "A4");
paveClic[7] = new paveLcClic ("B2", paveTypeAiguille, 17, 9, "D", "B2");
paveClic[8] = new paveLcClic ("B4", paveTypeAiguille, 18, 9, "D", "B4");
paveClic[9] = new paveLcClic ("AV", paveTypeAiguille, 16, 22, "D", "AV");
paveClic[10] = new paveLcClic ("CR1", paveTypeAiguilleDouble, 15, 8, "DD", "CR1"); // CR1 POSE DES PROBLEMES
paveClic[11] = new paveLcClic ("DAt2", paveTypeAiguille, 7, 14, "D", "DAt2"); // remplace le croisement CR2
paveClic[12] = new paveLcClic ("DAt1", paveTypeAiguille, 8, 13, "D", "DAt1"); // remplace le croisement CR2
paveClic[13] = new paveLcClic ("TRI1", paveTypeAiguille, 15, 14, "D", "TRI1");
paveClic[14] = new paveLcClic ("TRI2", paveTypeAiguille, 15, 12, "D", "TRI2");
paveClic[15] = new paveLcClic ("TRI3", paveTypeAiguille, 15, 10, "D", "TRI3");
paveClic[16] = new paveLcClic ("TRI4", paveTypeAiguille, 14, 9, "D", "TRI4");
paveClic[17] = new paveLcClic ("TRI5", paveTypeAiguille, 13, 10, "D", "TRI5");
paveClic[18] = new paveLcClic ("TRI6", paveTypeAiguille, 10, 12, "D", "TRI6");
paveClic[19] = new paveLcClic ("TRI3A", paveTypeAiguille, 11, 14, "D", "TRI3A");
paveClic[20] = new paveLcClic ("TRI4A", paveTypeAiguille, 11, 13, "D", "TRI4A");
paveClic[21] = new paveLcClic ("F3-1", paveTypeFeuTricolore, 5, 7, "VERT", "F3-1");
paveClic[22] = new paveLcClic ("F3-2", paveTypeFeuTricolore, 4, 6, "VERT", "F3-2");
paveClic[23] = new paveLcClic ("F3-3", paveTypeFeuTricolore, 3, 5, "VERT", "F3-3");
paveClic[24] = new paveLcClic ("F4", paveTypeFeuTricolore, 15, 20, "ROUGE", "F4");
paveClic[25] = new paveLcClic ("F1-4", paveTypeFeuTricolore, 16, 6, "VERT", "F1-4");
paveClic[26] = new paveLcClic ("F2-4", paveTypeFeuTricolore, 17, 7, "VERT", "F2-4");
paveClic[27] = new paveLcClic ("F3-4", paveTypeFeuTricolore, 18, 7, "VERT", "F3-4");
paveClic[28] = new paveLcClic ("PS3-1", paveTypeFeuTricolore, 5, 12, "BLANC", "PS3-1"); // ok
paveClic[29] = new paveLcClic ("PS3-2", paveTypeFeuTricolore, 4, 11, "BLANC", "PS3-2"); // ok
paveClic[30] = new paveLcClic ("PS3-3", paveTypeFeuTricolore, 3, 10, "BLANC", "PS3-3"); // ok
paveClic[31] = new paveLcClic ("PS1-4", paveTypeFeuTricolore, 13, 3, "BLANC", "PS1-4"); // ok
paveClic[32] = new paveLcClic ("PS2-4", paveTypeFeuTricolore, 14, 2, "BLANC", "PS2-4"); // ok
paveClic[33] = new paveLcClic ("PS3-4", paveTypeFeuTricolore, 15, 1, "BLANC", "PS3-4"); // ok
paveClic[34] = new paveLcClic ("F1-1", paveTypeFeuTricolore, 16, 23, "VERT", "F1-1");
paveClic[35] = new paveLcClic ("F1-2", paveTypeFeuTricolore, 17, 23, "VERT", "F1-2");
paveClic[36] = new paveLcClic ("F1-3", paveTypeFeuTricolore, 18, 23, "VERT", "F1-3");
paveClic[37] = new paveLcClic ("F2-1", paveTypeFeuTricolore, 6, 26, "VERT", "F2-1");
paveClic[38] = new paveLcClic ("F2-2", paveTypeFeuTricolore, 5, 27, "VERT", "F2-2");
paveClic[39] = new paveLcClic ("F2-3", paveTypeFeuTricolore, 4, 28, "VERT", "F2-3");
paveClic[40] = new paveLcClic ("PS2-1", paveTypeFeuTricolore, 10, 26, "BLANC", "PS2-1"); // ok
paveClic[41] = new paveLcClic ("PS2-2", paveTypeFeuTricolore, 9, 27, "BLANC", "PS2-2"); // ok
paveClic[42] = new paveLcClic ("PS2-3", paveTypeFeuTricolore, 8, 28, "BLANC", "PS2-3"); // ok
paveClic[43] = new paveLcClic ("C1V1", paveTypeBoutonPoussoir, 20, 1, "-", "G1_D, A1_D,A2_D, AV_D, F4_ROUGE");
paveClic[44] = new paveLcClic ("C1V2", paveTypeBoutonPoussoir, 21, 1, "-", "G1_D, A1_O, A4_O, F2-4_ROUGE, PS2-4_JAUNE");
paveClic[45] = new paveLcClic ("C2V1", paveTypeBoutonPoussoir, 20, 4, "-", "B1_D, B2_D, A3_O, A2_O, AV_D, F1-4_ROUGE, PS1-4_JAUNE");
paveClic[46] = new paveLcClic ("C2V2", paveTypeBoutonPoussoir, 21, 4, "-", "B1_D, B2_D, A3_D, A4_D");
paveClic[47] = new paveLcClic ("C2V3", paveTypeBoutonPoussoir, 22, 4, "-", "B1_O, B4_O, F3-4_ROUGE, PS3-4_JAUNE");
paveClic[48] = new paveLcClic ("C3V1", paveTypeBoutonPoussoir, 20, 7, "-", "B3_O, B2_O, A3_O, A2_O, AV_D, F2-4_ROUGE, PS2-4_JAUNE, F1-4_ROUGE, PS1-4_JAUNE, F4_ROUGE ");
paveClic[49] = new paveLcClic ("C3V2", paveTypeBoutonPoussoir, 21, 7, "-", "B3_O, B2_O, A3_D, A4_D, F2-4_ROUGE, PS2-4_JAUNE");
paveClic[50] = new paveLcClic ("C3V3", paveTypeBoutonPoussoir, 22, 7, "-", "B3_D, B4_D ");
paveClic[51] = new paveLcClic ("C1T1", paveTypeBoutonPoussoir, 20, 10, "-", "G1_O,CR1_C_B,Tri3_D,Tri2_D,Tri1_O"); // CR1 POSE DES PROBLEMES
paveClic[52] = new paveLcClic ("C1T2", paveTypeBoutonPoussoir, 20, 13, "-", "G1_O,CR1_C_B,Tri3_D,Tri2_D"); // CR1 POSE DES PROBLEMES
paveClic[53] = new paveLcClic ("C1T3", paveTypeBoutonPoussoir, 21, 10, "-", "G1_O,CR1_C_B,Tri3_O,Tri3a_D"); // CR1 POSE DES PROBLEMES
paveClic[54] = new paveLcClic ("C1T4", paveTypeBoutonPoussoir, 21, 13, "-", "G1_O,CR1_C_D,Tri4_O,Tri4a_D"); // CR1 POSE DES PROBLEMES
paveClic[55] = new paveLcClic ("C1T5", paveTypeBoutonPoussoir, 22, 10, "-", "G1_O,CR1_C_D,Tri4_D"); // CR1 POSE DES PROBLEMES
paveClic[56] = new paveLcClic ("C1T6", paveTypeBoutonPoussoir, 22, 13, "-", "G1_O,CR1_C_D,Tri4_D,Tri5_O,Tri6_D"); // CR1 POSE DES PROBLEMES
paveClic[57] = new paveLcClic ("C1At1", paveTypeBoutonPoussoir, 23, 10, "-", "G1_O,CR1_C_D,Tri4_D,Tri5_O,Tri6_O,DAt2_O"); // CR1 POSE DES PROBLEMES
paveClic[58] = new paveLcClic ("C1At2", paveTypeBoutonPoussoir, 23, 13, "-", "G1_O,CR1_C_D,Tri4_D,Tri5_O,Tri6_O,DAt2_D"); // CR1 POSE DES PROBLEMES
paveClic[59] = new paveLcClic ("T1ST", paveTypeBoutonPoussoir, 20, 16, "-", "Tri1_O,Tri2_D,Tri3_D,CR1_B_A"); // CR1 POSE DES PROBLEMES
paveClic[60] = new paveLcClic ("T2ST", paveTypeBoutonPoussoir, 20, 19, "-", "Tri2_O,Tri3_D,CR1_B_A"); // CR1 POSE DES PROBLEMES
paveClic[61] = new paveLcClic ("T3ST", paveTypeBoutonPoussoir, 21, 16, "-", "Tri3_O,CR1_B_A"); // CR1 POSE DES PROBLEMES
paveClic[62] = new paveLcClic ("T4ST", paveTypeBoutonPoussoir, 21, 19, "-", "Tri4a_D,Tri4_O,CR1_D_A"); // CR1 POSE DES PROBLEMES
paveClic[63] = new paveLcClic ("T5ST", paveTypeBoutonPoussoir, 22, 16, "-", "Tri5_D,Tri4_D,CR1_D_A"); // CR1 POSE DES PROBLEMES
paveClic[64] = new paveLcClic ("T6ST", paveTypeBoutonPoussoir, 22, 19, "-", "Tri6_D,Tri5_O,Tri4_D,CR1_D_A"); // CR1 POSE DES PROBLEMES
paveClic[65] = new paveLcClic ("At1ST", paveTypeBoutonPoussoir, 23, 16, "-", "DAt2_O,DAt1_D,Tri6_O,Tri5_O,Tri4_D,CR1_D_A"); // CR1 POSE DES PROBLEMES
paveClic[66] = new paveLcClic ("At2ST", paveTypeBoutonPoussoir, 23, 19, "-", "DAt2_D,DAt1_D,Tri5_O,Tri4_D,CR1_D_A"); // CR1 POSE DES PROBLEMES
paveClic[67] = new paveLcClic ("STC1", paveTypeBoutonPoussoir, 20, 25, "-", "CR1-2_AB,Tri3_D,Tri2_D,Tri1_D,AV_O, F1-4_Rouge, F4_VERT");// CR1 POSE DES PROBLEMES
paveClic[68] = new paveLcClic ("T3T4", paveTypeBoutonPoussoir, 22, 25, "-", "Tri3a_O,Tri4a_O");
paveClic[69] = new paveLcClic ("At1D", paveTypeBoutonPoussoir, 23, 23, "-", "DAt2_O,DAt1_O");
paveClic[70] = new paveLcClic ("At2D", paveTypeBoutonPoussoir, 23, 26, "-", "DAt2_D,DAt1_O");
paveClic[71] = new paveLcClic ("RAZ", paveTypeCommande, 0, 24, "-", "RAZ");
paveClic[72] = new paveLcClic ("SYNC", paveTypeCommande, 0, 27, "-", "SYNC");
}
La ligne qui nous intéresse est : "paveClic[10] = new paveLcClic ("CR1", paveTypeAiguilleDouble, 15, 8, "DD", "CR1"); // CR1 POSE DES PROBLEMES" ;
Comment faire reconnaître à Processing la différence entre un clic gauche de la souris et le clic droit ?
Pour info:
paveClic[0] = new paveLcClic ("G1", paveTypeAiguille, 16, 7, "D", "G1");
- 0 est un n° d'ordre ;
G1 est le nom du pavé ;
16, 7 sont les coordonnées du pavé : L = 16, C = 7 ; sur un TCO de 24 lignes et 30 colonnes ; les 1ère lignes et colonnes étant numéroté 0 (zéro)
D étant Droit et O pour oblique.
Dans le fichier joint, nous devons aller dans toutes les directions et bien sur à l'exception de A => C et D => B (et inversement !)
Je précise que le croisement utilisé et de chez TILLIG, échelle 1/120 et qu'il comporte 4 moteurs , soit 2 droits et 2 gauches.
Pouvez-vous m'aider ?
Avec mes remerciements