Re: Configuation screen



On Tue, 16 Oct 2007 07:47:02 -0700, wceess
<wceess@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Thanks Robert that was really a huge help. This is what i have in mind and i
need all your opinion. I am thinking of developing a configuration
application, when the system boots up first time where i will display the
different bmp(UI) images of each machine and highlight just one. A switch is
provided to select any one of them. When they select the machine type i write
a particular value in registry and kill this process and boot my main
application. When the application boots it looks at this registry value and
based on this i am planning to change the no of sensors and some parameters
using just IF's or CASE statement.
Questions:
1) My hardware has a storage folder and that is the only place data remains
even after the system reboot(non-volatile memory). Is it possible to write
the user input into as a file in this folder and boot the main application by
reading the values in this file to take a decision?

I sure think the answer is yes. But maybe I'm missing something. The
industrial devices I've seen with persistent storage also have
mechanisms to start multiple applications after a soft and/or hard
reset. Maybe your hardware has something similar or, if you have
control, you can create something.


2) What is the advantage/disadvantage of using registry or just a simple
file format?

This has been the subject of some heated debates. I just used google
(http://groups.google.com/advanced_group_search) to look up
registry ini
and got 1,310. That's way fewer than I got before. I found a 11 Aug
2004 post from me in which I said the search yielded 129000 hits, and
restricting the search to posts from me yielded several threads with
particularly good discussions (and _not_ just because I was in them).
I'm pretty sure I had similar results in the last few months.

But that was then, and now I can't find a good discussion so I'll try
to summarize.

Way back in the early days of Windows, Microsoft introduced ini files
for storing settings. Some time later, Microsoft introduced the
registry and declared ini files outmoded. And now Microsoft is
promoting a new solution, at least for "big" Windows, but I can't
remember what it is.

I feel very strongly about avoiding shared resources unless absolutely
necessary (makes your program dependent on others and other programs
dependent on yours). That means avoiding the registry. I am not a
reliable source for the arguments favoring the registry so I won't
try. I also favor using the simplest method that does the job well. I
think that means using a simple file when storing only a few pieces of
info. If you're storing more info, ini files work well enough. If your
program is the only program that needs the info, use whatever format
works for you.

I haven't tried GetPrivateProfileString and related functions for a
while. Last time I checked for CE, they were modified to use the
registry rather than ini files, and Microsoft provided no neat
functions for handling ini files. I wrote and use my own functions,
which I can't share. But I just went to http://www.codeproject.com/,
searched for
ini file
and found several possible leads.

If you want to avoid user interference, you'll need to consider
encrypting and/or hiding the info some place. You will also need to
put the info some place where all the users have read/write access.
These two requirements apply regardless of how you store the info,
although access may be a trivial problem for CE.


3) If i have different machine images how would my application know which
image was selected?

I'm showing my ignorance here, but:
Can the same executable run on different machine images? If it can't,
you can use compile-time switches (#ifdef statements in C/C++). If it
can, someone here can probably provide a better explanation if you say
why you think you need to know.


Thanks in advance


"r_z_aret@xxxxxxxxxxxx" wrote:

On Tue, 9 Oct 2007 12:28:01 -0700, wceess
<wceess@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi all,

I have a Windows CE application that collects data from various sensor on
CAN, process and display them graphically. I am asked to develop a
configuration screen such that my application can run on different types of
machines, ie the number of sensors can be different on each machine type, the
data processing can be different and display. So i need a configuration
screen where a user can specify which type of vehicle he is in and that
should decide the no of sensors, algorithm and display that my application
should run.

This suggests you have a specific number of vehicle types, and want to
use the same set of sensors for each vehicle type. How about:
1) Create a read-only data file that specifies the sensors for each
vehicle type.
2) Have your program read that file and display the list of vehicle
types it found in the file.
3) Let the user choose the vehicle type. You can store the setting
somewhere so the user doesn't need to choose every time. I strongly
favor simple files rather than registry (avoid using shared resources
like the registry unless necessary).
4) Develop a custom control (UI widget) for each sensor type.
4) Dynamically add appropriate controls according to the specified
vehicle type. For straight Win32, this would mean using CreateWindow.

If you create a robust set of widgets and are a bit lucky, you can
expand the list of supported vehicles by editing the data file, with
no need to update the program.

Does this program need to display the readings continuously, or just
take a measurement from each sensor? If you need to display more than
1 or 2 readings continuously, the UI will be tricky. If you just need
to take single readings, I would take a very different approach.

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com


-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com
.



Relevant Pages

  • Re: Configuation screen
    ... a particular value in registry and kill this process and boot my main ... process and display them graphically. ... machines, ie the number of sensors can be different on each machine type, the ... use the same set of sensors for each vehicle type. ...
    (microsoft.public.windowsce.embedded)
  • Re: Configuation screen
    ... process and display them graphically. ... machines, ie the number of sensors can be different on each machine type, the ... screen where a user can specify which type of vehicle he is in and that ... use the same set of sensors for each vehicle type. ...
    (microsoft.public.windowsce.embedded)
  • Re: PNG
    ... Red X Instead of Images - Can't see or save Images/Pictures ... "UseHR" registry value is added to the registry. ... These are the steps for changing the DPI setting on your system. ... Right-click the Windows desktop to display the context menu. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: jpg / gif images smeared on IE6-Outlook6
    ... Check the registry associations for the image file types. ... >I posted before on the issue of not seeing graphics properly on the IE 6 ... > Change the DPI setting from Large to Normal and see if that helps. ... > Right-click the Windows desktop to display the context menu. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Slowing Record Navigation
    ... If you modify the Registry as Bob mentioned to stop the display of the ... "loading Image" dialog then you will no longer crash as you scroll through ...
    (microsoft.public.access.modulesdaovba)