% % analyze the current data point % track the difference from the least date in days % %%% "counting" log)( _Raw.Least _ldate "d" Time.Diff %%% "ndate" log)( dup !ndate % % set up prior data point date formats % _xdate shdate !xsht _xdate Time.TimeOrder !tsht % % check this points date diff in days from prior data point % _bulday eq { % % date is same as last data point entry, don't summarize % } { % % date has changed, is this data point in range to process % _bulday positive { % % we were tracking a date, now changed % summarize the previous day entry % _xsht quoter &"," _Telm.Tcount _buldtcnt sub quoter & &"," % % create the alert field based on comparison to tool life % empty _Telm.T9 %%% "t9" log)( _Raw.T9life .75 mul %%% "life" log)( gt %%% "over" log)( { _Telm.T9 100.0 mul _Raw.T9life div normint & } if &"/" _Telm.T10 _Raw.T10life .75 mul gt { _Telm.T10 100.0 mul _Raw.T10life div normint & } if &"/" _Telm.T11 _Raw.T11life .75 mul gt { _Telm.T11 100.0 mul _Raw.T11life div normint & } if &"/" _Telm.T12 _Raw.T12life .75 mul gt { _Telm.T12 100.0 mul _Raw.T12life div normint & } if %%% "alert" log)( dup "///" eq$ { pop empty } { quoter } ifelse & &"," dup _xsht ofconn &".det" write _Raw.Direction "down" eq$ { &:builder } { ^:builder } ifelse empty % % report the daily sum by hour collected % 24 countup { - dup ^"Raw.Sday" _ quoter _xsht quoter &"," rot quoter & &"," ^ &",," & } for _xsht text!conn % % write the collected csvs for date % _xubuld _xsht ofconn &".csv" write } if % % effect the change in tcount and date tracking values % restart the collected csv collection % empty !xubuld % % the new date diff with least % _ndate !bulday % % this date is the one we are now tracking % _ldate !xdate % % track the Tcount, is now the least Tcount of date % _Telm.Tcount !buldtcnt % % zero out the daily summary % *gwizsumz } ifelse % % add this data point's csv to this date's detail summary % _xcsv _Raw.Direction "down" eq$ { &:xubuld } { ^:xubuld } ifelse % % add the quantity change to the hour of the day % _ldate Time.Timels pop2 ^"Raw.Sday" dup _ _Telm.Tcount _pcount sub add exch ! % % track this days most recent Tcount % _Telm.Tcount !pcount