GSE XOP ->code->Igor Procedures

Igor Procedures

This is the file of Igor procedures used by the XRS GSE.


#pragma rtGlobals=1		// Use modern global access method.
 
#include <strings as lists>
#include <keyword-value>
 
Function IgorStartOrNewHook( igorAppName )
	String igorAppName
	
	NewDataFolder /O root:notify
	
	Variable/G root:notify:firstDispChan = 0
	Variable/G root:notify:lastDispChan = 31
	
	String/G root:notify:CDP_SampleRateA =  "       "
	String/G root:notify:CDP_BootBankA =    "       "
	String/G root:notify:CDP_BootRequestA = "       "
	String/G root:notify:CDP_BootPermitA =  "       "
	String/G root:notify:CDP_CommErrA =     "       "
	String/G root:notify:CDP_LdAdrErrA =    "       "
	String/G root:notify:CDP_BootMemErrA =  "       "
	String/G root:notify:CDP_BadCmdErrA =   "       "
	
	String/G root:notify:CDP_SampleRateB =  "       "
	String/G root:notify:CDP_BootBankB =    "       "
	String/G root:notify:CDP_BootRequestB = "       "
	String/G root:notify:CDP_BootPermitB =  "       "
	String/G root:notify:CDP_CommErrB =     "       "
	String/G root:notify:CDP_LdAdrErrB =    "       "
	String/G root:notify:CDP_BootMemErrB =  "       "
	String/G root:notify:CDP_BadCmdErrB =   "       "
	
	String/G root:notify:cdf = "???"
	
	Make/o/n=32 root:notify:CDP_DumpPctDone
	Make/o/n=32 root:notify:CDP_DumpType
	Make/o/t/n=32 root:notify:CDP_DumpTypeText = ""
	
	NewDataFolder /O root:cdp
	Make/o/n=32 root:cdp:errLong, root:cdp:errShort, root:cdp:const, root:cdp:errNum
	Make/o/t/n=32 root:cdp:errText0, root:cdp:errtext1
End
 
Menu "Macros"
	"-"
	Submenu "Info wins"
		"Make Most", MakeAllGSEWins()
		"-"
		"Click Data Folder"
		"Master Status"
		"Dump Progress"
		"Upload Progress"
		"Recent Errors"
	End
	Submenu "Data Wins"
		"Show Dumps"
		"Show In Params"
		"Show Out Params"
		"Show RTPH"
		"Show PH"
		"-"
		"Graph Many"
	End
	"Get Out Param"
	"Copy Dumps"
End
 
 
Macro MakeAllGSEWins()
	ClickDataFolder()
	MasterStatus()
	DumpProgress()
	RecentErrors()
End
 
Macro ShowInParams( firstChan, lastChan )
	Variable firstChan = root:notify:firstDispChan
	Variable lastChan = root:notify:lastDispChan
	
	Variable chan, nChans, width
	Variable pointWidth = 28
	Variable nameWidth = 84
	Variable valWidth = 40
	Variable tLeft = 8
	String waveName, colName
	
	root:notify:firstDispChan = firstChan
	root:notify:lastDispChan = lastChan
	
	PauseUpdate; Silent 1		| building window...
	String fldrSav= GetDataFolder(1)
	SetDataFolder root:cdp:
	nChans = lastChan - firstChan + 1
	width = pointWidth + nameWidth + nChans * valWidth + 16		// 16 for scroll bar
	Edit/W=(tLeft,42,tLeft+width,543) root:names:InParamNames as "Input Params"
	
	chan = firstChan
	do
		sprintf waveName, "InPrm%02d", chan
		sprintf colName, "Ch %02d", chan
		if( Exists(waveName) == 1 )
			AppendToTable $waveName
			ModifyTable width($waveName) = valWidth, title($wavename)=colName
		endif
		chan += 1
	while( chan <= lastChan )
	
	ModifyTable size=9,width(Point)=pointWidth,title(Point)="Item"
	ModifyTable width(root:names:InParamNames)=nameWidth,title(root:names:InParamNames)="Param name"
	SetDataFolder fldrSav
