示例#1
0
 // 默认参数辅助函数:恢复默认值
 private void getDefault()
 {
     Source_LorC_TB.Text    = ConfigAppSettings.GetValue("Source_LorC");
     VCB_C_TB.Text          = ConfigAppSettings.GetValue("VCB_C");
     Discharge_R_TB.Text    = ConfigAppSettings.GetValue("Discharge_R");
     ZeroCrossing_C_TB.Text = ConfigAppSettings.GetValue("ZeroCrossing_C");
     ZeroCrossing_L_TB.Text = ConfigAppSettings.GetValue("ZeroCrossing_L");
     ThyristorTime_TB.Text  = ConfigAppSettings.GetValue("ThyristorTime");
 }
示例#2
0
        // 默认参数辅助函数:读取文本框参数,设置默认值
        private int setDefault()
        {
            ParaItems tempResult = getItemsFromTextBox();

            if (!tempResult.isValid)
            {
                return(-1);
            }

            ConfigAppSettings.SetValue("Source_LorC", tempResult.Source_LorC.ToString());
            ConfigAppSettings.SetValue("VCB_C", tempResult.VCB_C.ToString());
            ConfigAppSettings.SetValue("Discharge_R", tempResult.Discharge_R.ToString());
            ConfigAppSettings.SetValue("ThyristorTime", tempResult.ThyristorTime.ToString());

            ConfigAppSettings.SetValue("ZeroCrossing_C", (tempResult.ZeroCrossing_C * 1e3).ToString());
            ConfigAppSettings.SetValue("ZeroCrossing_L", (tempResult.ZeroCrossing_L * 1e6).ToString());

            return(0);
        }