Exemplo n.º 1
0
        public BuoyList readBuoyData(string _fileName)
        {
            // Call buoy input stream function using _fileName as input
            BuoyList tmpBuoys = new BuoyList();

            tmpBuoys.load(_fileName);

            return(tmpBuoys);
        }
Exemplo n.º 2
0
    /** Copy constructor
     * @param buoy list to be copied from
     */
    public BuoyList(BuoyList a)
    {
        blist = new List <Buoy>();
        int size = a.blist.Count;

        for (int i = 0; i < size; i++)
        {
            blist.Add(a.blist[i]);
        }
    }
Exemplo n.º 3
0
        public MainWindow()
        {
            InitializeComponent();

            // Create a material theme manager and add the form to manage (this)
            MaterialSkinManager materialSkinManager = MaterialSkinManager.Instance;

            materialSkinManager.AddFormToManage(this);
            materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;

            // Configure color schema
            materialSkinManager.ColorScheme = new ColorScheme(
                Primary.Blue400, Primary.LightBlue900,
                Primary.Blue500, Accent.Cyan700,
                TextShade.WHITE
                );

            /***** Trigger updateButton_click Event *****/
            string pathToSolution = @"C:\Users\User\Code\LabRatsProject\VisualStudio\NOAA_Monitor\VSProjectFiles";

            // Run python webscraping script
            run_cmd(pathToSolution + @"\scrape_NOAA_buoy.py");

            // Add timestamp to buoy data file name
            string updatedDataFile = timestampFile(pathToSolution + @"\bin\Debug\tmp.txt");

            // Read in new Buoy data
            Stations = readBuoyData(updatedDataFile);

            // Re-populate buoy data
            string stationNames =
                "PSBM1 CFWM1 44027 ATGM1 44034" +
                "MDRM1 44037 44033 MISM1 44032" +
                "44005 CASM1 44007 44030 WEQM1 WEXM1 WELM1";

            List <Buoy> .Enumerator stationIter = Stations.blist.GetEnumerator();
            Buoy tmpStation = new Buoy();

            ColumnHeader columnHeader1 = new ColumnHeader();

            columnHeader1.Text = "Station List";
            this.stationList.Columns.AddRange(new ColumnHeader[] { columnHeader1 });
            while (stationIter.MoveNext())
            {
                tmpStation = stationIter.Current;
                if (stationNames.Contains(tmpStation.getbname()) && !String.IsNullOrEmpty(tmpStation.getbname()))
                {
                    ListViewItem stationNameItems = new ListViewItem(tmpStation.getbname());
                    stationList.Items.Add(stationNameItems);
                }
            }
            stationList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
        }
Exemplo n.º 4
0
        /**
         * This is the constructor for the graphForm class
         * @param tmp is a temporary variable to transfer a BuoyList variable into the space of this class to be used for graphing
         **/
        public graphForm(BuoyList tmp)
        {
            Stations = new BuoyList(tmp);
            InitializeComponent();

            comboBox1.Items.Add("Wind Speed");
            comboBox1.Items.Add("Wind Direction");
            comboBox1.Items.Add("Dominant Wave");
            comboBox1.Items.Add("Average Wave Time");
            comboBox1.Items.Add("Sea Pressure");
            comboBox1.Items.Add("Air Temperature");
            comboBox1.Items.Add("Sea Temperature");
            comboBox1.Items.Add("Dew Temperature");
            comboBox1.Items.Add("Visibility");
            comboBox1.Items.Add("Tide Height");
        }
Exemplo n.º 5
0
        private void updateButton_Click(object sender, EventArgs e)
        {
            string pathToSolution = @"C:\Users\User\Code\LabRatsProject\VisualStudio\NOAA_Monitor\VSProjectFiles";

            // Run python webscraping script
            run_cmd(pathToSolution + @"\scrape_NOAA_buoy.py");

            // Add timestamp to buoy data file name
            string updatedDataFile = timestampFile(pathToSolution + @"\bin\Debug\tmp.txt");

            // Read in new Buoy data
            Stations = readBuoyData(updatedDataFile);

            // Re-populate buoy data
            string stationNames =
                "PSBM1 CFWM1 44027 ATGM1 44034 " +
                "MDRM1 44037 44033 MISM1 44032 " +
                "44005 CASM1 44007 44030 WEQM1 WEXM1 WELM1";

            List <Buoy> .Enumerator stationIter = Stations.blist.GetEnumerator();
            Buoy tmpStation = new Buoy();

            ColumnHeader columnHeader1 = new ColumnHeader();

            columnHeader1.Text = "Station List";
            this.stationList.Columns.AddRange(new ColumnHeader[] { columnHeader1 });
            while (stationIter.MoveNext())
            {
                tmpStation = stationIter.Current;
                if (stationNames.Contains(tmpStation.getbname()) && !String.IsNullOrEmpty(tmpStation.getbname()))
                {
                    ListViewItem stationNameItems = new ListViewItem(tmpStation.getbname());
                    stationList.Items.Add(stationNameItems);
                }
            }

            stationList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
        }