Esempio n. 1
0
        private void DrawHeartRateAnimation(IDynamicDisplay dynamicDisplay, IPoint bikePoint)
        {
            m_dynamicSymbolProperties.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolMarker, m_heartRateGlyph[m_heartRateCounter]);
            m_dynamicSymbolProperties.SetColor(esriDynamicSymbolType.esriDSymbolMarker, 1.0f, 1.0f, 1.0f, 1.0f);
            m_dynamicSymbolProperties.SetScale(esriDynamicSymbolType.esriDSymbolMarker, 1.0f, 1.0f);
            m_dynamicSymbolProperties.set_RotationAlignment(esriDynamicSymbolType.esriDSymbolMarker, esriDynamicSymbolRotationAlignment.esriDSRAScreen);
            m_dynamicSymbolProperties.set_Heading(esriDynamicSymbolType.esriDSymbolMarker, 0.0f);
            dynamicDisplay.DrawMarker(bikePoint);

            m_textGlyph.SetAnchor(-35.0f, -50.0f);
            m_dynamicSymbolProperties.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolText, m_textGlyph);
            m_dynamicSymbolProperties.TextBoxUseDynamicFillSymbol = true;
            m_dynamicSymbolProperties.SetColor(esriDynamicSymbolType.esriDSymbolText, 0.0f, 0.8f, 0.0f, 1.0f);
            m_dynamicSymbolProperties.SetColor(esriDynamicSymbolType.esriDSymbolFill, 0.0f, 0.0f, 0.0f, 1.0f);
            m_dynamicSymbolProperties.TextBoxHorizontalAlignment = esriTextHorizontalAlignment.esriTHALeft;
            dynamicDisplay.DrawText(bikePoint, m_heartRateString);

            m_textGlyph.SetAnchor(-20.0f, -30.0f);
            m_dynamicSymbolProperties.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolText, m_textGlyph);
            dynamicDisplay.DrawText(bikePoint, m_altitudeString);

            if (m_drawCycles % 5 == 0)
            {
                m_heartRateCounter++;

                if (m_heartRateCounter > 4)
                {
                    m_heartRateCounter = 0;
                }
            }

            m_drawCycles++;
            if (m_drawCycles == 5)
            {
                m_drawCycles = 0;
            }
        }
