Forums
setting custome value to segmentclock - Printable Version

+- Forums (http://mitov.com/forum)
+-- Forum: Visual C++ / MFC Components (/forum-7.html)
+--- Forum: InstrumentLab (/forum-32.html)
+--- Thread: setting custome value to segmentclock (/thread-3078.html)



setting custome value to segmentclock - umeshwalkar - 10-28-2014 07:27 PM

Dear sir,

I am using InstrumnetLab V4.5
I am referring demo source code with visual studio 6 with MFC
I want to used this segmented clock with my custom value.
Basically wanted to create a up/down counter and not the clock.


This is my code snipets.

Clock1.Open( m_Clock1.m_hWnd );

Clock1.Segments.CenterColor = 0xFF00FFFF;
Clock1.Segments.Color = 0xFF4040FF;
//Clock1.Sections.Hours.Mode24Hours = false;
//Clock1.Sections.AmPm.Visible = true;
Clock1.Sections.Minutes.Separator.Points.Add( 2 );
Clock1.Sections.Seconds.Separator.Points.Add( 2 );
Clock1.TimeSource=tsValue;


Clock1.Value=691.9;
Now the “Value” is a double data type.
If I wanna set 14:32:50 what value I supposed to set and how to calculate it.


Thanking you,
Umesh


RE: setting custome value to segmentclock - Dave - 10-29-2014 02:33 AM

Hi!

In C++Builder there's a function that does that job for you:

System::TDateTime __fastcall EncodeTime(Word Hour,Word Min,Word Sec,Word MSec);

Don't know about VC, perhaps it has something similar function. If it uses the same format as the TDateTime datatype in Builder then the integral part is the date (not used here of course) and the fractional part the time.
Perhaps that helps somewhat, as an alternative you could perhaps use a SegmentText and display whatever string you want to be displayed.

Regards,
Dave


Alac converter bound - CobDiomi - 12-03-2016 07:59 PM

[IF!EQUALS] was not working correctly Wave id3 tagging fix (where could write an extra byte to the end of the file, giving a warning on wave decode) Converting wave (LIST + id3 tagged file) >> wave would only write (id3 tag) m4a tag writer was inefficient when trying to trim a huge tag (image as base64, for example) down to the allowed 255 chars A badly corrupted FLAC file could cause the converter to terminate encode based on timeout, not reported errors CD ripper - if reading ISRC and was not present for a track, then track+1 would not have ISRC read either CD ripper, batch converter, would default their positions if moved to a certain display (on multi monitor systems) Here the main setting is the encoder. By default, it is the LAME MP3 Encoder . which you can use to convert other audio formats into MP3 format. However, if you want to convert an audio file to FLAC, OGG, WAV or BONK, just select the appropriate encoder. Freeware alac2wav converter additional info: download online alac to wav ability secretary .alac to .wav should