EndMacro
 
Macro ShowOutParams( firstChan, lastChan )
	Variable firstChan = root:notify:firstDispChan
	Variable lastChan = root:notify:lastDispChan
	
	Variable chan, nChans, width
	Variable pointWidth = 28
	Variable nameWidth = 98
	Variable valWidth = 40
	Variable tLeft = 8
	String waveName, colName
	
	root:notify:firstDispChan = firstChan
	root:notify:lastDispChan = lastChan
	
	PauseUpdate; Silent 1		| building window...
	String fldrSav= GetDataFolder(1)
	SetDataFolder root:cdp:
	nChans = lastChan - firstChan + 1
	width = pointWidth + nameWidth + nChans * valWidth + 16		// 16 for scroll bar
	Edit/W=(tLeft,42,tLeft+width,510) root:names:OutParamNames as "Output Params"
	
	chan = firstChan
	do
		sprintf waveName, "OutPrm%02d", chan
		sprintf colName, "Ch %02d", chan
		if( Exists(waveName) == 1 )
			AppendToTable $waveName
			ModifyTable width($waveName) = valWidth, title($wavename)=colName
		endif
		chan += 1
	while( chan <= lastChan )
	
	ModifyTable size=9,width(Point)=pointWidth,title(Point)="Item"
	ModifyTable width(root:names:OutParamNames)=nameWidth,title(root:names:OutParamNames)="Param name"
	SetDataFolder fldrSav
EndMacro
 
 
Function/S TextWaveToString( w, sep )
	Wave/T w
	String sep
	
	if( Wavetype(w) )
		return ""
	endif
	
	String sout
	Variable i, np
	np = numpnts(w)
	if( np > 256 )
		np = 256
	endif
	i = 1
	sout = w[1]
	if( np > 1 )
		do
			sout += sep + w[i]
			i += 1
		while( i < np )
	endif
	
	return sout
End
 
Macro GetOutParam( paramind, min, max )
	String allNames = TextWaveToString( root:names:outParamNames, ";" )
	Variable min = root:notify:firstDispChan
	Variable max = root:notify:lastDispChan
	Variable paramind
	prompt paramind, "param name", popup, allNames
	
	paramind -= 1
	Variable i = 0
	String iwn
	String own = root:names:outParamNames[paramInd]
	Make/o/n=32 root:cdp:$own
	do
		sprintf iwn, "OutPrm%02d", i
		$own[i] = $iwn[paramind]
		i += 1
	while( i < 32 )
	Print "Got", own, "data"
End
 
 
 
Macro ShowDumps( base, min, max )
	String	base
	Variable min = root:notify:firstDispChan
	Variable max = root:notify:lastDispChan
 
	String dfSave = GetDataFolder(1)
	SetDataFolder root:cdp:
	
	GraphMany( base, "", "", min, max )
	
	SetDataFolder dfSave
End
 