Esempio n. 2
0
        private void DrawGPSInfo(IDynamicDisplay dynamicDisplay, IPoint gpsPosition)
        {
            // altitude is already available
            string course;
            string speed;

            lock (m_bikePositionInfo)
            {
                course = string.Format("Course {0} DEG", m_bikePositionInfo.course.ToString("###.##"));
                speed  = string.Format("Speed {0} MPH", m_bikePositionInfo.speed.ToString("###.##"));
            }

            string gpsInfo = string.Format("{0}\n{1}\n{2}", course, speed, m_altitudeString);

            m_textGlyph.SetAnchor(-35.0f, -47.0f);
            m_dynamicSymbolProperties.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolText, m_textGlyph);
            m_dynamicSymbolProperties.TextBoxUseDynamicFillSymbol = true;
            m_dynamicSymbolProperties.set_Heading(esriDynamicSymbolType.esriDSymbolText, 0.0f);
            m_dynamicSymbolProperties.SetColor(esriDynamicSymbolType.esriDSymbolText, 0.0f, 0.8f, 0.0f, 1.0f);
            m_dynamicSymbolProperties.SetScale(esriDynamicSymbolType.esriDSymbolText, 1.0f, 1.0f);
            m_dynamicSymbolProperties.SetColor(esriDynamicSymbolType.esriDSymbolFill, 0.0f, 0.0f, 0.0f, 0.6f);
            m_dynamicSymbolProperties.TextBoxHorizontalAlignment = esriTextHorizontalAlignment.esriTHALeft;
            dynamicDisplay.DrawText(m_gpsPosition, gpsInfo);


            m_dynamicSymbolProperties.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolMarker, m_gpsGlyph);
            m_dynamicSymbolProperties.SetColor(esriDynamicSymbolType.esriDSymbolMarker, 1.0f, 1.0f, 1.0f, 1.0f);
            m_dynamicSymbolProperties.SetScale(esriDynamicSymbolType.esriDSymbolMarker, m_gpsSymbolScale, m_gpsSymbolScale);
            m_dynamicSymbolProperties.set_RotationAlignment(esriDynamicSymbolType.esriDSymbolMarker, esriDynamicSymbolRotationAlignment.esriDSRANorth);
            m_dynamicSymbolProperties.set_Heading(esriDynamicSymbolType.esriDSymbolMarker, (float)(m_heading - 90));
            dynamicDisplay.DrawMarker(m_gpsPosition);

            if (m_drawCycles % 5 == 0)
            {
                // increment the symbol size
                m_gpsSymbolScale += 0.05f;

                if (m_gpsSymbolScale > 1.2f)
                {
                    m_gpsSymbolScale = 0.8f;
                }
            }

            m_drawCycles++;
            if (m_drawCycles == 5)
            {
                m_drawCycles = 0;
            }
        }
		private void DrawGPSInfo(IDynamicDisplay dynamicDisplay, IPoint gpsPosition)
		{

			// altitude is already available
			string course;
			string speed;

			lock (m_bikePositionInfo)
			{
				course = string.Format("Course {0} DEG", m_bikePositionInfo.course.ToString("###.##"));
				speed = string.Format("Speed {0} MPH", m_bikePositionInfo.speed.ToString("###.##"));
			}

			string gpsInfo = string.Format("{0}\n{1}\n{2}", course, speed, m_altitudeString);

		  m_textGlyph.SetAnchor(-35.0f, -47.0f);
			m_dynamicSymbolProperties.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolText, m_textGlyph);
			m_dynamicSymbolProperties.TextBoxUseDynamicFillSymbol = true;
			m_dynamicSymbolProperties.set_Heading(esriDynamicSymbolType.esriDSymbolText, 0.0f);
			m_dynamicSymbolProperties.SetColor(esriDynamicSymbolType.esriDSymbolText, 0.0f, 0.8f, 0.0f, 1.0f);
			m_dynamicSymbolProperties.SetScale(esriDynamicSymbolType.esriDSymbolText, 1.0f, 1.0f);
			m_dynamicSymbolProperties.SetColor(esriDynamicSymbolType.esriDSymbolFill, 0.0f, 0.0f, 0.0f, 0.6f);
			m_dynamicSymbolProperties.TextBoxHorizontalAlignment = esriTextHorizontalAlignment.esriTHALeft;
			dynamicDisplay.DrawText(m_gpsPosition, gpsInfo);


			m_dynamicSymbolProperties.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolMarker, m_gpsGlyph);
			m_dynamicSymbolProperties.SetColor(esriDynamicSymbolType.esriDSymbolMarker, 1.0f, 1.0f, 1.0f, 1.0f);
			m_dynamicSymbolProperties.SetScale(esriDynamicSymbolType.esriDSymbolMarker, m_gpsSymbolScale, m_gpsSymbolScale);
			m_dynamicSymbolProperties.set_RotationAlignment(esriDynamicSymbolType.esriDSymbolMarker, esriDynamicSymbolRotationAlignment.esriDSRANorth);
			m_dynamicSymbolProperties.set_Heading(esriDynamicSymbolType.esriDSymbolMarker, (float)(m_heading - 90));
			dynamicDisplay.DrawMarker(m_gpsPosition);

			if (m_drawCycles % 5 == 0)
			{
				// increment the symbol size
				m_gpsSymbolScale += 0.05f;

				if (m_gpsSymbolScale > 1.2f)
					m_gpsSymbolScale = 0.8f;
			}

			m_drawCycles++;
			if (m_drawCycles == 5)
				m_drawCycles = 0;
		}
    private void DrawHeartRateAnimation(IDynamicDisplay dynamicDisplay, IPoint bikePoint)
    {
      m_dynamicSymbolProperties.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolMarker, m_heartRateGlyph[m_heartRateCounter]);
      m_dynamicSymbolProperties.SetColor(esriDynamicSymbolType.esriDSymbolMarker, 1.0f, 1.0f, 1.0f, 1.0f);
      m_dynamicSymbolProperties.SetScale(esriDynamicSymbolType.esriDSymbolMarker, 1.0f, 1.0f);
      m_dynamicSymbolProperties.set_RotationAlignment(esriDynamicSymbolType.esriDSymbolMarker, esriDynamicSymbolRotationAlignment.esriDSRAScreen);
      m_dynamicSymbolProperties.set_Heading(esriDynamicSymbolType.esriDSymbolMarker, 0.0f);
      dynamicDisplay.DrawMarker(bikePoint);

      m_textGlyph.SetAnchor(-35.0f, -50.0f);
      m_dynamicSymbolProperties.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolText, m_textGlyph);
      m_dynamicSymbolProperties.TextBoxUseDynamicFillSymbol = true;
      m_dynamicSymbolProperties.SetColor(esriDynamicSymbolType.esriDSymbolText, 0.0f, 0.8f, 0.0f, 1.0f);
      m_dynamicSymbolProperties.SetColor(esriDynamicSymbolType.esriDSymbolFill, 0.0f, 0.0f, 0.0f, 1.0f);
      m_dynamicSymbolProperties.TextBoxHorizontalAlignment = esriTextHorizontalAlignment.esriTHALeft;
      dynamicDisplay.DrawText(bikePoint, m_heartRateString);

      m_textGlyph.SetAnchor(-20.0f, -30.0f);
      m_dynamicSymbolProperties.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolText, m_textGlyph);
      dynamicDisplay.DrawText(bikePoint, m_altitudeString);

      if (m_drawCycles % 5 == 0)
      {
        m_heartRateCounter++;

        if (m_heartRateCounter > 4)
          m_heartRateCounter = 0;
      }

      m_drawCycles++;
      if (m_drawCycles == 5)
        m_drawCycles = 0;
    }