From cb259689deecd9163bdfeb88bf79b9fe30a3bf61 Mon Sep 17 00:00:00 2001 From: AdecWatt Date: Tue, 25 Jan 2022 08:40:23 +0100 Subject: [PATCH] test --- data/config/AdecWatt.xml | 113 ++++++++++---------- src/java/adecWatt/model/Embedded.java | 3 +- src/java/adecWatt/model/unit/Workspace.java | 12 ++- 3 files changed, 69 insertions(+), 59 deletions(-) diff --git a/data/config/AdecWatt.xml b/data/config/AdecWatt.xml index 5bd7e93..1228ee8 100644 --- a/data/config/AdecWatt.xml +++ b/data/config/AdecWatt.xml @@ -1,77 +1,76 @@ -This file is automaticaly generated by AdecWatt application at 5:25 PM on May 26, 2019. - -true - -4 - - -data/log/ - -true - -true -false -/home/felix/perso/adecWatt56/data/export/CendresLampionsChapelleBleue.lpz -North - +This file is automaticaly generated by AdecWatt application at 2:43 PM on Oct 21, 2020. true -0 +4 +data/images/adecWatt.png +true +North + + +North +North +false + +North +[x=0,y=28] +20201021 +true +[x=0,y=28] +true + +[x=0,y=28] +false + + +false +data/log/ + +false +true +3 +false +North + +true +true +[x=0,y=28] +true + + +true +false +3128 +false + +false +true +2 +false 1 -true -3128 - - -5 -North - -[x=0,y=31] - -false - -true -[x=1 490,y=312] -North -Day -false -[x=0,y=31] - -true -false -2 -North -true -true -true -data/images/adecWatt.png - -false -North - -false - -false -20190526 +5 false -true -3 -false -[x=0,y=31] -false - North +/home/felix/CendresLampionsChapelleBleue.lpz +0 + +true + + +Day + + diff --git a/src/java/adecWatt/model/Embedded.java b/src/java/adecWatt/model/Embedded.java index 06db360..2ca1e2e 100644 --- a/src/java/adecWatt/model/Embedded.java +++ b/src/java/adecWatt/model/Embedded.java @@ -119,7 +119,8 @@ public abstract class Embedded

, T extends Enum, if (visited.contains (this)) return; super.getLocalLink (visited, unitLinks, iconsLinks, imagesLinks); - model.getLocalLink (visited, unitLinks, iconsLinks, imagesLinks); + if (model != null) + model.getLocalLink (visited, unitLinks, iconsLinks, imagesLinks); } public boolean renameUnits (TreeMap translateMap) { diff --git a/src/java/adecWatt/model/unit/Workspace.java b/src/java/adecWatt/model/unit/Workspace.java index 099bb65..946fa0b 100644 --- a/src/java/adecWatt/model/unit/Workspace.java +++ b/src/java/adecWatt/model/unit/Workspace.java @@ -706,7 +706,17 @@ public abstract class Workspace extends Unit> { Circuits.CircuitState circuitState = circuits.getState (plugedComp, acc); if (circuitState == null) continue; - Acc.printCircuit (printGraphics, lineWidth, plugedComp.getAccCenter (acc.getId ()), circuitState); + Point2D c = plugedComp.getAccCenter (acc.getId ()); + // try { + // Comp endComp = (Comp) namedItems.get (acc.getConnectedTo ()); + // Point2D a = plugedComp.getAccCenter (acc.getId ()); + // Point2D b = endComp.getAccCenter (acc.getConnectedOn ()); + // c = new Point2D.Double ((1*a.getX ()+b.getX ())/2, (1*a.getY ()+b.getY ())/2); + // } catch (Exception e) { + // } + // XXX + //Acc.printCircuit (printGraphics, lineWidth, c, circuitState); + Acc.printCircuit (printGraphics, c, circuitState, .4); } }