TAP Controller FSM - fsm

Conventional flow of writing a tap register is, provide IR value followed by DR value. in that case why TAP controller FSM has SELECT_DR Stage followed by SELECT_IR Stage? is there any particular reason IR Stages implemented after DR Phases? Thank you in advance.
Trying to implement TAP controller FSM.

Related

How can i use sub process in APS/activiti

Requirement :
Candidates will Fill Application Form.
HR will review the application and submits for Technical Team Approval(P2).
After Technical team review HR need not to wait for Manger approval and HR should be able to get technical team data(with or without manager approval).
HR should be able to submit for Final Approval.
P1:
P2:
Solutions I have tried:
If i use Collapsed sub process i need to wait till the completion of Manager Approval task.
I tried using the sub process, throwing and catching events. Created two sub process, 1st sub process will throw signal and second sub process will catch signal if HR submits another application the 2nd sub process will not catch the signal.
If i use Call Activity multi-instance type as Sequential i need to provide Cardinality it will be fixed number of application HR will be able to submit for Technical Approval, in my case it should not be fixed number of loop.
If i use Call Activity, the Call Activity will not share its data to P1 process, in my case data should be shared from P2 to P1.
Kindly any one help me.
Thanks & Regards
Amruta Wandakar

RPC synchronization alternative MMORPG, Photon Unity3D

I'm using Photon Unity Networking and I am working on a little game of mine.
I got to a point where I have a room with players and mobs.
When a new player appears I use RPC call to update information about this player to all other connected users to get synchronized.
The problem is.. that this new player does not have any information about the rest of the room (his info is not up to date).
I mean for instance current health of other players, or current health of mobs, etc.
The only only solution I came up with is to send an RPC to a master client, pass through all volatile objects around and send several RPC calls back to the new player with this update.
What I am asking is... do I really have to it like this? Or is there any other way, any better or simpler way?
Okay so the phonton networking works via photon network view - and its observed components, means scripts
in this observed script you have to pass (if its your character and you are controlling it)
m_PhotonView = GetComponent<PhotonView>(); //Variable
if( m_PhotonView.isMine == true ) //in Void Update()
all variables you need, position, rotation, name, health, relevant data for animations and so on by using SetSynchronizedValues()
Variable = GetComponent<PhotonTransformView>();
Variable .SetSynchronizedValues( Position, Health , Name);
and it will synchronise the Variables, then you have to use them (display the name, set the object to the correct position , show a health bar and resize it) if it's an non controlled character only
if( m_PhotonView.isMine == false)
Hope I could help you

Messenger Plugin asynchronous messages

I want to use Stuart's messenger plugin to give instant user messages when a business process is done. eg. in my BL class I have the code:
var message = new UserMessages(this, "STARTING PROCESS");
_messenger.Publish<UserMessages>(message );
//PROCESS START
message = new UserMessages(this, "READING FILE 1");
_messenger.Publish<UserMessages>(message);
//READING FILE 1 PROCESS
message = new UserMessages(this, "ENDING PROCESS");
_messenger.Publish<UserMessages>(message);
//END PROCESS
I want my subscriber to show the message asynchronously (instantly in the gui). I have tried to use
_token = messenger.SubscribeOnThreadPoolThread<UserMessages>(OnImportMessage);
inside my viewmodel because I thought that this is what SubscribeOnThreadPoolThread is supposed to do but it didn't show me the expected outcome meaning:
1.The user clicks a button and based on my messaging service above the user must see inside the textedit control:
1.STARTING PROCESS
2.READING FILE1
3.ENDING PROCESS
What I finally displayed on the screen was the last message "ENDING PROCESS" because eventually the whole process was part of the Main Thread.
I want to understand how to do this asynchronously with the messenger plugin.
Do I need to use additional async/await operations?
I hope this makes sense to you.
Thanks in advance

AS3 Robot legs and Signals - Using Signals, Quite verbose, any alternatives?

Im using RobotLegs and Signals for my application. This is my first time using Robotlegs, and Im using Joel Hooks Signal Command Map example here
I've noticed that it seems quite verbose in contrast to events. For every Signal I have to create a new class, whereas with events I would group event types into one class.
I like how visually and instantly descriptive this is.. just browsing a signals package will reveal all app communications. Although it seems quite verbose to me.
Are other people using this, Is the way I'm using signals like this correct, or have people found a way around this verboseness?
Cheers
It's the correct way though. The major advantage of signals is you can include them in your interface definitions, but obviously you'll end up with a big pile of signals.
In general I use signals only for my view->mediator and service->command communication (1-to-1). For system wide notifications I use events (n-to-n). It makes the number of signals a bit more manageable.
But it's a matter of preference obviously.
Using a good IDE and/or a templating system alleviates a lot of the "pain" of having to create the various signals.
You do not have to make a new signal class for Command maps, its just good practice. You could just give the "dataType" class a type property - and do a switch on that. But that would be messy for commands. But note, Commands are basically for triggering application wide actions.
Not all signals trigger application wide actions.
For instance, if you are responding to a heap of events from a single View. I suggest making a Signal class for related "view events" (e.g. MyButtonSignal for MyButtonView) and give it a type property.
A typical signal of mine will look like:
package {
public class MyButtonSignal extends Signal {
public static const CLICK:String = 'myButtonClick';
public static const OVER:String = 'myButtonOver';
public function MyButtonSignal() {
super(String, Object);
}
}
}
Dispatch like so
myButtonSignal.dispatch(MyButtonSignal.CLICK, {name:'exit'});
Listen as normal:
myButtonSignal.add(doMyButtonSignal);
Handle signal like so:
protected function doMyButtonSignal(type:String, params:Object):void {
switch(type) {
case MyButtonSignal.CLICK: trace('click', params.name);
break;
case MyButtonSignal.OVER: trace('OVER', params.name);
break;
}
}
Occasionally its useful to give the data variable its own data class.
So everytime you realise "Aw shit, I need to react to another event", you simple go to the Signal and add a new static const to represent the event. Much like you (probably?) did when using Event objects.
For every Signal I have to create a new class, whereas with events I
would group event types into one class.
Instead of doing that you could just use the signal as a property… something like:
public var myCustomSignal:Signal = new Signal(String,String);
You can think of a signal as a property of your object/interface.
In Joel's example he's using signals to denote system level events and is mapping them with the robotlegs SignalMap which maps signals by type. Because they are mapped by type you need to create a unique type for each system level signal.

