to Add Animation Windows to TkShift GUI

1. Introduction

Animation windows created for the circular highway and racetrack simulations are added to TkShift , by making changes to the following files in <source>/lib/TkShift directory, where <source> is the directory location of your SHIFT installation:

Additional drawing procedures for the highway descriptions are very crude, and will cause TkShift to stop while generating the animation window.

NOTE: The changes described here are tested under version 2.12.


2. Additions to Files

The following changes need to be made in order to create an additional menu item in TkShift animation window:

File Name
Changes/Additions
animation-create.tcl Add canvas name to if-elseif section of the file, e.g.:
   } elseif {$CanvasName == "Circular"} {
        CreateCanvasInstance $CanvasNumber 1 Circular 
        lappend ExistingCanvases(Circular) $CanvasNumber 
        set CanvasTypeArray($CanvasNumber) Circular 
   }
canvases.tcl Add procedure for canvas drawing to the file, e.g.:
   proc DrawTrack {w {zoom_index 1}} {
        set lw 4
        set sl 100
        $w create rectangle [expr $sl/$zoom_index] 0 \ 
	   [expr 3*$sl/$zoom_index] [expr $lw/$zoom_index];
        ... 
        (more definitions) 
        ...
   }
canvas-parameters.tcl Add canvas name to "Canvases", and define canvas parameters at the end of the file, e.g.:
   set XDefault(Track) "gxp"
   ...
   (more definitions)
   ...
   set CanvasStructure(Track,procedure) DrawTrack


Required additions for circular highway and racetrack simulations are given here.


3. References


Back to Sensor and HDM page
Cem Ünsal

Last modified on December 5, 1997