Forwarded message: From lechner Fri Jun 25 03:42:31 1999 RJLRef: $CASE/99s523/genmerge/bdeReplayYxu.fdbk.990625 How am I (any reader) supposed to know what project source code you studied below? Even if you specified the path(s) in a prior document, you give no reference to it so it remains a mystery. I am not sympathetic to your pessimisticc conclusions because it looks like you either studied the wrong project, or you don't understand the power of genlog and rrassman's pr_set replay extensions (see rrassman's report for pr_set replay and see the genlog project report and user manual by the GTE team for the complete story on genlog operation. (genlog was probably not yet tested with the bde application - another reason to rebuild bde.) NO code needs to be written to log out any table row creation; and NO code needs to be written to log out any pr_set field change. Genlog/GTE/rrassman generates it all (in bde/pr_util not bde/src). The new code is a call to pr_dump_row or to write a pr_set command to the log file, and is contained inside the pr_set macro body. I'm assuming - please verify this- that rrassman modified chgen to define this new pr_set macro. Rrassman's extensions of genlog should show how pr-set replays are accomplished, and he has simple non-bde test cases with sample log.dat output = replay input. You are correct that mouse movement etc. is NOT loggable right now. Again, you MUST NOT write custom logging code for this either: but you DO have to declare a new one-row MousePosition (MP) table in the bde schema with 3 fields: hcg_key MPid, int x and int y, to capture mouse position fields, and you DO have to add two pr_set_int calls within do_button_event's mouse-move event case, brackets in do_button_event()'s switch(event-type) statement. to update that position from XEvent fields when each mouse-move event is received. Another question is how the mouse gets displayed during replay, since the observer is not moving his local mouse. THis is another question, but a call to draw any bitmapped icon aat that positiion will do for the demo. Bde probably has examples. Note that if 2 remote mice are also being tracked there will simply be 3 MP-rows with MPid = MP000001, MP000002, MP000003. The log and replay code is the same; each mouse is a distinct icon to be redrawn at its own x,y position to replay the diagram history. (Do_button_event switches on state first, then event, and states are partitioned by class=table type then action=method. (Later, do_button code will be partitioned into table-specific method files HG_ops.cc, HN_ops.cc etc. Therefore the mouse-move global update code shold be duplicated inside each switch(state) statement that includes a switcn(Xevent) case for mouse-move. . (This will update mouse x,y position in pixel coordinates only. The mouse position is only for human consumption, not .dat files, so we don't care about persistent moue position in world coordinates anyway.) Then you need to remake bde, which reruns chgen to regenerate pr_util, which generates new pr_set macros to log mouse position changes, just like any other bde schema table. THis can handle any other X-event types of interest (e.g. mouse button1 Up/down and text input). (Expose events might be loggd to keep track of user mouse entry and exit from canvas window or bde process window.) Bob Lechner Hi Prof. > WHAT SRC CODE? RJL > I have go through most of all the source code quickly. But I can not find > the source code for log and replay and do not know how they works. > I only find a code snippet in log_menu.cc under bde/src directory. > WHAT SRC DIR'Y? > Also I am thinking of the way to do the project. > First if we only need to log the activities on the cavas which record the > develop process of a diagram. It is a database of something like: > (timestamp, action, coordination, attribute) > this way we need to change big dobutton call back function code to make > them log the activities. You miss the point of genlog and rrassman. Did you read them? > > Second if we need to log all the activities of a user. We need to change > all the call back function not only the dobutton big switch case but also > all the widgets' call back function. And to log mouse movement is still a > problem I am searching. Why searching? Xevent type is a do_button_event case branch argument already and Xevent struct fields are documented in some < X*.h>. > > This is only for record part. For replay part, we can use file or socket > instead of event from X-Server as input to replay. > Yes - I believe you could even use two pipes instead, between the bde logging process and the bde replay process. > I think for record, I will select the second method to do it because it is > more close to the project's goal. The problem is that there is too much of > them need to change. I think I can only do part of them. For replay if the > way is we think is reality, I will try to finishe it so that I can do a > demo when I finished the project. I require mouse move event tracking as the ONLY NEW logging function. All database update functions are already logged/replayed (by genlog/replay) as far as the database only. The file_input or work_proc code should count input records of pr_add or pr_set type, and include a conditional call to bde's redraw function after every [#define K] K-th pr-set command and after each pr_add command is replayed, to demonstate the concept.