// Rx.h: interface for the CRx class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_RX_H__7E0461F9_CE34_4E74_8BF5_FED9286B60E2__INCLUDED_) #define AFX_RX_H__7E0461F9_CE34_4E74_8BF5_FED9286B60E2__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Rx.h : header file // //#include "Medium.h" #include "Bit.h" // to include necessary header files that their objects is used in this class object . #include "Data.h" #include "Code.h" #include "Frame.h" ///////////////////////////////////////////////////////////////////////////// // CRx window class CRx : public CButton // the default constructor of this object to alocate new memory for them and to set some variables to their initial values. { // Construction public: CRx(); // Attributes public: BOOL moved;// 0 = if the button of this object dont move 1= if it move POINT PreviousPoint;// the last position that the button of this object was there on document befor it moves. BOOL created;// 0= if the button of this objecft hadn't been created 1= if it had been created . RECT position;//the axis (x,y) of the top-left and down-right points of the of the button's rectangular of this object . double CurrentSubChip;// current subchip that is recieved by the Rx. BOOL tracked;// 0= this Rx object is not tracked with the recieved signal 1= it is tracked BOOL MatchedFilter;// 0= this Rx object uses simlpe serial search for acqusition 1= it used matched filter for acqusition int BitWeight;// the weight recieved bit = the number of right-positioned chips int BitThreshold;// threshol that if bitweight is greater than it , Rx recieve a 1-bit. int ChipThreshold;// threshol that if current chip is greater than it , Rx recieve a 1-chip. int LimiterType;// specifics the type of limiter that is used by Rx (no,hard or soft limiter) CBit* bit;// a pointer to the CBit object that is used to storing recieved bits. int StartTime;// the start time of listening of this object . BOOL RndProcDelay;// 0= process delay is static and definded by user 1= process delay is random. int ProcDelay;// the static process delay that is definded by user. int PacketByteCounter;// the counter that counts the bytes of the recieved packet . int presync;// this variable is set when Rx recieves the first bit of one(1) and is cleared when Rx ewcieves the first o-bit after 1-bits (pre-acquision) BOOL sync;// this variable is set when Rx recieves the first 1-bit after presync=0 (acquisition) CData* data;// a Cdata object to store recived data.e CMedium* medium;// a pointer to medium of this Rx object . CFrame* frame;//a pointer to the Cframe object to save . int PreviousChip;// previous chip that is received by Rx. int CurrentChip;// the current chip that is received by Rx. int CurrentBit;// the current bit that is received by Rx. BYTE CurrentByte;//the current byte that is received by Rx. int BufferIndex;// the index of current position in buffer that is not occiupied by any data. int ByteCounter;// counter of recieved bytes (mod 00) int BitCounter;// counter of recieved bits (mod 00) int ChipCounter;// counter of recieved chips (OOC length ) int SubChipCounter;// counter of recieved subchips (mod sub chip perchip) BYTE SubChipPerChip;// "subchip prechip" * the minimum time unit (sub chip) = chip CCode* code;// a pointer to the Ccode object that contains the properties of OOC of this object. char* buffer;// an array of characters that shows the received bytes of Rx. int UsedBufferSize;// the size of buffer that is used by received bytes int BufferSize;// the buffer size of this Rx object. int PacketSize;// the packet size of this Rx object. int CRCSize;// the CRC size of this Rx object. int PayloadSize;// the payload size of this Rx object. int HeaderSize;// the headersize size of this Rx object. int WindowSize;// the window size of this Rx object. BOOL OnOff; // 1= the Rx is switched on and ready for reception of data 0= the Rx is switched off BYTE RxID;// the identity of this Rx object. // Operations public: void Clock();// the main function of this Rx object that traces , synchronizes, tracks, and gets the os and 1s sent by Txs. void InitClock();// the initialize function of clock() that set some initial parameters. int GetBitWeight(CBit* b,CCode* c);// get the right positioned chips in "CBit*b" variable by regarding to "Ccode*c" object. void Tracking();// to track the OOC-matched Tx's signal = to become full synchronized with Tx's signal . void Acquisition();// to sychronize with OOC-matched Tx's signal. // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CRx) public: virtual void Serialize(CArchive& ar); //}}AFX_VIRTUAL // Implementation public: virtual ~CRx(); // Generated message map functions protected: //{{AFX_MSG(CRx) afx_msg void OnClicked();// called when user clicks the button of this Rx object. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);// called when user holds left button of mouse on the button of this Rx object. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);// called when user releases left button of mouse on the button of this Rx object. afx_msg void OnMouseMove(UINT nFlags, CPoint point);// called when user moves the mouse on the button of this Rx object. //}}AFX_MSG DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_RX_H__7E0461F9_CE34_4E74_8BF5_FED9286B60E2__INCLUDED_)