Exemple #1
0
        public DebuggerViewModel
            (DocumentModel document,
            DebugDocumentModel debugDocumentModel,
            ConsoleModel console,
            DebuggerModel debugger,
            object currentView,
            EditorView editorView,
            EditorDebugView editorDebugView,
            DebuggerFlagsModel debuggerFlags)
        {
            Debugger      = debugger;
            Console       = console;
            Document      = document;
            DebugDocument = debugDocumentModel;
            DebuggerFlags = debuggerFlags;

            _currentView     = currentView;
            _editorView      = editorView;
            _editorDebugView = editorDebugView;

            _isTaskRunning           = false;
            IsTaskWaitingForInput    = false;
            IsDebuggingMode          = false;
            _cancellationTokenSource = new CancellationTokenSource();

            RunInterpreterCommand  = new RelayCommand(RunInterpreter, () => !_isTaskRunning && !string.IsNullOrEmpty(Document.Text) && !IsDebuggingMode);
            SendInputCommand       = new RelayCommand(SendInput, () => IsTaskWaitingForInput);
            EndCurrentTaskCommand  = new RelayCommand(EndCurrentInterpreterTask, () => _isTaskRunning || IsDebuggingMode);
            NextInstructionCommand = new RelayCommand(NextInstruction, () => !string.IsNullOrEmpty(Document.Text) && !_isTaskRunning);
        }
Exemple #2
0
        public Task ExecuteAsync(DebuggerModel model, string[] parameters)
        {
            var address = uint.Parse(parameters[0]);
            var word    = uint.Parse(parameters[1]);

            return(model.Client.WriteWordAsync(address, word));
        }
        public async Task <IActionResult> Index()
        {
            var debuggerModel = new DebuggerModel();

            try
            {
                var contextData = await _repository.GetLastSnapshot();

                if (contextData != null)
                {
                    UiFlowScreenModel screenModel = contextData.GetCurrentStepData <UiFlowScreenModel>();
                    string            flowHandler = screenModel.FlowHandler;
                    while (screenModel.Metadata.ContainedFlowHandler != null)
                    {
                        contextData = await _repository.Get(screenModel.Metadata.ContainedFlowHandler);

                        screenModel = contextData.GetCurrentStepData <UiFlowScreenModel>();
                        flowHandler = screenModel.FlowHandler;
                    }


                    debuggerModel.FlowHandler = flowHandler;
                }
            }
            catch (Exception ex)
            {
                debuggerModel.Error = $"Possible cause: You need to refresh the page once you have the application with a flow rendered {Environment.NewLine}{ex}";
            }



            return(View(debuggerModel));
        }
 public Task ExecuteAsync(DebuggerModel model, string[] parameters)
 {
     foreach (var command in commands)
     {
         ConsoleColor.Cyan.Write(command.Name);
         ConsoleColor.White.WriteLine($"\t-\t{command.Info}");
     }
     return(Task.CompletedTask);
 }
        public Task ExecuteAsync(DebuggerModel model, string[] parameters)
        {
            var bp = new BreakPointDto
            {
                Name    = parameters[0],
                Address = uint.Parse(parameters[1])
            };

            return(model.Client.AddBreakPointAsync(bp));
        }
 public DebuggerApplication(DebuggerModel model, CommandSet commandSet, CommandResultWriterSet commandResultWriterSet)
 {
     this.model                  = model;
     this.commandSet             = commandSet;
     this.commandResultWriterSet = commandResultWriterSet;
     list = new ListCommand(commandSet.GetAll());
     commandSet.Add(list);
     commandSet.Add(new HelpCommand(commandSet));
     commandSet.Add(new ConnectCommand());
 }
Exemple #7
0
        public void Initialize()
        {
            _document           = new DocumentModel();
            _debugger           = new DebuggerModel();
            _console            = new ConsoleModel();
            _debugDocumentModel = new DebugDocumentModel();
            _debuggerFlags      = new DebuggerFlagsModel();
            _editorView         = null;
            _editorDebugView    = null;
            _currentView        = _editorView;

            _debuggerViewModel = new DebuggerViewModel(_document, _debugDocumentModel, _console, _debugger, _currentView, _editorView, _editorDebugView, _debuggerFlags);
        }
        public MainViewModel()
        {
            _document           = new DocumentModel();
            _debuggerModel      = new DebuggerModel();
            _console            = new ConsoleModel();
            _debugDocumentModel = new DebugDocumentModel();
            _replaceModel       = new ReplaceModel();
            _compilerFlags      = new CompilerFlagsModel();
            _debuggerFlags      = new DebuggerFlagsModel();

            _editorView      = new EditorView();
            _editorDebugView = new EditorDebugView();
            _currentView     = _editorView;

            Editor     = new EditorViewModel(_document);
            File       = new FileViewModel(_document);
            Help       = new HelpViewModel();
            Debugger   = new DebuggerViewModel(_document, _debugDocumentModel, _console, _debuggerModel, _currentView, _editorView, _editorDebugView, _debuggerFlags);
            Compiler   = new CompilerViewModel(_document, _console, _compilerFlags);
            MainWindow = new MainWindowViewModel();
            Replace    = new ReplaceViewModel(_replaceModel, _document);
        }
Exemple #9
0
 public Task ExecuteAsync(DebuggerModel model, string[] parameters)
 {
     return(model.Client.WriteIpAsync(uint.Parse(parameters[0])));
 }
Exemple #10
0
 public Task ExecuteAsync(DebuggerModel model, string[] parameters)
 {
     return(model.Client.ContinueAsync());
 }
 public Task ExecuteAsync(DebuggerModel model, string[] parameters)
 {
     return(model.Client.RemoveBreakPointAsync(parameters[0]));
 }
Exemple #12
0
 public async Task ExecuteAsync(DebuggerModel model, string[] parameters)
 {
     Result = await model.Client.GetDebugModeAsync().ConfigureAwait(false);
 }
Exemple #13
0
 public Task ExecuteAsync(DebuggerModel model, string[] parameters)
 {
     return(model.Client.SetDebugModeAsync((DebugMode)Enum.Parse(typeof(DebugMode), parameters[0])));
 }