Пример #1
0
    IEnumerator EmgStopCheck()
    {
        checkEmgStop = false;

        yield return(new WaitForSeconds(0.05f));

        var EMG1 = Interface1.ReadNodeValue("ns=3;s=\"dbOpPanel\".\"OpPanelBtn\".\"xEmStop\"");

        if (EMG1 == null)
        {
            idle1.SetActive(true);
            emergency1.SetActive(false);
            good1.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }
        if (EMG1 != null && EMG1.ToString() == active)
        {
            emergency1.SetActive(true);
            idle1.SetActive(false);
            good1.SetActive(false);
            overlayGood.SetActive(false);
            overlayEmergency.SetActive(true);
            info.text = "Check emergency on Machine 1!";
        }
        if (EMG1 != null && EMG1.ToString() == inactive)
        {
            good1.SetActive(true);
            idle1.SetActive(false);
            emergency1.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }

        yield return(new WaitForSeconds(0.05f));

        var EMG2 = Interface2.ReadNodeValue("ns=3;s=\"dbOpPanel\".\"OpPanelBtn\".\"xEmStop\"");

        if (EMG2 == null)
        {
            idle2.SetActive(true);
            emergency2.SetActive(false);
            good2.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }
        if (EMG2 != null && EMG2.ToString() == active)
        {
            emergency2.SetActive(true);
            idle2.SetActive(false);
            good2.SetActive(false);
            overlayGood.SetActive(false);
            overlayEmergency.SetActive(true);
            info.text = "Check emergency on Machine 2!";
        }
        if (EMG2 != null && EMG2.ToString() == inactive)
        {
            good2.SetActive(true);
            idle2.SetActive(false);
            emergency2.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }

        yield return(new WaitForSeconds(0.05f));

        var EMG3 = Interface3.ReadNodeValue("ns=3;s=\"dbOpPanel\".\"OpPanelBtn\".\"xEmStop\"");

        if (EMG3 == null)
        {
            idle3.SetActive(true);
            emergency3.SetActive(false);
            good3.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }
        if (EMG3 != null && EMG3.ToString() == active)
        {
            emergency3.SetActive(true);
            idle3.SetActive(false);
            good3.SetActive(false);
            overlayGood.SetActive(false);
            overlayEmergency.SetActive(true);
            info.text = "Check emergency on Machine 3!";
        }
        if (EMG3 != null && EMG3.ToString() == inactive)
        {
            good3.SetActive(true);
            idle3.SetActive(false);
            emergency3.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }

        yield return(new WaitForSeconds(0.05f));

        var EMG4 = Interface4.ReadNodeValue("ns=3;s=\"dbOpPanel\".\"OpPanelBtn\".\"xEmStop\"");

        if (EMG4 == null)
        {
            idle4.SetActive(true);
            emergency4.SetActive(false);
            good4.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }
        if (EMG4 != null && EMG4.ToString() == active)
        {
            emergency4.SetActive(true);
            idle4.SetActive(false);
            good4.SetActive(false);
            overlayEmergency.SetActive(true);
            info.text = "Check emergency on Machine 4!";
        }
        if (EMG4 != null && EMG4.ToString() == inactive)
        {
            good4.SetActive(true);
            idle4.SetActive(false);
            emergency4.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }

        yield return(new WaitForSeconds(0.05f));

        var EMG5 = Interface5.ReadNodeValue("ns=3;s=\"dbOpPanel\".\"OpPanelBtn\".\"xEmStop\"");

        if (EMG5 == null)
        {
            idle5.SetActive(true);
            emergency5.SetActive(false);
            good5.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }
        if (EMG5 != null && EMG5.ToString() == active)
        {
            emergency5.SetActive(true);
            idle5.SetActive(false);
            good5.SetActive(false);
            good4.SetActive(false);
            overlayEmergency.SetActive(true);
            info.text = "Check emergency on Machine 5!";
        }
        if (EMG5 != null && EMG5.ToString() == inactive)
        {
            good5.SetActive(true);
            idle5.SetActive(false);
            emergency5.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }

        yield return(new WaitForSeconds(0.05f));

        var EMG6 = Interface6.ReadNodeValue("ns=3;s=\"dbOpPanel\".\"OpPanelBtn\".\"xEmStop\"");

        if (EMG6 == null)
        {
            idle6.SetActive(true);
            emergency6.SetActive(false);
            good6.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }
        if (EMG6 != null && EMG6.ToString() == active)
        {
            emergency6.SetActive(true);
            idle6.SetActive(false);
            good6.SetActive(false);
            good4.SetActive(false);
            overlayEmergency.SetActive(true);
            info.text = "Check emergency on Machine 6!";
        }
        if (EMG6 != null && EMG6.ToString() == inactive)
        {
            good6.SetActive(true);
            idle6.SetActive(false);
            emergency6.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }

        yield return(new WaitForSeconds(0.05f));

        var EMG7 = Interface7.ReadNodeValue("ns=3;s=\"dbOpPanel\".\"OpPanelBtn\".\"xEmStop\"");

        if (EMG7 == null)
        {
            idle7.SetActive(true);
            emergency7.SetActive(false);
            good7.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }
        if (EMG7 != null && EMG7.ToString() == active)
        {
            emergency7.SetActive(true);
            idle7.SetActive(false);
            good7.SetActive(false);
            good4.SetActive(false);
            overlayEmergency.SetActive(true);
            info.text = "Check emergency on Machine 7!";
        }
        if (EMG7 != null && EMG7.ToString() == inactive)
        {
            good7.SetActive(true);
            idle7.SetActive(false);
            emergency7.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }

        yield return(new WaitForSeconds(0.05f));

        var EMG8 = Interface8.ReadNodeValue("ns=3;s=\"dbOpPanel\".\"OpPanelBtn\".\"xEmStop\"");

        if (EMG8 == null)
        {
            idle8.SetActive(true);
            emergency8.SetActive(false);
            good8.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }
        if (EMG8 != null && EMG4.ToString() == active)
        {
            emergency8.SetActive(true);
            idle4.SetActive(false);
            good8.SetActive(false);
            good4.SetActive(false);
            overlayEmergency.SetActive(true);
            info.text = "Check emergency on Machine 8!";
        }
        if (EMG8 != null && EMG8.ToString() == inactive)
        {
            good8.SetActive(true);
            idle8.SetActive(false);
            emergency8.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }

        yield return(new WaitForSeconds(0.05f));

        var EMG9 = Interface9.ReadNodeValue("ns=3;s=\"dbOpPanel\".\"OpPanelBtn\".\"xEmStop\"");

        if (EMG9 == null)
        {
            idle9.SetActive(true);
            emergency9.SetActive(false);
            good9.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }
        if (EMG9 != null && EMG9.ToString() == active)
        {
            emergency9.SetActive(true);
            idle9.SetActive(false);
            good9.SetActive(false);
            good4.SetActive(false);
            overlayEmergency.SetActive(true);
            info.text = "Check emergency on Machine 9!";
        }
        if (EMG9 != null && EMG9.ToString() == inactive)
        {
            good9.SetActive(true);
            idle9.SetActive(false);
            emergency9.SetActive(false);
            overlayGood.SetActive(true);
            overlayEmergency.SetActive(false);
            info.text = "No emergency";
        }

        yield return(new WaitForSeconds(0.5f));

        checkEmgStop = true;
    }
