Beispiel #1
0
        /// <summary>
        /// FetchFaultSegmentDetails
        /// </summary>
        /// <param name="EventInstanceID"></param>
        /// <param name="theset"></param>
        /// <returns></returns>
        private eventSet FetchFaultSegmentDetails(string EventInstanceID, eventSet theset)
        {
            List <faultSegmentDetail> thedetails = new List <faultSegmentDetail>();

            FaultLocationData.FaultSegmentDataTable segments;

            theset.detail = thedetails;

            using (FaultSegmentTableAdapter faultSegmentTableAdapter = new FaultSegmentTableAdapter())
            {
                faultSegmentTableAdapter.Connection.ConnectionString = ConnectionString;

                segments = faultSegmentTableAdapter.GetDataBy(Convert.ToInt32(EventInstanceID));

                foreach (FaultLocationData.FaultSegmentRow seg in segments)
                {
                    faultSegmentDetail thedetail = new faultSegmentDetail();

                    thedetail.type        = "Start";
                    thedetail.StartSample = seg.StartSample;
                    thedetail.EndSample   = seg.StartSample + 8;
                    thedetails.Add(thedetail);

                    faultSegmentDetail thedetail2 = new faultSegmentDetail();

                    thedetail2.type        = "End";
                    thedetail2.StartSample = seg.EndSample - 8;
                    thedetail2.EndSample   = seg.EndSample;
                    thedetails.Add(thedetail2);
                }
            }

            return(theset);
        }
    /// <summary>
    /// FetchFaultSegmentDetails
    /// </summary>
    /// <param name="EventInstanceID"></param>
    /// <param name="theset"></param>
    /// <returns></returns>
    private eventSet FetchFaultSegmentDetails(string EventInstanceID, eventSet theset)
    {
        List<faultSegmentDetail> thedetails = new List<faultSegmentDetail>();
        FaultLocationData.FaultSegmentDataTable segments;

        theset.detail = thedetails;

        using (FaultSegmentTableAdapter faultSegmentTableAdapter = new FaultSegmentTableAdapter())
        {
            faultSegmentTableAdapter.Connection.ConnectionString = ConnectionString;

            segments = faultSegmentTableAdapter.GetDataBy(Convert.ToInt32(EventInstanceID));

            foreach (FaultLocationData.FaultSegmentRow seg in segments)
            {
            faultSegmentDetail thedetail = new faultSegmentDetail();

            thedetail.type = "Start";
            thedetail.StartSample = seg.StartSample;
            thedetail.EndSample = seg.StartSample + 8;
            thedetails.Add(thedetail);

            faultSegmentDetail thedetail2 = new faultSegmentDetail();

            thedetail2.type = "End";
            thedetail2.StartSample = seg.EndSample - 8;
            thedetail2.EndSample = seg.EndSample;
            thedetails.Add(thedetail2);
            }
        }

        return (theset);
    }