Exemple #1
0
        public static void SerializeRealSnaphotsAll(AutoDataReader reader, int waferQtyThreshold)
        {
            if (reader.LotTraces == null)
            {
                reader.LotTraces = Deserializer.DeserializeLotTraces(Path.Combine(reader.DirectorySerializedFiles, "LotTraces_2019_2020.dat"));
            }

            DateTime start = reader.LotTraces.StartDate;
            DateTime end   = reader.LotTraces.EndDate;

            DateTime from      = new DateTime(start.Year, start.Month, start.Day, start.Hour, 0, 0, 0);
            DateTime until     = new DateTime(end.Year, end.Month, end.Day, end.Hour, 0, 0, 0);
            TimeSpan frequency = new TimeSpan(1, 0, 0);

            reader.ReadRealSnapshots(from, until, frequency, waferQtyThreshold);

            reader.SerializeRealSnapshots($"{from.Year}-{from.Month}-{from.Day}_{until.Year}-{until.Month}-{until.Day}_{frequency.Hours}h");
        }
Exemple #2
0
        public static void SerializeRealSnapshotsPerMonth(AutoDataReader reader, int waferQtyThreshold)
        {
            if (reader.LotTraces == null)
            {
                reader.LotTraces = Deserializer.DeserializeLotTraces(Path.Combine(reader.DirectorySerializedFiles, "LotTraces_2019_2020.dat"));
            }

            DateTime start = reader.LotTraces.StartDate;
            DateTime end   = reader.LotTraces.EndDate;

            DateTime from      = new DateTime(start.Year, start.Month, start.Day, start.Hour, 0, 0, 0);
            DateTime until     = new DateTime(start.AddMonths(1).Year, start.AddMonths(1).Month, 1, 0, 0, 0, 0); // Until first of next month
            TimeSpan frequency = new TimeSpan(1, 0, 0);

            while (until < end.AddMonths(1))
            {
                reader.ReadRealSnapshots(from, until, frequency, waferQtyThreshold);

                reader.SerializeRealSnapshots($"{from.Year}-{from.Month}-{from.Day}_{until.Year}-{until.Month}-{until.Day}_{frequency.Hours}h");

                from  = until;
                until = until.AddMonths(1);
            }
        }