コード例 #1
0
        public void timer_tick(object source, EventArgs e)
        {
            //
            saveTimerTick++;
            if (saveTimerTick == 3)
            {
                new Thread(() =>
                {
                    System.IO.File.WriteAllText(savePath + @"\" + "tempAntiCrashLog.txt", Parsing.GetData(port, listOfPoints));
                }).Start();
            }
            counterTimer++;
            if (counterTimer > 4 && atLeastOnePointPassed)
            {
                counterTimer          = 0;
                atLeastOnePointPassed = false;
                everySecond.Enabled   = false;//Сохранение текстового файла автоматом
                everySecond           = null;
                firstValue            = false;
                xMin = 0;
                try
                {
                    Bitmap   imageOfGraph = planeGraph.GraphPane.GetImage();
                    Graphics g            = Graphics.FromImage(imageOfGraph);
                    Bitmap   temp         = imageOfGraph;
                    temp.Save(Parsing.CheckForDuplicateImage(savePath, savePath, GraphName + "original"), System.Drawing.Imaging.ImageFormat.Bmp);
                }
                catch (Exception ex) { MessageBox.Show(ex.ToString()); }


                FileOperations.saveTextFile(Parsing.CheckForDuplicateTXT(savePath + @"\" + GraphName + ".txt", defaultPath, GraphName), port, listOfPoints);
                if (InvokeRequired)
                {
                    this.Invoke(new Action(() => DrawLinearPart()));
                    return;
                }
            }
        }
コード例 #2
0
 private void sensitivityTB_KeyPress(object sender, KeyPressEventArgs e)
 {
     Parsing.checkForDouble(e);
 }