


class Display
{
public:	
	static void Init(void);
    	static void DRAW_SPLASH(unsigned char remove);							// Draws the splash screen 
    	static void REMOVE_SPLASH(void);								// remove the splash screen
	static void DrawInitialScreen(void);								// Draws initial screen
	static void RefreshScreen(void);
	static void DRAWP(int x, int y, int dx, int dy, char set, unsigned long *planeaddress);
	static void PIXELP(int x, int y, char set, unsigned long *planeaddress);
	static void DRAWLINEP(int x1, int y1, int x2, int y2, char set, unsigned long *plane);
	static void DRAWZEROLINE(int y, char set, unsigned long *plane);	
	static void TEXTOUTvbig(char *String, int x, int y, char set, unsigned long *layer);		// Draw Text at Pos X / Y with Color and BackColor
													// (FF = Transparent)
	static void TEXTOUTxvbig(char *String, int x, int y, char set, unsigned long *layer);		// Draw Text at Pos X / Y with Color and BackColor
													// (FF = Transparent)
	static void BITBITMAP(unsigned char *pointer, int x, int y, unsigned char set, unsigned long *layer);	// Draw two color bitmap

	static void GRID(unsigned long x, unsigned long y, unsigned long *layer); 			// Draw Grid subroutine
	static void GRIDDELAYED(unsigned long x, unsigned long y, unsigned long *layer); 		// Draw Grid subroutine
	static void GRIDXY(unsigned long x, unsigned long y, unsigned long *layer); 			// Draw Grid subroutine
	static void GRIDFFT(unsigned long x, unsigned long y, unsigned long *layer);			// Draw Grid subroutine

	static void StatusUpdate(void);									// Updates the Status and the Popups
	static void DRAWSTATUS(int Which, int isChanging);						// Draw Status of Channels & Timebase 0 = TB ,
													// 1 - 4 = Channels , 5 = Clock
	static void RemoveStatusBtn(void);								// Remove Status Button
	
	static void UpdateMenu(void);
	static void ClearMenuAsm(long start, long count);						// Clear Menu Area
	static void ClearMenuItemAsm(long which, long start, long count);                          	// Clear Menu Area	
	static void ClearMenuItemTextAsm(long which, long start, long count);                      	// Clear Menu Area		
	static void DrawMenuItemButton(int ItemNr, unsigned char active, unsigned char pushed);
    	static void DrawMenuItem(int MenuNr,int ItemNr, unsigned char active, unsigned char pushed);	// Draw Menu Items
	static void ClearMenuItem(int ItemNr);								// Clear a Menuitem
	static void DRAWMENUPOPUP(int PopupNr);								// Popup the Menu Popup
	static void DRAWMENUPOPDOWN(void);								// Popdown the Menu Popup
	static void DRAWMENUBUTTONSELECT(int buttonnr);							// Draws Button Selector over menu	
	
	static void DRAWROUNDBUTTON(int posx, int posy, int sizex, int sizey, unsigned char pushed, unsigned char remove);	// Draw a Round Button	
	static void DRAWSQUAREBUTTON(int posx, int posy, int sizex, int sizey, unsigned char pushed, unsigned char remove);	// Draw a Square Button
		
	static void DrawMenuCheckBox(int posx, int posy, char checked, char active);			// Draw Checkbox in Menu
	static void DrawMenuArrow(int posx, int updn, int active);					// Draw Big Arrow
	static void DrawMenuArrowCycle(int posx, int active);						// Draw Arrow Cycle
	static void DrawMenuArrowCycle2(int posx, int active);						// Draw Arrow Cycle
	static void DrawMenuBiggerArrowCycle(int posx, int active);					// Draw the knob turn cycle
	static void DrawSubMenuArrow(int posx, int active);						// Draw the sub menu arrow

    	static void DRAW_ALL_CURSOR(void);								// Draw the all Cursos at once
    	static void DRAWMEMORY(char remove, char firstdraw, char redraw);
	static void DRAWCURSORDATA(char dir);								// Draw Cursor Data
	static void DRAWQMDATA(char dir);								// Draw Quick Measurment Data

	static void CALCCURSORDATA(void);								// Calculate Cursor Data
	static void CALCQMDATA(void);									// Calculate Quick Measurment Data	
	static float Measure(char nr, char channel, char type, char *pretext, char *unittext, char *returntext, char *qm_vertical_active, char *qm_horizontal_active);// make a measurement
    	static float MEASUREVOLTAGE(char channel, int points);						// Calculate the Voltage String
    	static float MEASURETIME(char sec_hz, int points);	    					// Calculate the Time String sec_hz 1 = seconds,
													// sec_hz = 2 = Hz
    //static float MEASUREVOLTAGE(char channel, int points, char *UnitString);	// Calculate the Voltage String
    //static float MEASURETIME(char sec_hz, int points, char *UnitString);	    // Calculate the Time String sec_hz 1 = seconds, sec_hz = 2 = Hz

