Firenet

Check-in [cb7720be5d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update css to remove bkgnd from graph
Timelines: family | ancestors | descendants | both | NEWNET
Files: files | file ages | folders
SHA1:cb7720be5d44604efc61967f8ae4c166974410e3
User & Date: jim 2012-07-17 02:32:08
Context
2012-10-24
00:51
Update schematic (edited) for Eagle 6 check-in: e5fc711496 user: jim tags: NEWNET
2012-07-17
02:32
Update css to remove bkgnd from graph check-in: cb7720be5d user: jim tags: NEWNET
2012-04-10
00:21
Fix JSON parser error, add cmd line to proj check-in: a1a3d51a8a user: jim tags: NEWNET
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Hardware/Board/Firenet/eagle.epf.

1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
..
19
20
21
22
23
24
25




26
27
28





















































































29
30

31
32
33
34
35
36



[Eagle]
Version="05 11 00"
Platform="Mac OS X"
Serial="62191E841E-LSR-WLM-1EL"
Globals="Globals"
Desktop="Desktop"

[Globals]
AutoSaveProject=1

UsedLibrary="/LApps/Eagle/lbr/atmel.lbr"
UsedLibrary="/LApps/Eagle/lbr/battery.lbr"
UsedLibrary="/LApps/Eagle/lbr/capacitor-wima.lbr"
UsedLibrary="/LApps/Eagle/lbr/crystal.lbr"
UsedLibrary="/LApps/Eagle/lbr/diode.lbr"
UsedLibrary="/LApps/Eagle/lbr/frames.lbr"
UsedLibrary="/LApps/Eagle/lbr/fuse.lbr"
................................................................................
UsedLibrary="/LApps/Eagle/lbr/rectifier.lbr"
UsedLibrary="/LApps/Eagle/lbr/ref-packages.lbr"
UsedLibrary="/LApps/Eagle/lbr/relay.lbr"
UsedLibrary="/LApps/Eagle/lbr/resistor-power.lbr"
UsedLibrary="/LApps/Eagle/lbr/supply1.lbr"
UsedLibrary="/LApps/Eagle/lbr/v-reg.lbr"
UsedLibrary="/Users/jschimpf/Public/USBSW/Hardware/firenet.lbr"




UsedLibrary="firenet.lbr"

[Win_1]





















































































Type="Control Panel"
Loc="122 44 721 443"

State=2
Number=0

[Desktop]
Screen="1280 1024"
Window="Win_1"




|







>







 







>
>
>
>
|


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

<
>






>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
..
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119

120
121
122
123
124
125
126
127
128
129
[Eagle]
Version="06 02 00"
Platform="Mac OS X"
Serial="62191E841E-LSR-WLM-1EL"
Globals="Globals"
Desktop="Desktop"

[Globals]
AutoSaveProject=1
UsedLibrary="/LApps/lbr/con-subd.lbr"
UsedLibrary="/LApps/Eagle/lbr/atmel.lbr"
UsedLibrary="/LApps/Eagle/lbr/battery.lbr"
UsedLibrary="/LApps/Eagle/lbr/capacitor-wima.lbr"
UsedLibrary="/LApps/Eagle/lbr/crystal.lbr"
UsedLibrary="/LApps/Eagle/lbr/diode.lbr"
UsedLibrary="/LApps/Eagle/lbr/frames.lbr"
UsedLibrary="/LApps/Eagle/lbr/fuse.lbr"
................................................................................
UsedLibrary="/LApps/Eagle/lbr/rectifier.lbr"
UsedLibrary="/LApps/Eagle/lbr/ref-packages.lbr"
UsedLibrary="/LApps/Eagle/lbr/relay.lbr"
UsedLibrary="/LApps/Eagle/lbr/resistor-power.lbr"
UsedLibrary="/LApps/Eagle/lbr/supply1.lbr"
UsedLibrary="/LApps/Eagle/lbr/v-reg.lbr"
UsedLibrary="/Users/jschimpf/Public/USBSW/Hardware/firenet.lbr"
UsedLibrary="/LApps/Eagle/lbr/ic-package.lbr"
UsedLibrary="/Users/jim/Desktop/Hardware/Schematic/Schematic/Libraries/SparkFun.lbr"
UsedLibrary="/Users/jim/Desktop/Hardware/Schematic/Schematic/Libraries/adafruit.lbr"
UsedLibrary="/Users/jim/Desktop/Hardware/Schematic/Schematic/Libraries/sds.lbr"
UsedLibrary="/LApps/Eagle/lbr/led.lbr"

[Win_1]
Loc="-899 51 -300 450"
State=2
Number=4

[Win_2]
Type="Schematic Editor"
Loc="-960 204 -108 937"
State=2
Number=1
File="/Users/jim/Desktop/Hardware/Schematic/Schematic/SiemensSW.sch"
View="-31.7373 10.2514 108.799 118.94"
WireWidths=" 0 0.3048 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0.4064 0.1524"
PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
PadDrills=" 0.5 0.6 0.7 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.8"
ViaDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
ViaDrills=" 0.5 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.6"
HoleDrills=" 0.5 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.6"
TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
WireBend=0
WireBendSet=31
WireCap=1
MiterStyle=0
PadShape=0
ViaShape=0
PolygonPour=0
PolygonRank=0
PolygonThermals=1
PolygonOrphans=0
TextRatio=8
PinDirection=3
PinFunction=0
PinLength=2
PinVisible=3
SwapLevel=0
ArcDirection=0
AddLevel=2
PadsSameType=0
Layer=91
Views=" 1: -31.7373 10.2514 108.799 118.94"
Sheet=1

[Win_3]
Type="Board Editor"
Loc="-243 707 708 1423"
State=2
Number=2
File="/Users/jim/Desktop/Hardware/Schematic/Schematic/SiemensSW.brd"
View="-10.1645 -1.33409 48.9283 66.0164"
WireWidths=" 0 0.254 0.3048 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0.4064"
PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
PadDrills=" 0.5 0.6 0.7 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.8"
ViaDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
ViaDrills=" 0.5 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.6"
HoleDrills=" 0.5 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 2 2.2 2.8 3.2 0.6"
TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
WireBend=0
WireBendSet=0
WireCap=1
MiterStyle=0
PadShape=0
ViaShape=0
PolygonPour=0
PolygonRank=1
PolygonThermals=1
PolygonOrphans=0
TextRatio=8
PinDirection=3
PinFunction=0
PinLength=2
PinVisible=3
SwapLevel=0
ArcDirection=0
AddLevel=2
PadsSameType=0
Layer=16

[Win_4]
Type="Control Panel"

Loc="30 52 629 451"
State=2
Number=0

[Desktop]
Screen="1280 1024"
Window="Win_1"
Window="Win_2"
Window="Win_3"
Window="Win_4"

Changes to Site/Site_J/style.css.

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
			width: 89%;
			height: 400px;
		}

