예제 #1
0
        private async Task Send()
        {
            SendHighPriorityItems();

            if (!_isOnHold)
            {
                if (Mode == OperatingMode.SendingGCodeFile &&
                    _toSend.Count == 0 &&
                    Settings.ControllerBufferSize - Math.Max(0, UnacknowledgedBytesSent) > 24)
                {
                    var nextCommand = GCodeFileManager.GetNextJobItem();
                    if (nextCommand != null)
                    {
                        TransmitJobItem(nextCommand);
                    }
                }
                else if (ShouldSendNormalPriorityItems())
                {
                    SendNormalPriorityItems();
                }
                else
                {
                    await QueryStatus();
                }
            }
        }
예제 #2
0
        public void ShouldNotSendNextLineIfBufferSpaceNotAvailable()
        {
            var mgr = new GCodeFileManager(_machine.Object, _logger.Object, _toolChangeManager.Object);

            mgr.SetGCode(GCodeSampleFile.GCODE_FILE);

            _machine.Setup(mac => mac.HasBufferSpaceAvailableForByteCount(It.IsAny <int>())).Returns(false);

            mgr.GetNextJobItem();

            _machine.Verify(mac => mac.SendJobCommand(It.IsAny <GCodeCommand>()), Times.Never);
        }