Exemple #1
0
        /// <summary>
        /// Processes heart beat packet
        /// </summary>
        private void ProcessDeviceHeartbeatPacket()
        {
            PacketDeviceHeartbeat packet = (PacketDeviceHeartbeat)m_receiver_queue.Pop(typeof(PacketDeviceHeartbeat));

            m_device_heartbeat_object.UpdateBegin();

            m_cpu_load_member.Write(packet.CPULoad);

            m_device_heartbeat_object.UpdateEnd();
        }
        /// <summary>
        /// Updates ROX object to signal current file transfer operation
        /// </summary>
        private void UpdateFileTransferState()
        {
            m_file_transfer_state_object.UpdateBegin();

            m_file_transfer_name_member.Write(m_file_transfer_current_name);
            if (m_file_transfer_current_size == 0)
            {
                m_file_transfer_percentage_member.Write(0);
            }
            else
            {
                m_file_transfer_percentage_member.Write(m_file_transfer_current_position * 100 / m_file_transfer_current_size);
            }

            m_file_transfer_state_object.UpdateEnd();
        }
Exemple #3
0
        /// <summary>
        /// Updates communication state realtime object
        /// </summary>
        private void UpdateCommunicationState()
        {
            double ellapsed_time;

            ellapsed_time = (DateTime.Now - m_communication_state_update_timestamp).TotalMilliseconds;
            if (ellapsed_time >= 1000)
            {
                m_communication_state_update_timestamp = m_communication_state_update_timestamp.AddMilliseconds(ellapsed_time);

                // start object update
                m_communication_state_object.UpdateBegin();

                m_device_connected_member.Write(Convert.ToInt32(m_device_connected));
                m_device_name_member.Write(m_device_name);

                for (int i = 0; i < m_communication_interfaces.Count; i++)
                {
                    m_communication_interfaces[i].UpdateCommunicationStatistics((int)ellapsed_time);
                }

                m_communication_state_object.UpdateEnd();
            }
        }