Example #1
0
    // Use this for initialization
    void Start()
    {
        if (isMobile == false)
        {
            this.GetComponent <TrailRenderer>().enabled = false;
        }

        if (sensorDeviceName == null)
        {
            sensorDeviceName = transform.name;
        }

        myColor = GetComponentInChildren <SpriteRenderer>().color;
        myLine  = GetComponent <LineRenderer>();
        //myLine.positionCount = 20;
        //GetComponent<TrailRenderer>().startColor = GetComponent<SpriteRenderer>().color;

        deviceDes        = transform.position;
        conversionParams = conversionParams = GisConvert.MakeConversionParameters(coordinateSettings.gridType);

        if (devicesController == null)
        {
            devicesController = GetComponentInParent <SensorDevicesController>();
        }

        Deselect();
        StopHover();
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        double northing = 0.0;
        double easting  = 0.0;

        GisConvert.GeodeticToGrid(latitude, longitude, conversionParams, out northing, out easting);

        float northingWithOffset = (float)(northing + northingOffset);
        float eastingWithOffset  = (float)(easting + eastingOffset);

        transform.position = new Vector3(eastingWithOffset, transform.position.y, northingWithOffset);
    }
Example #3
0
    // Update is called once per frame
    void Update()
    {
        double northing = 0.0;
        double easting  = 0.0;

        GisConvert.GeodeticToGrid(latitude, longitude, conversionParams, out northing, out easting);

        float northingWithOffset = (float)(northing + coordinateSettings.northingOffset);
        float eastingWithOffset  = (float)(easting + coordinateSettings.eastingOffset);

        //Debug.Log("Update northing easting: " + northing + " " + easting);

        transform.position = new Vector3(eastingWithOffset, transform.position.y, northingWithOffset);
    }
Example #4
0
    override public void TimeDataUpdate(Subscription Sub, DataPoint data)
    {
        if (data.Values[0] != null)
        {
            double northing = 0.0;
            double easting  = 0.0;

            //tempText.text = latitude.ToString();
            GisConvert.GeodeticToGrid(latitude, longitude, conversionParams, out northing, out easting);

            northingWithOffset = (float)(northing + coordinateSettings.northingOffset);
            eastingWithOffset  = (float)(easting + coordinateSettings.eastingOffset);

            latitude    = data.Values[0];
            longitude   = data.Values[1];
            temperature = (float)data.Values[2];
            humidity    = (float)data.Values[3];
            decibel     = (float)data.Values[4];

            //set the new destination for the bike
            deviceDes = new Vector3(eastingWithOffset, transform.position.y, northingWithOffset);


            /*if (isMobile) {
             *
             *  //myLineDes = transform.localPosition;
             *  //Debug.Log("new line des:" + myLineDes);
             *  myLineDes = new Vector3(transform.position.x, decibel/myLineScale, transform.position.z);
             *  myLine.SetPosition(myLineIndex, myLineDes);
             *  myLineIndex++;
             *  if (myLineIndex == myLine.positionCount)
             *  {
             *      myLineIndex = 0;
             *  }
             *  //myLine.positionCount = myLineIndex;
             *  //Debug.Log("Set pos count: " + myLine.positionCount);
             * }*/


            LastData = data;
        }
    }
    // Use this for initialization
    void Start()
    {
        base.Start();

        if (isMobile == false)
        {
            this.GetComponent <TrailRenderer>().enabled = false;
        }

        if (sensorDeviceName == null)
        {
            sensorDeviceName = transform.name;
        }

        myColor = GetComponentInChildren <SpriteRenderer>().color;
        myLine  = GetComponent <LineRenderer>();
        myLine.positionCount = 50;
        //GetComponent<TrailRenderer>().startColor = GetComponent<SpriteRenderer>().color;

        deviceDes        = transform.position;
        conversionParams = GisConvert.MakeSweref99L1800();
    }
Example #6
0
 // Use this for initialization
 void Start()
 {
     conversionParams = GisConvert.MakeConversionParameters(coordinateSettings.gridType);
 }
Example #7
0
 // Use this for initialization
 void Start()
 {
     conversionParams = GisConvert.MakeSweref99L1800();
 }