Esempio n. 1
0
        /// <summary>
        /// Get the time from the build start time until bottom temperature reached 100 degrees
        /// </summary>
        /// <param name="db"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime">Time when build is stopped</param>
        /// <returns></returns>
        public static TimeSpan?GetTotalBuildTime(IItemDatabase db, DateTime startTime, DateTime endTime)
        {
            LogRowDataPoint dataPoint = db.GetFirstItemDP("OPC.Temperature.BottomTemperature", p => (p.TimeStamp >= endTime && p.Value <= 110d));

            if (dataPoint == null)
            {
                dataPoint = db.GetLastItemDP("OPC.Temperature.BottomTemperature");
            }

            return(dataPoint.TimeStamp - startTime);
        }
Esempio n. 2
0
        /// <summary>
        /// Get the time from the first layer until Internal Process State not running
        /// </summary>
        /// <param name="db"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        public static TimeSpan?GetMeltTime(IItemDatabase db, DateTime startTime, DateTime endTime)
        {
            LogRowDataPoint processStopped = db.GetLastItemDP("Process.ProcessManager.InternalProcessStop",
                                                              p => p.TimeStamp > startTime && p.Value >= 0.5);

            if (processStopped == null)
            {
                return(null);
            }

            LogRowDataPoint firstLayer = db.GetFirstItemDP("Beam.LayerThickness", p => p.TimeStamp >= startTime && p.TimeStamp <= endTime && p.Value > 0);

            if (firstLayer == null)
            {
                return(null);
            }
            //throw new ApplicationException("Did not find the time of the first layer in the log file.");

            return(processStopped.TimeStamp - firstLayer.TimeStamp);
        }