示例#1
0
        public MasterViewModel(
            IComService comService,
            IGrblStatus grblStatus,
            ICommandSender commandSender,
            IGrblDispatcher grblDispatcher,
            IApplicationSettingsService applicationSettingsService,
            IGCodeFileService gCodeFileService)
        {
            _grblDispatcher             = grblDispatcher;
            _applicationSettingsService = applicationSettingsService;
            _applicationSettingsService.Upgrade();
            _applicationSettingsService.Load();

            ComConnectionViewModel = new COMConnectionViewModel(comService, applicationSettingsService);
            _comService            = comService;
            _grblStatus            = grblStatus;
            _commandSender         = commandSender;
            _gCodeFileService      = gCodeFileService;

            _grblStatus.GrblStatusModel.MachineStateChanged += GrblStatusModelMachineStateChanged;
            _grblStatus.GrblStatusModel.PropertyChanged     += GrblStatusModelPropertyChanged;
            _comService.ConnectionStateChanged       += ComServiceConnectionStateChanged;
            _commandSender.CommunicationLogUpdated   += CommandSenderCommunicationLogUpdated;
            _commandSender.CommandQueueLengthChanged += CommandSenderCommandQueueLengthChanged;

            _commandSender.FileCommands.CommandList.CollectionChanged += (sender, args) =>
            {
                NotifyOfPropertyChange(() => FileLinesProcessed);
            };

            StartNotifications();
        }
示例#2
0
 public COMConnectionViewModel(IComService comService, IApplicationSettingsService applicationSettingsService)
 {
     _comService = comService;
     _comService.ConnectionStateChanged += ComServiceConnectionStateChanged;
     _applicationSettingsService         = applicationSettingsService;
     ReloadComPorts();
 }
示例#3
0
 public CommandSender(IComService comService, IGrblResponseTypeFinder responseTypeFinder, IGrblCommandPreProcessor commandPreProcessor)
 {
     _uiContext                          = SynchronizationContext.Current;
     _comService                         = comService;
     _responseTypeFinder                 = responseTypeFinder;
     _commandPreProcessor                = commandPreProcessor;
     _comService.LineReceived           += ComServiceLineReceived;
     _comService.ConnectionStateChanged += ComServiceConnectionStateChanged;
 }
示例#4
0
        //private static bool CanWrite = false;

        public SmsService(MainDbContext mainDbContext,
                          IConfiguration configuration,
                          IComService comService,
                          IGammuService gammuService)
        {
            _mainDbContext = mainDbContext;
            _configuration = configuration;
            _comHelper     = (ComHelper)comService;
            _gammuService  = gammuService;
        }
示例#5
0
 public ComController(IComService comService)
 {
     this.comService = comService;
 }
示例#6
0
 public GrblPrompt(IComService comService)
 {
     comService.LineReceived += ComServiceLineReceived;
 }
示例#7
0
 public GrblDispatcher(IComService comService, IGrblPrompt grblPrompt, IGrblStatus grblStatus)
 {
     _grblStatus = grblStatus;
     grblPrompt.PromptReceived         += GrblPromptPromptReceived;
     comService.ConnectionStateChanged += ComServiceConnectionStateChanged;
 }