summaryrefslogtreecommitdiff
path: root/MainWindow.cpp
diff options
context:
space:
mode:
authorDaniel Jones <admin@danieljon.es>2020-07-03 00:38:15 +0930
committerDaniel Jones <admin@danieljon.es>2020-07-03 00:38:15 +0930
commit7e8f5a8e885ab980b3ac1acbec84f46ba28d0ca5 (patch)
tree18adf40cf064adb03a609c014ae20878b662bd63 /MainWindow.cpp
parent6658e28681480939ba0aaf46ecda9ea6d3642eb9 (diff)
downloadfoxlogicgates-7e8f5a8e885ab980b3ac1acbec84f46ba28d0ca5.tar.gz
foxlogicgates-7e8f5a8e885ab980b3ac1acbec84f46ba28d0ca5.zip
objects other than gates are now properly updated
this allows the binary display to be used as an input (any non 0 value turns the output on)
Diffstat (limited to 'MainWindow.cpp')
-rw-r--r--MainWindow.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/MainWindow.cpp b/MainWindow.cpp
index 2c21df9..4a06ea9 100644
--- a/MainWindow.cpp
+++ b/MainWindow.cpp
@@ -511,22 +511,12 @@ MainWindow::update_object_state(Object *object)
Gate *object2;
for(auto o = object->get_output_objects()->begin(); o != object->get_output_objects()->end(); ++o)
{
- switch (object->get_object_type())
+ object2 = (Gate*)find_object_by_id((*o));
+ if (object2)
{
- case Object::GATE:
- object2 = (Gate*)find_object_by_id((*o));
- if (object2)
- {
- update_object_state(object2);
- }
- break;
- case Object::NONE:
- default:
- printf("implement update_object_state for other types");
- break;
+ update_object_state(object2);
}
}
-
}
void
@@ -1277,7 +1267,7 @@ MainWindow::on_key_release(FXObject *sender, FXSelector sel, void *ptr)
case 4: bdsp.get_input4()->remove_output_object_id(bdsp.get_id()); bdsp.set_input4(nullptr); break;
case 5: bdsp.get_input5()->remove_output_object_id(bdsp.get_id()); bdsp.set_input5(nullptr); break;
case 6: bdsp.get_input6()->remove_output_object_id(bdsp.get_id()); bdsp.set_input6(nullptr); break;
- case 7: bdsp.get_input7()->remove_output_object_id(bdsp.get_id()); puts("7"); bdsp.set_input7(nullptr); break;
+ case 7: bdsp.get_input7()->remove_output_object_id(bdsp.get_id()); bdsp.set_input7(nullptr); break;
default: puts("input not handled in bdsp"); break;
}
break;