//----------------------------------------------
//  GraphMany Macro
//
Macro GraphMany( base, suffix, xwave, min, max )
	String	base, suffix, xwave
	Variable min = root:notify:firstDispChan
	Variable max = root:notify:lastDispChan
	
	Variable i, r, g, b, phi, deltaPhi, rad
	Variable ll, tt, rr, bb
	Variable hasLegend = 0
	String wn, wn2, cmd
	
	Silent 1; PauseUpdate
	
	root:notify:firstDispChan = min
	root:notify:lastDispChan = max
	
	ll=58
	tt=70
	rr=540
	bb=340
	Variable spaceUsed = 0
	String allWins = WinList("*", ";","WIN:1"), thisWin
	i=0
	do
		do
			thisWin = GetStrFromList(allWins, i, ";")
			if( cmpStr( thisWin, "" ) == 0 )
				spaceUsed = 0
				break
			endif
			GetWindow $thisWin, wsize
			if( (ll==V_left) * (tt==V_top) * (rr==V_right) * (bb==V_bottom) )
				spaceUsed = 1
				break
			endif
			i += 1
		while( 1 )
		if( spaceUsed )
			ll += 9
			rr += 9
			tt += 19
			bb += 19
			i = 0
		endif
	while( spaceUsed )
	wn = base + " " + num2str(min) + "-" + num2str(max) + " " + suffix
	Display /W=(ll,tt,rr,bb) as wn
	wn = base + "_" + num2str(min) + "_" + num2str(max) + "_" + suffix
	DoWindow/C $wn
	
	if( (max-min) < 9 )
		Legend/N=text0/J/B=1/A=MC "\\Z09"
		hasLegend = 1
	endif
	
	i=min
	phi = 0
	rad = 27000
	deltaPhi = 2 * PI / (max-min+1)
	do
		sprintf wn, "%s%02d%s", base, i, suffix
		r = rad + rad * cos(phi)
		g = rad + rad * cos(phi + 2*PI/3)
		b = rad + rad * cos(phi + 4*PI/3)
		if( exists( wn ) == 1 )
			if( !cmpstr( "r", suffix ) )
				sprintf wn2, "%s%02d%s", base, i, "e"
				Append /C=(r, g, b ) $wn vs $wn2
			else
				if( cmpstr( "", xwave ) )
					Append /C=( r, g, b ) $wn vs $xwave
				else
					Append /C=( r, g, b ) $wn 
				endif
			endif
		endif
		phi += deltaPhi
		i += 1
	while( i<=max )
	ModifyGraph gbRGB=(56797,56797,56797)
	ModifyGraph gfSize=9
	ModifyGraph mirror=2
	
	if( strsearch( lowerStr(base), "noisespec", 0 ) >= 0 )
		modifygraph log=1
		ModifyGraph grid=1
		ModifyGraph axOffset(left)=1.5
		if( hasLegend )
			Legend/C/N=text0/J/B=(65535,65535,65535)
		endif
	endif
	
	if( !cmpstr( "r", suffix ) )
		SetAxis left 0, 255
		ModifyGraph mode=3, marker=16, msize=0.5, mrkThick=0
	endif
	
	if( !cmpstr( "h", suffix ) )
		ModifyGraph mode=6
	endif
	
	ResumeUpdate
	Silent 0
End
 
Macro CopyDumps( base, min, max, suffix )
	String	base, suffix
	Variable min = root:notify:firstDispChan
	Variable max = root:notify:lastDispChan
	
	String wn, cmd, newwn
	Variable i
	String dfSave = GetDataFolder(1)
	
	Silent 1; PauseUpdate
	SetDataFolder root:cdp:
	
	root:notify:firstDispChan = min
	root:notify:lastDispChan = max
	i=min
	do
		sprintf wn, "%s%02d", base, i
		sprintf newwn, "%s%s%02d", base, suffix, i
		if( exists( wn ) == 1 )
			Duplicate/o $wn $newwn
		endif
		i += 1
	while( i<=max )
	ResumeUpdate
	Silent 0
End
 
// RTPH display macro
Macro ShowRTPH( pixel)
	Variable pixel
	
	String dfSave = GetDataFolder(1)
 
	SetDataFolder root:cdp:
	String xx, yy, image
	sprintf yy, "Box_RT%02d", pixel
	sprintf xx, "Box_PH%02d", pixel
	sprintf image, "Rtph%02d", pixel
	Display $yy vs $xx; appendimage $image; modifyImage $image ctab= {*,*,Grays,1}
	ModifyGraph mirror = 2
	SetDataFolder dfSave
End
 
Function ZeroUploadProg()
	NVAR lda = root:cdp_loadPctA 
	NVAR ldb = root:cdp_loadPctB 
	
	if( exists( "root:cdp_loadPctA" ) != 2 )
		Variable/G root:cdp_loadPctA
	endif
	if( exists( "root:cdp_loadPctB" ) != 2 )
		Variable/G root:cdp_loadPctB
	endif
	lda = 0
	ldb = 0
