public void OnBtK() { if (m_fAnimTime > 0.0f) { return; } COneParameterConfig jNow = new COneParameterConfig(); jNow.m_fDefaultMin = m_pParameter.m_fKMin; jNow.m_fDefaultMax = m_pParameter.m_fKMax; jNow.m_fMin = m_pConfigSimulation.m_ConfigK.m_fMin; jNow.m_fMax = m_pConfigSimulation.m_ConfigK.m_fMax; jNow.m_sImage = m_pParameter.m_sKImage; jNow.m_bEnableImage = m_pConfigSimulation.m_ConfigK.m_bEnableImage; jNow.m_bEnableMax = m_pConfigSimulation.m_ConfigK.m_bEnableMax; CDetailDialogConfig dialog = new CDetailDialogConfig(); dialog.m_sMsg = "结果K=a + (b-a) x 图片灰度\n图片灰度黑色为0,白色为1"; dialog.m_Config = jNow; dialog.m_sImageFolder = "Mask"; dialog.m_pCallback = OnChangeK; m_pOwner.ShowDetailChoose(dialog); }
private static void ConfigOneTab(Image tab, Text txt, Slider min, Slider max, Button detal, COneParameterConfig config, string sHead) { tab.color = config.m_bEnable ? m_cTabEnable : m_cTabDisable; txt.text = string.Format("{5}:{0:0.00}+({1:0.00}{3}{4:0.00})*{2}", config.m_fDefaultMin, config.m_fDefaultMax, config.m_sImage, config.m_fDefaultMin < 0.0f ? "+" : "-", Mathf.Abs(config.m_fDefaultMin), sHead ); min.minValue = config.m_fMin; min.maxValue = config.m_fMax; min.value = config.m_fDefaultMin; max.minValue = config.m_fMin; max.maxValue = config.m_fMax; max.value = config.m_fDefaultMax; min.interactable = config.m_bEnable; max.interactable = config.m_bEnableMax; detal.interactable = config.m_bEnable; }
private static CUIPageConfigSimulate GetExp1() { CUIPageConfigSimulate config = new CUIPageConfigSimulate(); COneParameterConfig alpha = new COneParameterConfig(); alpha.m_fDefault = 0.2f; alpha.m_bEnable = false; COneParameterConfig step = new COneParameterConfig(); step.m_fDefault = 0.1f; step.m_bEnable = false; COneParameterConfig j = new COneParameterConfig(); j.m_fDefaultMin = 1.0f; j.m_sImage = "0"; j.m_bEnable = false; COneParameterConfig d = new COneParameterConfig(); d.m_fDefaultMin = 0.2f; d.m_sImage = "0"; d.m_bEnable = true; d.m_bEnableMax = false; d.m_bEnableImage = false; COneParameterConfig b = new COneParameterConfig(); b.m_fDefaultMin = 0.0f; b.m_sImage = "0"; b.m_bEnable = true; b.m_bEnableMax = false; b.m_bEnableImage = false; COneParameterConfig k = new COneParameterConfig(); k.m_fDefaultMin = 0.0f; k.m_sImage = "0"; k.m_bEnable = false; k.m_bEnableMax = false; k.m_bEnableImage = false; COneParameterConfig el = new COneParameterConfig(); el.m_bEnable = false; COneParameterConfig bound = new COneParameterConfig(); bound.m_sImage = "Open"; bound.m_bEnable = false; config.m_sTitle = "实验1:Skyrmion相变"; config.m_sConfiguration = "Noise"; config.m_ConfigAlpha = alpha; config.m_ConfigStep = step; config.m_ConfigBoundary = bound; config.m_ConfigJ = j; config.m_ConfigD = d; config.m_ConfigB = b; config.m_ConfigK = k; config.m_ConfigElect = el; return config; }
public void OnDetailDialogOK() { HideDialog(EDialog.Detail); if (null != m_pDetailConfig.m_pCallback) { COneParameterConfig newcfg = new COneParameterConfig(); newcfg.m_fDefaultMin = UISimulate.TryParse(m_inDetailA.text, m_pDetailConfig.m_Config.m_fDefaultMin, m_pDetailConfig.m_Config.m_fMin, m_pDetailConfig.m_Config.m_fMax); newcfg.m_fDefaultMax = UISimulate.TryParse(m_inDetailB.text, m_pDetailConfig.m_Config.m_fDefaultMax, m_pDetailConfig.m_Config.m_fMin, m_pDetailConfig.m_Config.m_fMax); newcfg.m_sImage = m_pDetailConfig.m_Config.m_sImage; m_pDetailConfig.m_pCallback(newcfg); } }
private void OnChangeK(COneParameterConfig change) { m_pParameter.m_fKMin = change.m_fDefaultMin; m_pParameter.m_fKMax = change.m_fDefaultMax; m_sliderKMin.SetValueWithoutNotify(m_pParameter.m_fKMin); m_sliderKMax.SetValueWithoutNotify(m_pParameter.m_fKMax); m_pParameter.m_sKImage = change.m_sImage; m_txtK.text = string.Format("K:{0:0.00}+({1:0.00}{3}{4:0.00})*{2}", m_pParameter.m_fKMin, m_pParameter.m_fKMax, m_pParameter.m_sKImage, m_pParameter.m_fKMin < 0.0f ? "+" : "-", Mathf.Abs(m_pParameter.m_fKMin) ); }
public static CUIPageConfigSimulate GetDefault() { COneParameterConfig alpha = new COneParameterConfig { m_sImage = "", m_bEnable = true, m_bEnableMax = true, m_bEnableImage = true, m_fDefault = 0.2f, m_fMin = 0.0001f, m_fMax = 3.0f, m_fDefaultMax = 3.0f, m_fDefaultMin = 0.0001f }; COneParameterConfig step = new COneParameterConfig { m_sImage = "", m_bEnable = true, m_bEnableMax = true, m_bEnableImage = true, m_fDefault = 0.1f, m_fMin = 0.000001f, m_fMax = 1.0f, m_fDefaultMax = 0.1f, m_fDefaultMin = 0.000001f }; COneParameterConfig boundary = new COneParameterConfig { m_sImage = "Periodic", m_bEnable = true, m_bEnableMax = true, m_bEnableImage = true, m_fDefault = 0.1f, m_fMin = 0.0001f, m_fMax = 1.0f, m_fDefaultMax = 1.0f, m_fDefaultMin = 0.0001f }; COneParameterConfig cfgj = new COneParameterConfig { m_sImage = "0", m_bEnable = true, m_bEnableMax = true, m_bEnableImage = true, m_fDefault = 1.0f, m_fMin = -10.0f, m_fMax = 10.0f, m_fDefaultMax = 0.0f, m_fDefaultMin = 1.0f }; COneParameterConfig cfgd = new COneParameterConfig { m_sImage = "0", m_bEnable = true, m_bEnableMax = true, m_bEnableImage = true, m_fDefault = 0.2f, m_fMin = -10.0f, m_fMax = 10.0f, m_fDefaultMax = 0.0f, m_fDefaultMin = 0.2f }; COneParameterConfig cfgb = new COneParameterConfig { m_sImage = "0", m_bEnable = true, m_bEnableMax = true, m_bEnableImage = true, m_fDefault = 0.0f, m_fMin = -10.0f, m_fMax = 10.0f, m_fDefaultMax = 0.0f, m_fDefaultMin = 0.0f }; COneParameterConfig cfgk = new COneParameterConfig { m_sImage = "0", m_bEnable = true, m_bEnableMax = true, m_bEnableImage = true, m_fDefault = 0.0f, m_fMin = -10.0f, m_fMax = 10.0f, m_fDefaultMax = 0.0f, m_fDefaultMin = 0.0f }; COneParameterConfig el = new COneParameterConfig { m_sImage = "", m_bEnable = false, m_bEnableMax = true, m_bEnableImage = true, m_fDefault = 0.01f, m_fMin = 0.0001f, m_fMax = 3.0f, m_fDefaultMax = 3.0f, m_fDefaultMin = 0.0001f }; CUIPageConfigSimulate freeExp = new CUIPageConfigSimulate(); freeExp.m_sConfiguration = "Out"; freeExp.m_ConfigAlpha = alpha; freeExp.m_ConfigStep = step; freeExp.m_ConfigBoundary = boundary; freeExp.m_ConfigJ = cfgj; freeExp.m_ConfigD = cfgd; freeExp.m_ConfigB = cfgb; freeExp.m_ConfigK = cfgk; freeExp.m_ConfigElect = el; return(freeExp); }