Example #1
0
 private void AddTextSeries(out Series s, out int c, out int sdi)
 {
     s       = TextSeries.ReadFromFile(textFileName);
     s.Units = "cfs";
     //s.Table.TableName = "ts"+;
     c = s.Count;
     Assert.IsTrue(s.Count > 0);
     sdi = db.AddSeries(s);
 }
Example #2
0
 /// <summary>
 /// Import a text file into an existing series
 /// </summary>
 private void importTextFile_Click(object sender, EventArgs e)
 {
     if (openTextFileDialog.ShowDialog() == DialogResult.OK)
     {
         Series s = TextSeries.ReadFromFile(openTextFileDialog.FileName);
         if (s.Count == 0)
         {
             MessageBox.Show("No data found in file:" + openTextFileDialog.FileName);
             return;
         }
         if (s.Count > 0)
         {
             DB.UpdateTimeSeriesTable(tree1.SelectedID, s, true);
         }
     }
 }
Example #3
0
        /// <summary>
        /// Creates a new series from a text file
        /// </summary>
        void AddTextFileClick(object sender, System.EventArgs e)
        {
            if (openTextFileDialog.ShowDialog() == DialogResult.OK)
            {
                Series s = TextSeries.ReadFromFile(openTextFileDialog.FileName);
                if (s.Count == 0)
                {
                    MessageBox.Show("No data found in file:" + openTextFileDialog.FileName);
                    return;
                }

                if (s.Count > 0)
                {
                    DB.AddSeries(s, CurrentFolder);
                }
            }
        }
Example #4
0
        /// <summary>
        /// Creates a new series from a text file
        /// </summary>
        void newTextFile_Click(object sender, System.EventArgs e)
        {
            if (openTextFileDialog.ShowDialog() == DialogResult.OK)
            {
                Series s = TextSeries.ReadFromFile(openTextFileDialog.FileName);

                if (s.Count == 0)
                {
                    MessageBox.Show("No data found in file:" + openTextFileDialog.FileName);
                    return;
                }


                if (s.Count > 0)
                {
                    DB.AddSeries(s, tree1.SelectedID);
                    tree1.RefreshTree();
                }
            }
        }
Example #5
0
        /// <summary>
        /// Creates a new series from a text file
        /// </summary>
        void AddTextFileClick(object sender, System.EventArgs e)
        {
            if (openTextFileDialog.ShowDialog() == DialogResult.OK)
            {
                foreach (string filename in openTextFileDialog.FileNames)
                {
                    Series s = TextSeries.ReadFromFile(filename);
                    if (s.Count == 0)
                    {
                        MessageBox.Show("No data found in file:" + filename);
                        continue;
                    }

                    if (s.Count > 0)
                    {
                        DB.AddSeries(s, CurrentFolder);
                    }
                }
            }
        }
Example #6
0
        public void TestBrnleeStor()
        {
            string plantName = "BRNLEE";
            string dataType  = "ENDSTO";

            string fnMdb = TestData.DataPath + "\\BpaHydsim\\Supp_A1F450.mdb";
            string fnCsv = TestData.DataPath + "\\BpaHydsim\\BRNLEE_ENDSTO.csv";

            BpaHydsimSeriesAccess sMdb = new BpaHydsimSeriesAccess(fnMdb, plantName, dataType);

            sMdb.Read();
            Series sCsv = TextSeries.ReadFromFile(fnCsv);

            Assert.AreEqual(sMdb.Count, sCsv.Count, "wrong number of time steps");
            for (int i = 0; i < sMdb.Count; i++)
            {
                Assert.AreEqual(sMdb[i].Value, sCsv[i].Value);
            }
            Assert.AreEqual(Math.Sum(sMdb), Math.Sum(sCsv));
        }
Example #7
0
        public void TestBrnleeQout()
        {
            string plantName = "BRNLEE";
            string dataType  = "QOUT";

            string fnMdb = Path.Combine(TestData.DataPath, "BpaHydsim", "Supp_A1F450.mdb");
            string fnCsv = Path.Combine(TestData.DataPath, "BpaHydsim", "BRNLEE_QOUT.csv");

            BpaHydsimSeriesAccess sMdb = new BpaHydsimSeriesAccess(fnMdb, plantName, dataType);

            sMdb.Read();
            Series sCsv = TextSeries.ReadFromFile(fnCsv);

            Assert.AreEqual(sMdb.Count, sCsv.Count, "wrong number of time steps");
            for (int i = 0; i < sMdb.Count; i++)
            {
                Assert.AreEqual(sMdb[i].Value, sCsv[i].Value);
            }
            Assert.AreEqual(Math.Sum(sMdb), Math.Sum(sCsv));
        }