Statefinalization/initialization activity only runs on leaf states

I am trying to get my Windows State Machine workflow to communicate with end users. The general pattern I am trying to implement within a StateActivity is:
StateInitializationActivity: Send a message to user requesting an answer to a question (e.g. "Do you approve this document?"), together with the context for...
...EventDrivenActivity: Deal with answer sent by user
StateFinalizationActivity: Cancel message (e.g. document is withdrawn and no longer needs approval)
This all works fine if the StateActivity is a "Leaf State" (i.e. has no child states). However, it does not work if I want to use recursive composition of states. For non-leaf states, StateInitialization and StateFinalization do not run (I confirmed this behaviour by using Reflector to inspect the StateActivity source code). The EventDrivenActivity is still listening, but the end user doesn't know what's going on.
For StateInitialization, I thought that one way to work around this would be to replace it with an EventDrivenActivity and a zero-delay timer. I'm stuck with what to do about StateFinalization.
So - does anyone have any ideas about how to get a State Finalization Activity to always run, even for non-leaf states?
Its unfortunate that the structure of "nested states" is one of a "parent" containing "children", the designer UI re-enforces this concept. Hence its quite natural and intuative to think the way you are thinking. Its unfortunate because its wrong.
The true relationship is one of "General" -> "Specific". Its in effect a hierachical class structure. Consider a much more familar such relationship:-
public class MySuperClass
{
public MySuperClass(object parameter) { }
protected void DoSomething() { }
}
public class MySubClass : MySuperClass
{
protected void DoSomethingElse() { }
}
Here MySubClass inherits DoSomething from SuperClass. The above though is broken because the SuperClass doesn't have a default constructor. Also parameterised constructor of SuperClass is not inherited by SubClass. In fact logically a sub-class never inherits the constructors (or destructors) of the super-class. (Yes there is some magic wiring up default constructors but thats more sugar than substance).
Similarly the relationship between StateAcivities contained with another StateActivity is actually that the contained activity is a specialisation of the container. Each contained activity inherits the set of event driven activities of the container. However, each contained StateActivity is a first class discrete state in the workflow same as any other state.
The containing activity actual becomes an abstract, it can not be transitioned to and importantly there is no real concept of transition to a state "inside" another state. By extension then there is no concept of leaving such an outer state either. As a result there is no initialization or finalization of the containing StateActivity.
A quirk of the designer allows you to add a StateInitialization and StateFinalization then add StateActivities to a state. If you try it the other way round the designer won't let you because it knows the Initialization and Finalization will never be run.
I realise this doesn't actually answer your question and I'm loath to say in this case "It can't be done" but if it can it will be a little hacky.
OK, so here’s what I decided to do in the end. I created a custom tracking service which looks for activity events corresponding to entering or leaving the states which are involved in communication with end users. This service enters decisions for the user into a database when the state is entered and removes them when the state is left. The user can query the database to see what decisions the workflow is waiting on. The workflow listens for user responses using a ReceiveActivity in an EventDrivenActivity. This also works for decisions in parent ‘superstates’. This might not be exactly what a "Tracking Service" is meant to be for, but it seems to work
I've thought of another way of solving the problem. Originally, I had in mind that for communications I would use the WCF-integrated SendActivity and ReceiveActivity provided in WF 3.5.
However, in the end I came to the conclusion that it's easier to ignore these activities and implement your own IEventActivity with a local service. IEventActivity.Subscribe can be used to indicate to users that there is a question for them to answer and IEventActivity.Unsubscribe can be used to cancel the question. This means that separate activities in the State's inialization and finalization blocks are not required. The message routing is done manually using workflow queues and the user's response is added to the queue with appropriate name. I used Guid's for the queue names, and these are passed to the user during the IEventActivity.Subscribe call.
I used the 'File System Watcher' example in MSDN to work out how to do this.
I also found this article very insructive: http://www.infoq.com/articles/lublinksy-workqueue-mgr

Resources