コード例 #1
0
 private void SetIdleTimer(BreakSettings _break)
 {
     idleTimer.Interval  = _break.BreakIdleTime * 1000 * 60;
     idleTimer.AutoReset = false;
     idleTimer.Start();
     Logger.Warning("[" + invokeCount + "] Idle Timer for sequence " + _break.BreakSequenceId + " started. We are going to idle during: " + _break.BreakIdleTime + " minutes as soon as we finish what we are doing.");
 }
コード例 #2
0
 private void SetWalkTimer(BreakSettings _break)
 {
     //var autoEvent = new AutoResetEvent(false);
     //var stateTimer = new Timer(NextInterval, null, 0, _break.BreakWalkTime);
     walkTimer.Interval  = _break.BreakWalkTime * 1000 * 60;
     walkTimer.AutoReset = false;
     walkTimer.Start();
     Logger.Info("[" + invokeCount + "] Walking Timer for sequence " + _break.BreakSequenceId + " started. We are going to walk during: " + _break.BreakWalkTime + " minutes.");
 }
コード例 #3
0
        private void SetWalkTimer(BreakSettings _break)
        {
            walkTimer.Interval  = _break.BreakWalkTime * 1000 * 60;
            walkTimer.AutoReset = false;
            walkTimer.Start();

            //Logger.Debug("[" + invokeCount + "] Sequence " + _break.BreakSequenceId + " started."
            //    + " GlobalVars Catch: " + (GlobalVars.CatchPokemon ? "Yes" : "No")
            //    + " GlobalVars Walk: " + GlobalVars.WalkingSpeedInKilometerPerHour + "/" + GlobalVars.MinWalkSpeed
            //    + " Catch: " + (_break.BreakSettingsCatchPokemon ? "Yes" : "No")
            //    + " Walk: "  + _break.BreakSettingsMaxSpeed + "/" + _break.BreakSettingsMinSpeed
            //    + " MaxSpeedDefault: " + MaxSpeedDefault + " MinSpeedDefault: " + MinSpeedDefault);

            if (_break.BreakSettingsCatchPokemon)
            {
                GlobalVars.CatchPokemon = true;
            }
            else
            {
                GlobalVars.CatchPokemon = false;
            }

            if (_break.BreakSettingsMaxSpeed > 0 && _break.BreakSettingsMinSpeed < _break.BreakSettingsMaxSpeed)
            {
                GlobalVars.WalkingSpeedInKilometerPerHour = _break.BreakSettingsMaxSpeed;
                GlobalVars.MinWalkSpeed = _break.BreakSettingsMinSpeed;
            }
            else
            {
                GlobalVars.WalkingSpeedInKilometerPerHour = MaxSpeedDefault;
                GlobalVars.MinWalkSpeed = MinSpeedDefault;
            }
            DueTime    = DateTime.Now.AddMilliseconds(walkTimer.Interval);
            WalkOrIdle = true;

            Logger.Info("[" + invokeCount + "] Walking Timer sequence " + _break.BreakSequenceId + " started. We are going to walk during: " + _break.BreakWalkTime + " minutes."
                        + " Catch: " + (_break.BreakSettingsCatchPokemon ? "Yes" : "No")
                        + " Walk: " + GlobalVars.WalkingSpeedInKilometerPerHour + "(" + _break.BreakSettingsMaxSpeed + "/" + _break.BreakSettingsMinSpeed + ")");
        }