void ECCalibrateScreen::endCalibration()
{
	myUTFT.fillScr(VGA_BLUE);
	myUTFT.setColor(VGA_RED);
	myUTFT.fillRoundRect(80, 70, 239, 169);

	myUTFT.setColor(VGA_WHITE);
	myUTFT.setBackColor(VGA_RED);
	myUTFT.print("! All Done !", CENTER, 93);
	myUTFT.print("Touch Screen", CENTER, 119);
	myUTFT.print("To Exit", CENTER, 132);

	SwaitForTouch();
	myUTFT.clrScr();

	myUTFT.setFont(BigFont);

	myButtons.enableButton( /*resetButton*/ 0);
	myButtons.enableButton( /*infoButton*/ 1);
	myButtons.enableButton( /*readButton*/ 2);
	myButtons.enableButton( /*tempReadButton*/ 3);
	myButtons.enableButton( /*stopButton*/ 4);
	myButtons.enableButton( /*startButton*/ 5);
	myButtons.enableButton( /*backButton*/6);
	myButtons.enableButton( /*calibrateButton*/7);

	SdrawScreen();

}
void ECCalibrateScreen::dryCalibration()
{

	myUTFT.clrScr();
	myUTFT.setColor(255, 0, 0);
	myUTFT.fillRect(0, 0, 220, 13);
	myUTFT.setColor(255, 255, 255);
	myUTFT.setBackColor(255, 0, 0);
	myUTFT.drawLine(0, 14, 320, 14);
	myUTFT.print("EC Calibration", CENTER, 1);
	myUTFT.setBackColor(0, 0, 0);

	myUTFT.print("Do NOT put sensor in any Liquid you are", LEFT, 30);
	myUTFT.print("going to calibrate for a dry condition", LEFT, 42);
	myUTFT.print("This is much like setting a TARE on a", LEFT, 54);
	myUTFT.print("scale", LEFT, 66);
	myUTFT.print("", LEFT, 78);
	myUTFT.print("Please make sure that the EC sensor is", LEFT, 90);
	myUTFT.print("connected to the BNC connector before", LEFT, 102);
	myUTFT.print("you continue", LEFT, 114);
	//myUTFT.print("crosshairs in sequence.", LEFT, 126);
	myUTFT.print("Touch screen to continue", CENTER, 162);

	waitForTouch();
	myUTFT.clrScr();

	inputstring = "Z0\r";  //Command to get info
	Serial3.print(inputstring); //send command to sensor.

}
void ECCalibrateScreen::highCalibration()
{
	myUTFT.clrScr();
	myUTFT.setColor(255, 0, 0);
	myUTFT.fillRect(0, 0, 220, 13);
	myUTFT.setColor(255, 255, 255);
	myUTFT.setBackColor(255, 0, 0);
	myUTFT.drawLine(0, 14, 320, 14);
	myUTFT.print("EC Calibration", CENTER, 1);
	myUTFT.setBackColor(0, 0, 0);

	myUTFT.print("Calibrate now with the high side liquid", LEFT, 30);
	myUTFT.print("Place the sensor in the 3,000Us ", LEFT, 42);
	myUTFT.print("calibration liquid. This process", LEFT, 54);
	myUTFT.print("will take 5 minutes to complete", LEFT, 66);
	myUTFT.print("Wait for process to finish before ", LEFT, 78);
	myUTFT.print("removing the sensor from the liquid", LEFT, 90);
	myUTFT.print("", LEFT, 102);
	myUTFT.print("************************************", LEFT, 114);
	myUTFT.print("Touch screen to continue", CENTER, 162);

	waitForTouch();
	myUTFT.clrScr();

	inputstring = "C\r";  //set in continious mode

	myUTFT.clrScr();
	String thisSt = String(iSeconds);
	myUTFT.print("Calibration in Progress", CENTER, 30);
	myUTFT.print("Seconds left until ready " + thisSt, CENTER, 42);
	simpleTimer.setTimer(3000, updateWaitScreen, /*100*/ 4); //Update screen every 3 seconds for 5 minues.

}
void  PlugScreen::drawPrepareScreen()
{
	Serial.println("PlugScreen::handlePlugScreen SET LIGHTS ID  \n");
	myUTFT.setFont(SmallFont);
	myUTFT.clrScr();
	myUTFT.setColor(255, 0, 0);
	myUTFT.fillRect(0, 0, 220, 13);
	myUTFT.setColor(255, 255, 255);
	myUTFT.setBackColor(255, 0, 0);
	myUTFT.drawLine(0, 14, 320, 14);
	myUTFT.print("Plug Setting", CENTER, 1);
	myUTFT.setBackColor(0, 0, 0);

	myUTFT.print("Use the remote that came with your", LEFT, 30);
	myUTFT.print("plugs to set which unit and address it", LEFT, 42);
	myUTFT.print("uses.Just point the remote at the screen", LEFT, 54);
	myUTFT.print("and press a button for the unit you want", LEFT, 66);
	myUTFT.print("to use for the lights", LEFT, 78);
	myUTFT.print("", LEFT, 90);
	myUTFT.print("Please press a unit for the lights", LEFT, 102);
	myUTFT.print("", LEFT, 114);

	exitButton = myButtons.addButton( 10, 170, 145, 53, mainButton);
	myButtons.drawButton(exitButton);
	myUTFT.setBackColor (161,190,237);
	myUTFT.print("Cancel", 55, 195);
	myUTFT.setFont(BigFont);
}
Beispiel #5
0
// Draw a spot and wait until the user touches it, returning the touch coordinates in tx and ty.
// The alternative X and Y locations are so that the caller can allow for the touch panel being possibly inverted.
void DoTouchCalib(PixelNumber x, PixelNumber y, PixelNumber altX, PixelNumber altY, bool wantY, uint16_t& rawRslt)
{
	const PixelNumber touchCircleRadius = 8;
	const PixelNumber touchCalibMaxError = 40;
	
	lcd.setColor(touchSpotColour);
	lcd.fillCircle(x, y, touchCircleRadius);
	
	for (;;)
	{
		uint16_t tx, ty, rawX, rawY;
		if (touch.read(tx, ty, &rawX, &rawY))
		{
			if (   (abs((int)tx - (int)x) <= touchCalibMaxError || abs((int)tx - (int)altX) <= touchCalibMaxError)
				&& (abs((int)ty - (int)y) <= touchCalibMaxError || abs((int)ty - (int)altY) <= touchCalibMaxError)
			   ) 
			{
				TouchBeep();
				rawRslt = (wantY) ? rawY : rawX;
				break;
			}
		}
	}
	
	lcd.setColor(defaultBackColour);
	lcd.fillCircle(x, y, touchCircleRadius);
}
void PlugScreen::waitForReceiver(NewRemoteCode receivedCode)
{
	//Clear What was there.
	myUTFT.setFont(SmallFont);
	myUTFT.clrScr();
	myUTFT.setColor(255, 0, 0);
	myUTFT.fillRect(0, 0, 220, 13);
	myUTFT.setColor(255, 255, 255);
	myUTFT.setBackColor(255, 0, 0);
	myUTFT.drawLine(0, 14, 320, 14);
	myUTFT.print("ID Set", CENTER, 1);
	myUTFT.setBackColor(0, 0, 0);

	setAddresstoEEPROM(receivedCode.address);
	if(plugDevice.lights)
	{
		EEPROM.write(EEPROM_LEARNED_LIGHTS_UNIT,receivedCode.unit);
		plugDevice.lights = false;
	}
	if(plugDevice.pump)
	{
		EEPROM.write(EEPROM_LEARNED_PUMP_UNIT,receivedCode.unit);
		plugDevice.pump = false;
	}
	if(plugDevice.heater)
	{
		EEPROM.write(EEPROM_LEARNED_HEATER_UNIT,receivedCode.unit);
		plugDevice.heater = false;
	}

	//unsigned long add = getAddress();
	String sAddress(receivedCode.address);
	String slightID(receivedCode.unit);

	myUTFT.print("The unit has been set to unit ", LEFT, 30);
	myUTFT.print(slightID, LEFT, 42);
	myUTFT.print("The Transmitting Address is", LEFT, 54);
	myUTFT.print(sAddress, LEFT, 66);
	myUTFT.print("You can now use the plug", LEFT, 78);
	myUTFT.print("**********************************", LEFT, 90);

	myButtons.deleteAllButtons();
	exitButton = -1;

	exitButton = myButtons.addButton( 10, 170, 145, 53, mainButton);
	myButtons.drawButton(exitButton);
	myUTFT.setBackColor (161,190,237);
	myUTFT.print("Back", 55, 195);
	myUTFT.setFont(BigFont);

}
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void PulsesCountScreen::doDraw(TFTMenu* menu)
{
  UTFT* dc = menu->getDC();
  uint8_t* oldFont = dc->getFont();

  dc->setFont(BigRusFont);
  dc->setColor(VGA_WHITE);

  menu->print("ПАРАМЕТРЫ",130,2);
  menu->print("СИСТОЛИЧЕСКОЕ  ", 1, 37);
  menu->print("ДИАСТОЛИЧЕСКОЕ ", 1, 72);
  menu->print("ЧАСТОТА ПУЛЬСА", 1, 107);
  menu->print("ПАЛЬПАЦИЯ", 1, 142);


  if (channel4PulsesVal.toInt() == 0)
  {
	  screenButtons->relabelButton(channel4Button, "ОТКЛ");
  }
  else
  {
	  screenButtons->relabelButton(channel4Button, "ВКЛ");
  }
  screenButtons->drawButton(channel4Button);
  
  dc->setFont(oldFont);
}
Beispiel #8
0
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void Screen1::doUpdate(TFTMenu* menu)
{
    // тут обновляем внутреннее состояние
	if (isActive())
	{
		DS3231Time tm = RealtimeClock.getTime();
		if (oldsecond != tm.second)
		{
			oldsecond = tm.second;
			UTFT* dc = menu->getDC();
			dc->setColor(VGA_WHITE);
			dc->setBackColor(VGA_BLACK);
			// получаем компоненты даты в виде строк
			String strDate = RealtimeClock.getDateStr(tm);
			String strTime = RealtimeClock.getTimeStr(tm);
			dc->setFont(SmallRusFont);
			// печатаем их
			dc->print(strDate, 5, 305);
			dc->print(strTime, 160, 305);
															//dc->printNumF(setupPin.power3V3, 1, 195, 1);    //
															//dc->printNumF(setupPin.power5V0, 1, 195, 15);   //
															//dc->printNumI(setupPin.power200, 195, 30);      //
		}
	}
}
Beispiel #9
0
void Mixer::render(UTFT tft) {
	tft.clrScr();

	tft.setColor(255, 255, 255);
	tft.fillRect(0, 0, tft.getDisplayXSize() - 1, 12);
	tft.setBackColor(255, 255, 255);
	tft.setColor(0, 0, 0);
	tft.setFont(SmallFont);
	tft.print("Mixer", 10, 0);

	_tft = tft;
	for(byte x=0;x<3; x++) {
		renderedGains[x] = 0;
		renderMute(x);
	}
	update();
}
Beispiel #10
0
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void Screen1_0::doDraw(TFTMenu* menu)
{
  UTFT* dc = menu->getDC();
  dc->setColor(VGA_WHITE);
  dc->setBackColor(VGA_BLACK);
  dc->setFont(TFT_FONT);
  
  // тут рисуем, что надо именно нам, кнопки прорисуются сами после того, как мы тут всё отрисуем
  menu->print("Настройки", 50, 0);
}
Beispiel #11
0
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void SoundLevelScreen::doDraw(TFTMenu* menu)
{
	UTFT* dc = menu->getDC();
	dc->setColor(VGA_WHITE);
	uint8_t* oldFont = dc->getFont();

	dc->setFont(BigRusFont);
	dc->setBackColor(VGA_BLACK);

	// тут рисуем, что надо именно нам, кнопки прорисуются сами после того, как мы тут всё отрисуем
	menu->print("УРОВЕНЬ ЗВУКА", 105, 10);
	dc->setFont(oldFont);
}
void ECCalibrateScreen::lowCalibration()
{
	myUTFT.clrScr();
	myUTFT.setColor(255, 0, 0);
	myUTFT.fillRect(0, 0, 220, 13);
	myUTFT.setColor(255, 255, 255);
	myUTFT.setBackColor(255, 0, 0);
	myUTFT.drawLine(0, 14, 320, 14);
	myUTFT.print("EC Calibration", CENTER, 1);
	myUTFT.setBackColor(0, 0, 0);

	myUTFT.print("Calibrate now with the low side liquid", LEFT, 30);
	myUTFT.print("Place the sensor in the 220Us", LEFT, 42);
	myUTFT.print("calibration liquid.  This process", LEFT, 54);
	myUTFT.print("will take 5 mins to complete", LEFT, 66);
	myUTFT.print("Wait for process to finish before ", LEFT, 78);
	myUTFT.print("removing the sensor from the liquid", LEFT, 90);
	myUTFT.print("", LEFT, 102);
	myUTFT.print("************************************", LEFT, 114);
	myUTFT.print("Touch screen to continue", CENTER, 162);

	SwaitForTouch();
	myUTFT.clrScr();

	inputstring = "C\r";  //set in continious mode

	String thisSt = String(12);
	myUTFT.print("Calibration in Progress", CENTER, 30);
	myUTFT.print("Seconds left until ready " + thisSt, CENTER, 42);
	simpleTimer.setTimer(3000, updateLowWaitScreen, /*100*/ 4); //Update screen every 3 seconds for 5 minues.


	//delay(2000);  //Wait 2 seconds -- make 5mins
	//Serial3.print(inputstring); //send command to sensor.
	//inputstring = "Z2\r";  //set the sensor at this value.
	//Serial3.print(inputstring); //need to send twice??


}
Beispiel #13
0
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void Screen1::doDraw(TFTMenu* menu)
{
  UTFT* dc = menu->getDC();
  dc->setColor(VGA_WHITE);
  dc->setBackColor(VGA_BLACK);
  dc->setFont(TFT_FONT);
  // тут рисуем, что надо именно нам, кнопки прорисуются сами после того, как мы тут всё отрисуем
  menu->print("Главный экран", 15, 0);
  
  //// выводим число
  //dc->setColor(VGA_BLUE);
  //int number = 12345;
  //dc->printNumI(number, 20,200);

  //dc->setFont(SmallSymbolFont);
  //// выводим спецсимвол
  //dc->printChar(47,20,250);

  // возвращает шрифт по умолчанию
  dc->setFont(TFT_FONT); 
  /*RealXBeeMenu.XBee_status();
  delay(300);*/
  }