Пример #2
0
    IEnumerator RFIDDataCheck()
    {
        timeToCheck = false;

        yield return(new WaitForSeconds(0.15f));

        var ONE = Interface1.ReadNodeValue("ns=3;s=\"dbRfidData\".\"ID1\".\"iCarrierID\"");

        if (ONE == null)
        {
            FM1.text = ("No reading RFID machine 1");
        }
        else
        {
            text1    = ("The last RFID tag at machine 1 was ") + ONE.ToString();
            FM1.text = text1;
        }

        yield return(new WaitForSeconds(0.15f));

        var TWO = Interface2.ReadNodeValue("ns=3;s=\"dbRfidData\".\"ID1\".\"iCarrierID\"");

        if (TWO == null)
        {
            FM2.text = ("No reading RFID machine 2");
        }
        else
        {
            text2    = ("The last RFID tag at machine 2 was ") + TWO.ToString();
            FM2.text = text2;
        }

        yield return(new WaitForSeconds(0.15f));

        var THREE = Interface3.ReadNodeValue("ns=3;s=\"dbRfidData\".\"ID1\".\"iCarrierID\"");

        if (THREE == null)
        {
            FM3.text = ("No reading RFID machine 3");
        }
        else
        {
            text1    = ("The last RFID tag at machine 3 was ") + THREE.ToString();
            FM3.text = text3;
        }

        yield return(new WaitForSeconds(0.15f));

        var FOUR = Interface4.ReadNodeValue("ns=3;s=\"dbRfidData\".\"ID1\".\"iCarrierID\"");

        if (FOUR == null)
        {
            FM4.text = ("No reading RFID machine 4");
        }
        else
        {
            text4    = ("The last RFID tag at machine 4 was ") + FOUR.ToString();
            FM4.text = text4;
        }

        yield return(new WaitForSeconds(0.15f));

        var FIVE = Interface5.ReadNodeValue("ns=3;s=\"dbRfidData\".\"ID1\".\"iCarrierID\"");

        if (FIVE == null)
        {
            FM5.text = ("No reading RFID machine 5");
        }
        else
        {
            text5    = ("The last RFID tag at machine 5 was ") + FIVE.ToString();
            FM5.text = text5;
        }

        yield return(new WaitForSeconds(0.15f));

        var SIX = Interface6.ReadNodeValue("ns=3;s=\"dbRfidData\".\"ID1\".\"iCarrierID\"");

        if (SIX == null)
        {
            FM6.text = ("No reading RFID machine 6");
        }
        else
        {
            text6    = ("The last RFID tag at machine 6 was ") + SIX.ToString();
            FM6.text = text6;
        }

        yield return(new WaitForSeconds(0.15f));

        var SEVEN = Interface7.ReadNodeValue("ns=3;s=\"dbRfidData\".\"ID1\".\"iCarrierID\"");

        if (SEVEN == null)
        {
            FM7.text = ("No reading RFID machine 7");
        }
        else
        {
            text7    = ("The last RFID tag at machine 7 was ") + SEVEN.ToString();
            FM7.text = text7;
        }

        yield return(new WaitForSeconds(0.15f));

        var EIGHT = Interface8.ReadNodeValue("ns=3;s=\"dbRfidData\".\"ID1\".\"iCarrierID\"");

        if (EIGHT == null)
        {
            FM8.text = ("No reading RFID machine 8");
        }
        else
        {
            text8    = ("The last RFID tag at machine 8 was ") + EIGHT.ToString();
            FM8.text = text8;
        }

        yield return(new WaitForSeconds(0.15f));

        var NINE = Interface9.ReadNodeValue("ns=3;s=\"dbRfidData\".\"ID1\".\"iCarrierID\"");

        if (NINE == null)
        {
            FM9.text = ("No reading RFID machine 9");
        }
        else
        {
            text9    = ("The last RFID tag at machine 9 was ") + NINE.ToString();
            FM9.text = text9;
        }

        yield return(new WaitForSeconds(0.3f));

        timeToCheck = true;
    }
