Am 18.05.2013 um 00:55 schrieb Dave <[email protected]>:

> EBo, dave, Michael, Andy...
> 
> Thank you for the explanations...
> 
>>> Bang, trapped again. You simplify an implementation; you never simplify the 
>>> model proper because that gives you the power to describe the complex_and_  
>>> the simple.
> 
>>> Note: the mess we have now is the result of 'going simple and optimizing 
>>> the common case' too early.
> 
> I get it..  way to early to be discussing simplifications.
> I can understand how early simplifications can cause problems down the 
> road.  I have entered that trap before!  ;-)
> 
> Ebo, you make a good point regarding the future also.. regarding other 
> possible offsets.
> 
>>> I don't know if you would need more than two offsets. I suspect that
>>> three would be plenty.
> 
> Certainly tool and wear offsets are a must, but it isn't hard to imagine 
> more than two being required in some situations.
> Perhaps the number of offsets should be configurable??  Offsets could 
> come from a number of sources..

Let's look at a simple example how you would model offsets in a relational 
schema, since it's a good example to start thinking about this:

you'd have the following tables (the first attribute is the primary key and 
unique - no duplicates):

   tools(toolid, length, diameter, other-non-offset parameters) 
   offsets(offsetid, xoffset,yoffset..., purpose)  (purpose could be: 
coordinate system offset, wear, tool holder..)

then you have a relation describing the active offsets, which is 1:N in nature 
(a tool can have an arbitrary number of offsets or none at all):

   tooloffsets(toolid, offsetid) (only toolid is a primary key)

the actual offset of a tool is a view of these relations, say defined as 
activeoffset(tool) which does the following:
- select all tooloffsets where tool == toolid, and add the columns of matches 
to determine the compound offset

(there is no point and no simplification gained in limiting the size of the 
tooloffsets table)

the following operations would become toolstore API calls  (among others) *):

- activating an offset(o) for tool(t) : this becomes an insert operation on 
table tooloffsets(t,o)
- deactivating an offset(o) of tool(t): becomes a delete operation on 
tooloffsets(t,o)
- changing an offset(o) whether active or not: becomes an update operation on 
table offsets where offsetid == o
- retrieving the current offset becomes a select on the abovementioned view

Note that database object (tables, rows, views) do not cross the API - those 
are internal to the toolstore, which means the interpreter, gui, motion etc 
remain agnostic wrt the storage mechanism


a loosely related example, which expresses some of the above in a sqlite3 
schema: http://pastebin.com/sAqJW6TV
(this was an attempt to formulate the idea of tool holders which came up a long 
time ago on the list; conceptually holders are a form of offsets and probably 
could be subsumed under offsets) 
the 'actual offset' view is called 'total_offsets' there and the view is 
defined in line 108

-m 

*) to become useful in the linuxcnc context, API calls would need an extra 
'perspective' parameter, which could be either 'interpreter' or 'machine' as 
the interpreter might be far ahead of the machine

plus there would be operations to synchronize perspectives: 'apply offset' 
means to commit the interpreter perspective to the machine perspective at an 
appropriate point during execution; whereas 'synchronize interpreter' would 
mean to commit the machine view to the interpreter view  (e.g. on startup)




> 
> Dave Cole
> 


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to