Exemple #1
0
        public void StartDataStreaming_FakeCSVParameterSource_ReturnsStubCSV()
        {
            //Arrange
            DataStreaming dataStreaming = new DataStreaming(parameterSource);

            //Act
            string parameters = dataStreaming.Start(2);

            //Assert
            Assert.True(IsFloat(parameters, 0));
        }
Exemple #2
0
        public void LoadDataStreaming_FakeCSVParameterSource_ReturnsStubCSV()
        {
            //Arrange
            DataStreaming dataStreaming = new DataStreaming(parameterSource);

            //Assert
            string filePath   = Directory.GetParent("../../../../") + @"/BatteryDataStream/Data/Parameters.csv";
            string parameters = dataStreaming.Load(filePath);

            //Assert
            Assert.True(IsFloat(parameters, 1));
        }
        static void Main(string[] args)
        {
            _csvParameterSource = new CSVParameterSource();
            _batteryDataStream  = new DataStreaming(_csvParameterSource);
            _batteryDataStream.Load(_filePath);
            if (args.Length > 0 && int.TryParse(args[0], out int result))
            {
                _limitRows = result;
            }

            Console.WriteLine("Streaming is started in csv format(stateofcharge,temperature). Press Ctrl+C to end");
            Console.CancelKeyPress += (sender, eventArgs) =>
            {
                Console.WriteLine("Streaming stop event is triggered");
                cancellationToken.Cancel();
                eventArgs.Cancel = true;
            };

            StartStreaming();
        }
 private Boolean MaskHasFlag(UInt64 mask, DataStreaming flag)
 {
     return (mask & (UInt64)flag) > (Int64)0;
 }
Exemple #5
0
 private Boolean MaskHasFlag(UInt64 mask, DataStreaming flag)
 {
     return((mask & (UInt64)flag) > (Int64)0);
 }