Click here to Skip to main content
15,887,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Google Login [modified] Pin
Laxman Auti6-Jun-06 20:20
Laxman Auti6-Jun-06 20:20 
GeneralRe: Google Login [modified] Pin
Rahul.RK6-Jun-06 20:23
Rahul.RK6-Jun-06 20:23 
QuestionHow to display 2 sheets in Excel Pin
MikeRT6-Jun-06 19:25
MikeRT6-Jun-06 19:25 
AnswerRe: How to display 2 sheets in Excel Pin
FarPointer6-Jun-06 19:48
FarPointer6-Jun-06 19:48 
GeneralRe: How to display 2 sheets in Excel Pin
MikeRT6-Jun-06 20:02
MikeRT6-Jun-06 20:02 
GeneralRe: How to display 2 sheets in Excel Pin
FarPointer6-Jun-06 20:12
FarPointer6-Jun-06 20:12 
GeneralRe: How to display 2 sheets in Excel Pin
MikeRT6-Jun-06 20:36
MikeRT6-Jun-06 20:36 
QuestionText file stream? Pin
supernalle6-Jun-06 19:16
supernalle6-Jun-06 19:16 
Hello c++ friends!

I am currently working on a handy program that scans temperature/fan control for boat engines. However I am stuck at the moment, I want it to write the average values (average value, maximum values and minimum values) to a text file hourly/daily or whatever time i define. Below is some code..

This one works just fine, it writes current temperature to a text file once every second:

void CAnalogTag::StoreData (double dRawData, BOOL bLive)
{
double dValue;
EnterCriticalSection(&m_csAccess);
m_dPrevRawValue = m_dLatestRawValue;
m_dLatestRawValue = dRawData;
LeaveCriticalSection(&m_csAccess);

if (m_pSecondsBin && bLive)
m_pSecondsBin->StoreDataPoint(dRawData);

std::ofstream ScanFile ("scanfile.txt", std::ios_base::app);

ScanFile << "Temperature: " << dRawData << endl << "Offset: " << m_dOffset << "\n";
ScanFile.close();
}

""

That works just fine, I think below is where the values that i want are stored, but I don't know how or if it's even possible to extract them:

""
void CAnalogTag::StoreData(void *pData, void *pMinData, void *pMaxData, long nNumPts, int nTrendType)
{
CArray<double, double&=""> *pTrendData = (CArray<double,double&> *)pData;
CArray<double, double&=""> *pMinTrendData = (CArray<double,double&> *)pMinData;
CArray<double, double&=""> *pMaxTrendData = (CArray<double,double&> *)pMaxData;
// store an entire array of data to the bin

switch (nTrendType)
{
case trend_seconds:
if (m_pSecondsBin)
m_pSecondsBin->SetEntireTrend(pTrendData, pMinTrendData, pMaxTrendData, nNumPts);
break;
case trend_minutes:
if (m_pMinutesBin)
m_pMinutesBin->SetEntireTrend(pTrendData, pMinTrendData, pMaxTrendData, nNumPts);
break;
case trend_hours:
if (m_pHoursBin)
m_pHoursBin->SetEntireTrend(pTrendData, pMinTrendData, pMaxTrendData, nNumPts);
break;
case trend_days:
if (m_pDaysBin)
m_pDaysBin->SetEntireTrend(pTrendData, pMinTrendData, pMaxTrendData, nNumPts);
break;
}
}

""

Any help would be appreciated.. Been stuck here for the last few days, and i think my boss is losing his patience Big Grin | :-D

Cheers,
Nalle
Questionask for suggestion Pin
cheng_guo6-Jun-06 19:00
cheng_guo6-Jun-06 19:00 
AnswerRe: ask for suggestion Pin
_AnsHUMAN_ 6-Jun-06 19:11
_AnsHUMAN_ 6-Jun-06 19:11 
GeneralRe: ask for suggestion Pin
cheng_guo7-Jun-06 5:24
cheng_guo7-Jun-06 5:24 
QuestionRe: ask for suggestion Pin
Hamid_RT6-Jun-06 19:33
Hamid_RT6-Jun-06 19:33 
QuestionWhich interface can I use to set background-repeat property? Pin
Tcpip20056-Jun-06 18:55
Tcpip20056-Jun-06 18:55 
AnswerRe: Which interface can I use to set background-repeat property? Pin
Tcpip20056-Jun-06 21:48
Tcpip20056-Jun-06 21:48 
QuestionAdding const won't compile Pin
MALDATA6-Jun-06 18:48
MALDATA6-Jun-06 18:48 
AnswerRe: Adding const won't compile Pin
sunit56-Jun-06 19:09
sunit56-Jun-06 19:09 
AnswerRe: Adding const won't compile Pin
toxcct6-Jun-06 22:00
toxcct6-Jun-06 22:00 
AnswerRe: Adding const won't compile Pin
Michael Dunn7-Jun-06 2:52
sitebuilderMichael Dunn7-Jun-06 2:52 
QuestionHow to clear the screen to recover to the old style Pin
xuwenq886-Jun-06 18:45
xuwenq886-Jun-06 18:45 
AnswerRe: How to clear the screen to recover to the old style Pin
Hamid_RT6-Jun-06 19:11
Hamid_RT6-Jun-06 19:11 
AnswerRe: How to clear the screen to recover to the old style [modified] Pin
Naveen6-Jun-06 21:50
Naveen6-Jun-06 21:50 
Generalbest book for VC++ beginners Pin
sach!!6-Jun-06 18:32
sach!!6-Jun-06 18:32 
GeneralRe: best book for VC++ beginners Pin
nicknotyet7-Jun-06 10:15
nicknotyet7-Jun-06 10:15 
GeneralRe: best book for VC++ beginners Pin
bob169727-Jun-06 17:46
bob169727-Jun-06 17:46 
GeneralRe: best book for VC++ beginners Pin
nicknotyet8-Jun-06 3:29
nicknotyet8-Jun-06 3:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.