Help with Triggers with parameters using custom enums

102 views
Skip to first unread message

Chris Marrs

unread,
Feb 7, 2014, 6:18:59 PM2/7/14
to dotnet-state-ma...@googlegroups.com
Hi, I am having a run time error trying to use a custom enum with a trigger that has parameters.  When I fire this this trigger, for example:

_MotionMachine.Fire(_RotateCardinalPosition_ParamTrigger, CardinalPos, TimeOut);

I get an error at run time saying:

The argument in position 0 is of type GyroTesterPlus.KFLOP_Motion+CardinalPositions but must be of type System.Double.

CardinalPositions is an enum that has 4 values each assigned to an int.

I have another function that uses a double instead of the enum and it runs fine.  Am I missing something for this to work?

Grant BlahaErath

unread,
Feb 9, 2014, 11:13:17 PM2/9/14
to dotnet-state-ma...@googlegroups.com

Hi Chris,

I haven't used the library in a couple years but I believe the type is determined when you instantiated the MotionMachine object. Maybe you used a double there.

-g

--
 
---
You received this message because you are subscribed to the Google Groups "Stateless .NET State Machine Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotnet-state-machine-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Chris Marrs

unread,
Feb 10, 2014, 2:54:57 PM2/10/14
to dotnet-state-ma...@googlegroups.com
I figured it out a few hours later.  I had 2 triggers with params declared on the same base trigger.  I realized I was trying to create an overloaded trigger. So instead, I created 2 different triggers.
To unsubscribe from this group and stop receiving emails from it, send an email to dotnet-state-machine-framework+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages