private void btnOK_Click(object sender, EventArgs e)
        {
            GeneralSettingMeta meta = GeneralSettings.GetInstance().GetSettingMeta();

            //meta.DispenseInterval = (int)numDripInter.Value;
            meta.MoveSpeed           = float.Parse(txtMoveSpd.Text.Trim());
            meta.AutoConnect         = ckbAutoConnect.Checked;
            meta.OutputCommandLog    = ckbEnableCmdLog.Checked;
            meta.OutputStsCommandLog = ckbEnableStsCmdLog.Checked;
            meta.PipettingSpeed      = int.Parse(txtPipettingSpeed.Text);
            bool retVal = GeneralSettings.GetInstance().Save();

            if (retVal)
            {
                StatusBar.DisplayMessage(MessageType.Info, "设置成功!");
                if (VsmdController.GetVsmdController().IsInitialized())
                {
                    VsmdController.GetVsmdController().SetOutputCommandLogFlag(meta.OutputCommandLog);
                }

                this.Close();
            }
            else
            {
                StatusBar.DisplayMessage(MessageType.Error, "设置失败!");
            }
        }
Esempio n. 2
0
 public void InitDefaultSetting()
 {
     m_settingMeta = new GeneralSettingMeta();
     m_settingMeta.DripInterval     = 5000;
     m_settingMeta.MoveSpeed        = 500.0f;
     m_settingMeta.AutoConnect      = false;
     m_settingMeta.OutputCommandLog = false;
 }
        private void InitFormData()
        {
            GeneralSettingMeta meta = GeneralSettings.GetInstance().GetSettingMeta();

            //numDripInter.Value = (decimal)meta.DispenseInterval;
            txtPipettingSpeed.Text     = meta.PipettingSpeed.ToString();
            txtMoveSpd.Text            = meta.MoveSpeed.ToString();
            ckbAutoConnect.Checked     = meta.AutoConnect;
            ckbEnableCmdLog.Checked    = meta.OutputCommandLog;
            ckbEnableStsCmdLog.Checked = meta.OutputStsCommandLog;
        }
        public void LoadGeneralSettings()
        {
            string filePath = GetSettingFilePath();

            if (!File.Exists(filePath))
            {
                InitDefaultSetting();
                return;
            }
            string str = File.ReadAllText(filePath);

            if (string.IsNullOrWhiteSpace(str.Trim()))
            {
                InitDefaultSetting();
                return;
            }
            m_settingMeta = JsonConvert.DeserializeObject <GeneralSettingMeta>(str);
        }