End
 
//-------------------------------------------------
//  Upload Progress window
//
Function UploadProgress()
	Execute( "UploadProgressWin()" )
	ReanchorOneWin( "UploadProgressWin" )
End
 
Window UploadProgressWin() : Panel
	PauseUpdate; Silent 1		| building window...
	NewPanel /W=(604,365,768,407) as "Upload progress"
	ModifyPanel cbRGB=(65535,54607,32768)
	SetDrawLayer UserBack
	SetDrawEnv xcoord= rel,ycoord= rel,linethick= 2,linefgc= (52428,34958,1),fillpat= 0
	DrawRect -0.1,-0.1,1,1
	SetDrawEnv xcoord= rel,ycoord= rel,linethick= 2,linefgc= (65535,60076,49151),fillpat= 0
	DrawRect 0,0,1.1,1.1
	SetDrawEnv xcoord= rel,ycoord= rel,linefgc= (52428,34958,1),fillpat= 0
	DrawRect -0.2,-0.2,1,1
	ValDisplay valdisp0,pos={5,19},size={150,13},font="Monaco",fSize=9
	ValDisplay valdisp0,format="B:%5.1f",limits={0,100,0},barmisc={0,50}
	ValDisplay valdisp0,value= #"root:notify:cdp_loadpctb"
	ValDisplay valdisp0_1,pos={5,4},size={150,13},font="Monaco",fSize=9
	ValDisplay valdisp0_1,format="A:%5.1f",limits={0,100,0},barmisc={0,50}
	ValDisplay valdisp0_1,value= #"root:notify:cdp_loadpcta"
	SetWindow kwTopWin,note ="ANCHORSV:600;ANCHORSH:800;ANCHOR:br;ANCHORV:190;ANCHORH:49;"
EndMacro
 
Window InParamTable() : Table
	PauseUpdate; Silent 1		| building window...
	Edit/W=(15,42,273,447) :names:InParamNames as "Input Params"
	ModifyTable size=9,width(Point)=28,width(:names:InParamNames)=86
EndMacro
 
Window OutParamTbl() : Table
	PauseUpdate; Silent 1		| building window...
	String fldrSav= GetDataFolder(1)
	SetDataFolder root:names:
	Edit/W=(5,42,241,495) OutParamNames as "Output Params"
	ModifyTable width(Point)=28,width(OutParamNames)=106
	SetDataFolder fldrSav
EndMacro
 
 
//-------------------------------------------------------
// ShowPH macros
//
Macro ShowPh()
	PauseUpdate; Silent 1		| building window...
	String fldrSav= GetDataFolder(1)
	SetDataFolder root:cdp:
	Display /W=(5,42,659,372) Ph vs UTime as "Ph vs Utime"
	SetDataFolder fldrSav
	ModifyGraph margin(right)=16,gbRGB=(52428,52428,52428)
	ModifyGraph mode=2
	ModifyGraph zColor(Ph)={root:cdp:Pixel,root:notify:firstDispChan,root:notify:lastDispChan,Rainbow}
	ModifyGraph mirror=2
	ModifyGraph nticks(left)=10
	Textbox/N=text0/A=MC/X=-8.93/Y=38.80 "\\F'Monaco'\\Z09Pixel = \\{root:dispPixel}\rPh    = \\{root:dispPh}"
	AppendText "Rt    = \\{root:dispRt}\rFlags = \\{root:dispFlags}\rTime = \\{root:dispMacTime}"
	Cursor A Ph 0
	ShowInfo
	Button button0,pos={467,35},size={80,20},proc=ShowInfoButtonProc,title="Show Info"
End
 
