コード例 #1
0
        private void CreateOperation(object param)
        {
            if (param == null)
            {
                return;
            }
            OperationNode currentNode = GetCurrentNode(operationNodes);

            if (currentNode == null && operationNodes.Count != 0)
            {
                currentNode = operationNodes[0];
            }

            OperationNode newOpeartionNode = null;

            switch (param.ToString())
            {
            case "experiment":
                CreateExperimentNode();
                break;

            case "general_Param":
                newOpeartionNode = new FastScanParamOperationNode("FastScan Param");
                break;

            case "data":
                newOpeartionNode = new DataOperationNode("Data");
                break;

            case "background_data":
                newOpeartionNode = new BackgroundDataOperationNode("Background Data");
                break;

            case "sample":
                newOpeartionNode = new SampleOperationNode("Administrator 01");
                break;

            case "scan":
                newOpeartionNode = new FinchScanOperationNode("Scan");
                break;

            case "trigger":
                newOpeartionNode = new TriggerOperationNode("Trigger");
                break;

            case "temperature":
                newOpeartionNode = new TemperatureOperationNode("Peltier");
                break;

            case "temperatureScan":
                newOpeartionNode = new PeltierScanOperationNode("PeltierScan");
                break;

            case "time":
                newOpeartionNode = new TimeOperationNode("Time");
                break;

            case "microplatereader":
                newOpeartionNode = new MPROperationNode("Microplate Reader");
                break;

            case "wavelength":
                newOpeartionNode = new WaveLengthOperationNode("Wave Length");
                break;
            }

            if (newOpeartionNode != null)
            {
                currentNode.Children.Add(newOpeartionNode);
                newOpeartionNode.ParentNode = currentNode;
                currentNode.IsExpanded      = true;
                newOpeartionNode.IsSelected = true;
            }
        }
コード例 #2
0
        public OperationNode GenerateOperationNodeTree(Operation operation)
        {
            if (operation == null)
            {
                return(null);
            }
            OperationNode operationNode = null;

            if (operation.GetType() == typeof(BackgroundDataOperation))
            {
                operationNode = new BackgroundDataOperationNode(operation as BackgroundDataOperation);
            }
            else if (operation.GetType() == typeof(DataOperation))
            {
                operationNode = new DataOperationNode(operation as DataOperation);
            }
            else if (operation.GetType() == typeof(ExperimentOperation))
            {
                operationNode = new ExperimentOperationNode(operation as ExperimentOperation);
            }
            else if (operation.GetType() == typeof(FastScanParamOperation))
            {
                operationNode = new FastScanParamOperationNode(operation as FastScanParamOperation);
            }
            else if (operation.GetType() == typeof(MPROperation))
            {
                operationNode = new MPROperationNode(operation as MPROperation);
            }
            else if (operation.GetType() == typeof(SampleOperation))
            {
                operationNode = new SampleOperationNode(operation as SampleOperation);
            }
            else if (operation.GetType() == typeof(TemperatureOperation))
            {
                operationNode = new TemperatureOperationNode(operation as TemperatureOperation);
            }
            else if (operation.GetType() == typeof(TimeOperation))
            {
                operationNode = new TimeOperationNode(operation as TimeOperation);
            }
            else if (operation.GetType() == typeof(TriggerOperation))
            {
                operationNode = new TriggerOperationNode(operation as TriggerOperation);
            }
            else if (operation.GetType() == typeof(WaveLengthOperation))
            {
                operationNode = new WaveLengthOperationNode(operation as WaveLengthOperation);
            }
            else if (operation.GetType() == typeof(FinchScanOperation))
            {
                operationNode = new FinchScanOperationNode(operation as FinchScanOperation);
            }
            else if (operation.GetType() == typeof(PeltierScanOperation))
            {
                operationNode = new PeltierScanOperationNode(operation as PeltierScanOperation);
            }
            foreach (Operation childOperation in operation.ChildOperations)
            {
                OperationNode childOperationNode = GenerateOperationNodeTree(childOperation);
                if (childOperationNode != null && operationNode != null)
                {
                    operationNode.Children.Add(childOperationNode);
                }
            }
            return(operationNode);
        }