[Gbbopen-list] Losing events
Paul Werkowski
pw at snoopy.mv.com
Fri Mar 30 08:01:31 EDT 2007
Dan Corkill wrote:
>>> Did you specific :plus-subclasses on the :ks-triggers of MY-KS?
>>>
>>>
>> No. just (define-ks my-ks :trigger-events ((my-other-event)) ...)
>> The other ks defs had ((create-instance my-unit-class-x)) triggers.
>
> Paul,
>
> Actually, you did specify :plus-subclasses in your :trigger-events
> specification (but not intentionally). When you changed your
> my-other-event from a non-instance event to an instance event, you did
> not add a unit-class qualifier to your define-ks :trigger-events
> specification. The Agenda Shell treats this in the same way as if you
> had requested an event-function to be added (using add-event-function)
> and did not specify the instance-class qualifier.
>
> For example, compare the behavior of:
>
> (add-event-function 'fn1 'create-instance-event 'my-unit-class-x)
> (describe-event-function 'fn1)
>
> with
>
> (add-event-function 'fn2 'create-instance-event)
> (describe-event-function 'fn2)
>
> The same behavior holds for:
>
> :trigger-events ((create-instance-event my-unit-class-x))
>
> versus
>
> :trigger-events ((create-instance-event))
I may have given misleading info. Checking closer, I have..
(define-event-class my-other-event (single-instance-event)())
Some KSs had :trigger-events ((create-instance my-unit-class-x)) as
mentioned where my-unit-class-x represents a variety of class names
having nothing to do with my-other-event.
The KS using my-other-event was defined like this..
(define-ks :trigger-events ((my-other-event)) ...)
and activated by (signal-event 'my-other-event).
The output from describe-all-event-functions as noted in previous message is
MY-OTHER-EVENT
> STANDARD-UNIT-INSTANCE
> Triggers: MY-KS
> MY-UNIT-CLASS-X
> Triggers: MY-KS
> MY-UNIT-CLASS-Y
> Triggers: MY-KS
> <a long list like this>
>
>
I guess I'm not sure how to read that. Is it saying that
* make-instance of any unit-class is triggering my-ks?
* (signal-event 'my-other-event) triggers unrelated kss?
None of the above seems right.
Changing to
(define-event-class my-other-event (non-instance-event) ...)
in the running environment seems to remove any mention of my-other-event
from the output of describe-all-event-functions.
Reloading all into a fresh environment arranges things such that
describe-all-event-functions says my-other-event triggers only my-ks.
MY-OTHER-EVENT
Triggers: MY-KS
If this all correct as you describe, how should I expand the
:trigger-events to be more specific.
;; KS triggered by my-other-event
(define-ks my-ks :trigger-events ((my-other-event + more stuff?))
or
;; KS not triggered by my-other-event
(define-ks ks-x :trigger-events ((create-instance my-unit-class-x + more
stuff?))
Paul
Who is feeling quite confused.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the Gbbopen-list
mailing list