Пример #3
0
    // Update is called once per frame
    void Update()
    {
        var ONE = Interface1.ReadNodeValue("ns=3;s=\"dbRfidData\".\"ID1\".\"iCarrierID\"");

        text1    = ("RFID tag at machine 1 is ") + ONE.ToString();
        FM1.text = text1;
        if (ONE == null)
        {
            FM1.text = ("No reading RFID machine 1");
        }

        var TWO = Interface2.ReadNodeValue("ns = 3; s = \"dbRfidData\".\"ID1\".\"iCarrierID\"");

        text2    = ("RFID tag at machine 2 is ") + TWO.ToString();
        FM2.text = text2;
        if (TWO == null)
        {
            FM2.text = ("No reading RFID machine 2");
        }

        var THREE = Interface3.ReadNodeValue("ns = 3; s = \"dbRfidData\".\"ID1\".\"iCarrierID\"");

        text3    = ("RFID tag at machine 3 is ") + THREE.ToString();
        FM3.text = text3;
        if (THREE == null)
        {
            FM3.text = ("No reading RFID machine 3");
        }

        var FOUR = Interface4.ReadNodeValue("ns = 3; s = \"dbRfidData\".\"ID1\".\"iCarrierID\"");

        text4    = ("RFID tag at machine 4 is ") + FOUR.ToString();
        FM4.text = text4;
        if (FOUR == null)
        {
            FM4.text = ("No reading RFID machine 4");
        }

        var FIVE = Interface5.ReadNodeValue("ns = 3; s = \"dbRfidData\".\"ID1\".\"iCarrierID\"");

        text5    = ("RFID tag at machine 5 is ") + FIVE.ToString();
        FM5.text = text5;
        if (FIVE == null)
        {
            FM5.text = ("No reading RFID machine 5");
        }

        var SIX = Interface6.ReadNodeValue("ns = 3; s = \"dbRfidData\".\"ID1\".\"iCarrierID\"");

        text6    = ("RFID tag at machine 6 is ") + SIX.ToString();
        FM6.text = text6;
        if (SIX == null)
        {
            FM6.text = ("No reading RFID machine 6");
        }

        var SEVEN = Interface7.ReadNodeValue("ns = 3; s = \"dbRfidData\".\"ID1\".\"iCarrierID\"");

        text7    = ("RFID tag at machine 7 is ") + SEVEN.ToString();
        FM7.text = text7;
        if (SEVEN == null)
        {
            FM7.text = ("No reading RFID machine 7");
        }

        var EIGHT = Interface8.ReadNodeValue("ns = 3; s = \"dbRfidData\".\"ID1\".\"iCarrierID\"");

        text8    = ("RFID tag at machine 8 is ") + EIGHT.ToString();
        FM8.text = text8;
        if (EIGHT == null)
        {
            FM8.text = ("No reading RFID machine 8");
        }

        var NINE = Interface9.ReadNodeValue("ns = 3; s = \"dbRfidData\".\"ID1\".\"iCarrierID\"");

        text9    = ("RFID tag at machine 9 is ") + NINE.ToString();
        FM9.text = text9;
        if (NINE == null)
        {
            FM9.text = ("No reading RFID machine 9");
        }
    }