示例#1
0
        private void GetCaseMeasurementsData()
        {
            if (m_CaseObject.attachments.CountofType(AttachmentType.SNM) > 0)
            {
                foreach (DataAttachment attachment in m_CaseObject.attachments.GetSNMAttachments())
                {
                    try
                    {
                        //Attachment information in the two elements below  //attachment.attachmentData;
                        string        s          = attachment.attachmentId;
                        XmlSerializer serializer = new XmlSerializer(typeof(Measurements));
                        Measurements  snmData    = (Measurements)serializer.Deserialize(attachment.attachmentData);
                        PrepareChartData(snmData, dt);

                        for (int k = 0; k < dt.Count; k++)
                        {
                            if (dt[k].G_RSP1_Alarm > 0)
                            {
                                if (dt[k].G_RSP1_Alarm == 1)
                                {
                                    Chart_Series_Warnings.Points.AddXY(k, dt[k].G_RSP1_Data);
                                }
                                else if (dt[k].G_RSP1_Alarm == 2)
                                {
                                    Chart_Series_Alarms.Points.AddXY(k, dt[k].G_RSP1_Data);
                                }
                                else if (dt[k].G_RSP1_Alarm == 3)
                                {
                                    Chart_Series_NORMAlarms.Points.AddXY(k, dt[k].G_RSP1_Data);
                                }
                            }

                            if (dt[k].G_RSP2_Alarm > 0)
                            {
                                if (dt[k].G_RSP2_Alarm == 1)
                                {
                                    Chart_Series_Warnings.Points.AddXY(k, dt[k].G_RSP2_Data);
                                }
                                else if (dt[k].G_RSP2_Alarm == 2)
                                {
                                    Chart_Series_Alarms.Points.AddXY(k, dt[k].G_RSP2_Data);
                                }
                                else if (dt[k].G_RSP2_Alarm == 3)
                                {
                                    Chart_Series_NORMAlarms.Points.AddXY(k, dt[k].G_RSP2_Data);
                                }
                            }

                            if (dt[k].N_RSP1_Alarm > 0)
                            {
                                if (dt[k].N_RSP1_Alarm == 1)
                                {
                                    Chart_Series_Warnings.Points.AddXY(k, dt[k].N_RSP1_Data);
                                }
                                else if (dt[k].N_RSP1_Alarm == 2)
                                {
                                    Chart_Series_Alarms.Points.AddXY(k, dt[k].N_RSP1_Data);
                                }
                                else if (dt[k].N_RSP1_Alarm == 3)
                                {
                                    Chart_Series_NORMAlarms.Points.AddXY(k, dt[k].N_RSP1_Data);
                                }
                            }

                            if (dt[k].N_RSP2_Alarm > 0)
                            {
                                if (dt[k].N_RSP2_Alarm == 1)
                                {
                                    Chart_Series_Warnings.Points.AddXY(k, dt[k].N_RSP2_Data);
                                }
                                else if (dt[k].N_RSP2_Alarm == 2)
                                {
                                    Chart_Series_Alarms.Points.AddXY(k, dt[k].N_RSP2_Data);
                                }
                                else if (dt[k].N_RSP2_Alarm == 3)
                                {
                                    Chart_Series_NORMAlarms.Points.AddXY(k, dt[k].N_RSP2_Data);
                                }
                            }

                            Chart_Series1.Points.AddXY(k, dt[k].G_RSP1_Data);
                            Chart_Series2.Points.AddXY(k, dt[k].G_RSP2_Data);
                            Chart_Series3.Points.AddXY(k, dt[k].N_RSP1_Data);
                            Chart_Series4.Points.AddXY(k, dt[k].N_RSP2_Data);
                        }

                        Chart_ChartArea.AxisX.Maximum = dt.Count - 1;
                    }
                    catch (Exception ex)
                    {
                        //TODO: Log Bad File
                    }
                }
            }
        }