DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { const string PAPAM_TAB_NAME_BUILTIN = "Built-in"; const string PAPAM_TAB_NAME_INTERCONNECT = "Interconnect"; CyParameters prms = new CyParameters(edit); CyGeneralPage generalPage = new CyGeneralPage(prms); ICyTabbedParamEditor editor = edit.CreateTabbedParamEditor(); CyTerminalControl_v1 interconnectTab = null; CyParamExprDelegate exprDelegate = delegate(ICyParamEditor custEditor, CyCompDevParam param) { prms.m_globalEditMode = false; if (param.TabName == generalPage.TabName) { generalPage.InitFields(); } prms.m_globalEditMode = true; }; editor.AddCustomPage(Properties.Resources.PageTitleGeneral, generalPage, exprDelegate, generalPage.TabName); // System Builder support if (prms.InstQuery.DeviceQuery.IsPSoC4 && edit.IsInSystemBuilder) { interconnectTab = new CyTerminalControl_v1(edit); editor.AddCustomPage(Resources.InterconnectTabDisplayName, interconnectTab, exprDelegate, PAPAM_TAB_NAME_INTERCONNECT); } editor.AddDefaultPage(Properties.Resources.PageTitleBuiltIn, PAPAM_TAB_NAME_BUILTIN); prms.m_globalEditMode = true; return(editor.ShowDialog()); }
System.Windows.Forms.DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { ICyTabbedParamEditor editor = edit.CreateTabbedParamEditor(); m_control = new CyADC_DelSigControl(edit); m_editingControl = new CyADC_EditingControl(edit, m_control, BasicTabName); CyParamExprDelegate ExprDelegate = delegate(ICyParamEditor custEditor, CyCompDevParam param) { m_control.UpdateFormFromParams(edit); }; editor.AddCustomPage(ConfigureTabName, m_editingControl, ExprDelegate, BasicTabName); editor.AddDefaultPage(BuiltinTabName, BuiltinTabName); editor.UseBigEditor = true; DialogResult result = editor.ShowDialog(); // Place calculations here ***************************************************************************** edit.CommitParamExprs(); return(result); }
DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { parameters = new ErikaOSParameters(edit); CyParamExprDelegate paramChange = delegate(ICyParamEditor custEditor, CyCompDevParam param) { parameters.GetParams(); }; ICyTabbedParamEditor editor = edit.CreateTabbedParamEditor(); editor.AddCustomPage("OS Config", new ErikaOSEditingControl(parameters), paramChange, "Properties"); editor.AddCustomPage("Alarms & Counters", new ErikaOSEditingAlarms(parameters), paramChange, "Alarm Properties"); editor.AddCustomPage("Events & Resources", new ErikaOSEditingEvents(parameters), paramChange, "Event Properties"); editor.AddCustomPage("Tasks", new ErikaOSEditingTasks(parameters), paramChange, "Task Properties"); editor.AddCustomPage("ISRs", new ErikaOSEditingISRs(parameters), paramChange, "ISR Properties"); //editor.AddDefaultPage("Built-in", "Built-in"); editor.AddAllDefaultPages(); parameters.GetParams(); return(editor.ShowDialog()); }
/// <summary> /// Edit Params initializes the data in the customizer as well as /// instantiating the dialog. /// </summary> /// <param name="obj"> Is a component object containing the parameter information for the object. </param> /// <returns>A DialogResult object associated with the form. /// OK means accept changes. Cancel means reject changes.</returns> DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 obj, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { ICyTabbedParamEditor editor = obj.CreateTabbedParamEditor(); m_editControl = new CyCharacterLCDEditingControl(obj); editor.AddCustomPage("General", m_editControl, ExpView_ParamChanged, "General"); editor.AddDefaultPage("Built-in", "Built-in"); System.Windows.Forms.DialogResult result = editor.ShowDialog(); return(result); }
DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { parameters = new MultAccParameters(edit); CyParamExprDelegate paramChange = delegate(ICyParamEditor custEditor, CyCompDevParam param) { parameters.GetParams(); }; ICyTabbedParamEditor editor = edit.CreateTabbedParamEditor(); editor.AddCustomPage("Properties", new MultAccEditingControl(parameters), paramChange, "Properties"); editor.AddDefaultPage("Built-in", "Built-in"); parameters.GetParams(); return(editor.ShowDialog()); }
DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { parameters = new MultAccParameters(edit); CyParamExprDelegate paramChange = delegate(ICyParamEditor custEditor, CyCompDevParam param) { parameters.GetParams(); }; ICyTabbedParamEditor editor = edit.CreateTabbedParamEditor(); editor.AddCustomPage("Properties", new MultAccEditingControl(parameters), paramChange, "Properties"); editor.AddDefaultPage("Built-in", "Built-in"); parameters.GetParams(); return editor.ShowDialog(); }
public DialogResult EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { CySPIMParameters parameters = new CySPIMParameters(edit); ICyTabbedParamEditor editor = edit.CreateTabbedParamEditor(); CyParamExprDelegate configureExpressionViewDataChanged = delegate(ICyParamEditor custEditor, CyCompDevParam param) { parameters.LoadParameters(edit); }; editor.AddCustomPage(Properties.Resources.BasicTabTitle, new CySPIMControl(parameters), configureExpressionViewDataChanged, BASIC_TABNAME); editor.AddCustomPage(Properties.Resources.AdvancedTabTitle, new CySPIMControlAdv(parameters), configureExpressionViewDataChanged, ADVANCED_TABNAME); editor.AddDefaultPage(Properties.Resources.BuiltInTabTitle, "Built-in"); parameters.LoadParameters(edit); parameters.m_bGlobalEditMode = true; return(editor.ShowDialog()); }
DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { this.m_Component = edit; Parameters = new CyRTX51Parameters(edit); CyParamExprDelegate ParamCommitted = delegate(ICyParamEditor custEditor, CyCompDevParam param) { }; ICyTabbedParamEditor editor = edit.CreateTabbedParamEditor(); editor.AddCustomPage("Basic Configuration", new CyBasicConfigurationControl(Parameters), ParamCommitted, ""); editor.AddDefaultPage("Built-in", "Built-in"); DialogResult result = editor.ShowDialog(); editor.InterceptHelpRequest = new CyHelpDelegate(InterceptHelp); return(result); }
DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { const string PAPAM_TAB_NAME_BUILTIN = "Built-in"; CyEditingWrapperControl.RUN_MODE = true; CyParameters prms = new CyParameters(edit); CyGeneralPage generalPage = new CyGeneralPage(prms); ICyTabbedParamEditor editor = edit.CreateTabbedParamEditor(); CyParamExprDelegate exprDelegate = delegate(ICyParamEditor custEditor, CyCompDevParam param) { prms.m_globalEditMode = false; if (param.TabName == generalPage.TabName) generalPage.InitFields(); prms.m_globalEditMode = true; }; editor.AddCustomPage(Properties.Resources.PageTitleGeneral, generalPage, exprDelegate, generalPage.TabName); editor.AddDefaultPage(Properties.Resources.PageTitleBuiltIn, PAPAM_TAB_NAME_BUILTIN); prms.m_globalEditMode = true; return editor.ShowDialog(); }
public IEnumerable<CyAPICustomizer> CustomizeAPIs(ICyInstQuery_v1 query, ICyTerminalQuery_v1 termQuery, IEnumerable<CyAPICustomizer> apis) { List<CyClockData> clockStuff = termQuery.GetClockData(ADC_ClockTermName, 3); Dictionary<string, string> paramDict = null; m_termQuery = termQuery; m_instQuery = query; foreach (CyAPICustomizer api in apis) { // Get parameter dictionary paramDict = api.MacroDictionary; } bool isPSoC3 = query.GetCommittedParam(Resource.DsmNameText).Value == Resource.DSMText; float vdda = float.Parse(query.GetCommittedParam(Resource.VddaValueText).Value); // Calculate values CalcValues(ref paramDict, isPSoC3, vdda); // Assign dictionary back to API customizers foreach (CyAPICustomizer api in apis) { // Get parameter dictionary api.MacroDictionary = paramDict; } // Return customizers return apis; }
public IEnumerable <CyAPICustomizer> CustomizeAPIs( ICyInstQuery_v1 query, ICyTerminalQuery_v1 termQuery, IEnumerable <CyAPICustomizer> apis) { List <CyAPICustomizer> customizers = new List <CyAPICustomizer>(apis); Dictionary <string, string> paramDict = new Dictionary <string, string>(); string instanceName = ""; // Get the parameters from the characterLCD.c file customizer for (int i = 0; i < customizers.Count; i++) { CyAPICustomizer api = customizers[i]; // Get dict from main file. if (api.OriginalName.EndsWith(LCD_CFILE_NAME)) { paramDict = api.MacroDictionary; paramDict.TryGetValue(INSTANCE_NAME_PARAM, out instanceName); } else if (api.OriginalName.EndsWith(CUST_CHARS_CFILE_NAME)) { m_custChar_CFile = api; } else if (api.OriginalName.EndsWith(BARGRAPH_CFILE_NAME)) { m_barGraph_CFile = api; } } // Determine Custom Character Set string value; paramDict.TryGetValue(CUSTOM_CHARACTER_SET_PARAM, out value); m_customCharacterSet = (CyCustomCharacterSetTypes)(int.Parse(value)); // Determine existence of ASCII Routines paramDict.TryGetValue(CONVERSION_ROUTINE_PARAM, out value); m_conversionRoutines = (value == "1"); #region New Code Substitution Values const string CUSTOM_CHAR_DEFINES_MACRO = "CustomCharDefines_API_GEN"; const string CONVERSION_ROUTINE_MACRO = "ConversionRoutines_DEF"; string customCharDeleted = "0"; string customCharDefined = ((byte)m_customCharacterSet).ToString(); #region Literal String Code for Conversion Routines string conversionRoutineDeleted = "0"; string conversionRoutineDefined = "1"; #endregion #endregion // If a character set is selected, build c file with data in it. switch (m_customCharacterSet) { case CyCustomCharacterSetTypes.USERDEFINED: ConvertCharacters(LoadUserDefinedCharacters(paramDict), paramDict); paramDict.Add(CUSTOM_CHAR_DEFINES_MACRO, customCharDefined); customizers.Remove(m_barGraph_CFile); break; case CyCustomCharacterSetTypes.VERTICAL: GenerateVerticalBargraph(paramDict); paramDict.Add(CUSTOM_CHAR_DEFINES_MACRO, customCharDefined); customizers.Remove(m_custChar_CFile); break; case CyCustomCharacterSetTypes.HORIZONTAL: GenerateHorizontalBargraph(paramDict); paramDict.Add(CUSTOM_CHAR_DEFINES_MACRO, customCharDefined); customizers.Remove(m_custChar_CFile); break; default: paramDict.Add(CUSTOM_CHAR_DEFINES_MACRO, customCharDeleted); customizers.Remove(m_barGraph_CFile); customizers.Remove(m_custChar_CFile); break; } // If conversion routines are selected, import them if (m_conversionRoutines) { paramDict.Add(CONVERSION_ROUTINE_MACRO, conversionRoutineDefined); } else { paramDict.Add(CONVERSION_ROUTINE_MACRO, conversionRoutineDeleted); } // Replace macro dictionaries with paramDict for (int i = 0; i < customizers.Count; i++) { CyAPICustomizer api = customizers[i]; api.MacroDictionary = paramDict; } return(customizers); }
DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { const string PAPAM_TAB_NAME_BUILTIN = "Built-in"; const string PAPAM_TAB_NAME_INTERCONNECT = "Interconnect"; CyParameters prms = new CyParameters(edit); CyGeneralPage generalPage = new CyGeneralPage(prms); ICyTabbedParamEditor editor = edit.CreateTabbedParamEditor(); CyTerminalControl_v1 interconnectTab = null; CyParamExprDelegate exprDelegate = delegate(ICyParamEditor custEditor, CyCompDevParam param) { prms.m_globalEditMode = false; if (param.TabName == generalPage.TabName) generalPage.InitFields(); prms.m_globalEditMode = true; }; editor.AddCustomPage(Properties.Resources.PageTitleGeneral, generalPage, exprDelegate, generalPage.TabName); // System Builder support if (prms.InstQuery.DeviceQuery.IsPSoC4 && edit.IsInSystemBuilder) { interconnectTab = new CyTerminalControl_v1(edit); editor.AddCustomPage(Resources.InterconnectTabDisplayName, interconnectTab, exprDelegate, PAPAM_TAB_NAME_INTERCONNECT); } editor.AddDefaultPage(Properties.Resources.PageTitleBuiltIn, PAPAM_TAB_NAME_BUILTIN); prms.m_globalEditMode = true; return editor.ShowDialog(); }
System.Windows.Forms.DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { ICyTabbedParamEditor editor = edit.CreateTabbedParamEditor(); m_control = new CyADC_DelSigControl(edit); m_editingControl = new CyADC_EditingControl(edit, m_control, BasicTabName); CyParamExprDelegate ExprDelegate = delegate(ICyParamEditor custEditor, CyCompDevParam param) { m_control.UpdateFormFromParams(edit); }; editor.AddCustomPage(ConfigureTabName, m_editingControl, ExprDelegate, BasicTabName); editor.AddDefaultPage(BuiltinTabName, BuiltinTabName); editor.UseBigEditor = true; DialogResult result = editor.ShowDialog(); // Place calculations here ***************************************************************************** edit.CommitParamExprs(); return result; }
/// <summary> /// Edit Params initializes the data in the customizer as well as /// instantiating the dialog. /// </summary> /// <param name="obj"> Is a component object containing the parameter information for the object. </param> /// <returns>A DialogResult object associated with the form. /// OK means accept changes. Cancel means reject changes.</returns> DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 obj, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { ICyTabbedParamEditor editor = obj.CreateTabbedParamEditor(); m_editControl = new CyCharacterLCDEditingControl(obj); editor.AddCustomPage("General", m_editControl, ExpView_ParamChanged, "General"); editor.AddDefaultPage("Built-in", "Built-in"); System.Windows.Forms.DialogResult result = editor.ShowDialog(); return result; }
DialogResult ICyParamEditHook_v1.EditParams(ICyInstEdit_v1 edit, ICyTerminalQuery_v1 termQuery, ICyExpressMgr_v1 mgr) { this.m_Component = edit; Parameters = new CyRTX51Parameters(edit); CyParamExprDelegate ParamCommitted = delegate(ICyParamEditor custEditor, CyCompDevParam param) { }; ICyTabbedParamEditor editor = edit.CreateTabbedParamEditor(); editor.AddCustomPage("Basic Configuration", new CyBasicConfigurationControl(Parameters), ParamCommitted, ""); editor.AddDefaultPage("Built-in", "Built-in"); DialogResult result = editor.ShowDialog(); editor.InterceptHelpRequest = new CyHelpDelegate(InterceptHelp); return result; }
public IEnumerable<CyAPICustomizer> CustomizeAPIs( ICyInstQuery_v1 query, ICyTerminalQuery_v1 termQuery, IEnumerable<CyAPICustomizer> apis) { List<CyAPICustomizer> customizers = new List<CyAPICustomizer>(apis); Dictionary<string, string> paramDict = new Dictionary<string, string>(); string instanceName = ""; // Get the parameters from the characterLCD.c file customizer for (int i = 0; i < customizers.Count; i++) { CyAPICustomizer api = customizers[i]; // Get dict from main file. if (api.OriginalName.EndsWith(LCD_CFILE_NAME)) { paramDict = api.MacroDictionary; paramDict.TryGetValue(INSTANCE_NAME_PARAM, out instanceName); } else if (api.OriginalName.EndsWith(CUST_CHARS_CFILE_NAME)) { m_custChar_CFile = api; } else if (api.OriginalName.EndsWith(BARGRAPH_CFILE_NAME)) { m_barGraph_CFile = api; } } // Determine Custom Character Set string value; paramDict.TryGetValue(CUSTOM_CHARACTER_SET_PARAM, out value); m_customCharacterSet = (CyCustomCharacterSetTypes)(int.Parse(value)); // Determine existence of ASCII Routines paramDict.TryGetValue(CONVERSION_ROUTINE_PARAM, out value); m_conversionRoutines = (value == "1"); #region New Code Substitution Values const string CUSTOM_CHAR_DEFINES_MACRO = "CustomCharDefines_API_GEN"; const string CONVERSION_ROUTINE_MACRO = "ConversionRoutines_DEF"; string customCharDeleted = "0"; string customCharDefined = ((byte)m_customCharacterSet).ToString(); #region Literal String Code for Conversion Routines string conversionRoutineDeleted = "0"; string conversionRoutineDefined = "1"; #endregion #endregion // If a character set is selected, build c file with data in it. switch (m_customCharacterSet) { case CyCustomCharacterSetTypes.USERDEFINED: ConvertCharacters(LoadUserDefinedCharacters(paramDict), paramDict); paramDict.Add(CUSTOM_CHAR_DEFINES_MACRO, customCharDefined); customizers.Remove(m_barGraph_CFile); break; case CyCustomCharacterSetTypes.VERTICAL: GenerateVerticalBargraph(paramDict); paramDict.Add(CUSTOM_CHAR_DEFINES_MACRO, customCharDefined); customizers.Remove(m_custChar_CFile); break; case CyCustomCharacterSetTypes.HORIZONTAL: GenerateHorizontalBargraph(paramDict); paramDict.Add(CUSTOM_CHAR_DEFINES_MACRO, customCharDefined); customizers.Remove(m_custChar_CFile); break; default: paramDict.Add(CUSTOM_CHAR_DEFINES_MACRO, customCharDeleted); customizers.Remove(m_barGraph_CFile); customizers.Remove(m_custChar_CFile); break; } // If conversion routines are selected, import them if (m_conversionRoutines) { paramDict.Add(CONVERSION_ROUTINE_MACRO, conversionRoutineDefined); } else { paramDict.Add(CONVERSION_ROUTINE_MACRO, conversionRoutineDeleted); } // Replace macro dictionaries with paramDict for (int i = 0; i < customizers.Count; i++) { CyAPICustomizer api = customizers[i]; api.MacroDictionary = paramDict; } return customizers; }