Function ShowInfoButtonProc(ctrlName) : ButtonControl
	String ctrlName
	
	Wave 	wpixel = root:cdp:pixel
	Wave 	wph = root:cdp:ph
	Wave 	wrt = root:cdp:rt
	Wave 	wflags = root:cdp:flags
	Wave 	wsct = root:cdp:sctime
	NVAR	macTimeDiff = root:notify:xrs_macTimeDiff
 
	NVAR	vpixel = root:dispPixel
	NVAR	vph = root:dispPh
	NVAR	vrt = root:dispRt
	SVAR	vflags = root:dispFlags
	SVAR	vmtime = root:dispMacTime
	
	String fs
	Variable fv, mactime
	
	Variable/g root:dispPixel, root:dispPh, root:dispRt
	String/g root:dispFlags, root:dispMacTime
	
	vpixel = wpixel[pcsr(a)]
	vph = wph[pcsr(a)]
	vrt = wrt[pcsr(a)]
	mactime = wsct[pcsr(a)] + macTimeDiff
	sprintf vmtime, "%s %s", Secs2Date(mactime,0), Secs2Time(mactime,3)
	fv = wflags[pcsr(a)]
	
	sprintf fs, "(%2x) ", fv
	if( fv %& 0x01 )
		fs = fs + "S"
	else
		fs = fs + " "
	endif
	
	if( fv %& 0x02 )
		fs = fs + "L"
	else
		fs = fs + " "
	endif
	
	if( fv %& 0x04 )
		fs = fs + "N"
	else
		fs = fs + " "
	endif
	
	if( fv %& 0x08 )
		fs = fs + "B"
	else
		fs = fs + " "
	endif
	
	if( fv %& 0x10 )
		fs = fs + "A"
	else
		fs = fs + " "
	endif
	
	if( fv %& 0x20 )
		fs = fs + "C"
	else
		fs = fs + " "
	endif
	
	vFlags = fs
End
 
 
//----------------------------------------------------
// ClickDataFolder Panel (Well, actually it's a graph)
//
Function ClickDataFolder()
	Execute( "ClickDataFolderWin()" )
	ReanchorOneWin( "ClickDataFolderWin" )
End
 
Window ClickDataFolderWin() : Graph
	PauseUpdate; Silent 1		| building window...
	Display /W=(803,595,873,767) as "Ä"
	ModifyGraph width=70,height=172,wbRGB=(65535,54607,32768),gbRGB=(65535,54607,32768)
	ModifyGraph cbRGB=(65535,54607,32768)
	Textbox/N=text0/Z=1/B=(65535,60076,49151)/A=MC/X=-1.43/Y=-41.28 "\\F'Courier'\\Z10\\{root:notify:cdf}"
	Button bCDP,pos={10,29},size={50,19},proc=SetDFButtonProc,title="CDP"
	Button bCAP,pos={10,52},size={50,19},proc=SetDFButtonProc,title="CAP"
	Button bMHK,pos={10,98},size={50,19},proc=SetDFButtonProc,title="M-HK"
	Button bFILT,pos={10,75},size={50,19},proc=SetDFButtonProc,title="Filters"
	Button bNotify,pos={10,121},size={50,19},proc=SetDFButtonProc,title="Notify"
	Button bRoot,pos={10,6},size={50,19},proc=SetDFRootButtonProc,title="Root"
	SetDrawLayer UserBack
	SetDrawEnv xcoord= rel,ycoord= rel,linethick= 2,linefgc= (52428,34958,1),fillpat= 0
	DrawRect -0.1,-0.1,1,1
	SetDrawEnv xcoord= rel,ycoord= rel,linethick= 2,linefgc= (65535,60076,49151),fillpat= 0
	DrawRect 0,0,1.1,1.1
	SetDrawEnv xcoord= abs,ycoord= abs,linefgc= (52428,34958,1)
	DrawLine 1,144,69,144
	SetDrawEnv xcoord= abs,ycoord= abs,linefgc= (65535,60076,49151)
	DrawLine 1,145,69,145
	SetDrawEnv xcoord= rel,ycoord= rel,linefgc= (52428,34958,1),fillpat= 0
	DrawRect -0.2,-0.2,1,1
	SetDrawLayer UserFront
	SetWindow kwTopWin,note ="ANCHORSV:768;ANCHORSH:1024;ANCHOR:br;ANCHORV:-2;ANCHORH:151;"
