SystemMetrics Error

Hello everyone,
I am new to gadgeteering and I am developing using FEZ Cerebus hardware with Display_N18 module. My application displays simple WPFwindow on the display module.
It was working pretty well and now the same code gives me this error;
“System reboot should have occurred to set width/height in SystemMetrics” and execution halts.

I removed every bit of code and even with simple “Window win = display_N18.WPFWindow”, it throws the same problem.Any thoughts on whats causing this and how to get rid of this?

Thanks,
Deepak

I’d guess that something gone wrong when the screen size was written to flash.
I would update the firmware again, to have a clean restart.

1 Like

@ ReinhardOstermeier
Thanks for your response. I updated the firware using MFDeploy. That did not help.
I have noticed that it is this line that is causing the problem:
Window win = display_N18.WPFWindow;

i can still write text to the display using the native method and it it works
display_N18.SimpleGraphics.DisplayText(“TEXT”);

Any idea what else I could try?

The Gadgeteer WPF code in 4.2 assumes an LCD configuration. Since the DisplayN18 does not use the LCD controller, the WPF initialization code fails. The only sort-of work around I see is to add the Gadgeteer core DLL to your project and remove line 197 in DisplayModule.cs:



 SystemMetrics may be used elsewhere in WPF so it may still fail in other places. SimpleGraphics is your best bet on the N18.
1 Like

Thanks Aron. That answered the question :-).
I should say that I had this trouble with Display)N18 module only with Cerebus. On my raptor, even the WPFWindow worked as expected.