Changeset e43c8d0 in thomson


Ignore:
Timestamp:
Mar 24, 2012, 3:26:03 PM (12 years ago)
Author:
Adrien Destugues <pulkomandy@…>
Branches:
main
Children:
4a558d7
Parents:
fe55aa5
Message:

Some cleanup.

git-svn-id: svn://localhost/thomson@26 85ae3b6b-dc8f-4344-a89d-598714f2e4e5

Location:
elec/CrO2/software
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • elec/CrO2/software/Makefile

    rfe55aa5 re43c8d0  
    33ifdef WINDIR
    44        # windows
    5 USBFLAGS = -I/usr/local/mingw/include
    6 USBLIBS = -L/usr/local/mingw/lib -lusb
     5USBFLAGS = -I/local/include
     6USBLIBS = -L/local/lib -lusb
    77EXE_SUFFIX = .exe
    88else
     
    1414
    1515CC              = g++
    16 CPPFLAGS = $(USBFLAGS) -Os -Wall -I/usr/include/IUP/ -I/local/include -std=c++0x -mthreads
    17 LIBS = $(USBLIBS) -Os -L/usr/lib/ -mwindows -liup -liupcontrols -liupcd -lcd -lfreetype -lz -lcomctl32 -lole32 -mthreads
     16CPPFLAGS = $(USBFLAGS) -Os -Wall -I/local/include -std=c++0x -mthreads
     17LIBS = $(USBLIBS) -Os -mwindows -liup -liupcontrols -liupcd -lcd -lfreetype -lz -lcomctl32 -lole32 -mthreads
    1818
    1919PROJECT = CrO2
  • elec/CrO2/software/device.cpp

    rfe55aa5 re43c8d0  
    3030Device& Device::getDevice() throw(const char*)
    3131{
     32        // If Device constructor throws an exception, instance is not initialized.
     33        // So, the constructor will be called again at next getDevice call, until
     34        // it succeeds.
    3235        if (instance == NULL)
    3336                instance = new Device();
  • elec/CrO2/software/gui.cpp

    rfe55aa5 re43c8d0  
    108108        IupSetAttribute(hexEd, "ALIGNMENT", "ALEFT");
    109109        Callback<Gui, const char*, int, int>::create(hexEd, "VALUE_CB", this, &Gui::matVal);
     110        Callback<Gui, int, int, int, const char*>::create(hexEd, "VALUE_EDIT_CB", this, &Gui::setMatVal);
    110111       
    111112        // WINDOW LAYOUT
     
    227228        return IUP_DEFAULT;
    228229}
     230
     231
     232int Gui::setMatVal(int x, int y, const char* val)
     233{
     234        int pos = (y-1) * 16 + (x-1);
     235
     236        if (file == NULL || selblock < 0 || selblock >= file->getBlockCount())
     237                return 0;
     238
     239        const Tape::Block& block = file->getBlock(selblock);
     240        block.data[pos] = 0; // TODO parse hex val to int
     241
     242        return 0;
     243}
     244
    229245
    230246const char* Gui::matVal(int y, int x)
  • elec/CrO2/software/gui.h

    rfe55aa5 re43c8d0  
    2727                // Explore
    2828                int selectBlock(int id, int what);
     29                int setMatVal(int x, int y, const char* newVal);
    2930                const char* matVal(int y, int x);
    3031                const char* toHex(int val);
Note: See TracChangeset for help on using the changeset viewer.