What are emotions at their very basic level?
Emotions are basically thoughts which trigger certain effects in our bodies.
Since we can’t monitor our every thought, emotions are a kind of indication of the general directions our thoughts are going.
So, if we have many thoughts that have been designed to trigger certain chemicals to produce certain reactions, then we say we are sad/angry/happy and so on and there is a bodily reaction based on what chemical is triggered (i.e. adrenalin et al).
To do the same in machines, all you have to do is tag each process running and group those tags in a visual representation. Thus you can tell if the machine is happy, ponderous, sad and so on by the tags on the processes running. Based on these tags, you could have the machine perform other actions, just like our bodies reacting to chemicals it produces.
Now, all I need to do is figure out how to classify running processes and add a graph of some sort :)