Beispiel #14
0
void Draw::drawAPicture(pos x, pos y, short int width, short int height,
	char tp[], short int color)
{
	char temp;
	int x0 = x;
	myGLCD.setColor(color);
	int wid = width / 8;
	//将二进制中为一的表示为该点位亮。
	//将tp[]中的数据依次点亮屏幕。
	for (int i = 0; i < height; i++){

		for (int j = 0; j < width; j++){

			if (j % 8 == 0)temp = tp[i*wid + j / 8];
			if (temp & 0x80){
				myGLCD.drawPixel(x0, y);
			}
			temp <<= 1;
			x0++;
		}
		x0 = x;
		y++;
	}
}
Beispiel #15
0
void Keyboard::render(UTFT tft) {
    tft.clrScr();
    tft.setFont(BigFont);

    tft.setBackColor(255, 255, 255);
    tft.setColor(255, 255, 255);
    tft.drawRoundRect(30, 30, tft.getDisplayXSize() - 111, 70);
    tft.fillRect(tft.getDisplayXSize() - 106, 30, tft.getDisplayXSize() - 66, 70);
    tft.setColor(0, 0, 0);
    tft.print("<-", tft.getDisplayXSize() - 102, 43);
    tft.setColor(255, 255, 255);
    tft.fillRect(tft.getDisplayXSize() - 61, 30, tft.getDisplayXSize() - 21, 70);
    tft.setColor(0, 0, 0);
    tft.print("OK", tft.getDisplayXSize() - 57, 43);

    byte br = 9,
         nl = 0,
         offset = 1;

    int x = offset,
        y = 120;

    for(byte j=0; j<numKeys; j++) {
        tft.setColor(255, 255, 255);
        tft.fillRect(x, y, x + 30, y + 30);
        tft.setColor(0, 0, 0);
        String str = "";
        str += keys[j]; //lame!
        tft.print(str, x + 7, y + 8);
        x += 32;
        nl++;
        if(nl > br) {
            offset += 15;
            x = offset;
            nl = 0;
            y += 32;
            br -= 1;
        }
    }

    _tft = tft;
}
Beispiel #16
0
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void SoundLevelScreen::onButtonPressed(TFTMenu* menu, int pressedButton)
{
	UTFT* dc = menu->getDC();
	dc->setColor(VGA_WHITE);
	dc->setBackColor(VGA_BLUE);
	int x_sound = 189;
	int y_sound = 102;

	if (pressedButton == backButton)
		menu->switchToScreen("Settings");

	else if (pressedButton == volumeLeftButton)
	{
		if (volumeSoundOff)
		{
			volumeSound -= 1;
			if (volumeSound < 0)
			{
				volumeSound = 0;
			}
			Settings.setVolumeSound(volumeSound);
			if (volumeSound < 10)
			{
				dc->printNumI(0, x_sound, y_sound);
				dc->printNumI(volumeSound, x_sound + 16, y_sound);
			}
			else
			{
				dc->printNumI(volumeSound, x_sound, y_sound);
			}
		}
	}
	else if (pressedButton == volumeInfoButton)
	{
		volumeSoundStr = Settings.getVolumeSound();
		volumeSoundOff = !volumeSoundOff;
		if (!volumeSoundOff)
		{
			screenButtons->deleteButton(volumeInfoButton);
			volumeInfoButton = screenButtons->addButton(165, 80, 80, 60, "m", BUTTON_SYMBOL); // кнопка  
			screenButtons->drawButton(volumeInfoButton);
		}
		else
		{
			screenButtons->deleteButton(volumeInfoButton);
			volumeInfoButton = screenButtons->addButton(165, 80, 80, 60, volumeSoundStr.c_str()); // кнопка  
			screenButtons->drawButton(volumeInfoButton);
		}
	}
	else if (pressedButton == volumeRightButton)
	{
		if (volumeSoundOff)
		{
			volumeSound += 1;
			if (volumeSound > 30)
			{
				volumeSound = 30;
			}
			Settings.setVolumeSound(volumeSound);
			if (volumeSound < 10)
			{
				dc->printNumI(0, x_sound, y_sound);
				dc->printNumI(volumeSound, x_sound + 16, y_sound);
			}
			else
			{
				dc->printNumI(volumeSound, x_sound, y_sound);
			}
		}
	}

}
Beispiel #17
0
void Draw::drawARect(pos x0, pos y0, pos x1, pos y1, short int color)
{
	myGLCD.setColor(color);
	myGLCD.drawRect(x0, y0, x1, y1);
}
Beispiel #18
0
void Draw::fillARect(pos x0, pos y0, pos x1, pos y1, short int color)
{
	myGLCD.setColor(color);
	myGLCD.fillRect(x0, y0, x1, y1);
}