	static void CALCTRIGGER(void);									// Calculate Trigger Data
	static void CALCPRETRIGGER(void);								// Calclulate Timebase Data
	//static void CALCTIMEBASE(void);									// Calclulate Timebase Data
	static void CALCVOLTAGE(char channel, char *String);						// Calculate the Voltage String
	
//BF del	static void DRAWZERO(int inr, char changed);							// Draw one ZeroLine , would be removed if chaSnged
	static void DRAWSIGNS(void);
    	
	static void RemoveZeroSign(long addressold);
	static void DrawZeroSign(unsigned char *sign, long addressnew);
	static void DrawZeroSignXY(int position, char set);
	static void OverDrawZeroSign(unsigned char *sign, long addressnew);
	static void RemoveZeroSignBack(long addressold);
	static void DrawZeroSignBack(unsigned char *sign, long addressnew);

	static void CLEAR2BYTE(long addressold);            	
	static void WRITE2BYTE(unsigned char byte1, unsigned char byte2, long addressnew);
	static void OVERWRITE2BYTE(unsigned char byte1, unsigned char byte2, long addressnew);
	
	static void WRITE2BYTEBACK(unsigned char byte1, unsigned char byte2, long addressnew);
	static void CLEAR2BYTEBACK(long addressold);
      	
	static void DRAWZEROPOPUP(int channel);								// Draws a popup with the Zerolevel
	static void DRAWZEROPOPDOWN(void);								// Popdown the Zerolevel Popup
	
	//---------------------------------------------------------------------------------------------------------------------------------------------------------
	
	static void ProcessSignalData(void); 								// BF new level 1 routine for signal processing
													// and math functions
    	static void Interpolate(int timebase, int start, unsigned char *SignalData, unsigned char *InterpolateResult);	//BF new interpolation routine
	static void LinearInterpolation(int x1, int y1, int x2, int y2, unsigned char *interpolation);	

	// Math calculation
	static void CalcMathMul(int start, int stop, int stepwidth ,unsigned char *SignalData1, unsigned char *SignalData2, unsigned char *MathData);
	static void CalcMathSub(int start, int stop, int stepwidth ,unsigned char *SignalData1, unsigned char *SignalData2, unsigned char *MathData);
	static void CalcMathAdd(int start, int stop, int stepwidth ,unsigned char *SignalData1, unsigned char *SignalData2, unsigned char *MathData);

	//---------------------------------------------------------------------------------------------------------------------------------------------------------
	static void DrawSignals(unsigned char on);
	//static void Clear_Flips(void);	// BF not used

	//BF del not used static void CopySignal(unsigned long Buffer_Adr1, unsigned long Plane_Adr1, unsigned long Buffer_Adr2, unsigned long Plane_Adr2, unsigned long Buffer_Adr3, unsigned long Plane_Adr3, unsigned char count);

	static void DRAWSIGNAL_TY(unsigned int channel, unsigned char windows, unsigned int timefactor, unsigned int ixstart, unsigned char *DisplayData, unsigned char on, unsigned char vector);	//BF Draw T-Y time signal

	static void DRAWSIGNAL_XY(int channel_x, int channel_y, unsigned int start, unsigned char *signal_x, unsigned char *signal_y, unsigned char on, unsigned char vector);	//BF Draw X-Y signal

	static void DRAWSPECTRUM_FY(unsigned char on);	//BF Draw sprectrum
    	
	static void Connect_Pixels(int x, short y, short y2, int dir, unsigned long *planeaddress, unsigned char on);
    	static void Test_Pixels(int x, int y, int y2, int dir, unsigned long *planeaddress);
	//----------------------------------------------------------------------------------------------------------------------------------------------------------

	static void TestSignalGenerate(void);
	
	static void DrawColorDemoBox(int posx, int posy, int sizex, int sizey, unsigned long *planeaddress);
	static void	ColorDemo(void);
	static void	ColorDemo2(void);
	static void	ColorDemo3(void);
	static void	ColorDemo5(void);
	static void	ColorDemo6(void);
	static void floatprintf(float fvalue);

	//----------------------------------------------------------------------------------------------------------------------------------------------------------
	static void USTB_Clear_Buffer(void);
	static void USTB_roll_signal(int Time_idx, unsigned char *DataArray_in, unsigned char *Signal);
	static void USTB_shift_signal(unsigned char *DataArray_in, unsigned char *Signal);
	//----------------------------------------------------------------------------------------------------------------------------------------------------------
	static void FFT_BuildTrigoTables(void);
	static void FFT_CalcSpectrum(unsigned char *Signal, int *Spectrum);
	static void FFT_DrawStatus(void);
	static void FFT_CalcCursorData(void);
	//----------------------------------------------------------------------------------------------------------------------------------------------------------
	static void LowPassFilter(unsigned char *RawData, int start, int stop, unsigned char *DisplayData);

	//----------------------------------------------------------------------------------------------------------------------------------------------------------

	static void SCREENSHOT_BW(void); 	// nevm
	static void SCREENSHOT(void); 		// nevm
	static void DUMPCSV(void); 		// dl3daz


};

