Ejemplo n.º 1
0
        /// <summary>
        /// Plot an array of samples.
        /// </summary>
        /// <param name="Samples">The array of samples to plot</param>
        public void Plot(SamplePlot Samples)
        {
            int i           = 0;
            int sampleTicks = 0;

            Signals = new List <SampleSignal> [Samples.SampleSignals.Length];

            foreach (List <SampleSignal> sampleList in Samples.SampleSignals)
            {
                if (i == 0)
                {
                    // Find the duration of the first sample (they are all equal).
                    foreach (SampleSignal ss in sampleList)
                    {
                        sampleTicks += ss.Duration;
                    }

                    totalSampleTicks = sampleTicks;
                }
                Signals[i++] = sampleList;
            }

            // Set the scrollbar.
            // NOTE: This could overflow if the ticks are too large.
            hScrollBar1.Maximum = totalSampleTicks;
            hScrollBar1.Value   = 0;
            Invalidate();
        }
        public ActionResult DeleteConfirmed(Guid id)
        {
            SamplePlot samplePlot = db.SamplePlots.Find(id);

            db.SamplePlots.Remove(samplePlot);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Broadcast a plot event to anyone who's listening
        /// </summary>
        /// <param name="samples"></param>
        private void BroadcastPlot(SamplePlot samples)
        {
            EventHandler <PlotEventArgs> handler = OnPlot;

            if (handler != null)
            {
                handler(this, new PlotEventArgs(samples));
            }
        }
 public ActionResult Edit([Bind(Include = "SPlotID,SPlotNo,Date,Latitude,Longitude,Technician,GPSDevice,PlotSize,Layer,Genus,Species,Substrate,PctCover,HtClass,Nativity,MIndex,WIndex,PrairieCohort,RareSpecies,FocalSpecies,Comments,LayerID,TransectID")] SamplePlot samplePlot)
 {
     if (ModelState.IsValid)
     {
         db.Entry(samplePlot).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(samplePlot));
 }
        // GET: SamplePlots/Delete/5
        public ActionResult Delete(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SamplePlot samplePlot = db.SamplePlots.Find(id);

            if (samplePlot == null)
            {
                return(HttpNotFound());
            }
            return(View(samplePlot));
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Creates and initializes a PlotEventArgs object.
 /// </summary>
 /// <param name="Samples">A SamplePlot object representing several arrays of samples</param>
 public PlotEventArgs(SamplePlot Samples)
 {
     this.Samples = Samples;
 }