Skip to content

Commit

Permalink
updated for change in led output
Browse files Browse the repository at this point in the history
  • Loading branch information
ikdekker committed Nov 14, 2016
1 parent 690bb83 commit b86b778
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
Empty file removed ac#�8d��
Empty file.
7 changes: 3 additions & 4 deletions build/Debug/GNU-Linux/main.o.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ build/Debug/GNU-Linux/main.o: main.cpp src/StorageManagement.h \
include/json.hpp src/ConfigFactory.h src/ModuleEntity.h \
src/ModuleServer.h src/DatabaseAdapter.h src/MatrixControl.h \
src/ModuleEntity.h src/ModuleServer.h src/ModuleEntity.h \
src/MatrixControl.h src/ScannerReader.h \
/home/nick/hidapi/hidapi/hidapi.h src/MatrixControl.h \
src/DatabaseAdapter.h
src/MatrixControl.h src/ScannerReader.h lib/hidapi/hidapi/hidapi.h \
src/MatrixControl.h src/DatabaseAdapter.h

src/StorageManagement.h:

Expand All @@ -30,7 +29,7 @@ src/MatrixControl.h:

src/ScannerReader.h:

/home/nick/hidapi/hidapi/hidapi.h:
lib/hidapi/hidapi/hidapi.h:

src/MatrixControl.h:

Expand Down
4 changes: 2 additions & 2 deletions build/Debug/GNU-Linux/src/StorageManagement.o.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ build/Debug/GNU-Linux/src/StorageManagement.o: src/StorageManagement.cxx \
src/ModuleEntity.h src/ModuleServer.h src/DatabaseAdapter.h \
src/MatrixControl.h src/ModuleEntity.h src/ModuleServer.h \
src/ModuleEntity.h src/MatrixControl.h src/ScannerReader.h \
/home/nick/hidapi/hidapi/hidapi.h src/ScannerReader.h
lib/hidapi/hidapi/hidapi.h src/ScannerReader.h

src/StorageManagement.h:

Expand All @@ -29,6 +29,6 @@ src/MatrixControl.h:

src/ScannerReader.h:

/home/nick/hidapi/hidapi/hidapi.h:
lib/hidapi/hidapi/hidapi.h:

src/ScannerReader.h:
4 changes: 2 additions & 2 deletions config/modules.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"id" : 0,
"rows": 4,
"rows": 6,
"columns": 8,
"disableRows": ""
},
Expand All @@ -11,4 +11,4 @@
"columns": 8,
"disableRows": ""
}
]
]
3 changes: 2 additions & 1 deletion src/MatrixControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ MatrixControl::MatrixControl(ModuleServer* serv) : server(serv) {
shiftData *s = new shiftData();
s->id = (*it)->getId();
// cout << s->id << "id";
//change to reset
s->reg1 = 0;
s->reg2 = 0;
moduleData.insert(moduleData.begin(), s);
Expand All @@ -44,7 +45,7 @@ Point MatrixControl::indexToLocation(int index, int modId) {
int rows = ent->getRows();
pt.y = floor(index / cols);
pt.x = index - (pt.y * cols);

cout << pt.y << " = y " << pt.x << " = x \n";
return pt;
}

Expand Down
7 changes: 5 additions & 2 deletions src/StorageManagement.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ void StorageManagement::run() {

scanReader->start();
string lastCode;
int change = 1;
while (1) {
if (scanReader->isRunning()) {
if (scanReader->hasRead()) {
Expand All @@ -98,10 +99,12 @@ void StorageManagement::run() {
int modId = 0;
int index = dbAdapter->addOrder(findFreeSpot(modId), lastCode, modId);
matrix->ledOn(index, modId);

change = 1;
cout << index << endl;
}
}
matrix->update();
if (change) {
matrix->update(); change = 0;
}
}
}

0 comments on commit b86b778

Please sign in to comment.