#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" Serial Test " on openStack if the platform = "Win32" then set the hilite of btn "OS 9" to false set the hilite of btn "OS X" to false set the hilite of btn "Win" to true else put the systemVersion into tOS set the itemDel to "." if item 1 of tOS < 10 then set the hilite of btn "OS 9" to true set the hilite of btn "OS X" to false set the hilite of btn "Win" to false else set the hilite of btn "OS 9" to false set the hilite of btn "OS X" to true set the hilite of btn "Win" to false end if end if set the toolTipDelay to 500 send fillMenu to group "Platform" end openStack on closeStack if the hilite of btn "Port open" = true then send mouseUp to btn "Close Serial Port" end if end closeStack d t revstack false Serial Test U Courier New U Courier New @U Verdana U Lucida Grande cREVGeneral scriptChecksum 7#KeVց debugObjects bookmarks handlerList openStack closeStackscriptSelection char 539 to 538prevHandler openStacktempScript script
on openStack
if the platform = "Win32" then
set the hilite of btn "OS 9" to false
set the hilite of btn "OS X" to false
set the hilite of btn "Win" to true
else
put the systemVersion into tOS
set the itemDel to "."
if item 1 of tOS < 10 then
set the hilite of btn "OS 9" to true
set the hilite of btn "OS X" to false
set the hilite of btn "Win" to false
else
set the hilite of btn "OS 9" to false
set the hilite of btn "OS X" to true
set the hilite of btn "Win" to false
end if
end if
set the toolTipDelay to 500
send fillMenu to group "Platform"
end openStack
on closeStack
if the hilite of btn "Port open" = true then
send mouseUp to btn "Close Serial Port"
end if
end closeStack
P'local recEOL = empty on resetEOL -- work out the terminator character -- CR in Revolution isn't actually ASCII 13 put word 1 of the selectedText of btn "RecEOL" into recEOL if recEOL = "CR" then put numToChar(13) into recEOL else if recEOL = "LF" then put LF into recEOL else put CRLF into recEOL end resetEOL on readPort if the hilite of btn "Port open" = true then if recEOL is empty then resetEOL put the label of btn "Port" into thePort if the hilite of btn "OS X" then read from driver thePort until recEOL else read from file thePort until recEOL end if if it is not empty then put it after fld "recField" if last char of fld "recField" <> cr then put cr after fld "recField" send readPort to me in 5 ticks end if end readPort revcard false cREVGeneral scriptChecksum \}_f= bookmarks breakPoints handlerList resetEOL readPorttempScript prevHandler idlescriptSelection char 807 to 806script 0local recEOL = empty
on resetEOL
-- work out the terminator character
-- CR in Revolution isn't actually ASCII 13
put word 1 of the selectedText of btn "RecEOL" into recEOL
if recEOL = "CR" then put numToChar(13) into recEOL
else if recEOL = "LF" then put LF into recEOL
else put CRLF into recEOL
end resetEOL
on readPort
if the hilite of btn "Port open" = true then
if recEOL is empty then resetEOL
put the label of btn "Port" into thePort
if the hilite of btn "OS X" then
read from driver thePort until recEOL
else
read from file thePort until recEOL
end if
if it is not empty then put it after fld "recField"
if last char of fld "recField" <> cr then put cr after fld "recField"
send readPort to me in 5 ticks
end if
end readPort
Open Serial Port Epon mouseUp -- check which port is in use put the label of btn "Port" into thePort -- set the port parameters put "BAUD=" & the label of btn "Baud" & \ " PARITY=" & the label of btn "Parity" & \ " DATA=" & the label of btn "Data" & \ " STOP=" & the label of btn "Stop" into serial set the serialControlString to serial -- open the port & show any error set the cursor to watch if the hilite of btn "OS X" then open driver thePort for binary update else open file thePort for binary update end if if the result is not empty then answer the result else set the hilite of btn "Port open" to true -- start reading the port if open send readPort to this card in 10 ticks end if end mouseUp $ l &