コード例 #1
0
 void add_________Time(DateTime timeA, DateTime timeB, EvOfIntFlag eoiA, EvOfIntFlag eoiB, ref TimeSplit ts)
 {
     if (eoiA == EvOfIntFlag.ScreenSaverrDn || eoiA == EvOfIntFlag.BootAndWakeUps)
     {
         ts.WorkedFor += (timeB - timeA);
     }
     else
     {
         ts.IdleOrOff += (timeB - timeA);
     }
 }
コード例 #2
0
        void addWkTimeSegment(DateTime timeA, DateTime timeB, EvOfIntFlag eoiA, EvOfIntFlag eoiB, Brush brh, ref TimeSplit ts)
        {
            if (eoiA == EvOfIntFlag.ScreenSaverrUp && eoiB == EvOfIntFlag.BootAndWakeUps)
            {
                eoiB = EvOfIntFlag.ScreenSaverrUp;                                                                     // ignore odd pwr-on during scrsvr runs.
            }
            if (eoiA == EvOfIntFlag.BootAndWakeUps && eoiB == EvOfIntFlag.ScreenSaverrDn)
            {
                eoiA = EvOfIntFlag.ScreenSaverrUp;                                                                     // ignore odd pwr-on during scrsvr runs.
            }
            add_________Time(timeA, timeB, eoiA, eoiB, ref ts);

            var angleA = _aw * (eoiA == EvOfIntFlag.ScreenSaverrUp ? timeA.AddSeconds(-Ssto_GpSec).TimeOfDay.TotalDays : timeA.TimeOfDay.TotalDays); // for ss up - start idle line 2 min prior
            var angleB = _aw * (eoiB == EvOfIntFlag.ScreenSaverrUp ? timeB.AddSeconds(-Ssto_GpSec).TimeOfDay.TotalDays : timeB.TimeOfDay.TotalDays); // for ss dn - end   work line 2 min prior

            var hgt =
                eoiA == EvOfIntFlag.Day1stAmbiguos ? (_ah / 9) :
                eoiA == EvOfIntFlag.ScreenSaverrUp ? (_ah / 7) :
                eoiA == EvOfIntFlag.ScreenSaverrDn ? (_ah / 1) :
                eoiA == EvOfIntFlag.BootAndWakeUps ? (_ah / 1) :
                eoiA == EvOfIntFlag.Who_Knows_What ? (_ah / 8) :
                0;

            var isUp = eoiA == EvOfIntFlag.ScreenSaverrDn || eoiA == EvOfIntFlag.BootAndWakeUps;
            var top  = _ah - hgt;
            var wid  = Math.Abs(angleB - angleA);

            var time = TimeSpan.FromDays(wid / _aw);

            addRectangle(top, hgt, angleA, wid, brh, $"Span: {time:h\\:mm\\:ss}  => {wid:N0} pxl.");
            if (wid > .005 * _aw)
            {
                var isBig = time > TimeSpan.FromHours(1);
                addUiElnt(
                    isUp ? 2 : -1,
                    angleB - (isBig ? 28 : 20),
                    new TextBlock
                {
                    Text       = isBig ? $"{time:h\\:mm}" : $"{time,3:\\:m}",
                    FontSize   = isUp ? 14 : 12,
                    Foreground = isUp ? Brushes.LimeGreen : Brushes.DodgerBlue,
                    ToolTip    = $"Span: {time:h\\:mm\\:ss}  => {wid:N0} pxl."
                });
コード例 #3
0
 void addWkTimeSegment(double v1, double v2, EvOfIntFlag eoi /*, object clr*/)
 {
 }