Ver código fonte

Refactoring of code.

markus.muehlbrandt@gmail.com 13 anos atrás
pai
commit
cdf2b86b09

+ 2 - 3
examples/org.yakindu.sct.examples.trafficlight/.settings/org.eclipse.core.resources.prefs

@@ -1,3 +1,2 @@
-#Mon Apr 23 15:50:54 CEST 2012
-eclipse.preferences.version=1
-encoding/TrafficLightWaiting.sct=UTF-8
+eclipse.preferences.version=1
+encoding/TrafficLightWaiting.sct=UTF-8

+ 8 - 8
examples/org.yakindu.sct.examples.trafficlight/src-gen/org/yakindu/sct/examples/trafficlight/cyclebased/IStatemachine.java

@@ -8,17 +8,17 @@ package org.yakindu.sct.examples.trafficlight.cyclebased;
 public interface IStatemachine {
 
 	/**
-	 * Initializes the statemachine. Use to init internal variables etc.
-	 */
+	* Initializes the statemachine. Use to init internal variables etc.
+	*/
 	public void init();
 
 	/**
-	 * Start a run-to-completion cycle.
-	 */
-	public void runCycle();
+	* Enters the statemachine. Sets the statemachine in a defined state.
+	*/
+	public void enter();
 
 	/**
-	 * Enters the statemachine. Sets the statemachine in a defined state.
-	 */
-	public void enter();
+	* Start a run-to-completion cycle.
+	*/
+	public void runCycle();
 }

+ 16 - 16
examples/org.yakindu.sct.examples.trafficlight/src-gen/org/yakindu/sct/examples/trafficlight/cyclebased/ITimedStatemachine.java

@@ -1,30 +1,30 @@
 package org.yakindu.sct.examples.trafficlight.cyclebased;
 
 /**
- * Interface for state machines which use timed event triggers.
- */
+* Interface for state machines which use timed event triggers.
+*/
 public interface ITimedStatemachine {
 
 	/**
-	 * Set the {@link ITimerService} for the state machine. It must be set
-	 * externally on a timed state machine before a run cycle can be correct
-	 * executed.
-	 * 
-	 * @param timerService
-	 */
+	* Set the {@link ITimerService} for the state machine. It must be set
+	* externally on a timed state machine before a run cycle can be correct
+	* executed.
+	* 
+	* @param timerService
+	*/
 	public void setTimerService(ITimerService timerService);
 
 	/**
-	 * Returns the currently used timer service.
-	 * 
-	 * @return {@link ITimerService}
-	 */
+	* Returns the currently used timer service.
+	* 
+	* @return {@link ITimerService}
+	*/
 	public ITimerService getTimerService();
 
 	/**
-	 * Callback method if a {@link TimeEvent} occurred.
-	 * 
-	 * @param timeEvent
-	 */
+	* Callback method if a {@link TimeEvent} occurred.
+	* 
+	* @param timeEvent
+	*/
 	public void onTimeEventRaised(TimeEvent timeEvent);
 }

+ 1 - 1
examples/org.yakindu.sct.examples.trafficlight/src-gen/org/yakindu/sct/examples/trafficlight/cyclebased/TimeEvent.java

@@ -13,7 +13,7 @@ public class TimeEvent {
 	private boolean periodic;
 
 	private ITimedStatemachine statemachine;
-
+	
 	int index;
 
 	/**

+ 2 - 1
examples/org.yakindu.sct.examples.trafficlight/src-gen/org/yakindu/sct/examples/trafficlight/cyclebased/TimerService.java

@@ -15,7 +15,8 @@ public class TimerService implements ITimerService {
 
 	private final Map<TimeEvent, TimerTask> timerTaskMap = new HashMap<TimeEvent, TimerTask>();
 
-	public void setTimer(final TimeEvent event, long time, long cycleStartTime) {
+	public void setTimer(final TimeEvent event, long time,
+			long cycleStartTime) {
 		// Reset existing TimerTask for event. This step isn't necessary if
 		// timer tasks are properly reset by sexec model.
 		if (timerTaskMap.containsKey(event)) {

+ 4 - 9
examples/org.yakindu.sct.examples.trafficlight/src-gen/org/yakindu/sct/examples/trafficlight/cyclebased/trafficlightwaiting/ITrafficLightWaitingStatemachine.java

@@ -1,5 +1,4 @@
 package org.yakindu.sct.examples.trafficlight.cyclebased.trafficlightwaiting;
-
 import org.yakindu.sct.examples.trafficlight.cyclebased.IStatemachine;
 import org.yakindu.sct.examples.trafficlight.cyclebased.ITimedStatemachine;
 
@@ -9,7 +8,6 @@ public interface ITrafficLightWaitingStatemachine
 			IStatemachine {
 
 	public interface SCITrafficLight {
-
 		public boolean getRed();
 		public void setRed(boolean value);
 		public boolean getYellow();
@@ -19,8 +17,9 @@ public interface ITrafficLightWaitingStatemachine
 
 	}
 
-	public interface SCIPedestrian {
+	public SCITrafficLight getSCITrafficLight();
 
+	public interface SCIPedestrian {
 		public boolean getRequest();
 		public void setRequest(boolean value);
 		public boolean getRed();
@@ -30,18 +29,14 @@ public interface ITrafficLightWaitingStatemachine
 
 	}
 
-	public interface SCIDefault {
+	public SCIPedestrian getSCIPedestrian();
 
+	public interface SCIDefault {
 		public void raisePedestrianRequest();
-
 		public void raiseOnOff();
 
 	}
 
-	public SCITrafficLight getSCITrafficLight();
-
-	public SCIPedestrian getSCIPedestrian();
-
 	public SCIDefault getSCIDefault();
 
 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 506 - 396
examples/org.yakindu.sct.examples.trafficlight/src-gen/org/yakindu/sct/examples/trafficlight/cyclebased/trafficlightwaiting/TrafficLightWaitingStatemachine.java