From 57dbf7941cebb284edae68b81a69d148786bc720 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Fri, 1 Nov 2024 04:00:12 +0100 Subject: [PATCH 01/44] ajout structure2donnees --- component_sketch.py | 2 +- strcuture2donnees.md | 51 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 strcuture2donnees.md diff --git a/component_sketch.py b/component_sketch.py index 7051205..0491819 100644 --- a/component_sketch.py +++ b/component_sketch.py @@ -655,7 +655,7 @@ def find_nearest_grid_chip(self, x, y, matrix=matrix1260pts): # Consider only lines 7 and 21 ('f' lines) col, line = point[1]["coord"] - if line == 7 and line == 21: + if line == 7 or line == 21: # mettre is_XY_free4Chip(x,y) grid_x, grid_y = point[1]["xy"] diff --git a/strcuture2donnees.md b/strcuture2donnees.md new file mode 100644 index 0000000..29c7607 --- /dev/null +++ b/strcuture2donnees.md @@ -0,0 +1,51 @@ + +# Transformation de Circuit en Fonction + +Pour convertir un circuit en une fonction logique, nous utilisons deux dictionnaires principaux : + +## 1. `cur_dict_circuit` + +```python +cur_dict_circuit = {"id": {"elementType":"chip", "coord":(1,7), ... }} +``` + +- `elementType` : Peut être "chip", "wire", "io" ou "pwr", correspondant aux quatre types d'éléments que l'on peut placer sur une plaque. +- `coord` : Tuple (colonne, ligne), indiquant la position du composant sur la plaque en utilisant les repères (colonne et ligne) d'une breadboard. + +Ce dictionnaire est rempli lors de la création des composants à travers les fonctions `drawChip` et `drawWire`. Les composants IO et PWR restent à implémenter. + +## 2. `connexion_circuit` + +```python +connexion_circuit = { + "io": [(col, line, "in"/"out"), ...], + "wire" : [(col, line), ...], + "pwr" : [(col, line, "+" ou "-"), ...], + "func" : [([(ce1, le1), ...], "&", [(cs1, ls1), (cs2, ls2), ...]), ...] +} +``` + +- `io` : Liste des coordonnées des entrées/sorties, le dernier élément du tuple indique "in" (entrée) ou "out" (sortie). +- `wire` : Liste des coordonnées des deux extrémités de chaque fil. +- `pwr` : Liste des coordonnées des éléments d'alimentation, avec le dernier élément indiquant "+" (positif) ou "-" (négatif). +- `func` : Liste de tuples contenant : + - Les coordonnées des pins d'entrée des composants de la fonction réalisée. + - Les coordonnées des pins de sortie de la fonction réalisée. + +La fonction (`func`) peut inclure des opérateurs logiques tels que `&` (ET), `|` (OU), `^` (OU exclusif), `!` (NON), ou des combinaisons de ces opérateurs. Une fonction spéciale, `tblv` (table de vérité), facilite la gestion des correspondances entre les variables d'entrée et de sortie. Elle est limitée à 4 entrées et 3 sorties en raison des contraintes de ressources sur le microcontrôleur. + +## Étapes à réaliser + +### 1. Conversion de `cur_dict_circuit` en `connexion_circuit` + +L'objectif est de parcourir `cur_dict_circuit` pour établir les correspondances et générer `connexion_circuit`. Ce code reste à écrire et est disponible pour quiconque veut relever le défi ! + +### 2. Transformation de `connexion_circuit` en série de fonctions + +Le but est de transformer `connexion_circuit` en une série de fonctions logiques sous forme de notation polonaise inverse. Par exemple, un demi-additionneur serait représenté ainsi : + +```plaintext +[= [ pin_out5 ^[pin_in1 pin_in2]] = [ pin_out6 & [pin_in1 pin_in2]]] +``` + +Je travaille actuellement sur ce code et je fournirai des explications détaillées lors de la réunion de jeudi. From 8562e9fd1c9356d6722bf1ab4ebcc79067693b19 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Fri, 1 Nov 2024 18:05:41 +0100 Subject: [PATCH 02/44] test --- .DS_Store | Bin 0 -> 6148 bytes .vscode/launch.json | 11 -- Mc/.DS_Store | Bin 0 -> 6148 bytes ...1_testee_fonctionnelle (2eme approche).zip | Bin 0 -> 52335 bytes .../.~lock.tables de verite pour testes.docx# | 1 + .../simul61_testee_fonctionnelle.ino | 168 +++++++++++++++++ .../tables de verite pour testes.docx | Bin 0 -> 58417 bytes Mc/simul61_testee_fonctionnelle.zip | Bin 0 -> 4601 bytes Mc/simul61_testee_fonctionnelle/REDME.txt | 79 ++++++++ .../simul61_testee_fonctionnelle.ino | 170 ++++++++++++++++++ .../~$bles de verite pour testes.docx | Bin 0 -> 162 bytes TestButton.py | 38 ++++ TestCableArrondis.py | 58 ++++++ TestCableSmooth.py | 42 +++++ TestMenuCont2.py | 75 ++++++++ TestMenuCont3.py | 76 ++++++++ TestMenuContextuel.py | 47 +++++ dataCDLT.py | 6 + "mod\303\250le de fonction.py" | 46 +++++ 19 files changed, 806 insertions(+), 11 deletions(-) create mode 100644 .DS_Store delete mode 100644 .vscode/launch.json create mode 100644 Mc/.DS_Store create mode 100644 Mc/simul61_testee_fonctionnelle (2eme approche).zip create mode 100644 Mc/simul61_testee_fonctionnelle (2eme approche)/.~lock.tables de verite pour testes.docx# create mode 100644 Mc/simul61_testee_fonctionnelle (2eme approche)/simul61_testee_fonctionnelle.ino create mode 100644 Mc/simul61_testee_fonctionnelle (2eme approche)/tables de verite pour testes.docx create mode 100644 Mc/simul61_testee_fonctionnelle.zip create mode 100644 Mc/simul61_testee_fonctionnelle/REDME.txt create mode 100644 Mc/simul61_testee_fonctionnelle/simul61_testee_fonctionnelle.ino create mode 100644 Mc/simul61_testee_fonctionnelle/~$bles de verite pour testes.docx create mode 100644 TestButton.py create mode 100644 TestCableArrondis.py create mode 100644 TestCableSmooth.py create mode 100644 TestMenuCont2.py create mode 100644 TestMenuCont3.py create mode 100644 TestMenuContextuel.py create mode 100644 "mod\303\250le de fonction.py" diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1de4a7ef450f885748be576be084ebc60d344285 GIT binary patch literal 6148 zcmeHKOHRWu5FM8aqO$3drLWK%q$Mm_6&Tq8PLTVJL>PMzAQqhCkp*X6TkZ@ zt*OWFmiFF%L6;P$p$>Bkce@`jqiZVb?J6%r(|y}sv^OEkiaHdqC-nOE^8WC#hOWNq zS6_EOUGF)6Z0pc&Q3Gt77z4(DF<=ZB0|zpow@7k+V7{dp1IEDdGQj79$6!nq2f=uB zV2UjOa1L`6=-f+ij#o?-2SIosPEvuA>a@jhk`BAqxKwcvlyq|1d^mmbSM%cH(^22Y zaB``j&BlN+FlOLHmP@|>uke?dZ1Tq`wlW5cfg@wU&9gk)U{iXx{@5PhwI1UJgN5S; oRv^$v9|2hKIdT!5;`gj0E>#=^xeD83I?z4@A|W;z1AoB4Cw^r&M*si- literal 0 HcmV?d00001 diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 04fbaca..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "configurations": [ - { - "name": "ObjectModel", - "type": "debugpy", - "request": "launch", - "console": "integratedTerminal", - "module": "object_model.circuit_object_model", - } - ] -} \ No newline at end of file diff --git a/Mc/.DS_Store b/Mc/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..24c55309016801b17eb4c4835c19c4235f1ab1ef GIT binary patch literal 6148 zcmeHKu};G<5PdEkiWu6Ffx#n4EM@2%Rb^o21AwHdsN^<+@6M+R6c7?f2vv8{ z-E%H?w(}g>IRIh4TTX!qfDu)2a7^=w$aB%249s&x4BAJ+3{%|U1$8gl9siL5S-Uf| zSYv}7-mhP)t5|b2S7@+B#rw6kwp`uBtG-E1Ri>t7AMyc>MPE&R)9wrHoE8x^)Je0cT*(fb0*E zDp(kH8FlNR(Gq|-q+5k;`4yC$Xjm9_8To_~aw;*W1}iZ_PNzRwTw&N{%;^YLd;}Xg zScMXFboL)L9HGeQ)){aHJ~AM+A7vuv|Ml1PzXrK+2AqMzWFQO|w~IO7&Cb@|Tgq7* rsrOV7iR&`%Q`pd>n6YvcpHfxmkJ2C(hFwN_DE=d$G`MjF{*-|?ePK=7 literal 0 HcmV?d00001 diff --git a/Mc/simul61_testee_fonctionnelle (2eme approche).zip b/Mc/simul61_testee_fonctionnelle (2eme approche).zip new file mode 100644 index 0000000000000000000000000000000000000000..e4eec635078dd0bd030dfdbdd2d8fea9170ad7a9 GIT binary patch literal 52335 zcmb5UW2`Q~(ycqW-f7#mZDUQ__L{bB+qP}nwr$(K``fv>C%HK}$*H8P`d8QZ^`uiZ z}I@ ziM0uVft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fD@)Y7#IbZ1n4~gP|HEU ze1sv?|IE1-c#(5QIT` zp=6Zo?RWq-M{WpO;v@uZMt`wkTmS>}@jpMqe@3$d?7+!nH#mUJ2`i;{M)&~$_LtFZ zF+Trv^xxrB^!CU6g!Z-)j6Q~UeE$ZTYMLATuZ&s$540+lf5=M6b$4G>FvtT13PlBZ uhoC?K7;F&eC!xWL9vEcUPi#FkV6+gOw*QNbh4q+2Ci-b&0D#KT + +const int MAX_INPUTS = 8; +const int MAX_OUTPUTS = 6; + +const int inputPins[MAX_INPUTS] = {22, 23, 24, 25, 26, 27, 28, 29}; // Broches pour I1 à I8 +const int outputPins[MAX_OUTPUTS] = {32, 33, 34, 35, 36, 37}; // Broches pour O1 à O6 + +String logicExpressions[MAX_OUTPUTS]; + +void setup() { + Serial.begin(9600); + for (int i = 0; i < MAX_INPUTS; i++) { + pinMode(inputPins[i], INPUT); + } + for (int i = 0; i < MAX_OUTPUTS; i++) { + pinMode(outputPins[i], OUTPUT); + digitalWrite(outputPins[i], LOW); + } +} + +void loop() { + if (Serial.available()) { + String input = Serial.readStringUntil('\n'); + parseMultipleExpressions(input); + } + updateOutputs(); +} + +void resetOutputs() { + for (int i = 0; i < MAX_OUTPUTS; i++) { + logicExpressions[i] = ""; + digitalWrite(outputPins[i], LOW); + } +} + +void parseMultipleExpressions(String input) { + resetOutputs(); + input.trim(); + int start = 0; + while (start < input.length()) { + int end = input.indexOf(';', start); + if (end == -1) { + end = input.length(); + } + String expression = input.substring(start, end); + parseExpression(expression); + start = end + 1; + } +} + +void parseExpression(String input) { + input.trim(); + int eqIndex = input.indexOf('='); + if (eqIndex != -1 && input.startsWith("O")) { + int outputIndex = input.substring(1, eqIndex).toInt() - 1; + if (outputIndex >= 0 && outputIndex < MAX_OUTPUTS) { + logicExpressions[outputIndex] = input.substring(eqIndex + 1); + } + } +} + +bool evaluateExpression(String expr) { + expr.trim(); + expr.replace(" ", ""); + for (int i = 0; i < MAX_INPUTS; i++) { + expr.replace("!I" + String(i + 1), String(!digitalRead(inputPins[i]))); + expr.replace("I" + String(i + 1), String(digitalRead(inputPins[i]))); + } + return evaluateComplexExpression(expr); +} + +bool evaluateComplexExpression(String expr) { + struct Stack { + bool values[64]; + char operators[64]; + int valueTop = -1; + int operatorTop = -1; + + void pushValue(bool value) { + values[++valueTop] = value; + } + + bool popValue() { + return values[valueTop--]; + } + + void pushOperator(char op) { + operators[++operatorTop] = op; + } + + char popOperator() { + return operators[operatorTop--]; + } + + char peekOperator() { + return operators[operatorTop]; + } + + bool isOperatorStackEmpty() { + return operatorTop == -1; + } + } stack; + + for (int i = 0; i < expr.length(); i++) { + char c = expr.charAt(i); + + if (c == '0' || c == '1') { + stack.pushValue(c == '1'); + } else if (c == '(') { + stack.pushOperator(c); + } else if (c == ')') { + while (!stack.isOperatorStackEmpty() && stack.peekOperator() != '(') { + char op = stack.popOperator(); + bool val2 = stack.popValue(); + bool val1 = (op == '!') ? false : stack.popValue(); + stack.pushValue(applyOperator(val1, val2, op)); + } + stack.popOperator(); + } else if (c == '&' || c == '|' || c == '!' || c == '^') { + while (!stack.isOperatorStackEmpty() && stack.peekOperator() != '(' && precedence(stack.peekOperator()) >= precedence(c)) { + char op = stack.popOperator(); + bool val2 = stack.popValue(); + bool val1 = (op == '!') ? false : stack.popValue(); + stack.pushValue(applyOperator(val1, val2, op)); + } + stack.pushOperator(c); + } + } + + while (!stack.isOperatorStackEmpty()) { + char op = stack.popOperator(); + bool val2 = stack.popValue(); + bool val1 = (op == '!') ? false : stack.popValue(); + stack.pushValue(applyOperator(val1, val2, op)); + } + + return stack.popValue(); +} + +bool applyOperator(bool a, bool b, char op) { + if (op == '&') return a && b; + if (op == '|') return a || b; + if (op == '^') return a != b; + if (op == '!') return !b; + return false; +} + +int precedence(char op) { + if (op == '!') return 4; + if (op == '&') return 3; + if (op == '^') return 2; + if (op == '|') return 1; + return 0; +} + +void updateOutputs() { + for (int i = 0; i < MAX_OUTPUTS; i++) { + if (logicExpressions[i] != "") { + bool outputValue = evaluateExpression(logicExpressions[i]); + if (outputValue) { + digitalWrite(outputPins[i], HIGH); + } else { + digitalWrite(outputPins[i], LOW); + } + } + } +} diff --git a/Mc/simul61_testee_fonctionnelle (2eme approche)/tables de verite pour testes.docx b/Mc/simul61_testee_fonctionnelle (2eme approche)/tables de verite pour testes.docx new file mode 100644 index 0000000000000000000000000000000000000000..0b129c31fb476debf47fb2d84656e616d78d9257 GIT binary patch literal 58417 zcmeFXWmH^Umo7?zySqbh_u#>UySqCCcL?qf+#z^ycXxMpcXy|5CGTh5{q-Gv&fh*Y z*tKgf-BX@tuDMuplAvH{AP^u>ARr*bAP2;d+TT8afGmK6fS`gvebf}PwQ)4Ianx0E z`)2H*P48-LMU(^fk@6?VM_~K^_xWF}f!g>HiylTKk%z!{|Ec;#iDt_D-l3dmV_dW6 z4`Hm%!gqoSIzAin>B%UuSl5eKr70d4*h`~&wbRs^-w~%%V{gL=hC08|aWG7-WGe!5lu-CWrF~#|j(hq*tk+UZLKrs;fBg$WY?T zckeD6uZh~#%R`RHjMpmAw@+C099p+3s}3*qRWh zW=4Z(nhj?3U#qtPDUMqoaHBru4PSjPJBMYMk^Hcf{PZ})>O7Ty=La)#fRoT?o(7s; zU;HUpC2KXk0Z*{AB2Rfrg*DD(z$d83fNFs3vZI=1=GRGN=C%sU{MqE8}buN|N2>E-ng9} zB;W9ik9JzfJmv(XIT3;#F&sW$oLF05P`2E)k}tR+Y&O>rsIl|_q%_cxx! z#gE!Y`eGx~GjWsd4(Xy!oAKJ0IEl*eVQtX!PdYuCFRiX134yKoOs@0aw&BwD?@iu@ zNyVv#{lnGK!zOSbVje@1$2w8>sD`OktXvxA>~* z0a?r|(jJ80JdW)RW5QpR#6tHYx_iA^yI1Kru8}#?g6fVI$BL1GEIr1c6b9$Ab?VqX zx1+ExG>{fL8#)HJ93d2gy*-_EHFg|9}f68+Mzi4t8v+aHzQVCqF|?V}v{(K- z!Pm45?GM*FWaB=kwN5VGkh(XV21MctI>#3nGh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Jg9u%Eyw{X@CIh=gh|q0%%RE2XlA?0-^o`qt*EVhi_)>@ zWoWDUU>`E#e`kOffmM9~5J~|K0`_kVa)BbXZ4Aw9>1ZF0zY_+>gam>E6HT7z{4v?& z7i~8Xa(th90=N@(>lzs{JS=1I$GiMuq5P`*(KG@G^zi*V zi($%tvS9o-7Q=R2i3q@pJbeGoVuAgiEMEK@i^uy(JnO(f+r#(oES@XtAib{`#LRzVCDWdt2oHw#mXT7Dqtj|9f+O-*Vx17Qe3&`HO{Z_&-^EUo-M|7Qe4X z@r#92%0F3rUz_3&7Qam6_esIOSUjov!Q%HR!oRcleL~eQ7RZf1Sp0Q*)$ioLPnY;b zZqxFE{BM&dey9I^0QMKXPW#W|{~V6}o%r{J>=$w9*bn00(zD+={GLMm;(!ZmqVZi5 z{+3YuPXG7l@)tD-#5V;3{Ug@=o&4{f{;%Yxz-;nA$$$8L8SzH|>^$V2Xdp}g48a#3 G&i)7F_*o+W literal 0 HcmV?d00001 diff --git a/Mc/simul61_testee_fonctionnelle.zip b/Mc/simul61_testee_fonctionnelle.zip new file mode 100644 index 0000000000000000000000000000000000000000..c4137f27b92a6d2924f2d9b42e99ceb5852b19e0 GIT binary patch literal 4601 zcmbtY2T)U6w+>x8Qlz(pUP2QDr1utj4PXQbNS7oaU69@hMUWybNC&A3O0NL~X@a0A zO`0H0LFxnFyL0dS^WMF8=B+b(?=y4GS>Il>*R1t@$50m!pB8XsyUBN~e&77h#0ua5 zAf4U4-K4}|C^!-Yhr=8_J?^2LJv}_&Zf({0By^iR4`!fr^ID zn}!JVdC)x;i|RV|NNyWvS5`J6x|*K-g9i^av&+kB8tvTRCQ+VFyG0USn#pib9d&X% z(PFr><4}Y!EC1659-Y-eJrVk&Nx5jY+1^^qb1?W0CTbB1Enu6h6qwXPLC^gTNPDa+ zY|OH9DCq0b1@!eb3d_6;Si@t=-6~&66CN|{TqM*YM>9DS^C&rgLfN`~TN1tW7~&A+ z^)D&u?jXLX#?vO(86bYaiWu$?4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IH-5Tm&GyS z4x$)Q2XQ{pWr;L#Oc+*;&=dsqErvgu!eji*CWO3ae|L==H>HT3%p&u@rK@<^P>uhPniVS9tiB*H0V(VCxbQ0QfH_+4IE! literal 0 HcmV?d00001 diff --git a/Mc/simul61_testee_fonctionnelle/REDME.txt b/Mc/simul61_testee_fonctionnelle/REDME.txt new file mode 100644 index 0000000..f0b91b1 --- /dev/null +++ b/Mc/simul61_testee_fonctionnelle/REDME.txt @@ -0,0 +1,79 @@ + +1. Déclaration des Broches et Variables +MAX_INPUTS et MAX_OUTPUTS : Constantes définissant le nombre maximum d'entrées (MAX_INPUTS = 8) et de sorties (MAX_OUTPUTS = 6). +inputPins et outputPins : +inputPins : Tableau contenant les numéros de broches associés aux entrées (I1 à I8). Par exemple, inputPins[0] correspond à la broche 22, utilisée pour I1. +outputPins : Tableau contenant les numéros de broches associés aux sorties (O1 à O6). Par exemple, outputPins[0] correspond à la broche 32, utilisée pour O1. +logicExpressions : Tableau de chaînes de caractères qui stocke les expressions logiques associées à chaque sortie (O1 à O6). Chaque entrée dans le tableau contient l'expression logique pour la sortie correspondante. +2. Fonction setup() +Serial.begin(9600) : Initialise la communication série pour que l'Arduino puisse recevoir des instructions via le port série. +Configuration des broches d'entrée et de sortie : +Entrées (inputPins) : Les broches d'entrée sont configurées en tant qu'entrées (INPUT) via pinMode(). Cela permet à l'Arduino de lire l'état de chaque broche. +Sorties (outputPins) : Les broches de sortie sont configurées en tant que sorties (OUTPUT) et initialisées à LOW via digitalWrite(), garantissant que toutes les sorties sont éteintes au démarrage. +3. Fonction loop() +Vérification des données disponibles sur le port série : +Si des données sont disponibles (Serial.available()), elles sont lues via Serial.readStringUntil('\n') jusqu'à ce qu'une nouvelle ligne soit atteinte. +Appelle la fonction parseMultipleExpressions() pour analyser les expressions logiques reçues et les stocker dans le tableau logicExpressions. +Appel de updateOutputs() : Cette fonction est appelée en continu pour évaluer les expressions logiques définies et mettre à jour les sorties en conséquence. +4. Fonction resetOutputs() +Réinitialisation des sorties : Réinitialise les expressions logiques en définissant chaque entrée de logicExpressions à une chaîne vide (""). +Mise à jour des sorties : Toutes les sorties sont réinitialisées à LOW (digitalWrite(outputPins[i], LOW)), garantissant qu'elles sont désactivées lorsqu'une nouvelle commande est reçue. +5. Fonction parseMultipleExpressions(String input) +Réinitialisation des sorties : Appelle resetOutputs() pour s'assurer que toutes les anciennes expressions sont supprimées avant d'en ajouter de nouvelles. +Analyse des expressions multiples : +Divise l'entrée en plusieurs expressions logiques séparées par des points-virgules (;). +Pour chaque expression trouvée, appelle parseExpression() pour l'analyser. +6. Fonction parseExpression(String input) +Analyse d'une expression logique individuelle : +Recherche le caractère = pour identifier la sortie et l'expression logique associée. +Si l'expression commence par "O" (par exemple O1, O2, etc.), le code identifie l'indice de sortie et associe l'expression à cette sortie. +L'expression logique est alors stockée dans le tableau logicExpressions pour la sortie correspondante. +7. Fonction evaluateExpression(String expr) +Remplacement des entrées par leurs valeurs actuelles : +Supprime tous les espaces dans l'expression (expr.replace(" ", "")). +Remplace chaque occurrence de I1, I2, etc., par leur état actuel (HIGH ou LOW) en utilisant digitalRead(). +Utilise evaluateComplexExpression(expr) pour évaluer l'expression simplifiée. +8. Fonction evaluateComplexExpression(String expr) +Évaluation des expressions logiques complexes : +Utilise une structure de pile (stack) pour gérer les valeurs (0 ou 1) et les opérateurs (&, |, ^, !, (, )). +Parcours de l'expression : +Valeurs (0 ou 1) : Ajoute chaque valeur à la pile des valeurs (pushValue()). +Parenthèses : +Parenthèses ouvrantes (() : Ajoute à la pile des opérateurs. +Parenthèses fermantes ()) : Applique les opérateurs en attente jusqu'à la parenthèse ouvrante correspondante. +Opérateurs (&, |, !, ^) : Ajoute chaque opérateur à la pile des opérateurs après avoir vérifié la priorité. +Application des opérateurs : Les opérateurs sont appliqués aux valeurs extraites de la pile en fonction de leur priorité. +9. Fonction applyOperator(bool a, bool b, char op) +Application d'un opérateur logique : +Applique les opérateurs logiques aux valeurs booléennes a et b : +& (ET logique) : Retourne a && b. +| (OU logique) : Retourne a || b. +^ (XOR logique) : Retourne a != b. +! (NON logique) : Retourne !b (inverse b). +Cette fonction est utilisée lors de l'évaluation d'une expression pour appliquer les opérations logiques aux valeurs booléennes. +10. Fonction precedence(char op) +Détermine la priorité des opérateurs : +! (NON logique) : Priorité la plus élevée (4). +& (ET logique) : Priorité suivante (3). +^ (XOR logique) : Priorité inférieure à & mais supérieure à | (2). +| (OU logique) : Priorité la plus faible (1). +Cette fonction est utilisée pour s'assurer que les opérateurs sont appliqués dans le bon ordre lors de l'évaluation d'une expression. +11. Fonction updateOutputs() +Mise à jour des sorties : +Parcourt chaque sortie (O1 à O6) définie dans le tableau logicExpressions. +Si une expression logique est définie pour une sortie, elle est évaluée à l'aide de evaluateExpression(). +En fonction du résultat (true ou false), la sortie est activée (HIGH) ou désactivée (LOW) via digitalWrite(). +Fonctionnement Global du Code +Réception des expressions logiques : +L'utilisateur envoie une ou plusieurs expressions logiques via le port série, par exemple : +scss +Copier le code +O2 = (I1 & I2) | (I2 & I3); O1 = (I1 ^ I2) ^ I3; +Ces expressions sont lues par l'Arduino et analysées. +Stockage des expressions logiques : +Chaque expression est associée à une sortie spécifique (O1 à O6). +Lecture des entrées et mise à jour des sorties : +Les valeurs des entrées (I1 à I8) sont continuellement lues avec digitalRead(). +Les sorties (O1 à O6) sont mises à jour dynamiquement en fonction des valeurs actuelles des entrées et des expressions logiques définies. +Cela transforme l'Arduino en un simulateur logique programmable, capable de gérer des expressions complexes et de les évaluer en temps réel. +En résumé, ce code permet de programmer l'Arduino Mega pour simuler des circuits logiques, en permettant à l'utilisateur de définir dynamiquement des expressions logiques pour chaque sortie, qui sont continuellement mises à jour en fonction des états des entrées. \ No newline at end of file diff --git a/Mc/simul61_testee_fonctionnelle/simul61_testee_fonctionnelle.ino b/Mc/simul61_testee_fonctionnelle/simul61_testee_fonctionnelle.ino new file mode 100644 index 0000000..9ccdb15 --- /dev/null +++ b/Mc/simul61_testee_fonctionnelle/simul61_testee_fonctionnelle.ino @@ -0,0 +1,170 @@ +#include + +const int MAX_INPUTS = 8; +const int MAX_OUTPUTS = 6; + +const int inputPins[MAX_INPUTS] = {22, 23, 24, 25, 26, 27, 28, 29}; // Broches pour I1 à I8 +const int outputPins[MAX_OUTPUTS] = {32, 33, 34, 35, 36, 37}; // Broches pour O1 à O6 + +String logicExpressions[MAX_OUTPUTS]; + +void setup() { + Serial.begin(115200); + Serial.println("Je démarre"); + for (int i = 0; i < MAX_INPUTS; i++) { + pinMode(inputPins[i], INPUT); + } + for (int i = 0; i < MAX_OUTPUTS; i++) { + pinMode(outputPins[i], OUTPUT); + digitalWrite(outputPins[i], LOW); + } +} + +void loop() { + if (Serial.available()) { + String input = Serial.readStringUntil('\n'); + Serial.println(input); + parseMultipleExpressions(input); + } + updateOutputs(); +} + +void resetOutputs() { + for (int i = 0; i < MAX_OUTPUTS; i++) { + logicExpressions[i] = ""; + digitalWrite(outputPins[i], LOW); + } +} + +void parseMultipleExpressions(String input) { + resetOutputs(); + input.trim(); + int start = 0; + while (start < input.length()) { + int end = input.indexOf(';', start); + if (end == -1) { + end = input.length(); + } + String expression = input.substring(start, end); + parseExpression(expression); + start = end + 1; + } +} + +void parseExpression(String input) { + input.trim(); + int eqIndex = input.indexOf('='); + if (eqIndex != -1 && input.startsWith("O")) { + int outputIndex = input.substring(1, eqIndex).toInt() - 1; + if (outputIndex >= 0 && outputIndex < MAX_OUTPUTS) { + logicExpressions[outputIndex] = input.substring(eqIndex + 1); + } + } +} + +bool evaluateExpression(String expr) { + expr.trim(); + expr.replace(" ", ""); + for (int i = 0; i < MAX_INPUTS; i++) { + expr.replace("!I" + String(i + 1), String(!digitalRead(inputPins[i]))); + expr.replace("I" + String(i + 1), String(digitalRead(inputPins[i]))); + } + return evaluateComplexExpression(expr); +} + +bool evaluateComplexExpression(String expr) { + struct Stack { + bool values[64]; + char operators[64]; + int valueTop = -1; + int operatorTop = -1; + + void pushValue(bool value) { + values[++valueTop] = value; + } + + bool popValue() { + return values[valueTop--]; + } + + void pushOperator(char op) { + operators[++operatorTop] = op; + } + + char popOperator() { + return operators[operatorTop--]; + } + + char peekOperator() { + return operators[operatorTop]; + } + + bool isOperatorStackEmpty() { + return operatorTop == -1; + } + } stack; + + for (int i = 0; i < expr.length(); i++) { + char c = expr.charAt(i); + + if (c == '0' || c == '1') { + stack.pushValue(c == '1'); + } else if (c == '(') { + stack.pushOperator(c); + } else if (c == ')') { + while (!stack.isOperatorStackEmpty() && stack.peekOperator() != '(') { + char op = stack.popOperator(); + bool val2 = stack.popValue(); + bool val1 = (op == '!') ? false : stack.popValue(); + stack.pushValue(applyOperator(val1, val2, op)); + } + stack.popOperator(); + } else if (c == '&' || c == '|' || c == '!' || c == '^') { + while (!stack.isOperatorStackEmpty() && stack.peekOperator() != '(' && precedence(stack.peekOperator()) >= precedence(c)) { + char op = stack.popOperator(); + bool val2 = stack.popValue(); + bool val1 = (op == '!') ? false : stack.popValue(); + stack.pushValue(applyOperator(val1, val2, op)); + } + stack.pushOperator(c); + } + } + + while (!stack.isOperatorStackEmpty()) { + char op = stack.popOperator(); + bool val2 = stack.popValue(); + bool val1 = (op == '!') ? false : stack.popValue(); + stack.pushValue(applyOperator(val1, val2, op)); + } + + return stack.popValue(); +} + +bool applyOperator(bool a, bool b, char op) { + if (op == '&') return a && b; + if (op == '|') return a || b; + if (op == '^') return a != b; + if (op == '!') return !b; + return false; +} + +int precedence(char op) { + if (op == '!') return 4; + if (op == '&') return 3; + if (op == '^') return 2; + if (op == '|') return 1; + return 0; +} + +void updateOutputs() { + for (int i = 0; i < MAX_OUTPUTS; i++) { + if (logicExpressions[i] != "") { + bool outputValue = evaluateExpression(logicExpressions[i]); + if (outputValue) { + digitalWrite(outputPins[i], HIGH); + } else { + digitalWrite(outputPins[i], LOW); + } + } + } +} diff --git a/Mc/simul61_testee_fonctionnelle/~$bles de verite pour testes.docx b/Mc/simul61_testee_fonctionnelle/~$bles de verite pour testes.docx new file mode 100644 index 0000000000000000000000000000000000000000..e4e28af1a54de1b88173023384cd50b9e258fcba GIT binary patch literal 162 zcmdpf7Js; szCBpx#>BwTCFY<8;s->0UkT#FXhx`}G#-fh1BW?3L;=Mj7D&nh0J~QmBme*a literal 0 HcmV?d00001 diff --git a/TestButton.py b/TestButton.py new file mode 100644 index 0000000..cfa7e34 --- /dev/null +++ b/TestButton.py @@ -0,0 +1,38 @@ +import tkinter as tk +from tkinter import colorchooser + +class MyApp: + def __init__(self, root): + self.icon_size = 20 # Taille de l'icône du bouton + self.selected_color = "#ff0000" # Couleur par défaut + self.create_color_chooser(root) + + def choose_color(self): + """Ouvre une boîte de dialogue pour choisir une couleur.""" + color_code = colorchooser.askcolor(title="Choisissez une couleur") + if color_code[1]: # Si une couleur est choisie + self.selected_color = color_code[1] + self.color_button.config(bg=self.selected_color) + + def create_color_chooser(self, parent_frame): + """Crée un bouton pour choisir une couleur.""" + square_size = self.icon_size + + # Configurer le bouton avec une taille explicite en pixels (via `Canvas`) + self.color_button = tk.Button( + parent_frame, + text=" ", # Ajout d'un espace pour mieux gérer la taille sur macOS + bg=self.selected_color, + relief="raised", + bd=1, + command=self.choose_color + ) + self.color_button.pack(side=tk.LEFT, padx=2, pady=2) + + # Forcer la mise à jour du style pour macOS + self.color_button.update_idletasks() + +# Créer la fenêtre principale +root = tk.Tk() +app = MyApp(root) +root.mainloop() diff --git a/TestCableArrondis.py b/TestCableArrondis.py new file mode 100644 index 0000000..eb70c8b --- /dev/null +++ b/TestCableArrondis.py @@ -0,0 +1,58 @@ +import tkinter as tk + +def dessiner_segment(canvas, x1, y1, x2, y2, couleur="#000000", epaisseur=4): + """Dessine un segment de droite entre deux points.""" + canvas.create_line(x1, y1, x2, y2, fill=couleur, width=epaisseur) + +def dessiner_inflexion(canvas, x, y, rayon, couleur="#000000", epaisseur=4): + """Dessine un arc arrondi à l'inflexion.""" + canvas.create_oval( + x - rayon, y - rayon, x + rayon, y + rayon, + outline=couleur, width=epaisseur + ) + +def dessiner_cable(canvas, points, rayon=10, couleur="#0d6efd", epaisseur=4): + """ + Dessine un câble avec des segments droits et des inflexions arrondies. + + Parameters: + - canvas (tk.Canvas): Le canvas où dessiner. + - points (list): Liste des points (x, y) formant le câble. + - rayon (int): Rayon des inflexions arrondies. + - couleur (str): Couleur du câble. + - epaisseur (int): Épaisseur du câble. + """ + # Dessiner les segments de droite + for i in range(len(points) - 1): + x1, y1 = points[i] + x2, y2 = points[i + 1] + dessiner_segment(canvas, x1, y1, x2, y2, couleur, epaisseur) + + # Dessiner les inflexions arrondies aux points d'intersection + for i in range(1, len(points) - 1): + x, y = points[i] + dessiner_inflexion(canvas, x, y, rayon, couleur, epaisseur) + +# Créer la fenêtre principale +root = tk.Tk() +root.geometry("600x400") +root.title("Câble avec Inflexions Arrondies") + +# Créer un canvas pour dessiner +canvas = tk.Canvas(root, bg="white") +canvas.pack(fill=tk.BOTH, expand=True) + +# Liste des points formant le câble +points = [ + (50, 300), # Point de départ + (150, 200), # Inflexion 1 + (300, 250), # Inflexion 2 + (450, 150), # Inflexion 3 + (550, 300) # Point final +] + +# Dessiner le câble avec segments et inflexions arrondies +dessiner_cable(canvas, points, rayon=10, couleur="#0d6efd", epaisseur=4) + +# Lancer la boucle principale +root.mainloop() diff --git a/TestCableSmooth.py b/TestCableSmooth.py new file mode 100644 index 0000000..276a481 --- /dev/null +++ b/TestCableSmooth.py @@ -0,0 +1,42 @@ +import tkinter as tk + +def dessiner_cable(canvas, points, couleur="#0d6efd", contour="#000000", epaisseur=4): + """ + Dessine un câble courbé avec un contour. + + Parameters: + - canvas (tk.Canvas): Le canvas où dessiner. + - points (list): Liste des points (x, y) formant la ligne. + - couleur (str): Couleur principale du câble. + - contour (str): Couleur du contour. + - epaisseur (int): Épaisseur de la ligne principale. + """ + # Dessiner le "contour" (ligne plus épaisse) + canvas.create_line(points, fill=contour, width=epaisseur + 2) + + # Dessiner la ligne principale par-dessus + canvas.create_line(points, fill=couleur, width=epaisseur) # , splinesteps=2 + +# Créer la fenêtre principale +root = tk.Tk() +root.geometry("600x400") +root.title("Câble Courbé avec Contour") + +# Créer un canvas pour dessiner +canvas = tk.Canvas(root, bg="white") +canvas.pack(fill=tk.BOTH, expand=True) + +# Définir des points pour le câble courbé +points = [ + 50, 200, # Point de départ + 250, 480, # Point intermédiaire 1 + 300, 120, # Point intermédiaire 2 + 550, 120 # Point intermédiaire 3 + #550, 200 # Point final +] + +# Dessiner le câble courbé avec contour +dessiner_cable(canvas, points, couleur="#0d6efd", contour="#000000", epaisseur=4) + +# Lancer la boucle principale +root.mainloop() diff --git a/TestMenuCont2.py b/TestMenuCont2.py new file mode 100644 index 0000000..1180e6e --- /dev/null +++ b/TestMenuCont2.py @@ -0,0 +1,75 @@ +import tkinter as tk +from tkinter import messagebox +from PIL import Image, ImageDraw, ImageTk + +def ouvrir(): + messagebox.showinfo("Ouvrir", "Ouvrir le fichier sélectionné.") + +def renommer(): + messagebox.showinfo("Renommer", "Renommer le fichier sélectionné.") + +def supprimer(): + messagebox.showinfo("Supprimer", "Placer dans la corbeille.") + +def etiquetter(couleur): + messagebox.showinfo("Étiquette", f"Étiquette {couleur} appliquée.") + +def afficher_menu(event): + """Affiche le menu contextuel à la position du clic.""" + menu.post(event.x_root, event.y_root) + +def creer_image_cercle(couleur, taille=20): + """Crée une image en mémoire avec un cercle coloré.""" + image = Image.new("RGBA", (taille, taille), (0, 0, 0, 0)) # Image transparente + draw = ImageDraw.Draw(image) + draw.ellipse((0, 0, taille, taille), fill=couleur) # Dessine un cercle + return ImageTk.PhotoImage(image) + +# Fenêtre principale +root = tk.Tk() +root.geometry("300x200") +root.title("Menu Contextuel avec Formes") + +# Créer un menu contextuel +menu = tk.Menu(root, tearoff=0) + +# Ajouter les options au menu avec des icônes (formes) +menu.add_command(label="Ouvrir", command=ouvrir) +menu.add_command(label="Renommer", command=renommer) +menu.add_separator() +menu.add_command(label="Placer dans la corbeille", command=supprimer) + +# Sous-menu avec des couleurs et formes associées +sous_menu = tk.Menu(menu, tearoff=0) + +# Couleurs et icônes associées +couleurs = { + "Rouge": "#FF0000", + "Orange": "#FFA500", + "Jaune": "#FFFF00", + "Vert": "#00FF00", + "Bleu": "#0000FF", + "Violet": "#800080", + "Gris": "#808080" +} + +# Créer des icônes circulaires pour chaque couleur +icones = {} +for couleur, code in couleurs.items(): + icones[couleur] = creer_image_cercle(code) # Générer l'image du cercle + sous_menu.add_command( + label=couleur, + image=icones[couleur], + compound=tk.LEFT, # Affiche l'icône à gauche du texte + command=lambda c=couleur: etiquetter(c) + ) + +# Ajouter le sous-menu au menu principal +menu.add_cascade(label="Étiquettes", menu=sous_menu) + +# Lier un clic droit pour afficher le menu +root.bind("", afficher_menu) # Clic droit sur Windows/Linux/macOS +root.bind("", afficher_menu) # Clic gauche + Ctrl sur macOS + +# Boucle principale +root.mainloop() diff --git a/TestMenuCont3.py b/TestMenuCont3.py new file mode 100644 index 0000000..d1cff85 --- /dev/null +++ b/TestMenuCont3.py @@ -0,0 +1,76 @@ +import tkinter as tk +from tkinter import messagebox +from PIL import Image, ImageDraw, ImageTk + +def ouvrir(): + messagebox.showinfo("Ouvrir", "Ouvrir le fichier sélectionné.") + +def renommer(): + messagebox.showinfo("Renommer", "Renommer le fichier sélectionné.") + +def supprimer(): + messagebox.showinfo("Supprimer", "Placer dans la corbeille.") + +def etiquetter(couleur): + messagebox.showinfo("Étiquette", f"Étiquette {couleur} appliquée.") + +def afficher_menu(event): + """Affiche le menu contextuel à la position du clic.""" + menu.post(event.x_root, event.y_root) + +def creer_image_cercle(couleur, taille=20): + """Crée une image en mémoire avec un cercle coloré.""" + image = Image.new("RGBA", (taille, taille), (0, 0, 0, 0)) + draw = ImageDraw.Draw(image) + draw.ellipse((0, 0, taille, taille), fill=couleur) + return ImageTk.PhotoImage(image) + +# Fenêtre principale +root = tk.Tk() +root.geometry("300x200") +root.title("Menu Contextuel avec Titre") + +# Créer un menu contextuel +menu = tk.Menu(root, tearoff=0) + +# Ajouter un "titre" désactivé en haut du menu +menu.add_command(label="Menu d'Options", state="disabled") # Titre désactivé +menu.add_separator() # Séparateur sous le titre + +# Ajouter des options au menu +menu.add_command(label="Ouvrir", command=ouvrir) +menu.add_command(label="Renommer", command=renommer) +menu.add_separator() +menu.add_command(label="Placer dans la corbeille", command=supprimer) + +# Sous-menu avec des couleurs et formes associées +sous_menu = tk.Menu(menu, tearoff=0) +couleurs = { + "Rouge": "#FF0000", + "Orange": "#FFA500", + "Jaune": "#FFFF00", + "Vert": "#00FF00", + "Bleu": "#0000FF", + "Violet": "#800080", + "Gris": "#808080" +} + +icones = {} +for couleur, code in couleurs.items(): + icones[couleur] = creer_image_cercle(code) + sous_menu.add_command( + label=couleur, + image=icones[couleur], + compound=tk.LEFT, + command=lambda c=couleur: etiquetter(c) + ) + +# Ajouter le sous-menu au menu principal +menu.add_cascade(label="Étiquettes", menu=sous_menu) + +# Lier un clic droit pour afficher le menu +root.bind("", afficher_menu) +root.bind("", afficher_menu) # Clic gauche + Ctrl sur macOS + +# Boucle principale +root.mainloop() diff --git a/TestMenuContextuel.py b/TestMenuContextuel.py new file mode 100644 index 0000000..a1d396e --- /dev/null +++ b/TestMenuContextuel.py @@ -0,0 +1,47 @@ +import tkinter as tk +from tkinter import messagebox + +def ouvrir(): + messagebox.showinfo("Ouvrir", "Ouvrir le fichier sélectionné.") + +def renommer(): + messagebox.showinfo("Renommer", "Renommer le fichier sélectionné.") + +def supprimer(): + messagebox.showinfo("Supprimer", "Placer dans la corbeille.") + +def etiquetter(couleur): + messagebox.showinfo("Étiquette", f"Étiquette {couleur} appliquée.") + +def afficher_menu(event): + """Affiche le menu contextuel à la position du clic.""" + menu.post(event.x_root, event.y_root) + +# Création de la fenêtre principale +root = tk.Tk() +root.geometry("300x200") +root.title("Menu Contextuel") + +# Création du menu contextuel +menu = tk.Menu(root, tearoff=0) + +# Ajout des options au menu +menu.add_command(label="Ouvrir", command=ouvrir) +menu.add_command(label="Renommer", command=renommer) +menu.add_separator() +menu.add_command(label="Placer dans la corbeille", command=supprimer) + +# Sous-menu pour les étiquettes de couleur +sous_menu = tk.Menu(menu, tearoff=0) +couleurs = ["Rouge", "Orange", "Jaune", "Vert", "Bleu", "Violet", "Gris"] +for couleur in couleurs: + sous_menu.add_command(label=couleur, command=lambda c=couleur: etiquetter(c)) + +menu.add_cascade(label="Étiquettes", menu=sous_menu) + +# Lier un clic droit à l'apparition du menu contextuel +root.bind("", afficher_menu) # Clic droit sur Windows/macOS +root.bind("", afficher_menu) # Clic gauche + Ctrl sur macOS + +# Boucle principale +root.mainloop() diff --git a/dataCDLT.py b/dataCDLT.py index f8032ec..8bc1585 100644 --- a/dataCDLT.py +++ b/dataCDLT.py @@ -18,6 +18,12 @@ id_type = {} current_dict_circuit = {} +connexion_circuit = { + "io": [], + "wire" : [], + "pwr" : [], + "func" : [] +} num_id = 1 mouse_x, mouse_y = 0, 0 drag_mouse_x, drag_mouse_y = 0, 0 diff --git "a/mod\303\250le de fonction.py" "b/mod\303\250le de fonction.py" new file mode 100644 index 0000000..1cd4ec2 --- /dev/null +++ "b/mod\303\250le de fonction.py" @@ -0,0 +1,46 @@ +def drawPinIO(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): + global num_id + + if width != -1: + scale = width / 9.0 + inter_space = 15 * scale + space = 9 * scale + thickness = 1 * scale + matrix = matrix830pts + mode= AUTO + id = None + multipoints = [] + for key, value in kwargs.items(): + if key == "color": + color = value + if key == "mode": + mode = value + if key == "coords": + coords = value + if key == "matrix": + matrix = value + if key == "id": + id = value + if key == "tags": + tags = value + if key == "XY": + [(xs,ys,xe,ye)] = value + if key == "multipoints": + multipoints = value + + params = {} + if id: # If the wire already exists, delete it and redraw + if current_dict_circuit.get(id): + params = current_dict_circuit[id] + tags = params["tags"] + +################# ICI TON CODE PRIMITIVES GRAPHIQUE SI LA PIN EST DÉJÀ PLACÉE #################### + else: + id = "_wire_" + str(num_id) + num_id += 1 + params["id"] = id +################# ICI TON CODE PRIMITIVES GRAPHIQUE SI LA PIN N'EST PAS ENCORE PRÉSENTE #################### + + current_dict_circuit[id] = params + + return xD, yD \ No newline at end of file From ada8d3913499f914373bfc85d7e1b392976c5ace Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Fri, 1 Nov 2024 18:07:48 +0100 Subject: [PATCH 03/44] test2 --- "mod\303\250le de fonction.py" | 46 ---------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 "mod\303\250le de fonction.py" diff --git "a/mod\303\250le de fonction.py" "b/mod\303\250le de fonction.py" deleted file mode 100644 index 1cd4ec2..0000000 --- "a/mod\303\250le de fonction.py" +++ /dev/null @@ -1,46 +0,0 @@ -def drawPinIO(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): - global num_id - - if width != -1: - scale = width / 9.0 - inter_space = 15 * scale - space = 9 * scale - thickness = 1 * scale - matrix = matrix830pts - mode= AUTO - id = None - multipoints = [] - for key, value in kwargs.items(): - if key == "color": - color = value - if key == "mode": - mode = value - if key == "coords": - coords = value - if key == "matrix": - matrix = value - if key == "id": - id = value - if key == "tags": - tags = value - if key == "XY": - [(xs,ys,xe,ye)] = value - if key == "multipoints": - multipoints = value - - params = {} - if id: # If the wire already exists, delete it and redraw - if current_dict_circuit.get(id): - params = current_dict_circuit[id] - tags = params["tags"] - -################# ICI TON CODE PRIMITIVES GRAPHIQUE SI LA PIN EST DÉJÀ PLACÉE #################### - else: - id = "_wire_" + str(num_id) - num_id += 1 - params["id"] = id -################# ICI TON CODE PRIMITIVES GRAPHIQUE SI LA PIN N'EST PAS ENCORE PRÉSENTE #################### - - current_dict_circuit[id] = params - - return xD, yD \ No newline at end of file From 6a70602aa92bc32f6f60467f29b06d1e54bd6932 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Tue, 5 Nov 2024 19:40:12 -0500 Subject: [PATCH 04/44] temporaire pour fusion master --- component_sketch.py | 7 ++++++- menus.py | 50 +++++++++++++++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/component_sketch.py b/component_sketch.py index 0491819..001f4cc 100644 --- a/component_sketch.py +++ b/component_sketch.py @@ -1833,6 +1833,10 @@ def drawChip(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): tags = value if key == "type": type = value + if key == "io": + io = value + if key == "symbScript": + symbScript = value dimLine = (dim["pinCount"] - 0.30) * inter_space / 2 dimColumn = dim["chipWidth"] * inter_space @@ -1859,6 +1863,8 @@ def drawChip(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): params["label"] = label params["type"] = type params["btnMenu"] = [1, 1, 0] + params["symbScript"] = symbScript + params["io"] = io nbBrocheParCote = dim["pinCount"] // 2 #self.change_hole_state(xD,yD,nbBrocheParCote,USED) tagBase = "base" + id @@ -1905,7 +1911,6 @@ def drawChip(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): ) # FIN AJOUT KH self.rounded_rect(xD, yD, dimLine, dimColumn, 5, outline="#343434", fill="#343434", thickness=thickness, tags=tagBase) - self.canvas.create_rectangle( xD + 2 * scale, diff --git a/menus.py b/menus.py index 848632f..4a31dbd 100644 --- a/menus.py +++ b/menus.py @@ -3,9 +3,10 @@ import tkinter as tk from tkinter import messagebox, filedialog import json +from dataCDLT import current_dict_circuit class Menus: - def __init__(self, parent, canvas, board, component_data, model, current_dict_circuit, zoom_function): + def __init__(self, parent, canvas, board, component_data, model, current_dict_circuit, zoom_function,sketcher=None): """ Initializes the custom menu bar. @@ -25,29 +26,32 @@ def __init__(self, parent, canvas, board, component_data, model, current_dict_ci self.model = model self.current_dict_circuit = current_dict_circuit self.zoom = zoom_function + self.sketcher = sketcher # Create the menu bar frame (do not pack here) self.menu_bar = tk.Frame(parent, bg="#333333") # Define menu items and their corresponding dropdown options self.menus = { - "File": ["New", "Open", "Save", "Exit"], - "Controllers": ["Arduino", "ESP32"], - "Ports": ["Configure Ports"], - "Help": ["Documentation", "About"] + "Fichier": ["Nouveau", "Ouvrir", "Enregistrer", "Quitter"], + "Circuit": ["Vérification","Téléverser"], + "Controllers": ["Arduino", "ESP32","STM32"], + "Ports": ["Configurer le port série"], + "Help": ["Documentation", "A propos"] } # Mapping menu labels to their handler functions self.menu_commands = { - "New": self.new_file, - "Open": self.open_file, - "Save": self.save_file, - "Exit": self.parent.quit, + "Nouveau": self.new_file, + "Ouvrir": self.open_file, + "Enregistrer": self.save_file, + "Quitter": self.parent.quit, + "Vérification": self.checkCircuit, "Arduino": self.Arduino, "ESP32": self.ESP32, - "Configure Ports": self.configure_ports, + "Configurer le port série": self.configure_ports, "Documentation": self.open_documentation, - "About": self.about + "A propos": self.about } # Create each menu button and its dropdown @@ -70,9 +74,11 @@ def create_menu(self, menu_name, options): self.menu_bar, text=menu_name, bg="#333333", - fg="white", + fg="blue", activebackground="#444444", - activeforeground="white", + activeforeground="blue", + highlightbackground="#333333", # Border color when inactive + highlightcolor="#444444", # Border color when active bd=0, padx=10, pady=5, @@ -96,9 +102,11 @@ def create_menu(self, menu_name, options): dropdown, text=option, bg="#333333", - fg="white", + fg="blue", activebackground="#444444", - activeforeground="white", + activeforeground="blue", + highlightbackground="#333333", # Border color when inactive + highlightcolor="#444444", # Border color when active bd=0, anchor="w", padx=20, @@ -255,3 +263,15 @@ def about(self): """Handler for the 'About' menu item.""" print("About this software") messagebox.showinfo("About", "ArduinoLogique v1.0\nSimulateur de circuits logiques") + + def checkCircuit(self): + print("Lancer la vérification") + func =[] + for id, chip in current_dict_circuit.items(): + if id[:6] == "_chip_": + (x, y) = chip["pinUL_XY"] + numPinUL = chip["pinCount"] // 2 + (real_x,real_y),(col,line) = self.sketcher.find_nearest_grid_chip(x,y) + for io in chip["io"]: # [([(ce1, le1), ...], "&", [(cs1, ls1), (cs2, ls2), ...]), ...] + print(f"ce1-ce2, func, cs1:({io[0][0]}-{io[0][1]} , {chip["symbScript"]} , {io[1][0]})") + From 181e9f8f74512133f52325c646a8daa34e6ec35a Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Tue, 5 Nov 2024 20:04:24 -0500 Subject: [PATCH 05/44] 2eme fusion master --- arduino_logique.py | 14 ++++++++------ breadboard.py | 12 ++++++------ dataComponent.py | 5 +++++ toolbar.py | 11 +++++++++-- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/arduino_logique.py b/arduino_logique.py index f21a836..0d0f622 100644 --- a/arduino_logique.py +++ b/arduino_logique.py @@ -48,11 +48,12 @@ def zoom(p_canvas: tk.Canvas, p_scale: float, p_board: Breadboard, p_board_x: in def main(): # Creating main window - win = tk.Tk() - win.title("Laboratoire virtuel de circuit logique - GIF-1002") - win.geometry("1600x900") # Initial window size - win.configure(bg="#333333") # Setting consistent background color - + window = tk.Tk() + window.title("Laboratoire virtuel de circuit logique - GIF-1002") + window.geometry("1600x900") # Initial window size + #win.configure(bg="#333333") # Setting consistent background color + win = tk.Frame(window, bg="#333333") + win.pack(fill="both", expand=True) # Configuring grid layout for the main window win.grid_rowconfigure(0, weight=0) # Menu bar win.grid_rowconfigure(1, weight=0) # Secondary toolbar @@ -111,7 +112,8 @@ def main(): component_data=component_data, model=model, current_dict_circuit=current_dict_circuit, - zoom_function=zoom + zoom_function=zoom, + sketcher=sketcher ) # Placing the menu_bar in row=0, spanning both columns menus.menu_bar.grid(row=0, column=0, columnspan=2, sticky="nsew") diff --git a/breadboard.py b/breadboard.py index cd41ccc..1a3794c 100644 --- a/breadboard.py +++ b/breadboard.py @@ -157,7 +157,7 @@ def fill_matrix_830_pts(self, col_distance=1, line_distance=1, **kwargs): ), "coord": (2 + (i % 5) + col_distance + (i // 5) * 6, line_distance), "etat": FREE, - "lien": None, + "link": [(2 + col_distance, 1 + line_distance, 51 + col_distance, line_distance)], } matrix[id_top_plus] = { @@ -168,7 +168,7 @@ def fill_matrix_830_pts(self, col_distance=1, line_distance=1, **kwargs): ), "coord": (2 + (i % 5) + col_distance + (i // 5) * 6, 1 + line_distance), "etat": FREE, - "lien": None, + "link": [(2 + col_distance, 1 + line_distance, 51 + col_distance, 1 + line_distance)], } matrix[id_bot_minus] = { "id": ["pb", "plus bas", "13"], @@ -178,7 +178,7 @@ def fill_matrix_830_pts(self, col_distance=1, line_distance=1, **kwargs): ), "coord": (2 + (i % 5) + col_distance + (i // 5) * 6, 12 + line_distance), "etat": FREE, - "lien": None, + "link": [(2 + col_distance, 1 + line_distance, 51 + col_distance, 12 + line_distance)], } matrix[id_bot_plus] = { "id": ["mb", "moins bas", "14"], @@ -188,7 +188,7 @@ def fill_matrix_830_pts(self, col_distance=1, line_distance=1, **kwargs): ), "coord": (2 + (i % 5) + col_distance + (i // 5) * 6, 13 + line_distance), "etat": FREE, - "lien": None, + "link": [(2 + col_distance, 1 + line_distance, 51 + col_distance, 13 + line_distance)], } for l in range(5): for c in range(63): @@ -201,7 +201,7 @@ def fill_matrix_830_pts(self, col_distance=1, line_distance=1, **kwargs): ), "coord": (c + col_distance, l + 2 + line_distance), "etat": FREE, - "lien": None, + "link": [(c + col_distance, 2 + line_distance, c + col_distance, 6 + line_distance)], } id_in_matrix = str(c + col_distance) + "," + str(l + 7 + line_distance) matrix[id_in_matrix] = { @@ -212,7 +212,7 @@ def fill_matrix_830_pts(self, col_distance=1, line_distance=1, **kwargs): ), "coord": (c + col_distance, l + 7 + line_distance), "etat": FREE, - "lien": None, + "link": [(c + col_distance, 7 + line_distance, c + col_distance, 11 + line_distance)], } def fill_matrix_1260_pts(self): diff --git a/dataComponent.py b/dataComponent.py index 4cd4d34..4540653 100644 --- a/dataComponent.py +++ b/dataComponent.py @@ -34,6 +34,7 @@ def __init__(self, sketcher: ComponentSketcher): pins7400 = { "logicFunction": self.sketcher.symbNAND, + "symbScript" : "!&", "io": [ ( [1, 2], @@ -63,6 +64,7 @@ def __init__(self, sketcher: ComponentSketcher): } pins7402 = { "logicFunction": self.sketcher.symbNOR, + "symbScript" : "!|", "io": [ ( [1, 2], @@ -92,6 +94,7 @@ def __init__(self, sketcher: ComponentSketcher): } pins7404 = { "logicFunction": self.sketcher.symbNOT, + "symbScript" : "!", "io": [ ( [1, 2], @@ -121,6 +124,7 @@ def __init__(self, sketcher: ComponentSketcher): } pins7408 = { "logicFunction": self.sketcher.symbAND, + "symbScript" : "&", "io": [ ( [1, 2], @@ -150,6 +154,7 @@ def __init__(self, sketcher: ComponentSketcher): } pins7432 = { "logicFunction": self.sketcher.symbOR, + "symbScript" : "|", "io": [ ( [1, 2], diff --git a/toolbar.py b/toolbar.py index a005844..cd2cb16 100644 --- a/toolbar.py +++ b/toolbar.py @@ -139,8 +139,15 @@ def choose_color(self): self.selected_color = color_code[1] self.color_button.configure(bg=self.selected_color) self.canvas.itemconfig(self.cursor_circle_id,fill=self.selected_color) - # Here you can add logic to apply the selected color to new connections - + if self.wire_start_point: + color =self.hex_to_rgb(self.selected_color ) + encre = f"#{color[0]:02x}{color[1]:02x}{color[2]:02x}" + contour = f"#{color[0]//2:02x}{color[1]//2:02x}{color[2]//2:02x}" + wire_body_tag = f"{self.wire_id}_body" + wire_body_shadow_tag = f"{self.wire_id}_body_shadow" + self.canvas.itemconfig(wire_body_tag,fill=encre) + self.canvas.itemconfig(wire_body_shadow_tag,fill=contour) + def button_action(self, action_name): """ Defines the action to perform when a button is clicked. From a0e52f71af438e548ae194c881be6226fd552974 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Tue, 5 Nov 2024 21:14:05 -0500 Subject: [PATCH 06/44] bug save-open logicFunction --- CircuitKHTest.json | 577 +++++++++++++++++++++++++++++++++++++++++++ SaveCircuitBase.json | 359 +++++++++++++++++++++++++++ component_sketch.py | 3 + 3 files changed, 939 insertions(+) create mode 100644 CircuitKHTest.json create mode 100644 SaveCircuitBase.json diff --git a/CircuitKHTest.json b/CircuitKHTest.json new file mode 100644 index 0000000..2d00f1d --- /dev/null +++ b/CircuitKHTest.json @@ -0,0 +1,577 @@ +{ + "_chip_1": { + "XY": [ + 71.0, + 161.5 + ], + "pinUL_XY": [ + 73.0, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC08", + "type": "74HC08", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "&", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_chip_2": { + "XY": [ + 176.05, + 161.5 + ], + "pinUL_XY": [ + 178.05, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC02", + "type": "74HC02", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "!|", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_chip_3": { + "XY": [ + 281.1, + 161.5 + ], + "pinUL_XY": [ + 283.1, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC04", + "type": "74HC04", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "!", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_chip_4": { + "XY": [ + 386.15000000000003, + 161.5 + ], + "pinUL_XY": [ + 388.15000000000003, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "!&", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_chip_5": { + "XY": [ + 491.20000000000005, + 161.5 + ], + "pinUL_XY": [ + 493.20000000000005, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC32", + "type": "74HC32", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "|", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 1, + 17, + 32, + 25 + ] + ], + "multipoints": [ + 200, + 415, + 200, + 600, + 413, + 573 + ], + "color": [ + 255, + 0, + 0, + 255 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 72.5, + 425.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 537.5, + 575.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 35, + 12, + 35, + 13 + ] + ], + "multipoints": [], + "color": [ + 10, + 10, + 10, + 255 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 582.5, + 302.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 5, + 10, + 15, + 10 + ] + ], + "multipoints": [], + "color": [ + 0, + 80, + 0, + 255 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 227.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 282.5, + 227.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 2, + 6, + 40, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 255, + 0, + 255 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 87.5, + 137.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 657.5, + 32.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 51, + 1, + 48, + 13 + ] + ], + "multipoints": [], + "color": [ + 128, + 128, + 0, + 255 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 822.5, + 32.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 777.5, + 302.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_wire_11": { + "mode": 0, + "coord": [ + [ + 51, + 15, + 48, + 27 + ] + ], + "multipoints": [], + "color": [ + 128, + 128, + 0, + 255 + ], + "wire_body_tag": "_wire_11_body", + "endpoints": { + "start": { + "position": [ + 822.5, + 365.5 + ], + "tag": "_wire_11_start" + }, + "end": { + "position": [ + 777.5, + 635.5 + ], + "tag": "_wire_11_end" + } + } + }, + "_wire_12": { + "mode": 0, + "coord": [ + [ + 42, + 9, + 32, + 18 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_12_body", + "endpoints": { + "start": { + "position": [ + 687.5, + 212.5 + ], + "tag": "_wire_12_start" + }, + "end": { + "position": [ + 687.5, + 212.5 + ], + "tag": "_wire_12_end" + } + } + }, + "_wire_13": { + "mode": 0, + "coord": [ + [ + 32, + 18, + 43, + 18 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_13_body", + "endpoints": { + "start": { + "position": [ + 537.5, + 440.5 + ], + "tag": "_wire_13_start" + }, + "end": { + "position": [ + 537.5, + 440.5 + ], + "tag": "_wire_13_end" + } + } + } +} \ No newline at end of file diff --git a/SaveCircuitBase.json b/SaveCircuitBase.json new file mode 100644 index 0000000..d641b8b --- /dev/null +++ b/SaveCircuitBase.json @@ -0,0 +1,359 @@ +{ + "_chip_12": { + "XY": [ + 71.0, + 161.5 + ], + "pinUL_XY": [ + 73.0, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC08", + "type": "74HC08", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_chip_13": { + "XY": [ + 176.05, + 161.5 + ], + "pinUL_XY": [ + 178.05, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC02", + "type": "74HC02", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_chip_14": { + "XY": [ + 281.1, + 161.5 + ], + "pinUL_XY": [ + 283.1, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC04", + "type": "74HC04", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_chip_15": { + "XY": [ + 386.15000000000003, + 161.5 + ], + "pinUL_XY": [ + 388.15000000000003, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_chip_16": { + "XY": [ + 491.20000000000005, + 161.5 + ], + "pinUL_XY": [ + 493.20000000000005, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC32", + "type": "74HC32", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_wire_17": { + "mode": 0, + "coord": [ + [ + 1, + 17, + 32, + 25 + ] + ], + "multipoints": [ + 37, + 585, + 200, + 600, + 390, + 587 + ], + "color": [ + 255, + 0, + 0, + 255 + ], + "wire_body_tag": "_wire_17_body", + "endpoints": { + "start": { + "position": [ + 72.5, + 425.5 + ], + "tag": "_wire_17_start" + }, + "end": { + "position": [ + 537.5, + 575.5 + ], + "tag": "_wire_17_end" + } + } + }, + "_wire_18": { + "mode": 0, + "coord": [ + [ + 35, + 12, + 35, + 13 + ] + ], + "multipoints": [], + "color": [ + 10, + 10, + 10, + 255 + ], + "wire_body_tag": "_wire_18_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 257.5 + ], + "tag": "_wire_18_start" + }, + "end": { + "position": [ + 582.5, + 302.5 + ], + "tag": "_wire_18_end" + } + } + }, + "_wire_19": { + "mode": 0, + "coord": [ + [ + 5, + 10, + 15, + 10 + ] + ], + "multipoints": [], + "color": [ + 0, + 80, + 0, + 255 + ], + "wire_body_tag": "_wire_19_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 227.5 + ], + "tag": "_wire_19_start" + }, + "end": { + "position": [ + 282.5, + 227.5 + ], + "tag": "_wire_19_end" + } + } + }, + "_wire_20": { + "mode": 0, + "coord": [ + [ + 2, + 6, + 40, + 1 + ] + ], + "multipoints": [ + 623, + 119 + ], + "color": [ + 0, + 255, + 0, + 255 + ], + "wire_body_tag": "_wire_20_body", + "endpoints": { + "start": { + "position": [ + 87.5, + 137.5 + ], + "tag": "_wire_20_start" + }, + "end": { + "position": [ + 657.5, + 32.5 + ], + "tag": "_wire_20_end" + } + } + }, + "_wire_21": { + "mode": 0, + "coord": [ + [ + 51, + 1, + 48, + 13 + ] + ], + "multipoints": [ + 885, + 232 + ], + "color": [ + 128, + 128, + 0, + 255 + ], + "wire_body_tag": "_wire_21_body", + "endpoints": { + "start": { + "position": [ + 822.5, + 32.5 + ], + "tag": "_wire_21_start" + }, + "end": { + "position": [ + 777.5, + 302.5 + ], + "tag": "_wire_21_end" + } + } + }, + "_wire_22": { + "mode": 0, + "coord": [ + [ + 51, + 15, + 48, + 27 + ] + ], + "multipoints": [], + "color": [ + 128, + 128, + 0, + 255 + ], + "wire_body_tag": "_wire_22_body", + "endpoints": { + "start": { + "position": [ + 822.5, + 365.5 + ], + "tag": "_wire_22_start" + }, + "end": { + "position": [ + 777.5, + 635.5 + ], + "tag": "_wire_22_end" + } + } + }, + "_wire_23": { + "mode": 0, + "coord": [ + [ + 18, + 18, + 26, + 24 + ] + ], + "multipoints": [ + 400, + 431, + 397, + 548 + ], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_23_body", + "endpoints": { + "start": { + "position": [ + 327.5, + 440.5 + ], + "tag": "_wire_23_start" + }, + "end": { + "position": [ + 327.5, + 440.5 + ], + "tag": "_wire_23_end" + } + } + } +} \ No newline at end of file diff --git a/component_sketch.py b/component_sketch.py index 0a06849..1e8411a 100644 --- a/component_sketch.py +++ b/component_sketch.py @@ -1844,6 +1844,8 @@ def drawChip(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): io = value if key == "symbScript": symbScript = value + if key == "logicFunction": + logicFunction = value dimLine = (dim["pinCount"] - 0.30) * inter_space / 2 dimColumn = dim["chipWidth"] * inter_space @@ -1873,6 +1875,7 @@ def drawChip(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): params["btnMenu"] = [1, 1, 0] params["symbScript"] = symbScript params["io"] = io + params["logicFunction"] = logicFunction nbBrocheParCote = dim["pinCount"] // 2 #self.change_hole_state(xD,yD,nbBrocheParCote,USED) tagBase = "base" + id From f838f0a24ca40e5e1a3f256bc052bb915e08c0f3 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Wed, 6 Nov 2024 10:11:37 -0500 Subject: [PATCH 07/44] circuit 2 fonctions --- CircuitBaseMd.json | 133 ++++++++++ CircuitTest.json | 509 +++++++++++++++++++++++++++++++++++++++ CircuitTest2.json | 559 +++++++++++++++++++++++++++++++++++++++++++ component_sketch.py | 17 +- menus.py | 10 +- strcuture2donnees.md | 2 +- 6 files changed, 1219 insertions(+), 11 deletions(-) create mode 100644 CircuitBaseMd.json create mode 100644 CircuitTest.json create mode 100644 CircuitTest2.json diff --git a/CircuitBaseMd.json b/CircuitBaseMd.json new file mode 100644 index 0000000..1e444b0 --- /dev/null +++ b/CircuitBaseMd.json @@ -0,0 +1,133 @@ +{ + "_chip_1": { + "XY": [ + 71.0, + 161.5 + ], + "type": "74HC08", + "label": "74HC08-1", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_chip_2": { + "XY": [ + 176.05, + 161.5 + ], + "type": "74HC02", + "label": "74HC02-1", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_chip_3": { + "XY": [ + 281.1, + 161.5 + ], + "type": "74HC04", + "label": "74HC04-1", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_chip_4": { + "XY": [ + 386.15000000000003, + 161.5 + ], + "type": "74HC00", + "label": "74HC00-1", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_chip_5": { + "XY": [ + 491.20000000000005, + 161.5 + ], + "type": "74HC32", + "label": "74HC32-1", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_wire_6": { + "XY": [ + 22.5, + 415.5, + 502.5, + 445.5 + ], + "type": null, + "label": null, + "btnMenu": null + }, + "_wire_7": { + "XY": [ + 532.5, + 247.5, + 532.5, + 292.5 + ], + "type": null, + "label": null, + "btnMenu": null + }, + "_wire_8": { + "XY": [ + 82.5, + 217.5, + 232.5, + 217.5 + ], + "type": null, + "label": null, + "btnMenu": null + }, + "_wire_9": { + "XY": [ + 37.5, + 127.5, + 607.5, + 22.5 + ], + "type": null, + "label": null, + "btnMenu": null + }, + "_wire_10": { + "XY": [ + 772.5, + 22.5, + 487.5, + 565.5 + ], + "type": null, + "label": null, + "btnMenu": null + }, + "_wire_11": { + "XY": [ + 772.5, + 355.5, + 727.5, + 625.5 + ], + "type": null, + "label": null, + "btnMenu": null + } +} \ No newline at end of file diff --git a/CircuitTest.json b/CircuitTest.json new file mode 100644 index 0000000..9ca8c34 --- /dev/null +++ b/CircuitTest.json @@ -0,0 +1,509 @@ +{ + "_chip_1": { + "XY": [ + 71.0, + 161.5 + ], + "pinUL_XY": [ + 73.0, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC08", + "type": "74HC08", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "&", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_chip_2": { + "XY": [ + 176.05, + 161.5 + ], + "pinUL_XY": [ + 178.05, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC02", + "type": "74HC02", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "!|", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_chip_3": { + "XY": [ + 281.1, + 161.5 + ], + "pinUL_XY": [ + 283.1, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC04", + "type": "74HC04", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "!", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_chip_4": { + "XY": [ + 386.15000000000003, + 161.5 + ], + "pinUL_XY": [ + 388.15000000000003, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "!&", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_chip_5": { + "XY": [ + 491.20000000000005, + 161.5 + ], + "pinUL_XY": [ + 493.20000000000005, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC32", + "type": "74HC32", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "|", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 1, + 17, + 32, + 25 + ] + ], + "multipoints": [ + 200, + 415, + 200, + 600, + 400, + 500 + ], + "color": [ + 255, + 0, + 0, + 255 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 72.5, + 425.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 537.5, + 575.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 35, + 12, + 35, + 13 + ] + ], + "multipoints": [], + "color": [ + 10, + 10, + 10, + 255 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 582.5, + 302.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 5, + 10, + 15, + 10 + ] + ], + "multipoints": [], + "color": [ + 0, + 80, + 0, + 255 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 227.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 282.5, + 227.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 2, + 6, + 40, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 255, + 0, + 255 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 87.5, + 137.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 657.5, + 32.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 51, + 1, + 48, + 13 + ] + ], + "multipoints": [], + "color": [ + 128, + 128, + 0, + 255 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 822.5, + 32.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 777.5, + 302.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_wire_11": { + "mode": 0, + "coord": [ + [ + 51, + 15, + 48, + 27 + ] + ], + "multipoints": [], + "color": [ + 128, + 128, + 0, + 255 + ], + "wire_body_tag": "_wire_11_body", + "endpoints": { + "start": { + "position": [ + 822.5, + 365.5 + ], + "tag": "_wire_11_start" + }, + "end": { + "position": [ + 777.5, + 635.5 + ], + "tag": "_wire_11_end" + } + } + } +} \ No newline at end of file diff --git a/CircuitTest2.json b/CircuitTest2.json new file mode 100644 index 0000000..7657db3 --- /dev/null +++ b/CircuitTest2.json @@ -0,0 +1,559 @@ +{ + "_chip_12": { + "XY": [ + 71.0, + 161.5 + ], + "pinUL_XY": [ + 73.0, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC08", + "type": "74HC08", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "&", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_chip_13": { + "XY": [ + 176.05, + 161.5 + ], + "pinUL_XY": [ + 178.05, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC02", + "type": "74HC02", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "!|", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_chip_14": { + "XY": [ + 281.1, + 161.5 + ], + "pinUL_XY": [ + 283.1, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC04", + "type": "74HC04", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "!", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_chip_15": { + "XY": [ + 386.15000000000003, + 161.5 + ], + "pinUL_XY": [ + 388.15000000000003, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "!&", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ] + }, + "_chip_16": { + "XY": [ + 655.5, + 161.5 + ], + "pinUL_XY": [ + 657.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC32", + "type": "74HC32", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "|", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "occupied_holes": [ + "40,7", + "40,8", + "41,7", + "41,8", + "42,7", + "42,8", + "43,7", + "43,8", + "44,7", + "44,8", + "45,7", + "45,8", + "46,7", + "46,8" + ] + }, + "_wire_17": { + "mode": 0, + "coord": [ + [ + 1, + 17, + 32, + 25 + ] + ], + "multipoints": [ + 200, + 415, + 388, + 421, + 400, + 500 + ], + "color": [ + 255, + 0, + 0, + 255 + ], + "wire_body_tag": "_wire_17_body", + "endpoints": { + "start": { + "position": [ + 72.5, + 425.5 + ], + "tag": "_wire_17_start" + }, + "end": { + "position": [ + 537.5, + 575.5 + ], + "tag": "_wire_17_end" + } + } + }, + "_wire_18": { + "mode": 0, + "coord": [ + [ + 35, + 12, + 35, + 13 + ] + ], + "multipoints": [], + "color": [ + 10, + 10, + 10, + 255 + ], + "wire_body_tag": "_wire_18_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 257.5 + ], + "tag": "_wire_18_start" + }, + "end": { + "position": [ + 582.5, + 302.5 + ], + "tag": "_wire_18_end" + } + } + }, + "_wire_19": { + "mode": 0, + "coord": [ + [ + 5, + 10, + 15, + 10 + ] + ], + "multipoints": [], + "color": [ + 0, + 80, + 0, + 255 + ], + "wire_body_tag": "_wire_19_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 227.5 + ], + "tag": "_wire_19_start" + }, + "end": { + "position": [ + 282.5, + 227.5 + ], + "tag": "_wire_19_end" + } + } + }, + "_wire_20": { + "mode": 0, + "coord": [ + [ + 2, + 6, + 40, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 255, + 0, + 255 + ], + "wire_body_tag": "_wire_20_body", + "endpoints": { + "start": { + "position": [ + 87.5, + 137.5 + ], + "tag": "_wire_20_start" + }, + "end": { + "position": [ + 657.5, + 32.5 + ], + "tag": "_wire_20_end" + } + } + }, + "_wire_21": { + "mode": 0, + "coord": [ + [ + 51, + 1, + 48, + 13 + ] + ], + "multipoints": [], + "color": [ + 128, + 128, + 0, + 255 + ], + "wire_body_tag": "_wire_21_body", + "endpoints": { + "start": { + "position": [ + 822.5, + 32.5 + ], + "tag": "_wire_21_start" + }, + "end": { + "position": [ + 777.5, + 302.5 + ], + "tag": "_wire_21_end" + } + } + }, + "_wire_22": { + "mode": 0, + "coord": [ + [ + 51, + 15, + 48, + 27 + ] + ], + "multipoints": [], + "color": [ + 128, + 128, + 0, + 255 + ], + "wire_body_tag": "_wire_22_body", + "endpoints": { + "start": { + "position": [ + 822.5, + 365.5 + ], + "tag": "_wire_22_start" + }, + "end": { + "position": [ + 777.5, + 635.5 + ], + "tag": "_wire_22_end" + } + } + }, + "_wire_23": { + "mode": 0, + "coord": [ + [ + 7, + 25, + 16, + 19 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_23_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 575.5 + ], + "tag": "_wire_23_start" + }, + "end": { + "position": [ + 297.5, + 455.5 + ], + "tag": "_wire_23_end" + } + } + } +} \ No newline at end of file diff --git a/component_sketch.py b/component_sketch.py index 1e8411a..5e54004 100644 --- a/component_sketch.py +++ b/component_sketch.py @@ -1844,8 +1844,7 @@ def drawChip(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): io = value if key == "symbScript": symbScript = value - if key == "logicFunction": - logicFunction = value + dimLine = (dim["pinCount"] - 0.30) * inter_space / 2 dimColumn = dim["chipWidth"] * inter_space @@ -1875,7 +1874,7 @@ def drawChip(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): params["btnMenu"] = [1, 1, 0] params["symbScript"] = symbScript params["io"] = io - params["logicFunction"] = logicFunction + #params["logicFunction"] = logicFunction nbBrocheParCote = dim["pinCount"] // 2 #self.change_hole_state(xD,yD,nbBrocheParCote,USED) tagBase = "base" + id @@ -1934,8 +1933,8 @@ def drawChip(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): outline="#000000", tags=tagBase, ) - if dim["internalFunc"] is not None: - dim["internalFunc"](xD, yD, scale=scale, tags=tagBase, **kwargs) + # if dim["internalFunc"] is not None: + # dim["internalFunc"](xD, yD, scale=scale, tags=tagBase, **kwargs) self.rounded_rect( xD, yD, dimLine, dimColumn, 5, outline="#343434", fill="#343434", thickness=thickness, tags=tagCapot @@ -2000,10 +1999,10 @@ def drawChip(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): else: params["tags"].append(tagCapot) current_dict_circuit[id] = params - self.drawMenu(xD + dimLine + 2.3 * scale + space * 0, yD - space, thickness, label, tagMenu, id) - self.canvas.tag_bind( - tagSouris, "", lambda event: self.onMenu(event, tagMenu, "componentMenu", tagSouris) - ) + # self.drawMenu(xD + dimLine + 2.3 * scale + space * 0, yD - space, thickness, label, tagMenu, id) + # self.canvas.tag_bind( + # tagSouris, "", lambda event: self.onMenu(event, tagMenu, "componentMenu", tagSouris) + # ) # Bind left-click to initiate drag self.canvas.tag_bind(tagSouris, "", lambda event, chip_id=id: self.on_chip_click(event, chip_id)) diff --git a/menus.py b/menus.py index 8b6c7f1..d7bf8ad 100644 --- a/menus.py +++ b/menus.py @@ -381,6 +381,14 @@ def checkCircuit(self): (x, y) = chip["pinUL_XY"] numPinUL = chip["pinCount"] // 2 (real_x,real_y),(col,line) = self.sketcher.find_nearest_grid_chip(x,y) + ioIn, ioOut = [], [] for io in chip["io"]: # [([(ce1, le1), ...], "&", [(cs1, ls1), (cs2, ls2), ...]), ...] - print(f"ce1-ce2, func, cs1:({io[0][0]}-{io[0][1]} , {chip["symbScript"]} , {io[1][0]})") + #ioIN, ioOut = [], [] + ioIn = [(col + (numPin % numPinUL) -1 + (numPin // numPinUL), line + 1 - (numPin // numPinUL)) for numPin in io[0]] + ioOut = [(col + (numPin % numPinUL) -1 + (numPin // numPinUL), line + 1 - (numPin // numPinUL)) for numPin in io[1]] + func += [(ioIn, chip["symbScript"], ioOut)] + print(f"ioIN = {ioIn}") + print(f"ioOUT = {ioOut}") + print(f"func= {func}") + #print(f"ce1-ce2, func, cs1:({io[0][0]}-{io[0][1]} , {chip["symbScript"]} , {io[1][0]})") diff --git a/strcuture2donnees.md b/strcuture2donnees.md index 29c7607..a302f35 100644 --- a/strcuture2donnees.md +++ b/strcuture2donnees.md @@ -19,7 +19,7 @@ Ce dictionnaire est rempli lors de la création des composants à travers les fo ```python connexion_circuit = { "io": [(col, line, "in"/"out"), ...], - "wire" : [(col, line), ...], + "wire" : [(col1, line1,col2,line2), ...], "pwr" : [(col, line, "+" ou "-"), ...], "func" : [([(ce1, le1), ...], "&", [(cs1, ls1), (cs2, ls2), ...]), ...] } From 0f5f16d7dc5675fcfdaa3c2533c453aebb77763f Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Sun, 10 Nov 2024 13:12:08 -0500 Subject: [PATCH 08/44] circuit 2 fonction correctifs --- CicuitBug.json | 314 ++++++++++++++++++++++++++++++++++++++++++++ Circuit1Cable.json | 36 +++++ component_sketch.py | 3 + dataComponent.py | 5 + 4 files changed, 358 insertions(+) create mode 100644 CicuitBug.json create mode 100644 Circuit1Cable.json diff --git a/CicuitBug.json b/CicuitBug.json new file mode 100644 index 0000000..5859c37 --- /dev/null +++ b/CicuitBug.json @@ -0,0 +1,314 @@ +{ + "_chip_1": { + "XY": [ + 71.0, + 161.5 + ], + "pinUL_XY": [ + 73.0, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC08", + "type": "74HC08", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_chip_2": { + "XY": [ + 176.05, + 161.5 + ], + "pinUL_XY": [ + 178.05, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC02", + "type": "74HC02", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_chip_3": { + "XY": [ + 281.1, + 161.5 + ], + "pinUL_XY": [ + 283.1, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC04", + "type": "74HC04", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_chip_4": { + "XY": [ + 386.15000000000003, + 161.5 + ], + "pinUL_XY": [ + 388.15000000000003, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_chip_5": { + "XY": [ + 678.2, + 160.5 + ], + "pinUL_XY": [ + 680.2, + 151.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC32", + "type": "74HC32", + "btnMenu": [ + 1, + 1, + 0 + ] + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 1, + 17, + 32, + 25 + ] + ], + "multipoints": [ + 200, + 415, + 405, + 305, + 400, + 500 + ], + "color": [ + 255, + 0, + 0, + 255 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 72.5, + 425.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 537.5, + 575.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 35, + 12, + 35, + 13 + ] + ], + "multipoints": [], + "color": [ + 10, + 10, + 10, + 255 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 582.5, + 302.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 5, + 10, + 15, + 10 + ] + ], + "multipoints": [], + "color": [ + 0, + 80, + 0, + 255 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 227.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 282.5, + 227.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 2, + 6, + 40, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 255, + 0, + 255 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 87.5, + 137.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 657.5, + 32.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 51, + 1, + 48, + 13 + ] + ], + "multipoints": [], + "color": [ + 128, + 128, + 0, + 255 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 822.5, + 32.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 777.5, + 302.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_wire_11": { + "mode": 0, + "coord": [ + [ + 51, + 15, + 48, + 27 + ] + ], + "multipoints": [], + "color": [ + 128, + 128, + 0, + 255 + ], + "wire_body_tag": "_wire_11_body", + "endpoints": { + "start": { + "position": [ + 822.5, + 365.5 + ], + "tag": "_wire_11_start" + }, + "end": { + "position": [ + 777.5, + 635.5 + ], + "tag": "_wire_11_end" + } + } + } +} \ No newline at end of file diff --git a/Circuit1Cable.json b/Circuit1Cable.json new file mode 100644 index 0000000..6bc6f94 --- /dev/null +++ b/Circuit1Cable.json @@ -0,0 +1,36 @@ +{ + "_wire_12": { + "mode": 0, + "coord": [ + [ + 17, + 9, + 29, + 22 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_12_body", + "endpoints": { + "start": { + "position": [ + 312.5, + 212.5 + ], + "tag": "_wire_12_start" + }, + "end": { + "position": [ + 312.5, + 212.5 + ], + "tag": "_wire_12_end" + } + } + } +} \ No newline at end of file diff --git a/component_sketch.py b/component_sketch.py index 5e54004..6c1553b 100644 --- a/component_sketch.py +++ b/component_sketch.py @@ -1844,6 +1844,8 @@ def drawChip(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): io = value if key == "symbScript": symbScript = value + if key == "pwr": + pwr = value dimLine = (dim["pinCount"] - 0.30) * inter_space / 2 @@ -1874,6 +1876,7 @@ def drawChip(self, xD, yD, scale=1, width=-1, direction=HORIZONTAL, **kwargs): params["btnMenu"] = [1, 1, 0] params["symbScript"] = symbScript params["io"] = io + params["pwr"] = pwr #params["logicFunction"] = logicFunction nbBrocheParCote = dim["pinCount"] // 2 #self.change_hole_state(xD,yD,nbBrocheParCote,USED) diff --git a/dataComponent.py b/dataComponent.py index 4180262..b6e061a 100644 --- a/dataComponent.py +++ b/dataComponent.py @@ -35,6 +35,7 @@ def __init__(self, sketcher: ComponentSketcher): pins7400 = { "logicFunction": self.sketcher.symbNAND, "symbScript" : "!&", + "pwr" : [(6,"-"), (7,"+")], "io": [ ( [1, 2], @@ -65,6 +66,7 @@ def __init__(self, sketcher: ComponentSketcher): pins7402 = { "logicFunction": self.sketcher.symbNOR, "symbScript" : "!|", + "pwr" : [(6,"-"), (7,"+")], "io": [ ( [1, 2], @@ -95,6 +97,7 @@ def __init__(self, sketcher: ComponentSketcher): pins7404 = { "logicFunction": self.sketcher.symbNOT, "symbScript" : "!", + "pwr" : [(6,"-"), (7,"+")], "io": [ ( [1, 2], @@ -125,6 +128,7 @@ def __init__(self, sketcher: ComponentSketcher): pins7408 = { "logicFunction": self.sketcher.symbAND, "symbScript" : "&", + "pwr" : [(6,"-"), (7,"+")], "io": [ ( [1, 2], @@ -155,6 +159,7 @@ def __init__(self, sketcher: ComponentSketcher): pins7432 = { "logicFunction": self.sketcher.symbOR, "symbScript" : "|", + "pwr" : [(6,"-"), (7,"+")], "io": [ ( [1, 2], From db46c0a9d8f1420ea9839d765833f1466089ea49 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Sun, 10 Nov 2024 13:12:51 -0500 Subject: [PATCH 09/44] correctif 2 : cir 2 fonc --- menus.py | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/menus.py b/menus.py index d7bf8ad..495c56a 100644 --- a/menus.py +++ b/menus.py @@ -375,20 +375,35 @@ def about(self): def checkCircuit(self): print("Lancer la vérification") - func =[] - for id, chip in current_dict_circuit.items(): + func = [] + wire = [] + pwr = [(61,1,"-"), (61,2,"+")] # [(col, line, "+" ou "-"), ...] + pwrChip = {"+" : [], "-": []} + io = [] + for id, component in current_dict_circuit.items(): if id[:6] == "_chip_": - (x, y) = chip["pinUL_XY"] - numPinUL = chip["pinCount"] // 2 + (x, y) = component["pinUL_XY"] + numPinUL = component["pinCount"] // 2 (real_x,real_y),(col,line) = self.sketcher.find_nearest_grid_chip(x,y) ioIn, ioOut = [], [] - for io in chip["io"]: # [([(ce1, le1), ...], "&", [(cs1, ls1), (cs2, ls2), ...]), ...] + for io in component["io"]: # [([(ce1, le1), ...], "&", [(cs1, ls1), (cs2, ls2), ...]), ...] #ioIN, ioOut = [], [] ioIn = [(col + (numPin % numPinUL) -1 + (numPin // numPinUL), line + 1 - (numPin // numPinUL)) for numPin in io[0]] ioOut = [(col + (numPin % numPinUL) -1 + (numPin // numPinUL), line + 1 - (numPin // numPinUL)) for numPin in io[1]] - func += [(ioIn, chip["symbScript"], ioOut)] - print(f"ioIN = {ioIn}") - print(f"ioOUT = {ioOut}") - print(f"func= {func}") + func += [(id,ioIn, component["symbScript"], ioOut)] + #print(f"ioIN = {ioIn}") + #print(f"ioOUT = {ioOut}") + #print(f"func= {func}") #print(f"ce1-ce2, func, cs1:({io[0][0]}-{io[0][1]} , {chip["symbScript"]} , {io[1][0]})") + for pwr in component["pwr"]: + numPin, polarity = pwr[0], pwr[1] + pwrChip[polarity] += [(id,col + (numPin % numPinUL) -1 + (numPin // numPinUL), line + 1 - (numPin // numPinUL))] + #print(f"pwrChip= {pwrChip}") + elif id[:6] == "_wire_": # [(col1, line1,col2,line2), ...] + wire += component["coord"] + print(f"func= {func}\n") + print(f"pwrChip= {pwrChip}\n") + print(f"wire = {wire}") + + From b4e61d5ac4f6b8f2402453f5bb57d013aed4079f Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Sun, 10 Nov 2024 14:31:36 -0500 Subject: [PATCH 10/44] Fix menu --- menus.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/menus.py b/menus.py index a569a8f..f3099c3 100644 --- a/menus.py +++ b/menus.py @@ -108,9 +108,9 @@ def create_menu(self, menu_name, options, menu_commands): self.menu_bar, text=menu_name, bg="#333333", - fg="blue", + fg="white", activebackground="#444444", - activeforeground="blue", + activeforeground="white", highlightbackground="#333333", # Border color when inactive highlightcolor="#444444", # Border color when active bd=0, @@ -122,12 +122,12 @@ def create_menu(self, menu_name, options, menu_commands): btn.pack(side="left") # Create the dropdown frame - dropdown = tk.Frame(self.parent, bg="#333333", bd=1, relief="solid") + dropdown = tk.Frame(self.parent, bg="#333333", bd=1, relief="solid", width=200) # Calculate dropdown height based on number of options button_height = 30 # Approximate height of each dropdown button dropdown_height = button_height * len(options) - dropdown.place(x=0, y=0, width=150, height=dropdown_height) # Initial size based on options + dropdown.place(x=0, y=0, width=200, height=dropdown_height) # Initial size based on options dropdown.place_forget() # Hide initially # Populate the dropdown with menu options @@ -136,19 +136,20 @@ def create_menu(self, menu_name, options, menu_commands): dropdown, text=option, bg="#333333", - fg="blue", + fg="white", activebackground="#444444", - activeforeground="blue", + activeforeground="white", highlightbackground="#333333", # Border color when inactive highlightcolor="#444444", # Border color when active bd=0, anchor="w", + width=200, padx=20, pady=5, font=("FiraCode-Bold", 12), command=menu_commands.get(option, lambda opt=option: print(f"{opt} selected")), ) - option_btn.pack(fill="x") + option_btn.pack(fill="both") # Attach the dropdown to the button btn.dropdown = dropdown @@ -170,7 +171,7 @@ def toggle_dropdown(self, menu_name): # Position the dropdown below the button btn_x = child.winfo_rootx() - self.parent.winfo_rootx() btn_y = child.winfo_rooty() - self.parent.winfo_rooty() + child.winfo_height() - child.dropdown.place(x=btn_x, y=btn_y, width=150) + child.dropdown.place(x=btn_x, y=btn_y, width=200) print(f"Opened dropdown for {menu_name}") child.dropdown.lift() # Ensure dropdown is on top else: From 020db761f62f39009599ba81952446ef34a639a7 Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Sun, 10 Nov 2024 14:40:51 -0500 Subject: [PATCH 11/44] Load ios --- menus.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/menus.py b/menus.py index f3099c3..d007862 100644 --- a/menus.py +++ b/menus.py @@ -93,7 +93,8 @@ def __init__( self.create_menu(menu_name, options, menu_commands) # Bind to parent to close dropdowns when clicking outside - self.parent.bind("", self.close_dropdown) + self.parent.bind("", self.close_dropdown, add="+") + self.canvas.bind("", self.close_dropdown, add="+") def create_menu(self, menu_name, options, menu_commands): """ @@ -262,8 +263,19 @@ def open_file(self): ) ] self.board.sketcher.circuit(x_o, y_o, model=model_wire) + elif "io" in key: + model_io = [ + ( + self.board.sketcher.draw_pin_io, + 1, + { + **val, + "matrix": self.board.sketcher.matrix, + }, + ) + ] + self.board.sketcher.circuit(x_o, y_o, model=model_io) else: - # TODO add IO print(f"Unspecified component: {key}") messagebox.showinfo("Open File", f"Circuit loaded from {file_path}") except Exception as e: From 722afd0fa64661eb31490ce80d422e758e560b51 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Thu, 14 Nov 2024 23:05:41 -0500 Subject: [PATCH 12/44] =?UTF-8?q?t=C3=A9l=C3=A9versement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- breadboard.py | 8 ++-- component_sketch.py | 8 ++-- menus.py | 92 ++++++++++++++++++++++++++++++++++++++++++--- sidebar.py | 2 +- 4 files changed, 96 insertions(+), 14 deletions(-) diff --git a/breadboard.py b/breadboard.py index 4147d5c..c0b5506 100644 --- a/breadboard.py +++ b/breadboard.py @@ -89,7 +89,7 @@ def fill_matrix_830_pts(self, col_distance=1, line_distance=1): ), "coord": (2 + (i % 5) + col_distance + (i // 5) * 6, line_distance), "state": FREE, - "link": [(2 + col_distance, 1 + line_distance, 51 + col_distance, line_distance)], + "link": [(2 + col_distance, line_distance, 60 + col_distance, line_distance)], } matrix[id_top_plus] = { "id": ["mh", "moins haut", "2"], @@ -99,7 +99,7 @@ def fill_matrix_830_pts(self, col_distance=1, line_distance=1): ), "coord": (2 + (i % 5) + col_distance + (i // 5) * 6, 1 + line_distance), "state": FREE, - "link": [(2 + col_distance, 1 + line_distance, 51 + col_distance, 1 + line_distance)], + "link": [(2 + col_distance, 1 + line_distance, 60 + col_distance, 1 + line_distance)], } matrix[id_bot_minus] = { "id": ["pb", "plus bas", "13"], @@ -109,7 +109,7 @@ def fill_matrix_830_pts(self, col_distance=1, line_distance=1): ), "coord": (2 + (i % 5) + col_distance + (i // 5) * 6, 12 + line_distance), "state": FREE, - "link": [(2 + col_distance, 1 + line_distance, 51 + col_distance, 12 + line_distance)], + "link": [(2 + col_distance, line_distance, 60 + col_distance, 12 + line_distance)], } matrix[id_bot_plus] = { "id": ["mb", "moins bas", "14"], @@ -119,7 +119,7 @@ def fill_matrix_830_pts(self, col_distance=1, line_distance=1): ), "coord": (2 + (i % 5) + col_distance + (i // 5) * 6, 13 + line_distance), "state": FREE, - "link": [(2 + col_distance, 1 + line_distance, 51 + col_distance, 13 + line_distance)], + "link": [(2 + col_distance, 1 + line_distance, 60 + col_distance, 13 + line_distance)], } for l in range(5): for c in range(63): diff --git a/component_sketch.py b/component_sketch.py index 0af7ca1..bfb522c 100644 --- a/component_sketch.py +++ b/component_sketch.py @@ -2057,10 +2057,10 @@ def draw_chip(self, x_distance, y_distance, scale=1, width=-1, direction=HORIZON params["label"] = label params["type"] = chip_type params["btnMenu"] = [1, 1, 0] - #params["symbScript"] = symb_script - #params["io"] = io - #params["pwr"] = pwr - #params["logicFunction"] = logicFunction + params["symbScript"] = logic_function_name + params["io"] = io + params["pwr"] = pwr + params["logicFunction"] = logic_function_name params["pwr"] = dim["pwr"] num_pins_per_side = dim["pinCount"] // 2 tag_base = "base" + chip_id diff --git a/menus.py b/menus.py index d007862..cde3a0e 100644 --- a/menus.py +++ b/menus.py @@ -36,6 +36,7 @@ def __init__( current_dict_circuit: dict, zoom_function: Callable, sketcher: ComponentSketcher, + ): """ Initializes the custom menu bar. @@ -60,6 +61,10 @@ def __init__( self.sketcher = sketcher self.com_port: str | None = None """The selected COM port.""" + + self.baud_rate = 115200 + self.timeout = 1 + self.serial_conn = None # Create the menu bar frame (do not pack here) self.menu_bar = tk.Frame(parent, bg="#333333") @@ -81,6 +86,7 @@ def __init__( "Enregistrer": self.save_file, "Quitter": self.parent.quit, "Vérification": self.checkCircuit, + "Téléverser" : self.download_script, "Arduino": self.Arduino, "ESP32": self.ESP32, "Configurer le port série": self.configure_ports, @@ -369,28 +375,80 @@ def about(self): """Handler for the 'About' menu item.""" print("About this software") messagebox.showinfo("About", "ArduinoLogique v1.0\nSimulateur de circuits logiques") + + def open_port(self): + """Ouvre le port série.""" + try: + self.serial_conn = serial.Serial( + port=self.com_port, + baudrate=self.baud_rate, + timeout=self.timeout + ) + print(f"Port série {self.com_port} ouvert avec succès.") + except serial.SerialException as e: + print(f"Erreur lors de l'ouverture du port {self.com_port}: {e}") + + def send_data(self, data): + """ + Envoie une chaîne de caractères sur le port série. + :param data: Chaîne de caractères à envoyer. + """ + if self.serial_conn and self.serial_conn.is_open: + try: + # Convertir la chaîne en bytes et l'envoyer + self.serial_conn.write(data.encode('utf-8')) + print(f"Données envoyées: {data}") + except serial.SerialException as e: + print(f"Erreur lors de l'envoi des données: {e}") + else: + print("Le port série n'est pas ouvert. Impossible d'envoyer les données.") + + def close_port(self): + """Ferme le port série.""" + if self.serial_conn and self.serial_conn.is_open: + self.serial_conn.close() + print(f"Port série {self.com_port} fermé.") + else: + print("Le port série est déjà fermé.") + + def download_script(self, script): + self.open_port() + self.send_data(script) + self.close_port() + + def is_linked_to(self, dest, src): + res = False + c, l = src + for zone in dest: + c1, l1,c2, l2 = zone + if (c >= c1 and c<= c2 and l >= l1 and l<= l2): + res = True + break + return res def checkCircuit(self): print("Lancer la vérification") func = [] wire = [] - pwr = [(61, 1, "-"), (61, 2, "+")] # [(col, line, "+" ou "-"), ...] + pwrs = [(61, 1, "-"), (61, 2, "+")] # [(col, line, "+" ou "-"), ...] pwrChip = {"+": [], "-": []} io = [] + pwrM, pwrP = [], [] + for id, component in self.current_dict_circuit.items(): if id[:6] == "_chip_": (x, y) = component["pinUL_XY"] - numPinUL = component["pinCount"] // 2 + numPinBR = component["pinCount"] // 2 (real_x, real_y), (col, line) = self.sketcher.find_nearest_grid_chip(x, y) ioIn, ioOut = [], [] for io in component["io"]: # [([(ce1, le1), ...], "&", [(cs1, ls1), (cs2, ls2), ...]), ...] # ioIN, ioOut = [], [] ioIn = [ - (col + (numPin % numPinUL) - 1 + (numPin // numPinUL), line + 1 - (numPin // numPinUL)) + (col + (numPin % numPinBR) - 1 + (numPin // numPinBR), line + 1 - (numPin // numPinBR)) for numPin in io[0] ] ioOut = [ - (col + (numPin % numPinUL) - 1 + (numPin // numPinUL), line + 1 - (numPin // numPinUL)) + (col + (numPin % numPinBR) - 1 + (numPin // numPinBR), line + 1 - (numPin // numPinBR)) for numPin in io[1] ] func += [(id, ioIn, component["symbScript"], ioOut)] @@ -400,8 +458,10 @@ def checkCircuit(self): # print(f"ce1-ce2, func, cs1:({io[0][0]}-{io[0][1]} , {chip["symbScript"]} , {io[1][0]})") for pwr in component["pwr"]: numPin, polarity = pwr[0], pwr[1] + col_pin = col + numPin - 1 if numPin <= numPinBR else col + (component["pinCount"] - numPin) + line_pin = line if numPin > numPinBR else line+1 pwrChip[polarity] += [ - (id, col + (numPin % numPinUL) - 1 + (numPin // numPinUL), line + 1 - (numPin // numPinUL)) + (id, col_pin, line_pin) ] # print(f"pwrChip= {pwrChip}") elif id[:6] == "_wire_": # [(col1, line1,col2,line2), ...] @@ -409,3 +469,25 @@ def checkCircuit(self): print(f"func= {func}\n") print(f"pwrChip= {pwrChip}\n") print(f"wire = {wire}") + print(f"pwr = {pwrs}") + for pwr in pwrs: + (col, line, p) = pwr + if p == "-": + pwrM = deepcopy(self.board.sketcher.matrix[f"{col},{line}"]["link"]) + else: pwrP = deepcopy(self.board.sketcher.matrix[f"{col},{line}"]["link"]) + for w in wire: + c1,l1,c2,l2 = w + if self.is_linked_to(pwrM, (c1, l1)): + pwrM += self.board.sketcher.matrix[f"{c2},{l2}"]["link"] + elif self.is_linked_to(pwrP, (c1, l1)): + pwrP += self.board.sketcher.matrix[f"{c2},{l2}"]["link"] + if self.is_linked_to(pwrM, (c2, l2)): + pwrM += self.board.sketcher.matrix[f"{c1},{l1}"]["link"] + elif self.is_linked_to(pwrP, (c2, l2)): + pwrP += self.board.sketcher.matrix[f"{c1},{l1}"]["link"] + if (self.is_linked_to(pwrP, (c1, l1)) and self.is_linked_to(pwrM, (c1, l1))) or \ + (self.is_linked_to(pwrP, (c2, l2)) and self.is_linked_to(pwrM, (c2, l2))): + print(f"CC dans le cable {w}") + #pwrM.clear() + #pwrP.clear() + diff --git a/sidebar.py b/sidebar.py index 6101b1e..4de2a2f 100644 --- a/sidebar.py +++ b/sidebar.py @@ -213,7 +213,7 @@ def display_chips(self, chips: list[Tuple[Chip, tk.PhotoImage]]): self.chips_inner_frame, image=chip_image, text=chip.chip_type, - compound="top", + compound="center", font=fira_code_font, fg="white", # Set text color to white bg="#333333", From d9c821547cea8dfc4e575fc7a84a56f2650fed1b Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Thu, 21 Nov 2024 19:36:06 -0500 Subject: [PATCH 13/44] verif etn fonction finies --- .vscode/launch.json | 18 - .vscode/launchkh.json | 11 + ChipIO.json | 189 ++++++++++ "CircuitFerm\303\251.json" | 193 +++++++++++ DeuxFoisNot_Used.json | 240 +++++++++++++ TestCircuitAnd.json | 193 +++++++++++ TestCircuitAnd2.json | 193 +++++++++++ TestCircuitFerme2.json | 210 +++++++++++ TestCircuitFermeAnd.json | 215 ++++++++++++ TestCircuitFermeAndDouble.json | 611 +++++++++++++++++++++++++++++++++ TestIO.json | 172 ++++++++++ TestSave.json | 87 +++++ TestSave2.json | 87 +++++ TestWnotUsed.json | 193 +++++++++++ breadboard.py | 4 +- component_sketch.py | 2 +- menus.py | 253 ++++++++++++-- 17 files changed, 2814 insertions(+), 57 deletions(-) delete mode 100644 .vscode/launch.json create mode 100644 .vscode/launchkh.json create mode 100644 ChipIO.json create mode 100644 "CircuitFerm\303\251.json" create mode 100644 DeuxFoisNot_Used.json create mode 100644 TestCircuitAnd.json create mode 100644 TestCircuitAnd2.json create mode 100644 TestCircuitFerme2.json create mode 100644 TestCircuitFermeAnd.json create mode 100644 TestCircuitFermeAndDouble.json create mode 100644 TestIO.json create mode 100644 TestSave.json create mode 100644 TestSave2.json create mode 100644 TestWnotUsed.json diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 1fd8427..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "configurations": [ - { - "name": "ArduinoLogique", - "type": "debugpy", - "request": "launch", - "program": "${workspaceFolder}/arduino_logique.py", - "console": "integratedTerminal" - }, - { - "name": "ObjectModel", - "type": "debugpy", - "request": "launch", - "console": "integratedTerminal", - "module": "object_model.circuit_object_model", - } - ] -} \ No newline at end of file diff --git a/.vscode/launchkh.json b/.vscode/launchkh.json new file mode 100644 index 0000000..0381786 --- /dev/null +++ b/.vscode/launchkh.json @@ -0,0 +1,11 @@ +{ + "configurations": [ + { + "name": "ArduinoLogique", + "type": "debugpy", + "request": "launch", + "program": "arduino_logique.py", + "console": "integratedTerminal" + } + ] +} \ No newline at end of file diff --git a/ChipIO.json b/ChipIO.json new file mode 100644 index 0000000..40fd057 --- /dev/null +++ b/ChipIO.json @@ -0,0 +1,189 @@ +{ + "_chip_0": { + "XY": [ + 145.5, + 161.5 + ], + "pinUL_XY": [ + 147.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunction": "NandGate", + "occupied_holes": [ + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8", + "12,7", + "12,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 6, + 3, + 6, + 2 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 92.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 147.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 7, + 6, + 7, + 2 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 137.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 162.5, + 137.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 10, + 6, + 10, + 1 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 207.5, + 137.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 207.5, + 137.5 + ], + "tag": "_wire_2_end" + } + } + } +} \ No newline at end of file diff --git "a/CircuitFerm\303\251.json" "b/CircuitFerm\303\251.json" new file mode 100644 index 0000000..5e89878 --- /dev/null +++ "b/CircuitFerm\303\251.json" @@ -0,0 +1,193 @@ +{ + "_chip_0": { + "XY": [ + 190.5, + 161.5 + ], + "pinUL_XY": [ + 192.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": null, + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunction": null + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 9, + 2, + 9, + 5 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 192.5, + 122.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 9, + 19, + 9 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 267.5, + 212.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 9, + 11 + ] + ], + "XY": [ + 142.5, + 232.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0" + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 15, + 12, + 23, + 1 + ] + ], + "multipoints": [ + 349, + 249 + ], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 282.5, + 257.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 402.5, + 32.5 + ], + "tag": "_wire_2_end" + } + } + } +} \ No newline at end of file diff --git a/DeuxFoisNot_Used.json b/DeuxFoisNot_Used.json new file mode 100644 index 0000000..60ea58d --- /dev/null +++ b/DeuxFoisNot_Used.json @@ -0,0 +1,240 @@ +{ + "_wire_0": { + "mode": 0, + "coord": [ + [ + 9, + 2, + 10, + 6 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 192.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 18, + 10, + 25, + 10 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 327.5, + 227.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 327.5, + 227.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 20, + 5, + 23, + 5 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 122.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 357.5, + 122.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 33, + 3, + 34, + 1 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 552.5, + 92.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 552.5, + 92.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 23, + 4, + 34, + 4 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 402.5, + 107.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 402.5, + 107.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 34, + 5, + 33, + 5 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 567.5, + 122.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 567.5, + 122.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 10, + 7, + 20, + 7 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 207.5, + 152.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 207.5, + 152.5 + ], + "tag": "_wire_6_end" + } + } + } +} \ No newline at end of file diff --git a/TestCircuitAnd.json b/TestCircuitAnd.json new file mode 100644 index 0000000..a0b3cb1 --- /dev/null +++ b/TestCircuitAnd.json @@ -0,0 +1,193 @@ +{ + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": null, + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": null + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 9, + 12, + 1 + ] + ], + "multipoints": [ + 187, + 204 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 5, + 12 + ] + ], + "XY": [ + 82.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0" + }, + "_io_1": { + "coord": [ + [ + 6, + 9 + ] + ], + "XY": [ + 97.5, + 202.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1" + }, + "_io_2": { + "coord": [ + [ + 7, + 12 + ] + ], + "XY": [ + 112.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#008e00", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2" + } +} \ No newline at end of file diff --git a/TestCircuitAnd2.json b/TestCircuitAnd2.json new file mode 100644 index 0000000..12167a5 --- /dev/null +++ b/TestCircuitAnd2.json @@ -0,0 +1,193 @@ +{ + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate" + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 9, + 12, + 1 + ] + ], + "multipoints": [ + 188, + 202 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 5, + 12 + ] + ], + "XY": [ + 82.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0" + }, + "_io_1": { + "coord": [ + [ + 6, + 9 + ] + ], + "XY": [ + 97.5, + 202.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1" + }, + "_io_2": { + "coord": [ + [ + 7, + 12 + ] + ], + "XY": [ + 112.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#008e00", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2" + } +} \ No newline at end of file diff --git a/TestCircuitFerme2.json b/TestCircuitFerme2.json new file mode 100644 index 0000000..f3fe108 --- /dev/null +++ b/TestCircuitFerme2.json @@ -0,0 +1,210 @@ +{ + "_chip_0": { + "XY": [ + 190.5, + 161.5 + ], + "pinUL_XY": [ + 192.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": null, + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunction": null + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 9, + 2, + 9, + 5 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 192.5, + 122.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 9, + 11, + 12 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 267.5, + 212.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 18, + 10 + ] + ], + "XY": [ + 277.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0" + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 15, + 12, + 23, + 1 + ] + ], + "multipoints": [ + 349, + 249 + ], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 282.5, + 257.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 402.5, + 32.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 27, + 5 + ] + ], + "XY": [ + 412.5, + 112.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#fefb00", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1" + } +} \ No newline at end of file diff --git a/TestCircuitFermeAnd.json b/TestCircuitFermeAnd.json new file mode 100644 index 0000000..73a66f1 --- /dev/null +++ b/TestCircuitFermeAnd.json @@ -0,0 +1,215 @@ +{ + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate" + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 9, + 12, + 1 + ] + ], + "multipoints": [ + 186, + 203 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 7, + 12 + ] + ], + "XY": [ + 112.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0" + }, + "_io_1": { + "coord": [ + [ + 6, + 10 + ] + ], + "XY": [ + 97.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1" + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 5, + 9, + 5, + 6 + ] + ], + "multipoints": [ + 69, + 204, + 69, + 126 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 212.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 132.5, + 212.5 + ], + "tag": "_wire_2_end" + } + } + } +} \ No newline at end of file diff --git a/TestCircuitFermeAndDouble.json b/TestCircuitFermeAndDouble.json new file mode 100644 index 0000000..0f98144 --- /dev/null +++ b/TestCircuitFermeAndDouble.json @@ -0,0 +1,611 @@ +{ + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate" + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 9, + 12, + 1 + ] + ], + "multipoints": [ + 186, + 203 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 237.5, + 32.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 7, + 12 + ] + ], + "XY": [ + 112.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0" + }, + "_io_1": { + "coord": [ + [ + 6, + 10 + ] + ], + "XY": [ + 97.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1" + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 5, + 9, + 5, + 6 + ] + ], + "multipoints": [ + 69, + 204, + 69, + 126 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 212.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 132.5, + 137.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 8, + 12 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_io_2": { + "coord": [ + [ + 9, + 10 + ] + ], + "XY": [ + 142.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#0096ff", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2" + }, + "_io_3": { + "coord": [ + [ + 10, + 11 + ] + ], + "XY": [ + 157.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#fefb00", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3" + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 5, + 4, + 7, + 4 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 107.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 132.5, + 107.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_io_4": { + "coord": [ + [ + 6, + 3 + ] + ], + "XY": [ + 97.5, + 82.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4" + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 8, + 5, + 18, + 9 + ] + ], + "multipoints": [ + 263, + 114, + 264, + 203 + ], + "color": [ + 254, + 252, + 120 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 122.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 147.5, + 122.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_chip_1": { + "XY": [ + 325.5, + 161.5 + ], + "pinUL_XY": [ + 327.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "18,7", + "18,8", + "19,7", + "19,8", + "20,7", + "20,8", + "21,7", + "21,8", + "22,7", + "22,8", + "23,7", + "23,8", + "24,7", + "24,8" + ] + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 18, + 2, + 18, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 327.5, + 47.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 327.5, + 47.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 61, + 1, + 61, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 24, + 12, + 24, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 417.5, + 257.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 417.5, + 257.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 19, + 12, + 19, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 342.5, + 257.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 342.5, + 257.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_io_5": { + "coord": [ + [ + 20, + 11 + ] + ], + "XY": [ + 307.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5" + } +} \ No newline at end of file diff --git a/TestIO.json b/TestIO.json new file mode 100644 index 0000000..0eb2527 --- /dev/null +++ b/TestIO.json @@ -0,0 +1,172 @@ +{ + "_chip_0": { + "XY": [ + 115.5, + 161.5 + ], + "pinUL_XY": [ + 117.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunction": "NandGate", + "occupied_holes": [ + "4,7", + "4,8", + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8" + ] + }, + "_io_0": { + "coord": [ + [ + 6, + 11 + ] + ], + "XY": [ + 97.5, + 232.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0" + }, + "_io_1": { + "coord": [ + [ + 4, + 11 + ] + ], + "XY": [ + 67.5, + 232.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1" + }, + "_io_2": { + "coord": [ + [ + 8, + 10 + ] + ], + "XY": [ + 127.5, + 217.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2" + }, + "_io_3": { + "coord": [ + [ + 9, + 12 + ] + ], + "XY": [ + 142.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3" + }, + "_io_4": { + "coord": [ + [ + 10, + 12 + ] + ], + "XY": [ + 157.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4" + } +} \ No newline at end of file diff --git a/TestSave.json b/TestSave.json new file mode 100644 index 0000000..6249896 --- /dev/null +++ b/TestSave.json @@ -0,0 +1,87 @@ +{ + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunction": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + } +} \ No newline at end of file diff --git a/TestSave2.json b/TestSave2.json new file mode 100644 index 0000000..c4e45aa --- /dev/null +++ b/TestSave2.json @@ -0,0 +1,87 @@ +{ + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + } +} \ No newline at end of file diff --git a/TestWnotUsed.json b/TestWnotUsed.json new file mode 100644 index 0000000..0b08ff8 --- /dev/null +++ b/TestWnotUsed.json @@ -0,0 +1,193 @@ +{ + "_chip_0": { + "XY": [ + 190.5, + 161.5 + ], + "pinUL_XY": [ + 192.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": null, + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunction": null + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 9, + 2, + 9, + 5 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 192.5, + 122.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 9, + 14, + 9 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 267.5, + 212.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 15, + 11 + ] + ], + "XY": [ + 232.5, + 232.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0" + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 15, + 12, + 23, + 1 + ] + ], + "multipoints": [ + 349, + 249 + ], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 282.5, + 257.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 282.5, + 257.5 + ], + "tag": "_wire_2_end" + } + } + } +} \ No newline at end of file diff --git a/breadboard.py b/breadboard.py index c0b5506..b9626c5 100644 --- a/breadboard.py +++ b/breadboard.py @@ -109,7 +109,7 @@ def fill_matrix_830_pts(self, col_distance=1, line_distance=1): ), "coord": (2 + (i % 5) + col_distance + (i // 5) * 6, 12 + line_distance), "state": FREE, - "link": [(2 + col_distance, line_distance, 60 + col_distance, 12 + line_distance)], + "link": [(2 + col_distance, 12 + line_distance, 60 + col_distance, 12 + line_distance)], } matrix[id_bot_plus] = { "id": ["mb", "moins bas", "14"], @@ -119,7 +119,7 @@ def fill_matrix_830_pts(self, col_distance=1, line_distance=1): ), "coord": (2 + (i % 5) + col_distance + (i // 5) * 6, 13 + line_distance), "state": FREE, - "link": [(2 + col_distance, 1 + line_distance, 60 + col_distance, 13 + line_distance)], + "link": [(2 + col_distance, 13 + line_distance, 60 + col_distance, 13 + line_distance)], } for l in range(5): for c in range(63): diff --git a/component_sketch.py b/component_sketch.py index bfb522c..c3445e3 100644 --- a/component_sketch.py +++ b/component_sketch.py @@ -2060,7 +2060,7 @@ def draw_chip(self, x_distance, y_distance, scale=1, width=-1, direction=HORIZON params["symbScript"] = logic_function_name params["io"] = io params["pwr"] = pwr - params["logicFunction"] = logic_function_name + params["logicFunctionName"] = logic_function_name params["pwr"] = dim["pwr"] num_pins_per_side = dim["pinCount"] // 2 tag_base = "base" + chip_id diff --git a/menus.py b/menus.py index cde3a0e..6552046 100644 --- a/menus.py +++ b/menus.py @@ -13,7 +13,20 @@ from breadboard import Breadboard from component_sketch import ComponentSketcher - +from dataCDLT import ( + HORIZONTAL, + RIGHT, + VERTICAL, + VERTICAL_END_HORIZONTAL, + LEFT, + PERSO, + NO, + AUTO, + FREE, + USED, + INPUT, + OUTPUT, +) class Menus: """ @@ -61,6 +74,7 @@ def __init__( self.sketcher = sketcher self.com_port: str | None = None """The selected COM port.""" + self.script = "" self.baud_rate = 115200 self.timeout = 1 @@ -411,9 +425,10 @@ def close_port(self): else: print("Le port série est déjà fermé.") - def download_script(self, script): + def download_script(self): + self.checkCircuit() self.open_port() - self.send_data(script) + self.send_data(self.script) self.close_port() def is_linked_to(self, dest, src): @@ -425,15 +440,48 @@ def is_linked_to(self, dest, src): res = True break return res + + def checkCloseCircuit(self, ioOut): + id, (c1,l1,c2,l2) = ioOut + ioZone = [(c1,l1,c2,l2)] + findOut = False + for f in self.func: + id, inLst, fName, outLst = f + for out in outLst: + if self.is_linked_to(ioZone, out): + findOut = True + for inFunc in inLst: + findIn = False + if self.is_linked_to(self.pwrP, inFunc) or self.is_linked_to(self.pwrM, inFunc): + findIn = True + print("connecté à pwr") + if not findIn: + for io_inZone in self.io_in: + id, zone = io_inZone + if self.is_linked_to([zone], inFunc): + findIn = True + print("connecté à une ENTRÉE EXTERNE") + if not findIn: ## recherche d'une sortie de chip connectée à l'entrée actuelle de la chip + for nextOut in self.chip_out: + id, (c1, l1) = nextOut + outZone = deepcopy(self.board.sketcher.matrix[f"{c1},{l1}"]["link"]) + if self.is_linked_to(outZone, inFunc): + print("On passe à une autre sortie...") + ######## RAPPEL RECURSIF SUR OUTZONE ###################### + def checkCircuit(self): print("Lancer la vérification") - func = [] - wire = [] - pwrs = [(61, 1, "-"), (61, 2, "+")] # [(col, line, "+" ou "-"), ...] - pwrChip = {"+": [], "-": []} - io = [] - pwrM, pwrP = [], [] + self.func = [] + self.wire = [] + self.pwrs = [(61, 1, "-"), (61, 2, "+")] # [(col, line, "+" ou "-"), ...] + self.pwrChip = {"+": [], "-": [], "pwrConnected":[], "pwrNotConnected": [], "pwrMissConnected": []} # , "pwrNOTUSED": [], "pwrCC": [] + self.io_in, self.io_out = [], [] + self.chip_in, self.chip_out = [], [] + self.chip_ioCC, self.chip_ioOK = [], [] + self.pwrM, self.pwrP, self.wireNotUsed, self.pwrCC = [], [], [], [] + self.io_inCC, self.io_outCC = [], [] + self.chip_out_wire, self.chip_outCC = [], [] for id, component in self.current_dict_circuit.items(): if id[:6] == "_chip_": @@ -447,47 +495,180 @@ def checkCircuit(self): (col + (numPin % numPinBR) - 1 + (numPin // numPinBR), line + 1 - (numPin // numPinBR)) for numPin in io[0] ] + ioOut = [ (col + (numPin % numPinBR) - 1 + (numPin // numPinBR), line + 1 - (numPin // numPinBR)) for numPin in io[1] ] - func += [(id, ioIn, component["symbScript"], ioOut)] + self.func += [(id, ioIn, component["symbScript"], ioOut)] + self.chip_in += [(id, *ioIn)] + self.chip_out += [(id, *ioOut)] # print(f"ioIN = {ioIn}") # print(f"ioOUT = {ioOut}") - # print(f"func= {func}") - # print(f"ce1-ce2, func, cs1:({io[0][0]}-{io[0][1]} , {chip["symbScript"]} , {io[1][0]})") + # print(f"self.func= {self.func}") + # print(f"ce1-ce2, self.func, cs1:({io[0][0]}-{io[0][1]} , {chip["symbScript"]} , {io[1][0]})") for pwr in component["pwr"]: numPin, polarity = pwr[0], pwr[1] col_pin = col + numPin - 1 if numPin <= numPinBR else col + (component["pinCount"] - numPin) line_pin = line if numPin > numPinBR else line+1 - pwrChip[polarity] += [ + self.pwrChip[polarity] += [ (id, col_pin, line_pin) ] - # print(f"pwrChip= {pwrChip}") + # print(f"pwrChip= {self.pwrChip}") elif id[:6] == "_wire_": # [(col1, line1,col2,line2), ...] - wire += component["coord"] - print(f"func= {func}\n") - print(f"pwrChip= {pwrChip}\n") - print(f"wire = {wire}") - print(f"pwr = {pwrs}") - for pwr in pwrs: + self.wire += [(id, *component["coord"][0])] + elif id[:4] == "_io_": # [(col1, line1,col2,line2), ...] + (col, line) = component["coord"][0][0], component["coord"][0][1] + ioZone = deepcopy(self.board.sketcher.matrix[f"{col},{line}"]["link"]) + if component["type"] == INPUT: + self.io_in += [(id, *ioZone)] + else: + self.io_out += [(id, *ioZone)] + print(f"func= {self.func}\n") + print(f"pwrChip= {self.pwrChip}\n") + print(f"wire = {self.wire}") + print(f"pwr = {self.pwrs}") + print(f"io_in = {self.io_in}") + print(f"io_out = {self.io_out}") + print(f"chip_in = {self.chip_in}") + print(f"chip_out = {self.chip_out}") + for pwr in self.pwrs: (col, line, p) = pwr if p == "-": - pwrM = deepcopy(self.board.sketcher.matrix[f"{col},{line}"]["link"]) - else: pwrP = deepcopy(self.board.sketcher.matrix[f"{col},{line}"]["link"]) - for w in wire: - c1,l1,c2,l2 = w - if self.is_linked_to(pwrM, (c1, l1)): - pwrM += self.board.sketcher.matrix[f"{c2},{l2}"]["link"] - elif self.is_linked_to(pwrP, (c1, l1)): - pwrP += self.board.sketcher.matrix[f"{c2},{l2}"]["link"] - if self.is_linked_to(pwrM, (c2, l2)): - pwrM += self.board.sketcher.matrix[f"{c1},{l1}"]["link"] - elif self.is_linked_to(pwrP, (c2, l2)): - pwrP += self.board.sketcher.matrix[f"{c1},{l1}"]["link"] - if (self.is_linked_to(pwrP, (c1, l1)) and self.is_linked_to(pwrM, (c1, l1))) or \ - (self.is_linked_to(pwrP, (c2, l2)) and self.is_linked_to(pwrM, (c2, l2))): - print(f"CC dans le cable {w}") + self.pwrM = deepcopy(self.board.sketcher.matrix[f"{col},{line}"]["link"]) + else: self.pwrP = deepcopy(self.board.sketcher.matrix[f"{col},{line}"]["link"]) + for w in self.wire: + id,c1,l1,c2,l2 = w + if self.is_linked_to(self.pwrM, (c1, l1)): + self.pwrM += deepcopy(self.board.sketcher.matrix[f"{c2},{l2}"]["link"]) + elif self.is_linked_to(self.pwrP, (c1, l1)): + self.pwrP += deepcopy(self.board.sketcher.matrix[f"{c2},{l2}"]["link"]) + elif w not in self.wireNotUsed: + self.wireNotUsed += [w] #deepcopy(self.board.sketcher.matrix[f"{c2},{l2}"]["link"]) + if self.is_linked_to(self.pwrM, (c2, l2)): + self.pwrM += deepcopy(self.board.sketcher.matrix[f"{c2},{l2}"]["link"]) + elif self.is_linked_to(self.pwrP, (c2, l2)): + self.pwrP += deepcopy(self.board.sketcher.matrix[f"{c2},{l2}"]["link"]) + elif w not in self.wireNotUsed: + self.wireNotUsed += [w] #deepcopy(self.board.sketcher.matrix[f"{c2},{l2}"]["link"]) + again = True + while again and len(self.wireNotUsed)>0: + again = False + for wused in self.wireNotUsed[:]: + id,cu1,lu1,cu2,lu2 = wused + if self.is_linked_to(self.pwrM, (cu1, lu1)): + self.pwrM += deepcopy(self.board.sketcher.matrix[f"{cu2},{lu2}"]["link"]) + self.wireNotUsed.remove(wused) + again = True + elif self.is_linked_to(self.pwrP, (cu1, lu1)): + self.pwrP += deepcopy(self.board.sketcher.matrix[f"{cu2},{lu2}"]["link"]) + self.wireNotUsed.remove(wused) + again = True + + if self.is_linked_to(self.pwrM, (cu2, lu2)): + self.pwrM += deepcopy(self.board.sketcher.matrix[f"{cu1},{lu1}"]["link"]) + if not again: + self.wireNotUsed.remove(wused) + again = True + elif self.is_linked_to(self.pwrP, (cu2, lu2)): + self.pwrP += deepcopy(self.board.sketcher.matrix[f"{cu1},{lu1}"]["link"]) + if not again: + self.wireNotUsed.remove(wused) + again = True + if again: + if (self.is_linked_to(self.pwrP, (cu1, lu1)) and self.is_linked_to(self.pwrM, (cu1, lu1))) or \ + (self.is_linked_to(self.pwrP, (cu2, lu2)) and self.is_linked_to(self.pwrM, (cu2, lu2))): + self.pwrCC += [wused] + #print(f"CC dans le cable {wused}") + if (self.is_linked_to(self.pwrP, (c1, l1)) and self.is_linked_to(self.pwrM, (c1, l1))) or \ + (self.is_linked_to(self.pwrP, (c2, l2)) and self.is_linked_to(self.pwrM, (c2, l2))): + self.pwrCC += [w] + #print(f"CC dans le cable {w}") #pwrM.clear() #pwrP.clear() - + ############### Verification des chip sur pwr + ##################### + for chip in self.pwrChip["+"]: + id, col_pin, line_pin = chip + if self.is_linked_to(self.pwrP, (col_pin, line_pin)): + if id not in self.pwrChip["pwrConnected"]: + self.pwrChip["pwrConnected"].append((id,"+")) + elif self.is_linked_to(self.pwrM, (col_pin, line_pin)): + if id not in self.pwrChip["pwrMissConnected"]: + self.pwrChip["pwrMissConnected"].append((id,"+")) + elif id not in self.pwrChip["pwrNotConnected"]: + self.pwrChip["pwrNotConnected"].append((id,"+")) + ############### Verification des chip sur pwr - ##################### + for chip in self.pwrChip["-"]: + id, col_pin, line_pin = chip + if self.is_linked_to(self.pwrM, (col_pin, line_pin)): + if id not in self.pwrChip["pwrConnected"]: + self.pwrChip["pwrConnected"].append((id,"-")) + elif self.is_linked_to(self.pwrP, (col_pin, line_pin)): + if id not in self.pwrChip["pwrMissConnected"]: + self.pwrChip["pwrMissConnected"].append((id,"-")) + elif id not in self.pwrChip["pwrNotConnected"]: + self.pwrChip["pwrNotConnected"].append((id,"-")) + ############### Verification des chip_out sur pwr ##################### + for chipio in self.chip_out: + id, (c1,l1) = chipio + if self.is_linked_to(self.pwrM, (c1, l1)): + self.chip_ioCC += [chipio] + elif self.is_linked_to(self.pwrP, (c1, l1)): + self.chip_ioCC += [chipio] + else: + self.chip_ioOK += [chipio] + ############### Verification des chip_out sur io_in ##################### + for ioin in self.io_in: + if self.is_linked_to([ioin[1]], (c1, l1)): + self.io_outCC += [ioin[0]] + + ############### Verification des io_in sur pwr ##################### + for ioin in self.io_in: + c1, l1 = ioin[1][0], ioin[1][1] + if self.is_linked_to(self.pwrM, (c1, l1)): + if ioin[0] not in self.io_outCC: + self.io_outCC += [ioin[0]] + elif self.is_linked_to(self.pwrP, (c1, l1)): + if ioin[0] not in self.io_outCC: + self.io_outCC += [ioin[0]] + + ############### Verification des self.chip_out sur chip_out ##################### + for chipio in self.chip_out: + id, (c1,l1) = chipio + inChipOutWire = False + for cow in self.chip_out_wire: + if self.is_linked_to(cow, (c1, l1)): + inChipOutWire = True + if chipio not in self.chip_outCC: + self.chip_outCC += [(chipio)] + if not inChipOutWire: + cow = deepcopy(self.board.sketcher.matrix[f"{c1},{l1}"]["link"]) + again = True + while again and len(self.wireNotUsed)>0: + again = False + for wused in self.wireNotUsed[:]: + id,cu1,lu1,cu2,lu2 = wused + if self.is_linked_to(cow, (cu1, lu1)): + cow += deepcopy(self.board.sketcher.matrix[f"{cu2},{lu2}"]["link"]) + self.wireNotUsed.remove(wused) + again = True + elif self.is_linked_to(cow, (cu2, lu2)): + self.pwrP += deepcopy(self.board.sketcher.matrix[f"{cu1},{lu1}"]["link"]) + self.wireNotUsed.remove(wused) + again = True + self.chip_out_wire += [cow] + if not self.pwrCC and not self.pwrChip["pwrMissConnected"] and not self.chip_ioCC \ + and not self.io_outCC and not self.chip_outCC: + print("vérification du circuit fermé") + for ioOut in self.io_out: + self.checkCloseCircuit(ioOut) + + print(f"pwrChipConnected : {self.pwrChip["pwrConnected"]}") + print(f"pwrChipNotConnected : {self.pwrChip["pwrNotConnected"]}") + print(f"pwrChipMissConnected : {self.pwrChip["pwrMissConnected"]}") + print(f"wireNotUsed : {self.wireNotUsed}") + print(f"pwrCC : {self.pwrCC}") + print(f"chip_ioCC : {self.chip_ioCC}") + print(f"chip_ioOK : {self.chip_ioOK}") + print(f"io_outCC : {self.io_outCC}") + print(f"chip_outCC : {self.chip_outCC}") From d4e07781b444da1eb84808f1afb80c2075e3b529 Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Thu, 21 Nov 2024 20:22:45 -0500 Subject: [PATCH 14/44] Fixes after merge --- arduino_logique.py | 1 + menus.py | 54 +++++++--------------------------------------- 2 files changed, 9 insertions(+), 46 deletions(-) diff --git a/arduino_logique.py b/arduino_logique.py index 9219388..048f354 100644 --- a/arduino_logique.py +++ b/arduino_logique.py @@ -82,6 +82,7 @@ def refresh_sidebar(): canvas=canvas, board=board, current_dict_circuit=sketcher.current_dict_circuit, + sketcher=sketcher, ) # Placing the menu_bar in row=0, spanning both columns menus.menu_bar.grid(row=0, column=0, columnspan=2, sticky="nsew") diff --git a/menus.py b/menus.py index 542b33d..335c840 100644 --- a/menus.py +++ b/menus.py @@ -101,7 +101,6 @@ def __init__( canvas: tk.Canvas, board: Breadboard, current_dict_circuit: dict, - zoom_function: Callable, sketcher: ComponentSketcher, ): @@ -154,6 +153,8 @@ def __init__( "Configurer le port série": self.configure_ports, "Table de correspondance": self.show_correspondence_table, "Choisir un microcontrôleur": self.select_microcontroller, + "Vérifier": self.checkCircuit, + "Téléverser": self.download_script, "Documentation": self.open_documentation, "À propos": self.about, } @@ -584,7 +585,7 @@ def about(self): messagebox.showinfo("About", "ArduinoLogique v1.0\nSimulateur de circuits logiques") def open_port(self): - """Ouvre le port série.""" + """Handler for the 'Open Port' menu item.""" try: self.serial_conn = serial.Serial( port=self.com_port, @@ -597,8 +598,7 @@ def open_port(self): def send_data(self, data): """ - Envoie une chaîne de caractères sur le port série. - :param data: Chaîne de caractères à envoyer. + Send a string of data to the microcontroller through the serial port. """ if self.serial_conn and self.serial_conn.is_open: try: @@ -611,7 +611,7 @@ def send_data(self, data): print("Le port série n'est pas ouvert. Impossible d'envoyer les données.") def close_port(self): - """Ferme le port série.""" + """Upload the script to the microcontroller through the serial port.""" if self.serial_conn and self.serial_conn.is_open: self.serial_conn.close() print(f"Port série {self.com_port} fermé.") @@ -856,50 +856,12 @@ def checkCircuit(self): for ioOut in self.io_out: self.checkCloseCircuit(ioOut) - print(f"pwrChipConnected : {self.pwrChip["pwrConnected"]}") - print(f"pwrChipNotConnected : {self.pwrChip["pwrNotConnected"]}") - print(f"pwrChipMissConnected : {self.pwrChip["pwrMissConnected"]}") + print(f"pwrChipConnected : {self.pwrChip['pwrConnected']}") + print(f"pwrChipNotConnected : {self.pwrChip['pwrNotConnected']}") + print(f"pwrChipMissConnected : {self.pwrChip['pwrMissConnected']}") print(f"wireNotUsed : {self.wireNotUsed}") print(f"pwrCC : {self.pwrCC}") print(f"chip_ioCC : {self.chip_ioCC}") print(f"chip_ioOK : {self.chip_ioOK}") print(f"io_outCC : {self.io_outCC}") print(f"chip_outCC : {self.chip_outCC}") - - def open_port(self): - """Handler for the 'Open Port' menu item.""" - try: - self.serial_port.connection = serial.Serial( - port=self.serial_port.com_port, baudrate=self.serial_port.baud_rate, timeout=self.serial_port.timeout - ) - print(f"Port série {self.serial_port.com_port} ouvert avec succès.") - except serial.SerialException as e: - print(f"Erreur lors de l'ouverture du port {self.serial_port.com_port}: {e}") - - def send_data(self, data): - """ - Send a string of data to the microcontroller through the serial port. - """ - if self.serial_port.connection and self.serial_port.connection.is_open: - try: - # Convertir la chaîne en bytes et l'envoyer - self.serial_port.connection.write(data.encode("utf-8")) - print(f"Données envoyées: {data}") - except serial.SerialException as e: - print(f"Erreur lors de l'envoi des données: {e}") - else: - print("Le port série n'est pas ouvert. Impossible d'envoyer les données.") - - def close_port(self): - """Close the serial port.""" - if self.serial_port.connection and self.serial_port.connection.is_open: - self.serial_port.connection.close() - print(f"Port série {self.serial_port.com_port} fermé.") - else: - print("Le port série est déjà fermé.") - - def download_script(self, script): - """Upload the script to the microcontroller through the serial port.""" - self.open_port() - self.send_data(script) - self.close_port() From 00e8841eaa4dde84d77b50eef5dd14d7bf0ce926 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Fri, 22 Nov 2024 22:13:14 -0500 Subject: [PATCH 15/44] correction bug verif --- TestCicuitIOCC.json | 362 ++++++++++++++++++++++++++++ TestCicuitIOCC2.json | 409 ++++++++++++++++++++++++++++++++ TestCircuitFermeAndDouble.json | 145 +++++------ TestCircuitFermeAndSimple.json | 354 +++++++++++++++++++++++++++ TestCircuitOuvert2cascades.json | 388 ++++++++++++++++++++++++++++++ menus.py | 44 +++- sidebar.py | 4 +- 7 files changed, 1625 insertions(+), 81 deletions(-) create mode 100644 TestCicuitIOCC.json create mode 100644 TestCicuitIOCC2.json create mode 100644 TestCircuitFermeAndSimple.json create mode 100644 TestCircuitOuvert2cascades.json diff --git a/TestCicuitIOCC.json b/TestCicuitIOCC.json new file mode 100644 index 0000000..82b5f18 --- /dev/null +++ b/TestCicuitIOCC.json @@ -0,0 +1,362 @@ +{ + "_chip_0": { + "XY": [ + 145.5, + 161.5 + ], + "pinUL_XY": [ + 147.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8", + "12,7", + "12,8" + ] + }, + "_io_0": { + "coord": [ + [ + 6, + 12 + ] + ], + "XY": [ + 97.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0" + }, + "_io_1": { + "coord": [ + [ + 7, + 10 + ] + ], + "XY": [ + 112.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1" + }, + "_io_2": { + "coord": [ + [ + 9, + 12 + ] + ], + "XY": [ + 142.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2" + }, + "_io_3": { + "coord": [ + [ + 10, + 12 + ] + ], + "XY": [ + 157.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3" + }, + "_io_4": { + "coord": [ + [ + 7, + 5 + ] + ], + "XY": [ + 112.5, + 112.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4" + }, + "_io_5": { + "coord": [ + [ + 8, + 3 + ] + ], + "XY": [ + 127.5, + 82.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5" + }, + "_io_6": { + "coord": [ + [ + 10, + 3 + ] + ], + "XY": [ + 157.5, + 82.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_6", + "tag": "pin_io__io_6" + }, + "_io_7": { + "coord": [ + [ + 11, + 3 + ] + ], + "XY": [ + 172.5, + 82.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_7", + "tag": "pin_io__io_7" + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 6, + 2, + 6, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 147.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 12, + 9, + 13, + 1 + ] + ], + "multipoints": [ + 201, + 203 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 237.5, + 212.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 237.5, + 212.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_9": { + "coord": [ + [ + 9, + 6 + ] + ], + "XY": [ + 142.5, + 127.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#8df900", + "outline_tag": "pin_io_outline__io_9", + "tag": "pin_io__io_9" + }, + "_io_10": { + "coord": [ + [ + 12, + 6 + ] + ], + "XY": [ + 187.5, + 127.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#8df900", + "outline_tag": "pin_io_outline__io_10", + "tag": "pin_io__io_10" + }, + "_io_11": { + "coord": [ + [ + 11, + 12 + ] + ], + "XY": [ + 172.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_11", + "tag": "pin_io__io_11" + }, + "_io_12": { + "coord": [ + [ + 8, + 12 + ] + ], + "XY": [ + 127.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#8df900", + "outline_tag": "pin_io_outline__io_12", + "tag": "pin_io__io_12" + } +} \ No newline at end of file diff --git a/TestCicuitIOCC2.json b/TestCicuitIOCC2.json new file mode 100644 index 0000000..2a276be --- /dev/null +++ b/TestCicuitIOCC2.json @@ -0,0 +1,409 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1156, + 348.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1156, + 445.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_io_0": { + "coord": [ + [ + 7, + 11 + ] + ], + "XY": [ + 112.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 11, + 9, + 12, + 1 + ] + ], + "multipoints": [ + 185, + 207 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 237.5, + 32.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 6, + 6 + ] + ], + "XY": [ + 97.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#fefb00", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_io_2": { + "coord": [ + [ + 5, + 11 + ] + ], + "XY": [ + 82.5, + 232.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#fefb00", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_io_3": { + "coord": [ + [ + 6, + 11 + ] + ], + "XY": [ + 97.5, + 232.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#fefb00", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_io_4": { + "coord": [ + [ + 8, + 5 + ] + ], + "XY": [ + 127.5, + 112.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#fefb00", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_io_5": { + "coord": [ + [ + 7, + 3 + ] + ], + "XY": [ + 112.5, + 82.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#fefb00", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" + }, + "_io_6": { + "coord": [ + [ + 8, + 12 + ] + ], + "XY": [ + 127.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_6", + "tag": "pin_io__io_6", + "label_tag": "_io_6_label" + }, + "_io_7": { + "coord": [ + [ + 9, + 12 + ] + ], + "XY": [ + 142.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_7", + "tag": "pin_io__io_7", + "label_tag": "_io_7_label" + }, + "_io_8": { + "coord": [ + [ + 9, + 6 + ] + ], + "XY": [ + 142.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_8", + "tag": "pin_io__io_8", + "label_tag": "_io_8_label" + }, + "_io_9": { + "coord": [ + [ + 10, + 3 + ] + ], + "XY": [ + 157.5, + 82.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_9", + "tag": "pin_io__io_9", + "label_tag": "_io_9_label" + }, + "_io_10": { + "coord": [ + [ + 11, + 6 + ] + ], + "XY": [ + 172.5, + 127.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_10", + "tag": "pin_io__io_10", + "label_tag": "_io_10_label" + }, + "_io_11": { + "coord": [ + [ + 10, + 12 + ] + ], + "XY": [ + 157.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_11", + "tag": "pin_io__io_11", + "label_tag": "_io_11_label" + } +} \ No newline at end of file diff --git a/TestCircuitFermeAndDouble.json b/TestCircuitFermeAndDouble.json index 0f98144..9fcbcfc 100644 --- a/TestCircuitFermeAndDouble.json +++ b/TestCircuitFermeAndDouble.json @@ -1,4 +1,39 @@ { + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1156, + 348.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1156, + 445.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, "_chip_0": { "XY": [ 130.5, @@ -66,7 +101,23 @@ "-" ] ], - "logicFunctionName": "NandGate" + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] }, "_wire_0": { "mode": 0, @@ -154,7 +205,8 @@ "type": 1, "color": "#ffd478", "outline_tag": "pin_io_outline__io_0", - "tag": "pin_io__io_0" + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" }, "_io_1": { "coord": [ @@ -171,7 +223,8 @@ "type": 0, "color": "#479dff", "outline_tag": "pin_io_outline__io_1", - "tag": "pin_io__io_1" + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" }, "_wire_2": { "mode": 0, @@ -239,7 +292,7 @@ }, "end": { "position": [ - 222.5, + 177.5, 257.5 ], "tag": "_wire_3_end" @@ -261,58 +314,8 @@ "type": 0, "color": "#0096ff", "outline_tag": "pin_io_outline__io_2", - "tag": "pin_io__io_2" - }, - "_io_3": { - "coord": [ - [ - 10, - 11 - ] - ], - "XY": [ - 157.5, - 232.5 - ], - "controller_pin": "IO", - "type": 1, - "color": "#fefb00", - "outline_tag": "pin_io_outline__io_3", - "tag": "pin_io__io_3" - }, - "_wire_4": { - "mode": 0, - "coord": [ - [ - 5, - 4, - 7, - 4 - ] - ], - "multipoints": [], - "color": [ - 255, - 38, - 0 - ], - "wire_body_tag": "_wire_4_body", - "endpoints": { - "start": { - "position": [ - 132.5, - 107.5 - ], - "tag": "_wire_4_start" - }, - "end": { - "position": [ - 132.5, - 107.5 - ], - "tag": "_wire_4_end" - } - } + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" }, "_io_4": { "coord": [ @@ -329,23 +332,24 @@ "type": 0, "color": "#479dff", "outline_tag": "pin_io_outline__io_4", - "tag": "pin_io__io_4" + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" }, "_wire_5": { "mode": 0, "coord": [ [ - 8, + 7, 5, - 18, - 9 + 10, + 11 ] ], "multipoints": [ 263, 114, - 264, - 203 + 263, + 232 ], "color": [ 254, @@ -356,15 +360,15 @@ "endpoints": { "start": { "position": [ - 147.5, + 177.5, 122.5 ], "tag": "_wire_5_start" }, "end": { "position": [ - 147.5, - 122.5 + 327.5, + 212.5 ], "tag": "_wire_5_end" } @@ -483,7 +487,7 @@ "end": { "position": [ 327.5, - 47.5 + 92.5 ], "tag": "_wire_6_end" } @@ -517,7 +521,7 @@ "end": { "position": [ 972.5, - 32.5 + 302.5 ], "tag": "_wire_7_end" } @@ -551,7 +555,7 @@ "end": { "position": [ 417.5, - 257.5 + 302.5 ], "tag": "_wire_8_end" } @@ -585,7 +589,7 @@ "end": { "position": [ 342.5, - 257.5 + 302.5 ], "tag": "_wire_9_end" } @@ -606,6 +610,7 @@ "type": 1, "color": "#ffd478", "outline_tag": "pin_io_outline__io_5", - "tag": "pin_io__io_5" + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" } } \ No newline at end of file diff --git a/TestCircuitFermeAndSimple.json b/TestCircuitFermeAndSimple.json new file mode 100644 index 0000000..df7229a --- /dev/null +++ b/TestCircuitFermeAndSimple.json @@ -0,0 +1,354 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1159, + 351.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1159, + 448.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 9, + 12, + 1 + ] + ], + "multipoints": [ + 186, + 203 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 237.5, + 32.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 8, + 3 + ] + ], + "XY": [ + 127.5, + 82.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 8, + 12 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_io_2": { + "coord": [ + [ + 9, + 10 + ] + ], + "XY": [ + 142.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#0096ff", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_io_3": { + "coord": [ + [ + 6, + 3 + ] + ], + "XY": [ + 97.5, + 82.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 7, + 5, + 10, + 11 + ] + ], + "multipoints": [ + 263, + 114, + 263, + 232 + ], + "color": [ + 254, + 252, + 120 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 122.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 207.5, + 242.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 61, + 1, + 61, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 972.5, + 302.5 + ], + "tag": "_wire_6_end" + } + } + } +} \ No newline at end of file diff --git a/TestCircuitOuvert2cascades.json b/TestCircuitOuvert2cascades.json new file mode 100644 index 0000000..0d9efd1 --- /dev/null +++ b/TestCircuitOuvert2cascades.json @@ -0,0 +1,388 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1162, + 354.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1162, + 451.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 9, + 12, + 1 + ] + ], + "multipoints": [ + 186, + 203 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 237.5, + 32.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 8, + 3 + ] + ], + "XY": [ + 127.5, + 82.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 8, + 12 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 5, + 9 + ] + ], + "XY": [ + 82.5, + 202.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_io_2": { + "coord": [ + [ + 6, + 3 + ] + ], + "XY": [ + 97.5, + 82.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 7, + 5, + 10, + 11 + ] + ], + "multipoints": [ + 263, + 114, + 263, + 232 + ], + "color": [ + 254, + 252, + 120 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 122.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 207.5, + 242.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 61, + 1, + 61, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 972.5, + 302.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 7, + 10, + 9, + 10 + ] + ], + "multipoints": [], + "color": [ + 0, + 142, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 227.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 162.5, + 227.5 + ], + "tag": "_wire_5_end" + } + } + } +} \ No newline at end of file diff --git a/menus.py b/menus.py index 335c840..d789752 100644 --- a/menus.py +++ b/menus.py @@ -638,6 +638,8 @@ def checkCloseCircuit(self, ioOut): id, (c1,l1,c2,l2) = ioOut ioZone = [(c1,l1,c2,l2)] findOut = False + circuitClose = True + for f in self.func: id, inLst, fName, outLst = f for out in outLst: @@ -655,12 +657,31 @@ def checkCloseCircuit(self, ioOut): findIn = True print("connecté à une ENTRÉE EXTERNE") if not findIn: ## recherche d'une sortie de chip connectée à l'entrée actuelle de la chip - for nextOut in self.chip_out: - id, (c1, l1) = nextOut - outZone = deepcopy(self.board.sketcher.matrix[f"{c1},{l1}"]["link"]) - if self.is_linked_to(outZone, inFunc): - print("On passe à une autre sortie...") - ######## RAPPEL RECURSIF SUR OUTZONE ###################### + findNext =False + for nextOut in self.chip_out_wire: + #id, (c1, l1) = nextOut + #outZone = deepcopy(self.board.sketcher.matrix[f"{c1},{l1}"]["link"]) + + if self.is_linked_to(nextOut, inFunc): + for next in nextOut: + for cow in self.chip_out: + id, pt = cow + if self.is_linked_to([next], pt): + outZone =(id,next) + print("On passe à une autre sortie...") + ######## RAPPEL RECURSIF SUR OUTZONE ###################### + findNext = self.checkCloseCircuit(outZone) + break + if not findIn and not findNext: + self.in_outOC += [(id,inFunc)] + if not findOut: + self.in_outOC += [ioOut] + if not findOut and not findNext and not findNext: + circuitClose = False + + return circuitClose + + def checkCircuit(self): @@ -675,6 +696,7 @@ def checkCircuit(self): self.pwrM, self.pwrP, self.wireNotUsed, self.pwrCC = [], [], [], [] self.io_inCC, self.io_outCC = [], [] self.chip_out_wire, self.chip_outCC = [], [] + self.in_outOC = [] for id, component in self.current_dict_circuit.items(): if id[:6] == "_chip_": @@ -685,12 +707,14 @@ def checkCircuit(self): for io in component["io"]: # [([(ce1, le1), ...], "&", [(cs1, ls1), (cs2, ls2), ...]), ...] # ioIN, ioOut = [], [] ioIn = [ - (col + (numPin % numPinBR) - 1 + (numPin // numPinBR), line + 1 - (numPin // numPinBR)) + # (col + (numPin % numPinBR) - 1 + (numPin // numPinBR), line + 1 - (numPin // numPinBR)) + # for numPin in io[0] + (col + numPin - 1 if numPin <= numPinBR else col + (numPinBR - (numPin % numPinBR) ), line + 1 - (numPin // numPinBR)) for numPin in io[0] ] ioOut = [ - (col + (numPin % numPinBR) - 1 + (numPin // numPinBR), line + 1 - (numPin // numPinBR)) + (col + numPin - 1 if numPin <= numPinBR else col + (numPinBR - (numPin % numPinBR) ), line + 1 - (numPin // numPinBR)) for numPin in io[1] ] self.func += [(id, ioIn, component["symbScript"], ioOut)] @@ -846,7 +870,7 @@ def checkCircuit(self): self.wireNotUsed.remove(wused) again = True elif self.is_linked_to(cow, (cu2, lu2)): - self.pwrP += deepcopy(self.board.sketcher.matrix[f"{cu1},{lu1}"]["link"]) + cow += deepcopy(self.board.sketcher.matrix[f"{cu1},{lu1}"]["link"]) self.wireNotUsed.remove(wused) again = True self.chip_out_wire += [cow] @@ -865,3 +889,5 @@ def checkCircuit(self): print(f"chip_ioOK : {self.chip_ioOK}") print(f"io_outCC : {self.io_outCC}") print(f"chip_outCC : {self.chip_outCC}") + print(f"in_outOC : {self.in_outOC}") + print(f"chip_out_wire : {self.chip_out_wire}") diff --git a/sidebar.py b/sidebar.py index 03b3286..6402ca8 100644 --- a/sidebar.py +++ b/sidebar.py @@ -521,5 +521,5 @@ def refresh(self): self.initialize_chip_data(self.current_dict_circuit, self.chip_images_path) self.on_search(None) print("Sidebar refreshed with updated chips.") - else: - print("No changes detected. Sidebar not refreshed.") + #else: + #print("No changes detected. Sidebar not refreshed.") From 2be63e09d20a222382715ac5e23142473e28cbf2 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Sat, 23 Nov 2024 13:20:44 -0500 Subject: [PATCH 16/44] =?UTF-8?q?bug=20sur=20boucle=20corrig=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestCircuitBoucle.json | 297 +++++++++++++++++++++++++++++++++++++++++ menus.py | 79 ++++++----- 2 files changed, 342 insertions(+), 34 deletions(-) create mode 100644 TestCircuitBoucle.json diff --git a/TestCircuitBoucle.json b/TestCircuitBoucle.json new file mode 100644 index 0000000..96817b1 --- /dev/null +++ b/TestCircuitBoucle.json @@ -0,0 +1,297 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1162, + 354.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1162, + 451.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 9, + 12, + 1 + ] + ], + "multipoints": [ + 186, + 203 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 237.5, + 32.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 61, + 1, + 61, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 972.5, + 302.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_io_3": { + "coord": [ + [ + 7, + 11 + ] + ], + "XY": [ + 112.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_io_4": { + "coord": [ + [ + 5, + 12 + ] + ], + "XY": [ + 82.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 6, + 12, + 7, + 12 + ] + ], + "multipoints": [], + "color": [ + 71, + 157, + 255 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_5_end" + } + } + } +} \ No newline at end of file diff --git a/menus.py b/menus.py index d789752..b427668 100644 --- a/menus.py +++ b/menus.py @@ -639,44 +639,52 @@ def checkCloseCircuit(self, ioOut): ioZone = [(c1,l1,c2,l2)] findOut = False circuitClose = True + #chip_out_checked = [] for f in self.func: id, inLst, fName, outLst = f for out in outLst: - if self.is_linked_to(ioZone, out): - findOut = True - for inFunc in inLst: - findIn = False - if self.is_linked_to(self.pwrP, inFunc) or self.is_linked_to(self.pwrM, inFunc): - findIn = True - print("connecté à pwr") - if not findIn: - for io_inZone in self.io_in: - id, zone = io_inZone - if self.is_linked_to([zone], inFunc): - findIn = True - print("connecté à une ENTRÉE EXTERNE") - if not findIn: ## recherche d'une sortie de chip connectée à l'entrée actuelle de la chip - findNext =False - for nextOut in self.chip_out_wire: - #id, (c1, l1) = nextOut - #outZone = deepcopy(self.board.sketcher.matrix[f"{c1},{l1}"]["link"]) - - if self.is_linked_to(nextOut, inFunc): - for next in nextOut: - for cow in self.chip_out: - id, pt = cow - if self.is_linked_to([next], pt): - outZone =(id,next) - print("On passe à une autre sortie...") - ######## RAPPEL RECURSIF SUR OUTZONE ###################### - findNext = self.checkCloseCircuit(outZone) - break - if not findIn and not findNext: - self.in_outOC += [(id,inFunc)] + #if out not in chip_out_checked: + if self.is_linked_to(ioZone, out): + findOut = True + #chip_out_checked += [out] + for inFunc in inLst: + findIn = False + if self.is_linked_to(self.pwrP, inFunc) or self.is_linked_to(self.pwrM, inFunc): + findIn = True + print("connecté à pwr") + if not findIn: + for io_inZone in self.io_in: + id, zone = io_inZone + if self.is_linked_to([zone], inFunc): + findIn = True + print("connecté à une ENTRÉE EXTERNE") + if not findIn: ## recherche d'une sortie de chip connectée à l'entrée actuelle de la chip + findNext =False + for nextOut in self.chip_out_wire: + #id, (c1, l1) = nextOut + #outZone = deepcopy(self.board.sketcher.matrix[f"{c1},{l1}"]["link"]) + + if self.is_linked_to(nextOut, inFunc): + for next in nextOut: + for cow in self.chip_out: + id, pt = cow + if self.is_linked_to([next], pt): + outZone =(id,next) + print("On passe à une autre sortie...") + ######## RAPPEL RECURSIF SUR OUTZONE ###################### + if outZone not in self.chip_out_checked: + self.chip_out_checked += [outZone] + findNext = self.checkCloseCircuit(outZone) + else: findNext = True + break + if not findIn and not findNext: + self.in_outOC += [(id,inFunc)] + circuitClose = False if not findOut: - self.in_outOC += [ioOut] - if not findOut and not findNext and not findNext: + self.in_outOC += [ioOut] + circuitClose = False + if not findOut and not findIn and not findNext: circuitClose = False return circuitClose @@ -697,6 +705,7 @@ def checkCircuit(self): self.io_inCC, self.io_outCC = [], [] self.chip_out_wire, self.chip_outCC = [], [] self.in_outOC = [] + self.chip_out_checked = [] for id, component in self.current_dict_circuit.items(): if id[:6] == "_chip_": @@ -878,7 +887,9 @@ def checkCircuit(self): and not self.io_outCC and not self.chip_outCC: print("vérification du circuit fermé") for ioOut in self.io_out: - self.checkCloseCircuit(ioOut) + if self.checkCloseCircuit(ioOut): + print(f"le circuit est fermée sur la sortie {ioOut}") + else: print(f"le circuit est ouvert sur la sortie {ioOut}") print(f"pwrChipConnected : {self.pwrChip['pwrConnected']}") print(f"pwrChipNotConnected : {self.pwrChip['pwrNotConnected']}") From c70b3ee85532aa81a8b5874a91dc2784399824a3 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Sun, 24 Nov 2024 00:48:17 -0500 Subject: [PATCH 17/44] fonction valeur fixe --- TestCicuitFoncsimple.json | 347 ++++++++++++++++++ TestCicuitFoncsimple2.json | 436 +++++++++++++++++++++++ TestCicuitFoncsimple3.json | 703 +++++++++++++++++++++++++++++++++++++ menus.py | 21 +- 4 files changed, 1504 insertions(+), 3 deletions(-) create mode 100644 TestCicuitFoncsimple.json create mode 100644 TestCicuitFoncsimple2.json create mode 100644 TestCicuitFoncsimple3.json diff --git a/TestCicuitFoncsimple.json b/TestCicuitFoncsimple.json new file mode 100644 index 0000000..e473ff9 --- /dev/null +++ b/TestCicuitFoncsimple.json @@ -0,0 +1,347 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1156, + 348.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1156, + 445.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 11, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 222.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 61, + 13, + 61, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 302.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 5, + 12, + 5, + 13 + ] + ], + "multipoints": [ + 86, + 288 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 132.5, + 302.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 6, + 12, + 6, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 147.5, + 317.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 7, + 10 + ] + ], + "XY": [ + 112.5, + 217.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff2600", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 3, + 2, + 3, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 102.5, + 47.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 102.5, + 47.5 + ], + "tag": "_wire_5_end" + } + } + } +} \ No newline at end of file diff --git a/TestCicuitFoncsimple2.json b/TestCicuitFoncsimple2.json new file mode 100644 index 0000000..53ca402 --- /dev/null +++ b/TestCicuitFoncsimple2.json @@ -0,0 +1,436 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1159, + 351.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1159, + 448.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 11, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 222.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 61, + 13, + 61, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 302.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 5, + 12, + 5, + 13 + ] + ], + "multipoints": [ + 86, + 288 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 132.5, + 302.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 6, + 12, + 6, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 147.5, + 317.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 7, + 10 + ] + ], + "XY": [ + 112.5, + 217.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff2600", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 3, + 2, + 3, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 102.5, + 47.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 102.5, + 317.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 10, + 11 + ] + ], + "XY": [ + 157.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 9, + 12, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 8, + 12, + 7, + 14 + ] + ], + "multipoints": [ + 126, + 310 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_7_end" + } + } + } +} \ No newline at end of file diff --git a/TestCicuitFoncsimple3.json b/TestCicuitFoncsimple3.json new file mode 100644 index 0000000..b47332e --- /dev/null +++ b/TestCicuitFoncsimple3.json @@ -0,0 +1,703 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1159, + 351.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1159, + 448.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 11, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 222.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 61, + 13, + 61, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 302.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 5, + 12, + 5, + 13 + ] + ], + "multipoints": [ + 86, + 288 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 132.5, + 302.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 6, + 12, + 6, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 147.5, + 317.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 7, + 10 + ] + ], + "XY": [ + 112.5, + 217.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff2600", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 3, + 2, + 3, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 102.5, + 47.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 102.5, + 317.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 10, + 11 + ] + ], + "XY": [ + 157.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 9, + 12, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 8, + 12, + 7, + 14 + ] + ], + "multipoints": [ + 126, + 310 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_chip_1": { + "XY": [ + 355.5, + 161.5 + ], + "pinUL_XY": [ + 357.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC10", + "type": "74HC10", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2, + 13 + ], + [ + 12 + ] + ], + [ + [ + 3, + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10, + 11 + ], + [ + 8 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "20,7", + "20,8", + "21,7", + "21,8", + "22,7", + "22,8", + "23,7", + "23,8", + "24,7", + "24,8", + "25,7", + "25,8", + "26,7", + "26,8" + ] + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 20, + 3, + 21, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 92.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 357.5, + 92.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 20, + 5, + 21, + 5 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 122.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 357.5, + 122.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_wire_11": { + "mode": 0, + "coord": [ + [ + 20, + 12, + 19, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_11_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 257.5 + ], + "tag": "_wire_11_start" + }, + "end": { + "position": [ + 357.5, + 257.5 + ], + "tag": "_wire_11_end" + } + } + }, + "_wire_12": { + "mode": 0, + "coord": [ + [ + 21, + 12, + 21, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_12_body", + "endpoints": { + "start": { + "position": [ + 372.5, + 257.5 + ], + "tag": "_wire_12_start" + }, + "end": { + "position": [ + 372.5, + 257.5 + ], + "tag": "_wire_12_end" + } + } + }, + "_io_3": { + "coord": [ + [ + 22, + 4 + ] + ], + "XY": [ + 337.5, + 97.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_wire_14": { + "mode": 0, + "coord": [ + [ + 26, + 12, + 27, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_14_body", + "endpoints": { + "start": { + "position": [ + 447.5, + 257.5 + ], + "tag": "_wire_14_start" + }, + "end": { + "position": [ + 447.5, + 257.5 + ], + "tag": "_wire_14_end" + } + } + } +} \ No newline at end of file diff --git a/menus.py b/menus.py index b427668..c4469a6 100644 --- a/menus.py +++ b/menus.py @@ -647,10 +647,19 @@ def checkCloseCircuit(self, ioOut): #if out not in chip_out_checked: if self.is_linked_to(ioZone, out): findOut = True + self.script += "( " #chip_out_checked += [out] - for inFunc in inLst: + for n,inFunc in enumerate(inLst): findIn = False if self.is_linked_to(self.pwrP, inFunc) or self.is_linked_to(self.pwrM, inFunc): + if self.is_linked_to(self.pwrP, inFunc): + if n == 0: + self.script += f"1 " + else: self.script += f"{fName} 1 " + else: + if n == 0: + self.script += f"0 " + else: self.script += f"{fName} 0 " findIn = True print("connecté à pwr") if not findIn: @@ -681,11 +690,13 @@ def checkCloseCircuit(self, ioOut): if not findIn and not findNext: self.in_outOC += [(id,inFunc)] circuitClose = False + if findIn or findNext: + self.script += ") " if not findOut: self.in_outOC += [ioOut] circuitClose = False - if not findOut and not findIn and not findNext: - circuitClose = False + # if not findIn and not findNext: + # circuitClose = False return circuitClose @@ -886,9 +897,12 @@ def checkCircuit(self): if not self.pwrCC and not self.pwrChip["pwrMissConnected"] and not self.chip_ioCC \ and not self.io_outCC and not self.chip_outCC: print("vérification du circuit fermé") + self.script = "" for ioOut in self.io_out: + self.script += f"O{ioOut[0][4:]} = " if self.checkCloseCircuit(ioOut): print(f"le circuit est fermée sur la sortie {ioOut}") + self.script += f"; " else: print(f"le circuit est ouvert sur la sortie {ioOut}") print(f"pwrChipConnected : {self.pwrChip['pwrConnected']}") @@ -902,3 +916,4 @@ def checkCircuit(self): print(f"chip_outCC : {self.chip_outCC}") print(f"in_outOC : {self.in_outOC}") print(f"chip_out_wire : {self.chip_out_wire}") + print(f"script : {self.script}") From 5e6f584c2938678670f5910292e802b941cede0b Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Sun, 24 Nov 2024 02:49:48 -0500 Subject: [PATCH 18/44] =?UTF-8?q?fonction=20avec=20entr=C3=A9e=20et=20vale?= =?UTF-8?q?urs=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestCicuitFoncsimple4.json | 972 +++++++++++++++++++++++++++++++++++++ TestCicuitFoncsimple5.json | 924 +++++++++++++++++++++++++++++++++++ menus.py | 52 +- 3 files changed, 1939 insertions(+), 9 deletions(-) create mode 100644 TestCicuitFoncsimple4.json create mode 100644 TestCicuitFoncsimple5.json diff --git a/TestCicuitFoncsimple4.json b/TestCicuitFoncsimple4.json new file mode 100644 index 0000000..545ebda --- /dev/null +++ b/TestCicuitFoncsimple4.json @@ -0,0 +1,972 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1162, + 354.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1162, + 451.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 11, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 222.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 61, + 13, + 61, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 302.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 5, + 12, + 5, + 13 + ] + ], + "multipoints": [ + 86, + 288 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 132.5, + 302.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 6, + 12, + 6, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 147.5, + 317.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 7, + 10 + ] + ], + "XY": [ + 112.5, + 217.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff2600", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 3, + 2, + 3, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 102.5, + 47.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 102.5, + 317.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 10, + 11 + ] + ], + "XY": [ + 157.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 9, + 12, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 192.5, + 302.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 8, + 12, + 7, + 14 + ] + ], + "multipoints": [ + 126, + 310 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 162.5, + 317.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_chip_1": { + "XY": [ + 355.5, + 161.5 + ], + "pinUL_XY": [ + 357.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC10", + "type": "74HC10", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2, + 13 + ], + [ + 12 + ] + ], + [ + [ + 3, + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10, + 11 + ], + [ + 8 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "20,7", + "20,8", + "21,7", + "21,8", + "22,7", + "22,8", + "23,7", + "23,8", + "24,7", + "24,8", + "25,7", + "25,8", + "26,7", + "26,8" + ] + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 20, + 3, + 21, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 92.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 372.5, + 47.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 20, + 5, + 21, + 5 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 122.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 372.5, + 122.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 20, + 12, + 19, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 257.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 342.5, + 317.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_wire_11": { + "mode": 0, + "coord": [ + [ + 21, + 12, + 21, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_11_body", + "endpoints": { + "start": { + "position": [ + 372.5, + 257.5 + ], + "tag": "_wire_11_start" + }, + "end": { + "position": [ + 372.5, + 317.5 + ], + "tag": "_wire_11_end" + } + } + }, + "_io_2": { + "coord": [ + [ + 22, + 4 + ] + ], + "XY": [ + 337.5, + 97.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_wire_12": { + "mode": 0, + "coord": [ + [ + 26, + 12, + 27, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_12_body", + "endpoints": { + "start": { + "position": [ + 447.5, + 257.5 + ], + "tag": "_wire_12_start" + }, + "end": { + "position": [ + 462.5, + 302.5 + ], + "tag": "_wire_12_end" + } + } + }, + "_chip_2": { + "XY": [ + 580.5, + 161.5 + ], + "pinUL_XY": [ + 582.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC04", + "type": "74HC04", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NotGate", + "io": [ + [ + [ + 1 + ], + [ + 2 + ] + ], + [ + [ + 3 + ], + [ + 4 + ] + ], + [ + [ + 5 + ], + [ + 6 + ] + ], + [ + [ + 9 + ], + [ + 8 + ] + ], + [ + [ + 11 + ], + [ + 10 + ] + ], + [ + [ + 13 + ], + [ + 12 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NotGate", + "occupied_holes": [ + "35,7", + "35,8", + "36,7", + "36,8", + "37,7", + "37,8", + "38,7", + "38,8", + "39,7", + "39,8", + "40,7", + "40,8", + "41,7", + "41,8" + ] + }, + "_wire_13": { + "mode": 0, + "coord": [ + [ + 35, + 2, + 35, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_13_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 47.5 + ], + "tag": "_wire_13_start" + }, + "end": { + "position": [ + 582.5, + 47.5 + ], + "tag": "_wire_13_end" + } + } + }, + "_wire_14": { + "mode": 0, + "coord": [ + [ + 35, + 14, + 35, + 12 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_14_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 317.5 + ], + "tag": "_wire_14_start" + }, + "end": { + "position": [ + 582.5, + 317.5 + ], + "tag": "_wire_14_end" + } + } + }, + "_wire_15": { + "mode": 0, + "coord": [ + [ + 41, + 12, + 41, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_15_body", + "endpoints": { + "start": { + "position": [ + 672.5, + 257.5 + ], + "tag": "_wire_15_start" + }, + "end": { + "position": [ + 672.5, + 257.5 + ], + "tag": "_wire_15_end" + } + } + }, + "_wire_16": { + "mode": 0, + "coord": [ + [ + 37, + 12, + 37, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_16_body", + "endpoints": { + "start": { + "position": [ + 612.5, + 257.5 + ], + "tag": "_wire_16_start" + }, + "end": { + "position": [ + 612.5, + 257.5 + ], + "tag": "_wire_16_end" + } + } + }, + "_io_3": { + "coord": [ + [ + 36, + 11 + ] + ], + "XY": [ + 547.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_io_4": { + "coord": [ + [ + 38, + 12 + ] + ], + "XY": [ + 577.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + } +} \ No newline at end of file diff --git a/TestCicuitFoncsimple5.json b/TestCicuitFoncsimple5.json new file mode 100644 index 0000000..388b6bc --- /dev/null +++ b/TestCicuitFoncsimple5.json @@ -0,0 +1,924 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1165, + 357.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1165, + 454.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 11, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 222.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 61, + 13, + 61, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 302.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 5, + 12, + 5, + 13 + ] + ], + "multipoints": [ + 86, + 288 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 132.5, + 302.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 6, + 12, + 6, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 147.5, + 317.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 7, + 10 + ] + ], + "XY": [ + 112.5, + 217.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff2600", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 3, + 2, + 3, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 102.5, + 47.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 102.5, + 317.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 10, + 11 + ] + ], + "XY": [ + 157.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 9, + 12, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 192.5, + 302.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 8, + 12, + 7, + 14 + ] + ], + "multipoints": [ + 126, + 310 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 162.5, + 317.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_chip_1": { + "XY": [ + 355.5, + 161.5 + ], + "pinUL_XY": [ + 357.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC10", + "type": "74HC10", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2, + 13 + ], + [ + 12 + ] + ], + [ + [ + 3, + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10, + 11 + ], + [ + 8 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "20,7", + "20,8", + "21,7", + "21,8", + "22,7", + "22,8", + "23,7", + "23,8", + "24,7", + "24,8", + "25,7", + "25,8", + "26,7", + "26,8" + ] + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 20, + 3, + 21, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 92.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 372.5, + 47.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 20, + 12, + 19, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 257.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 342.5, + 317.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_io_2": { + "coord": [ + [ + 22, + 4 + ] + ], + "XY": [ + 337.5, + 97.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_wire_12": { + "mode": 0, + "coord": [ + [ + 26, + 12, + 27, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_12_body", + "endpoints": { + "start": { + "position": [ + 447.5, + 257.5 + ], + "tag": "_wire_12_start" + }, + "end": { + "position": [ + 462.5, + 302.5 + ], + "tag": "_wire_12_end" + } + } + }, + "_chip_2": { + "XY": [ + 580.5, + 161.5 + ], + "pinUL_XY": [ + 582.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC04", + "type": "74HC04", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NotGate", + "io": [ + [ + [ + 1 + ], + [ + 2 + ] + ], + [ + [ + 3 + ], + [ + 4 + ] + ], + [ + [ + 5 + ], + [ + 6 + ] + ], + [ + [ + 9 + ], + [ + 8 + ] + ], + [ + [ + 11 + ], + [ + 10 + ] + ], + [ + [ + 13 + ], + [ + 12 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NotGate", + "occupied_holes": [ + "35,7", + "35,8", + "36,7", + "36,8", + "37,7", + "37,8", + "38,7", + "38,8", + "39,7", + "39,8", + "40,7", + "40,8", + "41,7", + "41,8" + ] + }, + "_wire_13": { + "mode": 0, + "coord": [ + [ + 35, + 2, + 35, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_13_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 47.5 + ], + "tag": "_wire_13_start" + }, + "end": { + "position": [ + 582.5, + 92.5 + ], + "tag": "_wire_13_end" + } + } + }, + "_wire_14": { + "mode": 0, + "coord": [ + [ + 35, + 14, + 35, + 12 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_14_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 317.5 + ], + "tag": "_wire_14_start" + }, + "end": { + "position": [ + 582.5, + 257.5 + ], + "tag": "_wire_14_end" + } + } + }, + "_wire_15": { + "mode": 0, + "coord": [ + [ + 41, + 12, + 41, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_15_body", + "endpoints": { + "start": { + "position": [ + 672.5, + 257.5 + ], + "tag": "_wire_15_start" + }, + "end": { + "position": [ + 672.5, + 302.5 + ], + "tag": "_wire_15_end" + } + } + }, + "_io_3": { + "coord": [ + [ + 36, + 11 + ] + ], + "XY": [ + 547.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_io_4": { + "coord": [ + [ + 38, + 12 + ] + ], + "XY": [ + 577.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_io_5": { + "coord": [ + [ + 21, + 11 + ] + ], + "XY": [ + 322.5, + 232.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#c0c0c0", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" + }, + "_io_6": { + "coord": [ + [ + 37, + 12 + ] + ], + "XY": [ + 562.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#c0c0c0", + "outline_tag": "pin_io_outline__io_6", + "tag": "pin_io__io_6", + "label_tag": "_io_6_label" + }, + "_io_7": { + "coord": [ + [ + 21, + 5 + ] + ], + "XY": [ + 322.5, + 112.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#c0c0c0", + "outline_tag": "pin_io_outline__io_7", + "tag": "pin_io__io_7", + "label_tag": "_io_7_label" + } +} \ No newline at end of file diff --git a/menus.py b/menus.py index c4469a6..01e308e 100644 --- a/menus.py +++ b/menus.py @@ -634,6 +634,42 @@ def is_linked_to(self, dest, src): break return res + def decodeFunc(self,inVar, funcName): + if funcName == "NandGate": + s = f"! ( {inVar[0]} " + for v in inVar[1:]: + s += f"& {v} " + s += ") " + elif funcName == "AndGate": + s = f"( {inVar[0]} " + for v in inVar[1:]: + s += f"& {v} " + s += ") " + elif funcName == "NorGate": + s = f"! ( {inVar[0]} " + for v in inVar[1:]: + s += f"| {v} " + s += ") " + elif funcName == "OrGate": + s = f"( {inVar[0]} " + for v in inVar[1:]: + s += f"| {v} " + s += ") " + elif funcName == "NotGate": + s = f"! {inVar[0]} " + elif funcName == "XorGate": + s = f"( {inVar[0]} " + for v in inVar[1:]: + s += f"^ {v} " + s += ") " + elif funcName == "XnorGate": + s = f"! ( {inVar[0]} " + for v in inVar[1:]: + s += f"| {v} " + s += ") " + + return s + def checkCloseCircuit(self, ioOut): id, (c1,l1,c2,l2) = ioOut ioZone = [(c1,l1,c2,l2)] @@ -647,25 +683,22 @@ def checkCloseCircuit(self, ioOut): #if out not in chip_out_checked: if self.is_linked_to(ioZone, out): findOut = True - self.script += "( " + #self.script += "( " #chip_out_checked += [out] + inFuncConst = [] for n,inFunc in enumerate(inLst): findIn = False if self.is_linked_to(self.pwrP, inFunc) or self.is_linked_to(self.pwrM, inFunc): if self.is_linked_to(self.pwrP, inFunc): - if n == 0: - self.script += f"1 " - else: self.script += f"{fName} 1 " - else: - if n == 0: - self.script += f"0 " - else: self.script += f"{fName} 0 " + inFuncConst += ["1"] + else: inFuncConst += ["0"] findIn = True print("connecté à pwr") if not findIn: for io_inZone in self.io_in: id, zone = io_inZone if self.is_linked_to([zone], inFunc): + inFuncConst += [f"I{id[4:]}"] findIn = True print("connecté à une ENTRÉE EXTERNE") if not findIn: ## recherche d'une sortie de chip connectée à l'entrée actuelle de la chip @@ -691,7 +724,8 @@ def checkCloseCircuit(self, ioOut): self.in_outOC += [(id,inFunc)] circuitClose = False if findIn or findNext: - self.script += ") " + #self.script += ") " + self.script += self.decodeFunc(inFuncConst, fName) if not findOut: self.in_outOC += [ioOut] circuitClose = False From e2ae22d3d76e2af0afee01468c3613d91c7f43ba Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Sun, 24 Nov 2024 03:33:56 -0500 Subject: [PATCH 19/44] =?UTF-8?q?fonction=20simple=20termin=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestCicuitFoncsimple6.json | 906 +++++++++++++++++++++++++++++++++++++ menus.py | 19 +- 2 files changed, 918 insertions(+), 7 deletions(-) create mode 100644 TestCicuitFoncsimple6.json diff --git a/TestCicuitFoncsimple6.json b/TestCicuitFoncsimple6.json new file mode 100644 index 0000000..0baf325 --- /dev/null +++ b/TestCicuitFoncsimple6.json @@ -0,0 +1,906 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1168, + 360.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1168, + 457.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 11, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 222.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 61, + 13, + 61, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 302.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 5, + 12, + 5, + 13 + ] + ], + "multipoints": [ + 86, + 288 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 132.5, + 302.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 6, + 12, + 6, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 147.5, + 317.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 7, + 10 + ] + ], + "XY": [ + 112.5, + 217.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff2600", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 3, + 2, + 3, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 102.5, + 47.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 102.5, + 317.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 10, + 11 + ] + ], + "XY": [ + 157.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 9, + 12, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 192.5, + 302.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 8, + 12, + 7, + 14 + ] + ], + "multipoints": [ + 126, + 310 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 162.5, + 317.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_chip_1": { + "XY": [ + 355.5, + 161.5 + ], + "pinUL_XY": [ + 357.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC10", + "type": "74HC10", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2, + 13 + ], + [ + 12 + ] + ], + [ + [ + 3, + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10, + 11 + ], + [ + 8 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "20,7", + "20,8", + "21,7", + "21,8", + "22,7", + "22,8", + "23,7", + "23,8", + "24,7", + "24,8", + "25,7", + "25,8", + "26,7", + "26,8" + ] + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 20, + 3, + 21, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 92.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 372.5, + 47.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 20, + 12, + 36, + 12 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 257.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 342.5, + 317.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_io_2": { + "coord": [ + [ + 22, + 4 + ] + ], + "XY": [ + 337.5, + 97.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 26, + 12, + 27, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 447.5, + 257.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 462.5, + 302.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_chip_2": { + "XY": [ + 580.5, + 161.5 + ], + "pinUL_XY": [ + 582.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC04", + "type": "74HC04", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NotGate", + "io": [ + [ + [ + 1 + ], + [ + 2 + ] + ], + [ + [ + 3 + ], + [ + 4 + ] + ], + [ + [ + 5 + ], + [ + 6 + ] + ], + [ + [ + 9 + ], + [ + 8 + ] + ], + [ + [ + 11 + ], + [ + 10 + ] + ], + [ + [ + 13 + ], + [ + 12 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NotGate", + "occupied_holes": [ + "35,7", + "35,8", + "36,7", + "36,8", + "37,7", + "37,8", + "38,7", + "38,8", + "39,7", + "39,8", + "40,7", + "40,8", + "41,7", + "41,8" + ] + }, + "_wire_11": { + "mode": 0, + "coord": [ + [ + 35, + 2, + 35, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_11_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 47.5 + ], + "tag": "_wire_11_start" + }, + "end": { + "position": [ + 582.5, + 92.5 + ], + "tag": "_wire_11_end" + } + } + }, + "_wire_12": { + "mode": 0, + "coord": [ + [ + 35, + 14, + 35, + 12 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_12_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 317.5 + ], + "tag": "_wire_12_start" + }, + "end": { + "position": [ + 582.5, + 257.5 + ], + "tag": "_wire_12_end" + } + } + }, + "_wire_13": { + "mode": 0, + "coord": [ + [ + 41, + 12, + 41, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_13_body", + "endpoints": { + "start": { + "position": [ + 672.5, + 257.5 + ], + "tag": "_wire_13_start" + }, + "end": { + "position": [ + 672.5, + 302.5 + ], + "tag": "_wire_13_end" + } + } + }, + "_io_4": { + "coord": [ + [ + 38, + 12 + ] + ], + "XY": [ + 577.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_io_5": { + "coord": [ + [ + 21, + 11 + ] + ], + "XY": [ + 322.5, + 232.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#c0c0c0", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" + }, + "_io_6": { + "coord": [ + [ + 37, + 12 + ] + ], + "XY": [ + 562.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#c0c0c0", + "outline_tag": "pin_io_outline__io_6", + "tag": "pin_io__io_6", + "label_tag": "_io_6_label" + }, + "_io_7": { + "coord": [ + [ + 21, + 5 + ] + ], + "XY": [ + 322.5, + 112.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#c0c0c0", + "outline_tag": "pin_io_outline__io_7", + "tag": "pin_io__io_7", + "label_tag": "_io_7_label" + } +} \ No newline at end of file diff --git a/menus.py b/menus.py index 01e308e..385bcae 100644 --- a/menus.py +++ b/menus.py @@ -675,10 +675,11 @@ def checkCloseCircuit(self, ioOut): ioZone = [(c1,l1,c2,l2)] findOut = False circuitClose = True + #script = "" #chip_out_checked = [] for f in self.func: - id, inLst, fName, outLst = f + idOut, inLst, fName, outLst = f for out in outLst: #if out not in chip_out_checked: if self.is_linked_to(ioZone, out): @@ -717,22 +718,25 @@ def checkCloseCircuit(self, ioOut): ######## RAPPEL RECURSIF SUR OUTZONE ###################### if outZone not in self.chip_out_checked: self.chip_out_checked += [outZone] - findNext = self.checkCloseCircuit(outZone) - else: findNext = True + findNext, s = self.checkCloseCircuit(outZone) + inFuncConst += [s] + else: + # il faut voir si une sortie io n'existe pas sinon var temp + findNext = True break if not findIn and not findNext: self.in_outOC += [(id,inFunc)] circuitClose = False if findIn or findNext: #self.script += ") " - self.script += self.decodeFunc(inFuncConst, fName) + script = self.decodeFunc(inFuncConst, fName) if not findOut: self.in_outOC += [ioOut] circuitClose = False # if not findIn and not findNext: # circuitClose = False - return circuitClose + return circuitClose, script @@ -934,9 +938,10 @@ def checkCircuit(self): self.script = "" for ioOut in self.io_out: self.script += f"O{ioOut[0][4:]} = " - if self.checkCloseCircuit(ioOut): + circuitClose, script = self.checkCloseCircuit(ioOut) + if circuitClose : print(f"le circuit est fermée sur la sortie {ioOut}") - self.script += f"; " + self.script += f"{script}; " else: print(f"le circuit est ouvert sur la sortie {ioOut}") print(f"pwrChipConnected : {self.pwrChip['pwrConnected']}") From 04cf41c46d4114b3eb4a54b3d9af7b9c91c2d06f Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Sun, 24 Nov 2024 22:33:11 -0500 Subject: [PATCH 20/44] script fonction de base tous les cas possibles --- TestCicuitFoncsimple7.json | 945 ++++++++++++++++++++++++++++++ TestCircuitBascule.json | 401 +++++++++++++ TestCircuitBasculeEtdoubleIn.json | 694 ++++++++++++++++++++++ TestCircuitDoubleIn.json | 554 ++++++++++++++++++ menus.py | 65 +- 5 files changed, 2653 insertions(+), 6 deletions(-) create mode 100644 TestCicuitFoncsimple7.json create mode 100644 TestCircuitBascule.json create mode 100644 TestCircuitBasculeEtdoubleIn.json create mode 100644 TestCircuitDoubleIn.json diff --git a/TestCicuitFoncsimple7.json b/TestCicuitFoncsimple7.json new file mode 100644 index 0000000..40322f2 --- /dev/null +++ b/TestCicuitFoncsimple7.json @@ -0,0 +1,945 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1168, + 360.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1168, + 457.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 11, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 222.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 61, + 13, + 61, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 302.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 5, + 12, + 5, + 13 + ] + ], + "multipoints": [ + 86, + 288 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 132.5, + 302.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 6, + 12, + 6, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 147.5, + 317.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 7, + 10 + ] + ], + "XY": [ + 112.5, + 217.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff2600", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 3, + 2, + 3, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 102.5, + 47.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 102.5, + 317.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 10, + 11 + ] + ], + "XY": [ + 157.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 10, + 18, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 192.5, + 302.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 8, + 12, + 7, + 14 + ] + ], + "multipoints": [ + 126, + 310 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 162.5, + 317.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_chip_1": { + "XY": [ + 355.5, + 161.5 + ], + "pinUL_XY": [ + 357.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC10", + "type": "74HC10", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2, + 13 + ], + [ + 12 + ] + ], + [ + [ + 3, + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10, + 11 + ], + [ + 8 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "occupied_holes": [ + "20,7", + "20,8", + "21,7", + "21,8", + "22,7", + "22,8", + "23,7", + "23,8", + "24,7", + "24,8", + "25,7", + "25,8", + "26,7", + "26,8" + ] + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 20, + 3, + 21, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 92.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 372.5, + 47.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 20, + 12, + 36, + 12 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 257.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 342.5, + 317.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_io_2": { + "coord": [ + [ + 22, + 4 + ] + ], + "XY": [ + 337.5, + 97.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 26, + 12, + 27, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 447.5, + 257.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 462.5, + 302.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_chip_2": { + "XY": [ + 580.5, + 161.5 + ], + "pinUL_XY": [ + 582.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC04", + "type": "74HC04", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NotGate", + "io": [ + [ + [ + 1 + ], + [ + 2 + ] + ], + [ + [ + 3 + ], + [ + 4 + ] + ], + [ + [ + 5 + ], + [ + 6 + ] + ], + [ + [ + 9 + ], + [ + 8 + ] + ], + [ + [ + 11 + ], + [ + 10 + ] + ], + [ + [ + 13 + ], + [ + 12 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NotGate", + "occupied_holes": [ + "35,7", + "35,8", + "36,7", + "36,8", + "37,7", + "37,8", + "38,7", + "38,8", + "39,7", + "39,8", + "40,7", + "40,8", + "41,7", + "41,8" + ] + }, + "_wire_11": { + "mode": 0, + "coord": [ + [ + 35, + 2, + 35, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_11_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 47.5 + ], + "tag": "_wire_11_start" + }, + "end": { + "position": [ + 582.5, + 92.5 + ], + "tag": "_wire_11_end" + } + } + }, + "_wire_12": { + "mode": 0, + "coord": [ + [ + 35, + 14, + 35, + 12 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_12_body", + "endpoints": { + "start": { + "position": [ + 582.5, + 317.5 + ], + "tag": "_wire_12_start" + }, + "end": { + "position": [ + 582.5, + 257.5 + ], + "tag": "_wire_12_end" + } + } + }, + "_wire_13": { + "mode": 0, + "coord": [ + [ + 41, + 12, + 41, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_13_body", + "endpoints": { + "start": { + "position": [ + 672.5, + 257.5 + ], + "tag": "_wire_13_start" + }, + "end": { + "position": [ + 672.5, + 302.5 + ], + "tag": "_wire_13_end" + } + } + }, + "_io_4": { + "coord": [ + [ + 38, + 12 + ] + ], + "XY": [ + 577.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_io_5": { + "coord": [ + [ + 21, + 11 + ] + ], + "XY": [ + 322.5, + 232.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#c0c0c0", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" + }, + "_io_6": { + "coord": [ + [ + 37, + 12 + ] + ], + "XY": [ + 562.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#c0c0c0", + "outline_tag": "pin_io_outline__io_6", + "tag": "pin_io__io_6", + "label_tag": "_io_6_label" + }, + "_io_7": { + "coord": [ + [ + 21, + 5 + ] + ], + "XY": [ + 322.5, + 112.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#c0c0c0", + "outline_tag": "pin_io_outline__io_7", + "tag": "pin_io__io_7", + "label_tag": "_io_7_label" + }, + "_wire_14": { + "mode": 0, + "coord": [ + [ + 22, + 6, + 9, + 11 + ] + ], + "multipoints": [ + 291, + 128, + 290, + 232 + ], + "color": [ + 0, + 249, + 0 + ], + "wire_body_tag": "_wire_14_body", + "endpoints": { + "start": { + "position": [ + 387.5, + 137.5 + ], + "tag": "_wire_14_start" + }, + "end": { + "position": [ + 387.5, + 137.5 + ], + "tag": "_wire_14_end" + } + } + } +} \ No newline at end of file diff --git a/TestCircuitBascule.json b/TestCircuitBascule.json new file mode 100644 index 0000000..ad73ddc --- /dev/null +++ b/TestCircuitBascule.json @@ -0,0 +1,401 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1153, + 345.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1153, + 442.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 175.5, + 161.5 + ], + "pinUL_XY": [ + 177.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC02", + "type": "74HC02", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NorGate", + "io": [ + [ + [ + 2, + 3 + ], + [ + 1 + ] + ], + [ + [ + 5, + 6 + ], + [ + 4 + ] + ], + [ + [ + 8, + 9 + ], + [ + 10 + ] + ], + [ + [ + 11, + 12 + ], + [ + 13 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NorGate", + "occupied_holes": [ + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8", + "12,7", + "12,8", + "13,7", + "13,8", + "14,7", + "14,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 61, + 2, + 61, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 972.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 9, + 2, + 8, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 47.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 192.5, + 47.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 59, + 1, + 59, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 32.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 942.5, + 32.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 14, + 12, + 15, + 13 + ] + ], + "multipoints": [ + 233, + 290 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 267.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 267.5, + 257.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 8, + 12 + ] + ], + "XY": [ + 127.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#fefc78", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_io_1": { + "coord": [ + [ + 11, + 9 + ] + ], + "XY": [ + 172.5, + 202.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#fefc78", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 8, + 10, + 12, + 10 + ] + ], + "multipoints": [], + "color": [ + 78, + 143, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 227.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 177.5, + 227.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 10, + 12 + ] + ], + "multipoints": [], + "color": [ + 78, + 143, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_io_3": { + "coord": [ + [ + 13, + 10 + ] + ], + "XY": [ + 202.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ff40ff", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_io_4": { + "coord": [ + [ + 9, + 9 + ] + ], + "XY": [ + 142.5, + 202.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ff40ff", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + } +} \ No newline at end of file diff --git a/TestCircuitBasculeEtdoubleIn.json b/TestCircuitBasculeEtdoubleIn.json new file mode 100644 index 0000000..ba22932 --- /dev/null +++ b/TestCircuitBasculeEtdoubleIn.json @@ -0,0 +1,694 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1156, + 348.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1156, + 445.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 175.5, + 161.5 + ], + "pinUL_XY": [ + 177.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC02", + "type": "74HC02", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NorGate", + "io": [ + [ + [ + 2, + 3 + ], + [ + 1 + ] + ], + [ + [ + 5, + 6 + ], + [ + 4 + ] + ], + [ + [ + 8, + 9 + ], + [ + 10 + ] + ], + [ + [ + 11, + 12 + ], + [ + 13 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NorGate", + "occupied_holes": [ + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8", + "12,7", + "12,8", + "13,7", + "13,8", + "14,7", + "14,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 61, + 2, + 61, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 972.5, + 317.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 9, + 2, + 8, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 47.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 177.5, + 92.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 59, + 1, + 59, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 32.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 942.5, + 302.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 14, + 12, + 15, + 13 + ] + ], + "multipoints": [ + 233, + 290 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 267.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 282.5, + 302.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 8, + 12 + ] + ], + "XY": [ + 127.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#fefc78", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_io_1": { + "coord": [ + [ + 11, + 9 + ] + ], + "XY": [ + 172.5, + 202.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#fefc78", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 8, + 10, + 12, + 10 + ] + ], + "multipoints": [], + "color": [ + 78, + 143, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 227.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 237.5, + 227.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 10, + 12 + ] + ], + "multipoints": [], + "color": [ + 78, + 143, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 207.5, + 257.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_io_2": { + "coord": [ + [ + 13, + 10 + ] + ], + "XY": [ + 202.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ff40ff", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_io_3": { + "coord": [ + [ + 9, + 9 + ] + ], + "XY": [ + 142.5, + 202.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ff40ff", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_chip_1": { + "XY": [ + 520.5, + 161.5 + ], + "pinUL_XY": [ + 522.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC32", + "type": "74HC32", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "OrGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "OrGate", + "occupied_holes": [ + "31,7", + "31,8", + "32,7", + "32,8", + "33,7", + "33,8", + "34,7", + "34,8", + "35,7", + "35,8", + "36,7", + "36,8", + "37,7", + "37,8" + ] + }, + "_io_4": { + "coord": [ + [ + 31, + 12 + ] + ], + "XY": [ + 472.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_io_5": { + "coord": [ + [ + 32, + 12 + ] + ], + "XY": [ + 487.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" + }, + "_io_7": { + "coord": [ + [ + 33, + 9 + ] + ], + "XY": [ + 502.5, + 202.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#feffff", + "outline_tag": "pin_io_outline__io_7", + "tag": "pin_io__io_7", + "label_tag": "_io_7_label" + }, + "_io_8": { + "coord": [ + [ + 36, + 9 + ] + ], + "XY": [ + 547.5, + 202.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#feffff", + "outline_tag": "pin_io_outline__io_8", + "tag": "pin_io__io_8", + "label_tag": "_io_8_label" + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 37, + 12, + 37, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 612.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 612.5, + 257.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 31, + 3, + 31, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 522.5, + 92.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 522.5, + 92.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 33, + 10, + 35, + 10 + ] + ], + "multipoints": [], + "color": [ + 0, + 150, + 255 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 552.5, + 227.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 552.5, + 227.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 31, + 9, + 34, + 9 + ] + ], + "multipoints": [], + "color": [ + 0, + 150, + 255 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 522.5, + 212.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 522.5, + 212.5 + ], + "tag": "_wire_9_end" + } + } + } +} \ No newline at end of file diff --git a/TestCircuitDoubleIn.json b/TestCircuitDoubleIn.json new file mode 100644 index 0000000..76a44c2 --- /dev/null +++ b/TestCircuitDoubleIn.json @@ -0,0 +1,554 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 1159, + 351.4 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 1159, + 448.6 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 175.5, + 161.5 + ], + "pinUL_XY": [ + 177.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC02", + "type": "74HC02", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NorGate", + "io": [ + [ + [ + 2, + 3 + ], + [ + 1 + ] + ], + [ + [ + 5, + 6 + ], + [ + 4 + ] + ], + [ + [ + 8, + 9 + ], + [ + 10 + ] + ], + [ + [ + 11, + 12 + ], + [ + 13 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NorGate", + "occupied_holes": [ + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8", + "12,7", + "12,8", + "13,7", + "13,8", + "14,7", + "14,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 61, + 2, + 61, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 972.5, + 317.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 9, + 2, + 8, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 47.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 177.5, + 92.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 59, + 1, + 59, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 32.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 942.5, + 302.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 14, + 12, + 15, + 13 + ] + ], + "multipoints": [ + 233, + 290 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 267.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 282.5, + 302.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_chip_1": { + "XY": [ + 520.5, + 161.5 + ], + "pinUL_XY": [ + 522.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC32", + "type": "74HC32", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "OrGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "OrGate", + "occupied_holes": [ + "31,7", + "31,8", + "32,7", + "32,8", + "33,7", + "33,8", + "34,7", + "34,8", + "35,7", + "35,8", + "36,7", + "36,8", + "37,7", + "37,8" + ] + }, + "_io_4": { + "coord": [ + [ + 31, + 12 + ] + ], + "XY": [ + 472.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_io_5": { + "coord": [ + [ + 32, + 12 + ] + ], + "XY": [ + 487.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" + }, + "_io_6": { + "coord": [ + [ + 33, + 9 + ] + ], + "XY": [ + 502.5, + 202.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#feffff", + "outline_tag": "pin_io_outline__io_6", + "tag": "pin_io__io_6", + "label_tag": "_io_6_label" + }, + "_io_7": { + "coord": [ + [ + 36, + 9 + ] + ], + "XY": [ + 547.5, + 202.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#feffff", + "outline_tag": "pin_io_outline__io_7", + "tag": "pin_io__io_7", + "label_tag": "_io_7_label" + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 37, + 12, + 37, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 612.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 612.5, + 302.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 31, + 3, + 31, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 522.5, + 92.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 522.5, + 47.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 33, + 10, + 35, + 10 + ] + ], + "multipoints": [], + "color": [ + 0, + 150, + 255 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 552.5, + 227.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 582.5, + 227.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 31, + 9, + 34, + 9 + ] + ], + "multipoints": [], + "color": [ + 0, + 150, + 255 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 522.5, + 212.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 567.5, + 212.5 + ], + "tag": "_wire_9_end" + } + } + } +} \ No newline at end of file diff --git a/menus.py b/menus.py index 385bcae..f3cb3ec 100644 --- a/menus.py +++ b/menus.py @@ -675,7 +675,7 @@ def checkCloseCircuit(self, ioOut): ioZone = [(c1,l1,c2,l2)] findOut = False circuitClose = True - #script = "" + script = "" #chip_out_checked = [] for f in self.func: @@ -702,6 +702,16 @@ def checkCloseCircuit(self, ioOut): inFuncConst += [f"I{id[4:]}"] findIn = True print("connecté à une ENTRÉE EXTERNE") + break + if not findIn: + for io_chipInZone in self.chip_in_wire: + id, zone = io_chipInZone + if self.is_linked_to(zone, inFunc): + inFuncConst += [f"I{id[4:]}"] + findIn = True + print("connecté à une ENTRÉE EXTERNE") + break + if not findIn: ## recherche d'une sortie de chip connectée à l'entrée actuelle de la chip findNext =False for nextOut in self.chip_out_wire: @@ -718,11 +728,32 @@ def checkCloseCircuit(self, ioOut): ######## RAPPEL RECURSIF SUR OUTZONE ###################### if outZone not in self.chip_out_checked: self.chip_out_checked += [outZone] - findNext, s = self.checkCloseCircuit(outZone) - inFuncConst += [s] + isPinOut = False + for pinOut in self.io_out: + id, pinZoneOut = pinOut + if self.is_linked_to([pinZoneOut], pt): + isPinOut = True + inFuncConst += [f"O{id[4:]} "] + findNext = True + if not isPinOut: + findNext, s = self.checkCloseCircuit(outZone) + inFuncConst += [s] + self.chip_out_script += [(s,outZone)] else: - # il faut voir si une sortie io n'existe pas sinon var temp - findNext = True + # il faut voir si une sortie io n'existe pas sinon var temp + isPinOut = False + for pinOut in self.io_out: + id, pinZoneOut = pinOut + if self.is_linked_to([pinZoneOut], pt): + isPinOut = True + inFuncConst += [f"O{id[4:]} "] + if not isPinOut: + for coc in self.chip_out_script: + if coc[1] == outZone: + exp = coc[0] + inFuncConst += [exp] + break + findNext = True break if not findIn and not findNext: self.in_outOC += [(id,inFunc)] @@ -753,8 +784,10 @@ def checkCircuit(self): self.pwrM, self.pwrP, self.wireNotUsed, self.pwrCC = [], [], [], [] self.io_inCC, self.io_outCC = [], [] self.chip_out_wire, self.chip_outCC = [], [] + self.chip_in_wire = [] self.in_outOC = [] self.chip_out_checked = [] + self.chip_out_script = [] for id, component in self.current_dict_circuit.items(): if id[:6] == "_chip_": @@ -900,12 +933,31 @@ def checkCircuit(self): ############### Verification des io_in sur pwr ##################### for ioin in self.io_in: c1, l1 = ioin[1][0], ioin[1][1] + inChipInWire = False if self.is_linked_to(self.pwrM, (c1, l1)): + inChipInWire = True if ioin[0] not in self.io_outCC: self.io_outCC += [ioin[0]] elif self.is_linked_to(self.pwrP, (c1, l1)): + inChipInWire = True if ioin[0] not in self.io_outCC: self.io_outCC += [ioin[0]] + if not inChipInWire: + ciw = deepcopy(self.board.sketcher.matrix[f"{c1},{l1}"]["link"]) + again = True + while again and len(self.wireNotUsed)>0: + again = False + for wused in self.wireNotUsed[:]: + id,cu1,lu1,cu2,lu2 = wused + if self.is_linked_to(ciw, (cu1, lu1)): + ciw += deepcopy(self.board.sketcher.matrix[f"{cu2},{lu2}"]["link"]) + self.wireNotUsed.remove(wused) + again = True + elif self.is_linked_to(ciw, (cu2, lu2)): + ciw += deepcopy(self.board.sketcher.matrix[f"{cu1},{lu1}"]["link"]) + self.wireNotUsed.remove(wused) + again = True + self.chip_in_wire += [(ioin[0], ciw)] ############### Verification des self.chip_out sur chip_out ##################### for chipio in self.chip_out: @@ -933,7 +985,7 @@ def checkCircuit(self): again = True self.chip_out_wire += [cow] if not self.pwrCC and not self.pwrChip["pwrMissConnected"] and not self.chip_ioCC \ - and not self.io_outCC and not self.chip_outCC: + and not self.io_outCC and not self.chip_outCC and not self.in_outOC: print("vérification du circuit fermé") self.script = "" for ioOut in self.io_out: @@ -955,4 +1007,5 @@ def checkCircuit(self): print(f"chip_outCC : {self.chip_outCC}") print(f"in_outOC : {self.in_outOC}") print(f"chip_out_wire : {self.chip_out_wire}") + print(f"chip_in_wire : {self.chip_in_wire}") print(f"script : {self.script}") From de921a1656660c922c658d6909778a5d744a1c9f Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Sat, 30 Nov 2024 00:54:32 -0500 Subject: [PATCH 21/44] MUX avec 3 tests --- TestMux.json | 1181 +++++++++++++++++++++++++ TestMux2.json | 1181 +++++++++++++++++++++++++ TestMuxEnCascade.json | 1202 ++++++++++++++++++++++++++ component_sketch.py | 8 + menus.py | 327 +++++-- object_model/circuit_object_model.py | 27 +- 6 files changed, 3873 insertions(+), 53 deletions(-) create mode 100644 TestMux.json create mode 100644 TestMux2.json create mode 100644 TestMuxEnCascade.json diff --git a/TestMux.json b/TestMux.json new file mode 100644 index 0000000..4838805 --- /dev/null +++ b/TestMux.json @@ -0,0 +1,1181 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 975.5, + 35.5 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 975.5, + 320.5 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 16, + "label": "74HC151", + "type": "74HC151", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "Mux", + "io": [ + [ + [ + 4, + 3, + 2, + 1, + 15, + 14, + 13, + 12 + ], + [ + 5 + ] + ] + ], + "pwr": [ + [ + 16, + "+" + ], + [ + 8, + "-" + ] + ], + "logicFunctionName": "Mux", + "io_select": [ + [ + 11, + 10, + 9 + ] + ], + "io_out_inv": [ + [ + 6 + ] + ], + "io_enable": [ + [] + ], + "io_enable_inv": [ + [ + 7 + ] + ], + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8", + "12,7", + "12,8" + ] + }, + "_io_0": { + "coord": [ + [ + 9, + 12 + ] + ], + "XY": [ + 142.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 3, + 5, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 12, + 12, + 12, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 237.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 237.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 60, + 1, + 60, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 957.5, + 32.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 957.5, + 302.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 59, + 2, + 59, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 47.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 942.5, + 317.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 11, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 222.5, + 302.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 5, + 12, + 5, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 132.5, + 302.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 6, + 12, + 6, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 147.5, + 302.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 7, + 12, + 7, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 162.5, + 302.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 8, + 12, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 192.5, + 302.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 6, + 3, + 6, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 92.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 147.5, + 32.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 7, + 3, + 7, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 92.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 162.5, + 32.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_wire_11": { + "mode": 0, + "coord": [ + [ + 8, + 3, + 9, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_11_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 92.5 + ], + "tag": "_wire_11_start" + }, + "end": { + "position": [ + 192.5, + 32.5 + ], + "tag": "_wire_11_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 10, + 6 + ] + ], + "XY": [ + 157.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#a9a9a9", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_io_2": { + "coord": [ + [ + 11, + 4 + ] + ], + "XY": [ + 172.5, + 97.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#a9a9a9", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_io_3": { + "coord": [ + [ + 12, + 6 + ] + ], + "XY": [ + 187.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#a9a9a9", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_chip_1": { + "XY": [ + 355.5, + 161.5 + ], + "pinUL_XY": [ + 357.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 16, + "label": "74HC151", + "type": "74HC151", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "Mux", + "io": [ + [ + [ + 4, + 3, + 2, + 1, + 15, + 14, + 13, + 12 + ], + [ + 5 + ] + ] + ], + "pwr": [ + [ + 16, + "+" + ], + [ + 8, + "-" + ] + ], + "logicFunctionName": "Mux", + "io_select": [ + [ + 11, + 10, + 9 + ] + ], + "io_out_inv": [ + [ + 6 + ] + ], + "io_enable": [ + [] + ], + "io_enable_inv": [ + [ + 7 + ] + ], + "occupied_holes": [ + "20,7", + "20,8", + "21,7", + "21,8", + "22,7", + "22,8", + "23,7", + "23,8", + "24,7", + "24,8", + "25,7", + "25,8", + "26,7", + "26,8", + "27,7", + "27,8" + ] + }, + "_wire_13": { + "mode": 0, + "coord": [ + [ + 27, + 12, + 27, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_13_body", + "endpoints": { + "start": { + "position": [ + 462.5, + 257.5 + ], + "tag": "_wire_13_start" + }, + "end": { + "position": [ + 462.5, + 257.5 + ], + "tag": "_wire_13_end" + } + } + }, + "_wire_14": { + "mode": 0, + "coord": [ + [ + 26, + 12, + 25, + 13 + ] + ], + "multipoints": [ + 388, + 289 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_14_body", + "endpoints": { + "start": { + "position": [ + 447.5, + 257.5 + ], + "tag": "_wire_14_start" + }, + "end": { + "position": [ + 447.5, + 257.5 + ], + "tag": "_wire_14_end" + } + } + }, + "_wire_15": { + "mode": 0, + "coord": [ + [ + 20, + 12, + 19, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_15_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 257.5 + ], + "tag": "_wire_15_start" + }, + "end": { + "position": [ + 357.5, + 257.5 + ], + "tag": "_wire_15_end" + } + } + }, + "_wire_16": { + "mode": 0, + "coord": [ + [ + 21, + 12, + 21, + 13 + ] + ], + "multipoints": [ + 326, + 289 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_16_body", + "endpoints": { + "start": { + "position": [ + 372.5, + 257.5 + ], + "tag": "_wire_16_start" + }, + "end": { + "position": [ + 372.5, + 257.5 + ], + "tag": "_wire_16_end" + } + } + }, + "_wire_17": { + "mode": 0, + "coord": [ + [ + 22, + 12, + 22, + 13 + ] + ], + "multipoints": [ + 340, + 285 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_17_body", + "endpoints": { + "start": { + "position": [ + 387.5, + 257.5 + ], + "tag": "_wire_17_start" + }, + "end": { + "position": [ + 387.5, + 257.5 + ], + "tag": "_wire_17_end" + } + } + }, + "_wire_18": { + "mode": 0, + "coord": [ + [ + 23, + 12, + 23, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_18_body", + "endpoints": { + "start": { + "position": [ + 402.5, + 257.5 + ], + "tag": "_wire_18_start" + }, + "end": { + "position": [ + 402.5, + 257.5 + ], + "tag": "_wire_18_end" + } + } + }, + "_wire_19": { + "mode": 0, + "coord": [ + [ + 21, + 3, + 21, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_19_body", + "endpoints": { + "start": { + "position": [ + 372.5, + 92.5 + ], + "tag": "_wire_19_start" + }, + "end": { + "position": [ + 372.5, + 92.5 + ], + "tag": "_wire_19_end" + } + } + }, + "_wire_20": { + "mode": 0, + "coord": [ + [ + 22, + 3, + 22, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_20_body", + "endpoints": { + "start": { + "position": [ + 387.5, + 92.5 + ], + "tag": "_wire_20_start" + }, + "end": { + "position": [ + 387.5, + 92.5 + ], + "tag": "_wire_20_end" + } + } + }, + "_wire_21": { + "mode": 0, + "coord": [ + [ + 23, + 3, + 23, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_21_body", + "endpoints": { + "start": { + "position": [ + 402.5, + 92.5 + ], + "tag": "_wire_21_start" + }, + "end": { + "position": [ + 402.5, + 92.5 + ], + "tag": "_wire_21_end" + } + } + }, + "_wire_22": { + "mode": 0, + "coord": [ + [ + 20, + 3, + 19, + 2 + ] + ], + "multipoints": [ + 298, + 51 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_22_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 92.5 + ], + "tag": "_wire_22_start" + }, + "end": { + "position": [ + 357.5, + 92.5 + ], + "tag": "_wire_22_end" + } + } + }, + "_wire_23": { + "mode": 0, + "coord": [ + [ + 24, + 3, + 24, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_23_body", + "endpoints": { + "start": { + "position": [ + 417.5, + 92.5 + ], + "tag": "_wire_23_start" + }, + "end": { + "position": [ + 417.5, + 92.5 + ], + "tag": "_wire_23_end" + } + } + }, + "_wire_24": { + "mode": 0, + "coord": [ + [ + 9, + 3, + 10, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_24_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 92.5 + ], + "tag": "_wire_24_start" + }, + "end": { + "position": [ + 192.5, + 92.5 + ], + "tag": "_wire_24_end" + } + } + }, + "_io_4": { + "coord": [ + [ + 25, + 6 + ] + ], + "XY": [ + 382.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#8df900", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_io_5": { + "coord": [ + [ + 27, + 6 + ] + ], + "XY": [ + 412.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#8df900", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" + }, + "_io_6": { + "coord": [ + [ + 26, + 4 + ] + ], + "XY": [ + 397.5, + 97.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#8df900", + "outline_tag": "pin_io_outline__io_6", + "tag": "pin_io__io_6", + "label_tag": "_io_6_label" + }, + "_io_7": { + "coord": [ + [ + 24, + 12 + ] + ], + "XY": [ + 367.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff2f92", + "outline_tag": "pin_io_outline__io_7", + "tag": "pin_io__io_7", + "label_tag": "_io_7_label" + } +} \ No newline at end of file diff --git a/TestMux2.json b/TestMux2.json new file mode 100644 index 0000000..541f95e --- /dev/null +++ b/TestMux2.json @@ -0,0 +1,1181 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 972.5, + 32.5 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 972.5, + 317.5 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 16, + "label": "74HC151", + "type": "74HC151", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "Mux", + "io": [ + [ + [ + 4, + 3, + 2, + 1, + 15, + 14, + 13, + 12 + ], + [ + 5 + ] + ] + ], + "pwr": [ + [ + 16, + "+" + ], + [ + 8, + "-" + ] + ], + "logicFunctionName": "Mux", + "io_select": [ + [ + 11, + 10, + 9 + ] + ], + "io_out_inv": [ + [ + 6 + ] + ], + "io_enable": [ + [] + ], + "io_enable_inv": [ + [ + 7 + ] + ], + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8", + "12,7", + "12,8" + ] + }, + "_io_0": { + "coord": [ + [ + 9, + 12 + ] + ], + "XY": [ + 142.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 3, + 5, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 12, + 12, + 12, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 237.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 237.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 60, + 1, + 60, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 957.5, + 32.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 957.5, + 302.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 59, + 2, + 59, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 47.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 942.5, + 317.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 11, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 222.5, + 302.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 5, + 12, + 5, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 132.5, + 302.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 6, + 12, + 6, + 14 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 147.5, + 317.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 7, + 12, + 7, + 14 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 162.5, + 317.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 8, + 12, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 192.5, + 302.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 6, + 3, + 6, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 92.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 147.5, + 32.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 7, + 3, + 7, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 92.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 162.5, + 32.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_wire_11": { + "mode": 0, + "coord": [ + [ + 8, + 3, + 9, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_11_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 92.5 + ], + "tag": "_wire_11_start" + }, + "end": { + "position": [ + 192.5, + 32.5 + ], + "tag": "_wire_11_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 10, + 6 + ] + ], + "XY": [ + 157.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#a9a9a9", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_io_2": { + "coord": [ + [ + 11, + 4 + ] + ], + "XY": [ + 172.5, + 97.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#a9a9a9", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_io_3": { + "coord": [ + [ + 12, + 6 + ] + ], + "XY": [ + 187.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#a9a9a9", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_chip_1": { + "XY": [ + 355.5, + 161.5 + ], + "pinUL_XY": [ + 357.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 16, + "label": "74HC151", + "type": "74HC151", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "Mux", + "io": [ + [ + [ + 4, + 3, + 2, + 1, + 15, + 14, + 13, + 12 + ], + [ + 5 + ] + ] + ], + "pwr": [ + [ + 16, + "+" + ], + [ + 8, + "-" + ] + ], + "logicFunctionName": "Mux", + "io_select": [ + [ + 11, + 10, + 9 + ] + ], + "io_out_inv": [ + [ + 6 + ] + ], + "io_enable": [ + [] + ], + "io_enable_inv": [ + [ + 7 + ] + ], + "occupied_holes": [ + "20,7", + "20,8", + "21,7", + "21,8", + "22,7", + "22,8", + "23,7", + "23,8", + "24,7", + "24,8", + "25,7", + "25,8", + "26,7", + "26,8", + "27,7", + "27,8" + ] + }, + "_wire_12": { + "mode": 0, + "coord": [ + [ + 27, + 12, + 27, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_12_body", + "endpoints": { + "start": { + "position": [ + 462.5, + 257.5 + ], + "tag": "_wire_12_start" + }, + "end": { + "position": [ + 462.5, + 302.5 + ], + "tag": "_wire_12_end" + } + } + }, + "_wire_13": { + "mode": 0, + "coord": [ + [ + 26, + 12, + 25, + 14 + ] + ], + "multipoints": [ + 388, + 289 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_13_body", + "endpoints": { + "start": { + "position": [ + 447.5, + 257.5 + ], + "tag": "_wire_13_start" + }, + "end": { + "position": [ + 432.5, + 317.5 + ], + "tag": "_wire_13_end" + } + } + }, + "_wire_14": { + "mode": 0, + "coord": [ + [ + 20, + 12, + 19, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_14_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 257.5 + ], + "tag": "_wire_14_start" + }, + "end": { + "position": [ + 342.5, + 302.5 + ], + "tag": "_wire_14_end" + } + } + }, + "_wire_15": { + "mode": 0, + "coord": [ + [ + 21, + 12, + 21, + 13 + ] + ], + "multipoints": [ + 326, + 289 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_15_body", + "endpoints": { + "start": { + "position": [ + 372.5, + 257.5 + ], + "tag": "_wire_15_start" + }, + "end": { + "position": [ + 372.5, + 302.5 + ], + "tag": "_wire_15_end" + } + } + }, + "_wire_16": { + "mode": 0, + "coord": [ + [ + 22, + 12, + 22, + 13 + ] + ], + "multipoints": [ + 340, + 285 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_16_body", + "endpoints": { + "start": { + "position": [ + 387.5, + 257.5 + ], + "tag": "_wire_16_start" + }, + "end": { + "position": [ + 387.5, + 302.5 + ], + "tag": "_wire_16_end" + } + } + }, + "_wire_17": { + "mode": 0, + "coord": [ + [ + 23, + 12, + 23, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_17_body", + "endpoints": { + "start": { + "position": [ + 402.5, + 257.5 + ], + "tag": "_wire_17_start" + }, + "end": { + "position": [ + 402.5, + 302.5 + ], + "tag": "_wire_17_end" + } + } + }, + "_wire_18": { + "mode": 0, + "coord": [ + [ + 21, + 3, + 21, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_18_body", + "endpoints": { + "start": { + "position": [ + 372.5, + 92.5 + ], + "tag": "_wire_18_start" + }, + "end": { + "position": [ + 372.5, + 32.5 + ], + "tag": "_wire_18_end" + } + } + }, + "_wire_19": { + "mode": 0, + "coord": [ + [ + 22, + 3, + 22, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_19_body", + "endpoints": { + "start": { + "position": [ + 387.5, + 92.5 + ], + "tag": "_wire_19_start" + }, + "end": { + "position": [ + 387.5, + 32.5 + ], + "tag": "_wire_19_end" + } + } + }, + "_wire_20": { + "mode": 0, + "coord": [ + [ + 23, + 3, + 23, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_20_body", + "endpoints": { + "start": { + "position": [ + 402.5, + 92.5 + ], + "tag": "_wire_20_start" + }, + "end": { + "position": [ + 402.5, + 32.5 + ], + "tag": "_wire_20_end" + } + } + }, + "_wire_21": { + "mode": 0, + "coord": [ + [ + 20, + 3, + 19, + 2 + ] + ], + "multipoints": [ + 298, + 51 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_21_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 92.5 + ], + "tag": "_wire_21_start" + }, + "end": { + "position": [ + 342.5, + 47.5 + ], + "tag": "_wire_21_end" + } + } + }, + "_wire_22": { + "mode": 0, + "coord": [ + [ + 24, + 3, + 24, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_22_body", + "endpoints": { + "start": { + "position": [ + 417.5, + 92.5 + ], + "tag": "_wire_22_start" + }, + "end": { + "position": [ + 417.5, + 47.5 + ], + "tag": "_wire_22_end" + } + } + }, + "_wire_23": { + "mode": 0, + "coord": [ + [ + 9, + 3, + 10, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_23_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 92.5 + ], + "tag": "_wire_23_start" + }, + "end": { + "position": [ + 207.5, + 47.5 + ], + "tag": "_wire_23_end" + } + } + }, + "_io_4": { + "coord": [ + [ + 25, + 6 + ] + ], + "XY": [ + 382.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#8df900", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_io_5": { + "coord": [ + [ + 27, + 6 + ] + ], + "XY": [ + 412.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#8df900", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" + }, + "_io_6": { + "coord": [ + [ + 26, + 4 + ] + ], + "XY": [ + 397.5, + 97.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#8df900", + "outline_tag": "pin_io_outline__io_6", + "tag": "pin_io__io_6", + "label_tag": "_io_6_label" + }, + "_io_7": { + "coord": [ + [ + 25, + 11 + ] + ], + "XY": [ + 382.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_7", + "tag": "pin_io__io_7", + "label_tag": "_io_7_label" + } +} \ No newline at end of file diff --git a/TestMuxEnCascade.json b/TestMuxEnCascade.json new file mode 100644 index 0000000..046125d --- /dev/null +++ b/TestMuxEnCascade.json @@ -0,0 +1,1202 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 972.5, + 32.5 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 972.5, + 317.5 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 16, + "label": "74HC151", + "type": "74HC151", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "Mux", + "io": [ + [ + [ + 4, + 3, + 2, + 1, + 15, + 14, + 13, + 12 + ], + [ + 5 + ] + ] + ], + "pwr": [ + [ + 16, + "+" + ], + [ + 8, + "-" + ] + ], + "logicFunctionName": "Mux", + "io_select": [ + [ + 11, + 10, + 9 + ] + ], + "io_out_inv": [ + [ + 6 + ] + ], + "io_enable": [ + [] + ], + "io_enable_inv": [ + [ + 7 + ] + ], + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8", + "12,7", + "12,8" + ] + }, + "_io_0": { + "coord": [ + [ + 9, + 12 + ] + ], + "XY": [ + 142.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 3, + 5, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 12, + 12, + 12, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 237.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 237.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 60, + 1, + 60, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 957.5, + 32.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 957.5, + 302.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 59, + 2, + 59, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 47.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 942.5, + 317.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 11, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 222.5, + 302.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 5, + 12, + 5, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 132.5, + 302.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 6, + 12, + 6, + 14 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 147.5, + 317.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 7, + 12, + 7, + 14 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 162.5, + 317.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 8, + 12, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 192.5, + 302.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 6, + 3, + 6, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 92.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 147.5, + 32.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 7, + 3, + 7, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 92.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 162.5, + 32.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_wire_11": { + "mode": 0, + "coord": [ + [ + 8, + 3, + 9, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_11_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 92.5 + ], + "tag": "_wire_11_start" + }, + "end": { + "position": [ + 192.5, + 32.5 + ], + "tag": "_wire_11_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 10, + 6 + ] + ], + "XY": [ + 157.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#a9a9a9", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_io_2": { + "coord": [ + [ + 11, + 4 + ] + ], + "XY": [ + 172.5, + 97.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#a9a9a9", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_io_3": { + "coord": [ + [ + 12, + 6 + ] + ], + "XY": [ + 187.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#a9a9a9", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_chip_1": { + "XY": [ + 355.5, + 161.5 + ], + "pinUL_XY": [ + 357.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 16, + "label": "74HC151", + "type": "74HC151", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "Mux", + "io": [ + [ + [ + 4, + 3, + 2, + 1, + 15, + 14, + 13, + 12 + ], + [ + 5 + ] + ] + ], + "pwr": [ + [ + 16, + "+" + ], + [ + 8, + "-" + ] + ], + "logicFunctionName": "Mux", + "io_select": [ + [ + 11, + 10, + 9 + ] + ], + "io_out_inv": [ + [ + 6 + ] + ], + "io_enable": [ + [] + ], + "io_enable_inv": [ + [ + 7 + ] + ], + "occupied_holes": [ + "20,7", + "20,8", + "21,7", + "21,8", + "22,7", + "22,8", + "23,7", + "23,8", + "24,7", + "24,8", + "25,7", + "25,8", + "26,7", + "26,8", + "27,7", + "27,8" + ] + }, + "_wire_12": { + "mode": 0, + "coord": [ + [ + 27, + 12, + 27, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_12_body", + "endpoints": { + "start": { + "position": [ + 462.5, + 257.5 + ], + "tag": "_wire_12_start" + }, + "end": { + "position": [ + 462.5, + 302.5 + ], + "tag": "_wire_12_end" + } + } + }, + "_wire_13": { + "mode": 0, + "coord": [ + [ + 26, + 12, + 25, + 14 + ] + ], + "multipoints": [ + 388, + 289 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_13_body", + "endpoints": { + "start": { + "position": [ + 447.5, + 257.5 + ], + "tag": "_wire_13_start" + }, + "end": { + "position": [ + 432.5, + 317.5 + ], + "tag": "_wire_13_end" + } + } + }, + "_wire_14": { + "mode": 0, + "coord": [ + [ + 20, + 12, + 19, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_14_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 257.5 + ], + "tag": "_wire_14_start" + }, + "end": { + "position": [ + 342.5, + 302.5 + ], + "tag": "_wire_14_end" + } + } + }, + "_wire_15": { + "mode": 0, + "coord": [ + [ + 21, + 12, + 21, + 13 + ] + ], + "multipoints": [ + 326, + 289 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_15_body", + "endpoints": { + "start": { + "position": [ + 372.5, + 257.5 + ], + "tag": "_wire_15_start" + }, + "end": { + "position": [ + 372.5, + 302.5 + ], + "tag": "_wire_15_end" + } + } + }, + "_wire_16": { + "mode": 0, + "coord": [ + [ + 22, + 12, + 22, + 13 + ] + ], + "multipoints": [ + 340, + 285 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_16_body", + "endpoints": { + "start": { + "position": [ + 387.5, + 257.5 + ], + "tag": "_wire_16_start" + }, + "end": { + "position": [ + 387.5, + 302.5 + ], + "tag": "_wire_16_end" + } + } + }, + "_wire_17": { + "mode": 0, + "coord": [ + [ + 23, + 12, + 23, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_17_body", + "endpoints": { + "start": { + "position": [ + 402.5, + 257.5 + ], + "tag": "_wire_17_start" + }, + "end": { + "position": [ + 402.5, + 302.5 + ], + "tag": "_wire_17_end" + } + } + }, + "_wire_18": { + "mode": 0, + "coord": [ + [ + 21, + 3, + 21, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_18_body", + "endpoints": { + "start": { + "position": [ + 372.5, + 92.5 + ], + "tag": "_wire_18_start" + }, + "end": { + "position": [ + 372.5, + 32.5 + ], + "tag": "_wire_18_end" + } + } + }, + "_wire_19": { + "mode": 0, + "coord": [ + [ + 22, + 3, + 22, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_19_body", + "endpoints": { + "start": { + "position": [ + 387.5, + 92.5 + ], + "tag": "_wire_19_start" + }, + "end": { + "position": [ + 387.5, + 32.5 + ], + "tag": "_wire_19_end" + } + } + }, + "_wire_20": { + "mode": 0, + "coord": [ + [ + 23, + 3, + 23, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_20_body", + "endpoints": { + "start": { + "position": [ + 402.5, + 92.5 + ], + "tag": "_wire_20_start" + }, + "end": { + "position": [ + 402.5, + 32.5 + ], + "tag": "_wire_20_end" + } + } + }, + "_wire_21": { + "mode": 0, + "coord": [ + [ + 20, + 3, + 19, + 2 + ] + ], + "multipoints": [ + 298, + 51 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_21_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 92.5 + ], + "tag": "_wire_21_start" + }, + "end": { + "position": [ + 342.5, + 47.5 + ], + "tag": "_wire_21_end" + } + } + }, + "_wire_22": { + "mode": 0, + "coord": [ + [ + 24, + 3, + 24, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_22_body", + "endpoints": { + "start": { + "position": [ + 417.5, + 92.5 + ], + "tag": "_wire_22_start" + }, + "end": { + "position": [ + 417.5, + 47.5 + ], + "tag": "_wire_22_end" + } + } + }, + "_wire_23": { + "mode": 0, + "coord": [ + [ + 9, + 3, + 10, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_23_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 92.5 + ], + "tag": "_wire_23_start" + }, + "end": { + "position": [ + 207.5, + 47.5 + ], + "tag": "_wire_23_end" + } + } + }, + "_io_4": { + "coord": [ + [ + 25, + 6 + ] + ], + "XY": [ + 382.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#8df900", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_io_5": { + "coord": [ + [ + 27, + 6 + ] + ], + "XY": [ + 412.5, + 127.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#8df900", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" + }, + "_io_7": { + "coord": [ + [ + 25, + 11 + ] + ], + "XY": [ + 382.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_7", + "tag": "pin_io__io_7", + "label_tag": "_io_7_label" + }, + "_wire_24": { + "mode": 0, + "coord": [ + [ + 9, + 9, + 26, + 6 + ] + ], + "multipoints": [ + 281, + 202, + 280, + 130 + ], + "color": [ + 4, + 50, + 255 + ], + "wire_body_tag": "_wire_24_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 212.5 + ], + "tag": "_wire_24_start" + }, + "end": { + "position": [ + 192.5, + 212.5 + ], + "tag": "_wire_24_end" + } + } + } +} \ No newline at end of file diff --git a/component_sketch.py b/component_sketch.py index 812e0f7..de13f3a 100644 --- a/component_sketch.py +++ b/component_sketch.py @@ -2024,6 +2024,10 @@ def draw_chip(self, x_distance, y_distance, scale=1, width=-1, direction=HORIZON dim["chipWidth"] = kwargs.get("chipWidth", dim["chipWidth"]) dim["label"] = kwargs.get("label", dim["label"]) dim["internalFunc"] = kwargs.get("internalFunc", None) + dim["io_select"] = kwargs.get("io_select", None) + dim["io_out_inv"] = kwargs.get("io_out_inv", None) + dim["io_enable"] = kwargs.get("io_enable", None) + dim["io_enable_inv"] = kwargs.get("io_enable_inv", None) dim["pwr"] = kwargs.get("pwr", None) logic_function_name = kwargs.get("logicFunctionName", None) @@ -2072,6 +2076,10 @@ def draw_chip(self, x_distance, y_distance, scale=1, width=-1, direction=HORIZON params["pwr"] = pwr params["logicFunctionName"] = logic_function_name params["pwr"] = dim["pwr"] + params["io_select"] = dim["io_select"] + params["io_out_inv"] = dim["io_out_inv"] + params["io_enable"] = dim["io_enable"] + params["io_enable_inv"] = dim["io_enable_inv"] num_pins_per_side = dim["pinCount"] // 2 tag_base = "base" + chip_id tag_menu = "menu" + chip_id diff --git a/menus.py b/menus.py index f3cb3ec..dc4c1f4 100644 --- a/menus.py +++ b/menus.py @@ -11,6 +11,7 @@ import json from typing import Callable import serial.tools.list_ports # type: ignore +from tkmacosx import Button from breadboard import Breadboard from component_sketch import ComponentSketcher @@ -182,7 +183,9 @@ def select_microcontroller(self): # Create a combobox with the options combobox = ttk.Combobox(dialog, values=available_microcontrollers) combobox.pack(pady=10) - + + default_option = "Arduino Mega" # Changez ceci selon votre choix + combobox.set(default_option) # Définit l'option par défaut # Create a button to confirm the selection def confirm_selection(): selected_option = combobox.get() @@ -191,10 +194,26 @@ def confirm_selection(): print(f"{selected_option} selected.") dialog.destroy() - confirm_button = tk.Button(dialog, text="Confirm", command=confirm_selection) + confirm_button = Button(dialog, text="Confirm", command=confirm_selection) confirm_button.pack(pady=10) + + # def map_mcu_pin(self, treeview=None, input_pin_ios, output_pin_ios, input_pins, output_pins): + # # Populate the table with input and output pin mappings + # self.mcu_pin= {} + # for idx, pin_io in enumerate(input_pin_ios): + # mcu_pin = input_pins[idx] + # pin_number = pin_io["id"].split("_")[-1] + # treeview.insert("", "end", values=(pin_number, "Input", mcu_pin)) + # self.mcu_pin.update({f"I{pin_number}":f"I{mcu_pin}"}) + - def show_correspondence_table(self): + # for idx, pin_io in enumerate(output_pin_ios): + # mcu_pin = output_pins[idx] + # pin_number = pin_io["id"].split("_")[-1] + # treeview.insert("", "end", values=(pin_number, "Output", mcu_pin)) + # self.mcu_pin.update({f"O{pin_number}":f"O{mcu_pin}"}) + + def show_correspondence_table(self, show=True): """Displays the correspondence table between pin_io objects and microcontroller pins in a table format.""" if self.selected_microcontroller is None: messagebox.showwarning("No Microcontroller Selected", "Please select a microcontroller first.") @@ -233,9 +252,11 @@ def show_correspondence_table(self): # Create a new window for the correspondence table table_window = tk.Toplevel(self.parent) + table_window.withdraw() table_window.title("Correspondence Table") table_window.geometry("400x300") + # if show: # Create a Treeview widget for the table tree = ttk.Treeview(table_window, columns=("ID", "Type", "MCU Pin"), show="headings", height=10) tree.pack(expand=True, fill="both", padx=10, pady=10) @@ -248,26 +269,34 @@ def show_correspondence_table(self): tree.heading("Type", text="Type") tree.heading("MCU Pin", text="MCU Pin") + #self.map_mcu_pin(tree, input_pin_ios, output_pin_ios, input_pins, output_pins) # Populate the table with input and output pin mappings + self.mcu_pin= {} for idx, pin_io in enumerate(input_pin_ios): mcu_pin = input_pins[idx] pin_number = pin_io["id"].split("_")[-1] + # if show: tree.insert("", "end", values=(pin_number, "Input", mcu_pin)) + self.mcu_pin.update({f"I{pin_number}":f"I{mcu_pin}"}) + for idx, pin_io in enumerate(output_pin_ios): mcu_pin = output_pins[idx] pin_number = pin_io["id"].split("_")[-1] tree.insert("", "end", values=(pin_number, "Output", mcu_pin)) + self.mcu_pin.update({f"O{pin_number}":f"O{mcu_pin}"}) - # Add a scrollbar if the list gets too long - scrollbar = ttk.Scrollbar(table_window, orient="vertical", command=tree.yview) - tree.configure(yscroll=scrollbar.set) - scrollbar.pack(side="right", fill="y") + if show: + table_window.deiconify() + # Add a scrollbar if the list gets too long + scrollbar = ttk.Scrollbar(table_window, orient="vertical", command=tree.yview) + tree.configure(yscroll=scrollbar.set) + scrollbar.pack(side="right", fill="y") - # Show the table in the new window - table_window.transient(self.parent) # Set to be on top of the parent window - table_window.grab_set() # Prevent interaction with the main window until closed - table_window.mainloop() + # Show the table in the new window + table_window.transient(self.parent) # Set to be on top of the parent window + table_window.grab_set() # Prevent interaction with the main window until closed + table_window.mainloop() def create_menu(self, menu_name, options, menu_commands): """ @@ -278,7 +307,7 @@ def create_menu(self, menu_name, options, menu_commands): - options (list): List of options under the menu. """ # Create the menu button - btn = tk.Button( + btn = Button( self.menu_bar, text=menu_name, bg="#333333", @@ -313,7 +342,7 @@ def select_menu_item(option): # Populate the dropdown with menu options for option in options: - option_btn = tk.Button( + option_btn = Button( dropdown, text=option, bg="#333333", @@ -346,7 +375,7 @@ def toggle_dropdown(self, menu_name): - menu_name (str): The name of the menu to toggle. """ for child in self.menu_bar.winfo_children(): - if isinstance(child, tk.Button) and hasattr(child, "dropdown"): + if isinstance(child, Button) and hasattr(child, "dropdown"): if child["text"] == menu_name: if child.dropdown.winfo_ismapped(): child.dropdown.place_forget() @@ -390,11 +419,11 @@ def close_dropdown(self, event): and not any( self.is_descendant(event.widget, child.dropdown) for child in self.menu_bar.winfo_children() - if isinstance(child, tk.Button) and hasattr(child, "dropdown") + if isinstance(child, Button) and hasattr(child, "dropdown") ) ): for child in self.menu_bar.winfo_children(): - if isinstance(child, tk.Button) and hasattr(child, "dropdown"): + if isinstance(child, Button) and hasattr(child, "dropdown"): child.dropdown.place_forget() # Menu Handler Functions @@ -571,7 +600,7 @@ def confirm_selection(): self.serial_port.com_port = selected_option dialog.destroy() - confirm_button = tk.Button(dialog, text="Confirm", command=confirm_selection) + confirm_button = Button(dialog, text="Confirm", command=confirm_selection) confirm_button.pack(pady=10) def open_documentation(self): @@ -636,43 +665,59 @@ def is_linked_to(self, dest, src): def decodeFunc(self,inVar, funcName): if funcName == "NandGate": - s = f"! ( {inVar[0]} " + s = f"! ( {inVar[0]["val"]} " for v in inVar[1:]: - s += f"& {v} " + s += f"& {v["val"]} " s += ") " elif funcName == "AndGate": - s = f"( {inVar[0]} " + s = f"( {inVar[0]["val"]} " for v in inVar[1:]: - s += f"& {v} " + s += f"& {v["val"]} " s += ") " elif funcName == "NorGate": - s = f"! ( {inVar[0]} " + s = f"! ( {inVar[0]["val"]} " for v in inVar[1:]: - s += f"| {v} " + s += f"| {v["val"]} " s += ") " elif funcName == "OrGate": - s = f"( {inVar[0]} " + s = f"( {inVar[0]["val"]} " for v in inVar[1:]: - s += f"| {v} " + s += f"| {v["val"]} " s += ") " elif funcName == "NotGate": - s = f"! {inVar[0]} " + s = f"! {inVar[0]["val"]} " elif funcName == "XorGate": - s = f"( {inVar[0]} " + s = f"( {inVar[0]["val"]} " for v in inVar[1:]: - s += f"^ {v} " + s += f"^ {v["val"]} " s += ") " elif funcName == "XnorGate": - s = f"! ( {inVar[0]} " + s = f"! ( {inVar[0]["val"]} " for v in inVar[1:]: - s += f"| {v} " - s += ") " + s += f"| {v["val"]} " + s += ") " + elif funcName == "Mux": + e =["( ","( ","( ","( ","( ","( ","( ","( "] + for v in range(8): + v2, v1, v0 = (v & 1)^1, ((v & 2) >> 1)^1, ((v & 4) >> 2)^1 + e[v] += inVar[v]["val"] + " & " + inVar[11]["einv"] + " & " + \ + v0*" ! " + inVar[8]["sel"] + " & " + v1*" ! " + inVar[9]["sel"] + " & " + v2*" ! " + inVar[10]["sel"] + " ) " + s = " ( " + e[0] + for et in e[1:]: + s += "| " + et + s += " ) " + return s - def checkCloseCircuit(self, ioOut): + def checkCloseCircuit(self, ioOut, params={}): id, (c1,l1,c2,l2) = ioOut ioZone = [(c1,l1,c2,l2)] + chip_select = params.get("chip_select", []) + chip_out_inv = params.get("chip_out_inv", []) + chip_in_enable = params.get("chip_in_enable", []) + chip_in_enable_inv = params.get("chip_in_enable_inv", []) + findOut = False circuitClose = True script = "" @@ -680,6 +725,25 @@ def checkCloseCircuit(self, ioOut): for f in self.func: idOut, inLst, fName, outLst = f + if chip_select: + chipSel = chip_select + [chipSel] = [list(chipS[1:]) for chipS in chipSel if chipS[0] == idOut] + else: chipSel = [] + if chip_in_enable_inv: + chipEnInv = chip_in_enable_inv + [chipEnInv] = [list(chipEI[1:]) for chipEI in chipEnInv if chipEI[0] == idOut] + else: chipEnInv = [] + if chip_in_enable: + chipEn = chip_in_enable + [chipEn] = [list(chipE[1:]) for chipE in chipEn if chipE[0] == idOut] + else: chipEn = [] + if chip_out_inv: + chipOutInv = chip_out_inv + [chipOutInv] = [list(chipOI[1:]) for chipOI in chipOutInv if chipOI[0] == idOut] + else: chipOutInv = [] + + inLst += chipSel + chipEnInv + chipEn + outLst += chipOutInv for out in outLst: #if out not in chip_out_checked: if self.is_linked_to(ioZone, out): @@ -690,16 +754,38 @@ def checkCloseCircuit(self, ioOut): for n,inFunc in enumerate(inLst): findIn = False if self.is_linked_to(self.pwrP, inFunc) or self.is_linked_to(self.pwrM, inFunc): + constKey = "val" + pos, neg = "1", "0" + for c in chipSel: + if c == inFunc: + constKey = "sel" + for c in chipEnInv: + if c == inFunc: + constKey = "einv" + pos, neg = "0", "1" + for c in chipEn: + if c == inFunc: + constKey = "enb" if self.is_linked_to(self.pwrP, inFunc): - inFuncConst += ["1"] - else: inFuncConst += ["0"] + inFuncConst += [{constKey:pos, "num":n}] + else: inFuncConst += [{constKey:neg, "num":n}] findIn = True print("connecté à pwr") if not findIn: for io_inZone in self.io_in: id, zone = io_inZone if self.is_linked_to([zone], inFunc): - inFuncConst += [f"I{id[4:]}"] + constKey = "val" + for c in chipSel: + if c == inFunc: + constKey = "sel" + for c in chipEnInv: + if c == inFunc: + constKey = "einv" + for c in chipEn: + if c == inFunc: + constKey = "enb" + inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n findIn = True print("connecté à une ENTRÉE EXTERNE") break @@ -707,9 +793,19 @@ def checkCloseCircuit(self, ioOut): for io_chipInZone in self.chip_in_wire: id, zone = io_chipInZone if self.is_linked_to(zone, inFunc): - inFuncConst += [f"I{id[4:]}"] + constKey = "val" + for c in chipSel: + if c == inFunc: + constKey = "sel" + for c in chipEnInv: + if c == inFunc: + constKey = "einv" + for c in chipEn: + if c == inFunc: + constKey = "enb" + inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n}] findIn = True - print("connecté à une ENTRÉE EXTERNE") + print("connecté à une ENTRÉE EXTERNE par cable") # ici ajouter n {"val":self.mcu_pin[f"I{id[4:]}"], "num":n} break if not findIn: ## recherche d'une sortie de chip connectée à l'entrée actuelle de la chip @@ -732,12 +828,42 @@ def checkCloseCircuit(self, ioOut): for pinOut in self.io_out: id, pinZoneOut = pinOut if self.is_linked_to([pinZoneOut], pt): + outPrev = self.mcu_pin[f"O{id[4:]}"] + constKey = "val" + for c in chipSel: + if c == inFunc: + constKey = "sel" + for c in chipEnInv: + if c == inFunc: + constKey = "einv" + for c in chipEn: + if c == inFunc: + constKey = "enb" + + for c in chipOutInv: + if c == pt: + outPrev = "! " + outPrev isPinOut = True - inFuncConst += [f"O{id[4:]} "] + inFuncConst += [{constKey:outPrev, "num":n}] # [self.mcu_pin[f"O{id[4:]}"]] findNext = True if not isPinOut: findNext, s = self.checkCloseCircuit(outZone) - inFuncConst += [s] + constKey = "val" + for c in chipSel: + if c == inFunc: + constKey = "sel" + for c in chipEnInv: + if c == inFunc: + constKey = "einv" + for c in chipEn: + if c == inFunc: + constKey = "enb" + + for c in chipOutInv: + if c == pt: + s = "! " + s + + inFuncConst += [{constKey:s, "num":n}] self.chip_out_script += [(s,outZone)] else: # il faut voir si une sortie io n'existe pas sinon var temp @@ -746,12 +872,43 @@ def checkCloseCircuit(self, ioOut): id, pinZoneOut = pinOut if self.is_linked_to([pinZoneOut], pt): isPinOut = True - inFuncConst += [f"O{id[4:]} "] + outPrev = self.mcu_pin[f"O{id[4:]}"] + constKey = "val" + for c in chipSel: + if c == inFunc: + constKey = "sel" + for c in chipEnInv: + if c == inFunc: + constKey = "einv" + for c in chipEn: + if c == inFunc: + constKey = "enb" + + for c in chipOutInv: + if c == pt: + outPrev = "! " + outPrev + + inFuncConst += [{constKey:outPrev, "num":n}] if not isPinOut: for coc in self.chip_out_script: if coc[1] == outZone: exp = coc[0] - inFuncConst += [exp] + constKey = "val" + for c in chipSel: + if c == inFunc: + constKey = "sel" + for c in chipEnInv: + if c == inFunc: + constKey = "einv" + for c in chipEn: + if c == inFunc: + constKey = "enb" + + for c in chipOutInv: + if c == pt: + exp = "! " + exp + + inFuncConst += [{constKey:exp, "num":n}] break findNext = True break @@ -776,10 +933,15 @@ def checkCircuit(self): print("Lancer la vérification") self.func = [] self.wire = [] - self.pwrs = [(61, 1, "-"), (61, 2, "+")] # [(col, line, "+" ou "-"), ...] + (xBatNeg, yBatNeg) = self.current_dict_circuit['_battery_neg_wire']["end"] + (xBatPos, yBatPos) = self.current_dict_circuit['_battery_pos_wire']["end"] + (_, _),(colBatNeg, lineBatNeg) = self.sketcher.find_nearest_grid_point(xBatNeg, yBatNeg) + (_, _),(colBatPos, lineBatPos) = self.sketcher.find_nearest_grid_point(xBatPos, yBatPos) + #self.pwrs = [(61, 1, "-"), (61, 2, "+")] # [(col, line, "+" ou "-"), ...] + self.pwrs = [(colBatNeg, lineBatNeg, "-"), (colBatPos, lineBatPos, "+")] # [(col, line, "+" ou "-"), ...] self.pwrChip = {"+": [], "-": [], "pwrConnected":[], "pwrNotConnected": [], "pwrMissConnected": []} # , "pwrNOTUSED": [], "pwrCC": [] self.io_in, self.io_out = [], [] - self.chip_in, self.chip_out = [], [] + self.chip_in, self.chip_out = [], [] self.chip_ioCC, self.chip_ioOK = [], [] self.pwrM, self.pwrP, self.wireNotUsed, self.pwrCC = [], [], [], [] self.io_inCC, self.io_outCC = [], [] @@ -788,14 +950,21 @@ def checkCircuit(self): self.in_outOC = [] self.chip_out_checked = [] self.chip_out_script = [] + + chip_select = [] + chip_out_inv = [] + chip_in_enable = [] + chip_in_enable_inv = [] + self.show_correspondence_table(False) for id, component in self.current_dict_circuit.items(): if id[:6] == "_chip_": (x, y) = component["pinUL_XY"] numPinBR = component["pinCount"] // 2 (real_x, real_y), (col, line) = self.sketcher.find_nearest_grid_chip(x, y) - ioIn, ioOut = [], [] + #ioIn, ioOut = [], [] for io in component["io"]: # [([(ce1, le1), ...], "&", [(cs1, ls1), (cs2, ls2), ...]), ...] + #io = component["io"] # ioIN, ioOut = [], [] ioIn = [ # (col + (numPin % numPinBR) - 1 + (numPin // numPinBR), line + 1 - (numPin // numPinBR)) @@ -809,12 +978,14 @@ def checkCircuit(self): for numPin in io[1] ] self.func += [(id, ioIn, component["symbScript"], ioOut)] - self.chip_in += [(id, *ioIn)] - self.chip_out += [(id, *ioOut)] - # print(f"ioIN = {ioIn}") - # print(f"ioOUT = {ioOut}") - # print(f"self.func= {self.func}") - # print(f"ce1-ce2, self.func, cs1:({io[0][0]}-{io[0][1]} , {chip["symbScript"]} , {io[1][0]})") + if ioIn: + self.chip_in += [(id, *ioIn)] + if ioOut: + self.chip_out += [(id, *ioOut)] + # print(f"ioIN = {ioIn}") + # print(f"ioOUT = {ioOut}") + # print(f"self.func= {self.func}") + # print(f"ce1-ce2, self.func, cs1:({io[0][0]}-{io[0][1]} , {chip["symbScript"]} , {io[1][0]})") for pwr in component["pwr"]: numPin, polarity = pwr[0], pwr[1] col_pin = col + numPin - 1 if numPin <= numPinBR else col + (component["pinCount"] - numPin) @@ -823,6 +994,51 @@ def checkCircuit(self): (id, col_pin, line_pin) ] # print(f"pwrChip= {self.pwrChip}") + ############### gestion des MUX DEMUX ################# + #### les sélecteurs ### + ioSel = component.get("io_select", []) + if ioSel: + ioS = [ + (col + numPin - 1 if numPin <= numPinBR else col + (numPinBR - (numPin % numPinBR) ), line + 1 - (numPin // numPinBR)) + for numPin in ioSel[0] + ] + if ioS: + chip_select += [(id, *ioS)] + self.chip_in += [(id, *ioS)] + + #### les sorties inversées ### + ioOutInv = component.get("io_out_inv", []) + if ioOutInv: + ioOI = [ + (col + numPin - 1 if numPin <= numPinBR else col + (numPinBR - (numPin % numPinBR) ), line + 1 - (numPin // numPinBR)) + for numPin in ioOutInv[0] + ] + if ioOI: + chip_out_inv += [(id, *ioOI)] + self.chip_out += [(id, *ioOI)] + + #### les entrées enable ### + ioInEnable = component.get("io_enable", []) + if ioInEnable: + ioIEn = [ + (col + numPin - 1 if numPin <= numPinBR else col + (numPinBR - (numPin % numPinBR) ), line + 1 - (numPin // numPinBR)) + for numPin in ioInEnable[0] + ] + if ioIEn: + chip_in_enable += [(id, *ioIEn)] + self.chip_in += [(id, *ioIEn)] + + #### les entrées enable inverse ### + ioInEnableInv = component.get("io_enable_inv", []) + if ioInEnableInv: + ioIEnInv = [ + (col + numPin - 1 if numPin <= numPinBR else col + (numPinBR - (numPin % numPinBR) ), line + 1 - (numPin // numPinBR)) + for numPin in ioInEnableInv[0] + ] + if ioIEnInv: + chip_in_enable_inv += [(id, *ioIEnInv)] + self.chip_in += [(id, *ioIEnInv)] + elif id[:6] == "_wire_": # [(col1, line1,col2,line2), ...] self.wire += [(id, *component["coord"][0])] elif id[:4] == "_io_": # [(col1, line1,col2,line2), ...] @@ -988,9 +1204,11 @@ def checkCircuit(self): and not self.io_outCC and not self.chip_outCC and not self.in_outOC: print("vérification du circuit fermé") self.script = "" + params ={"chip_select":chip_select, "chip_out_inv":chip_out_inv, + "chip_in_enable":chip_in_enable, "chip_in_enable_inv": chip_in_enable_inv} for ioOut in self.io_out: - self.script += f"O{ioOut[0][4:]} = " - circuitClose, script = self.checkCloseCircuit(ioOut) + self.script += self.mcu_pin[f"O{ioOut[0][4:]}"] + " = " + circuitClose, script = self.checkCloseCircuit(ioOut,params) if circuitClose : print(f"le circuit est fermée sur la sortie {ioOut}") self.script += f"{script}; " @@ -1008,4 +1226,9 @@ def checkCircuit(self): print(f"in_outOC : {self.in_outOC}") print(f"chip_out_wire : {self.chip_out_wire}") print(f"chip_in_wire : {self.chip_in_wire}") + print(f"chip_select : {chip_select}") + print(f"chip_out_inv : {chip_out_inv}") + print(f"chip_in_enable : {chip_in_enable}") + print(f"chip_in_enable_inv : {chip_in_enable_inv}") + print(f"map pin mcu : {self.mcu_pin}") print(f"script : {self.script}") diff --git a/object_model/circuit_object_model.py b/object_model/circuit_object_model.py index 29a099e..6e6101d 100644 --- a/object_model/circuit_object_model.py +++ b/object_model/circuit_object_model.py @@ -272,7 +272,32 @@ def to_generic_dict(self) -> dict[str, Any]: attr_dict["io"] = [ ([pin.pin_num for pin in func.input_pins], [pin.pin_num for pin in func.output_pins]) for func in self.functions - if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) + #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) + if isinstance(func, LogicalFunction) or isinstance(func, Mux) or isinstance(func, Demux) + ] + attr_dict["io_select"] = [ + [pin.pin_num for pin in func.select_pins] + for func in self.functions + #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) + if isinstance(func, Mux) or isinstance(func, Demux) + ] + attr_dict["io_out_inv"] = [ + [pin.pin_num for pin in func.inv_output_pins] + for func in self.functions + #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) + if isinstance(func, Mux) or isinstance(func, Demux) + ] + attr_dict["io_enable"] = [ + [pin.pin_num for pin in func.enable_pins] + for func in self.functions + #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) + if isinstance(func, Mux) or isinstance(func, Demux) + ] + attr_dict["io_enable_inv"] = [ + [pin.pin_num for pin in func.inv_enable_pins] + for func in self.functions + #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) + if isinstance(func, Mux) or isinstance(func, Demux) ] return attr_dict From 4070719765a083e5eec85fc15d515d22d6aa02f1 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Sun, 1 Dec 2024 03:46:09 -0500 Subject: [PATCH 22/44] =?UTF-8?q?DMUX=20ok=20d=C3=A9but=20bascule=20D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Chips/Logical/74HC238_DEMUX_3_8.json | 2 +- New_Circuit_DMUX_Cascade.json | 882 ++++++++++++++++++ New_Circuit_DMUX_Ouvert_Simple.json | 464 +++++++++ New_Circuit_Ferme_AND_Simple.json | 392 ++++++++ New_Circuit_INV_AND_Cascade.json | 588 ++++++++++++ TestDemux.json | 482 ++++++++++ component_sketch.py | 2 + menus.py | 138 ++- object_model/chip_functions.py | 20 +- object_model/circuit_object_model.py | 8 +- 10 files changed, 2920 insertions(+), 58 deletions(-) create mode 100644 New_Circuit_DMUX_Cascade.json create mode 100644 New_Circuit_DMUX_Ouvert_Simple.json create mode 100644 New_Circuit_Ferme_AND_Simple.json create mode 100644 New_Circuit_INV_AND_Cascade.json create mode 100644 TestDemux.json diff --git a/Components/Chips/Logical/74HC238_DEMUX_3_8.json b/Components/Chips/Logical/74HC238_DEMUX_3_8.json index 03f45e5..9aa9b7f 100644 --- a/Components/Chips/Logical/74HC238_DEMUX_3_8.json +++ b/Components/Chips/Logical/74HC238_DEMUX_3_8.json @@ -7,7 +7,7 @@ "functions": [ { "func_type": "DEMUX", - "address_pins": [1, 2, 3], + "input_pins": [1, 2, 3], "output_pins": [15, 14, 13, 12, 11, 10, 9, 7], "enable_pins": [6], "inv_enable_pins": [4, 5] diff --git a/New_Circuit_DMUX_Cascade.json b/New_Circuit_DMUX_Cascade.json new file mode 100644 index 0000000..9f6a0c7 --- /dev/null +++ b/New_Circuit_DMUX_Cascade.json @@ -0,0 +1,882 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 975.5, + 35.5 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 975.5, + 320.5 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 115.5, + 161.5 + ], + "pinUL_XY": [ + 117.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 16, + "label": "74HC238", + "type": "74HC238", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "Demux", + "io": [ + [ + [ + 1, + 2, + 3 + ], + [ + 15, + 14, + 13, + 12, + 11, + 10, + 9, + 7 + ] + ] + ], + "pwr": [ + [ + 16, + "+" + ], + [ + 8, + "-" + ] + ], + "logicFunctionName": "Demux", + "io_select": [], + "io_out_inv": [], + "io_enable": [ + [ + 6 + ] + ], + "io_enable_inv": [ + [ + 4, + 5 + ] + ], + "occupied_holes": [ + "4,7", + "4,8", + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 4, + 3, + 4, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 117.5, + 92.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 117.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 11, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 222.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 5, + 5 + ] + ], + "XY": [ + 82.5, + 112.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#929000", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 60, + 1, + 60, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 957.5, + 32.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 957.5, + 302.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 59, + 2, + 59, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 47.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 942.5, + 317.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 10, + 14, + 9, + 12 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 207.5, + 317.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 8, + 12, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 192.5, + 302.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 7, + 12, + 7, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 162.5, + 302.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 4, + 10 + ] + ], + "XY": [ + 67.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_io_2": { + "coord": [ + [ + 5, + 11 + ] + ], + "XY": [ + 82.5, + 232.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_io_3": { + "coord": [ + [ + 6, + 12 + ] + ], + "XY": [ + 97.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_chip_1": { + "XY": [ + 310.5, + 161.5 + ], + "pinUL_XY": [ + 312.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 16, + "label": "74HC238", + "type": "74HC238", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "Demux", + "io": [ + [ + [ + 1, + 2, + 3 + ], + [ + 15, + 14, + 13, + 12, + 11, + 10, + 9, + 7 + ] + ] + ], + "pwr": [ + [ + 16, + "+" + ], + [ + 8, + "-" + ] + ], + "logicFunctionName": "Demux", + "io_select": [], + "io_out_inv": [], + "io_enable": [ + [ + 6 + ] + ], + "io_enable_inv": [ + [ + 4, + 5 + ] + ], + "occupied_holes": [ + "17,7", + "17,8", + "18,7", + "18,8", + "19,7", + "19,8", + "20,7", + "20,8", + "21,7", + "21,8", + "22,7", + "22,8", + "23,7", + "23,8", + "24,7", + "24,8" + ] + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 11, + 6, + 17, + 9 + ] + ], + "multipoints": [ + 247, + 128, + 245, + 201 + ], + "color": [ + 0, + 249, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 297.5, + 302.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 312.5, + 212.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 17, + 2, + 17, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 125, + 120 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 312.5, + 47.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 312.5, + 92.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 24, + 12, + 24, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 417.5, + 257.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 417.5, + 302.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 18, + 12, + 18, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 327.5, + 257.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 327.5, + 302.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_wire_11": { + "mode": 0, + "coord": [ + [ + 19, + 12, + 19, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_11_body", + "endpoints": { + "start": { + "position": [ + 342.5, + 257.5 + ], + "tag": "_wire_11_start" + }, + "end": { + "position": [ + 342.5, + 302.5 + ], + "tag": "_wire_11_end" + } + } + }, + "_wire_12": { + "mode": 0, + "coord": [ + [ + 20, + 12, + 21, + 13 + ] + ], + "multipoints": [ + 322, + 286 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_12_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 257.5 + ], + "tag": "_wire_12_start" + }, + "end": { + "position": [ + 372.5, + 302.5 + ], + "tag": "_wire_12_end" + } + } + }, + "_wire_13": { + "mode": 0, + "coord": [ + [ + 22, + 12, + 22, + 13 + ] + ], + "multipoints": [ + 339, + 289 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_13_body", + "endpoints": { + "start": { + "position": [ + 387.5, + 257.5 + ], + "tag": "_wire_13_start" + }, + "end": { + "position": [ + 387.5, + 302.5 + ], + "tag": "_wire_13_end" + } + } + }, + "_wire_14": { + "mode": 0, + "coord": [ + [ + 20, + 11, + 21, + 11 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_14_body", + "endpoints": { + "start": { + "position": [ + 357.5, + 242.5 + ], + "tag": "_wire_14_start" + }, + "end": { + "position": [ + 372.5, + 242.5 + ], + "tag": "_wire_14_end" + } + } + }, + "_io_4": { + "coord": [ + [ + 18, + 5 + ] + ], + "XY": [ + 277.5, + 112.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff84ff", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_io_5": { + "coord": [ + [ + 21, + 3 + ] + ], + "XY": [ + 322.5, + 82.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff84ff", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" + }, + "_io_6": { + "coord": [ + [ + 23, + 3 + ] + ], + "XY": [ + 352.5, + 82.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff84ff", + "outline_tag": "pin_io_outline__io_6", + "tag": "pin_io__io_6", + "label_tag": "_io_6_label" + }, + "_io_7": { + "coord": [ + [ + 24, + 6 + ] + ], + "XY": [ + 367.5, + 127.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff84ff", + "outline_tag": "pin_io_outline__io_7", + "tag": "pin_io__io_7", + "label_tag": "_io_7_label" + }, + "_io_8": { + "coord": [ + [ + 23, + 12 + ] + ], + "XY": [ + 352.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff84ff", + "outline_tag": "pin_io_outline__io_8", + "tag": "pin_io__io_8", + "label_tag": "_io_8_label" + } +} \ No newline at end of file diff --git a/New_Circuit_DMUX_Ouvert_Simple.json b/New_Circuit_DMUX_Ouvert_Simple.json new file mode 100644 index 0000000..e97b8e4 --- /dev/null +++ b/New_Circuit_DMUX_Ouvert_Simple.json @@ -0,0 +1,464 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 978.5, + 38.5 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 978.5, + 323.5 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 115.5, + 161.5 + ], + "pinUL_XY": [ + 117.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 16, + "label": "74HC238", + "type": "74HC238", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "Demux", + "io": [ + [ + [ + 1, + 2, + 3 + ], + [ + 15, + 14, + 13, + 12, + 11, + 10, + 9, + 7 + ] + ] + ], + "pwr": [ + [ + 16, + "+" + ], + [ + 8, + "-" + ] + ], + "logicFunctionName": "Demux", + "io_select": [], + "io_out_inv": [], + "io_enable": [ + [ + 6 + ] + ], + "io_enable_inv": [ + [ + 4, + 5 + ] + ], + "occupied_holes": [ + "4,7", + "4,8", + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 4, + 3, + 4, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 117.5, + 92.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 117.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 11, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 222.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 5, + 5 + ] + ], + "XY": [ + 82.5, + 112.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#929000", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 60, + 1, + 60, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 957.5, + 32.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 957.5, + 302.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 59, + 2, + 59, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 47.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 942.5, + 317.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 10, + 14, + 9, + 12 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 207.5, + 317.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 8, + 12, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 192.5, + 302.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 7, + 12, + 7, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 257.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 162.5, + 302.5 + ], + "tag": "_wire_9_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 7, + 5 + ] + ], + "XY": [ + 112.5, + 112.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_io_2": { + "coord": [ + [ + 4, + 10 + ] + ], + "XY": [ + 67.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_io_3": { + "coord": [ + [ + 5, + 11 + ] + ], + "XY": [ + 82.5, + 232.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_io_4": { + "coord": [ + [ + 6, + 12 + ] + ], + "XY": [ + 97.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ffd478", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_io_5": { + "coord": [ + [ + 10, + 11 + ] + ], + "XY": [ + 157.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#00f900", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" + } +} \ No newline at end of file diff --git a/New_Circuit_Ferme_AND_Simple.json b/New_Circuit_Ferme_AND_Simple.json new file mode 100644 index 0000000..29edf1e --- /dev/null +++ b/New_Circuit_Ferme_AND_Simple.json @@ -0,0 +1,392 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 972.5, + 32.5 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 972.5, + 317.5 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "io_select": null, + "io_out_inv": null, + "io_enable": null, + "io_enable_inv": null, + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 2, + 5, + 3 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 11, + 9, + 12, + 1 + ] + ], + "multipoints": [ + 186, + 203 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 212.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 237.5, + 32.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 8, + 3 + ] + ], + "XY": [ + 127.5, + 82.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 11, + 12, + 8, + 12 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 222.5, + 257.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 177.5, + 257.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_io_1": { + "coord": [ + [ + 9, + 10 + ] + ], + "XY": [ + 142.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#0096ff", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_io_2": { + "coord": [ + [ + 6, + 3 + ] + ], + "XY": [ + 97.5, + 82.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#479dff", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 7, + 5, + 10, + 11 + ] + ], + "multipoints": [ + 263, + 114, + 263, + 232 + ], + "color": [ + 254, + 252, + 120 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 122.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 207.5, + 242.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 60, + 1, + 60, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 972.5, + 32.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 972.5, + 302.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 58, + 2, + 58, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 927.5, + 47.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 927.5, + 47.5 + ], + "tag": "_wire_5_end" + } + } + } +} \ No newline at end of file diff --git a/New_Circuit_INV_AND_Cascade.json b/New_Circuit_INV_AND_Cascade.json new file mode 100644 index 0000000..5044b54 --- /dev/null +++ b/New_Circuit_INV_AND_Cascade.json @@ -0,0 +1,588 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 972.5, + 32.5 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 972.5, + 317.5 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 100.5, + 161.5 + ], + "pinUL_XY": [ + 102.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC04", + "type": "74HC04", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NotGate", + "io": [ + [ + [ + 1 + ], + [ + 2 + ] + ], + [ + [ + 3 + ], + [ + 4 + ] + ], + [ + [ + 5 + ], + [ + 6 + ] + ], + [ + [ + 9 + ], + [ + 8 + ] + ], + [ + [ + 11 + ], + [ + 10 + ] + ], + [ + [ + 13 + ], + [ + 12 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NotGate", + "io_select": [], + "io_out_inv": [], + "io_enable": [], + "io_enable_inv": [], + "occupied_holes": [ + "3,7", + "3,8", + "4,7", + "4,8", + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 3, + 3, + 3, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 102.5, + 92.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 102.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 3, + 14, + 3, + 12 + ] + ], + "multipoints": [ + 58, + 258 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 102.5, + 317.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 102.5, + 317.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_chip_1": { + "XY": [ + 280.5, + 161.5 + ], + "pinUL_XY": [ + 282.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC08", + "type": "74HC08", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "AndGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "AndGate", + "io_select": [], + "io_out_inv": [], + "io_enable": [], + "io_enable_inv": [], + "occupied_holes": [ + "15,7", + "15,8", + "16,7", + "16,8", + "17,7", + "17,8", + "18,7", + "18,8", + "19,7", + "19,8", + "20,7", + "20,8", + "21,7", + "21,8" + ] + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 15, + 3, + 15, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 282.5, + 92.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 282.5, + 92.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 21, + 12, + 21, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 372.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 372.5, + 257.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 9, + 12, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 60, + 1, + 60, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 957.5, + 32.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 957.5, + 32.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 4, + 9, + 15, + 9 + ] + ], + "multipoints": [], + "color": [ + 254, + 251, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 117.5, + 212.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 117.5, + 212.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 16, + 12, + 16, + 14 + ] + ], + "multipoints": [], + "color": [ + 254, + 251, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 297.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 297.5, + 257.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 17, + 10, + 29, + 10 + ] + ], + "multipoints": [], + "color": [ + 254, + 251, + 0 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 312.5, + 227.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 312.5, + 227.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 29, + 8 + ] + ], + "XY": [ + 442.5, + 187.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#fefb00", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_9": { + "mode": 0, + "coord": [ + [ + 59, + 2, + 59, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_9_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 47.5 + ], + "tag": "_wire_9_start" + }, + "end": { + "position": [ + 942.5, + 47.5 + ], + "tag": "_wire_9_end" + } + } + } +} \ No newline at end of file diff --git a/TestDemux.json b/TestDemux.json new file mode 100644 index 0000000..71a4641 --- /dev/null +++ b/TestDemux.json @@ -0,0 +1,482 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 972.5, + 32.5 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 972.5, + 317.5 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 130.5, + 161.5 + ], + "pinUL_XY": [ + 132.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 16, + "label": "74HC238", + "type": "74HC238", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "Demux", + "io": [], + "pwr": [ + [ + 16, + "+" + ], + [ + 8, + "-" + ] + ], + "logicFunctionName": "Demux", + "io_select": [ + [ + 1, + 2, + 3 + ] + ], + "io_out_inv": [], + "io_enable": [ + [ + 6 + ] + ], + "io_enable_inv": [ + [ + 4, + 5 + ] + ], + "occupied_holes": [ + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8", + "11,7", + "11,8", + "12,7", + "12,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 5, + 3, + 5, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 12, + 12, + 12, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 237.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 237.5, + 257.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 60, + 1, + 60, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 957.5, + 32.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 957.5, + 32.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 59, + 14, + 59, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 317.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 942.5, + 317.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 5, + 12, + 5, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 6, + 12, + 6, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 147.5, + 257.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 7, + 12, + 7, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 257.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 162.5, + 257.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 9, + 12, + 9, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 192.5, + 257.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_wire_8": { + "mode": 0, + "coord": [ + [ + 10, + 12, + 10, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_8_body", + "endpoints": { + "start": { + "position": [ + 207.5, + 257.5 + ], + "tag": "_wire_8_start" + }, + "end": { + "position": [ + 207.5, + 257.5 + ], + "tag": "_wire_8_end" + } + } + }, + "_wire_10": { + "mode": 0, + "coord": [ + [ + 8, + 11, + 9, + 11 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_10_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 242.5 + ], + "tag": "_wire_10_start" + }, + "end": { + "position": [ + 177.5, + 242.5 + ], + "tag": "_wire_10_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 7, + 6 + ] + ], + "XY": [ + 112.5, + 127.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#00f900", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_io_1": { + "coord": [ + [ + 11, + 11 + ] + ], + "XY": [ + 172.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#00f900", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + } +} \ No newline at end of file diff --git a/component_sketch.py b/component_sketch.py index de13f3a..98a2e4c 100644 --- a/component_sketch.py +++ b/component_sketch.py @@ -2025,6 +2025,8 @@ def draw_chip(self, x_distance, y_distance, scale=1, width=-1, direction=HORIZON dim["label"] = kwargs.get("label", dim["label"]) dim["internalFunc"] = kwargs.get("internalFunc", None) dim["io_select"] = kwargs.get("io_select", None) + # if not dim["io_select"] : + # dim["io_select"] = kwargs.get("address_pins", None) dim["io_out_inv"] = kwargs.get("io_out_inv", None) dim["io_enable"] = kwargs.get("io_enable", None) dim["io_enable_inv"] = kwargs.get("io_enable_inv", None) diff --git a/menus.py b/menus.py index dc4c1f4..da64854 100644 --- a/menus.py +++ b/menus.py @@ -706,17 +706,26 @@ def decodeFunc(self,inVar, funcName): for et in e[1:]: s += "| " + et s += " ) " + elif funcName == "Demux": + s ="(" + out = inVar[0]["numO"] + v2, v1, v0 = (out & 1)^1, ((out & 2) >> 1)^1, ((out & 4) >> 2)^1 + s += v0*" ! " + inVar[0]["val"] + " & " + v1*"! " + inVar[1]["val"] + " & " + v2*"! " + inVar[2]["val"] + \ + " & " + inVar[3]["einv"] + " & " + inVar[4]["einv"] + " & " + inVar[5]["enb"] + s += " ) " return s def checkCloseCircuit(self, ioOut, params={}): - id, (c1,l1,c2,l2) = ioOut - ioZone = [(c1,l1,c2,l2)] + #id, (c1,l1,c2,l2) = ioOut + id, [ioZone] = ioOut + #ioZone = [(c1,l1,c2,l2)] chip_select = params.get("chip_select", []) chip_out_inv = params.get("chip_out_inv", []) chip_in_enable = params.get("chip_in_enable", []) chip_in_enable_inv = params.get("chip_in_enable_inv", []) + #chip_in_address_pins = params.get("chip_in_address_pins", []) findOut = False circuitClose = True @@ -724,19 +733,27 @@ def checkCloseCircuit(self, ioOut, params={}): #chip_out_checked = [] for f in self.func: - idOut, inLst, fName, outLst = f + idOut, inLst, fName, outLst = deepcopy(f) if chip_select: chipSel = chip_select [chipSel] = [list(chipS[1:]) for chipS in chipSel if chipS[0] == idOut] else: chipSel = [] + if chip_in_enable_inv: chipEnInv = chip_in_enable_inv [chipEnInv] = [list(chipEI[1:]) for chipEI in chipEnInv if chipEI[0] == idOut] else: chipEnInv = [] + if chip_in_enable: chipEn = chip_in_enable [chipEn] = [list(chipE[1:]) for chipE in chipEn if chipE[0] == idOut] else: chipEn = [] + + # if chip_in_address_pins: + # chipInAdress = chip_in_address_pins + # [chipInAdress] = [list(chipIAdd[1:]) for chipIAdd in chipInAdress if chipIAdd[0] == idOut] + # else: chipOutInv = [] + if chip_out_inv: chipOutInv = chip_out_inv [chipOutInv] = [list(chipOI[1:]) for chipOI in chipOutInv if chipOI[0] == idOut] @@ -744,7 +761,7 @@ def checkCloseCircuit(self, ioOut, params={}): inLst += chipSel + chipEnInv + chipEn outLst += chipOutInv - for out in outLst: + for no,out in enumerate(outLst): #if out not in chip_out_checked: if self.is_linked_to(ioZone, out): findOut = True @@ -767,14 +784,14 @@ def checkCloseCircuit(self, ioOut, params={}): if c == inFunc: constKey = "enb" if self.is_linked_to(self.pwrP, inFunc): - inFuncConst += [{constKey:pos, "num":n}] - else: inFuncConst += [{constKey:neg, "num":n}] + inFuncConst += [{constKey:pos, "num":n, "numO":no}] + else: inFuncConst += [{constKey:neg, "num":n, "numO":no}] findIn = True print("connecté à pwr") if not findIn: for io_inZone in self.io_in: - id, zone = io_inZone - if self.is_linked_to([zone], inFunc): + id, [zone] = io_inZone + if self.is_linked_to(zone, inFunc): constKey = "val" for c in chipSel: if c == inFunc: @@ -785,7 +802,7 @@ def checkCloseCircuit(self, ioOut, params={}): for c in chipEn: if c == inFunc: constKey = "enb" - inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n + inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n findIn = True print("connecté à une ENTRÉE EXTERNE") break @@ -803,7 +820,7 @@ def checkCloseCircuit(self, ioOut, params={}): for c in chipEn: if c == inFunc: constKey = "enb" - inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n}] + inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] findIn = True print("connecté à une ENTRÉE EXTERNE par cable") # ici ajouter n {"val":self.mcu_pin[f"I{id[4:]}"], "num":n} break @@ -819,15 +836,15 @@ def checkCloseCircuit(self, ioOut, params={}): for cow in self.chip_out: id, pt = cow if self.is_linked_to([next], pt): - outZone =(id,next) + outZone =(id,[[next]]) print("On passe à une autre sortie...") ######## RAPPEL RECURSIF SUR OUTZONE ###################### if outZone not in self.chip_out_checked: self.chip_out_checked += [outZone] isPinOut = False for pinOut in self.io_out: - id, pinZoneOut = pinOut - if self.is_linked_to([pinZoneOut], pt): + id, [pinZoneOut] = pinOut + if self.is_linked_to(pinZoneOut, pt): outPrev = self.mcu_pin[f"O{id[4:]}"] constKey = "val" for c in chipSel: @@ -844,7 +861,7 @@ def checkCloseCircuit(self, ioOut, params={}): if c == pt: outPrev = "! " + outPrev isPinOut = True - inFuncConst += [{constKey:outPrev, "num":n}] # [self.mcu_pin[f"O{id[4:]}"]] + inFuncConst += [{constKey:outPrev, "num":n, "numO":no}] # [self.mcu_pin[f"O{id[4:]}"]] findNext = True if not isPinOut: findNext, s = self.checkCloseCircuit(outZone) @@ -863,14 +880,14 @@ def checkCloseCircuit(self, ioOut, params={}): if c == pt: s = "! " + s - inFuncConst += [{constKey:s, "num":n}] + inFuncConst += [{constKey:s, "num":n, "numO":no}] self.chip_out_script += [(s,outZone)] else: # il faut voir si une sortie io n'existe pas sinon var temp isPinOut = False for pinOut in self.io_out: id, pinZoneOut = pinOut - if self.is_linked_to([pinZoneOut], pt): + if self.is_linked_to(pinZoneOut, pt): isPinOut = True outPrev = self.mcu_pin[f"O{id[4:]}"] constKey = "val" @@ -888,7 +905,7 @@ def checkCloseCircuit(self, ioOut, params={}): if c == pt: outPrev = "! " + outPrev - inFuncConst += [{constKey:outPrev, "num":n}] + inFuncConst += [{constKey:outPrev, "num":n, "numO":no}] if not isPinOut: for coc in self.chip_out_script: if coc[1] == outZone: @@ -908,7 +925,7 @@ def checkCloseCircuit(self, ioOut, params={}): if c == pt: exp = "! " + exp - inFuncConst += [{constKey:exp, "num":n}] + inFuncConst += [{constKey:exp, "num":n, "numO":no}] break findNext = True break @@ -955,6 +972,7 @@ def checkCircuit(self): chip_out_inv = [] chip_in_enable = [] chip_in_enable_inv = [] + #chip_in_address_pins = [] self.show_correspondence_table(False) for id, component in self.current_dict_circuit.items(): @@ -1038,6 +1056,17 @@ def checkCircuit(self): if ioIEnInv: chip_in_enable_inv += [(id, *ioIEnInv)] self.chip_in += [(id, *ioIEnInv)] + + #### les entrées adress ### + # ioInAdressPins = component.get("address_pins", []) + # if ioInAdressPins: + # ioInAdress = [ + # (col + numPin - 1 if numPin <= numPinBR else col + (numPinBR - (numPin % numPinBR) ), line + 1 - (numPin // numPinBR)) + # for numPin in ioInAdressPins[0] + # ] + # if ioInAdress: + # chip_in_address_pins += [(id, *ioInAdress)] + # self.chip_in += [(id, *ioInAdress)] elif id[:6] == "_wire_": # [(col1, line1,col2,line2), ...] self.wire += [(id, *component["coord"][0])] @@ -1045,9 +1074,9 @@ def checkCircuit(self): (col, line) = component["coord"][0][0], component["coord"][0][1] ioZone = deepcopy(self.board.sketcher.matrix[f"{col},{line}"]["link"]) if component["type"] == INPUT: - self.io_in += [(id, *ioZone)] + self.io_in += [(id, [ioZone])] else: - self.io_out += [(id, *ioZone)] + self.io_out += [(id, [ioZone])] print(f"func= {self.func}\n") print(f"pwrChip= {self.pwrChip}\n") print(f"wire = {self.wire}") @@ -1133,22 +1162,27 @@ def checkCircuit(self): elif id not in self.pwrChip["pwrNotConnected"]: self.pwrChip["pwrNotConnected"].append((id,"-")) ############### Verification des chip_out sur pwr ##################### - for chipio in self.chip_out: - id, (c1,l1) = chipio - if self.is_linked_to(self.pwrM, (c1, l1)): - self.chip_ioCC += [chipio] - elif self.is_linked_to(self.pwrP, (c1, l1)): - self.chip_ioCC += [chipio] - else: - self.chip_ioOK += [chipio] - ############### Verification des chip_out sur io_in ##################### - for ioin in self.io_in: - if self.is_linked_to([ioin[1]], (c1, l1)): - self.io_outCC += [ioin[0]] + for chipAllio in self.chip_out: + id = chipAllio[0] + for chipio in chipAllio[1:]: + (c1,l1) = chipio + if self.is_linked_to(self.pwrM, (c1, l1)): + self.chip_ioCC += [(id, chipio)] + elif self.is_linked_to(self.pwrP, (c1, l1)): + self.chip_ioCC += [(id,chipio)] + else: + self.chip_ioOK += [(id,chipio)] + ############### Verification des chip_out sur io_in ##################### + for ioin in self.io_in: + id, [ioInZone] = ioin + if self.is_linked_to(ioInZone, (c1, l1)): + self.io_outCC += [ioin[0]] ############### Verification des io_in sur pwr ##################### for ioin in self.io_in: - c1, l1 = ioin[1][0], ioin[1][1] + #c1, l1 = ioin[1][0], ioin[1][1] + id, ioInZone = ioin + [(c1,l1,c2,l2)] = ioInZone[0] inChipInWire = False if self.is_linked_to(self.pwrM, (c1, l1)): inChipInWire = True @@ -1176,14 +1210,16 @@ def checkCircuit(self): self.chip_in_wire += [(ioin[0], ciw)] ############### Verification des self.chip_out sur chip_out ##################### - for chipio in self.chip_out: - id, (c1,l1) = chipio + for chipAllio in self.chip_out: + id = chipAllio[0] inChipOutWire = False - for cow in self.chip_out_wire: - if self.is_linked_to(cow, (c1, l1)): - inChipOutWire = True - if chipio not in self.chip_outCC: - self.chip_outCC += [(chipio)] + for chipio in chipAllio[1:]: + (c1,l1) = chipio + for cow in self.chip_out_wire: + if self.is_linked_to(cow, (c1, l1)): + inChipOutWire = True + if chipio not in self.chip_outCC: + self.chip_outCC += [(id,chipio)] if not inChipOutWire: cow = deepcopy(self.board.sketcher.matrix[f"{c1},{l1}"]["link"]) again = True @@ -1199,19 +1235,35 @@ def checkCircuit(self): cow += deepcopy(self.board.sketcher.matrix[f"{cu1},{lu1}"]["link"]) self.wireNotUsed.remove(wused) again = True - self.chip_out_wire += [cow] + self.chip_out_wire += [cow] + + ################# Redefinir les zones des io_out avec les cables non utilisés ############## + for n,ioOut in enumerate(self.io_out): + id, [ioOutZone] = ioOut + c1,l1,c2,l2 = ioOutZone[0] + ioOutZoneWire = [] + inIoOutZoneWire = False + for cow in self.chip_out_wire: + if self.is_linked_to(cow, (c1, l1)): + inIoOutZoneWire = True + ioOutZoneWire += [cow] + if inIoOutZoneWire: + self.io_out[n] = (id,ioOutZoneWire) + if not self.pwrCC and not self.pwrChip["pwrMissConnected"] and not self.chip_ioCC \ and not self.io_outCC and not self.chip_outCC and not self.in_outOC: print("vérification du circuit fermé") self.script = "" params ={"chip_select":chip_select, "chip_out_inv":chip_out_inv, - "chip_in_enable":chip_in_enable, "chip_in_enable_inv": chip_in_enable_inv} + "chip_in_enable":chip_in_enable, "chip_in_enable_inv": chip_in_enable_inv, } + # "chip_in_address_pins":chip_in_address_pins} for ioOut in self.io_out: self.script += self.mcu_pin[f"O{ioOut[0][4:]}"] + " = " circuitClose, script = self.checkCloseCircuit(ioOut,params) if circuitClose : print(f"le circuit est fermée sur la sortie {ioOut}") self.script += f"{script}; " + print(f"script temp : {self.script}") else: print(f"le circuit est ouvert sur la sortie {ioOut}") print(f"pwrChipConnected : {self.pwrChip['pwrConnected']}") @@ -1231,4 +1283,4 @@ def checkCircuit(self): print(f"chip_in_enable : {chip_in_enable}") print(f"chip_in_enable_inv : {chip_in_enable_inv}") print(f"map pin mcu : {self.mcu_pin}") - print(f"script : {self.script}") + print(f"script final : {self.script}") diff --git a/object_model/chip_functions.py b/object_model/chip_functions.py index 0a97603..f73ce95 100644 --- a/object_model/chip_functions.py +++ b/object_model/chip_functions.py @@ -472,7 +472,7 @@ class Demux(ChipFunction): """ Represents an demultiplexer in a digital circuit. Attributes: - address_pins (list[int]): A tuple containing the address pins. + input_pins (list[int]): A tuple containing the address pins. output_pins (list[int]): A tuple containing the output pins. enable_pins (list[int]): A tuple containing the active HIGH enable pins. inv_enable_pins (list[int]): A tuple containing the active LOW enable pins. @@ -480,7 +480,7 @@ class Demux(ChipFunction): def __init__( self, - address_pins: list[int], + input_pins: list[int], output_pins: list[int], enable_pins: list[int], inv_enable_pins: list[int], @@ -488,7 +488,7 @@ def __init__( """ Initializes a DEMUX with the specified input and output pins. Args: - address_pins (list[int]): A tuple containing the address pins. + input_pins (list[int]): A tuple containing the address pins. output_pins (list[int]): A tuple containing the output pins. enable_pins (list[int]): A tuple containing the active HIGH enable pins. inv_enable_pins (list[int]): A tuple containing the active LOW enable pins. @@ -498,25 +498,25 @@ def __init__( ValueError: If the number of address pins is not equal to log2(num output pins). """ super().__init__() - self.address_pins: list[Pin] = [Pin(pin_num, None) for pin_num in address_pins] + self.input_pins: list[Pin] = [Pin(pin_num, None) for pin_num in input_pins] self.output_pins: list[Pin] = [Pin(pin_num, None) for pin_num in output_pins] self.enable_pins: list[Pin] = [Pin(pin_num, None) for pin_num in enable_pins] self.inv_enable_pins: list[Pin] = [Pin(pin_num, None) for pin_num in inv_enable_pins] - self.all_pins = self.address_pins + self.output_pins + self.enable_pins + self.inv_enable_pins + self.all_pins = self.input_pins + self.output_pins + self.enable_pins + self.inv_enable_pins if len(self.output_pins) < 2: raise ValueError("DEMUX must have at least two input pins.") - if len(self.address_pins) < 1: + if len(self.input_pins) < 1: raise ValueError("DEMUX must have at least one address pin.") - if len(self.address_pins) != log2(len(self.output_pins)): + if len(self.input_pins) != log2(len(self.output_pins)): raise ValueError("DEMUX must have log2(num output_pins) address pins.") if ( len(self.enable_pins) != 1 or len(self.inv_enable_pins) != 2 or len(self.output_pins) != 8 - or len(self.address_pins) != 3 + or len(self.input_pins) != 3 ): raise ValueError("Arbitrary DEMUX size not supported yet") @@ -527,7 +527,7 @@ def __str__(self): str: A string describing the DEMUX with its input and output pins. """ return ( - f"DEMUX:\n\t\tAddress Pins: {self.address_pins}," + f"DEMUX:\n\t\tAddress Pins: {self.input_pins}," f"\n\t\tOutput Pins: {self.output_pins}," f"\n\t\tEnable Pins: {self.enable_pins}," f"\n\t\tInverted Enable Pins: {self.inv_enable_pins}" @@ -540,7 +540,7 @@ def chip_internal_function(self): """ input_pin_pos = [ pin.connection_point - for pin in self.inv_enable_pins + self.enable_pins + self.address_pins + for pin in self.inv_enable_pins + self.enable_pins + self.input_pins if pin is not None and pin.connection_point is not None ] output_pin_pos = [pin.connection_point for pin in self.output_pins if pin.connection_point is not None] diff --git a/object_model/circuit_object_model.py b/object_model/circuit_object_model.py index 6e6101d..4bb848c 100644 --- a/object_model/circuit_object_model.py +++ b/object_model/circuit_object_model.py @@ -184,7 +184,7 @@ def from_json(json_data: dict, package_dict: dict[str, Package] | None = None): data["inv_enable_pins"], ), "DEMUX": lambda data: Demux( - data["address_pins"], + data["input_pins"], data["output_pins"], data["enable_pins"], data["inv_enable_pins"], @@ -273,19 +273,19 @@ def to_generic_dict(self) -> dict[str, Any]: ([pin.pin_num for pin in func.input_pins], [pin.pin_num for pin in func.output_pins]) for func in self.functions #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) - if isinstance(func, LogicalFunction) or isinstance(func, Mux) or isinstance(func, Demux) + if isinstance(func, LogicalFunction) or isinstance(func, Mux) or isinstance(func, Demux) ] attr_dict["io_select"] = [ [pin.pin_num for pin in func.select_pins] for func in self.functions #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) - if isinstance(func, Mux) or isinstance(func, Demux) + if isinstance(func, Mux) ] attr_dict["io_out_inv"] = [ [pin.pin_num for pin in func.inv_output_pins] for func in self.functions #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) - if isinstance(func, Mux) or isinstance(func, Demux) + if isinstance(func, Mux) ] attr_dict["io_enable"] = [ [pin.pin_num for pin in func.enable_pins] From 14a9cf74b006d032394e84fd2001482dafd1ab48 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Mon, 2 Dec 2024 00:19:26 -0500 Subject: [PATCH 23/44] DMUX debug cascade --- New_Circuit_DMUX_Ouvert_Simple.json | 48 +++---- menus.py | 200 +++++++++++++++------------- 2 files changed, 131 insertions(+), 117 deletions(-) diff --git a/New_Circuit_DMUX_Ouvert_Simple.json b/New_Circuit_DMUX_Ouvert_Simple.json index e97b8e4..5a6616f 100644 --- a/New_Circuit_DMUX_Ouvert_Simple.json +++ b/New_Circuit_DMUX_Ouvert_Simple.json @@ -6,8 +6,8 @@ 342.4 ], "end": [ - 978.5, - 38.5 + 972.5, + 32.5 ], "color": [ 0, @@ -23,8 +23,8 @@ 439.6 ], "end": [ - 978.5, - 323.5 + 972.5, + 317.5 ], "color": [ 255, @@ -201,7 +201,7 @@ "tag": "pin_io__io_0", "label_tag": "_io_0_label" }, - "_wire_3": { + "_wire_2": { "mode": 0, "coord": [ [ @@ -217,25 +217,25 @@ 0, 0 ], - "wire_body_tag": "_wire_3_body", + "wire_body_tag": "_wire_2_body", "endpoints": { "start": { "position": [ 957.5, 32.5 ], - "tag": "_wire_3_start" + "tag": "_wire_2_start" }, "end": { "position": [ 957.5, 302.5 ], - "tag": "_wire_3_end" + "tag": "_wire_2_end" } } }, - "_wire_4": { + "_wire_3": { "mode": 0, "coord": [ [ @@ -251,25 +251,25 @@ 38, 0 ], - "wire_body_tag": "_wire_4_body", + "wire_body_tag": "_wire_3_body", "endpoints": { "start": { "position": [ 942.5, 47.5 ], - "tag": "_wire_4_start" + "tag": "_wire_3_start" }, "end": { "position": [ 942.5, 317.5 ], - "tag": "_wire_4_end" + "tag": "_wire_3_end" } } }, - "_wire_6": { + "_wire_4": { "mode": 0, "coord": [ [ @@ -285,25 +285,25 @@ 38, 0 ], - "wire_body_tag": "_wire_6_body", + "wire_body_tag": "_wire_4_body", "endpoints": { "start": { "position": [ 207.5, 317.5 ], - "tag": "_wire_6_start" + "tag": "_wire_4_start" }, "end": { "position": [ 192.5, 257.5 ], - "tag": "_wire_6_end" + "tag": "_wire_4_end" } } }, - "_wire_8": { + "_wire_5": { "mode": 0, "coord": [ [ @@ -319,25 +319,25 @@ 0, 0 ], - "wire_body_tag": "_wire_8_body", + "wire_body_tag": "_wire_5_body", "endpoints": { "start": { "position": [ 177.5, 257.5 ], - "tag": "_wire_8_start" + "tag": "_wire_5_start" }, "end": { "position": [ 192.5, 302.5 ], - "tag": "_wire_8_end" + "tag": "_wire_5_end" } } }, - "_wire_9": { + "_wire_6": { "mode": 0, "coord": [ [ @@ -353,21 +353,21 @@ 0, 0 ], - "wire_body_tag": "_wire_9_body", + "wire_body_tag": "_wire_6_body", "endpoints": { "start": { "position": [ 162.5, 257.5 ], - "tag": "_wire_9_start" + "tag": "_wire_6_start" }, "end": { "position": [ 162.5, 302.5 ], - "tag": "_wire_9_end" + "tag": "_wire_6_end" } } }, diff --git a/menus.py b/menus.py index da64854..77ccde5 100644 --- a/menus.py +++ b/menus.py @@ -665,7 +665,7 @@ def is_linked_to(self, dest, src): def decodeFunc(self,inVar, funcName): if funcName == "NandGate": - s = f"! ( {inVar[0]["val"]} " + s = f"!( {inVar[0]["val"]} " for v in inVar[1:]: s += f"& {v["val"]} " s += ") " @@ -701,7 +701,7 @@ def decodeFunc(self,inVar, funcName): for v in range(8): v2, v1, v0 = (v & 1)^1, ((v & 2) >> 1)^1, ((v & 4) >> 2)^1 e[v] += inVar[v]["val"] + " & " + inVar[11]["einv"] + " & " + \ - v0*" ! " + inVar[8]["sel"] + " & " + v1*" ! " + inVar[9]["sel"] + " & " + v2*" ! " + inVar[10]["sel"] + " ) " + v0*" !" + inVar[8]["sel"] + " & " + v1*" !" + inVar[9]["sel"] + " & " + v2*" !" + inVar[10]["sel"] + " ) " s = " ( " + e[0] for et in e[1:]: s += "| " + et @@ -710,7 +710,7 @@ def decodeFunc(self,inVar, funcName): s ="(" out = inVar[0]["numO"] v2, v1, v0 = (out & 1)^1, ((out & 2) >> 1)^1, ((out & 4) >> 2)^1 - s += v0*" ! " + inVar[0]["val"] + " & " + v1*"! " + inVar[1]["val"] + " & " + v2*"! " + inVar[2]["val"] + \ + s += v0*" !" + inVar[0]["val"] + " & " + v1*"!" + inVar[1]["val"] + " & " + v2*"!" + inVar[2]["val"] + \ " & " + inVar[3]["einv"] + " & " + inVar[4]["einv"] + " & " + inVar[5]["enb"] s += " ) " @@ -802,7 +802,8 @@ def checkCloseCircuit(self, ioOut, params={}): for c in chipEn: if c == inFunc: constKey = "enb" - inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n + #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n + inFuncConst += [{constKey:f"I{n+1}", "num":n, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n findIn = True print("connecté à une ENTRÉE EXTERNE") break @@ -820,7 +821,8 @@ def checkCloseCircuit(self, ioOut, params={}): for c in chipEn: if c == inFunc: constKey = "enb" - inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] + #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] + inFuncConst += [{constKey:f"I{n+1}", "num":n, "numO":no}] findIn = True print("connecté à une ENTRÉE EXTERNE par cable") # ici ajouter n {"val":self.mcu_pin[f"I{id[4:]}"], "num":n} break @@ -832,64 +834,41 @@ def checkCloseCircuit(self, ioOut, params={}): #outZone = deepcopy(self.board.sketcher.matrix[f"{c1},{l1}"]["link"]) if self.is_linked_to(nextOut, inFunc): - for next in nextOut: + #for next in nextOut: for cow in self.chip_out: - id, pt = cow - if self.is_linked_to([next], pt): - outZone =(id,[[next]]) - print("On passe à une autre sortie...") - ######## RAPPEL RECURSIF SUR OUTZONE ###################### - if outZone not in self.chip_out_checked: - self.chip_out_checked += [outZone] - isPinOut = False - for pinOut in self.io_out: - id, [pinZoneOut] = pinOut - if self.is_linked_to(pinZoneOut, pt): - outPrev = self.mcu_pin[f"O{id[4:]}"] - constKey = "val" - for c in chipSel: - if c == inFunc: - constKey = "sel" - for c in chipEnInv: - if c == inFunc: - constKey = "einv" - for c in chipEn: - if c == inFunc: - constKey = "enb" - - for c in chipOutInv: - if c == pt: - outPrev = "! " + outPrev - isPinOut = True - inFuncConst += [{constKey:outPrev, "num":n, "numO":no}] # [self.mcu_pin[f"O{id[4:]}"]] - findNext = True - if not isPinOut: - findNext, s = self.checkCloseCircuit(outZone) - constKey = "val" - for c in chipSel: - if c == inFunc: - constKey = "sel" - for c in chipEnInv: - if c == inFunc: - constKey = "einv" - for c in chipEn: - if c == inFunc: - constKey = "enb" - - for c in chipOutInv: - if c == pt: - s = "! " + s + id, pts = cow[0], cow[1:] + for pt in pts: + if self.is_linked_to(nextOut, pt): + outZone =(id,[nextOut]) + print("On passe à une autre sortie...") + ######## RAPPEL RECURSIF SUR OUTZONE ###################### + if outZone not in self.chip_out_checked: + self.chip_out_checked += [outZone] + isPinOut = False + for pinOut in self.io_out: + id, [pinZoneOut] = pinOut + if self.is_linked_to(pinZoneOut, pt): + #outPrev = self.mcu_pin[f"O{id[4:]}"] + outPrev = f"O{no+1}" + constKey = "val" + for c in chipSel: + if c == inFunc: + constKey = "sel" + for c in chipEnInv: + if c == inFunc: + constKey = "einv" + for c in chipEn: + if c == inFunc: + constKey = "enb" - inFuncConst += [{constKey:s, "num":n, "numO":no}] - self.chip_out_script += [(s,outZone)] - else: - # il faut voir si une sortie io n'existe pas sinon var temp - isPinOut = False - for pinOut in self.io_out: - id, pinZoneOut = pinOut - if self.is_linked_to(pinZoneOut, pt): - isPinOut = True - outPrev = self.mcu_pin[f"O{id[4:]}"] + for c in chipOutInv: + if c == pt: + outPrev = "! " + outPrev + isPinOut = True + inFuncConst += [{constKey:outPrev, "num":n, "numO":no}] # [self.mcu_pin[f"O{id[4:]}"]] + findNext = True + if not isPinOut: + findNext, s = self.checkCloseCircuit(outZone,params) constKey = "val" for c in chipSel: if c == inFunc: @@ -900,16 +879,22 @@ def checkCloseCircuit(self, ioOut, params={}): for c in chipEn: if c == inFunc: constKey = "enb" - + for c in chipOutInv: if c == pt: - outPrev = "! " + outPrev + s = "! " + s - inFuncConst += [{constKey:outPrev, "num":n, "numO":no}] - if not isPinOut: - for coc in self.chip_out_script: - if coc[1] == outZone: - exp = coc[0] + inFuncConst += [{constKey:s, "num":n, "numO":no}] + self.chip_out_script += [(s,outZone)] + else: + # il faut voir si une sortie io n'existe pas sinon var temp + isPinOut = False + for pinOut in self.io_out: + id, [pinZoneOut] = pinOut + if self.is_linked_to(pinZoneOut, pt): + isPinOut = True + #outPrev = self.mcu_pin[f"O{id[4:]}"] + outPrev = f"O{no+1}" constKey = "val" for c in chipSel: if c == inFunc: @@ -923,12 +908,32 @@ def checkCloseCircuit(self, ioOut, params={}): for c in chipOutInv: if c == pt: - exp = "! " + exp + outPrev = "! " + outPrev - inFuncConst += [{constKey:exp, "num":n, "numO":no}] - break - findNext = True - break + inFuncConst += [{constKey:outPrev, "num":n, "numO":no}] + if not isPinOut: + for coc in self.chip_out_script: + if coc[1] == outZone: + exp = coc[0] + constKey = "val" + for c in chipSel: + if c == inFunc: + constKey = "sel" + for c in chipEnInv: + if c == inFunc: + constKey = "einv" + for c in chipEn: + if c == inFunc: + constKey = "enb" + + for c in chipOutInv: + if c == pt: + exp = "! " + exp + + inFuncConst += [{constKey:exp, "num":n, "numO":no}] + break + findNext = True + break if not findIn and not findNext: self.in_outOC += [(id,inFunc)] circuitClose = False @@ -1207,7 +1212,7 @@ def checkCircuit(self): ciw += deepcopy(self.board.sketcher.matrix[f"{cu1},{lu1}"]["link"]) self.wireNotUsed.remove(wused) again = True - self.chip_in_wire += [(ioin[0], ciw)] + self.chip_in_wire += [(ioin[0], ciw)] ############### Verification des self.chip_out sur chip_out ##################### for chipAllio in self.chip_out: @@ -1220,22 +1225,22 @@ def checkCircuit(self): inChipOutWire = True if chipio not in self.chip_outCC: self.chip_outCC += [(id,chipio)] - if not inChipOutWire: - cow = deepcopy(self.board.sketcher.matrix[f"{c1},{l1}"]["link"]) - again = True - while again and len(self.wireNotUsed)>0: - again = False - for wused in self.wireNotUsed[:]: - id,cu1,lu1,cu2,lu2 = wused - if self.is_linked_to(cow, (cu1, lu1)): - cow += deepcopy(self.board.sketcher.matrix[f"{cu2},{lu2}"]["link"]) - self.wireNotUsed.remove(wused) - again = True - elif self.is_linked_to(cow, (cu2, lu2)): - cow += deepcopy(self.board.sketcher.matrix[f"{cu1},{lu1}"]["link"]) - self.wireNotUsed.remove(wused) - again = True - self.chip_out_wire += [cow] + if not inChipOutWire: + cow = deepcopy(self.board.sketcher.matrix[f"{c1},{l1}"]["link"]) + again = True + while again and len(self.wireNotUsed)>0: + again = False + for wused in self.wireNotUsed[:]: + id,cu1,lu1,cu2,lu2 = wused + if self.is_linked_to(cow, (cu1, lu1)): + cow += deepcopy(self.board.sketcher.matrix[f"{cu2},{lu2}"]["link"]) + self.wireNotUsed.remove(wused) + again = True + elif self.is_linked_to(cow, (cu2, lu2)): + cow += deepcopy(self.board.sketcher.matrix[f"{cu1},{lu1}"]["link"]) + self.wireNotUsed.remove(wused) + again = True + self.chip_out_wire += [cow] ################# Redefinir les zones des io_out avec les cables non utilisés ############## for n,ioOut in enumerate(self.io_out): @@ -1243,13 +1248,20 @@ def checkCircuit(self): c1,l1,c2,l2 = ioOutZone[0] ioOutZoneWire = [] inIoOutZoneWire = False - for cow in self.chip_out_wire: + for cow in self.wireNotUsed: # self.chip_out_wire + cow = [(cow[1:])] if self.is_linked_to(cow, (c1, l1)): inIoOutZoneWire = True ioOutZoneWire += [cow] if inIoOutZoneWire: self.io_out[n] = (id,ioOutZoneWire) + # ################ Redefinir les zones des chip_out avec les cables non utilisés ############## + # for chipO in self.chip_out: + # id = chipO[0] + # for co in chipO[1:]: + # for + if not self.pwrCC and not self.pwrChip["pwrMissConnected"] and not self.chip_ioCC \ and not self.io_outCC and not self.chip_outCC and not self.in_outOC: print("vérification du circuit fermé") @@ -1257,14 +1269,16 @@ def checkCircuit(self): params ={"chip_select":chip_select, "chip_out_inv":chip_out_inv, "chip_in_enable":chip_in_enable, "chip_in_enable_inv": chip_in_enable_inv, } # "chip_in_address_pins":chip_in_address_pins} - for ioOut in self.io_out: - self.script += self.mcu_pin[f"O{ioOut[0][4:]}"] + " = " + for no,ioOut in enumerate(self.io_out): + #self.script += self.mcu_pin[f"O{ioOut[0][4:]}"] + " = " # f"O{no+1}" + self.script += f"O{no+1}" + " = " circuitClose, script = self.checkCloseCircuit(ioOut,params) if circuitClose : print(f"le circuit est fermée sur la sortie {ioOut}") self.script += f"{script}; " print(f"script temp : {self.script}") else: print(f"le circuit est ouvert sur la sortie {ioOut}") + print(f"pwrChipConnected : {self.pwrChip['pwrConnected']}") print(f"pwrChipNotConnected : {self.pwrChip['pwrNotConnected']}") From 29277686cd3aeacfef67d78bfe396b0cc2fa20a7 Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Tue, 3 Dec 2024 09:01:13 -0500 Subject: [PATCH 24/44] made lists --- object_model/chip_functions.py | 56 ++++++++++++++++------------------ 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/object_model/chip_functions.py b/object_model/chip_functions.py index f73ce95..ea954a5 100644 --- a/object_model/chip_functions.py +++ b/object_model/chip_functions.py @@ -751,39 +751,37 @@ def __init__( ValueError: If the JK Flip Flop has both reset and inverted reset pins. """ super().__init__() - self.clock_pin: Pin = Pin(clock_pin, None) + self.clock_pin: list[Pin] = [Pin(clock_pin, None)] self.clock_type: str = clock_type - self.reset_pin: Pin = Pin(reset_pin, None) if reset_pin is not None else None - self.inv_reset_pin: Pin = Pin(inv_reset_pin, None) if inv_reset_pin is not None else None - self.set_pin: Pin = Pin(set_pin, None) if set_pin is not None else None - self.inv_set_pin: Pin = Pin(inv_set_pin, None) if inv_set_pin is not None else None - self.j_input_pin: Pin = Pin(j_input_pin, None) if j_input_pin is not None else None - self.inv_j_input_pin: Pin = Pin(inv_j_input_pin, None) if inv_j_input_pin is not None else None - self.k_input_pin: Pin = Pin(k_input_pin, None) if k_input_pin is not None else None - self.inv_k_input_pin: Pin = Pin(inv_k_input_pin, None) if inv_k_input_pin is not None else None - self.output_pin: Pin = Pin(output_pin, None) - self.inv_output_pin: Pin = Pin(inv_output_pin, None) - - self.all_pins = [ - self.clock_pin, - self.reset_pin, - self.inv_reset_pin, - self.set_pin, - self.inv_set_pin, - self.j_input_pin, - self.inv_j_input_pin, - self.k_input_pin, - self.inv_k_input_pin, - self.output_pin, - self.inv_output_pin, - ] + self.reset_pin: list[Pin] = [Pin(reset_pin, None) if reset_pin is not None else None] + self.inv_reset_pin: list[Pin] = [Pin(inv_reset_pin, None) if inv_reset_pin is not None else None] + self.set_pin: list[Pin] = [Pin(set_pin, None) if set_pin is not None else None] + self.inv_set_pin: list[Pin] = [Pin(inv_set_pin, None) if inv_set_pin is not None else None] + # self.j_input_pin: list[Pin] = [Pin(j_input_pin, None) if j_input_pin is not None else None] + # self.inv_j_input_pin: list[Pin] = [Pin(inv_j_input_pin, None) if inv_j_input_pin is not None else None] + self.input_pins: list[Pin] = [Pin(k_input_pin, None) if j_input_pin is not None else None] # input pins = j_input_pin + self.k_input_pin: list[Pin] = [Pin(k_input_pin, None) if k_input_pin is not None else None] + self.inv_k_input_pin: list[Pin] = [Pin(inv_k_input_pin, None) if inv_k_input_pin is not None else None] + self.output_pin: list[Pin] = [Pin(output_pin, None)] + self.inv_output_pin: list[Pin] = [Pin(inv_output_pin, None)] + + self.all_pins = self.clock_pin + \ + self.reset_pin +\ + self.inv_reset_pin +\ + self.set_pin +\ + self.inv_set_pin +\ + self.input_pins +\ + self.k_input_pin +\ + self.inv_k_input_pin +\ + self.output_pin +\ + self.inv_output_pin if self.clock_type not in ["RISING_EDGE", "FALLING_EDGE"]: raise ValueError("Clock type must be either RISING_EDGE or FALLING_EDGE.") - if self.j_input_pin is None and self.inv_j_input_pin is None: - raise ValueError("JK Flip Flop must have either J or inverted J input pin.") - if self.j_input_pin is not None and self.inv_j_input_pin is not None: - raise ValueError("JK Flip Flop cannot have both J and inverted J input pins.") + # if self.j_input_pin is None and self.inv_j_input_pin is None: + # raise ValueError("JK Flip Flop must have either J or inverted J input pin.") + # if self.j_input_pin is not None and self.inv_j_input_pin is not None: + # raise ValueError("JK Flip Flop cannot have both J and inverted J input pins.") if self.k_input_pin is None and self.inv_k_input_pin is None: raise ValueError("JK Flip Flop must have either K or inverted K input pin.") if self.k_input_pin is not None and self.inv_k_input_pin is not None: From 9b06bd8a0052f848ba7fa84577b91a683f34c5a8 Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Tue, 3 Dec 2024 09:02:26 -0500 Subject: [PATCH 25/44] made lists --- object_model/chip_functions.py | 91 +++++++++++++++++----------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/object_model/chip_functions.py b/object_model/chip_functions.py index ea954a5..ae8417f 100644 --- a/object_model/chip_functions.py +++ b/object_model/chip_functions.py @@ -808,8 +808,8 @@ def __str__(self): f"\n\t\tInverted Reset Pin: {self.inv_reset_pin}," f"\n\t\tSet Pin: {self.set_pin}," f"\n\t\tInverted Set Pin: {self.inv_set_pin}," - f"\n\t\tJ Input Pin: {self.j_input_pin}," - f"\n\t\tInverted J Input Pin: {self.inv_j_input_pin}," + f"\n\t\tJ Input Pin: {self.input_pins}," + # f"\n\t\tInverted J Input Pin: {self.inv_j_input_pin}," f"\n\t\tK Input Pin: {self.k_input_pin}," f"\n\t\tInverted K Input Pin: {self.inv_k_input_pin}," f"\n\t\tOutput Pin: {self.output_pin}," @@ -820,49 +820,50 @@ def chip_internal_function(self) -> FunctionRepresentation: """ Returns a FunctionRepresentation object representing the internal function of the JK Flip Flop """ - input_pin_pos = [ - pin.connection_point - for pin in [ - self.inv_set_pin, - self.set_pin, - self.inv_reset_pin, - self.reset_pin, - self.clock_pin, - self.inv_j_input_pin, - self.j_input_pin, - self.inv_k_input_pin, - self.k_input_pin, - ] - if pin is not None and pin.connection_point is not None - ] - output_pin_pos = [ - pin.connection_point for pin in [self.output_pin, self.inv_output_pin] if pin.connection_point is not None - ] - - # Handle inverted inputs - hi_set = "H" if self.set_pin is not None else "L" - lo_set = "L" if self.set_pin is not None else "H" - hi_reset = "H" if self.reset_pin is not None else "L" - lo_reset = "L" if self.reset_pin is not None else "H" - clock_symb = "R" if self.clock_type == "RISING_EDGE" else "F" - hi_j = "H" if self.j_input_pin is not None else "L" - lo_j = "L" if self.j_input_pin is not None else "H" - hi_k = "H" if self.k_input_pin is not None else "L" - lo_k = "L" if self.k_input_pin is not None else "H" - - truth_table = TruthTable( - [ - TruthTableRow([hi_set, lo_reset, "X", "X", "X"], ["H", "L"]), - TruthTableRow([lo_set, hi_reset, "X", "X", "X"], ["L", "H"]), - TruthTableRow([hi_set, hi_reset, clock_symb, "X", "X"], ["H", "H"]), - TruthTableRow([lo_set, lo_reset, clock_symb, hi_j, hi_k], ["nQ", "Q"]), - TruthTableRow([lo_set, lo_reset, clock_symb, lo_j, hi_k], ["L", "H"]), - TruthTableRow([lo_set, lo_reset, clock_symb, hi_j, lo_k], ["H", "L"]), - TruthTableRow([lo_set, lo_reset, clock_symb, lo_j, lo_k], ["Q", "nQ"]), - ] - ) - - return FunctionRepresentation(input_pin_pos, output_pin_pos, truth_table) + # input_pin_pos = [ + # pin.connection_point + # for pin in [ + # self.inv_set_pin, + # self.set_pin, + # self.inv_reset_pin, + # self.reset_pin, + # self.clock_pin, + # self.inv_j_input_pin, + # self.j_input_pin, + # self.inv_k_input_pin, + # self.k_input_pin, + # ] + # if pin is not None and pin.connection_point is not None + # ] + # output_pin_pos = [ + # pin.connection_point for pin in [self.output_pin, self.inv_output_pin] if pin.connection_point is not None + # ] + + # # Handle inverted inputs + # hi_set = "H" if self.set_pin is not None else "L" + # lo_set = "L" if self.set_pin is not None else "H" + # hi_reset = "H" if self.reset_pin is not None else "L" + # lo_reset = "L" if self.reset_pin is not None else "H" + # clock_symb = "R" if self.clock_type == "RISING_EDGE" else "F" + # hi_j = "H" if self.j_input_pin is not None else "L" + # lo_j = "L" if self.j_input_pin is not None else "H" + # hi_k = "H" if self.k_input_pin is not None else "L" + # lo_k = "L" if self.k_input_pin is not None else "H" + + # truth_table = TruthTable( + # [ + # TruthTableRow([hi_set, lo_reset, "X", "X", "X"], ["H", "L"]), + # TruthTableRow([lo_set, hi_reset, "X", "X", "X"], ["L", "H"]), + # TruthTableRow([hi_set, hi_reset, clock_symb, "X", "X"], ["H", "H"]), + # TruthTableRow([lo_set, lo_reset, clock_symb, hi_j, hi_k], ["nQ", "Q"]), + # TruthTableRow([lo_set, lo_reset, clock_symb, lo_j, hi_k], ["L", "H"]), + # TruthTableRow([lo_set, lo_reset, clock_symb, hi_j, lo_k], ["H", "L"]), + # TruthTableRow([lo_set, lo_reset, clock_symb, lo_j, lo_k], ["Q", "nQ"]), + # ] + # ) + + # return FunctionRepresentation(input_pin_pos, output_pin_pos, truth_table) + return FunctionRepresentation([], [], TruthTable([])) class BinaryCounter(ChipFunction): From b091856af6383e1647733b12ac4d07da2b466b2b Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Tue, 3 Dec 2024 09:33:05 -0500 Subject: [PATCH 26/44] Added 74hc163 --- Components/Chips/Sequential/74HC163.json | 27 ++ .../Chips/Sequential/74HC191_CB4CLED.json | 2 + object_model/chip_functions.py | 335 +++++++++--------- object_model/circuit_object_model.py | 2 + 4 files changed, 202 insertions(+), 164 deletions(-) create mode 100644 Components/Chips/Sequential/74HC163.json diff --git a/Components/Chips/Sequential/74HC163.json b/Components/Chips/Sequential/74HC163.json new file mode 100644 index 0000000..db2b06a --- /dev/null +++ b/Components/Chips/Sequential/74HC163.json @@ -0,0 +1,27 @@ +{ + "name": "74HC163", + "description": "Presettable synchronous 4-bit binary counter; synchronous reset", + "package": "DIP16", + "vcc_pin": 16, + "gnd_pin": 8, + "functions": [ + { + "func_type": "BINARY_COUNTER", + "clock_pin": 2, + "clock_type": "RISING_EDGE", + "reset_pin": null, + "inv_reset_pin": 1, + "count_enable_pin": 7, + "inv_count_enable_pin": null, + "load_enable_pin": null, + "inv_load_enable_pin": 9, + "up_down_input_pin": null, + "inv_up_down_input_pin": 5, + "terminal_count_pin": 15, + "ripple_clock_output_pin": null, + "data_pins": [3, 4, 5, 6], + "output_pins": [14, 13, 12, 11] + } + ], + "datasheet": "https://www.alldatasheet.com/datasheet-pdf/view/15547/PHILIPS/74HC163.html" +} \ No newline at end of file diff --git a/Components/Chips/Sequential/74HC191_CB4CLED.json b/Components/Chips/Sequential/74HC191_CB4CLED.json index 0afe11e..af698d0 100644 --- a/Components/Chips/Sequential/74HC191_CB4CLED.json +++ b/Components/Chips/Sequential/74HC191_CB4CLED.json @@ -9,6 +9,8 @@ "func_type": "BINARY_COUNTER", "clock_pin": 14, "clock_type": "RISING_EDGE", + "reset_pin": null, + "inv_reset_pin": null, "count_enable_pin": null, "inv_count_enable_pin": 4, "load_enable_pin": null, diff --git a/object_model/chip_functions.py b/object_model/chip_functions.py index ae8417f..b5897e0 100644 --- a/object_model/chip_functions.py +++ b/object_model/chip_functions.py @@ -776,24 +776,24 @@ def __init__( self.output_pin +\ self.inv_output_pin - if self.clock_type not in ["RISING_EDGE", "FALLING_EDGE"]: - raise ValueError("Clock type must be either RISING_EDGE or FALLING_EDGE.") + # if self.clock_type not in ["RISING_EDGE", "FALLING_EDGE"]: + # raise ValueError("Clock type must be either RISING_EDGE or FALLING_EDGE.") # if self.j_input_pin is None and self.inv_j_input_pin is None: # raise ValueError("JK Flip Flop must have either J or inverted J input pin.") # if self.j_input_pin is not None and self.inv_j_input_pin is not None: # raise ValueError("JK Flip Flop cannot have both J and inverted J input pins.") - if self.k_input_pin is None and self.inv_k_input_pin is None: - raise ValueError("JK Flip Flop must have either K or inverted K input pin.") - if self.k_input_pin is not None and self.inv_k_input_pin is not None: - raise ValueError("JK Flip Flop cannot have both K and inverted K input pins.") - if self.inv_set_pin is None and self.set_pin is None: - raise ValueError("JK Flip Flop must have either set or inverted set pin.") - if self.inv_set_pin is not None and self.set_pin is not None: - raise ValueError("JK Flip Flop cannot have both set and inverted set pins.") - if self.inv_reset_pin is None and self.reset_pin is None: - raise ValueError("JK Flip Flop must have either reset or inverted reset pin.") - if self.inv_reset_pin is not None and self.reset_pin is not None: - raise ValueError("JK Flip Flop cannot have both reset and inverted reset pins.") + # if self.k_input_pin is None and self.inv_k_input_pin is None: + # raise ValueError("JK Flip Flop must have either K or inverted K input pin.") + # if self.k_input_pin is not None and self.inv_k_input_pin is not None: + # raise ValueError("JK Flip Flop cannot have both K and inverted K input pins.") + # if self.inv_set_pin is None and self.set_pin is None: + # raise ValueError("JK Flip Flop must have either set or inverted set pin.") + # if self.inv_set_pin is not None and self.set_pin is not None: + # raise ValueError("JK Flip Flop cannot have both set and inverted set pins.") + # if self.inv_reset_pin is None and self.reset_pin is None: + # raise ValueError("JK Flip Flop must have either reset or inverted reset pin.") + # if self.inv_reset_pin is not None and self.reset_pin is not None: + # raise ValueError("JK Flip Flop cannot have both reset and inverted reset pins.") def __str__(self): """ @@ -891,6 +891,8 @@ def __init__( self, clock_pin: int, clock_type: str, + reset_pin: int, + inv_reset_pin: int, count_enable_pin: int, inv_count_enable_pin: int, load_enable_pin: int, @@ -908,6 +910,8 @@ def __init__( clock_pin (int): The clock pin. clock_type (str): The type of the clock signal (e.g., rising, falling, etc.). count_enable_pin (int): The count enable pin. + reset_pin (int): The reset pin. + inv_reset_pin (int): The inverted reset pin (Active LOW). inv_count_enable_pin (int): The inverted count enable pin (Active LOW). load_enable_pin (int): The load enable pin. inv_load_enable_pin (int): The inverted load enable pin (Active LOW). @@ -928,57 +932,59 @@ def __init__( ValueError: If the number of data pins is not equal to the number of output pins. """ super().__init__() - self.clock_pin: Pin = Pin(clock_pin, None) + self.clock_pin: list[Pin] = [Pin(clock_pin, None)] self.clock_type: str = clock_type - self.count_enable_pin: Pin = Pin(count_enable_pin, None) if count_enable_pin is not None else None - self.inv_count_enable_pin: Pin = Pin(inv_count_enable_pin, None) if inv_count_enable_pin is not None else None - self.load_enable_pin: Pin = Pin(load_enable_pin, None) if load_enable_pin is not None else None - self.inv_load_enable_pin: Pin = Pin(inv_load_enable_pin, None) if inv_load_enable_pin is not None else None - self.up_down_input_pin: Pin = Pin(up_down_input_pin, None) if up_down_input_pin is not None else None - self.inv_up_down_input_pin: Pin = ( + self.reset_pin: list[Pin] = [Pin(reset_pin, None) if reset_pin is not None else None] + self.inv_reset_pin: list[Pin] = [Pin(inv_reset_pin, None) if inv_reset_pin is not None else None] + self.count_enable_pin: list[Pin] = [Pin(count_enable_pin, None) if count_enable_pin is not None else None] + self.inv_count_enable_pin: list[Pin] = [Pin(inv_count_enable_pin, None) if inv_count_enable_pin is not None else None] + self.load_enable_pin: list[Pin] = [Pin(load_enable_pin, None) if load_enable_pin is not None else None] + self.inv_load_enable_pin: list[Pin] = [Pin(inv_load_enable_pin, None) if inv_load_enable_pin is not None else None] + self.up_down_input_pin: list[Pin] = [Pin(up_down_input_pin, None) if up_down_input_pin is not None else None] + self.inv_up_down_input_pin: list[Pin] = [( Pin(inv_up_down_input_pin, None) if inv_up_down_input_pin is not None else None - ) - self.terminal_count_pin: Pin = Pin(terminal_count_pin, None) - self.ripple_clock_output_pin: Pin = Pin(ripple_clock_output_pin, None) + )] + self.terminal_count_pin: list[Pin] = [Pin(terminal_count_pin, None)] + self.ripple_clock_output_pin: list[Pin] = [Pin(ripple_clock_output_pin, None)] self.data_pins: list[Pin] = [Pin(pin_num, None) for pin_num in data_pins] self.output_pins: list[Pin] = [Pin(pin_num, None) for pin_num in output_pins] - self.all_pins = ( - [ - self.clock_pin, - self.count_enable_pin, - self.inv_count_enable_pin, - self.load_enable_pin, - self.inv_load_enable_pin, - self.up_down_input_pin, - self.inv_up_down_input_pin, - self.terminal_count_pin, - self.ripple_clock_output_pin, - ] - + self.data_pins - + self.output_pins - ) - - if self.count_enable_pin is not None and self.inv_count_enable_pin is not None: - raise ValueError("Binary Counter cannot have both count enable and inverted count enable pins.") - if self.load_enable_pin is not None and self.inv_load_enable_pin is not None: - raise ValueError("Binary Counter cannot have both load enable and inverted load enable pins.") - if self.up_down_input_pin is not None and self.inv_up_down_input_pin is not None: - raise ValueError("Binary Counter cannot have both up/down input and inverted up/down input pins.") - if self.inv_count_enable_pin is None and self.count_enable_pin is None: - raise ValueError("Binary Counter must have either count enable or inverted count enable pin.") - if self.inv_load_enable_pin is None and self.load_enable_pin is None: - raise ValueError("Binary Counter must have either load enable or inverted load enable pin.") - if self.inv_up_down_input_pin is None and self.up_down_input_pin is None: - raise ValueError("Binary Counter must have either up/down input or inverted up/down input pin.") - - if self.clock_type not in ["RISING_EDGE", "FALLING_EDGE"]: - raise ValueError("Clock type must be either RISING_EDGE or FALLING_EDGE.") - if len(self.data_pins) != len(self.output_pins): - raise ValueError("Number of data pins must be equal to number of output pins.") + # self.all_pins = ( + # [ + # self.clock_pin, + # self.count_enable_pin, + # self.inv_count_enable_pin, + # self.load_enable_pin, + # self.inv_load_enable_pin, + # self.up_down_input_pin, + # self.inv_up_down_input_pin, + # self.terminal_count_pin, + # self.ripple_clock_output_pin, + # ] + # + self.data_pins + # + self.output_pins + # ) - if len(self.data_pins) != 4: - raise ValueError("Arbitrary Binary Counter not supported yet") + # if self.count_enable_pin is not None and self.inv_count_enable_pin is not None: + # raise ValueError("Binary Counter cannot have both count enable and inverted count enable pins.") + # if self.load_enable_pin is not None and self.inv_load_enable_pin is not None: + # raise ValueError("Binary Counter cannot have both load enable and inverted load enable pins.") + # if self.up_down_input_pin is not None and self.inv_up_down_input_pin is not None: + # raise ValueError("Binary Counter cannot have both up/down input and inverted up/down input pins.") + # if self.inv_count_enable_pin is None and self.count_enable_pin is None: + # raise ValueError("Binary Counter must have either count enable or inverted count enable pin.") + # if self.inv_load_enable_pin is None and self.load_enable_pin is None: + # raise ValueError("Binary Counter must have either load enable or inverted load enable pin.") + # if self.inv_up_down_input_pin is None and self.up_down_input_pin is None: + # raise ValueError("Binary Counter must have either up/down input or inverted up/down input pin.") + + # if self.clock_type not in ["RISING_EDGE", "FALLING_EDGE"]: + # raise ValueError("Clock type must be either RISING_EDGE or FALLING_EDGE.") + # if len(self.data_pins) != len(self.output_pins): + # raise ValueError("Number of data pins must be equal to number of output pins.") + + # if len(self.data_pins) != 4: + # raise ValueError("Arbitrary Binary Counter not supported yet") def __str__(self): """ @@ -1006,112 +1012,113 @@ def chip_internal_function(self) -> FunctionRepresentation: Some of the outputs are also inputs for the counter. Only supports 4 bit counter. """ - # TODO figure out a better way, I hate this - input_pin_pos = [ - pin.connection_point - for pin in [ - self.inv_load_enable_pin, - self.load_enable_pin, - self.inv_up_down_input_pin, - self.up_down_input_pin, - self.inv_count_enable_pin, - self.count_enable_pin, - self.clock_pin, - ] - + self.data_pins - + self.output_pins - if pin is not None and pin.connection_point is not None - ] - output_pin_pos = [ - pin.connection_point - for pin in self.output_pins + [self.terminal_count_pin, self.ripple_clock_output_pin] - if pin.connection_point is not None - ] + # # TODO figure out a better way, I hate this + # input_pin_pos = [ + # pin.connection_point + # for pin in [ + # self.inv_load_enable_pin, + # self.load_enable_pin, + # self.inv_up_down_input_pin, + # self.up_down_input_pin, + # self.inv_count_enable_pin, + # self.count_enable_pin, + # self.clock_pin, + # ] + # + self.data_pins + # + self.output_pins + # if pin is not None and pin.connection_point is not None + # ] + # output_pin_pos = [ + # pin.connection_point + # for pin in self.output_pins + [self.terminal_count_pin, self.ripple_clock_output_pin] + # if pin.connection_point is not None + # ] - # Handle inverted outputs - hi_load = "H" if self.load_enable_pin is not None else "L" - lo_load = "L" if self.load_enable_pin is not None else "H" - hi_up_down = "H" if self.up_down_input_pin is not None else "L" - lo_up_down = "L" if self.up_down_input_pin is not None else "H" - hi_count = "H" if self.count_enable_pin is not None else "L" - lo_count = "L" if self.count_enable_pin is not None else "H" - clock_symb = "R" if self.clock_type == "RISING_EDGE" else "F" - - x_dq = ["X"] * len(self.data_pins) # Don't care values for data pins/output pins - c00 = ["L", "L", "L", "L"] - c01 = ["L", "L", "L", "H"] - c02 = ["L", "L", "H", "L"] - c03 = ["L", "L", "H", "H"] - c04 = ["L", "H", "L", "L"] - c05 = ["L", "H", "L", "H"] - c06 = ["L", "H", "H", "L"] - c07 = ["L", "H", "H", "H"] - c08 = ["H", "L", "L", "L"] - c09 = ["H", "L", "L", "H"] - c10 = ["H", "L", "H", "L"] - c11 = ["H", "L", "H", "H"] - c12 = ["H", "H", "L", "L"] - c13 = ["H", "H", "L", "H"] - c14 = ["H", "H", "H", "L"] - c15 = ["H", "H", "H", "H"] + # # Handle inverted outputs + # hi_load = "H" if self.load_enable_pin is not None else "L" + # lo_load = "L" if self.load_enable_pin is not None else "H" + # hi_up_down = "H" if self.up_down_input_pin is not None else "L" + # lo_up_down = "L" if self.up_down_input_pin is not None else "H" + # hi_count = "H" if self.count_enable_pin is not None else "L" + # lo_count = "L" if self.count_enable_pin is not None else "H" + # clock_symb = "R" if self.clock_type == "RISING_EDGE" else "F" + # x_dq = ["X"] * len(self.data_pins) # Don't care values for data pins/output pins + # c00 = ["L", "L", "L", "L"] + # c01 = ["L", "L", "L", "H"] + # c02 = ["L", "L", "H", "L"] + # c03 = ["L", "L", "H", "H"] + # c04 = ["L", "H", "L", "L"] + # c05 = ["L", "H", "L", "H"] + # c06 = ["L", "H", "H", "L"] + # c07 = ["L", "H", "H", "H"] + # c08 = ["H", "L", "L", "L"] + # c09 = ["H", "L", "L", "H"] + # c10 = ["H", "L", "H", "L"] + # c11 = ["H", "L", "H", "H"] + # c12 = ["H", "H", "L", "L"] + # c13 = ["H", "H", "L", "H"] + # c14 = ["H", "H", "H", "L"] + # c15 = ["H", "H", "H", "H"] - truth_table = TruthTable( - [ - # Load states - TruthTableRow([hi_load, "X", "X", "X"] + c00 + x_dq, c00 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c01 + x_dq, c01 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c02 + x_dq, c02 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c03 + x_dq, c03 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c04 + x_dq, c04 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c05 + x_dq, c05 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c06 + x_dq, c06 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c07 + x_dq, c07 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c08 + x_dq, c08 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c09 + x_dq, c09 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c10 + x_dq, c10 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c11 + x_dq, c11 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c12 + x_dq, c12 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c13 + x_dq, c13 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c14 + x_dq, c14 + ["L", "H"]), - TruthTableRow([hi_load, "X", "X", "X"] + c15 + x_dq, c15 + ["L", "H"]), - # Hold state - TruthTableRow([lo_load, "X", lo_count, "X", "X", "X", "X", "X"], ["Q", "Q", "Q", "Q", "Q", "Q"]), - # Count UP states - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c00, c01 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c01, c02 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c02, c03 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c03, c04 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c04, c05 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c05, c06 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c06, c07 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c07, c08 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c08, c09 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c09, c10 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c10, c11 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c11, c12 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c12, c13 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c13, c14 + ["L", "H"]), - TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c14, c15 + ["L", "H"]), - # TODO add limit states when terminal count is reached - # Count DOWN states - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c15, c14 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c14, c13 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c13, c12 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c12, c11 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c11, c10 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c10, c09 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c09, c08 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c08, c07 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c07, c06 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c06, c05 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c05, c04 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c04, c03 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c03, c02 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c02, c01 + ["L", "H"]), - TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c01, c00 + ["L", "H"]), - # TODO add limit states when terminal count is reached - ] - ) - return FunctionRepresentation(input_pin_pos, output_pin_pos, truth_table) + # truth_table = TruthTable( + # [ + # # Load states + # TruthTableRow([hi_load, "X", "X", "X"] + c00 + x_dq, c00 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c01 + x_dq, c01 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c02 + x_dq, c02 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c03 + x_dq, c03 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c04 + x_dq, c04 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c05 + x_dq, c05 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c06 + x_dq, c06 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c07 + x_dq, c07 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c08 + x_dq, c08 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c09 + x_dq, c09 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c10 + x_dq, c10 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c11 + x_dq, c11 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c12 + x_dq, c12 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c13 + x_dq, c13 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c14 + x_dq, c14 + ["L", "H"]), + # TruthTableRow([hi_load, "X", "X", "X"] + c15 + x_dq, c15 + ["L", "H"]), + # # Hold state + # TruthTableRow([lo_load, "X", lo_count, "X", "X", "X", "X", "X"], ["Q", "Q", "Q", "Q", "Q", "Q"]), + # # Count UP states + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c00, c01 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c01, c02 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c02, c03 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c03, c04 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c04, c05 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c05, c06 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c06, c07 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c07, c08 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c08, c09 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c09, c10 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c10, c11 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c11, c12 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c12, c13 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c13, c14 + ["L", "H"]), + # TruthTableRow([lo_load, hi_up_down, hi_count, clock_symb] + x_dq + c14, c15 + ["L", "H"]), + # # TODO add limit states when terminal count is reached + # # Count DOWN states + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c15, c14 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c14, c13 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c13, c12 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c12, c11 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c11, c10 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c10, c09 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c09, c08 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c08, c07 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c07, c06 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c06, c05 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c05, c04 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c04, c03 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c03, c02 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c02, c01 + ["L", "H"]), + # TruthTableRow([lo_load, lo_up_down, hi_count, clock_symb] + x_dq + c01, c00 + ["L", "H"]), + # # TODO add limit states when terminal count is reached + # ] + # ) + + # return FunctionRepresentation(input_pin_pos, output_pin_pos, truth_table) + return FunctionRepresentation([], [], TruthTable([])) \ No newline at end of file diff --git a/object_model/circuit_object_model.py b/object_model/circuit_object_model.py index 4bb848c..f0126a1 100644 --- a/object_model/circuit_object_model.py +++ b/object_model/circuit_object_model.py @@ -217,6 +217,8 @@ def from_json(json_data: dict, package_dict: dict[str, Package] | None = None): "BINARY_COUNTER": lambda data: BinaryCounter( data["clock_pin"], data["clock_type"], + data["reset_pin"], + data["inv_reset_pin"], data["count_enable_pin"], data["inv_count_enable_pin"], data["load_enable_pin"], From 906470757eef89c1045bbb477371f9002f6907aa Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Tue, 3 Dec 2024 09:37:56 -0500 Subject: [PATCH 27/44] fix 163 --- Components/Chips/Sequential/74HC163.json | 2 +- object_model/chip_functions.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Components/Chips/Sequential/74HC163.json b/Components/Chips/Sequential/74HC163.json index db2b06a..e6ec881 100644 --- a/Components/Chips/Sequential/74HC163.json +++ b/Components/Chips/Sequential/74HC163.json @@ -11,7 +11,7 @@ "clock_type": "RISING_EDGE", "reset_pin": null, "inv_reset_pin": 1, - "count_enable_pin": 7, + "count_enable_pin": 10, "inv_count_enable_pin": null, "load_enable_pin": null, "inv_load_enable_pin": 9, diff --git a/object_model/chip_functions.py b/object_model/chip_functions.py index b5897e0..ac30405 100644 --- a/object_model/chip_functions.py +++ b/object_model/chip_functions.py @@ -946,7 +946,7 @@ def __init__( )] self.terminal_count_pin: list[Pin] = [Pin(terminal_count_pin, None)] self.ripple_clock_output_pin: list[Pin] = [Pin(ripple_clock_output_pin, None)] - self.data_pins: list[Pin] = [Pin(pin_num, None) for pin_num in data_pins] + self.input_pins: list[Pin] = [Pin(pin_num, None) for pin_num in data_pins] # input pins = data pins self.output_pins: list[Pin] = [Pin(pin_num, None) for pin_num in output_pins] # self.all_pins = ( @@ -1002,7 +1002,7 @@ def __str__(self): f"\n\t\tUp/Down Input Pin: {self.up_down_input_pin}," f"\n\t\tTerminal Count Pin: {self.terminal_count_pin}," f"\n\t\tRipple Clock Output Pin: {self.ripple_clock_output_pin}," - f"\n\t\tData Pins: {self.data_pins}," + f"\n\t\tData Pins: {self.input_pins}," f"\n\t\tOutput Pins: {self.output_pins}" ) From 73075395f9d8ad784dcc51064a5554a070102d92 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Thu, 5 Dec 2024 15:06:45 -0500 Subject: [PATCH 28/44] =?UTF-8?q?JK=20=C3=A0=20tester?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Components/Chips/Sequential/74HC109_JK.json | 8 +- Components/Chips/Sequential/74HC112_JK.json | 8 +- Components/Chips/Sequential/74HC74_D.json | 24 +- New_Circuit_AND.json | 351 ++++++++++++++ New_Circuit_D_FlipFlop.json | 452 ++++++++++++++++++ New_Circuit_JK109_FlipFlop.json | 486 ++++++++++++++++++++ bascule_essai_120.zip | Bin 0 -> 1785 bytes component_sketch.py | 15 + menus.py | 247 +++++++++- object_model/chip_functions.py | 127 ++--- object_model/circuit_object_model.py | 60 ++- 11 files changed, 1673 insertions(+), 105 deletions(-) create mode 100644 New_Circuit_AND.json create mode 100644 New_Circuit_D_FlipFlop.json create mode 100644 New_Circuit_JK109_FlipFlop.json create mode 100644 bascule_essai_120.zip diff --git a/Components/Chips/Sequential/74HC109_JK.json b/Components/Chips/Sequential/74HC109_JK.json index 57ec4be..63b36a9 100644 --- a/Components/Chips/Sequential/74HC109_JK.json +++ b/Components/Chips/Sequential/74HC109_JK.json @@ -17,8 +17,8 @@ "inv_j_input_pin": null, "k_input_pin": null, "inv_k_input_pin": 3, - "output_pin": 6, - "inv_output_pin": 7 + "output_pins": 6, + "inv_output_pins": 7 }, { "func_type": "JK_FLIP_FLOP", @@ -32,8 +32,8 @@ "inv_j_input_pin": null, "k_input_pin": null, "inv_k_input_pin": 13, - "output_pin": 10, - "inv_output_pin": 9 + "output_pins": 10, + "inv_output_pins": 9 } ], "datasheet": "https://www.alldatasheet.com/datasheet-pdf/view/15527/PHILIPS/74HC109.html" diff --git a/Components/Chips/Sequential/74HC112_JK.json b/Components/Chips/Sequential/74HC112_JK.json index ea9203d..e723146 100644 --- a/Components/Chips/Sequential/74HC112_JK.json +++ b/Components/Chips/Sequential/74HC112_JK.json @@ -17,8 +17,8 @@ "inv_j_input_pin": null, "k_input_pin": 2, "inv_k_input_pin": null, - "output_pin": 5, - "inv_output_pin": 6 + "output_pins": 5, + "inv_output_pins": 6 }, { "func_type": "JK_FLIP_FLOP", @@ -32,8 +32,8 @@ "inv_j_input_pin": null, "k_input_pin": 12, "inv_k_input_pin": null, - "output_pin": 9, - "inv_output_pin": 7 + "output_pins": 9, + "inv_output_pins": 7 } ], "datasheet": "https://www.alldatasheet.com/datasheet-pdf/view/15529/PHILIPS/74HC112.html" diff --git a/Components/Chips/Sequential/74HC74_D.json b/Components/Chips/Sequential/74HC74_D.json index 50bc0eb..1887187 100644 --- a/Components/Chips/Sequential/74HC74_D.json +++ b/Components/Chips/Sequential/74HC74_D.json @@ -7,27 +7,27 @@ "functions": [ { "func_type": "D_FLIP_FLOP", - "clock_pin": 3, + "clock_pin": [3], "clock_type": "RISING_EDGE", "reset_pin": null, - "inv_reset_pin": 1, + "inv_reset_pin": [1], "set_pin": null, - "inv_set_pin": 4, - "data_pin": 2, - "output_pin": 5, - "inv_output_pin": 6 + "inv_set_pin": [4], + "input_pins": [2], + "output_pins": [5], + "inv_output_pins": [6] }, { "func_type": "D_FLIP_FLOP", - "clock_pin": 11, + "clock_pin": [11], "clock_type": "RISING_EDGE", "reset_pin": null, - "inv_reset_pin": 13, + "inv_reset_pin": [13], "set_pin": null, - "inv_set_pin": 10, - "data_pin": 12, - "output_pin": 9, - "inv_output_pin": 8 + "inv_set_pin": [10], + "input_pins": [12], + "output_pins": [9], + "inv_output_pins": [8] } ], "datasheet": "https://www.alldatasheet.com/datasheet-pdf/view/15659/PHILIPS/74HC74.html" diff --git a/New_Circuit_AND.json b/New_Circuit_AND.json new file mode 100644 index 0000000..3e683de --- /dev/null +++ b/New_Circuit_AND.json @@ -0,0 +1,351 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 972.5, + 32.5 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 972.5, + 317.5 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 115.5, + 161.5 + ], + "pinUL_XY": [ + 117.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC00", + "type": "74HC00", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "NandGate", + "io": [ + [ + [ + 1, + 2 + ], + [ + 3 + ] + ], + [ + [ + 4, + 5 + ], + [ + 6 + ] + ], + [ + [ + 9, + 10 + ], + [ + 8 + ] + ], + [ + [ + 12, + 13 + ], + [ + 11 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "NandGate", + "io_select": [], + "io_out_inv": [], + "io_enable": [], + "io_enable_inv": [], + "clock_pin": [], + "inv_reset_pin": [], + "inv_set_pin": [], + "occupied_holes": [ + "4,7", + "4,8", + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 4, + 3, + 4, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 117.5, + 92.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 117.5, + 92.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 10, + 12, + 10, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 207.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 207.5, + 257.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 4, + 12, + 4, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 117.5, + 257.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 117.5, + 257.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 5, + 12, + 5, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 132.5, + 257.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 6, + 11 + ] + ], + "XY": [ + 97.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#00f900", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 59, + 2, + 59, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 47.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 942.5, + 47.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 60, + 13, + 60, + 1 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 957.5, + 302.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 957.5, + 302.5 + ], + "tag": "_wire_5_end" + } + } + } +} \ No newline at end of file diff --git a/New_Circuit_D_FlipFlop.json b/New_Circuit_D_FlipFlop.json new file mode 100644 index 0000000..fc28240 --- /dev/null +++ b/New_Circuit_D_FlipFlop.json @@ -0,0 +1,452 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 975.5, + 35.5 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 975.5, + 320.5 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 4, + 3, + 4, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 117.5, + 92.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 117.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 10, + 12, + 10, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 207.5, + 257.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 207.5, + 302.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 5, + 3, + 5, + 2 + ] + ], + "multipoints": [ + 83, + 57 + ], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 132.5, + 92.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 132.5, + 47.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 8, + 3, + 9, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 177.5, + 92.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 192.5, + 47.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 5, + 12 + ] + ], + "XY": [ + 82.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ff9300", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_io_1": { + "coord": [ + [ + 6, + 10 + ] + ], + "XY": [ + 97.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ff9300", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_io_2": { + "coord": [ + [ + 8, + 11 + ] + ], + "XY": [ + 127.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#00fa92", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_wire_6": { + "mode": 0, + "coord": [ + [ + 59, + 2, + 59, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_6_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 47.5 + ], + "tag": "_wire_6_start" + }, + "end": { + "position": [ + 942.5, + 317.5 + ], + "tag": "_wire_6_end" + } + } + }, + "_wire_7": { + "mode": 0, + "coord": [ + [ + 60, + 1, + 60, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_7_body", + "endpoints": { + "start": { + "position": [ + 957.5, + 32.5 + ], + "tag": "_wire_7_start" + }, + "end": { + "position": [ + 957.5, + 302.5 + ], + "tag": "_wire_7_end" + } + } + }, + "_chip_0": { + "XY": [ + 115.5, + 161.5 + ], + "pinUL_XY": [ + 117.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 14, + "label": "74HC74", + "type": "74HC74", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "DFlipFlop", + "io": [ + [ + [ + 2 + ], + [ + 5 + ] + ], + [ + [ + 12 + ], + [ + 9 + ] + ] + ], + "pwr": [ + [ + 14, + "+" + ], + [ + 7, + "-" + ] + ], + "logicFunctionName": "DFlipFlop", + "io_select": [], + "io_out_inv": [ + [ + 6 + ], + [ + 8 + ] + ], + "io_enable": [], + "io_enable_inv": [], + "clock_pin": [ + [ + [ + 0, + 3 + ] + ], + [ + [ + 1, + 11 + ] + ] + ], + "inv_reset_pin": [ + [ + [ + 0, + 1 + ] + ], + [ + [ + 1, + 13 + ] + ] + ], + "inv_set_pin": [ + [ + [ + 0, + 4 + ] + ], + [ + [ + 1, + 10 + ] + ] + ], + "occupied_holes": [ + "4,7", + "4,8", + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8" + ] + }, + "_io_3": { + "coord": [ + [ + 4, + 10 + ] + ], + "XY": [ + 67.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#00fcff", + "outline_tag": "pin_io_outline__io_3", + "tag": "pin_io__io_3", + "label_tag": "_io_3_label" + }, + "_io_4": { + "coord": [ + [ + 7, + 12 + ] + ], + "XY": [ + 112.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#00fcff", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + } +} \ No newline at end of file diff --git a/New_Circuit_JK109_FlipFlop.json b/New_Circuit_JK109_FlipFlop.json new file mode 100644 index 0000000..1cfbc12 --- /dev/null +++ b/New_Circuit_JK109_FlipFlop.json @@ -0,0 +1,486 @@ +{ + "_battery": {}, + "_battery_neg_wire": { + "start": [ + 1250, + 342.4 + ], + "end": [ + 972.5, + 32.5 + ], + "color": [ + 0, + 0, + 0 + ], + "terminal_type": "neg", + "endpoint_tag": "_battery_neg_wire_endpoint" + }, + "_battery_pos_wire": { + "start": [ + 1250, + 439.6 + ], + "end": [ + 972.5, + 317.5 + ], + "color": [ + 255, + 0, + 0 + ], + "terminal_type": "pos", + "endpoint_tag": "_battery_pos_wire_endpoint" + }, + "_chip_0": { + "XY": [ + 100.5, + 161.5 + ], + "pinUL_XY": [ + 102.5, + 152.5 + ], + "chipWidth": 2.4, + "pinCount": 16, + "label": "74HC109", + "type": "74HC109", + "btnMenu": [ + 1, + 1, + 0 + ], + "symbScript": "JKFlipFlop", + "io": [ + [ + [ + 2 + ], + [ + 6 + ] + ], + [ + [ + 14 + ], + [ + 10 + ] + ] + ], + "pwr": [ + [ + 16, + "+" + ], + [ + 8, + "-" + ] + ], + "logicFunctionName": "JKFlipFlop", + "io_select": [], + "io_out_inv": [], + "io_enable": [], + "io_enable_inv": [], + "clock_pin": [ + [ + [ + 0, + 4 + ] + ], + [ + [ + 1, + 12 + ] + ] + ], + "inv_reset_pin": [ + [ + [ + 0, + 1 + ] + ], + [ + [ + 1, + 15 + ] + ] + ], + "inv_set_pin": [ + [ + [ + 0, + 5 + ] + ], + [ + [ + 1, + 11 + ] + ] + ], + "inv_clock_pin": [], + "j_input_pin": [ + [ + [ + 0, + 2 + ] + ], + [ + [ + 1, + 14 + ] + ] + ], + "inv_k_input_pin": [ + [ + [ + 0, + 3 + ] + ], + [ + [ + 1, + 13 + ] + ] + ], + "k_input_pin": [ + [], + [] + ], + "occupied_holes": [ + "3,7", + "3,8", + "4,7", + "4,8", + "5,7", + "5,8", + "6,7", + "6,8", + "7,7", + "7,8", + "8,7", + "8,8", + "9,7", + "9,8", + "10,7", + "10,8" + ] + }, + "_wire_0": { + "mode": 0, + "coord": [ + [ + 60, + 2, + 60, + 14 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_0_body", + "endpoints": { + "start": { + "position": [ + 957.5, + 47.5 + ], + "tag": "_wire_0_start" + }, + "end": { + "position": [ + 957.5, + 47.5 + ], + "tag": "_wire_0_end" + } + } + }, + "_wire_1": { + "mode": 0, + "coord": [ + [ + 3, + 3, + 3, + 2 + ] + ], + "multipoints": [], + "color": [ + 255, + 38, + 0 + ], + "wire_body_tag": "_wire_1_body", + "endpoints": { + "start": { + "position": [ + 102.5, + 92.5 + ], + "tag": "_wire_1_start" + }, + "end": { + "position": [ + 102.5, + 92.5 + ], + "tag": "_wire_1_end" + } + } + }, + "_wire_2": { + "mode": 0, + "coord": [ + [ + 59, + 1, + 59, + 13 + ] + ], + "multipoints": [], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_2_body", + "endpoints": { + "start": { + "position": [ + 942.5, + 32.5 + ], + "tag": "_wire_2_start" + }, + "end": { + "position": [ + 942.5, + 32.5 + ], + "tag": "_wire_2_end" + } + } + }, + "_wire_3": { + "mode": 0, + "coord": [ + [ + 10, + 12, + 10, + 13 + ] + ], + "multipoints": [ + 165, + 283 + ], + "color": [ + 0, + 0, + 0 + ], + "wire_body_tag": "_wire_3_body", + "endpoints": { + "start": { + "position": [ + 207.5, + 257.5 + ], + "tag": "_wire_3_start" + }, + "end": { + "position": [ + 207.5, + 257.5 + ], + "tag": "_wire_3_end" + } + } + }, + "_io_0": { + "coord": [ + [ + 4, + 12 + ] + ], + "XY": [ + 67.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ff84ff", + "outline_tag": "pin_io_outline__io_0", + "tag": "pin_io__io_0", + "label_tag": "_io_0_label" + }, + "_io_1": { + "coord": [ + [ + 5, + 10 + ] + ], + "XY": [ + 82.5, + 217.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ff84ff", + "outline_tag": "pin_io_outline__io_1", + "tag": "pin_io__io_1", + "label_tag": "_io_1_label" + }, + "_io_2": { + "coord": [ + [ + 6, + 12 + ] + ], + "XY": [ + 97.5, + 247.5 + ], + "controller_pin": "IO", + "type": 0, + "color": "#ff84ff", + "outline_tag": "pin_io_outline__io_2", + "tag": "pin_io__io_2", + "label_tag": "_io_2_label" + }, + "_wire_4": { + "mode": 0, + "coord": [ + [ + 3, + 12, + 3, + 14 + ] + ], + "multipoints": [ + 56, + 303 + ], + "color": [ + 255, + 147, + 0 + ], + "wire_body_tag": "_wire_4_body", + "endpoints": { + "start": { + "position": [ + 102.5, + 257.5 + ], + "tag": "_wire_4_start" + }, + "end": { + "position": [ + 102.5, + 257.5 + ], + "tag": "_wire_4_end" + } + } + }, + "_wire_5": { + "mode": 0, + "coord": [ + [ + 7, + 12, + 7, + 14 + ] + ], + "multipoints": [ + 119, + 305 + ], + "color": [ + 255, + 147, + 0 + ], + "wire_body_tag": "_wire_5_body", + "endpoints": { + "start": { + "position": [ + 162.5, + 257.5 + ], + "tag": "_wire_5_start" + }, + "end": { + "position": [ + 162.5, + 257.5 + ], + "tag": "_wire_5_end" + } + } + }, + "_io_4": { + "coord": [ + [ + 8, + 11 + ] + ], + "XY": [ + 127.5, + 232.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff9300", + "outline_tag": "pin_io_outline__io_4", + "tag": "pin_io__io_4", + "label_tag": "_io_4_label" + }, + "_io_5": { + "coord": [ + [ + 9, + 12 + ] + ], + "XY": [ + 142.5, + 247.5 + ], + "controller_pin": "IO", + "type": 1, + "color": "#ff9300", + "outline_tag": "pin_io_outline__io_5", + "tag": "pin_io__io_5", + "label_tag": "_io_5_label" + } +} \ No newline at end of file diff --git a/bascule_essai_120.zip b/bascule_essai_120.zip new file mode 100644 index 0000000000000000000000000000000000000000..0a9e30b06bed1824fa622032acaa77a2c912b509 GIT binary patch literal 1785 zcmZ{ldpOg39LIli87Eues90kz(~43qxlKkH!kiI@$y&tGG8U^`k26%qeOya_fXK-OF9sfB` z8Bhi$g8!R``fA=61QT*3^=lBhPXL8KA;bP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connection_point - for pin in [self.inv_set_pin, self.inv_reset_pin, self.clock_pin, self.data_pin] + for pin in [self.inv_set_pin, self.inv_reset_pin, self.clock_pin, self.input_pins] if pin is not None and pin.connection_point is not None ] output_pin_pos = [ - pin.connection_point for pin in [self.output_pin, self.inv_output_pin] if pin.connection_point is not None + pin.connection_point for pin in [self.output_pins, self.inv_output_pins] if pin.connection_point is not None ] truth_table = TruthTable( @@ -706,8 +727,8 @@ class JKFlipFlop(ChipFunction): inv_j_input_pin (Pin): The inverted J input pin (Active LOW). k_input_pin (Pin): The K input pin. inv_k_input_pin (Pin): The inverted K input pin (Active LOW). - output_pin (Pin): The output pin. - inv_output_pin (Pin): The inverted output pin (Active LOW). + output_pins (Pin): The output pin. + inv_output_pins (Pin): The inverted output pin (Active LOW). """ def __init__( @@ -722,8 +743,8 @@ def __init__( inv_j_input_pin: int, k_input_pin: int, inv_k_input_pin: int, - output_pin: int, - inv_output_pin: int, + output_pins: int, + inv_output_pins: int, ): """ Initializes a JK Flip Flop with the specified input and output pins. @@ -738,8 +759,8 @@ def __init__( inv_j_input_pin (Pin): The inverted J input pin (Active LOW). k_input_pin (Pin): The K input pin. inv_k_input_pin (Pin): The inverted K input pin (Active LOW). - output_pin (Pin): The output pin. - inv_output_pin (Pin): The inverted output pin (Active LOW). + output_pins (Pin): The output pin. + inv_output_pins (Pin): The inverted output pin (Active LOW). Raises: ValueError: If the JK Flip Flop does not have either J or inverted J input pin. ValueError: If the JK Flip Flop has both J and inverted J input pins. @@ -757,13 +778,13 @@ def __init__( self.inv_reset_pin: list[Pin] = [Pin(inv_reset_pin, None) if inv_reset_pin is not None else None] self.set_pin: list[Pin] = [Pin(set_pin, None) if set_pin is not None else None] self.inv_set_pin: list[Pin] = [Pin(inv_set_pin, None) if inv_set_pin is not None else None] - # self.j_input_pin: list[Pin] = [Pin(j_input_pin, None) if j_input_pin is not None else None] - # self.inv_j_input_pin: list[Pin] = [Pin(inv_j_input_pin, None) if inv_j_input_pin is not None else None] - self.input_pins: list[Pin] = [Pin(k_input_pin, None) if j_input_pin is not None else None] # input pins = j_input_pin + self.j_input_pin: list[Pin] = [Pin(j_input_pin, None) if j_input_pin is not None else None] + self.inv_j_input_pin: list[Pin] = [Pin(inv_j_input_pin, None) if inv_j_input_pin is not None else None] + self.input_pins: list[Pin] = [Pin(j_input_pin, None) if j_input_pin is not None else None] # input pins = j_input_pin self.k_input_pin: list[Pin] = [Pin(k_input_pin, None) if k_input_pin is not None else None] self.inv_k_input_pin: list[Pin] = [Pin(inv_k_input_pin, None) if inv_k_input_pin is not None else None] - self.output_pin: list[Pin] = [Pin(output_pin, None)] - self.inv_output_pin: list[Pin] = [Pin(inv_output_pin, None)] + self.output_pins: list[Pin] = [Pin(output_pins, None)] + self.inv_output_pins: list[Pin] = [Pin(inv_output_pins, None)] self.all_pins = self.clock_pin + \ self.reset_pin +\ @@ -773,8 +794,8 @@ def __init__( self.input_pins +\ self.k_input_pin +\ self.inv_k_input_pin +\ - self.output_pin +\ - self.inv_output_pin + self.output_pins +\ + self.inv_output_pins # if self.clock_type not in ["RISING_EDGE", "FALLING_EDGE"]: # raise ValueError("Clock type must be either RISING_EDGE or FALLING_EDGE.") @@ -812,8 +833,8 @@ def __str__(self): # f"\n\t\tInverted J Input Pin: {self.inv_j_input_pin}," f"\n\t\tK Input Pin: {self.k_input_pin}," f"\n\t\tInverted K Input Pin: {self.inv_k_input_pin}," - f"\n\t\tOutput Pin: {self.output_pin}," - f"\n\t\tInverted Output Pin: {self.inv_output_pin}" + f"\n\t\tOutput Pin: {self.output_pins}," + f"\n\t\tInverted Output Pin: {self.inv_output_pins}" ) def chip_internal_function(self) -> FunctionRepresentation: diff --git a/object_model/circuit_object_model.py b/object_model/circuit_object_model.py index f0126a1..2fd9d6f 100644 --- a/object_model/circuit_object_model.py +++ b/object_model/circuit_object_model.py @@ -196,9 +196,9 @@ def from_json(json_data: dict, package_dict: dict[str, Package] | None = None): data["inv_reset_pin"], data["set_pin"], data["inv_set_pin"], - data["data_pin"], - data["output_pin"], - data["inv_output_pin"], + data["input_pins"], + data["output_pins"], + data["inv_output_pins"], ), "JK_FLIP_FLOP": lambda data: JKFlipFlop( data["clock_pin"], @@ -211,8 +211,8 @@ def from_json(json_data: dict, package_dict: dict[str, Package] | None = None): data["inv_j_input_pin"], data["k_input_pin"], data["inv_k_input_pin"], - data["output_pin"], - data["inv_output_pin"], + data["output_pins"], + data["inv_output_pins"], ), "BINARY_COUNTER": lambda data: BinaryCounter( data["clock_pin"], @@ -275,8 +275,10 @@ def to_generic_dict(self) -> dict[str, Any]: ([pin.pin_num for pin in func.input_pins], [pin.pin_num for pin in func.output_pins]) for func in self.functions #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) - if isinstance(func, LogicalFunction) or isinstance(func, Mux) or isinstance(func, Demux) + #if isinstance(func, LogicalFunction) or isinstance(func, Mux) or isinstance(func, Demux) or isinstance(func, DFlipFlop) ] + # if isinstance(self.functions, DFlipFlop): + # attr_dict["io"] = [([2], [5])] attr_dict["io_select"] = [ [pin.pin_num for pin in func.select_pins] for func in self.functions @@ -287,7 +289,7 @@ def to_generic_dict(self) -> dict[str, Any]: [pin.pin_num for pin in func.inv_output_pins] for func in self.functions #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) - if isinstance(func, Mux) + if isinstance(func, Mux) or isinstance(func, DFlipFlop) ] attr_dict["io_enable"] = [ [pin.pin_num for pin in func.enable_pins] @@ -301,6 +303,50 @@ def to_generic_dict(self) -> dict[str, Any]: #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) if isinstance(func, Mux) or isinstance(func, Demux) ] + attr_dict["clock_pin"] = [ + [(n,pin.pin_num) for pin in func.clock_pin] + for n,func in enumerate(self.functions) if func.clock_type != "FALLING_EDGE" + #self.functions.clock_pin + #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) + if isinstance(func, DFlipFlop) or isinstance(func, JKFlipFlop) + ] + attr_dict["inv_clock_pin"] = [ + [(n,pin.pin_num) for pin in func.clock_pin] + for n,func in enumerate(self.functions) if func.clock_type == "FALLING_EDGE" + #self.functions.clock_pin + #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) + if isinstance(func, JKFlipFlop) + ] + attr_dict["inv_reset_pin"] = [ + [(n,pin.pin_num) for pin in func.inv_reset_pin] + for n,func in enumerate(self.functions) + + if isinstance(func, DFlipFlop) or isinstance(func, JKFlipFlop) + ] + attr_dict["inv_set_pin"] = [ + [(n,pin.pin_num)for pin in func.inv_set_pin] + for n,func in enumerate(self.functions) + + if isinstance(func, DFlipFlop) or isinstance(func, JKFlipFlop) + ] + attr_dict["j_input_pin"] = [ + [(n,pin.pin_num)for pin in func.j_input_pin] + for n,func in enumerate(self.functions) + + if isinstance(func, JKFlipFlop) + ] + attr_dict["inv_k_input_pin"] = [ + [(n,pin.pin_num)for pin in func.inv_k_input_pin] + for n,func in enumerate(self.functions) + + if isinstance(func, JKFlipFlop) + ] + attr_dict["k_input_pin"] = [ + [(n,pin.pin_num)for pin in func.k_input_pin if pin] + for n,func in enumerate(self.functions) + + if isinstance(func, JKFlipFlop) + ] return attr_dict def __str__(self): From 7298ad5cb52385ab7af2466536396492e89faeae Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Thu, 5 Dec 2024 16:37:31 -0500 Subject: [PATCH 29/44] merge fix --- menus.py | 93 +++++++++++++++++++++++++++----------------------------- 1 file changed, 44 insertions(+), 49 deletions(-) diff --git a/menus.py b/menus.py index 8dd3888..2cea3ae 100644 --- a/menus.py +++ b/menus.py @@ -89,6 +89,14 @@ class SerialPort: connection: serial.Serial | None """The serial connection object.""" + def connect(self): + """Open the serial connection.""" + try: + self.connection = serial.Serial(port=self.com_port, baudrate=self.baud_rate, timeout=self.timeout) + print(f"Serial port {self.com_port} opened successfully.") + except serial.SerialException as e: + print(f"Error opening port {self.com_port}: {e}") + class Menus: """ @@ -127,8 +135,7 @@ def __init__( self.current_dict_circuit: dict = current_dict_circuit """The current circuit data.""" self.sketcher = sketcher - self.com_port: str | None = None - """The selected COM port.""" + self.script = "" self.selected_microcontroller = None @@ -328,10 +335,10 @@ def show_correspondence_table(self, show=True): tree.configure(yscroll=scrollbar.set) scrollbar.pack(side="right", fill="y") - # Show the table in the new window - table_window.transient(self.parent) # Set to be on top of the parent window - table_window.grab_set() # Prevent interaction with the main window until closed - table_window.mainloop() + # Show the table in the new window + table_window.transient(self.parent) # Set to be on top of the parent window + table_window.grab_set() # Prevent interaction with the main window until closed + table_window.mainloop() def create_menu(self, menu_name, options, menu_commands): """ @@ -657,26 +664,14 @@ def about(self): print("About this software") messagebox.showinfo("À propos", "ArduinoLogique v1.0\nSimulateur de circuits logiques") - def open_port(self): - """Handler for the 'Open Port' menu item.""" - try: - self.serial_conn = serial.Serial( - port=self.com_port, - baudrate=self.baud_rate, - timeout=self.timeout - ) - print(f"Port série {self.com_port} ouvert avec succès.") - except serial.SerialException as e: - print(f"Erreur lors de l'ouverture du port {self.com_port}: {e}") - def send_data(self, data): """ Send a string of data to the microcontroller through the serial port. """ - if self.serial_conn and self.serial_conn.is_open: + if self.serial_port.connection and self.serial_port.connection.is_open: try: # Convertir la chaîne en bytes et l'envoyer - self.serial_conn.write(data.encode('utf-8')) + self.serial_port.connection.write(data.encode('utf-8')) print(f"Données envoyées: {data}") except serial.SerialException as e: print(f"Erreur lors de l'envoi des données: {e}") @@ -685,15 +680,15 @@ def send_data(self, data): def close_port(self): """Upload the script to the microcontroller through the serial port.""" - if self.serial_conn and self.serial_conn.is_open: - self.serial_conn.close() - print(f"Port série {self.com_port} fermé.") + if self.serial_port.connection and self.serial_port.connection.is_open: + self.serial_port.connection.close() + print(f"Port série {self.serial_port.com_port} fermé.") else: print("Le port série est déjà fermé.") def download_script(self): self.checkCircuit() - self.open_port() + self.serial_port.connect() self.send_data(self.script) self.close_port() @@ -709,42 +704,42 @@ def is_linked_to(self, dest, src): def decodeFunc(self,inVar, funcName): if funcName == "NandGate": - s = f"!( {inVar[0]["val"]} " + s = f"!( {inVar[0]['val']} " for v in inVar[1:]: - s += f"& {v["val"]} " + s += f"& {v['val']} " s += ") " elif funcName == "AndGate": - s = f"( {inVar[0]["val"]} " + s = f"( {inVar[0]['val']} " for v in inVar[1:]: - s += f"& {v["val"]} " + s += f"& {v['val']} " s += ") " elif funcName == "NorGate": - s = f"! ( {inVar[0]["val"]} " + s = f"! ( {inVar[0]['val']} " for v in inVar[1:]: - s += f"| {v["val"]} " + s += f"| {v['val']} " s += ") " elif funcName == "OrGate": - s = f"( {inVar[0]["val"]} " + s = f"( {inVar[0]['val']} " for v in inVar[1:]: - s += f"| {v["val"]} " + s += f"| {v['val']} " s += ") " elif funcName == "NotGate": - s = f"! {inVar[0]["val"]} " + s = f"! {inVar[0]['val']} " elif funcName == "XorGate": - s = f"( {inVar[0]["val"]} " + s = f"( {inVar[0]['val']} " for v in inVar[1:]: - s += f"^ {v["val"]} " + s += f"^ {v['val']} " s += ") " elif funcName == "XnorGate": - s = f"! ( {inVar[0]["val"]} " + s = f"! ( {inVar[0]['val']} " for v in inVar[1:]: - s += f"| {v["val"]} " + s += f"| {v['val']} " s += ") " elif funcName == "Mux": e =["( ","( ","( ","( ","( ","( ","( ","( "] for v in range(8): v2, v1, v0 = (v & 1)^1, ((v & 2) >> 1)^1, ((v & 4) >> 2)^1 - e[v] += inVar[v]["val"] + " & " + inVar[11]["einv"] + " & " + \ + e[v] += inVar[v]['val'] + " & " + inVar[11]["einv"] + " & " + \ v0*" !" + inVar[8]["sel"] + " & " + v1*" !" + inVar[9]["sel"] + " & " + v2*" !" + inVar[10]["sel"] + " ) " s = " ( " + e[0] for et in e[1:]: @@ -754,16 +749,16 @@ def decodeFunc(self,inVar, funcName): s ="(" out = inVar[0]["numO"] v2, v1, v0 = (out & 1)^1, ((out & 2) >> 1)^1, ((out & 4) >> 2)^1 - s += v0*" !" + inVar[0]["val"] + " & " + v1*"!" + inVar[1]["val"] + " & " + v2*"!" + inVar[2]["val"] + \ + s += v0*" !" + inVar[0]['val'] + " & " + v1*"!" + inVar[1]['val'] + " & " + v2*"!" + inVar[2]['val'] + \ " & " + inVar[3]["einv"] + " & " + inVar[4]["einv"] + " & " + inVar[5]["enb"] s += " ) " elif funcName == "DFlipFlop": s ="(" - s += inVar[0]["val"] + " & CLK & " + inVar[3]["iset"] + " & " + inVar[2]["irst"] + " | !" + inVar[3]["iset"] + s += inVar[0]['val'] + " & CLK & " + inVar[3]["iset"] + " & " + inVar[2]["irst"] + " | !" + inVar[3]["iset"] s += " ) " elif funcName == "JKFlipFlop": s ="(" - s += inVar[0]["val"] + " & CLK & " + inVar[3]["iset"] + " & " + inVar[2]["irst"] + " | !" + inVar[3]["iset"] + s += inVar[0]['val'] + " & CLK & " + inVar[3]["iset"] + " & " + inVar[2]["irst"] + " | !" + inVar[3]["iset"] s += " ) " @@ -866,7 +861,7 @@ def checkCloseCircuit(self, ioOut, params={}): for n,inFunc in enumerate(inLst): findIn = False if self.is_linked_to(self.pwrP, inFunc) or self.is_linked_to(self.pwrM, inFunc): - constKey = "val" + constKey = 'val' pos, neg = "1", "0" for c in chipSel: if c == inFunc: @@ -906,7 +901,7 @@ def checkCloseCircuit(self, ioOut, params={}): for io_inZone in self.io_in: id, [zone] = io_inZone if self.is_linked_to(zone, inFunc): - constKey = "val" + constKey = 'val' for c in chipSel: if c == inFunc: constKey = "sel" @@ -947,7 +942,7 @@ def checkCloseCircuit(self, ioOut, params={}): for io_chipInZone in self.chip_in_wire: id, zone = io_chipInZone if self.is_linked_to(zone, inFunc): - constKey = "val" + constKey = 'val' for c in chipSel: if c == inFunc: constKey = "sel" @@ -982,7 +977,7 @@ def checkCloseCircuit(self, ioOut, params={}): #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] inFuncConst += [{constKey:f"I{n+1}", "num":n, "numO":no}] findIn = True - print("connecté à une ENTRÉE EXTERNE par cable") # ici ajouter n {"val":self.mcu_pin[f"I{id[4:]}"], "num":n} + print("connecté à une ENTRÉE EXTERNE par cable") # ici ajouter n {'val':self.mcu_pin[f"I{id[4:]}"], "num":n} break if not findIn: ## recherche d'une sortie de chip connectée à l'entrée actuelle de la chip @@ -1008,7 +1003,7 @@ def checkCloseCircuit(self, ioOut, params={}): if self.is_linked_to(pinZoneOut, pt): #outPrev = self.mcu_pin[f"O{id[4:]}"] outPrev = f"O{no+1}" - constKey = "val" + constKey = 'val' for c in chipSel: if c == inFunc: constKey = "sel" @@ -1027,7 +1022,7 @@ def checkCloseCircuit(self, ioOut, params={}): findNext = True if not isPinOut: findNext, s = self.checkCloseCircuit(outZone,params) - constKey = "val" + constKey = 'val' for c in chipSel: if c == inFunc: constKey = "sel" @@ -1053,7 +1048,7 @@ def checkCloseCircuit(self, ioOut, params={}): isPinOut = True #outPrev = self.mcu_pin[f"O{id[4:]}"] outPrev = f"O{no+1}" - constKey = "val" + constKey = 'val' for c in chipSel: if c == inFunc: constKey = "sel" @@ -1073,7 +1068,7 @@ def checkCloseCircuit(self, ioOut, params={}): for coc in self.chip_out_script: if coc[1] == outZone: exp = coc[0] - constKey = "val" + constKey = 'val' for c in chipSel: if c == inFunc: constKey = "sel" From ba29ac0ce559e4949c8224e3d103d30e0a47ad89 Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Thu, 5 Dec 2024 19:58:24 -0500 Subject: [PATCH 30/44] Moved zip --- bascule_essai_120.zip => Mc/bascule_essai_120.zip | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename bascule_essai_120.zip => Mc/bascule_essai_120.zip (100%) diff --git a/bascule_essai_120.zip b/Mc/bascule_essai_120.zip similarity index 100% rename from bascule_essai_120.zip rename to Mc/bascule_essai_120.zip From 363cea73b6b38928e5f2cac6a29f078a2389806a Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Thu, 5 Dec 2024 20:23:18 -0500 Subject: [PATCH 31/44] commit menu show correspondance --- menus.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/menus.py b/menus.py index 2cea3ae..b20a4b7 100644 --- a/menus.py +++ b/menus.py @@ -325,20 +325,20 @@ def show_correspondence_table(self, show=True): scrollbar = ttk.Scrollbar(table_window, orient="vertical", command=tree.yview) tree.configure(yscroll=scrollbar.set) scrollbar.pack(side="right", fill="y") - if clock_pin_ios: - clock_pin = pin_mappings["clock_pin"] - pin_number = clock_pin_ios[0]["id"].split("_")[-1] - tree.insert("", "end", values=(pin_number, "clk input", clock_pin)) - - # Add a scrollbar if the list gets too long - scrollbar = ttk.Scrollbar(table_window, orient="vertical", command=tree.yview) - tree.configure(yscroll=scrollbar.set) - scrollbar.pack(side="right", fill="y") - - # Show the table in the new window - table_window.transient(self.parent) # Set to be on top of the parent window - table_window.grab_set() # Prevent interaction with the main window until closed - table_window.mainloop() + if clock_pin_ios: + clock_pin = pin_mappings["clock_pin"] + pin_number = clock_pin_ios[0]["id"].split("_")[-1] + tree.insert("", "end", values=(pin_number, "clk input", clock_pin)) + + # Add a scrollbar if the list gets too long + scrollbar = ttk.Scrollbar(table_window, orient="vertical", command=tree.yview) + tree.configure(yscroll=scrollbar.set) + scrollbar.pack(side="right", fill="y") + + # Show the table in the new window + table_window.transient(self.parent) # Set to be on top of the parent window + table_window.grab_set() # Prevent interaction with the main window until closed + table_window.mainloop() def create_menu(self, menu_name, options, menu_commands): """ From 7712c8a29eead4d4d13fb318e19451c92bbc1772 Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Thu, 5 Dec 2024 20:28:10 -0500 Subject: [PATCH 32/44] Fix mac import --- menus.py | 2 +- sidebar.py | 4 ++-- toolbar.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/menus.py b/menus.py index b20a4b7..2aa11a7 100644 --- a/menus.py +++ b/menus.py @@ -31,7 +31,7 @@ CLOCK, ) -if os.name == "darwin": +if os.name == "posix" or os.name=="darwin": from tkinter import messagebox, filedialog, ttk from tkmacosx import Button # type: ignore else: diff --git a/sidebar.py b/sidebar.py index d332b31..9b5aa90 100644 --- a/sidebar.py +++ b/sidebar.py @@ -17,7 +17,7 @@ from dataCDLT import FREE, USED from object_model.circuit_object_model import Chip, get_all_available_chips, get_chip_modification_times -if os.name == "darwin": +if os.name == "posix" or os.name=="darwin": from tkinter import messagebox, font from tkmacosx import Button # type: ignore else: @@ -492,7 +492,7 @@ def manage_components(self): os.startfile(path) except AttributeError: pass - elif os.name == "posix": # For macOS and Linux # type: ignore + elif os.name == "posix" or os.name=="darwin": # For macOS and Linux # type: ignore with subprocess.Popen(["open", path] if sys.platform == "darwin" else ["xdg-open", path]): pass else: diff --git a/toolbar.py b/toolbar.py index d71f87d..aaa78c0 100644 --- a/toolbar.py +++ b/toolbar.py @@ -14,7 +14,7 @@ from dataCDLT import INPUT, OUTPUT, FREE, CLOCK from utils import resource_path -if os.name == "darwin": +if os.name == "posix" or os.name=="darwin": from tkinter import messagebox, colorchooser from tkmacosx import Button # type: ignore else: From f552936841418373a751d7fa434e73cb7c2cd222 Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Thu, 5 Dec 2024 20:38:18 -0500 Subject: [PATCH 33/44] Ignored more files --- .gitignore | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b37659d..b655d0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,11 @@ __pycache__/ .mypy_cache/ build/ -dist/ \ No newline at end of file +dist/ +*.DS_Store +*.tmp +*.temp +*.docx~ +~*.docx +*.docx.tmp +*.docx.temp From 44b9e25de63dd7f1274766d846506f7b1c940391 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Fri, 6 Dec 2024 02:09:37 -0500 Subject: [PATCH 34/44] =?UTF-8?q?JK=20109=20et=20112=20test=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- menus.py | 39 +++++++++++++++++++++------- object_model/circuit_object_model.py | 6 +++-- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/menus.py b/menus.py index 2aa11a7..6323735 100644 --- a/menus.py +++ b/menus.py @@ -138,7 +138,7 @@ def __init__( self.script = "" - self.selected_microcontroller = None + self.selected_microcontroller = "Arduino Mega" """The selected microcontroller.""" self.menu_bar = tk.Frame(parent, bg="#333333") @@ -178,7 +178,7 @@ def __init__( # Display selected microcontroller label self.microcontroller_label = tk.Label( self.menu_bar, - text="(Aucun microcontrôleur n'est choisi)", + text="(Aucun microcontrôleur n'est choisi)" if not self.selected_microcontroller else self.selected_microcontroller, bg="#333333", fg="white", font=("FiraCode-Bold", 12), @@ -757,12 +757,27 @@ def decodeFunc(self,inVar, funcName): s += inVar[0]['val'] + " & CLK & " + inVar[3]["iset"] + " & " + inVar[2]["irst"] + " | !" + inVar[3]["iset"] s += " ) " elif funcName == "JKFlipFlop": - s ="(" - s += inVar[0]['val'] + " & CLK & " + inVar[3]["iset"] + " & " + inVar[2]["irst"] + " | !" + inVar[3]["iset"] - s += " ) " + if inVar[4].get("iK"): + K = f"!{inVar[4]["iK"]}" + else: K = inVar[4]["K"] + if inVar[1].get("clk"): + CLK = f"{inVar[1]["clk"]} " + else: CLK = f"!{inVar[3]["iclk"]} " + if inVar[3].get("iset"): + iSet = f"{inVar[3]["iset"]}" + iRst = f"{inVar[2]["irst"]}" + else: + iSet = f"!{inVar[2]["iset"]}" + iRst = f"{inVar[1]["irst"]}" + sT =f"T{self.varTempNum} = " + sT += "((" + inVar[0]['J'] + f" & T{self.varTempNum}_precedant) | (!{K} & t{self.varTempNum}_precedant)) & !{iSet} & !{iRst} & CLK | !{iSet} " + sT += " ); " + s = inVar[0]["numO"]*" !" + f"T{self.varTempNum} " + self.varTempNum +=1 + self.varScript += [sT] - return s + return s def checkCloseCircuit(self, ioOut, params={}): #id, (c1,l1,c2,l2) = ioOut @@ -1137,6 +1152,8 @@ def checkCircuit(self): chip_in_j = [] chip_in_k = [] chip_in_inv_k = [] + self.varTempNum = 1 + self.varScript = [] self.show_correspondence_table(False) for id, component in self.current_dict_circuit.items(): @@ -1240,8 +1257,8 @@ def checkCircuit(self): for (n,numPin) in sum(ioInClockInv,[]) ] if ioInCLKInv: - chip_in_inv_clock += [(id, *ioInCLK)] - self.chip_in += [(id, *ioInCLK)] + chip_in_inv_clock += [(id, *ioInCLKInv)] + self.chip_in += [(id, *ioInCLKInv)] #### l' entrée Reset Inv ### ioInResetInv = component.get("inv_reset_pin", []) @@ -1507,10 +1524,14 @@ def checkCircuit(self): # "chip_in_address_pins":chip_in_address_pins} for no,ioOut in enumerate(self.io_out): #self.script += self.mcu_pin[f"O{ioOut[0][4:]}"] + " = " # f"O{no+1}" - self.script += f"O{no+1}" + " = " + circuitClose, script = self.checkCloseCircuit(ioOut,params) if circuitClose : print(f"le circuit est fermée sur la sortie {ioOut}") + for s in self.varScript: + self.script += s + self.varScript = [] + self.script += f"O{no+1}" + " = " self.script += f"{script}; " print(f"script temp : {self.script}") else: print(f"le circuit est ouvert sur la sortie {ioOut}") diff --git a/object_model/circuit_object_model.py b/object_model/circuit_object_model.py index 2fd9d6f..014781d 100644 --- a/object_model/circuit_object_model.py +++ b/object_model/circuit_object_model.py @@ -272,7 +272,9 @@ def to_generic_dict(self) -> dict[str, Any]: if self.functions: attr_dict["logicFunctionName"] = self.functions[0].__class__.__name__ attr_dict["io"] = [ - ([pin.pin_num for pin in func.input_pins], [pin.pin_num for pin in func.output_pins]) + ( [pin.pin_num for pin in func.input_pins], [pin.pin_num for pin in func.output_pins] + \ + [pin.pin_num for pin in func.inv_output_pins if func.inv_output_pins] + ) for func in self.functions #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) #if isinstance(func, LogicalFunction) or isinstance(func, Mux) or isinstance(func, Demux) or isinstance(func, DFlipFlop) @@ -336,7 +338,7 @@ def to_generic_dict(self) -> dict[str, Any]: if isinstance(func, JKFlipFlop) ] attr_dict["inv_k_input_pin"] = [ - [(n,pin.pin_num)for pin in func.inv_k_input_pin] + [(n,pin.pin_num)for pin in func.inv_k_input_pin if func.inv_k_input_pin[0] ] for n,func in enumerate(self.functions) if isinstance(func, JKFlipFlop) From fb833d9033f4819ca22834f0dd4816b3b3bf953a Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Fri, 6 Dec 2024 08:50:18 -0500 Subject: [PATCH 35/44] correction bug 112 --- menus.py | 14 ++++++++------ sidebar.py | 10 +++++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/menus.py b/menus.py index 6323735..bb06ca6 100644 --- a/menus.py +++ b/menus.py @@ -764,13 +764,15 @@ def decodeFunc(self,inVar, funcName): CLK = f"{inVar[1]["clk"]} " else: CLK = f"!{inVar[3]["iclk"]} " if inVar[3].get("iset"): - iSet = f"{inVar[3]["iset"]}" - iRst = f"{inVar[2]["irst"]}" + set = f"!{inVar[3]["iset"]}" + iset = f"{inVar[3]["iset"]}" + rst = f"!{inVar[2]["irst"]}" else: - iSet = f"!{inVar[2]["iset"]}" - iRst = f"{inVar[1]["irst"]}" + set = f"!{inVar[2]["iset"]}" + iset = f"{inVar[2]["iset"]}" + rst = f"!{inVar[1]["irst"]}" sT =f"T{self.varTempNum} = " - sT += "((" + inVar[0]['J'] + f" & T{self.varTempNum}_precedant) | (!{K} & t{self.varTempNum}_precedant)) & !{iSet} & !{iRst} & CLK | !{iSet} " + sT += "((" + inVar[0]['J'] + f" & !T{self.varTempNum}_precedant) | (!{K} & T{self.varTempNum}_precedant)) & {set} & {rst} & CLK | {iset} " sT += " ); " s = inVar[0]["numO"]*" !" + f"T{self.varTempNum} " self.varTempNum +=1 @@ -1320,7 +1322,7 @@ def checkCircuit(self): elif id[:4] == "_io_": # [(col1, line1,col2,line2), ...] (col, line) = component["coord"][0][0], component["coord"][0][1] ioZone = deepcopy(self.board.sketcher.matrix[f"{col},{line}"]["link"]) - if component["type"] == INPUT: + if component["type"] == INPUT or component["type"] == CLOCK: self.io_in += [(id, [ioZone])] else: self.io_out += [(id, [ioZone])] diff --git a/sidebar.py b/sidebar.py index 9b5aa90..b6bcd00 100644 --- a/sidebar.py +++ b/sidebar.py @@ -17,11 +17,11 @@ from dataCDLT import FREE, USED from object_model.circuit_object_model import Chip, get_all_available_chips, get_chip_modification_times -if os.name == "posix" or os.name=="darwin": - from tkinter import messagebox, font - from tkmacosx import Button # type: ignore -else: - from tkinter import Button, messagebox, font +# if os.name == "posix" or os.name=="darwin": +# from tkinter import messagebox, font +# from tkmacosx import Button # type: ignore +# else: +from tkinter import Button, messagebox, font @dataclass From d08169e59a8d59288b3fe7465a7b91964d327255 Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Sun, 8 Dec 2024 17:28:53 -0500 Subject: [PATCH 36/44] fix quotes --- menus.py | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/menus.py b/menus.py index bb06ca6..ba439f3 100644 --- a/menus.py +++ b/menus.py @@ -754,23 +754,23 @@ def decodeFunc(self,inVar, funcName): s += " ) " elif funcName == "DFlipFlop": s ="(" - s += inVar[0]['val'] + " & CLK & " + inVar[3]["iset"] + " & " + inVar[2]["irst"] + " | !" + inVar[3]["iset"] + s += inVar[0]['val'] + " & CLK & " + inVar[3]['iset'] + " & " + inVar[2]['irst'] + " | !" + inVar[3]['iset'] s += " ) " elif funcName == "JKFlipFlop": - if inVar[4].get("iK"): - K = f"!{inVar[4]["iK"]}" + if inVar[4].get('iK'): + K = f"!{inVar[4]['iK']}" else: K = inVar[4]["K"] - if inVar[1].get("clk"): - CLK = f"{inVar[1]["clk"]} " - else: CLK = f"!{inVar[3]["iclk"]} " - if inVar[3].get("iset"): - set = f"!{inVar[3]["iset"]}" - iset = f"{inVar[3]["iset"]}" - rst = f"!{inVar[2]["irst"]}" + if inVar[1].get('clk'): + CLK = f"{inVar[1]['clk']} " + else: CLK = f"!{inVar[3]['iclk']} " + if inVar[3].get('iset'): + set = f"!{inVar[3]['iset']}" + iset = f"{inVar[3]['iset']}" + rst = f"!{inVar[2]['irst']}" else: - set = f"!{inVar[2]["iset"]}" - iset = f"{inVar[2]["iset"]}" - rst = f"!{inVar[1]["irst"]}" + set = f"!{inVar[2]['iset']}" + iset = f"{inVar[2]['iset']}" + rst = f"!{inVar[1]['irst']}" sT =f"T{self.varTempNum} = " sT += "((" + inVar[0]['J'] + f" & !T{self.varTempNum}_precedant) | (!{K} & T{self.varTempNum}_precedant)) & {set} & {rst} & CLK | {iset} " sT += " ); " @@ -892,14 +892,14 @@ def checkCloseCircuit(self, ioOut, params={}): constKey = "enb" for c in chipInInvReset: if c == inFunc: - constKey = "irst" + constKey = 'irst' for c in chipInInvSet: if c == inFunc: - constKey = "iset" + constKey = 'iset' for c in chipInInvClk: if c == inFunc: - constKey = "iclk" + constKey = 'iclk' for c in chipInJ: if c == inFunc: constKey = "J" @@ -908,7 +908,7 @@ def checkCloseCircuit(self, ioOut, params={}): constKey = "K" for c in chipInInvK: if c == inFunc: - constKey = "iK" + constKey = 'iK' if self.is_linked_to(self.pwrP, inFunc): inFuncConst += [{constKey:pos, "num":n, "numO":no}] else: inFuncConst += [{constKey:neg, "num":n, "numO":no}] @@ -930,17 +930,17 @@ def checkCloseCircuit(self, ioOut, params={}): constKey = "enb" for c in chipInInvReset: if c == inFunc: - constKey = "irst" + constKey = 'irst' for c in chipInInvSet: if c == inFunc: - constKey = "iset" + constKey = 'iset' for c in chipInClock: if c == inFunc: - constKey = "clk" + constKey = 'clk' for c in chipInInvClk: if c == inFunc: - constKey = "iclk" + constKey = 'iclk' for c in chipInJ: if c == inFunc: constKey = "J" @@ -949,7 +949,7 @@ def checkCloseCircuit(self, ioOut, params={}): constKey = "K" for c in chipInInvK: if c == inFunc: - constKey = "iK" + constKey = 'iK' #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n inFuncConst += [{constKey:f"I{n+1}", "num":n, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n findIn = True @@ -971,17 +971,17 @@ def checkCloseCircuit(self, ioOut, params={}): constKey = "enb" for c in chipInInvReset: if c == inFunc: - constKey = "irst" + constKey = 'irst' for c in chipInInvSet: if c == inFunc: - constKey = "iset" + constKey = 'iset' for c in chipInClock: if c == inFunc: - constKey = "clk" + constKey = 'clk' for c in chipInInvClk: if c == inFunc: - constKey = "iclk" + constKey = 'iclk' for c in chipInJ: if c == inFunc: constKey = "J" @@ -990,7 +990,7 @@ def checkCloseCircuit(self, ioOut, params={}): constKey = "K" for c in chipInInvK: if c == inFunc: - constKey = "iK" + constKey = 'iK' #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] inFuncConst += [{constKey:f"I{n+1}", "num":n, "numO":no}] findIn = True From 440f307220d7e8cee326822c7b19aae1ff53e191 Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Sun, 8 Dec 2024 17:36:37 -0500 Subject: [PATCH 37/44] fix os selection --- arduino_logique.py | 3 ++- menus.py | 2 +- sidebar.py | 11 ++++++----- toolbar.py | 3 ++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/arduino_logique.py b/arduino_logique.py index f3184a7..f9c2532 100644 --- a/arduino_logique.py +++ b/arduino_logique.py @@ -5,6 +5,7 @@ draw a breadboard, etc. """ import os +import platform from pathlib import Path import tkinter as tk from breadboard import Breadboard @@ -14,7 +15,7 @@ from toolbar import Toolbar from utils import resource_path -if os.name == "darwin" or os.name == "posix": +if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower(): from tkinter import font from tkmacosx import Button # type: ignore else: diff --git a/menus.py b/menus.py index d0350ec..2885b04 100644 --- a/menus.py +++ b/menus.py @@ -31,7 +31,7 @@ CLOCK, ) -if os.name == "posix" or os.name=="darwin": +if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower(): from tkinter import messagebox, filedialog, ttk from tkmacosx import Button # type: ignore else: diff --git a/sidebar.py b/sidebar.py index 5bf0012..745cdd7 100644 --- a/sidebar.py +++ b/sidebar.py @@ -8,6 +8,7 @@ from pathlib import Path import tkinter as tk import os +import platform from typing import Callable, Tuple import subprocess import sys @@ -17,11 +18,11 @@ from dataCDLT import FREE, USED from object_model.circuit_object_model import Chip, get_all_available_chips, get_chip_modification_times -# if os.name == "posix" or os.name=="darwin": -# from tkinter import messagebox, font -# from tkmacosx import Button # type: ignore -# else: -from tkinter import Button, messagebox, font +if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower(): + from tkinter import messagebox, font + from tkmacosx import Button # type: ignore +else: + from tkinter import Button, messagebox, font @dataclass diff --git a/toolbar.py b/toolbar.py index 6538bee..5786768 100644 --- a/toolbar.py +++ b/toolbar.py @@ -8,6 +8,7 @@ import os from dataclasses import dataclass from pathlib import Path +import platform import tkinter as tk from idlelib.tooltip import Hovertip # type: ignore @@ -15,7 +16,7 @@ from dataCDLT import INPUT, OUTPUT, FREE, CLOCK from utils import resource_path -if os.name == "posix" or os.name=="darwin": +if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower(): from tkinter import messagebox, colorchooser from tkmacosx import Button # type: ignore else: From 8c34cf1b9b4ef009f3b3cde102e9c837d4c2e31a Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Tue, 10 Dec 2024 23:02:47 -0500 Subject: [PATCH 38/44] =?UTF-8?q?CB163=20test=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 2 +- Components/Chips/Sequential/74HC163.json | 6 +- component_sketch.py | 11 ++ menus.py | 196 +++++++++++++++++++++-- object_model/circuit_object_model.py | 36 ++++- requirements.txt | 1 - 6 files changed, 227 insertions(+), 25 deletions(-) delete mode 100644 requirements.txt diff --git a/.vscode/launch.json b/.vscode/launch.json index 1fd8427..fed746c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,7 +2,7 @@ "configurations": [ { "name": "ArduinoLogique", - "type": "debugpy", + "type": "python", "request": "launch", "program": "${workspaceFolder}/arduino_logique.py", "console": "integratedTerminal" diff --git a/Components/Chips/Sequential/74HC163.json b/Components/Chips/Sequential/74HC163.json index e6ec881..49fbeb5 100644 --- a/Components/Chips/Sequential/74HC163.json +++ b/Components/Chips/Sequential/74HC163.json @@ -7,16 +7,16 @@ "functions": [ { "func_type": "BINARY_COUNTER", - "clock_pin": 2, + "clock_pin": 2, "clock_type": "RISING_EDGE", "reset_pin": null, "inv_reset_pin": 1, - "count_enable_pin": 10, + "count_enable_pin": 7, "inv_count_enable_pin": null, "load_enable_pin": null, "inv_load_enable_pin": 9, "up_down_input_pin": null, - "inv_up_down_input_pin": 5, + "inv_up_down_input_pin": 10, "terminal_count_pin": 15, "ripple_clock_output_pin": null, "data_pins": [3, 4, 5, 6], diff --git a/component_sketch.py b/component_sketch.py index ff6372e..c1bae70 100644 --- a/component_sketch.py +++ b/component_sketch.py @@ -2036,6 +2036,11 @@ def draw_chip(self, x_distance, y_distance, scale=1, width=-1, direction=HORIZON dim["j_input_pin"] = kwargs.get("j_input_pin", None) dim["inv_k_input_pin"] = kwargs.get("inv_k_input_pin", None) dim["k_input_pin"] = kwargs.get("k_input_pin", None) + + dim["count_enable_pin"] = kwargs.get("count_enable_pin", None) + dim["inv_load_enable_pin"] = kwargs.get("inv_load_enable_pin", None) + dim["inv_up_down_input_pin"] = kwargs.get("inv_up_down_input_pin", None) + dim["terminal_count_pin"] = kwargs.get("terminal_count_pin", None) dim["pwr"] = kwargs.get("pwr", None) logic_function_name = kwargs.get("logicFunctionName", None) @@ -2096,6 +2101,12 @@ def draw_chip(self, x_distance, y_distance, scale=1, width=-1, direction=HORIZON params["j_input_pin"] = dim["j_input_pin"] params["inv_k_input_pin"] = dim["inv_k_input_pin"] params["k_input_pin"] = dim["k_input_pin"] + + params["count_enable_pin"] = dim["count_enable_pin"] + params["inv_load_enable_pin"] = dim["inv_load_enable_pin"] + params["inv_up_down_input_pin"] = dim["inv_up_down_input_pin"] + params["terminal_count_pin"] = dim["terminal_count_pin"] + num_pins_per_side = dim["pinCount"] // 2 tag_base = "base" + chip_id tag_menu = "menu" + chip_id diff --git a/menus.py b/menus.py index 2885b04..6428216 100644 --- a/menus.py +++ b/menus.py @@ -715,6 +715,7 @@ def is_linked_to(self, dest, src): return res def decodeFunc(self,inVar, funcName): + s ="" if funcName == "NandGate": s = f"!( {inVar[0]['val']} " for v in inVar[1:]: @@ -789,7 +790,36 @@ def decodeFunc(self,inVar, funcName): s = inVar[0]["numO"]*" !" + f"T{self.varTempNum} " self.varTempNum +=1 self.varScript += [sT] - + elif funcName == "BinaryCounter": + if inVar[0]["numO"] == 0: + self.numTemp = [] + CE = inVar[6]["CE"] + iU = inVar[8]["iU"] + iL = inVar[7]["iL"] + D0 = inVar[0]["val"] + D1 = inVar[1]["val"] + D2 = inVar[0]["val"] + D3 = inVar[0]["val"] + sT = f"T{self.varTempNum} = {CE} & {iL} & !T{self.varTempNum}_precedant + !{iL} & {D0} + !{CE} & {iL} & T{self.varTempNum}_precedant; " + self.numTemp += [self.varTempNum] + self.varTempNum +=1 + self.varScript += [sT] + sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-1}_precedant | !T{self.varTempNum}_precedant) & " \ + + f"({CE} & T{self.varTempNum - 1}_precedant + T{self.varTempNum}_precedant ) & {iL} + !{iL} & {D1} + !{CE} & {iL} & T{self.varTempNum}_precedant; " + self.numTemp += [self.varTempNum] + self.varTempNum +=1 + self.varScript += [sT] + sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-2}_precedant | !T{self.varTempNum-1}_precedant | !T{self.varTempNum}_precedant) & " \ + + f"({CE} & T{self.varTempNum - 2}_precedant & T{self.varTempNum - 1}_precedant + T{self.varTempNum}_precedant ) & {iL} + !{iL} & {D2} + !{CE} & {iL} & T{self.varTempNum}_precedant; " + self.numTemp += [self.varTempNum] + self.varTempNum +=1 + self.varScript += [sT] + sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-3}_precedant | !T{self.varTempNum-2}_precedant | !T{self.varTempNum-1}_precedant | !T{self.varTempNum}_precedant) & " \ + + f"({CE} & T{self.varTempNum - 3}_precedant & T{self.varTempNum - 2}_precedant & T{self.varTempNum - 1}_precedant + T{self.varTempNum}_precedant ) & {iL} + !{iL} & {D3} + !{CE} & {iL} & T{self.varTempNum}_precedant; " + self.numTemp += [self.varTempNum] + self.varTempNum +=1 + self.varScript += [sT] + s = f"T{self.numTemp[inVar[0]["numO"]]} " return s @@ -808,6 +838,12 @@ def checkCloseCircuit(self, ioOut, params={}): chip_in_j = params.get("chip_in_j", []) chip_in_k = params.get("chip_in_k", []) chip_in_inv_k = params.get("chip_in_inv_k", []) + + chip_in_ce = params.get("count_enable_pin", []) + chip_in_inv_L = params.get("inv_load_enable_pin", []) + chip_in_inv_U = params.get("inv_up_down_input_pin", []) + chip_out_TC = params.get("terminal_count_pin", []) + findOut = False circuitClose = True script = "" @@ -872,14 +908,38 @@ def checkCloseCircuit(self, ioOut, params={}): chipInInvK = [(c1,l1) for (c1,l1,nfunc) in chipInInvK if nfunc == nf] else: chipInInvK = [] + if chip_in_ce: + chipInCE = chip_in_ce + [chipInCE] = [list(chipICE[1:]) for chipICE in chipInCE if chipICE[0] == idOut] + chipInCE = [(c1,l1) for (c1,l1,nfunc) in chipInCE if nfunc == nf] + else: chipInCE = [] + + if chip_in_inv_L: + chipInInvL = chip_in_inv_L + [chipInInvL] = [list(chipIIL[1:]) for chipIIL in chipInInvL if chipIIL[0] == idOut] + chipInInvL = [(c1,l1) for (c1,l1,nfunc) in chipInInvL if nfunc == nf] + else: chipInInvL = [] + + if chip_in_inv_U: + chipInInvU = chip_in_inv_U + [chipInInvU] = [list(chipIIU[1:]) for chipIIU in chipInInvU if chipIIU[0] == idOut] + chipInInvU = [(c1,l1) for (c1,l1,nfunc) in chipInInvU if nfunc == nf] + else: chipInInvU = [] + + if chip_out_TC: + chipOutTC = chip_out_TC + [chipOutTC] = [list(chipOTC[1:]) for chipOTC in chipOutTC if chipOTC[0] == idOut] + chipOutTC = [(c1,l1) for (c1,l1,nfunc) in chipOutTC if nfunc == nf] + else: chipOutTC = [] + if chip_out_inv: chipOutInv = chip_out_inv [chipOutInv] = [list(chipOI[1:]) for chipOI in chipOutInv if chipOI[0] == idOut] else: chipOutInv = [] inLst += chipSel + chipEnInv + chipEn + chipInClock + chipInInvReset + chipInInvSet + \ - chipInInvClk + chipInK + chipInInvK - outLst += chipOutInv + chipInInvClk + chipInK + chipInInvK + chipInCE + chipInInvL + chipInInvU + outLst += chipOutInv + chipOutTC for no,out in enumerate(outLst): #if out not in chip_out_checked: if self.is_linked_to(ioZone, out): @@ -920,7 +980,19 @@ def checkCloseCircuit(self, ioOut, params={}): constKey = "K" for c in chipInInvK: if c == inFunc: - constKey = 'iK' + constKey = "iK" + + for c in chipInCE: + if c == inFunc: + constKey = "CE" + for c in chipInInvL: + if c == inFunc: + constKey = "iL" + for c in chipInInvU: + if c == inFunc: + constKey = "iU" + + if self.is_linked_to(self.pwrP, inFunc): inFuncConst += [{constKey:pos, "num":n, "numO":no}] else: inFuncConst += [{constKey:neg, "num":n, "numO":no}] @@ -961,7 +1033,18 @@ def checkCloseCircuit(self, ioOut, params={}): constKey = "K" for c in chipInInvK: if c == inFunc: - constKey = 'iK' + constKey = "iK" + + for c in chipInCE: + if c == inFunc: + constKey = "CE" + for c in chipInInvL: + if c == inFunc: + constKey = "iL" + for c in chipInInvU: + if c == inFunc: + constKey = "iU" + #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n inFuncConst += [{constKey:f"I{n+1}", "num":n, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n findIn = True @@ -1002,7 +1085,18 @@ def checkCloseCircuit(self, ioOut, params={}): constKey = "K" for c in chipInInvK: if c == inFunc: - constKey = 'iK' + constKey = "iK" + + for c in chipInCE: + if c == inFunc: + constKey = "CE" + for c in chipInInvL: + if c == inFunc: + constKey = "iL" + for c in chipInInvU: + if c == inFunc: + constKey = "iU" + #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] inFuncConst += [{constKey:f"I{n+1}", "num":n, "numO":no}] findIn = True @@ -1042,7 +1136,11 @@ def checkCloseCircuit(self, ioOut, params={}): for c in chipEn: if c == inFunc: constKey = "enb" - + + for c in chipOutTC: + if c == inFunc: + constKey = "TC" + for c in chipOutInv: if c == pt: outPrev = "!" + outPrev @@ -1061,7 +1159,11 @@ def checkCloseCircuit(self, ioOut, params={}): for c in chipEn: if c == inFunc: constKey = "enb" - + + for c in chipOutTC: + if c == inFunc: + constKey = "TC" + for c in chipOutInv: if c == pt: s = "!" + s @@ -1087,7 +1189,11 @@ def checkCloseCircuit(self, ioOut, params={}): for c in chipEn: if c == inFunc: constKey = "enb" - + + for c in chipOutTC: + if c == inFunc: + constKey = "TC" + for c in chipOutInv: if c == pt: outPrev = "!" + outPrev @@ -1107,7 +1213,11 @@ def checkCloseCircuit(self, ioOut, params={}): for c in chipEn: if c == inFunc: constKey = "enb" - + + for c in chipOutTC: + if c == inFunc: + constKey = "TC" + for c in chipOutInv: if c == pt: exp = "!" + exp @@ -1166,6 +1276,12 @@ def checkCircuit(self): chip_in_j = [] chip_in_k = [] chip_in_inv_k = [] + + chip_in_ce = [] + chip_in_inv_L = [] + chip_in_inv_U = [] + chip_out_TC = [] + self.varTempNum = 1 self.varScript = [] @@ -1328,6 +1444,50 @@ def checkCircuit(self): if ioIK: chip_in_k += [(id, *ioIK)] self.chip_in += [(id, *ioIK)] + + #### l' entrée CE ### + ioInCE = component.get("count_enable_pin", []) + if ioInCE: + ioICE = [ + (col + numPin - 1 if numPin <= numPinBR else col + (numPinBR - (numPin % numPinBR) ), line + 1 - (numPin // numPinBR),n) + for (n,numPin) in sum(ioInCE, []) + ] + if ioICE: + chip_in_ce += [(id, *ioICE)] + self.chip_in += [(id, *ioICE)] + + #### l' entrée L ### + ioInInvL = component.get("inv_load_enable_pin", []) + if ioInInvL: + ioIIL = [ + (col + numPin - 1 if numPin <= numPinBR else col + (numPinBR - (numPin % numPinBR) ), line + 1 - (numPin // numPinBR),n) + for (n,numPin) in sum(ioInInvL, []) + ] + if ioIIL: + chip_in_inv_L += [(id, *ioIIL)] + self.chip_in += [(id, *ioIIL)] + + #### l' entrée U ### + ioInInvU = component.get("inv_up_down_input_pin", []) + if ioInInvU: + ioIIU = [ + (col + numPin - 1 if numPin <= numPinBR else col + (numPinBR - (numPin % numPinBR) ), line + 1 - (numPin // numPinBR),n) + for (n,numPin) in sum(ioInInvU, []) + ] + if ioIIU: + chip_in_inv_U += [(id, *ioIIU)] + self.chip_in += [(id, *ioIIU)] + + #### l' entrée TC ### + ioOutTC = component.get("terminal_count_pin", []) + if ioOutTC: + ioOTC = [ + (col + numPin - 1 if numPin <= numPinBR else col + (numPinBR - (numPin % numPinBR) ), line + 1 - (numPin // numPinBR),n) + for (n,numPin) in sum(ioOutTC, []) + ] + if ioOTC: + chip_out_TC += [(id, *ioOTC)] + self.chip_out += [(id, *ioOTC)] elif id[:6] == "_wire_": # [(col1, line1,col2,line2), ...] self.wire += [(id, *component["coord"][0])] @@ -1426,7 +1586,7 @@ def checkCircuit(self): for chipAllio in self.chip_out: id = chipAllio[0] for chipio in chipAllio[1:]: - (c1,l1) = chipio + c1,l1, *n = chipio if self.is_linked_to(self.pwrM, (c1, l1)): self.chip_ioCC += [(id, chipio)] elif self.is_linked_to(self.pwrP, (c1, l1)): @@ -1475,7 +1635,7 @@ def checkCircuit(self): id = chipAllio[0] inChipOutWire = False for chipio in chipAllio[1:]: - (c1,l1) = chipio + (c1,l1, *n) = chipio for cow in self.chip_out_wire: if self.is_linked_to(cow, (c1, l1)): inChipOutWire = True @@ -1534,9 +1694,17 @@ def checkCircuit(self): "chip_in_j" : chip_in_j, "chip_in_k" : chip_in_k, "chip_in_inv_k" : chip_in_inv_k, - } + "count_enable_pin" : chip_in_ce, + "inv_load_enable_pin" : chip_in_inv_L , + "inv_up_down_input_pin" : chip_in_inv_U , + "terminal_count_pin" : chip_out_TC , + } + def io_position(io): + id,[[p]] = io + return p[0] + # "chip_in_address_pins":chip_in_address_pins} - for no,ioOut in enumerate(self.io_out): + for no,ioOut in enumerate(sorted(self.io_out, key=lambda io: io_position(io))): #self.script += self.mcu_pin[f"O{ioOut[0][4:]}"] + " = " # f"O{no+1}" circuitClose, script = self.checkCloseCircuit(ioOut,params) diff --git a/object_model/circuit_object_model.py b/object_model/circuit_object_model.py index 014781d..3bd82f8 100644 --- a/object_model/circuit_object_model.py +++ b/object_model/circuit_object_model.py @@ -273,7 +273,7 @@ def to_generic_dict(self) -> dict[str, Any]: attr_dict["logicFunctionName"] = self.functions[0].__class__.__name__ attr_dict["io"] = [ ( [pin.pin_num for pin in func.input_pins], [pin.pin_num for pin in func.output_pins] + \ - [pin.pin_num for pin in func.inv_output_pins if func.inv_output_pins] + [pin.pin_num for pin in getattr(func, 'inv_output_pins', [])] ) for func in self.functions #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) @@ -307,14 +307,14 @@ def to_generic_dict(self) -> dict[str, Any]: ] attr_dict["clock_pin"] = [ [(n,pin.pin_num) for pin in func.clock_pin] - for n,func in enumerate(self.functions) if func.clock_type != "FALLING_EDGE" + for n,func in enumerate(self.functions) if getattr(func,"clock_type", "") == "RISING_EDGE" #self.functions.clock_pin #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) - if isinstance(func, DFlipFlop) or isinstance(func, JKFlipFlop) + if isinstance(func, DFlipFlop) or isinstance(func, JKFlipFlop) or isinstance(func, BinaryCounter) ] attr_dict["inv_clock_pin"] = [ [(n,pin.pin_num) for pin in func.clock_pin] - for n,func in enumerate(self.functions) if func.clock_type == "FALLING_EDGE" + for n,func in enumerate(self.functions) if getattr(func,"clock_type", "") == "FALLING_EDGE" #self.functions.clock_pin #if isinstance(func, LogicalFunction) and not isinstance(func, Mux) and not isinstance(func, Demux) if isinstance(func, JKFlipFlop) @@ -323,7 +323,7 @@ def to_generic_dict(self) -> dict[str, Any]: [(n,pin.pin_num) for pin in func.inv_reset_pin] for n,func in enumerate(self.functions) - if isinstance(func, DFlipFlop) or isinstance(func, JKFlipFlop) + if isinstance(func, DFlipFlop) or isinstance(func, JKFlipFlop) or isinstance(func, BinaryCounter) ] attr_dict["inv_set_pin"] = [ [(n,pin.pin_num)for pin in func.inv_set_pin] @@ -348,7 +348,31 @@ def to_generic_dict(self) -> dict[str, Any]: for n,func in enumerate(self.functions) if isinstance(func, JKFlipFlop) - ] + ] + attr_dict["count_enable_pin"] = [ + [(n,pin.pin_num)for pin in func.count_enable_pin if pin] + for n,func in enumerate(self.functions) + + if isinstance(func, BinaryCounter) + ] + attr_dict["inv_load_enable_pin"] = [ + [(n,pin.pin_num)for pin in func.inv_load_enable_pin if pin] + for n,func in enumerate(self.functions) + + if isinstance(func, BinaryCounter) + ] + attr_dict["inv_up_down_input_pin"] = [ + [(n,pin.pin_num)for pin in func.inv_up_down_input_pin if pin] + for n,func in enumerate(self.functions) + + if isinstance(func, BinaryCounter) + ] + attr_dict["terminal_count_pin"] = [ + [(n,pin.pin_num)for pin in func.terminal_count_pin if pin] + for n,func in enumerate(self.functions) + + if isinstance(func, BinaryCounter) + ] # return attr_dict def __str__(self): diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index d0dfd58..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pyserial==3.5 From 40085ee825182c60f14175701f450ead31237732 Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Wed, 11 Dec 2024 09:14:55 -0500 Subject: [PATCH 39/44] fix chips in sidebar --- menus.py | 28 ++++++++++++++-------------- sidebar.py | 6 +----- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/menus.py b/menus.py index 6428216..1279c9f 100644 --- a/menus.py +++ b/menus.py @@ -760,7 +760,7 @@ def decodeFunc(self,inVar, funcName): s += " ) " elif funcName == "Demux": s ="(" - out = inVar[0]["numO"] + out = inVar[0]['numO'] v2, v1, v0 = (out & 1)^1, ((out & 2) >> 1)^1, ((out & 4) >> 2)^1 s += v0*" !" + inVar[0]['val'] + " & " + v1*"!" + inVar[1]['val'] + " & " + v2*"!" + inVar[2]['val'] + \ " & " + inVar[3]["einv"] + " & " + inVar[4]["einv"] + " & " + inVar[5]["enb"] @@ -787,11 +787,11 @@ def decodeFunc(self,inVar, funcName): sT =f"T{self.varTempNum} = " sT += "((" + inVar[0]['J'] + f" & !T{self.varTempNum}_precedant) | (!{K} & T{self.varTempNum}_precedant)) & {set} & {rst} & CLK | {iset} " sT += " ); " - s = inVar[0]["numO"]*" !" + f"T{self.varTempNum} " + s = inVar[0]['numO']*" !" + f"T{self.varTempNum} " self.varTempNum +=1 self.varScript += [sT] elif funcName == "BinaryCounter": - if inVar[0]["numO"] == 0: + if inVar[0]['numO'] == 0: self.numTemp = [] CE = inVar[6]["CE"] iU = inVar[8]["iU"] @@ -819,7 +819,7 @@ def decodeFunc(self,inVar, funcName): self.numTemp += [self.varTempNum] self.varTempNum +=1 self.varScript += [sT] - s = f"T{self.numTemp[inVar[0]["numO"]]} " + s = f"T{self.numTemp[inVar[0]['numO']]} " return s @@ -994,8 +994,8 @@ def checkCloseCircuit(self, ioOut, params={}): if self.is_linked_to(self.pwrP, inFunc): - inFuncConst += [{constKey:pos, "num":n, "numO":no}] - else: inFuncConst += [{constKey:neg, "num":n, "numO":no}] + inFuncConst += [{constKey:pos, "num":n, 'numO':no}] + else: inFuncConst += [{constKey:neg, "num":n, 'numO':no}] findIn = True print("connecté à pwr") if not findIn: @@ -1045,8 +1045,8 @@ def checkCloseCircuit(self, ioOut, params={}): if c == inFunc: constKey = "iU" - #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n - inFuncConst += [{constKey:f"I{n+1}", "num":n, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n + #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, 'numO':no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n + inFuncConst += [{constKey:f"I{n+1}", "num":n, 'numO':no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n findIn = True print("connecté à une ENTRÉE EXTERNE") break @@ -1097,8 +1097,8 @@ def checkCloseCircuit(self, ioOut, params={}): if c == inFunc: constKey = "iU" - #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] - inFuncConst += [{constKey:f"I{n+1}", "num":n, "numO":no}] + #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, 'numO':no}] + inFuncConst += [{constKey:f"I{n+1}", "num":n, 'numO':no}] findIn = True print("connecté à une ENTRÉE EXTERNE par cable") # ici ajouter n {'val':self.mcu_pin[f"I{id[4:]}"], "num":n} break @@ -1145,7 +1145,7 @@ def checkCloseCircuit(self, ioOut, params={}): if c == pt: outPrev = "!" + outPrev isPinOut = True - inFuncConst += [{constKey:outPrev, "num":n, "numO":no}] # [self.mcu_pin[f"O{id[4:]}"]] + inFuncConst += [{constKey:outPrev, "num":n, 'numO':no}] # [self.mcu_pin[f"O{id[4:]}"]] findNext = True if not isPinOut: findNext, s = self.checkCloseCircuit(outZone,params) @@ -1168,7 +1168,7 @@ def checkCloseCircuit(self, ioOut, params={}): if c == pt: s = "!" + s - inFuncConst += [{constKey:s, "num":n, "numO":no}] + inFuncConst += [{constKey:s, "num":n, 'numO':no}] self.chip_out_script += [(s,outZone)] else: # il faut voir si une sortie io n'existe pas sinon var temp @@ -1198,7 +1198,7 @@ def checkCloseCircuit(self, ioOut, params={}): if c == pt: outPrev = "!" + outPrev - inFuncConst += [{constKey:outPrev, "num":n, "numO":no}] + inFuncConst += [{constKey:outPrev, "num":n, 'numO':no}] if not isPinOut: for coc in self.chip_out_script: if coc[1] == outZone: @@ -1222,7 +1222,7 @@ def checkCloseCircuit(self, ioOut, params={}): if c == pt: exp = "!" + exp - inFuncConst += [{constKey:exp, "num":n, "numO":no}] + inFuncConst += [{constKey:exp, "num":n, 'numO':no}] break findNext = True break diff --git a/sidebar.py b/sidebar.py index 745cdd7..5da5934 100644 --- a/sidebar.py +++ b/sidebar.py @@ -18,11 +18,7 @@ from dataCDLT import FREE, USED from object_model.circuit_object_model import Chip, get_all_available_chips, get_chip_modification_times -if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower(): - from tkinter import messagebox, font - from tkmacosx import Button # type: ignore -else: - from tkinter import Button, messagebox, font +from tkinter import Button, messagebox, font @dataclass From 1636d9836c553ea38738ef67bcbb1f513414831c Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Thu, 12 Dec 2024 06:40:10 -0500 Subject: [PATCH 40/44] correction bug lab 1 et 3 --- menus.py | 87 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 26 deletions(-) diff --git a/menus.py b/menus.py index 6428216..2b67500 100644 --- a/menus.py +++ b/menus.py @@ -800,22 +800,22 @@ def decodeFunc(self,inVar, funcName): D1 = inVar[1]["val"] D2 = inVar[0]["val"] D3 = inVar[0]["val"] - sT = f"T{self.varTempNum} = {CE} & {iL} & !T{self.varTempNum}_precedant + !{iL} & {D0} + !{CE} & {iL} & T{self.varTempNum}_precedant; " + sT = f"T{self.varTempNum} = clk & {CE} & {iL} & !T{self.varTempNum}_precedant | !{iL} & {D0} & clk | !{CE} & {iL} & clk & T{self.varTempNum}_precedant; " self.numTemp += [self.varTempNum] self.varTempNum +=1 self.varScript += [sT] sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-1}_precedant | !T{self.varTempNum}_precedant) & " \ - + f"({CE} & T{self.varTempNum - 1}_precedant + T{self.varTempNum}_precedant ) & {iL} + !{iL} & {D1} + !{CE} & {iL} & T{self.varTempNum}_precedant; " + + f"({CE} & T{self.varTempNum - 1}_precedant | T{self.varTempNum}_precedant ) & {iL} & clk | !{iL} & {D1} & clk | !{CE} & {iL} & clk & T{self.varTempNum}_precedant; " self.numTemp += [self.varTempNum] self.varTempNum +=1 self.varScript += [sT] - sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-2}_precedant | !T{self.varTempNum-1}_precedant | !T{self.varTempNum}_precedant) & " \ - + f"({CE} & T{self.varTempNum - 2}_precedant & T{self.varTempNum - 1}_precedant + T{self.varTempNum}_precedant ) & {iL} + !{iL} & {D2} + !{CE} & {iL} & T{self.varTempNum}_precedant; " + sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-2}_precedant | !T{self.varTempNum-1}_precedant | !T{self.varTempNum}_precedant) & clk & " \ + + f"({CE} & T{self.varTempNum - 2}_precedant & T{self.varTempNum - 1}_precedant | T{self.varTempNum}_precedant ) & {iL} & clk | !{iL} & {D2} & clk | !{CE} & {iL} & clk & T{self.varTempNum}_precedant; " self.numTemp += [self.varTempNum] self.varTempNum +=1 self.varScript += [sT] sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-3}_precedant | !T{self.varTempNum-2}_precedant | !T{self.varTempNum-1}_precedant | !T{self.varTempNum}_precedant) & " \ - + f"({CE} & T{self.varTempNum - 3}_precedant & T{self.varTempNum - 2}_precedant & T{self.varTempNum - 1}_precedant + T{self.varTempNum}_precedant ) & {iL} + !{iL} & {D3} + !{CE} & {iL} & T{self.varTempNum}_precedant; " + + f"({CE} & T{self.varTempNum - 3}_precedant & T{self.varTempNum - 2}_precedant & T{self.varTempNum - 1}_precedant | T{self.varTempNum}_precedant ) & {iL} & clk | !{iL} & {D3} & clk | !{CE} & {iL} & clk & T{self.varTempNum}_precedant; " self.numTemp += [self.varTempNum] self.varTempNum +=1 self.varScript += [sT] @@ -853,88 +853,118 @@ def checkCloseCircuit(self, ioOut, params={}): idOut, inLst, fName, outLst = deepcopy(f) if chip_select: chipSel = chip_select - [chipSel] = [list(chipS[1:]) for chipS in chipSel if chipS[0] == idOut] + chipSel = [list(chipS[1:]) for chipS in chipSel if chipS[0] == idOut] + if chipSel: + [chipSel] = chipSel else: chipSel = [] if chip_in_enable_inv: chipEnInv = chip_in_enable_inv - [chipEnInv] = [list(chipEI[1:]) for chipEI in chipEnInv if chipEI[0] == idOut] + chipEnInv = [list(chipEI[1:]) for chipEI in chipEnInv if chipEI[0] == idOut] + if chipEnInv: + [chipEnInv] = chipEnInv else: chipEnInv = [] if chip_in_enable: chipEn = chip_in_enable - [chipEn] = [list(chipE[1:]) for chipE in chipEn if chipE[0] == idOut] + chipEn = [list(chipE[1:]) for chipE in chipEn if chipE[0] == idOut] + if chipEn: + [chipEn] = chipEn else: chipEn = [] if chip_in_clock: chipInClock = chip_in_clock - [chipInClock] = [list(chipICLK[1:]) for chipICLK in chipInClock if chipICLK[0] == idOut] + chipInClock = [list(chipICLK[1:]) for chipICLK in chipInClock if chipICLK[0] == idOut] + if chipInClock: + [chipInClock] =chipInClock chipInClock = [(c1,l1) for (c1,l1,nfunc) in chipInClock if nfunc == nf] else: chipInClock = [] if chip_in_inv_reset: chipInInvReset = chip_in_inv_reset - [chipInInvReset] = [list(chipInInvR[1:]) for chipInInvR in chipInInvReset if chipInInvR[0] == idOut] + chipInInvReset = [list(chipInInvR[1:]) for chipInInvR in chipInInvReset if chipInInvR[0] == idOut] + if chipInInvReset: + [chipInInvReset] = chipInInvReset chipInInvReset = [(c1,l1) for (c1,l1,nfunc) in chipInInvReset if nfunc == nf] else: chipInInvReset = [] if chip_in_inv_set: chipInInvSet = chip_in_inv_set - [chipInInvSet] = [list(chipInInvS[1:]) for chipInInvS in chipInInvSet if chipInInvS[0] == idOut] + chipInInvSet = [list(chipInInvS[1:]) for chipInInvS in chipInInvSet if chipInInvS[0] == idOut] + if chipInInvSet: + [chipInInvSet] = chipInInvSet chipInInvSet = [(c1,l1) for (c1,l1,nfunc) in chipInInvSet if nfunc == nf] else: chipInInvSet = [] if chip_in_inv_clock: chipInInvClk = chip_in_inv_clock - [chipInInvClk] = [list(chipInIClk[1:]) for chipInIClk in chipInInvClk if chipInIClk[0] == idOut] + chipInInvClk = [list(chipInIClk[1:]) for chipInIClk in chipInInvClk if chipInIClk[0] == idOut] + if chipInInvClk: + [chipInInvClk] = chipInInvClk chipInInvClk = [(c1,l1) for (c1,l1,nfunc) in chipInInvClk if nfunc == nf] else: chipInInvClk = [] if chip_in_j: chipInJ = chip_in_j - [chipInJ] = [list(chipIIJ[1:]) for chipIIJ in chipInJ if chipIIJ[0] == idOut] + chipInJ = [list(chipIJ[1:]) for chipIJ in chipInJ if chipIJ[0] == idOut] + if chipInJ: + [chipInJ] = chipInJ chipInJ = [(c1,l1) for (c1,l1,nfunc) in chipInJ if nfunc == nf] else: chipInJ = [] if chip_in_k: chipInK = chip_in_k - [chipInK] = [list(chipIK[1:]) for chipIK in chipInK if chipIK[0] == idOut] + chipInK = [list(chipIK[1:]) for chipIK in chipInK if chipIK[0] == idOut] + if chipInK: + [chipInK] = chipInK chipInK = [(c1,l1) for (c1,l1,nfunc) in chipInK if nfunc == nf] else: chipInK = [] if chip_in_inv_k: chipInInvK = chip_in_inv_k - [chipInInvK] = [list(chipIIK[1:]) for chipIIK in chipInInvK if chipIIK[0] == idOut] + chipInInvK = [list(chipIIK[1:]) for chipIIK in chipInInvK if chipIIK[0] == idOut] + if chipInInvK: + [chipInInvK] = chipInInvK chipInInvK = [(c1,l1) for (c1,l1,nfunc) in chipInInvK if nfunc == nf] else: chipInInvK = [] if chip_in_ce: chipInCE = chip_in_ce - [chipInCE] = [list(chipICE[1:]) for chipICE in chipInCE if chipICE[0] == idOut] + chipInCE = [list(chipICE[1:]) for chipICE in chipInCE if chipICE[0] == idOut] + if chipInCE: + [chipInCE] = chipInCE chipInCE = [(c1,l1) for (c1,l1,nfunc) in chipInCE if nfunc == nf] else: chipInCE = [] if chip_in_inv_L: chipInInvL = chip_in_inv_L - [chipInInvL] = [list(chipIIL[1:]) for chipIIL in chipInInvL if chipIIL[0] == idOut] + chipInInvL = [list(chipIIL[1:]) for chipIIL in chipInInvL if chipIIL[0] == idOut] + if chipInInvL: + [chipInInvL] = chipInInvL chipInInvL = [(c1,l1) for (c1,l1,nfunc) in chipInInvL if nfunc == nf] else: chipInInvL = [] if chip_in_inv_U: chipInInvU = chip_in_inv_U - [chipInInvU] = [list(chipIIU[1:]) for chipIIU in chipInInvU if chipIIU[0] == idOut] + chipInInvU = [list(chipIIU[1:]) for chipIIU in chipInInvU if chipIIU[0] == idOut] + if chipInInvU: + [chipInInvU] = chipInInvU chipInInvU = [(c1,l1) for (c1,l1,nfunc) in chipInInvU if nfunc == nf] else: chipInInvU = [] if chip_out_TC: chipOutTC = chip_out_TC - [chipOutTC] = [list(chipOTC[1:]) for chipOTC in chipOutTC if chipOTC[0] == idOut] + chipOutTC = [list(chipOTC[1:]) for chipOTC in chipOutTC if chipOTC[0] == idOut] + if chipOutTC: + [chipOutTC] = chipOutTC chipOutTC = [(c1,l1) for (c1,l1,nfunc) in chipOutTC if nfunc == nf] else: chipOutTC = [] if chip_out_inv: chipOutInv = chip_out_inv - [chipOutInv] = [list(chipOI[1:]) for chipOI in chipOutInv if chipOI[0] == idOut] + chipOutInv = [list(chipOI[1:]) for chipOI in chipOutInv if chipOI[0] == idOut] + if chipOutInv: + [chipOutInv] = chipOutInv else: chipOutInv = [] inLst += chipSel + chipEnInv + chipEn + chipInClock + chipInInvReset + chipInInvSet + \ @@ -999,7 +1029,7 @@ def checkCloseCircuit(self, ioOut, params={}): findIn = True print("connecté à pwr") if not findIn: - for io_inZone in self.io_in: + for n_io,io_inZone in enumerate(self.io_in): id, [zone] = io_inZone if self.is_linked_to(zone, inFunc): constKey = 'val' @@ -1046,12 +1076,12 @@ def checkCloseCircuit(self, ioOut, params={}): constKey = "iU" #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n - inFuncConst += [{constKey:f"I{n+1}", "num":n, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n + inFuncConst += [{constKey:f"I{n_io+1}", "num":n_io, "numO":no}] # [self.mcu_pin[f"I{id[4:]}"]] # ici ajouter n findIn = True print("connecté à une ENTRÉE EXTERNE") break if not findIn: - for io_chipInZone in self.chip_in_wire: + for n_io, io_chipInZone in enumerate(self.chip_in_wire): id, zone = io_chipInZone if self.is_linked_to(zone, inFunc): constKey = 'val' @@ -1098,7 +1128,7 @@ def checkCloseCircuit(self, ioOut, params={}): constKey = "iU" #inFuncConst += [{constKey:self.mcu_pin[f"I{id[4:]}"], "num":n, "numO":no}] - inFuncConst += [{constKey:f"I{n+1}", "num":n, "numO":no}] + inFuncConst += [{constKey:f"I{n_io+1}", "num":n_io, "numO":no}] findIn = True print("connecté à une ENTRÉE EXTERNE par cable") # ici ajouter n {'val':self.mcu_pin[f"I{id[4:]}"], "num":n} break @@ -1628,7 +1658,9 @@ def checkCircuit(self): ciw += deepcopy(self.board.sketcher.matrix[f"{cu1},{lu1}"]["link"]) self.wireNotUsed.remove(wused) again = True - self.chip_in_wire += [(ioin[0], ciw)] + elt = (ioin[0], ciw) + if not elt in self.chip_in_wire: + self.chip_in_wire += [elt] ############### Verification des self.chip_out sur chip_out ##################### for chipAllio in self.chip_out: @@ -1652,11 +1684,14 @@ def checkCircuit(self): cow += deepcopy(self.board.sketcher.matrix[f"{cu2},{lu2}"]["link"]) self.wireNotUsed.remove(wused) again = True + if not cow in self.chip_out_wire: + self.chip_out_wire += [cow] elif self.is_linked_to(cow, (cu2, lu2)): cow += deepcopy(self.board.sketcher.matrix[f"{cu1},{lu1}"]["link"]) self.wireNotUsed.remove(wused) again = True - self.chip_out_wire += [cow] + if not cow in self.chip_out_wire: + self.chip_out_wire += [cow] ################# Redefinir les zones des io_out avec les cables non utilisés ############## for n,ioOut in enumerate(self.io_out): From 883fc72bff3a5c93a8f2332efabc81bdd99333a7 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Thu, 12 Dec 2024 06:45:34 -0500 Subject: [PATCH 41/44] dbug --- sidebar.py | 10 +++++----- toolbar.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sidebar.py b/sidebar.py index 745cdd7..8fe41ae 100644 --- a/sidebar.py +++ b/sidebar.py @@ -18,11 +18,11 @@ from dataCDLT import FREE, USED from object_model.circuit_object_model import Chip, get_all_available_chips, get_chip_modification_times -if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower(): - from tkinter import messagebox, font - from tkmacosx import Button # type: ignore -else: - from tkinter import Button, messagebox, font +# if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower(): +# from tkinter import messagebox, font +# from tkmacosx import Button # type: ignore +# else: +from tkinter import Button, messagebox, font @dataclass diff --git a/toolbar.py b/toolbar.py index 5786768..37fef84 100644 --- a/toolbar.py +++ b/toolbar.py @@ -16,11 +16,11 @@ from dataCDLT import INPUT, OUTPUT, FREE, CLOCK from utils import resource_path -if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower(): - from tkinter import messagebox, colorchooser - from tkmacosx import Button # type: ignore -else: - from tkinter import Button, messagebox, colorchooser +# if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower(): +# from tkinter import messagebox, colorchooser +# from tkmacosx import Button # type: ignore +# else: +from tkinter import Button, messagebox, colorchooser @dataclass class WirePlacementInfo: From fba45222b80b7b3baa334fc17f7d3620128cc6ba Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Thu, 12 Dec 2024 06:57:13 -0500 Subject: [PATCH 42/44] dbug --- sidebar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sidebar.py b/sidebar.py index 08a8181..745cdd7 100644 --- a/sidebar.py +++ b/sidebar.py @@ -22,7 +22,7 @@ from tkinter import messagebox, font from tkmacosx import Button # type: ignore else: -from tkinter import Button, messagebox, font + from tkinter import Button, messagebox, font @dataclass From 2ccc83cc7c2d971a21a9ee32b75e2d525855dd16 Mon Sep 17 00:00:00 2001 From: Khalid Hannouf Date: Fri, 13 Dec 2024 14:11:38 -0500 Subject: [PATCH 43/44] version de la prez --- arduino_logique.py | 2 +- menus.py | 40 +++++++++++++++++++++++++++------------- sidebar.py | 11 ++++++----- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/arduino_logique.py b/arduino_logique.py index f9c2532..d8bd77d 100644 --- a/arduino_logique.py +++ b/arduino_logique.py @@ -30,7 +30,7 @@ def main(): win = tk.Tk() win.title("Laboratoire virtuel de circuit logique - GIF-1002") win.geometry("1500x800") # Initial window size - win.minsize(1500, 800) # Set minimal window size + win.minsize(3456, 2234) # Set minimal window size 3456 × 2234) 1500,800 win.resizable(True, True) # Disabling window resizing win.configure(bg="#333333") # Setting consistent background color diff --git a/menus.py b/menus.py index cc74712..6bb32d0 100644 --- a/menus.py +++ b/menus.py @@ -12,6 +12,7 @@ import subprocess import platform import serial.tools.list_ports # type: ignore +import time from breadboard import Breadboard from component_sketch import ComponentSketcher @@ -92,7 +93,12 @@ class SerialPort: def connect(self): """Open the serial connection.""" try: - self.connection = serial.Serial(port=self.com_port, baudrate=self.baud_rate, timeout=self.timeout) + self.connection = serial.Serial(port=self.com_port, + baudrate=self.baud_rate, + parity=serial.PARITY_NONE, + stopbits=serial.STOPBITS_ONE, + bytesize=serial.EIGHTBITS, + timeout=self.timeout) print(f"Serial port {self.com_port} opened successfully.") except serial.SerialException as e: print(f"Error opening port {self.com_port}: {e}") @@ -143,8 +149,8 @@ def __init__( self.menu_bar = tk.Frame(parent, bg="#333333") """The frame containing the menu bar buttons.""" - - self.serial_port = SerialPort(None, 115200, 1, None) + + self.serial_port = SerialPort(None, 9600, 1, None) """The serial port configuration.""" self.open_file_path: str | None = None @@ -685,6 +691,10 @@ def send_data(self, data): # Convertir la chaîne en bytes et l'envoyer self.serial_port.connection.write(data.encode('utf-8')) print(f"Données envoyées: {data}") + #time.sleep(0.5) + #if self.serial_port.connection.in_waiting > 0: # Vérifie s'il y a des données disponibles + data = self.serial_port.connection.readline().decode('utf-8').strip() + print(f"réponse: {data} à {self.serial_port.baud_rate} bauds") except serial.SerialException as e: print(f"Erreur lors de l'envoi des données: {e}") else: @@ -702,7 +712,7 @@ def download_script(self): self.checkCircuit() self.serial_port.connect() self.send_data(self.script) - self.close_port() + #self.close_port() def is_linked_to(self, dest, src): res = False @@ -785,7 +795,7 @@ def decodeFunc(self,inVar, funcName): iset = f"{inVar[2]['iset']}" rst = f"!{inVar[1]['irst']}" sT =f"T{self.varTempNum} = " - sT += "((" + inVar[0]['J'] + f" & !T{self.varTempNum}_precedant) | (!{K} & T{self.varTempNum}_precedant)) & {set} & {rst} & CLK | {iset} " + sT += "((" + inVar[0]['J'] + f" & !T{self.varTempNum}_precedent) | (!{K} & T{self.varTempNum}_precedent)) & {set} & {rst} & CLK | {iset} " sT += " ); " s = inVar[0]['numO']*" !" + f"T{self.varTempNum} " self.varTempNum +=1 @@ -800,22 +810,22 @@ def decodeFunc(self,inVar, funcName): D1 = inVar[1]["val"] D2 = inVar[0]["val"] D3 = inVar[0]["val"] - sT = f"T{self.varTempNum} = clk & {CE} & {iL} & !T{self.varTempNum}_precedant | !{iL} & {D0} & clk | !{CE} & {iL} & clk & T{self.varTempNum}_precedant; " + sT = f"T{self.varTempNum} = clk & {CE} & {iL} & !T{self.varTempNum}_precedent | !{iL} & {D0} & clk | !{CE} & {iL} & clk & T{self.varTempNum}_precedent; " self.numTemp += [self.varTempNum] self.varTempNum +=1 self.varScript += [sT] - sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-1}_precedant | !T{self.varTempNum}_precedant) & " \ - + f"({CE} & T{self.varTempNum - 1}_precedant | T{self.varTempNum}_precedant ) & {iL} & clk | !{iL} & {D1} & clk | !{CE} & {iL} & clk & T{self.varTempNum}_precedant; " + sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-1}_precedent | !T{self.varTempNum}_precedent) & " \ + + f"({CE} & T{self.varTempNum - 1}_precedent | T{self.varTempNum}_precedent ) & {iL} & clk | !{iL} & {D1} & clk | !{CE} & {iL} & clk & T{self.varTempNum}_precedent; " self.numTemp += [self.varTempNum] self.varTempNum +=1 self.varScript += [sT] - sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-2}_precedant | !T{self.varTempNum-1}_precedant | !T{self.varTempNum}_precedant) & clk & " \ - + f"({CE} & T{self.varTempNum - 2}_precedant & T{self.varTempNum - 1}_precedant | T{self.varTempNum}_precedant ) & {iL} & clk | !{iL} & {D2} & clk | !{CE} & {iL} & clk & T{self.varTempNum}_precedant; " + sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-2}_precedent | !T{self.varTempNum-1}_precedent | !T{self.varTempNum}_precedent) & clk & " \ + + f"({CE} & T{self.varTempNum - 2}_precedent & T{self.varTempNum - 1}_precedent | T{self.varTempNum}_precedent ) & {iL} & clk | !{iL} & {D2} & clk | !{CE} & {iL} & clk & T{self.varTempNum}_precedent; " self.numTemp += [self.varTempNum] self.varTempNum +=1 self.varScript += [sT] - sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-3}_precedant | !T{self.varTempNum-2}_precedant | !T{self.varTempNum-1}_precedant | !T{self.varTempNum}_precedant) & " \ - + f"({CE} & T{self.varTempNum - 3}_precedant & T{self.varTempNum - 2}_precedant & T{self.varTempNum - 1}_precedant | T{self.varTempNum}_precedant ) & {iL} & clk | !{iL} & {D3} & clk | !{CE} & {iL} & clk & T{self.varTempNum}_precedant; " + sT = f"T{self.varTempNum} = (!{CE} | !T{self.varTempNum-3}_precedent | !T{self.varTempNum-2}_precedent | !T{self.varTempNum-1}_precedent | !T{self.varTempNum}_precedent) & " \ + + f"({CE} & T{self.varTempNum - 3}_precedent & T{self.varTempNum - 2}_precedent & T{self.varTempNum - 1}_precedent | T{self.varTempNum}_precedent ) & {iL} & clk | !{iL} & {D3} & clk | !{CE} & {iL} & clk & T{self.varTempNum}_precedent; " self.numTemp += [self.varTempNum] self.varTempNum +=1 self.varScript += [sT] @@ -1749,7 +1759,7 @@ def io_position(io): self.script += s self.varScript = [] self.script += f"O{no+1}" + " = " - self.script += f"{script}; " + self.script += f"{script}; \n" print(f"script temp : {self.script}") else: print(f"le circuit est ouvert sur la sortie {ioOut}") @@ -1772,3 +1782,7 @@ def io_position(io): print(f"chip_in_enable_inv : {chip_in_enable_inv}") print(f"map pin mcu : {self.mcu_pin}") print(f"script final : {self.script}") + if self.script: + messagebox.showinfo("Script du circuit", f"Circuit= {self.script}") + else: + messagebox.showinfo("Script du circuit", f"Le circuit présente au moins un défaut et ne peut être téléversé.") diff --git a/sidebar.py b/sidebar.py index 745cdd7..f5892a9 100644 --- a/sidebar.py +++ b/sidebar.py @@ -18,12 +18,13 @@ from dataCDLT import FREE, USED from object_model.circuit_object_model import Chip, get_all_available_chips, get_chip_modification_times -if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower(): - from tkinter import messagebox, font - from tkmacosx import Button # type: ignore -else: - from tkinter import Button, messagebox, font +# if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower(): +# from tkinter import messagebox, font +# from tkmacosx import Button # type: ignore +# else: +# from tkinter import Button, messagebox, font +from tkinter import Button, messagebox, font @dataclass class SidebarGrid: From 246d1e6c3777982c09726f01cb2a1dffe02edfc0 Mon Sep 17 00:00:00 2001 From: Charles-Olivier Trudel Date: Fri, 13 Dec 2024 14:19:42 -0500 Subject: [PATCH 44/44] fix window size --- arduino_logique.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino_logique.py b/arduino_logique.py index d8bd77d..1eac935 100644 --- a/arduino_logique.py +++ b/arduino_logique.py @@ -30,7 +30,7 @@ def main(): win = tk.Tk() win.title("Laboratoire virtuel de circuit logique - GIF-1002") win.geometry("1500x800") # Initial window size - win.minsize(3456, 2234) # Set minimal window size 3456 × 2234) 1500,800 + win.minsize(1500, 800) # Set minimal window size 3456 × 2234) 1500,800 win.resizable(True, True) # Disabling window resizing win.configure(bg="#333333") # Setting consistent background color