예제 #1
0
        private bool getTempFromDevice()
        {
            GetTemperature getTemperature = new GetTemperature(ip);

            if (getTemperature.isOk)
            {
                temperatureValue = getTemperature.tempValue;
                return(true);
            }
            else
            {
                temperatureErrorMessage = getTemperature.errorMessage;
                return(false);
            }
        }
예제 #2
0
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            WWWFormScore   thingconnection = (WWWFormScore)gameObject.AddComponent(typeof(WWWFormScore));
            GetText        haeteksti       = (GetText)gameObject.AddComponent(typeof(GetText));
            GetTemperature temperature     = (GetTemperature)gameObject.AddComponent(typeof(GetTemperature));
            TurnLight      valo            = (TurnLight)gameObject.AddComponent(typeof(TurnLight));

            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;


            if (Physics.Raycast(ray, out hit, 100.0f))
            {
                this.Nimi   = hit.transform.name;
                ShowThisGUI = true;

                Debug.Log("Pisteessa " + hit.point + " on " + hit.transform.name + " ja arvo on : " + value);
            }
        }
    }
예제 #3
0
 /// <summary>Constructor.</summary>
 /// <param name="shortName">Description of the temperature. This will be displayed when switching
 /// to this segment display for a period of time.</param>
 /// <param name="longName">Description of the temperature for the UI.</param>
 /// <param name="prefix">String to prefix the temperature with, e.g. "Oil", "H20".</param>
 /// <param name="getTemperature">Function to get a temperature from <see cref="NormalizedData"/>.</param>
 public TempSegmentDisplay(String shortName, String longName, String prefix,
                           GetTemperature getTemperature) : base(shortName, longName)
 {
     m_prefix         = prefix;
     m_getTemperature = getTemperature;
 }