/*  AUTO RUN BLOCK CONTROLS */

div#AUTO_PLOT_BLOCK {
			background-color: #FFFFFF;
			color: black;
			float: left;
			width: 80px;
			height: 250px;
		}

div#AUTO_TABLE {







|







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
			width: 89%;
			height: 400px;
		}

/*  AUTO RUN BLOCK CONTROLS */

div#AUTO_PLOT_BLOCK {
			background-color: #F0F0F0;
			color: black;
			float: left;
			width: 80px;
			height: 250px;
		}

div#AUTO_TABLE {

Changes to Tools/MsgTest/MsgTest.xcodeproj/project.pbxproj.

148
149
150
151
152
153
154

155
156
157
158
159
160
161

162
163
164
165
166
167
168

169
170
171
172

173
174
175
176
177
178
179
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
		1DEB928608733DD80010E9CD /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;

				COPY_PHASE_STRIP = NO;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_ENABLE_FIX_AND_CONTINUE = YES;
				GCC_MODEL_TUNING = G5;
				GCC_OPTIMIZATION_LEVEL = 0;
				INSTALL_PATH = /usr/local/bin;
				PRODUCT_NAME = MsgTest;

			};
			name = Debug;
		};
		1DEB928708733DD80010E9CD /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;

				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				GCC_MODEL_TUNING = G5;
				INSTALL_PATH = /usr/local/bin;
				PRODUCT_NAME = MsgTest;

			};
			name = Release;
		};
		1DEB928A08733DD80010E9CD /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ARCHS = "$(ARCHS_STANDARD_32_BIT)";







>







>







>




>







148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
		1DEB928608733DD80010E9CD /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ARCHS = "$(NATIVE_ARCH_ACTUAL)";
				COPY_PHASE_STRIP = NO;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_ENABLE_FIX_AND_CONTINUE = YES;
				GCC_MODEL_TUNING = G5;
				GCC_OPTIMIZATION_LEVEL = 0;
				INSTALL_PATH = /usr/local/bin;
				PRODUCT_NAME = MsgTest;
				SDKROOT = "";
			};
			name = Debug;
		};
		1DEB928708733DD80010E9CD /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ARCHS = "$(NATIVE_ARCH_ACTUAL)";
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				GCC_MODEL_TUNING = G5;
				INSTALL_PATH = /usr/local/bin;
				PRODUCT_NAME = MsgTest;
				SDKROOT = "";
			};
			name = Release;
		};
		1DEB928A08733DD80010E9CD /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ARCHS = "$(ARCHS_STANDARD_32_BIT)";

