Dean Hystad's Pod Software (GresIII Version)		BKT 25-May-05

This document details changes to the standard pod software distribution,
and how to use it.

All modules are contained in folder AppPod.  All *.c and *.h files are compiled
in this folder and do not have to be copied anywhere.  All *.alt files are copied
to the AppGui folder so that only that folder need be distributed to remake GUI
software in the field.  The pod firmware file pod.hex is copied to the bin folder.

Make the following changes to the standard distribution:

1) Rename the folder from AppDsp to AppPod.

2) Delete files

	aadefine.alt
	GresIII.alt
	PodManager.alt

3) In GresIII.c:

   a) Change method "setInterrupt" to "attach".

   b) Change method "dump" to "debug".

4) In Pod.c:

   a) change method "writeCmd" to "setValue" so as not to conflict
      with local procedure of that name in the Mts493 classes.

   b) Change method "dump" to "debug".

5) In Pod.alt:

   a) Change

	CLASS Pod OF DSPObject IS
 
     to

	CLASS Pod OF DspModel IS

   b) Delete method createRemote.

   c) Delete method writeVar.

   d) Replace method init with
	
	METHOD init[parent, remoteName] IS
	BEGIN
		super.init[parent, remoteName]
		firmware := NIL
		command  := IntegerArray.newWith[10]
	END METHOD

   e) Add methods

	METHOD status[size, array] IS
	BEGIN
		IF remote THEN
			RETURN remote.status[size, array.become[Integer]]
		END IF
	END METHOD

	METHOD read[size, array] IS
	BEGIN
		IF remote THEN
			RETURN remote.read[size, array.become[Integer]]
		END IF
	END METHOD

   f) Delete references to ivars "gres", "port", & "accel".

   g) Change ".writeCmd" to ".setValue".
 
6) In PodView.alt, add ivars

	VAR
		foregroundColor,
		backgroundColor,
		fill

7) In PodControl.alt method setActive, remove

	IF NOT active THEN
    		IF self.hasKeyboard THEN
    			self.releaseKeyboard
    		END IF
    		IF self.hasWheel THEN
    			self.releaseWheel
    		END IF
	END IF


********** How to install and use **********

Copy pod.hex to bin directory.

Add to makefile:

	APPPOD	  = AppPod

	VPATH = $(COOPSDSP) $(COOPSHARD) $(COOPSCOM) $(APPDSP) $(APPCON) $(APPPOD)
	EXTRA_INCLUDE = -I$(COOPSDSP) -I$(COOPSHARD) -I$(COOPSCOM) -I$(APPDSP) -I$(APPCON) -I$(APPPOD)

	podObjects = \
		$(LIBDSP)/GresIII.o		\
		$(LIBDSP)/Pod.o			\
		$(LIBDSP)/VMESupport.o		\
		$(LIBDSP)/XLib.o

	$(DESTDIR)/coops.o : $(appObjects) $(coopsObjects) $(podObjects)
		$(LD) $(LFLAGS) -r -o $@ $(appObjects) $(coopsObjects) $(podObjects)

Add to configDsp.c:

	#ifndef SIMULATE

	void dspPodClassInit()
	{	extern GresIIIInit();
		extern PodInit();

		GresIIIInit();
		PodInit();
	}

	void dspPodClassExport(supLink)
		objects	supLink;
	{	extern objects	GresIII;
		extern objects	Pod;
	
		add(supLink, "GresIII",	GresIII);
		add(supLink, "Pod",	Pod);
	}

	#endif


	To procedure userOpen():

		dspPodClassExport(supLink);

	To procedure userInit():

		dspPodClassInit();

Add to configSup.c:
	
	objects	GresIII;
	objects	Pod;

	void dspPodClassImport(dspLink)
		objects	dspLink;
	{
		#ifndef SIMULATE
			GresIII	= lookup(dspLink, "GresIII");
			Pod	= lookup(dspLink, "Pod");
		#else
			GresIII	= NIL;
			Pod	= NIL;
		#endif
	}

	To procedure userOpen():

		dspPodClassImport(dspLink);


Add to vm.c:

	extern objects	GresIII;
	extern objects	Pod;

	/* create pod objects*/	
	if (GresIII && Pod)
	{	gres = new(GresIII, 0xC0800000, 0);
		pod  = start(new(Pod, seqSlo, 1, gres));
		load(pod, "pod.hex", 0);
	}

	add(hostLink, "gres",	gres);
	add(hostLink, "pod",	pod);


Copy all *.alt files to AppGui.

Add to aadefine.alt (after virtual machine creation):

	! create pod

	VAR
		podBlack	:= 0,
		podDkGray	:= 1,
		podLtGray	:= 2,
		podWhite	:= 3

	INCLUDE 'Pod.alt'
	INCLUDE 'PodView.alt'
	INCLUDE 'PodWindow.alt'
	INCLUDE 'PodText.alt'
	INCLUDE 'PodDynamicText.alt'
	INCLUDE 'PodDisplay.alt'
	INCLUDE 'PodNumberDisplay.alt'
	INCLUDE 'PodControl.alt'
	INCLUDE 'PodNumberControl.alt'
	INCLUDE 'PodMenu.alt'
	INCLUDE 'PodPane.alt'

VAR pod	    := Pod.new.init[NIL, 'pod']
VAR podPort := PodWindow.new.init[pod]

Add to aadefine.alt (after creating podsetP of PodsetptPanel):

	podPort	.grabKey[2, podsetP]	! give wheel enable/disable key to PodPane

Add to MySystem.alt method attach:

	IF NOT self.isSimulation THEN
		podPort.start
	END IF

