mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-14 23:36:27 -04:00
added a additional screenshot
This commit is contained in:
parent
e021f853a1
commit
eb27f23d7d
BIN
screenshot3.png
Normal file
BIN
screenshot3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 90 KiB |
84
src/main/fsm/trafficLightBlink.fsm
Normal file
84
src/main/fsm/trafficLightBlink.fsm
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<fsm>
|
||||||
|
<states>
|
||||||
|
<state>
|
||||||
|
<values>R=1</values>
|
||||||
|
<position x="600.0" y="180.0"/>
|
||||||
|
<number>0</number>
|
||||||
|
<name>Red</name>
|
||||||
|
<radius>70</radius>
|
||||||
|
</state>
|
||||||
|
<state>
|
||||||
|
<values>R=1,Y=1</values>
|
||||||
|
<position x="780.0" y="360.0"/>
|
||||||
|
<number>1</number>
|
||||||
|
<name>Red/Yellow</name>
|
||||||
|
<radius>70</radius>
|
||||||
|
</state>
|
||||||
|
<state>
|
||||||
|
<values>G=1</values>
|
||||||
|
<position x="600.0" y="540.0"/>
|
||||||
|
<number>2</number>
|
||||||
|
<name>Green</name>
|
||||||
|
<radius>70</radius>
|
||||||
|
</state>
|
||||||
|
<state>
|
||||||
|
<values>Y=1</values>
|
||||||
|
<position x="420.0" y="360.0"/>
|
||||||
|
<number>3</number>
|
||||||
|
<name>Yellow</name>
|
||||||
|
<radius>70</radius>
|
||||||
|
</state>
|
||||||
|
<state>
|
||||||
|
<values></values>
|
||||||
|
<position x="120.0" y="360.0"/>
|
||||||
|
<number>4</number>
|
||||||
|
<name>Off</name>
|
||||||
|
<radius>70</radius>
|
||||||
|
</state>
|
||||||
|
</states>
|
||||||
|
<transitions>
|
||||||
|
<transition>
|
||||||
|
<values></values>
|
||||||
|
<position x="777.1327" y="182.86734"/>
|
||||||
|
<fromState reference="../../../states/state"/>
|
||||||
|
<toState reference="../../../states/state[2]"/>
|
||||||
|
<condition></condition>
|
||||||
|
</transition>
|
||||||
|
<transition>
|
||||||
|
<values></values>
|
||||||
|
<position x="777.13477" y="537.13477"/>
|
||||||
|
<fromState reference="../../../states/state[2]"/>
|
||||||
|
<toState reference="../../../states/state[3]"/>
|
||||||
|
<condition></condition>
|
||||||
|
</transition>
|
||||||
|
<transition>
|
||||||
|
<values></values>
|
||||||
|
<position x="428.74414" y="531.25586"/>
|
||||||
|
<fromState reference="../../../states/state[3]"/>
|
||||||
|
<toState reference="../../../states/state[4]"/>
|
||||||
|
<condition></condition>
|
||||||
|
</transition>
|
||||||
|
<transition>
|
||||||
|
<values></values>
|
||||||
|
<position x="428.7441" y="188.74411"/>
|
||||||
|
<fromState reference="../../../states/state[4]"/>
|
||||||
|
<toState reference="../../../states/state"/>
|
||||||
|
<condition></condition>
|
||||||
|
</transition>
|
||||||
|
<transition>
|
||||||
|
<values></values>
|
||||||
|
<position x="270.0" y="280.53717"/>
|
||||||
|
<fromState reference="../../../states/state[4]"/>
|
||||||
|
<toState reference="../../../states/state[5]"/>
|
||||||
|
<condition>Blk</condition>
|
||||||
|
</transition>
|
||||||
|
<transition>
|
||||||
|
<values></values>
|
||||||
|
<position x="270.0" y="439.46304"/>
|
||||||
|
<fromState reference="../../../states/state[5]"/>
|
||||||
|
<toState reference="../../../states/state[4]"/>
|
||||||
|
<condition></condition>
|
||||||
|
</transition>
|
||||||
|
</transitions>
|
||||||
|
</fsm>
|
@ -254,7 +254,12 @@ public class FSMFrame extends JFrame implements ClosingWindowListener.ConfirmSav
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadFile(File file) {
|
/**
|
||||||
|
* Loads a file.
|
||||||
|
*
|
||||||
|
* @param file the file to load
|
||||||
|
*/
|
||||||
|
public void loadFile(File file) {
|
||||||
try {
|
try {
|
||||||
moveControl.setSelectedIndex(0);
|
moveControl.setSelectedIndex(0);
|
||||||
setFSM(FSM.loadFSM(file));
|
setFSM(FSM.loadFSM(file));
|
||||||
|
@ -525,6 +525,13 @@ public class TableDialog extends JDialog {
|
|||||||
else return filename.getName();
|
else return filename.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the all solutions dialog
|
||||||
|
*/
|
||||||
|
public AllSolutionsDialog getAllSolutionsDialog() {
|
||||||
|
return allSolutionsDialog;
|
||||||
|
}
|
||||||
|
|
||||||
private void setLastUsedGenerator(HardwareDescriptionGenerator generator) {
|
private void setLastUsedGenerator(HardwareDescriptionGenerator generator) {
|
||||||
if (lastUsedGenratorMenuItem != null)
|
if (lastUsedGenratorMenuItem != null)
|
||||||
hardwareMenu.remove(lastUsedGenratorMenuItem);
|
hardwareMenu.remove(lastUsedGenratorMenuItem);
|
||||||
|
@ -6,12 +6,14 @@
|
|||||||
package de.neemann.digital.docu;
|
package de.neemann.digital.docu;
|
||||||
|
|
||||||
import de.neemann.digital.core.element.Keys;
|
import de.neemann.digital.core.element.Keys;
|
||||||
|
import de.neemann.digital.fsm.gui.FSMFrame;
|
||||||
import de.neemann.digital.gui.Main;
|
import de.neemann.digital.gui.Main;
|
||||||
import de.neemann.digital.gui.Settings;
|
import de.neemann.digital.gui.Settings;
|
||||||
import de.neemann.digital.gui.components.AttributeDialog;
|
import de.neemann.digital.gui.components.AttributeDialog;
|
||||||
import de.neemann.digital.gui.components.expression.ExpressionDialog;
|
import de.neemann.digital.gui.components.expression.ExpressionDialog;
|
||||||
import de.neemann.digital.gui.components.graphics.GraphicDialog;
|
import de.neemann.digital.gui.components.graphics.GraphicDialog;
|
||||||
import de.neemann.digital.gui.components.karnaugh.KarnaughMapDialog;
|
import de.neemann.digital.gui.components.karnaugh.KarnaughMapDialog;
|
||||||
|
import de.neemann.digital.gui.components.table.AllSolutionsDialog;
|
||||||
import de.neemann.digital.gui.components.table.TableDialog;
|
import de.neemann.digital.gui.components.table.TableDialog;
|
||||||
import de.neemann.digital.gui.components.testing.TestCaseDescriptionDialog;
|
import de.neemann.digital.gui.components.testing.TestCaseDescriptionDialog;
|
||||||
import de.neemann.digital.gui.components.testing.ValueTableDialog;
|
import de.neemann.digital.gui.components.testing.ValueTableDialog;
|
||||||
@ -41,6 +43,7 @@ public class ScreenShots {
|
|||||||
private static final int WIN_DX = 850;
|
private static final int WIN_DX = 850;
|
||||||
private static final int WIN_DY = 500;
|
private static final int WIN_DY = 500;
|
||||||
private static GraphicDialog graphic;
|
private static GraphicDialog graphic;
|
||||||
|
private static Main mainStatic;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Settings.getInstance().getAttributes().set(Keys.SETTINGS_DEFAULT_TREESELECT, false);
|
Settings.getInstance().getAttributes().set(Keys.SETTINGS_DEFAULT_TREESELECT, false);
|
||||||
@ -130,6 +133,60 @@ public class ScreenShots {
|
|||||||
.add(new GuiTester.CloseTopMost())
|
.add(new GuiTester.CloseTopMost())
|
||||||
.add(new GuiTester.CloseTopMost())
|
.add(new GuiTester.CloseTopMost())
|
||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
|
File trafficLight = new File(Resources.getRoot(), "../../main/fsm/trafficLightBlink.fsm");
|
||||||
|
new GuiTester()
|
||||||
|
.press("F10")
|
||||||
|
.press("RIGHT", 4)
|
||||||
|
.press("DOWN", 4)
|
||||||
|
.press("ENTER")
|
||||||
|
.delay(500)
|
||||||
|
.add(new GuiTester.WindowCheck<>(FSMFrame.class, (gt, fsmFrame) -> fsmFrame.loadFile(trafficLight)))
|
||||||
|
.press("F10")
|
||||||
|
.press("RIGHT", 2)
|
||||||
|
.press("DOWN", 1)
|
||||||
|
.press("ENTER")
|
||||||
|
.delay(500)
|
||||||
|
.add(new GuiTester.WindowCheck<>(Window.class, (guiTester, window) -> {
|
||||||
|
if (window instanceof AllSolutionsDialog)
|
||||||
|
window.dispose();
|
||||||
|
else
|
||||||
|
if (window instanceof TableDialog)
|
||||||
|
((TableDialog)window).getAllSolutionsDialog().dispose();
|
||||||
|
}))
|
||||||
|
.add(new GuiTester.WindowCheck<>(TableDialog.class))
|
||||||
|
.press("F10")
|
||||||
|
.press("RIGHT", 4)
|
||||||
|
.press("DOWN", 2)
|
||||||
|
.press("ENTER")
|
||||||
|
.delay(500)
|
||||||
|
.add(new GuiTester.WindowCheck<>(Main.class,
|
||||||
|
(gt, main) -> {
|
||||||
|
main.getCircuitComponent().translateCircuit(-300, 0);
|
||||||
|
mainStatic = main;
|
||||||
|
}))
|
||||||
|
.delay(500)
|
||||||
|
.press("F10")
|
||||||
|
.press("RIGHT", 4)
|
||||||
|
.press("DOWN", 4)
|
||||||
|
.press("ENTER")
|
||||||
|
.delay(500)
|
||||||
|
.add(new GuiTester.WindowCheck<>(FSMFrame.class, (gt, fsmFrame) -> {
|
||||||
|
fsmFrame.loadFile(trafficLight);
|
||||||
|
fsmFrame.getContentPane().setPreferredSize(new Dimension(550, 400));
|
||||||
|
fsmFrame.pack();
|
||||||
|
final Point location = fsmFrame.getLocation();
|
||||||
|
fsmFrame.setLocation(location.x + 250, location.y + 100);
|
||||||
|
fsmFrame.setAlwaysOnTop(true);
|
||||||
|
fsmFrame.setTitle(trafficLight.getName());
|
||||||
|
mainStatic.requestFocus();
|
||||||
|
}))
|
||||||
|
.add(new MainScreenShot("screenshot3.png"))
|
||||||
|
.add(new GuiTester.CloseTopMost())
|
||||||
|
.add(new GuiTester.CloseTopMost())
|
||||||
|
.add(new GuiTester.CloseTopMost())
|
||||||
|
.add(new GuiTester.CloseTopMost())
|
||||||
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set all settings as needed before start this method
|
// Set all settings as needed before start this method
|
||||||
|
@ -17,7 +17,7 @@ public class IntegrationTest extends TestCase {
|
|||||||
|
|
||||||
public void testExamples() throws Exception {
|
public void testExamples() throws Exception {
|
||||||
File examples = new File(Resources.getRoot().getParentFile().getParentFile(), "/main/fsm");
|
File examples = new File(Resources.getRoot().getParentFile().getParentFile(), "/main/fsm");
|
||||||
assertEquals(7, new FileScanner(this::check).setSuffix("fsm").scan(examples));
|
assertEquals(8, new FileScanner(this::check).setSuffix("fsm").scan(examples));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user