View
217
Download
1
Embed Size (px)
Citation preview
EE296 – Web-based Truth Table EE296 – Web-based Truth Table ProgramProgram
Jason AxelsonJason Axelson
Bryant KomoBryant Komo
Brief OverviewBrief Overview We are doing a web based version of truth_table which We are doing a web based version of truth_table which
was used in EE260 to create truth tables and create hex was used in EE260 to create truth tables and create hex files for the eprom. files for the eprom.
Our project will be written mostly in JavaScript, which is Our project will be written mostly in JavaScript, which is an interpreted scripting language for the web an interpreted scripting language for the web
We will also use cgi which is a script (we're going to use We will also use cgi which is a script (we're going to use C, but many other languages are possible) that runs on C, but many other languages are possible) that runs on the server. the server.
Our program will be better than truth_table. Our program will be better than truth_table.
Assembling the HTMLAssembling the HTML
For each row For each row Add HTML for row label Add HTML for row label Add HTML for input cells Add HTML for input cells Add HTML for the border cell Add HTML for the border cell Add HTML for output cells Add HTML for output cells
Write HTML to inside of a div tag Write HTML to inside of a div tag
Manipulating RowsManipulating Rows
If row is beyond table, add line at end of If row is beyond table, add line at end of table table
save table to temp save table to temp add row to bottom add row to bottom redraw table with new height redraw table with new height open part of table that is above the row open part of table that is above the row
being added being added open bottom half of table shifted down one open bottom half of table shifted down one
EventsEvents Uses onkeydown to capture key press. Uses onkeydown to capture key press. Uses onkeypress to capture key press. Uses onkeypress to capture key press. needs to use onkeypress for netscape, some old needs to use onkeypress for netscape, some old
versions of firefox, and opera, and onkeydown for most versions of firefox, and opera, and onkeydown for most other browsers. other browsers.
Uses onclick to capture mouse clicks. Uses onclick to capture mouse clicks. //Some browsers need to use onkeydown, some need to use //Some browsers need to use onkeydown, some need to use
onkeypress onkeypress if(isKeyDown) { if(isKeyDown) {
table_html += "onkeydown='return checkForKey(event, this)' "; table_html += "onkeydown='return checkForKey(event, this)' ";
} else if(isKeyPress) { } else if(isKeyPress) { table_html += "onkeypress='return checkForKey(event, this)' "; table_html += "onkeypress='return checkForKey(event, this)' ";
} }
Browser Detection Browser Detection
var browser = navigator.userAgent; var browser = navigator.userAgent; if(browser.indexOf("Firefox/1.0.2") != -1) { if(browser.indexOf("Firefox/1.0.2") != -1) {
isFirefox1_0_2 = true; isFirefox1_0_2 = true; isKeyPress = true; isKeyPress = true;
} else if(browser.indexOf("MSIE") != -1) { } else if(browser.indexOf("MSIE") != -1) { isIE = true; isIE = true; isKeyDown = true; isKeyDown = true;
} }
What Remains to Be DoneWhat Remains to Be Done
Work on cgi interface to bool and Work on cgi interface to bool and wiliki/spectra accounts wiliki/spectra accounts
Be able to convert to hex file Be able to convert to hex file Be able to save across sessions Be able to save across sessions
somehow. somehow. Flesh out interface Flesh out interface
Basic Timeline for CompletionBasic Timeline for Completion
Get Bryant's website up Get Bryant's website up Don't know how long this will take Don't know how long this will take
Understand necessary parts of truth_table code Understand necessary parts of truth_table code Get exporting to .HEX working Get exporting to .HEX working Complete Error Checking module Complete Error Checking module Open/Save files Open/Save files Usability testing. Usability testing. Debug Debug Interface to bool. Interface to bool.
ProblemsProblems
The website only worked for certain The website only worked for certain browsers and certain versions of browsersbrowsers and certain versions of browsers
The way we named the array cells were a The way we named the array cells were a little difficult to work withlittle difficult to work with
Apparently, CGI has a small limit on its Apparently, CGI has a small limit on its buffer sizebuffer size