Lahman, how ya doing?




Some time ago we hit many keys concerning OOP, and discussed a simulation
of a thermal control system. I've been playing with that in the last few
days. Yes, it's taken me this long to get a round tuit. Turned out I had
to do some pretty heavy review of the basics, too. But I've gotten to a
basic design that I'm happy with, and I'm not sure if it's quite what
you'd had in mind, but it was influenced by it. And I just wanted to let
you know, sort of as appreciation for the time you'd spent. I think my
simple main() pretty much sums it up.

#include "control.h"
int main()
{
ControlBlock c1(1), c2(2), c3(3);

Timer t1(3); // trigger every 3 seconds
t1.add_task(&c1);
t1.add_task(&c2);

DoubleTimer t2(5,7); // event1 every 5 s, event2 every 7
t2.add_task(&c3);

Clock clock; // default 1 tick per second
clock.add_timer(&t1);
clock.add_timer(&t2);

for (int i = 0; i < 10; i++)
clock.tick();

return 0;
}

This isn't really "real" yet-- e.g. ControlBlock has some diagnostic
members (the parameters are just to give each a unique identity when they
report), and will become the ancestor to derived classes, including a
chart recorder that saves as a data point an average and standard
deviation over a given time. That's what DoubleTimer is for, because
there will be a sampling time and an averaging time, similarly to the
apparatus. But it reflects what I want "real" to be. There'll be
separate timers for the analog peices, the digital controllers, the chart
recorders, and the switch that turns the beam on and off-- four total,
each with one or more tasks, or control blocks, to manage. All on one
clock.

I'd started with a Timer class that keeps the total time separately in
each individual instantiation, but I thought that wasn't quite logically
representative since there's only one time. I thought it still wasn't
worthwhile changing that until I realized that main() was pretty much
doing what I'd have Clock doing anyway.

Ultimately I'd like to "fit" control parameters to find ideal control. So
select a set of PID parameters, generate a curve, fit the curve to a
model, test the model against what we'd like the control to be, and repeat.

Anyway, just checking in. Thanks for the help.

--
"Awareness means not just a vague, comfortable, fuzzy feeling. It means
explicit knowledge of current conditions." -- NBSR Radiation Safety
Training
.



Relevant Pages

  • multiple slow ache from Pervez Youssef Al Islamias drink
    ... supreme noisy scientists will find much as registrations. ... Otherwise the control in ... fit a production! ... margins. ...
    (sci.crypt)
  • Re: What went wrong with our slam bidding?
    ... besides, we might have a 4-4 major fit, so I bid 3H. ... denying 1st or 2nd round control in diamonds. ... Well, he wasn't showing tolerance, but a real fit under the assumption ... Concern about this question is what led to my partner choosing the ...
    (rec.games.bridge)
  • Re: Fit print on page?
    ... control / IE toolbar add-on) from ... this download page will install the ... Even when I set the margins to the minimum it still won't fit. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Text Fit
    ... I have a fixed length control. ... I may use several font sizes that ... how many text characters will fit in the control. ... If you're talking about a block of text in just one font then have a look at the the DrawText API and check out the flag DT_CALCRECT. ...
    (microsoft.public.vb.general.discussion)
  • Help needed: Missing some parts
    ... The volume control of the CPC6128 fits somehow and would give a good 2nd ... The volume control of the CPC464 seems to fit the ... plug it could work out well too. ... so that I can buy them and don't have to solder the ...
    (comp.sys.amstrad.8bit)

Loading