Example #1
0
/*******************************************************************************
* Function Name  : Draw_btnTIME_SCALE
* Description    : Draw button TIME_SCALE
* Input          : active
* Return         : None
*******************************************************************************/
void Draw_btnTIME_SCALE(uint8_t active)
{
	float win_widht = (190.0 * (float)gSamplesWin.WindowWidh) / ((float)gOSC_MODE.oscNumPoints * (*SweepScale));
	float win_pos = ((float)gSamplesWin.WindowPosition * win_widht) + 1;
	uint16_t brdColor = (pMNU == TimeScale_Menu)? LightGray4 : LightBlack2;
	uint16_t fillColor = DarkOrange2;
	
	LCD_SetGraphicsColor(btnTIME_SCALE.Color);
	LCD_DrawFillRect(btnTIME_SCALE.Left, btnTIME_SCALE.Lower, btnTIME_SCALE.Left + btnTIME_SCALE.Width,
			btnTIME_SCALE.Lower + btnTIME_SCALE.Height, active, brdColor);

	/* Clip */
	if(win_widht <= 2) win_widht = 2;
	else if(win_widht >= 190) win_widht = 189;

	LCD_SetGraphicsColor(fillColor);
	LCD_DrawFillRect(btnTIME_SCALE.Left + win_pos, btnTIME_SCALE.Lower + 1,
			btnTIME_SCALE.Left + win_pos + win_widht - 2, (btnTIME_SCALE.Lower + btnTIME_SCALE.Height) - 1, 0, 0);

	btnTIME_SCALE_trigX_Update(DRAW);

	if(active == 0)
	{
		LCD_SetGraphicsColor(Active_BackColor);
		LCD_DrawLine(btnTIME_SCALE.Left, btnTIME_SCALE.Lower + btnTIME_SCALE.Height, btnTIME_SCALE.Left + btnTIME_SCALE.Width, btnTIME_SCALE.Lower + btnTIME_SCALE.Height);
		LCD_DrawLine(btnTIME_SCALE.Left + btnTIME_SCALE.Width, btnTIME_SCALE.Lower, btnTIME_SCALE.Left + btnTIME_SCALE.Width, btnTIME_SCALE.Lower + btnTIME_SCALE.Height);
	}
}
Example #2
0
/*!
Вывод диаграммы на экран
\param[in] *chart Указатель на объект диаграммы
*/
void guiChartDraw(GUI_CHART * chart)
{
	uint16_t i;
	//uint16_t  xGridSpace, yGridSpace;

	if (chart->wmObj.Visible)
	{
		// Axes
		LCD_SetTextColor(chart->wmObj.BorderColor);

		LCD_DrawLine(chart->wmObj.xPos, chart->wmObj.yPos, 						chart->wmObj.Height, 	LCD_DIR_VERTICAL);
		LCD_DrawLine(chart->wmObj.xPos, chart->wmObj.yPos + chart->wmObj.Height-1, 	chart->wmObj.Width, 	LCD_DIR_HORIZONTAL);
		LCD_SetTextColor(chart->wmObj.Color);
		LCD_DrawFillRect(chart->wmObj.xPos+1, chart->wmObj.yPos, chart->wmObj.Width - 1, chart->wmObj.Height - 1);

		// Grid Lines

		// Graph
		LCD_SetTextColor(chart->LineColor);
		for (i = 0; i <  chart->wmObj.Width-1; i++)
		{
			if (chart->table[i] > chart->wmObj.Height-1) chart->table[i] = chart->wmObj.Height-11;
			if (chart->Dot_nLine)	// dot graph
				LCD_PutPixel(chart->wmObj.xPos+1+i, chart->wmObj.yPos + chart->wmObj.Height - 1 - chart->table[i]);
			else					// line graph (histogram)
				LCD_DrawLine(chart->wmObj.xPos+1+i,
							chart->wmObj.yPos + chart->wmObj.Height - 1 - chart->table[i],
							chart->table[i],
							LCD_DIR_VERTICAL);
		}
	}
}
Example #3
0
/*******************************************************************************
* Function Name  : IndicateTrigTimeout
* Description    : 
* Input          : None
* Return         : None
*******************************************************************************/
void UI_SamplingSetTimeout(uint16_t TextColor)
{   
    static char txt_OLD = 'T';
    char *txtTimeout = "T";

    TrigTimeoutState = SET;

	LCD_SetBackColor(Active_BackColor);			// set text color to globalBackColor
	LCD_SetFont(&lucidaConsole10ptFontInfo);	// set font

	if(txt_OLD != *txtTimeout) UI_SamplingClearTimeout();
	txt_OLD = *txtTimeout;

	/*  */
	if(gSyncState.Mode == Sync_NONE)
	{
		LCD_SetTextColor(TextColor);
		LCD_SetGraphicsColor(GrayBlue);
		txtTimeout = "S";
	}
	else
	{
		/* установить цвет текста */
		LCD_SetTextColor(TextColor);
		LCD_SetGraphicsColor(Red);
	}

	LCD_DrawFillRect(304, 225, 314, 235, 0, 0);
	LCD_PutStrig(306, 223, 1, txtTimeout);
}
Example #4
0
/*******************************************************************************
* Function Name  : FrequencyMeas_Draw
* Description    :
* Input          :
* Return         : None
*******************************************************************************/
void FrequencyMeas_Draw(Boolean NewState)
{
	uint16_t X0 = rightLimit - 61, Y0 = upperLimit - 33;
	uint16_t X1 = rightLimit - 1, Y1 = upperLimit - 6;

	if(gOSC_MODE.autoMeasurments != OFF) return;

	if((NewState == TRUE) && (ActiveMode != &IntMIN_MAX))
	{
		/* устанавливаем ограничения для отрисовки */
		if(Set_New_ClipObject(X0 - 1, Y0, X1, Y1 + 1, IN_OBJECT, ShowFreq_ClipObj) != ERROR)
		{
			Update_Oscillogram();	// обновлем осциллограммы, для того что бы они "обрезались" по размерам отсечения
			Reset_Calc_Show_Freq();
			LCD_SetGraphicsColor(StillBlue);
			LCD_DrawFillRect(X0, Y0, X1, Y1, 0, 0);
		}
	}
	else
	{
		/* Clear */
		if(Clear_ClipObject(ShowFreq_ClipObj) != ERROR)
		{
			LCD_ClearArea(X0, Y0, X1, Y1, Active_BackColor);
			LCD_DrawGrid(&activeAreaGrid, DRAW);	/* перерисовываем сетку в области осциллограмм */
			Update_Oscillogram();				    /* обновлем осциллограммы */
		}
	}

	gShowFFTFreq = NewState;
}
Example #5
0
/*******************************************************************************
* Function Name  : Clear_COLOR_Mn
* Description    : 
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void Clear_COLOR_Mn(void)
{
	if(ColorMn.State != DRAW) return;
	
	ColorMn.State = CLEAR;
	Clear_ClipObject(ColorMN_ClipObj);				/* убираем ограничения для отрисовки */
	LCD_SetGraphicsColor(Active_BackColor);
	LCD_DrawFillRect(ColorMn.X - 1, ColorMn.Y - 1, ColorMn.X + ColorMn.Leight, ColorMn.Y + ColorMn.Height, 0, 0);

	LCD_DrawGrid(&activeAreaGrid, DRAW);	// перерисовываем сетку в области осциллограмм					
	Update_Oscillogram();					/* обновлем осциллограммы */
}
Example #6
0
/*******************************************************************************
* Function Name  : Draw_Interface
* Description    : Draw All interface
* Input          : None
* Return         : None
*******************************************************************************/
void Draw_Interface(void)
{
	/* Draw Logo screen */
	Draw_Logo();

	/* Prepare clear all */
	LCD_FillScreen(globalBackColor);

	/* Oscillogram graphics window */
	LCD_SetGraphicsColor(Active_BackColor);
	LCD_DrawFillRect(leftLimit, lowerLimit+5, rightLimit, upperLimit - 5, DRAW, Active_BorderColor);
	LCD_DrawGrid(&activeAreaGrid, DRAW); // перерисовываем сетку в области осциллограмм

	/* Set active and draw main menu */
	SetActiveMenu(&gInterfaceMenu);
	Draw_Menu(&gInterfaceMenu);

	LCD_SetFont(&lucidaConsole10ptFontInfo);
	
	if(gOSC_MODE.autoMeasurments == ON) Draw_Menu(&MeasMenu);

	if(gShowFFTFreq == TRUE)
	{
		FrequencyMeas_SaveRestore_State(1, &gShowFFTFreq);
		FrequencyMeas_Draw(TRUE);
	}

	Draw_btnTIME_SCALE(0);
	Draw_Cursor_Trig(DRAW, LightGray4, Red);
	DrawTrig_PosX(DRAW, &trigPosX_cursor);
	Draw_Trigg_Info(TriggShowInfo.Status);
	UI_Update_CH_Cursors();
	Draw_Batt(100, 0);

	LCD_PutColorStrig(320, 224, 1, "FPS:", LightGray);	// print FPS label
}
Example #7
0
void EditBoxDraw(GUI_EDIT_BOX * pEditBox)
{
	int i;
	if (pEditBox->wmObj.Visible)
	{
		// Borders
		LCD_SetTextColor(pEditBox->wmObj.BorderColor);
		if (pEditBox->wmObj.BorderWidth)
		{
			if (pEditBox->wmObj.Visual3D == 1)
			{
				for (i = 0; i < pEditBox->wmObj.BorderWidth; i++)
				{
					LCD_SetTextColor(LCD_COLOR_GREYD);
					// Top Border
					LCD_DrawLine(pEditBox->wmObj.xPos, pEditBox->wmObj.yPos, pEditBox->wmObj.Width-i-1, LCD_DIR_HORIZONTAL);
					// Left Border
					LCD_DrawLine(pEditBox->wmObj.xPos, pEditBox->wmObj.yPos, pEditBox->wmObj.Height-i, LCD_DIR_VERTICAL);

					if (i == pEditBox->wmObj.BorderWidth-1 && pEditBox->wmObj.Color == LCD_COLOR_WHITE)
						LCD_SetTextColor(LCD_COLOR_GREYL);
					else
						LCD_SetTextColor(LCD_COLOR_WHITE);
					// Bottom Border
					LCD_DrawLine(pEditBox->wmObj.xPos+1+i, pEditBox->wmObj.yPos+pEditBox->wmObj.Height-i-1, pEditBox->wmObj.Width-i-2, LCD_DIR_HORIZONTAL);
					// Right Border
					LCD_DrawLine(pEditBox->wmObj.xPos+pEditBox->wmObj.Width-i-1, pEditBox->wmObj.yPos+i+1, pEditBox->wmObj.Height-i-2, LCD_DIR_VERTICAL);
				}
			}
			else
			{
				// Top Border
				LCD_DrawFillRect(pEditBox->wmObj.xPos, pEditBox->wmObj.yPos, pEditBox->wmObj.Width, pEditBox->wmObj.BorderWidth);
				// Left Border
				LCD_DrawFillRect(pEditBox->wmObj.xPos, pEditBox->wmObj.yPos, pEditBox->wmObj.BorderWidth, pEditBox->wmObj.Height);
				// Bottom Border
				LCD_DrawFillRect(pEditBox->wmObj.xPos, pEditBox->wmObj.yPos+pEditBox->wmObj.Height-pEditBox->wmObj.BorderWidth, pEditBox->wmObj.Width, pEditBox->wmObj.BorderWidth);
				// Right Border
				LCD_DrawFillRect(pEditBox->wmObj.xPos+pEditBox->wmObj.Width-pEditBox->wmObj.BorderWidth, pEditBox->wmObj.yPos, pEditBox->wmObj.BorderWidth, pEditBox->wmObj.Height);
			}
		}
		// Back
		if (pEditBox->wmObj.Transparent == 0)
		{
			LCD_SetTextColor(pEditBox->wmObj.Color);
			LCD_DrawFillRect(pEditBox->wmObj.xPos + pEditBox->wmObj.BorderWidth,
							pEditBox->wmObj.yPos + pEditBox->wmObj.BorderWidth,
							pEditBox->wmObj.Width - 2*pEditBox->wmObj.BorderWidth,
							pEditBox->wmObj.Height - 2*pEditBox->wmObj.BorderWidth
							);
		}
		// Text
		LCD_SetFont(pEditBox->wmTxt.vFont);
		if (pEditBox->wmObj.Enable)
			LCD_SetColors(pEditBox->wmTxt.TextColor, pEditBox->wmObj.Color);
		else
			LCD_SetColors(guiChangeColorLight(pEditBox->wmObj.Color, 120), pEditBox->wmObj.Color);

		LCD_DrawString(pEditBox->wmTxt.Text, pEditBox->wmTxt.TextLen, pEditBox->wmTxt.TextPosX, pEditBox->wmTxt.TextPosY);
	}
}
Example #8
0
/*******************************************************************************
* Function Name  : IndicateTrigTimeout
* Description    :
* Input          : None
* Return         : None
*******************************************************************************/
void UI_SamplingClearTimeout(void)
{
	TrigTimeoutState = RESET;
	LCD_SetGraphicsColor(globalBackColor);		 // set clear color to globalBackColor
	LCD_DrawFillRect(304, 225, 314, 235, 0, 0);	 // clear
}