Ignore:
Timestamp:
Dec 24, 2009, 4:17:54 AM (10 years ago)
Author:
sven
Message:

Punch Card Editor, ongoing development

  • Extended new Deck interface, expanding the undo framework
  • Implemented editor changes via undo framework
  • revised the menu and toolbar actions and structure (now dynamic construction at deck load time), implemented undo viewer
  • Started implementation of device driver framework in menu
  • Embedded the Qextserialport library (http://qextserialport.sourceforge.net/)
  • Started the Documation M200 Client device driver (well, just created the directory structure and qmake project file infrastructure)
  • At the current state, the complete project compiles :-)

Statistics: About 3500 Lines of code (without libqextserialport)

-- sven @ workstation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • punch-card/punch-card-editor/src/qpunchcard/card.h

    r52 r53  
    1414
    1515namespace QPunchCard {
    16         class Column; class Deck; class DeckIndex;
     16        class Column;
     17        class Card;
     18        class CardIndex;
    1719};
    1820
     
    7779
    7880        ~Card() {};
     81}; // class Card
     82
     83/**
     84 * An int with bounds (i is in [0, 79]). Behaves like DeckIndex (deck.h),
     85 * but slightly less intelligent since it does not need to know the
     86 * corresponding Card since all cards have same length (80 columns).
     87 * Use this class as an integer.
     88 **/
     89class CardIndex {
     90private:
     91        int i;
     92
     93public:
     94        // behaves like int, copy constructor and operator= will be created automatically
     95        CardIndex(int i = 0) : i(i) {}
     96        operator int() const { return normalized(); }
     97        int asInt() const { return normalized(); }
     98
     99        bool isValid() const { return i >= 0 && i < 80; }
     100
     101        // "normalisierung" = in Card bounds
     102        bool isNormalized() const { return i == normalized(); }
     103        int normalized() const { if(i < 0) return 0; else if(i >= 80) return 79; else return i; }
     104        void normalize() { i = normalized(); }
     105
     106        // special positions
     107        bool isFirst() const { return i == 0; }
     108        bool isLast() const { return i == 79; }
     109
     110        CardIndex& operator++() { i++; return *this; }
     111        CardIndex& operator+=(int x) { i+= x; return *this; }
    79112};
    80 
    81113
    82114/****************************************************************************
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