Home→Forums→MonoBrick EV3 Firmware→Brick-Simulator?→Reply To: Brick-Simulator?

Martin Wagner
Hi Anders,
My hair turned even more gray. Since my first bitmap approach for the LCD-screen had this spoiled text, I started building a WPF realization with a rectangle per pixel (recommendation of a colleague at work). As WPF-newbie, I really had problems properly implementing the MVVM pattern. But after a lot of pixel-per-pixel-testing it finally worked and I had to realize that was ways too slow.
So I started with the bitmap approach again. I realized that the spoiled writing is due to reverse bit order in displayBuffer. Why did you implement it this way? After adding a reversing and negating function, I could use the BitmapSource.Create functions from DotNet. The screen finally works okay! Ufff. (See attachment).
Before implementing the next step, I got a question:
At the moment, several instances of Lcd could be created, overwriting each other. How shall I solved that?
1. Make the Lcd-HAL accept inputs from several lcd instances, which are OR-wise combined, with a semaphore controlling access. But then public void Clear() would have to be changed as well.
2. Convert Lcd into a singleton as well to ensure that only one instance exists. ( Lcd myLcd = new Lcd(); ==>> Lcd myLcd = Lcd.init; )
I would prefer the second solution. What do you suggest?
Hope to hear from you soon,
Martin
Follow