Exemple #1
0
        public Display Execute(string displayHint = null)
        {
            Debug.WriteLine($"beginning execution of {request.action} Request");
            response = new MessageResponse(request);

            // absent actions are added messageRequest sometimes
            switch (request.action)
            {
            case (RequestAction.doNothing):
                Debug.WriteLine($"Doing nothing...");
                break;

            case (RequestAction.scanFolderFast):
                Debug.WriteLine($"Scanning ABF folder (filenames only)...");
                response.AbfFolder = new AbfFolder(request.path);
                break;

            case (RequestAction.scanFolderFull):
                Debug.WriteLine($"Scanning ABF folder (and text files)...");
                break;

            case (RequestAction.modifyCell):
                Debug.WriteLine($"Modifying a cell...");
                break;

            case (RequestAction.modifyExperiment):
                Debug.WriteLine($"Modifying an experiment...");
                break;

            case (RequestAction.analyzeAbf):
                Debug.WriteLine($"Analyzing ABF(s)...");
                break;

            case (RequestAction.analyzeTif):
                Debug.WriteLine($"analyzing TIF(s)...");
                break;

            case (RequestAction.labtalk):
                Debug.WriteLine($"executing labtalk...");
                break;

            default:
                throw new Exception($"Unimplimented action: {request.action}");
            }

            Debug.WriteLine($"Display hint: {displayHint}");
            switch (displayHint)
            {
            case "home":
                displayer = new DisplayHome(response);
                break;

            case "frames":
                displayer = new DisplayFrames(response);
                break;

            case "menu":
                displayer = new DisplayMenu(response);
                break;

            case "cell":
                displayer = new DisplayCell(response);
                break;

            case "labtalk":
                displayer = new DisplayLabtalk(response);
                break;

            default:
                displayer = new DisplayError(response);
                break;
            }

            Debug.WriteLine($"using displayer: {displayer}");
            response.StopwatchStop();
            Debug.WriteLine($"execution completed in {response.elapsedMillisecString} ms");
            return(displayer);
        }
Exemple #2
0
 public DisplayError(MessageResponse response) : base(response)
 {
     Debug.WriteLine($"Creating error display from {response}");
 }
Exemple #3
0
 public DisplayLabtalk(MessageResponse response) : base(response)
 {
     Debug.WriteLine($"Creating labtalk display from {response}");
 }
Exemple #4
0
 public DisplayCell(MessageResponse response) : base(response)
 {
     Debug.WriteLine($"Creating cell display from {response}");
 }
Exemple #5
0
 public DisplayFrames(MessageResponse response) : base(response)
 {
     Debug.WriteLine($"Creating frames display from {response}");
 }
Exemple #6
0
 public DisplayHome(MessageResponse response) : base(response)
 {
     Debug.WriteLine($"Creating home display from {response}");
 }
Exemple #7
0
 public Display(MessageResponse response)
 {
     this.response = response;
 }
Exemple #8
0
 public DisplayMenu(MessageResponse response) : base(response)
 {
     Debug.WriteLine($"Creating menu display from {response}");
 }