mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-17 00:44:40 -04:00
Merge branch 'master' into macCTRL
This commit is contained in:
commit
80138b7cf9
@ -87,7 +87,7 @@ public class Wire implements Drawable, Movable, ObservableValueReader {
|
||||
style = Style.getWireStyle(value);
|
||||
|
||||
graphic.drawLine(p1, p2, style);
|
||||
if (highLight != null && graphic.isFlagSet(Graphic.Flag.tiny)) {
|
||||
if (highLight == Style.ERROR && graphic.isFlagSet(Graphic.Flag.tiny)) {
|
||||
Vector min = Vector.min(p1, p2).add(-SIZE, -SIZE);
|
||||
Vector max = Vector.max(p1, p2).add(SIZE, SIZE);
|
||||
graphic.drawCircle(min, max, highLight);
|
||||
@ -237,7 +237,7 @@ public class Wire implements Drawable, Movable, ObservableValueReader {
|
||||
if (p1.x == p2.x)
|
||||
return Orientation.vertical;
|
||||
if (p1.y == p2.y)
|
||||
return Orientation.horzontal;
|
||||
return Orientation.horizontal;
|
||||
return Orientation.diagonal;
|
||||
}
|
||||
|
||||
@ -359,5 +359,5 @@ public class Wire implements Drawable, Movable, ObservableValueReader {
|
||||
this.isConnectedToSplitter = isConnectedToSplitter;
|
||||
}
|
||||
|
||||
enum Orientation {horzontal, vertical, diagonal}
|
||||
enum Orientation {horizontal, vertical, diagonal}
|
||||
}
|
||||
|
@ -43,13 +43,13 @@ public class WireConsistencyChecker {
|
||||
HashSet<Vector> diagPoints = new HashSet<>();
|
||||
|
||||
ArrayList<Wire> newWires = new ArrayList<>();
|
||||
WireMerger hori = new WireMerger(Wire.Orientation.horzontal);
|
||||
WireMerger hori = new WireMerger(Wire.Orientation.horizontal);
|
||||
WireMerger vert = new WireMerger(Wire.Orientation.vertical);
|
||||
|
||||
for (Wire w : wires) {
|
||||
if (!w.p1.equals(w.p2))
|
||||
switch (w.getOrientation()) {
|
||||
case horzontal:
|
||||
case horizontal:
|
||||
hori.add(w);
|
||||
horiPoints.add(w.p1);
|
||||
horiPoints.add(w.p2);
|
||||
|
@ -27,7 +27,7 @@ public class WireMerger {
|
||||
public WireMerger(Wire.Orientation orientation) {
|
||||
wireContainers = new HashMap<>();
|
||||
switch (orientation) {
|
||||
case horzontal:
|
||||
case horizontal:
|
||||
handler = new OrientationHandlerHorizontal();
|
||||
break;
|
||||
case vertical:
|
||||
|
@ -178,7 +178,7 @@
|
||||
<string name="elem_Button">Button</string>
|
||||
<string name="elem_Button_tt">A simple push button which goes back to its original state when it is released.</string>
|
||||
<string name="elem_Button_pin_out">The output signal of the button.</string>
|
||||
<string name="elem_ButtonLED">Button</string>
|
||||
<string name="elem_ButtonLED">Button with LED</string>
|
||||
<string name="elem_ButtonLED_tt">A simple push button which goes back to its original state when it is released.
|
||||
The push button has an LED which can be switched via an input signal.</string>
|
||||
<string name="elem_ButtonLED_pin_out">The output signal of the button.</string>
|
||||
|
@ -1070,9 +1070,9 @@
|
||||
<string name="key_poles">Número de polos</string>
|
||||
<!-- Relay -->
|
||||
<string name="key_poles_tt">Número de polos disponíveis.</string>
|
||||
<string name="key_commonCathode">cátodo comum</string>
|
||||
<string name="key_commonCathode">Conexão comum</string>
|
||||
<!-- Seven-Seg -->
|
||||
<string name="key_commonCathode_tt">Se a entrada for selecionada como cátodo comum, também será simulada.</string>
|
||||
<string name="key_commonCathode_tt">Se a entrada for selecionada como ânodo ou cátodo comum, também será simulada.</string>
|
||||
<string name="key_ledPersistence">Prevenir o piscamento (flicker)</string>
|
||||
<!-- Seven-Seg, LedMatrix -->
|
||||
<string name="key_ledPersistence_tt">Se não for possível aumentar a frequência o bastante para que o efeito de piscamento possa desaparecer.
|
||||
@ -1851,4 +1851,15 @@ Portanto, o sinal 'D_out' também será avaliado para se verificar o valor desse
|
||||
<string name="tutorialNotNeeded">Pular o tutorial</string>
|
||||
<string name="msg_fsmTransition">Transição</string>
|
||||
<string name="msg_fsmState">Estado</string>
|
||||
<string name="elem_Seven-Seg_pin_ca">Ânodo comum. Para acender os LEDs, essa entrada deverá estar em nível alto.</string>
|
||||
<string name="key_commonConnectionType">Comum</string>
|
||||
<string name="key_commonConnectionType_tt">Tipo da conexão comum.</string>
|
||||
<string name="key_commonConnectionType_cathode">Cátodo</string>
|
||||
<string name="key_commonConnectionType_anode">Ânodo</string>
|
||||
<string name="key_wireToolTips">Dicas sobre conexões</string>
|
||||
<string name="key_wireToolTips_tt">Se habilitada, linhas serão destacadas quando o mouse passar sobre elas.</string>
|
||||
<string name="menu_table_showAllSolutions">Mostrar a caixa de diálogo com resultados</string>
|
||||
<string name="menu_table_showAllSolutions_tt">Mostrar a caixa de diálogo com resultados se tiver sido fechada manualmente.</string>
|
||||
<string name="msg_codeNotConsistent">Impossível criar definições de entrada e de saída automaticamente.
|
||||
Favor verificar as configurações|</string>
|
||||
</resources>
|
||||
|
@ -1075,9 +1075,9 @@
|
||||
<string name="key_poles">Pole count</string>
|
||||
<!-- Relay -->
|
||||
<string name="key_poles_tt">Number of poles available.</string>
|
||||
<string name="key_commonCathode">Common cathode</string>
|
||||
<string name="key_commonCathode">Common Connection</string>
|
||||
<!-- Seven-Seg -->
|
||||
<string name="key_commonCathode_tt">If selected the common cathode input is also simulated.</string>
|
||||
<string name="key_commonCathode_tt">If selected, a common cathode or anode input is also simulated.</string>
|
||||
<string name="key_ledPersistence">Avoid Flicker</string>
|
||||
<!-- Seven-Seg, LedMatrix -->
|
||||
<string name="key_ledPersistence_tt">It is not possible to increase the frequency so much that the flickering disappears.
|
||||
@ -1864,4 +1864,15 @@ Therefore, the signal 'D_out' is also available to check the value in this case.
|
||||
<string name="tutorialNotNeeded">Skip Tutorial</string>
|
||||
<string name="msg_fsmTransition">Transition</string>
|
||||
<string name="msg_fsmState">State</string>
|
||||
<string name="elem_Seven-Seg_pin_ca">Common anode. To turn on the LEDs, this input needs to be high.</string>
|
||||
<string name="key_commonConnectionType">Common</string>
|
||||
<string name="key_commonConnectionType_tt">Kind of common connection.</string>
|
||||
<string name="key_commonConnectionType_cathode">Cathode</string>
|
||||
<string name="key_commonConnectionType_anode">Anode</string>
|
||||
<string name="key_wireToolTips">Wire tool tips</string>
|
||||
<string name="key_wireToolTips_tt">If set, lines are highlighted when the mouse hovers over them.</string>
|
||||
<string name="menu_table_showAllSolutions">Show results dialog</string>
|
||||
<string name="menu_table_showAllSolutions_tt">Shows the results dialog again if it was closed manually.</string>
|
||||
<string name="msg_codeNotConsistent">Input and output definitions could not be created automatically.
|
||||
Please check the settings!</string>
|
||||
</resources>
|
||||
|
@ -38,7 +38,7 @@ public class WireMergerTest extends TestCase {
|
||||
}
|
||||
|
||||
public void testMerge1() {
|
||||
WireMerger wm = new WireMerger(Wire.Orientation.horzontal);
|
||||
WireMerger wm = new WireMerger(Wire.Orientation.horizontal);
|
||||
wm.add(new Wire(new Vector(1, 3), new Vector(5, 3)));
|
||||
wm.add(new Wire(new Vector(5, 3), new Vector(8, 3)));
|
||||
wm.add(new Wire(new Vector(1, 4), new Vector(5, 4)));
|
||||
@ -66,7 +66,7 @@ public class WireMergerTest extends TestCase {
|
||||
}
|
||||
|
||||
public void testMerge2() {
|
||||
WireMerger wm = new WireMerger(Wire.Orientation.horzontal);
|
||||
WireMerger wm = new WireMerger(Wire.Orientation.horizontal);
|
||||
wm.add(new Wire(new Vector(1, 3), new Vector(3, 3)));
|
||||
wm.add(new Wire(new Vector(6, 3), new Vector(8, 3)));
|
||||
wm.add(new Wire(new Vector(2, 3), new Vector(7, 3)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user