notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r1577 - in development/laboratory/planet/components/fsm: basic/src/main/net/dpml/fsm/basic demo/trafficlight/src/main/net/dpml/fsm demo/trafficlight/src/main/net/dpml/fsm/trafficlight
- From: niclas AT netcompartner.com
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r1577 - in development/laboratory/planet/components/fsm: basic/src/main/net/dpml/fsm/basic demo/trafficlight/src/main/net/dpml/fsm demo/trafficlight/src/main/net/dpml/fsm/trafficlight
- Date: Mon, 24 Jan 2005 12:57:59 +0100
Author: niclas
Date: Mon Jan 24 12:57:58 2005
New Revision: 1577
Added:
development/laboratory/planet/components/fsm/demo/trafficlight/src/main/net/dpml/fsm/Resources.properties
- copied, changed from r1562,
development/laboratory/planet/components/fsm/demo/trafficlight/src/main/net/dpml/fsm/Resouces.properties
Removed:
development/laboratory/planet/components/fsm/demo/trafficlight/src/main/net/dpml/fsm/Resouces.properties
Modified:
development/laboratory/planet/components/fsm/basic/src/main/net/dpml/fsm/basic/TransitionComponent.java
development/laboratory/planet/components/fsm/basic/src/main/net/dpml/fsm/basic/TransitionImpl.java
development/laboratory/planet/components/fsm/demo/trafficlight/src/main/net/dpml/fsm/trafficlight/Timer.java
Log:
Trafficlight is finally operational.
Modified:
development/laboratory/planet/components/fsm/basic/src/main/net/dpml/fsm/basic/TransitionComponent.java
==============================================================================
---
development/laboratory/planet/components/fsm/basic/src/main/net/dpml/fsm/basic/TransitionComponent.java
(original)
+++
development/laboratory/planet/components/fsm/basic/src/main/net/dpml/fsm/basic/TransitionComponent.java
Mon Jan 24 12:57:58 2005
@@ -124,7 +124,6 @@
{
m_beginState.exit();
m_endState.entry();
-
TransitionEvent event = new TransitionEvent( source, this, fsm );
Iterator list;
synchronized( m_listeners )
Modified:
development/laboratory/planet/components/fsm/basic/src/main/net/dpml/fsm/basic/TransitionImpl.java
==============================================================================
---
development/laboratory/planet/components/fsm/basic/src/main/net/dpml/fsm/basic/TransitionImpl.java
(original)
+++
development/laboratory/planet/components/fsm/basic/src/main/net/dpml/fsm/basic/TransitionImpl.java
Mon Jan 24 12:57:58 2005
@@ -116,7 +116,6 @@
{
m_beginState.exit();
m_endState.entry();
-
TransitionEvent event = new TransitionEvent( source, this, fsm );
Iterator list;
synchronized( m_listeners )
Copied:
development/laboratory/planet/components/fsm/demo/trafficlight/src/main/net/dpml/fsm/Resources.properties
(from r1562,
development/laboratory/planet/components/fsm/demo/trafficlight/src/main/net/dpml/fsm/Resouces.properties)
==============================================================================
---
development/laboratory/planet/components/fsm/demo/trafficlight/src/main/net/dpml/fsm/Resouces.properties
(original)
+++
development/laboratory/planet/components/fsm/demo/trafficlight/src/main/net/dpml/fsm/Resources.properties
Mon Jan 24 12:57:58 2005
@@ -1,18 +1,18 @@
-state-red.name=Red
-state-red.description=Red signal means "stop".
+red.name=Red
+red.description=Red signal means "stop".
-state-yellow.name=Yellow
-state-yellow.description=Yellow signal means "go faster" :o)
+yellow.name=Yellow
+yellow.description=Yellow signal means "go faster" :o)
-state-green.name=Green
-state-green.description=Green signal means "go".
+green.name=Green
+green.description=Green signal means "go".
-transition-red-to-green.name=GoingToGreen
-transition-red-to-green.description=Signal changing from Red to Green.
+red-to-green.name=GoingToGreen
+red-to-green.description=Signal changing from Red to Green.
-transition-green-to-yellow.name=GoingToGreen
-transition-green-to-yellow.name=GoingToGreen
+green-to-yellow.name=GoingToGreen
+green-to-yellow.name=GoingToGreen
-transition-yellow-to-red.name=GoingToGreen
-transition-yellow-to-red.name=GoingToGreen
+yellow-to-red.name=GoingToGreen
+yellow-to-red.name=GoingToGreen
Modified:
development/laboratory/planet/components/fsm/demo/trafficlight/src/main/net/dpml/fsm/trafficlight/Timer.java
==============================================================================
---
development/laboratory/planet/components/fsm/demo/trafficlight/src/main/net/dpml/fsm/trafficlight/Timer.java
(original)
+++
development/laboratory/planet/components/fsm/demo/trafficlight/src/main/net/dpml/fsm/trafficlight/Timer.java
Mon Jan 24 12:57:58 2005
@@ -64,7 +64,6 @@
System.out.println( "Creating Trafficlight." );
m_stateMachine = (StateMachine) man.lookup( "fsm" );
m_initial = (State) man.lookup( "initial-state" );
- m_stateMachine.addTransitionListener( this, null );
}
public void start()
@@ -86,7 +85,8 @@
m_run = true;
String command = "next";
m_stateMachine.reset( m_initial );
- m_nextWait = 5000;
+ m_nextWait = 1000;
+ m_stateMachine.addTransitionListener( this, null );
try
{
while( m_run )
@@ -94,7 +94,6 @@
synchronized( this )
{
wait( m_nextWait );
- m_nextWait = 100;
m_stateMachine.trigger( this, command );
}
}
@@ -114,11 +113,11 @@
System.out.println( sdf.format( date ) + " : " + stateName );
String id = state.getIdentity();
- if( id.equals( "state-red" ) )
+ if( id.equals( "red" ) )
m_nextWait = 5000;
- if( id.equals( "state-yellow" ) )
+ if( id.equals( "yellow" ) )
m_nextWait = 1000;
- if( id.equals( "state-red" ) )
+ if( id.equals( "red" ) )
m_nextWait = 5000;
}
}
- svn commit: r1577 - in development/laboratory/planet/components/fsm: basic/src/main/net/dpml/fsm/basic demo/trafficlight/src/main/net/dpml/fsm demo/trafficlight/src/main/net/dpml/fsm/trafficlight, niclas, 01/24/2005
Archive powered by MHonArc 2.6.24.