Windows CE

ceaser

Active Member
Licensed User
Hi

I wonder if somebody can give me advise please. I have a Surveying program called "Ceaser" that runs on any PDA with Windows Mobile on. I have received a Nikon Total Station with Windows CE on, onto which I want to copy my program.

This I have done and the program runs OK, except for the screen resolution. The screen on the Nikon is in Landscape orientation and I have adjusted the screen size in Basic4ppc to suit the Nikon. But when I install the program on the Nikon, the width (should be 320 pixels) is not correct - the program is displayed too narrow on the screen of the Nikon.:sign0148:

Any help please?

Regards
Michael
 

ceaser

Active Member
Licensed User
Hi Erel

I have changed the setting in the "CEnhancedForm", but soemthing is not working 100%. The main screens with the menus on display allright, but the other forms that are still crop on the right side of the screen.

Must I not maybe change something else in the file....I see further down the file that there is also a screen size setting.

Regards
Michael
 

ceaser

Active Member
Licensed User
Hi Erel

I have found today that when I click on the "maximize" button, then the screen fills up the entire display - which is correct.

Is there a way maybe to program this into my program....that each time the user opens a new screen, that the program maximizes the screen?

Thanks
Michael
 

ceaser

Active Member
Licensed User
Hi Erel

Sorry for wasting your time, but I have found my mistake....I have been using the wrong screen size:BangHead:

Another question...because the Total Station is Windows CE, it does not display my horizontal angle. When I do setting out I have to continously read the horizontal angle from the instrument and display the updated angle as I turn the instrument to the setting out correct angle.

How can I accomplish to read this angle continously in the background, while I do something else in the program?

Thanks
Michael
 

agraham

Expert
Licensed User
Longtime User
Try using a Thread and do something like this. See the comments in the ThreadTest example in my Threading library. You will need Threading3 if you are using Basic4ppc v6.90. If your program is not permanently blocking the UI during the time the update is needed then use a Timer event instead.

B4X:
Sub ThreadCode
   ErrorLabel(ThreadCodeErr1) ' if abort is used to stop a thread an (intended by .NET) error occurs when optimised compiled
   Do While True ' do until aborted
      ' read the angle into a Global variable
      Thread.FireThreadEvent  ' update the reading
      Thread1.Sleep(1000) ' sleep for required update period to avoid using resources
   Loop
   ThreadCodeErr1: ' ignore any error when an optimised compiled thread is stoppped
End Sub

Sub Thread_ThreadEvent
   textbox1.Text = Angle ' do the update or whatever using the global value
End Sub

EDIT :- I'm a bit rusty on all this. As you seem to want to display the angle in your GUI a Thread alone won't do what you want. As the ThreadEvent runs on the GUI thread if you block the thread with a long loop then the update will not be visible unless you call DoEvents within the loop in which case you may as well use a Timer and not a Thread and keep things simple.
 
Last edited:

mjcoon

Well-Known Member
Licensed User
Try using a Thread. See the comments in the ThreadTest example in my Threading library. You will need Threading3 if you are using Basic4ppc v6.90. If your program is not permanently blocking the UI during the time the update is needed then use a Timer event instead.

I thought that would be the answer. But being a threading virgin (spinster? ;) I had to leave it to the expert!

Mike.
 
Top