Click here to Skip to main content
16,005,552 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to change Dialog Back ground color Pin
Renjith Ramachandran15-May-03 4:46
Renjith Ramachandran15-May-03 4:46 
GeneralRe: Disable resizing of CSplitterWnd panes Pin
Jerry Evans15-May-03 1:45
Jerry Evans15-May-03 1:45 
GeneralRe: Disable resizing of CSplitterWnd panes Pin
John R. Shaw15-May-03 15:18
John R. Shaw15-May-03 15:18 
Generalerror C2102: '&' requires l-value Pin
flora_k14-May-03 22:19
flora_k14-May-03 22:19 
GeneralRe: error C2102: '&' requires l-value Pin
Rage14-May-03 22:28
professionalRage14-May-03 22:28 
GeneralRe: error C2102: '&' requires l-value Pin
flora_k14-May-03 22:36
flora_k14-May-03 22:36 
GeneralRe: error C2102: '&' requires l-value Pin
Rage14-May-03 22:50
professionalRage14-May-03 22:50 
GeneralRe: error C2102: '&' requires l-value Pin
flora_k14-May-03 23:08
flora_k14-May-03 23:08 
#include <stdio.h>
#include <math.h>

double tailing = 0;
double trl_values = 0;
double y_int_1 = 0;
int rest = 0;
double leading = 0;
double histogram_ram = 0;
double i_index;
double Trl_values;
double y_int = 0;

/*******************************************************************************************


Transfer function:
1
----------------
3.333e-005 s + 1


Transfer function:
0.1829 z + 0.11829
-----------------------
z - 0.6341

Sampling time: 1.9113e-008
********************************************************************************************/



unsigned char Slice_level(unsigned char x) // Function accessible only from this file
{
double b0=0.1829,b1=0.11829;
double a1= 0.6341;
double temp_x1,temp_x2;
double temp_y1;
unsigned char y;
int static xn_1;
int static yn_1,yn_2; // y(n-1)

temp_x1 = x * b0;
temp_x2 = xn_1* b1;

temp_y1 = yn_1 * a1;

y = temp_x1+ temp_x2 + temp_y1; // warning C4244

xn_1 = x;
yn_1 = y;

return y;

}

//main()

void SLFilter (long amount, unsigned char* pData)
{
long n;
unsigned char y;
for (n=0; n<amount; n++)
="" {
="" y="Slice_level(pData[n]);

" pdata[n]="y;
"
="" printf("%8d="" n",y);
="" }
}


="" *******************************************************************************************
="" this="" code="" shows="" the="" trl_values="" calculation.="" it="" is="" going="" to="" help="" determining="" histogram=""
********************************************************************************************=""


void="" trl_calculation(int="" amount,="" unsigned="" char*pdata)
{
="" long="" n;
="" for="" (int="" i="1;" <="amount;" i++)
="" if="" ((y_int_1)="" -="" 0)="" &="" (y_int=""> 0); //error C2102
tailing = 1 - (y_int- pData[n])/(y_int - y_int_1);
Trl_values(sizeof(Trl_values)+1) = tailing + leading + rest; // error C2064
leading = 1 - tailing;
rest = 0;

if ((y_int_1- pData[n] > 0)&(y_int- pData[n] < 0))
tailing = 1 - (y_int - pData[n])/(y_int - y_int_1);
Trl_values(sizeof(Trl_values)+1) = tailing + leading + rest; //error C2064
leading = 1 - tailing;
rest = 0;

rest = rest + 1;

y_int_1 = y_int;

}
}



void histogram(int amount, unsigned char*pData)
{
const double Duration = amount/4096;
for (int i=1; i <= amount; i++)
{
i_index = ceil(Trl_values(i)/Duration)+1; //error C2064
histogram_ram(i_index)=histogram_ram(i_index)+1; //error C2064

}
}

cpp(48) : warning C4244: '=' : conversion from 'double' to 'unsigned char', possible loss of data
cpp(90) : error C2102: '&' requires l-value
cpp(92) : error C2064: term does not evaluate to a function
cpp(98) : error C2064: term does not evaluate to a function
cpp(116) : error C2064: term does not evaluate to a function
cpp(117) : error C2064: term does not evaluate to a function


F.K
GeneralRe: error C2102: '&' requires l-value Pin
jhwurmbach14-May-03 23:19
jhwurmbach14-May-03 23:19 
GeneralRe: error C2102: '&' requires l-value Pin
Rage14-May-03 23:27
professionalRage14-May-03 23:27 
GeneralRe: error C2102: '&' requires l-value Pin
flora_k14-May-03 23:54
flora_k14-May-03 23:54 
GeneralRe: error C2102: '&' requires l-value Pin
David Crow15-May-03 3:02
David Crow15-May-03 3:02 
GeneralRe: error C2102: '&' requires l-value Pin
flora_k14-May-03 22:40
flora_k14-May-03 22:40 
Generaldifficult - CListCtrl::GetItemRect() Pin
JensB14-May-03 21:59
JensB14-May-03 21:59 
GeneralRe: difficult - CListCtrl::GetItemRect() Pin
Rage14-May-03 22:09
professionalRage14-May-03 22:09 
GeneralRe: difficult - CListCtrl::GetItemRect() Pin
JensB14-May-03 22:17
JensB14-May-03 22:17 
GeneralRe: difficult - CListCtrl::GetItemRect() Pin
Rage14-May-03 22:25
professionalRage14-May-03 22:25 
GeneralRe: difficult - CListCtrl::GetItemRect() Pin
JensB14-May-03 22:32
JensB14-May-03 22:32 
GeneralRe: difficult - CListCtrl::GetItemRect() Pin
Rage14-May-03 22:46
professionalRage14-May-03 22:46 
GeneralRe: difficult - CListCtrl::GetItemRect() Pin
JensB14-May-03 22:52
JensB14-May-03 22:52 
GeneralRe: difficult - CListCtrl::GetItemRect() Pin
Rage14-May-03 22:59
professionalRage14-May-03 22:59 
GeneralRe: difficult - CListCtrl::GetItemRect() Pin
JensB14-May-03 23:05
JensB14-May-03 23:05 
GeneralRe: difficult - CListCtrl::GetItemRect() Pin
Rage14-May-03 23:15
professionalRage14-May-03 23:15 
Generalchange the language in edit box Pin
Didaa14-May-03 21:55
Didaa14-May-03 21:55 
GeneralRe: change the language in edit box Pin
Rage15-May-03 7:58
professionalRage15-May-03 7:58 

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.