Beispiel #1
0
 /// <summary>
 /// This is the constructor for the class. It initializes the datahandler, model and timer.
 /// </summary>
 public Synthesis(MasterGraphPanel graphPanel)
 {
     simulationDataHandler = new DataHandler();
     SimulationModel       = new AmmoniaModel(currentData);
     timer          = new System.Timers.Timer(100);
     timer.Elapsed += this.OnElapsed;
     graphHandlers.Add(new GraphHandler(graphPanel));
 }
Beispiel #2
0
        /// <summary>
        /// This method allows the user to take a snapshot of the graph at a current time and save it as a .png-file
        /// </summary>
        /// <param name="PaneltoPNG"></param>
        public static void saveToImage(MasterGraphPanel PaneltoPNG)
        {
            string[] files      = Directory.GetFiles(path, "*.png");
            int      i          = files.Length + 1;
            Bitmap   tempBitmap = new Bitmap(PaneltoPNG.ClientSize.Width, PaneltoPNG.ClientSize.Height);

            PaneltoPNG.DrawToBitmap(tempBitmap, PaneltoPNG.ClientRectangle);
            tempBitmap.Save(@"SimData\SimulationGraf" + i + ".png", System.Drawing.Imaging.ImageFormat.Png);
        }
Beispiel #3
0
 /// <summary>
 /// Instantiates a new object of the GraphHandler class
 /// </summary>
 /// <param name="graphArea">A reference to the <see cref="P2Graph.MasterGraphPanel"/>, which the GraphHandler controls</param>
 public GraphHandler(MasterGraphPanel graphArea)
 {
     _graphPanel = graphArea;
     InitGraphs();
 }