public WaveFormPlayerViewModel(string displayName, string groupName, int initialFrequency,
                                       SignalGeneratorType signalType, int duration)
            : base(displayName, groupName)
        {
            _frequency       = initialFrequency;
            _signalType      = signalType;
            _streamGenerator = new StreamGenerator();

            Duration = duration;
        }
Exemple #2
0
        public void Should_be_able_to_get_the_description_from_the_update()
        {
            var reader = new NAppUpdate.Framework.FeedReaders.AppcastReader();

            using (Stream s = StreamGenerator.GenerateStreamFromString(ZuneUpdateFeed))
            {
                var updates = reader.Read(s);
                Assert.AreEqual(1, updates.Count());
                Assert.AreEqual(".WMA Support and other minor bug fixes", updates.First().Description);
            }
        }
Exemple #3
0
        public void HappyFlow()
        {
            StreamGenerator sut = new StreamGenerator(12345, 'A');

            byte[] actual = StreamReader.ReadAll(sut);

            Assert.AreEqual(12345, actual.Length);
            for (int i = 0; i < actual.Length; i++)
            {
                if (actual[i] != 'A')
                {
                    Assert.Fail("Incorrect data in the stream");
                }
            }
        }
Exemple #4
0
 private void ReadWavFile(Client client, string WavFileName, ref IStream stream)
 {
     try
     {
         using (DirectWave wav = new DirectWave(Main.ResourceDirectory + WavFileName, FileMode.Open, FileAccess.Read, FileShare.Read))
         {
             PCMParam pcmp = wav.readParameter();
             client.IsFormatSupported(pcmp);
             stream = StreamGenerator.GenerateStream(pcmp, wav.readSamplesData());
         }
     }
     catch (Exception e)
     {
         Trace.WriteLine(string.Format("{0} のロードに失敗しました.例外情報:{1}", WavFileName, e.ToString()));
     }
 }
Exemple #5
0
        public void TestIsCorrectStreamGeneration(string requestType)
        {
            List <Order> collection = new List <Order>()
            {
                new Order()
                {
                    CustomerId  = "testID",
                    OrderDate   = Convert.ToDateTime("06-06-1998"),
                    Id          = 1,
                    ShipAddress = "test address"
                }
            };
            StreamGenerator generator = new StreamGenerator(collection);

            Assert.IsNotNull(generator.GenerateStreamByContentType(requestType, out string responseType));
        }
        static void Main(string[] args)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json");

            IConfiguration config = builder.Build();

            // This is the number of unique patients to generate
            var numberOfPatients = 1;

            // Whether or not to write directly to event hub output source for function triggers
            bool byPass = true;

            string eventHubConnectionString      = config.GetConnectionString("EventHubConnection");
            string eventHubTopicTotals           = config.GetConnectionString("EventHubNameTotals");
            string eventHubTopicTemperature      = config.GetConnectionString("EventHubNameTemperature");
            string eventHubTopicPulseAndPressure = config.GetConnectionString("EventHubNamePulseAndPressure");
            string eventHubTopicJobInfo          = config.GetConnectionString("EventHubNameJobInfo");

            var generator = new StreamGenerator(numberOfPatients, eventHubConnectionString, eventHubTopicTotals, eventHubTopicTemperature, eventHubTopicPulseAndPressure, eventHubTopicJobInfo);


            if (false == byPass)
            {
                Console.WriteLine("Generating Patient Stream Data to Event Hub 3 Input Sources ...");

                generator.generatePatientValueRanges();
            }
            else
            {
                Console.WriteLine("Bypassing multiple input sources and writing directly to output event hub ...");

                generator.generateByPass();
            }

            generator.Close();

            Console.WriteLine("\n");
            Console.Write("Data Generation Completed ....\n\n\n");
        }
        public void NauReaderCanReadFeed1()
        {
            const string NauUpdateFeed =
                @"<?xml version=""1.0"" encoding=""utf-8""?>
<Feed>
  <Title>My application</Title>
  <Link>http://myapp.com/</Link>
  <Tasks>
    <FileUpdateTask localPath=""test.dll"" updateTo=""remoteFile.dll"">
      <Description>update details</Description>
      <Conditions>
        <FileExistsCondition localPath=""otherFile.dll"" />
      </Conditions>
    </FileUpdateTask>
  </Tasks>
</Feed>";

            var reader = new NAppUpdate.Framework.FeedReaders.NauXmlFeedReader();

            using (Stream s = StreamGenerator.GenerateStreamFromString(NauUpdateFeed))
            {
                IList <IUpdateTask> updates = reader.Read(s);

                Assert.IsTrue(updates.Count == 1);

                var task = updates[0] as FileUpdateTask;
                Assert.IsNotNull(task);
                Assert.IsFalse(task.CanHotSwap);
                Assert.AreEqual("test.dll", task.LocalPath);
                Assert.AreEqual("remoteFile.dll", task.UpdateTo);
                Assert.IsNull(task.Sha256Checksum);
                Assert.IsNotNull(task.Description);

                Assert.AreEqual(1, task.UpdateConditions.ChildConditionsCount);

                var cnd = task.UpdateConditions.Degrade() as FileExistsCondition;
                Assert.IsNotNull(cnd);
                Assert.AreEqual("otherFile.dll", cnd.LocalPath);
            }
        }
 public UIAbstractionFacade(StreamGenerator musicGenerator, MusicPlayingFacade musicPlayingFacade)
 {
     this.musicGenerator = musicGenerator;
     this.musicPlayingFacade = musicPlayingFacade;
     this.musicStream = null;
 }