For this week, I’ve worked on several different things, mostly to complete the linking between schematic, compiler and processor simulator. To communicate among the components, I have used emit() in Wt which implement the signal and slot system.

Jsignal and Jslot
The signal and slot system allows user to send up to 6 arguments. In official Wt documentation, there is little elaboration on how to perform the Wt.emit function. In any web application, it is important to send information among different components, Wt emit makes it all so simple for the developer. It even supports sending data to a backend with different host. However, instead of Wt.emit, the id of the main application widget is used to replace “Wt” Ex: this->id.emit() .
As part of my task, I had to send a signal from backend to itself. I thought Wt.emit would serve my purposed but numerous tries turned to be fruitless until I saw that the signal is actually sent to the main application (the Wt signal unexposed error)! So, it turns out that the main widget ID have to be used again.
Another problem I have encountered with Wt Signal is sending some JSON text as a string argument, which was unsuccessful. The double quotes in JSON seemed to be causing an incorrect interpretation of data. Eventually, I had to use another method to send JSON: Http GET request.

A note about this->require()
Another interesting thing which I have discovered is that you should never use this->require to include dynamic javascript libraries. Previously, I generated a javascript file containing several parameters of IOs used during runtime, which was then included by the WApplication using this->require(). I realize that even after changing the IOs, the old data was used. I then found out in the file sources that the included javascript file does not change until I refresh the page.

Reading up on jointJS
As the final part of my first task, I need to integrate JointJS with IO output signals. I had some time to study on jointJS logic circuit example, which was quite complicated for me. I hope by the end of next week, I can show some interesting graphical results using the library.

Categories: Experiential

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.