Beispiel #1
0
        public void AddData(stContinuousModeData_HA data)
        {
            // data.sequence trae la secuencia del frame, que se convertirá en una secuencia continua
            lock (syncObj)
            {
                int frameSequence = 0;

                //save the frame sequence number (to calculate next usersequence)
                frameSequence = (int)data.sequence;

                // set sequence for data (with current user sequence)
                data.sequence = userSequence;
                //updating the next user sequence and lastFrameSequence
                if (frameSequence > lastFrameSequence)
                {
                    userSequence = userSequence + System.Convert.ToUInt64(frameSequence - lastFrameSequence);
                }
                if (frameSequence < lastFrameSequence)
                {
                    userSequence = userSequence + System.Convert.ToUInt64(frameSequence - lastFrameSequence + 256);
                }
                lastFrameSequence = frameSequence;
                //Dim curSequence As Integer = CInt(data.sequence)
                dataList.Add(data);
            }
        }
 public void AddData(stContinuousModeData_HA data)
 {
     // data.sequence trae la secuencia del frame, que se convertirá en una secuencia continua
     //SyncLock syncObjList
     // add continuous mode data in each queue buffer
     foreach (CContinuousModeQueueStation_HA dataQueue in queueList)
     {
         dataQueue.AddData(data);
     }
     //End SyncLock
 }
        public void AddData(stContinuousModeData_HA data, uint queueID)
        {
            // data.sequence trae la secuencia del frame, que se convertirá en una secuencia continua
            //SyncLock syncObjList
            // add continuous mode data in buffer
            int idx = getIdx(queueID);

            if (idx >= 0)
            {
                queueList[idx].dataList.Add(data);
            }
            //End SyncLock
        }
        public stContinuousModeData_HA GetData(uint queueID)
        {
            stContinuousModeData_HA data = new stContinuousModeData_HA();

            try
            {
                int idx = getIdx(queueID);
                if (idx >= 0)
                {
                    // get out data from trace buffer
                    data = queueList[idx].GetData();
                }
            }
            catch (Exception)
            {
            }
            return(data);
        }
Beispiel #5
0
        public void AddData(stContinuousModeData_HA data) // Overloads
        {
            // data.sequence trae la secuencia del frame, que se convertirá en una secuencia continua
            lock (syncObj)
            {
                int frameSequence = 0;

                m_captureMSCount++;
                // cumulate
                for (var i = 0; i <= data.data.Length - 1; i++)
                {
                    m_acumData[(int)i].power               += data.data[(int)i].power;
                    m_acumData[(int)i].flow                += data.data[(int)i].flow;
                    m_acumData[(int)i].temperatureUTI      += data.data[(int)i].temperature.UTI;
                    m_acumData[(int)i].externalTC1_TempUTI += data.data[(int)i].externalTC1_Temp.UTI;
                    m_acumData[(int)i].externalTC2_TempUTI += data.data[(int)i].externalTC2_Temp.UTI;
                }
                if (m_captureMSCount == m_captureWindow)
                {
                    // set sequence for data
                    userSequence  = userSequence + System.Convert.ToUInt64(1);
                    data.sequence = userSequence;

                    for (var i = 0; i <= data.data.Length - 1; i++)
                    {
                        data.data[(int)i].power                = System.Convert.ToInt32(m_acumData[(int)i].power / m_captureWindow);
                        data.data[(int)i].flow                 = System.Convert.ToInt32(m_acumData[(int)i].flow / m_captureWindow);
                        data.data[(int)i].temperature          = new CTemperature(System.Convert.ToInt32(m_acumData[(int)i].temperatureUTI / m_captureWindow));
                        data.data[(int)i].externalTC1_Temp     = new CTemperature(System.Convert.ToInt32(m_acumData[(int)i].externalTC1_TempUTI / m_captureWindow));
                        data.data[(int)i].externalTC2_Temp     = new CTemperature(System.Convert.ToInt32(m_acumData[(int)i].externalTC2_TempUTI / m_captureWindow));
                        m_acumData[(int)i].power               = 0;
                        m_acumData[(int)i].flow                = 0;
                        m_acumData[(int)i].temperatureUTI      = 0;
                        m_acumData[(int)i].externalTC1_TempUTI = 0;
                        m_acumData[(int)i].externalTC2_TempUTI = 0;
                    }

                    dataList.Add(data);
                    m_captureMSCount = 0;
                }
            }
        }
Beispiel #6
0
 public stContinuousModeData_HA GetData()
 {
     // check data.data.length = 0 on return for error???
     lock (syncObj)
     {
         stContinuousModeData_HA data = new stContinuousModeData_HA();
         try
         {
             // get out data from trace buffer
             if (dataList.Count > 0)
             {
                 data = dataList[0];
                 dataList.RemoveAt(0);
             }
         }
         catch (Exception)
         {
         }
         return(data);
     }
 }