Exemple #1
0
        public override void PrepareProcessing()
        {
            if (_editor != null && !_editor.IsDisposed && _editor.Edited)
            {
                _editor.AskForSave();
            }

            if (_ctx == null)
            {
                throw new Exception("Python code has errors");
            }

            try {
                _ctx.Call("prepare", new PyObject[0]);
            }
            catch (PyException e) {
                DisplayPythonError(e);
                throw;
            }

            foreach (var port in InputPorts.OfType <NodeSystemLib2.FormatData1D.InputPortData1D>())
            {
                port.PrepareProcessing();
            }

            foreach (var port in OutputPorts.OfType <NodeSystemLib2.FormatData1D.OutputPortData1D>())
            {
                port.PrepareProcessing();
            }
        }
Exemple #2
0
 public override void Process()
 {
     try {
         _ctx?.Call("process", new PyObject[0]);
     }
     catch (PyException e) {
         DisplayPythonError(e);
         throw;
     }
 }