Beispiel #1
0
 // Constructor
 public BufferComm()
 {
     // Create communication obj and init the data
     C = new BufferClient();
     nEvents = 0;
     nSamples = 0;
 }
Beispiel #2
0
    void Awake()
    {
        bufferClient = new BufferClient();
        bufferEvents = new List <BufferEvent>();

        latestCapturedSample         = 0;
        newDataIn                    = false;
        dataPacketsLost              = 0;
        lastNumberOfEvents           = 0;
        latestNumebrOfEventsInBuffer = 0;
    }
Beispiel #3
0
    void Awake()
    {
        Debug.Log("Awoke UnityBuffer");
        bufferClient = new BufferClient();
        bufferEvents = new List <BufferEvent>();

        latestCapturedSample         = -1;
        newDataIn                    = false;
        dataPacketsLost              = 0;
        lastNumberOfEvents           = -1;
        latestNumberOfEventsInBuffer = -1;
    }
Beispiel #4
0
    public UnityBuffer()
    {
        bufferClient = new BufferClient();
        bufferEvents = new List <BufferEvent>();
        //Debug.Log("Connecting to "+hostname+":"+port);
        if (bufferClient.connect(hostname, port))
        {
            hdr = bufferClient.getHeader();
            latestBufferSample = hdr.nSamples;
            nSamples           = hdr.nSamples;
            nChans             = hdr.nChans;
            fSample            = hdr.fSample;
            initializeData();
            //  System.Windows.Forms.MessageBox.Show("hello");
            //Debug.Log("#channels....: "+hdr.nChans);
            //Debug.Log("#samples.....: "+hdr.nSamples);
            //Debug.Log("#events......: "+hdr.nEvents);
            //Debug.Log("Sampling Freq: "+hdr.fSample);
            //Debug.Log("data type....: "+hdr.dataType);

            for (int n = 0; n < nChans; n++)
            {
                if (hdr.labels[n] != null)
                {
                    //Debug.Log("Channel number " + n + ": " + hdr.labels[n]);
                }
            }
        }
        else          //Debug.LogError("Connection to "+hostname+":"+port+" failed");

        {
            latestCapturedSample = 0;
        }
        newDataIn                    = false;
        dataPacketsLost              = 0;
        lastNumberOfEvents           = 0;
        latestNumebrOfEventsInBuffer = 0;
    }