Esempio n. 1
0
        private void butSettings_Click(object sender, EventArgs e)
        {
            var fc = new FormConfig(Cfg);

            if (fc.ShowDialog() == DialogResult.OK)
            {
                Cfg = fc.GetDialogData();
                PolyConfig.SaveConfig(Cfg);
                UpdateGraphics();
            }
            fc.Dispose();
        }
Esempio n. 2
0
 private void butNewRecord_Click(object sender, EventArgs e)
 {
     saveFileDialog1.FileName         = "";
     saveFileDialog1.InitialDirectory = Cfg.DataDir.ToString();
     saveFileDialog1.Filter           = "Text files | *.txt|All files | *.*";
     if (saveFileDialog1.ShowDialog() == DialogResult.OK)
     {
         Cfg.DataDir = Path.GetDirectoryName(saveFileDialog1.FileName) + @"\";
         PolyConfig.SaveConfig(Cfg);
         CurrentFile      = Path.GetFileName(saveFileDialog1.FileName);
         labFileName.Text = "File: " + CurrentFile;
     }
 }
Esempio n. 3
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (decomposer != null)
     {
         if (Connected & decomposer.DeviceTurnedOn)
         {
             USBPort.WriteByte(PolyConstants.cmStopPump1);
             USBPort.WriteByte(PolyConstants.cmStopPump2);
         }
     }
     Cfg.Maximized    = WindowState == FormWindowState.Maximized;
     Cfg.WindowWidth  = Width;
     Cfg.WindowHeight = Height;
     PolyConfig.SaveConfig(Cfg);
 }
Esempio n. 4
0
        private void butOpenFile_Click(object sender, EventArgs e)
        {
            openFileDialog1.FileName         = "";
            openFileDialog1.InitialDirectory = Cfg.DataDir.ToString();
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                if (File.Exists(openFileDialog1.FileName))
                {
                    Cfg.DataDir = Path.GetDirectoryName(openFileDialog1.FileName) + @"\";
                    PolyConfig.SaveConfig(Cfg);
                    ViewMode          = true;
                    ViewShift         = 0;
                    timerRead.Enabled = false;

                    CurrentFile = Path.GetFileName(openFileDialog1.FileName);
                    ReadFile(Cfg.DataDir + CurrentFile);
                }
            }
        }
Esempio n. 5
0
 private void butStopRecord_Click(object sender, EventArgs e)
 {
     StopRecord();
     Cfg.DataFileNum++;
     PolyConfig.SaveConfig(Cfg);
 }