Changeset 73 in projects


Ignore:
Timestamp:
Jul 26, 2013, 11:33:55 AM (11 years ago)
Author:
sven
Message:

PaperTape Restauration: Fixed various bugs to bring back Web and visualisation CLI application:

  • Documentation: Fixed Links and added "Page superseded" box
  • Web-Frontend: Replaced buggy no-more-working-in-modern-browsers JavaScript ajax-POST-library by contemporary jquery
  • Visualisator: lochstreifen.c and cli.c, Makefile: Fixed bugs for modern compiler warnings. Now again the code compiles and works.
Location:
paper-tape-project/trunk
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • paper-tape-project/trunk/documentation/index.php

    r72 r73  
    114114        'The Paper Tape Project' => array(
    115115                'Start' => $doc.'/paper-tape-project.htm',
    116                 'In a nutshell' => $doc.'/in-a-nutshell.htm',
     116                'In a nutshell' => 'in-a-nutshell.htm',
    117117                'Abstract' => array(
    118                         'Subproject overview' => $doc.'/README.txt',
    119                         'To Do' => $doc.'/TODO.htm',
    120                         'Using Windows' => $doc.'/WINDOWS.txt',
     118                        'Subproject overview' => 'README.txt',
     119                        'To Do' => 'TODO.htm',
     120                        'Using Windows' => 'WINDOWS.txt',
    121121                ),
    122                 'Data' => $doc.'/daten/README.htm',
    123                 'Perl tools' => $doc.'/perl-tools/README.htm',
     122                'Data' => 'daten/README.htm',
     123                'Perl tools' => 'perl-tools/README.htm',
    124124                'Labeling and Fonts' => array(
    125                         'Generating Labels' => $doc.'/schriften/README.htm',
    126                         'Font Files' => $doc.'/schriften/font_files.htm'
     125                        'Generating Labels' => 'schriften/README.htm',
     126                        'Font Files' => 'schriften/font_files.htm'
    127127                ),
    128128                'Devices' => array(
    129                         'Facit Tape Punch' => $doc.'/driver/FACIT-MANUAL.txt',
    130                         'Ghielmetti Tape Reader' => $doc.'/reader/GHIELMETTI-MANUAL.txt'
     129                        'Facit Tape Punch' => 'driver/FACIT-MANUAL.txt',
     130                        'Ghielmetti Tape Reader' => 'reader/GHIELMETTI-MANUAL.txt'
    131131                ),
    132132                'Driver framework' => array(
    133                         'Legacy reader documentation' => $doc.'/reader/README.txt',
    134                         'Legacy puncher documentation' => $doc.'/puncher/README.txt',
    135                         'Legacy old puncher documentation' => $doc.'/userspace-driver/README.txt'
     133                        'Legacy reader documentation' => 'reader/README.txt',
     134                        'Legacy puncher documentation' => 'puncher/README.txt',
     135                        'Legacy old puncher documentation' => 'userspace-driver/README.txt'
    136136                ),
    137                 'Visualisation' => $doc.'/visualisator/README.htm',
     137                'Visualisation' => 'visualisator/README.htm',
    138138                'Web Frontend' => array(
    139                         'Abstract' => $doc.'/web-frontend/README.htm',
    140                         'Generating Paper Tapes online!' => $doc.'/web-frontend/'
     139                        'Abstract' => 'web-frontend/README.htm',
     140                        'Generating Paper Tapes online!' => 'web-frontend/'
    141141                )
    142         ),
    143 /*
     142        ),/*
    144143        'The Punch Card Project' => array(
    145144                'Start' => 'punch-card/README.htm',
     
    148147                        'Nixdorf 0377.01' => 'punch-card/driver/nixdorf-0377.01/README.htm'
    149148                )
    150         ),
    151 */
     149        ),*/
    152150        'Various' => array(
    153151                'Using PCI I/O cards' => $doc.'/parallel-port-card.htm'
     
    172170</div>
    173171<div id="content">
     172
     173<div class="box" id="outdated" style="background-color: #FEF2E0; border-color: #775E1C; color: #403E3E; font-size: 140%; line-height: 150%; margin-bottom: 40px;">
     174<h3 style="margin-top: 0; font-size:180%">The Punched Paper Project website has moved.</h3>
     175This website is from 2008 and the information is most likely quite outdated.
     176Please see the <a href="http://labs.technikum29.de/">technikum29 Labs</a> for the new website.
     177You might also want to check the <a href="http://www.technikum29.de">technikum29 Computer Museum main website</a>.
     178<br> -- Sven, July 2013
     179</div>
     180
    174181<?php
    175182  call_user_func($exec_action, $filename);#, $exec_array);
     
    184191  <a href="http://koeppel.homeunix.org">koeppel.homeunix.org</a>
    185192</div>
     193
  • paper-tape-project/trunk/visualisator/Makefile

    r20 r73  
    1010
    1111cli: cli.c lochstreifen.o
    12         $(CC) $(CAIRO_CFLAGS) $^ $(CAIRO_LIBS) -o $@
     12        $(CC) $(CAIRO_CFLAGS) $^ $(CAIRO_LIBS) -lm -o $@
    1313
    1414gtkpapertape.o: gtkpapertape.cc gtkpapertape.h
     
    3434
    3535clean:
    36         rm -v *.o cli gtk
     36        rm -fv *.o cli gtk
  • paper-tape-project/trunk/visualisator/cli.c

    r18 r73  
    249249        int x, color;          // iterators
    250250        long color_value[4]; // interpreted numbers
    251         char *buf = "xy";       // Buffer for strtol <- one color value
    252        
     251        char buf[3] = "xy";       // Buffer for strtol <- one color value
     252
    253253        // remove a "#" char if present
    254254        if(string[0] == '#')
     
    260260                // copy the current character to buffer, first position
    261261                buf[0] = string[x];
     262
    262263                // if short notation (shorter than AABBCC), dublicate
    263264                // current character to buffer second position, else
     
    267268                color_value[color] = strtol(buf, NULL, 16);
    268269        }
    269        
    270         DPRINTF("Allocating '%s' as #%x%x%x%x\n", string,
    271                 color_value[0], color_value[1], color_value[2], (color == 4) ? color_value[3] : 0xFF);
    272        
     270
     271        DPRINTF("Allocating '%s' as #%02x%02x%02x%02x\n", string,
     272                (unsigned int) color_value[0], (unsigned int) color_value[1], (unsigned int)color_value[2], (color == 4) ? (unsigned int) color_value[3] : 0xFF);
     273
    273274        return cairo_pattern_create_rgba(
    274275                (double) color_value[0] / (double) 0xFF,
     
    415416        }
    416417       
    417         lochstreifen_print_debug(l);
    418         exit(0);
     418        if(verbosity!=0)
     419                lochstreifen_print_debug(l);
    419420
    420421        // setting up the surface and painting...
  • paper-tape-project/trunk/visualisator/lochstreifen.c

    r22 r73  
    940940                cairo_user_to_device(cr, &x, &y);
    941941                cairo_user_to_device_distance(cr, &width, &height);
    942                 printf("draw: %i|%i %ix%i ", (int)x, (int)y, (int)width, (int)height);
    943         } else    printf("draw: ");
    944         printf("row %i->%i track %i->%i\n", row, row_max, track_min, track_max);
     942                //printf("draw: %i|%i %ix%i ", (int)x, (int)y, (int)width, (int)height);
     943        } //else    printf("draw: ");
     944        //printf("row %i->%i track %i->%i\n", row, row_max, track_min, track_max);
    945945       
    946946        // loop all the rows (bytes)
     
    998998                        }
    999999                       
    1000                         printf("testing byte\n");
     1000                        //printf("testing byte\n");
    10011001                        if( ((l->data[row] >> track) & 0x01) != 0x01) {
    10021002                                // bit is logical ZERO (0)
  • paper-tape-project/trunk/web-frontend/design/formular.js

    r1 r73  
    2828
    2929    // 2. Submit abänder
     30    /*
    3031    var button = document.getElementById("submit-button");
    3132    button.setAttribute("type", "button");
    3233    button.setAttribute("onclick", "new POST().submitForm(document.forms[0], getHttpRes);");
     34    */
     35    $(function(){
     36        // 2013: auf jquery umgestiegen von Teleport
     37        $("form").submit(function(){
     38            $.post($("form").attr("action"), $("form").serialize(), getHttpRes);
     39            return false; // Da per jquery
     40        });
     41    });
    3342
    3443    // 3. und dieses Teleport-Teil starten
    35     Init.run('BODY');
     44    // Init.run('BODY'); 
    3645}
    3746
     
    5867
    5968
     69/*
    6070function getHttpRes(msg, state, extra){
    6171     // Ajax-Antwort kriegen, mit diesem Teleport-Teil
    6272     if(state != __RPC_SUCCESS__) return alert("Konnte nicht zu Server verbinden!");
     73*/
     74function getHttpRes(data, textStatus, jqXHR) {
     75     // Ajax-Antwort kriegen, mit diesem Teleport-Teil
     76     //if(state != __RPC_SUCCESS__) return alert("Konnte nicht zu Server verbinden!");
     77
    6378
    6479     // nachricht checken:
    65      if(msg == "ok") {
     80     if(data == "ok") {
    6681         // weitermachen. Formular abschicken!
    6782         document.getElementById('ajax-output').innerHTML = "<div class='big-okay'>Alle Eingaben richtig, Lochstreifen wird erstellt...</div>";
     
    7792     } else {
    7893         var forword = "<p>Es sind Fehler in den Eingaben aufgetreten, daher kann der Lochstreifen noch nicht erstellt werden. Bitte berichtigen sie diese Fehler und klicken sie dann nochmals auf \"Lochstreifen generieren\"</p>\n";
    79          document.getElementById('ajax-output').innerHTML = forword+msg;
     94         document.getElementById('ajax-output').innerHTML = forword+data;
    8095         var button = document.getElementById("submit-button");
    8196         button.setAttribute("value", "Nochmal probieren & Lochstreifen generieren...");
  • paper-tape-project/trunk/web-frontend/generator.php

    r6 r73  
    3030
    3131// Konstanten:
    32 $draw_program = "../visualisator/binary";
     32$draw_program = "../visualisator/cli";
    3333
    3434// Ausgabeordner (ohne trailing slash)
     
    132132    }
    133133    exit;
     134}
     135
     136// Schritt 0: Ausgabeverzeichnis pruefen
     137if(!file_exists($output_dir)) {
     138        if(is_writeable($output_dir)) {
     139                mkdir($output_dir);
     140        } else
     141                $errors[] = "Ausgabeverzeichnis <i>$output_dir</i> nicht anlegbar!";
    134142}
    135143
  • paper-tape-project/trunk/web-frontend/index.html

    r1 r73  
     1<?xml version="1.0" encoding="UTF-8" ?>
     2<!DOCTYPE html>
     3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
    14<!--
    25/*
     
    2730*/
    2831-->
    29 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    30      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    31 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
    3232<html>
    3333<head>
     
    3535   <link rel="stylesheet" href="http://dev.technikum29.de/src/private.design/style.css" type="text/css"/>
    3636   <link rel="stylesheet" href="design/formular.css" type="text/css"/>
    37    <script type="text/javascript" src="design/teleport_post.js"></script>
     37   <!--<script type="text/javascript" src="design/teleport_post.js"></script>-->
     38   <script type="text/javascript" src="design/jquery.js"></script>
    3839   <script type="text/javascript" src="design/formular.js"></script>
    3940   <meta name="date.initial" value="02.04.2008"/>
     
    9495        <img src="design/beschriftung.jpg" alt="Echter Lochstreifen mit Beschriftung" style="float:right;" />
    9596        <strong>Text generieren</strong>
    96         <br/>Mit dem Eingeben von Buchstaben wird das entsprechende Bitmuster &ndash; wie im Bild gezeigt &ndash; generiert.
     97        <br/>Mit dem Eingeben von Buchstaben wird das entsprechende Bitmuster, wie im Bild gezeigt, generiert.
    9798        </label>:
    9899        <br/><input type="text" maxlength="500" name="data-text" />
     
    351352    <p>Diese Online-Lochstreifenvisualisierung obliegt gewisser Beschränkungen (maximal 1MB Datenmenge, die
    352353    visualisiert wird). Mit der Offline-Variante gibt es diese Beschänkungen nicht. Und so sieht sie aus:</p>
    353     <p style="text-align:center;"><img src="design/screenshot.png" alt="Screenshot des GTK-PRogramms"></p />
     354    <p style="text-align:center;"><img src="design/screenshot.png" alt="Screenshot des GTK-PRogramms" /></p>
    354355    <p>Es handelt sich um ein <a href="http://www.gtk.org" target="_blank">GTK-Programm</a>, welches
    355356    genau das gleiche System nutzt, wie diese Onlineversion. Sie vereint alle Möglichkeiten, die das
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License