Deleted Tools/MsgTest/build/MsgTest.build/MsgTest.pbxindex/categories.pbxbtree.

cannot compute difference between binary files

Deleted Tools/MsgTest/build/MsgTest.build/MsgTest.pbxindex/cdecls.pbxbtree.

cannot compute difference between binary files

Deleted Tools/MsgTest/build/MsgTest.build/MsgTest.pbxindex/decls.pbxbtree.

cannot compute difference between binary files

Deleted Tools/MsgTest/build/MsgTest.build/MsgTest.pbxindex/files.pbxbtree.

cannot compute difference between binary files

Deleted Tools/MsgTest/build/MsgTest.build/MsgTest.pbxindex/imports.pbxbtree.

cannot compute difference between binary files

Deleted Tools/MsgTest/build/MsgTest.build/MsgTest.pbxindex/pbxindex.header.

cannot compute difference between binary files

Deleted Tools/MsgTest/build/MsgTest.build/MsgTest.pbxindex/protocols.pbxbtree.

cannot compute difference between binary files

Deleted Tools/MsgTest/build/MsgTest.build/MsgTest.pbxindex/refs.pbxbtree.

cannot compute difference between binary files

Deleted Tools/MsgTest/build/MsgTest.build/MsgTest.pbxindex/strings.pbxstrings/control.

cannot compute difference between binary files

Deleted Tools/MsgTest/build/MsgTest.build/MsgTest.pbxindex/strings.pbxstrings/strings.

cannot compute difference between binary files

Deleted Tools/MsgTest/build/MsgTest.build/MsgTest.pbxindex/subclasses.pbxbtree.

cannot compute difference between binary files

Deleted Tools/MsgTest/build/MsgTest.build/MsgTest.pbxindex/symbols0.pbxsymbols.

cannot compute difference between binary files

Deleted build/Debug/firenet_sup.lua.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
--------------------------------------------------------------
--
--	FIRENET Lua support functions
--	This file contains the basic structures used for Firenet
--	support under Lua
--
--	Basic Structures
--		FNET_MAP	- List indexed by NODE name
--			[<Node Name>]
--							.FIRED		- Fired channels as a #
--							.UNFIRED	- UnFired channels as a #
--							.PHY		- Physical address
--		REV_FNET_MAP	- List indexed by NODE Phy address
--			[<Node Phy addr]
--							.NAME		- Node name (see FNET_MAP)
--
--	13-Sep-2009	Initial version
--	20-Sep-2009	Add cmd line handler
--
----------------------------------------------------------------

----------------------------------------------------------------
-- GLOBAL DATA STRUCTURES
----------------------------------------------------------------
FNET_MAP = {}			-- Network MAP
REV_FNET_MAP = {}		-- Reverse MAP
BCAST_ADDR = "0xFF"		-- Broadcast address for FIRENET
OS_MUSIC_PLAYER	= "afplay"	-- Cmd line Music player program (OS dependent)

----------------------------------------------------------------
--	build_fnet_map(h)	- Build Lua map of firenet network
--
--	INPUT:	h	- FIRENET handle
--
--	OUTPUT:	1	- Success, FNET_MAP and REV_FNET_MAP rebuilt
--			nil	- FAILURE
--
----------------------------------------------------------------

function build_fnet_map(h)
	local outpk
	local inpk
	local rtnval = nil
	
	-- (1) Build a WHO IS message
	
	outpk = {}
	outpk.CMD = "W"
	outpk.TO = BCAST_ADDR
	
	-- (2) Send it then wait for an answer
	
	--print("-- Sending Packet --")
	h:write(outpk)
	timer.sleep( 20000 );
	
	-- (3) Now read packets till we get a nil and store the data
	
	inpk = h:read()
	FNET_MAP = {}
	REV_FNET_MAP = {}
	while( inpk ~= nil )
	do
			--print("-- MAP Rec Packet --")
			--table.foreach(inpk,print)

		if( inpk.CMD == "W" )
		then
			print("Build MAP ",inpkt,FROM)
			-- Build forward map
			FNET_MAP[inpk.DATA] = {}
			FNET_MAP[inpk.DATA].NAME = inpk.DATA
			FNET_MAP[inpk.DATA].PHY = inpk.FROM
			
			-- Build Reverse MAP
			REV_FNET_MAP[inpk.FROM] = {}
			REV_FNET_MAP[inpk.FROM].NAME = inpk.DATA
		end
		timer.sleep( 100 );
		rtnval = 1
		inpk = h:read()
	end
	return rtnval
