Exemple #1
0
 public override void PrepareProcessing()
 {
     _active = TristateActive.Inactive;
     _portIn.PrepareProcessing();
     _portThreshHigh.PrepareProcessing();
     _portThreshLow.PrepareProcessing();
     _portOut.PrepareProcessing();
 }
Exemple #2
0
 public override void PrepareProcessing()
 {
     _active             = TristateActive.Inactive;
     _timeBecomeInactive = TimeStamp.Zero;
     _portIn.PrepareProcessing();
     _portThresh.PrepareProcessing();
     _portOut.PrepareProcessing();
 }
        public override void PrepareProcessing()
        {
            _portInp.PrepareProcessing();
            _portOut.PrepareProcessing();

            _bufOut = new TimeLocatedBuffer1D <double>(
                DefaultParameters.DefaultBufferMilliseconds.ToSamples(_portInp.Samplerate), _portInp.Samplerate
                );

            _portInpVal.PrepareProcessing();
        }
Exemple #4
0
        public override void PrepareProcessing()
        {
            _reader?.Dispose();
            try {
                _reader = new System.IO.BinaryReader(System.IO.File.OpenRead(_attrFilePath.TypedGet()));
            } catch (Exception ex) {
                Parent.Context.Notify(new GraphNotification(GraphNotification.NotificationType.Error, ex.ToString()));
                throw;
            }

            if (_reader != null)
            {
                _reader.BaseStream.Seek(0, System.IO.SeekOrigin.Begin);
                _portOut.PrepareProcessing();
                _portTrigger.PrepareProcessing();
                _buffer      = new TimeLocatedBuffer1D <double>(_portOut.Buffer.Capacity, _portOut.Samplerate);
                _endOfStream = false;

                if (_portTrigger.Connection == null)
                {
                    _startTime = new TimeStamp(0);
                }
            }
            else
            {
                throw new Exception("File node: did not specify input");
            }

            _lastStatePosition = 0;

            _sampleSize = _dataTypeSizes[_attrDataType.TypedGet()];

            _sampleGetterFunc = () => {
                throw new System.IO.EndOfStreamException();
            };

            switch (_attrDataType.TypedGet())
            {
            case DataType.Float32:
                _sampleGetterFunc = () => _reader.ReadSingle();
                break;

            case DataType.Float64:
                _sampleGetterFunc = () => _reader.ReadDouble();
                break;

            case DataType.Int16:
                _sampleGetterFunc = () => _reader.ReadInt16();
                break;

            case DataType.Int32:
                _sampleGetterFunc = () => _reader.ReadInt32();
                break;

            case DataType.Int64:
                _sampleGetterFunc = () => _reader.ReadInt64();
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemple #5
0
 public override void PrepareProcessing()
 {
     _portIn.PrepareProcessing();
     _portOut.PrepareProcessing();
 }