EndMacro
 
Function SetDFRootButtonProc(ctrlName) : ButtonControl
	String ctrlName
	
	String df
	df = "root:"
	if( DataFolderExists( df ) )
		SetDataFolder $df
	else
		Beep
	endif
End
 
Function SetDFButtonProc(ctrlName) : ButtonControl
	String ctrlName
	
	String df
	df = "root:" + ctrlName[1,99]
	if( DataFolderExists( df ) )
		SetDataFolder $df
	else
		Beep
	endif
End
 
 
//-------------------------------------------------------
// Recent Errors window
//
Function RecentErrors()
	Execute( "RecentErrorsWin()" )
	ReanchorOneWin( "RecentErrorsWin" )
End
 
Window RecentErrorsWin() : Graph
	PauseUpdate; Silent 1		| building window...
	String fldrSav= GetDataFolder(1)
	SetDataFolder root:cdp:
	Display /W=(-2,38,257,374) const,const,const as "Recent Errors"
	Append/T const
	SetDataFolder fldrSav
	ModifyGraph margin(top)=14,margin(right)=4,wbRGB=(65535,54607,32768)
	ModifyGraph mode=3
	ModifyGraph rgb(const)=(34952,34952,34952),rgb(const#1)=(1,12815,52428)
	ModifyGraph msize(const)=3,msize(const#1)=3,msize(const#2)=3
	ModifyGraph offset(const#1)={0,1.19211},offset(const#2)={0,2.30926},offset(const#3)={0,2.62257}
	ModifyGraph zColor(const#1)={:cdp:errNum,0,40,Terrain},zColor(const#2)={:cdp:errNum,0,40,Terrain}
	ModifyGraph zColor(const#3)={:cdp:errNum,0,40,Terrain}
	ModifyGraph textMarker(const)={:cdp:errtext1,"default",0,0,4,5.00,0.00},textMarker(const#1)={:cdp:errText0,"default",0,0,4,0.00,0.00}
	ModifyGraph textMarker(const#2)={:cdp:errShort,"default",0,0,4,0.00,0.00},textMarker(const#3)={:cdp:errLong,"default",0,0,4,0.00,0.00}
	ModifyGraph grid(top)=1
	ModifyGraph tick=3
	ModifyGraph mirror(left)=2
	ModifyGraph noLabel(left)=2,noLabel(top)=2
	ModifyGraph fSize=9
	ModifyGraph lblMargin(left)=2
	ModifyGraph standoff(left)=0,standoff(bottom)=0
	ModifyGraph axOffset(left)=-2.33333,axOffset(bottom)=-6
	ModifyGraph lblLatPos(left)=3
	ModifyGraph manTick(bottom)={0,1,0,0},manMinor(bottom)={0,0}
	ModifyGraph manTick(top)={0.5,1,0,0},manMinor(top)={0,0}
	SetAxis left 0,3
	SetAxis bottom 31.5,-0.5
	SetAxis top 31.5,-0.5
	SetDrawLayer UserBack
	SetDrawEnv xcoord= rel,ycoord= rel,linethick= 2,linefgc= (52428,34958,1),fillpat= 0
	DrawRect -0.1,-0.1,1,1
	SetDrawEnv xcoord= rel,ycoord= rel,linethick= 2,linefgc= (65535,60076,49151),fillpat= 0
	DrawRect 0,0,1.1,1.1
	SetDrawEnv xcoord= rel,ycoord= rel,linefgc= (52428,34958,1),fillpat= 0
	DrawRect -0.2,-0.2,1,1
	SetDrawLayer UserFront
	SetDrawEnv linefgc= (1,12815,52428)
	DrawLine 0.00892857142857143,0.501577287066246,1.01785714285714,0.501577287066246
	SetDrawEnv linefgc= (1,12815,52428)
	DrawLine 0.004739336492891,0.25,1.01895734597156,0.25
	SetDrawEnv linefgc= (1,12815,52428)
	DrawLine 0.004739336492891,0.753154574132492,1.01895734597156,0.753154574132492
	SetDrawEnv fsize= 9
	DrawText 0.147058823529411,1.0410094637224,"prev err        last err              S        L"
	ModifyGraph swapXY=1
	SetWindow kwTopWin,note ="ANCHORSV:600;ANCHORSH:800;ANCHOR:tl;ANCHORV:38;ANCHORH:-1;"
EndMacro
 
//-------------------------------------------------------
// Dump Progress window
//
Function DumpProgress()
	Execute( "DumpProgressWin()" )
	ReanchorOneWin( "DumpProgressWin" )
End
 
Window DumpProgressWin() : Graph
	PauseUpdate; Silent 1		| building window...
	String fldrSav= GetDataFolder(1)
	SetDataFolder root:notify:
	Display /W=(608,38,774,373) CDP_DumpPctDone,CDP_DumpPctDone,CDP_DumpPctDone as "Dump progress"
	SetDataFolder fldrSav
	ModifyGraph margin(top)=8,margin(right)=4,wbRGB=(65535,54607,32768),gbRGB=(61166,61166,61166)
	ModifyGraph mode(CDP_DumpPctDone)=5,mode(CDP_DumpPctDone#1)=3,mode(CDP_DumpPctDone#2)=5
	ModifyGraph rgb=(0,0,0)
	ModifyGraph msize(CDP_DumpPctDone)=3,msize(CDP_DumpPctDone#1)=3
	ModifyGraph hbFill(CDP_DumpPctDone)=2
	ModifyGraph plusRGB(CDP_DumpPctDone)=(52428,1,1)
	ModifyGraph zColor(CDP_DumpPctDone)={:notify:CDP_DumpType,0,15,Terrain}
	ModifyGraph textMarker(CDP_DumpPctDone)={:notify:CDP_DumpTypeText,"default",0,90,8,0.00,0.00}
	ModifyGraph textMarker(CDP_DumpPctDone#1)={:notify:CDP_DumpTypeText,"default",0,0,10,0.00,2.00}
	ModifyGraph grid(left)=1
	ModifyGraph mirror=2
	ModifyGraph nticks(left)=4,nticks(bottom)=16
	ModifyGraph minor(bottom)=1
	ModifyGraph noLabel(left)=2
	ModifyGraph fSize=9
	ModifyGraph standoff=0
	ModifyGraph axOffset(left)=-1,axOffset(bottom)=-1.66667
	ModifyGraph gridRGB(left)=(16385,16388,65535),gridRGB(bottom)=(0,0,0)
	ModifyGraph tlblRGB(left)=(16385,16388,65535)
	ModifyGraph btLen=0.1
	ModifyGraph tlOffset(bottom)=2
	ModifyGraph tickZap(bottom)={32}
	ModifyGraph manTick(left)={0,25,0,0},manMinor(left)={0,0}
	ModifyGraph manTick(bottom)={0.4999,1,0,0},manMinor(bottom)={0,0}
	SetAxis left 0,100
	SetAxis bottom 32,0
	SetDrawLayer UserBack
	SetDrawEnv xcoord= rel,ycoord= rel,linethick= 2,linefgc= (52428,34958,1),fillpat= 0
	DrawRect -0.1,-0.1,1,1
	SetDrawEnv xcoord= rel,ycoord= rel,linethick= 2,linefgc= (65535,60076,49151),fillpat= 0
	DrawRect 0,0,1.1,1.1
	SetDrawEnv xcoord= rel,ycoord= rel,linefgc= (52428,34958,1),fillpat= 0
	DrawRect -0.2,-0.2,1,1
	SetDrawLayer UserFront
	SetDrawEnv linethick= 2,linefgc= (1,16019,65535)
	DrawLine 0.01,0.251582246486705,1,0.251582246486705
	SetDrawEnv linethick= 2,linefgc= (1,16019,65535)
	DrawLine 0.01,0.503174603174603,1,0.503174603174603
	SetDrawEnv linethick= 2,linefgc= (1,16019,65535)
	DrawLine 0.00999999999999999,0.75,1,0.75
	ModifyGraph swapXY=1
	SetWindow kwTopWin,note ="ANCHORSV:600;ANCHORSH:800;ANCHOR:tr;ANCHORV:38;ANCHORH:40;"
EndMacro
 
 
//-------------------------------------------------------
// Master Status window
//
Function MasterStatus()
	Execute( "MasterStatusWin()" )
	ReanchorOneWin( "MasterStatusWin" )
End
 
Window MasterStatusWin() : Graph
	PauseUpdate; Silent 1		| building window...
	Display /W=(647,427,773,599) as "CDP State"
	ModifyGraph width=126,height=172,wbRGB=(65535,54607,32768),gbRGB=(65535,54607,32768)
	Textbox/N=BErrs/Z=1/B=(65535,60076,49151)/A=MC/X=-19.69/Y=-23.08 "\\f04\\JC\\Z09B Errors:"
	AppendText "\\f00\\JL\\K(65535,0,0)\\Z12\\F'Monaco'\\f01\\{root:notify:cdp_commErrb}\r\\{root:notify:cdp_LdAdrErrb}"
	AppendText "\\{root:notify:cdp_bootMemErrb}\r\\{root:notify:cdp_BadCmdErrb}"
	Textbox/N=AErrs/Z=1/B=(65535,60076,49151)/A=MC/X=-19.69/Y=23.84 "\\f04\\JC\\Z09A Errors:"
	AppendText "\\f00\\JL\\K(65535,0,0)\\Z12\\F'Monaco'\\f01\\{root:notify:cdp_commErra}\r\\{root:notify:cdp_LdAdrErra}"
	AppendText "\\{root:notify:cdp_bootMemErra}\r\\{root:notify:cdp_BadCmdErra}"
	Textbox/N=BStat/Z=1/B=(65535,60076,49151)/A=MC/X=26.19/Y=-23.26 "\\f04\\JC\\Z09B Status:"
	AppendText "\\f00\\Z10\\Z09\\JL\\F'Monaco'\\{root:notify:CDP_SampleRateB}\r\\{root:notify:CDP_BootBankB}"
	AppendText "\\{root:notify:CDP_BootRequestB}\r\\{root:notify:CDP_BootPermitB}"
	Textbox/N=AStat/Z=1/B=(65535,60076,49151)/A=MC/X=26.19/Y=23.84 "\\f04\\JC\\Z09A Status:"
	AppendText "\\f00\\Z10\\Z09\\JL\\F'Monaco'\\{root:notify:CDP_SampleRateA}\r\\{root:notify:CDP_BootBankA}"
	AppendText "\\{root:notify:CDP_BootRequestA}\r\\{root:notify:CDP_BootPermitA}"
	SetDrawLayer UserBack
	SetDrawEnv xcoord= rel,ycoord= rel,linethick= 2,linefgc= (52428,34958,1),fillpat= 0
	DrawRect -0.1,-0.1,1,1
	SetDrawEnv xcoord= rel,ycoord= rel,linethick= 2,linefgc= (65535,60076,49151),fillpat= 0
	DrawRect 0,0,1.1,1.1
	SetDrawEnv xcoord= rel,ycoord= rel,linefgc= (52428,34958,1),fillpat= 0
	DrawRect -0.2,-0.2,1,1
	SetDrawLayer UserFront
	SetWindow kwTopWin,note ="ANCHORSV:600;ANCHORSH:800;ANCHOR:br;ANCHORV:-2;ANCHORH:23;"
EndMacro