end

----------------------------------------------------------------
--	build_fnet_status(h)	- Get status of network
--
--	INPUT:	h	- FIRENET handle
--
--	OUTPUT:	1	- Success, FNET_MAP and REV_FNET_MAP updated with status
--			nil	- FAILURE
--
----------------------------------------------------------------

function build_fnet_status( h )
	local outpk
	local inpk
	local rtnval = nil
	local node
	local out
	
	-- (1) Build a STATUS message
	
	outpk = {}
	outpk.CMD = "S"
	outpk.TO = BCAST_ADDR
	
	-- (2) Send it then wait for an answer
	
	--print("-- Sending Packet --")
	h:write(outpk)
	timer.sleep( 20000 );
	
	-- (3) Now read packets till we get a nil and store the data
	
	inpk = h:read()
	while( inpk ~= nil )
	do
			--print("-- STATUS Rec Packet --")
			--table.foreach(inpk,print)

		if( inpk.CMD == "S" )
		then
			node = node_address(inpk.FROM)
			if( node ~= nil )
			then
				-- Update forward map
				if( FNET_MAP[node] ~= nil )
				then
					FNET_MAP[node].FIRED = inpk.FIRED
					FNET_MAP[node].UNFIRED = inpk.UNFIRED
				else
					out = string.format("*** ERROR Unknown NODE [%s]",inpk.FROM)
					if( inpk.DATA ~= nil )
					then
						out = out..string.format("NAME: [%s]",node)
					end
					print(out)
				end
			else
				out = string.format("*** ERROR Node [%s] NOT FOUND",inpk.FROM)
				print(out)
			end
		end
		timer.sleep( 100 );
		rtnval = 1
		inpk = h:read()
	end
	return rtnval
end

----------------------------------------------------------------
--	phy_address(node)	- Return physical address for a node
--
--	INPUT:	node	- Node name
--
--	OUTPUT:	Physical address or BCAST_ADDRESS if none
--
----------------------------------------------------------------

function phy_address(node)
	local phy
	
	if( FNET_MAP[node] ~= nil )
	then
		phy = FNET_MAP[node].PHY
	else
		phy = BCAST_ADDR
	end
	
	return phy
end

----------------------------------------------------------------
--	node_address(phy)	- Return node  name from physical address
--
--	INPUT:	phy	- physical address
--
--	OUTPUT:	Node name or nil if not found
--
----------------------------------------------------------------

function node_address(phy)
	local node = nil
	local val
	
	val = tonumber(phy)
	if( REV_FNET_MAP[val] ~= nil )
	then
		node = REV_FNET_MAP[val].NAME
	else
		node = phy
	end
	
	return node
end
	
----------------------------------------------------------------
--	play_file(file)
--
--	INPUT:	file	- Music file
--
--	OUTPUT:	1 if play started, nil if not
--
----------------------------------------------------------------

function play_file( file )
	local rtnval = nil
	local fp
	
	-- (1) Try to open the file, if OK then proceed
	
	fp = io.open(file,"r")
	if( fp ~= nil )
	then
		-- OS X version of play
		
		fp:close()
		rtnval = 1
		fp = string.format("%s %s &",OS_MUSIC_PLAYER,file)
		os.execute(fp)
	end
	
	return rtnval
end

-------------------------------------------------------------------------------
--
--  find_arg( argv,flag,data )   - Find the port in the argument list
--
--  INPUT:      argv    - Program argument list
--              flag    - Look for this string (i.e. -flag) in list
--              data    - If non-nil get the field following flag slot
--
--  OUTPUT      If data = nil return nil if flag not found and 1 if found
--              If data <> nil return nil if flag not found or next field if found
--
-------------------------------------------------------------------------------

function flag_srch( argv,flag,data )
    local rtnval = nil
    
    -- Loop over the list and check each item for match
    
    for i=1,table.getn(argv) 
    do
        if( flag == argv[i] )
        then
            -- Found so two cases 
            -- (a) If data == nil then return 1
            -- (b) If data != nil then return argv[i+1]
            
            if( data == nil  )
            then
                rtnval = 1
            else
                rtnval = argv[i+1]
            end
            
            -- In either case just break out
            
            break
        end
    end
    
    return( rtnval )
end

		
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<