 |
|
 |
I just downloaded the source code, but it wont compile and run as is. I was hoping to be able to generate the TestOScope.exe file. i would then take it from there and make my changes. But as of the way it is now there is no main file. Am I misunderstanding something?
|
|
|
|
 |
|
 |
Sorry for your confusion. Did you download the "Source Code" or the "Demo Project"? The "Source Code" only contains the control itself. You'll need the "Demo Project" to build and test an EXE.
I just checked the links and the "Demo Project" downloads, compiles (Visual C++ 6.0) and runs correctly on my machine.
- Mark
|
|
|
|
 |
|
 |
Thanks for your speedy reply. I downloaded the project but could not open it successfully because I have Microsoft Visual C++ 2010 Express with MFC compilation enabled using instructions from
http://www.codeproject.com/KB/MFC/MFCinVisualStudioExpress.aspx
So I am trying to create a new project with your files and am getting this error:
1>LINK : fatal error LNK1561: entry point must be defined
I'm new to this whole visual C++. I have only done basic C and C++ projects before, so I'm still trying to figure it out.
|
|
|
|
 |
|
 |
I'm a newbie in visual studio
when I Copy the header and cpp files and paste into my project directory, the compiler gives me an error message
error C2664: 'BOOL CDC::TextOutW(int,int,const CString &)' : cannot convert parameter 3 from 'const char [2]' to 'const CString &'
does it due to the settings in my visual studio 2005??
|
|
|
|
 |
|
 |
It might be a "Visual Studio 2005" versus "Visual C++ 6.0" thing. Just re-cast your character array to a CString or create a new CString variable and us it instead.
- Mark
|
|
|
|
 |
|
 |
I am using VC++ 6.0 to compile the demo project. During linking I get the following error:
libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/TestOScope.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
I have searched all around to find a solution but so far no luck. I have done all I know to Project Settings but just cannot make the app compile. Any thoughts on what might be the problem ??
Thanks
-- modified at 8:36 Wednesday 14th February, 2007
|
|
|
|
 |
|
 |
Hi,
very good project for me but how can implement left to right. Any body know did imlement to left to right.
Could anyone implement suggested modification?
|
|
|
|
 |
|
 |
Hello:
Have you solved this problem? If yes, can I have the code?
Many thanks.
Ke
|
|
|
|
 |
|
 |
