Exemple #1
0
        public IObservable<object> Execute(IObservable<Tuple<string, string>> stream)
        {
            var confidenceParser = new JsonDoubleValueParser("confidence");
            var faces =
                stream.Where(t => t.Item1 == "faces")
                      .Select(t => t.Item2)
                      .Select(confidenceParser.Parse);

            var altitudeParser = new JsonDoubleValueParser("altitudeMeters");
            var height = stream
                .Where(t => t.Item1 == "navdata")
                .Select(t => t.Item2)
                .Select(altitudeParser.Parse)
                .Where(d => d > 0.5);

            return faces
                .Where(c => c > 1.4)
                .CombineLatest(height, (f, h) => "Conf: " + f + " && " + h);
        }
Exemple #2
0
        public IObservable <object> Execute(IObservable <Tuple <string, string> > stream)
        {
            var confidenceParser = new JsonDoubleValueParser("confidence");
            var faces            =
                stream.Where(t => t.Item1 == "faces")
                .Select(t => t.Item2)
                .Select(confidenceParser.Parse);

            var altitudeParser = new JsonDoubleValueParser("altitudeMeters");
            var height         = stream
                                 .Where(t => t.Item1 == "navdata")
                                 .Select(t => t.Item2)
                                 .Select(altitudeParser.Parse)
                                 .Where(d => d > 0.5);

            return(faces
                   .Where(c => c > 1.4)
                   .CombineLatest(height, (f, h) => "Conf: " + f + " && " + h));
        }