c't

c't-Projekte - Mailinglisten


[Voriger (Datum)] [Nächster (Datum)] [Voriger (Thread)] [Nächster (Thread)]
[Nach Datum][Nach Thread]

[ct-bot] [c't-Sim] Seltsame Indikatoren (Fehler?)

Absender: Raeder
Datum: So, 10.09.2006 09:54:45


Mir war die Bedeutung der Indikator-LEDs im c't-Sim zuerst ziemlich
schleierhaft. Habe dann ein paar Tooltips hinzugefügt und die
Reihenfolge umgedreht. Danach machte es Sinn.


Index: ctSim/model/bots/ctbot/CtBotSimTcp.java
===================================================================
RCS file: /ctbot/ct-Sim/ctSim/model/bots/ctbot/CtBotSimTcp.java,v
retrieving revision 1.3.2.4
diff -u -r1.3.2.4 CtBotSimTcp.java
--- ctSim/model/bots/ctbot/CtBotSimTcp.java	15 Aug 2006 08:16:50 -0000	1.3.2.4
+++ ctSim/model/bots/ctbot/CtBotSimTcp.java	10 Sep 2006 07:15:26 -0000
@@ -248,10 +248,10 @@
 		// LEDs:
 		for(int i=0; i<ledCount; i++) {
 			
-			final Integer idx = new Integer(ledCount-i-1);
+			final Integer idx = new Integer(i);
 			
 			this.addActuator(
-					new Indicator("LED "+i, new Point3d(), new Vector3d(), cols[i], colsAct[i]) { //$NON-NLS-1$
+					new Indicator(ledNames[i], new Point3d(), new Vector3d(), cols[i], colsAct[i]) { //$NON-NLS-1$
 				
 						@Override
 						public void setValue(@SuppressWarnings("unused") Boolean value) {
@@ -1001,6 +1001,17 @@
 //			this.actLed -= range;
 	}
 	
+    private static final String[] ledNames = {
+        "Radsensor rechts", // blau
+        "Radsensor links", // blau
+        "Transportfach", // rot
+        "Motor-/Batteriefehler", // orange
+        "Klappe", // gelb
+        "X-Achse", // gruen
+        "Y-Achse", // tuerkis
+        "Fernsteuerung"  // weiss
+    };
+    
 	private static final Color[] cols = {
 		new Color(137, 176, 255), // blau
 		new Color(137, 176, 255), // blau
Index: ctSim/view/actuators/IndicatorGroupGUI.java
===================================================================
RCS file: /ctbot/ct-Sim/ctSim/view/actuators/IndicatorGroupGUI.java,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 IndicatorGroupGUI.java
--- ctSim/view/actuators/IndicatorGroupGUI.java	15 Jul 2006 00:01:01 -0000	1.3.2.1
+++ ctSim/view/actuators/IndicatorGroupGUI.java	10 Sep 2006 07:15:26 -0000
@@ -70,7 +70,9 @@
 			JLabel led = new JLabel();
 //			JPanel led = new JPanel();
 			// TODO: siehe Indicator
-			led.setBackground(it.next().getColor(false));
+            Indicator indicator = it.next();
+			led.setBackground(indicator.getColor(false));
+            led.setToolTipText(indicator.getName());
 			led.setOpaque(true);
 			led.setVerticalAlignment(SwingConstants.CENTER);
 			led.setHorizontalAlignment(SwingConstants.CENTER);