Grid 2 Scientific Calculator

The Grid 2 provides a number of workspaces to do neat things; control a mobile phone, environmental control using a plethora of connecting devices, computer control and programme control to control windows based programmes and many more. If you would like to have a simple calculator there is also “Calculator” workspace which allows you to have a simple addition, minus, division and multiplication calculator. Currently if you want a higher level scientific calculator you have a number of options; the obvious is to use the calculator in windows and use a computer control grid to control the calculator (hint and hint). Although programme/computer control is very neat - it can mess a keyguard user up as you need to make space for the programme. So the alternative in this case? Well you could get more advanced things like 1/x, exponentials and so forth in the standard Grid computer control workspace - simply by programming the formulae into Grid cells - but only if you can do it using the +,-,*,/ signs.. and you quickly come unstuck when you need to reference variables..

As a different approach I wondered “could we create a more complex calculator using an external programme to handle the math!?”. To do this I tried creating a small executable that you pass a mathematical argument to (e.g. –command=sinh ) and a value (e.g. –toeval=121 - if no argument passed takes what is in the current copy buffer) and then the output is passed back within the paste buffer.

The answer to my query is “Kind of”. The difficulty is that the grid doesn’t have any neat ways of passing variables or functions back and forth - either within it or externally via an API. The only way (thanks to Barney for this tip off) is using the copy buffer of Windows.

This is ok - but it means that if you wanted to do a sum like (121 * 45) + 16² = you can’t simply. Currently you would have to do 121 *45 on its own, remember the result then do a 16² and add that to the previous result. If anyone has a neat way of creating a Memory button then that would help!

(There is another way - I guess you could use a text chat workspace and replicate what the calculator workspace does by firing every piece of text off and analysing it.. thing is though you have to put a wait command on the grid for the exe to run and its all a bit slow..)

Anyway - if you fancy using what I have created in its current form and want to hack it go ahead. The code:

The Grid Bundle and Executable (nb: its windowless) (to use place the GridSciCalc directory at C:/ - feel free to edit the paths in the bundle The source code of the Executable