If you declare a variant without using it,I mean, just place it in the data member list in the C***Dlg Class,program crashes when it terminats at your class's destructor .
( like this COScopeCtrl m_OScopeCtrl;)
(Warning Again: Don't initializing it in InitDialog or anywhere else)
I am Married But Available.
so call me MBA.
|
|
|
|
 |
|
 |
Hi Mark.
I want to design Data frome COM port (Real Oscope)
but I dont know that how to receive data and Design that.
(I use frome mscomm32.ocx for Read Data)
Data from a AC signal that is convert to Digital signal(with A/D)
I want design the signal in VC (RealTime Sampling)
this is my project(I'm student).
Please Please Please Help me!
thank you for your Help.
|
|
|
|
 |
|
 |
I've created a dialog that has 8 Strip Chart controls, the first two update and the other six don't. If I move the dialog window and keep the left mouse button depressed all 8 chart controls update(the call to append data seems to work). Has anyone seen this behavior from the control, can anyone help?
|
|
|
|
 |
|
 |
I'm changing original code to the Multiple Line OScope class.
If you are interested in this subject, please send a mail to me.
I'll send source code and demo project. Good luck!
My e-mail address is yeol238@hotmail.com
-- modified at 20:00 Monday 12th December, 2005
|
|
|
|
 |
|
 |
Dear All...
How to add 3 data with different color in this chart ?..
Thx.
|
|
|
|
 |
|
 |
In my program, it can hardly show 1 graph per sec.
Oscilloscope should be able to show at least 20 waves per second.
Perf is ok if added 1 point to graph, but i'm adding 200points every time.
Any solutions?
|
|
|
|
 |
|
 |
I want to use Oscilloscope/StripChart Control in my C# application. Can anyone tell me how to use this control in C# application?
|
|
|
|
 |
|
 |
Hello,
I have built up an simple measurement circuit and I need to display the result in sine wave from my PC. So, can anyone pls tell me how can I read the data from my comm port and convert in into a grahical result. 10Q
|
|
|
|
 |
|
 |
Hi,
Great job. Thanks.
But, I am not putting it on a dialog (so no picture box).
I am putting it in a CSizingControlBar (by Cristi Posea).
It is just a black fill.
My background color is not black.
No points are drawn.
What is the issue?
Larry Dobson
If you want to be seen, stand up.
If you want to be heard, speak up.
If you want to be respected, shut up.
William Batson
|
|
|
|
 |
|
 |
This control was really nice but I needed it to do one additional thing. Automatically rescale the existing data if I call SetRange(). As it stands it will call InvalidateCtrl() which blanks out the entire chart. I added a circular buffer that stores the data points so they can be re-plotted by the SetRange() method after the Y-axis has been re-scaled. It seems to work really nice for what I wanted. If anyone is interested in this just respond to this message and I can provide the changes.
Gil Jones
|
|
|
|
 |
|
 |
I was asked for my changes so I figured I'd also post what I did. Feel free to make any suggestions or let me know about any problems with this.
Added the following variables to the header file:
class COScopeCtrl : public CWnd
{
...
protected:
...
<code>int m_nBufferSize;
int m_nDataIndex;
bool m_bWrapped;
double *m_pdblDataPoints;</code>
}
Added the following to the end of the constructor code:
COScopeCtrl::COScopeCtrl()
{
...
<code> m_pdblDataPoints = NULL;
m_nDataIndex = 0;
m_bWrapped = false;</code>
}
Update the SetRange() method:
void COScopeCtrl::SetRange(double dLower, double dUpper, int nDecimalPlaces)
{
ASSERT(dUpper > dLower) ;
m_dLowerLimit = dLower ;
m_dUpperLimit = dUpper ;
m_nYDecimals = nDecimalPlaces ;
m_dRange = m_dUpperLimit - m_dLowerLimit ;
m_dVerticalFactor = (double)m_nPlotHeight / m_dRange ;
InvalidateCtrl() ;
<code>if(m_bWrapped ) {
m_dPreviousPosition = m_pdblDataPoints[(m_nDataIndex+1)%m_nBufferSize];
for( int i = ((m_nDataIndex+1)%m_nBufferSize); i != m_nDataIndex; i = (i + 1)%m_nBufferSize)
{
m_dCurrentPosition = m_pdblDataPoints[i];
DrawPoint() ;
}
}
else if( m_nDataIndex != 0 ) {
m_dPreviousPosition = m_pdblDataPoints[0];
for( int i = 0; i < m_nDataIndex; i++)
{
m_dCurrentPosition = m_pdblDataPoints[i];
DrawPoint() ;
}
}
Invalidate() ;</code>
} // SetRange
Added the following to the end of InvalidateCtrl:
void COScopeCtrl::InvalidateCtrl()
{
...
<code> if(m_nPlotWidth/m_nShiftPixels != m_nBufferSize )
{
if( m_pdblDataPoints != NULL )
delete m_pdblDataPoints;
m_nBufferSize = m_nPlotWidth/m_nShiftPixels; m_pdblDataPoints = new double[m_nBufferSize]; m_nDataIndex = 0;
m_bWrapped = false;
}</code>
} // InvalidateCtrl
And finally update AppendPoint:
double COScopeCtrl::AppendPoint(double dNewPoint)
{
double dPrevious ;
<code> m_pdblDataPoints[m_nDataIndex++] = dNewPoint;
m_nDataIndex %= m_nBufferSize;
if(m_nDataIndex == 0)
m_bWrapped = true;</code>
dPrevious = m_dCurrentPosition ;
m_dCurrentPosition = dNewPoint ;
DrawPoint() ;
Invalidate() ;
return dPrevious ;
}
Enjoy,
Gil Jones
|
|
|
|
 |
|
 |
Many thanks to Mark and Gil!
I found all of this code to be very useful in latest project. I gave Mark a 5>
I had one small problem. I experienced some clipping of the leading edge of the trace during autoranging. This is caused in some way by the automatic resizing of the plot rectangle when the range numbers grow in digits. So far, I am not able to define the exact cause. Maybe something to do with the data buffer. For now, I solved the problem by fixing the value of nCharacters so that the rectangle never changes size.
If anyone has a more elegant solution, please let us know.
ronpeters
|
|
|
|
 |
|
 |
Ron,
I'll try to reproduce this problem as well because I want to fix my code also if there's an issue. It's possible that my application doesn't grow the number of digits across the range of temperature I'm dealing with so maybe that's why I didn't see the problem.
Just to make sure I understand your description....
The problem happens when your Y-axis values get larger such that the number of digits increases. And when you say leading edge you mean that some of the values on the right side of the plot are not showing up until they scroll into view.
I'll take a look at the code when I get home tonight.
Gil Jones
|
|
|
|
 |
|
 |
Hi Gil,
Thanks for the fast response!
Yes, the problem happens when the number of y-axis digits increase. This results in a shrinking of the plot rectangle.
By leading edge I mean:
My waveform is progressing from right to left. When the resizing happens, instead of the currently displayed trace rescaling, it vanishes. At this point, the trace has progressed only partly across the plot rectangle. The remainder of the trace progresses noramlly, no increase in digits happens in the case at hand. These are electrical waveforms, current in this case. I start out at +/- 10 Amps. In this case, current eventually reaches ~1100A. So, autoranging increases the digit count twice.
So, I'm guessing: we store the currently displayed values, adjust the range, rescale the values and re-write them to the plot rectangle. In this case, they don't get re-written, or re-displayed.
Hope this helps!
ronpeters
|
|
|
|
 |
|
 |
Ron,
Sorry it took me so long to respond. I've been writing all the firmware and window application for a new focuser product for telescopes as a side project and we've been down to the wire finishing up in time for christmas. Here's a link to check it out...there are some software screenshots at the bottom:
http://www.threebuttes.com/focuser.htm
Anyways...I think I have a fix for this issue...
Replace the code I had added to COScopeCtrl::InvalidateCtrl() with the following:
if(m_nPlotWidth/m_nShiftPixels != m_nBufferSize )
{
double *m_pdblSavedDataPoints = m_pdblDataPoints;
int nOldBufferSize = m_nBufferSize;
m_nBufferSize = m_nPlotWidth/m_nShiftPixels;
m_pdblDataPoints = new double[m_nBufferSize];
int nPointsToCopy = 0;
bool bNewWrapFlag = false;
if( m_pdblSavedDataPoints != NULL )
{
if(m_nBufferSize >= nOldBufferSize)
{
if(m_bWrapped)
nPointsToCopy = nOldBufferSize;
else
nPointsToCopy = m_nDataIndex;
}
else
{
if(m_bWrapped || (m_nBufferSize < m_nDataIndex))
{
nPointsToCopy = m_nBufferSize;
bNewWrapFlag = true;
}
else
nPointsToCopy = m_nDataIndex;
}
}
if( nPointsToCopy > 0 )
{
for( int i = nPointsToCopy-1; i >= 0; --i )
{
if(m_nDataIndex == 0)
m_nDataIndex = nOldBufferSize-1;
else
m_nDataIndex--;
m_pdblDataPoints[i] = m_pdblSavedDataPoints[m_nDataIndex];
}
}
if( m_pdblSavedDataPoints != NULL )
delete m_pdblSavedDataPoints;
if( bNewWrapFlag )
m_nDataIndex = 0;
else
m_nDataIndex = nPointsToCopy;
m_bWrapped = bNewWrapFlag;
}
If anyone finds any issues with this or any improvements feel free to let me know.
Thanks,
Gil Jones
|
|
|
|
 |
|
 |
Thanks Gil,
Works great!!!
I checked out your screen shots. Very nice!
Regards,
Ron Peters
|
|
|
|
 |
|
 |
Gil,
Thanks for the code, works great! There's a little memory leak though. Use operator delete[] In InvalidateCtrl():
delete [] m_pdblSavedDataPoints;
Also put the same line in destructor.
az0te
|
|
|
|
 |