Exemplo n.º 1
0
 private void ExpView_ParamChanged(ICyParamEditor custEditor, CyCompDevParam param)
 {
     if (param.ErrorCount == 0)
     {
         ((CyCharLCDControl)(m_editControl.DisplayControl)).InitializeParameters();
     }
 }
Exemplo n.º 2
0
        public CyCustErr CustomizeShapes(
            ICyInstQuery_v1 instQuery,
            ICySymbolShapeEdit_v1 shapeEdit,
            ICyTerminalEdit_v1 termEdit)
        {
            CyCompDevParam width_param = instQuery.GetCommittedParam("Width");
            int            terminal_width;
            CyCustErr      err = width_param.TryGetValueAs <int>(out terminal_width);

            if (err.IsNotOk)
            {
                return(err);
            }

            // Shape the width of the data buses
            string suffix = (terminal_width > 1) ? string.Format("[{0}:0]", terminal_width - 1) : string.Empty;

            string term_name = termEdit.GetTermName("slope");

            termEdit.TerminalRename(term_name, term_name + suffix);

            term_name = termEdit.GetTermName("value");
            termEdit.TerminalRename(term_name, term_name + suffix);

            return(CyCustErr.OK);
        }
Exemplo n.º 3
0
        const string OUTPUT_TERM_NAME_2 = "out2"; //out2 terminal


        public CyCustErr CustomizeShapes(ICyInstQuery_v1 instQuery, ICySymbolShapeEdit_v1 shapeEdit,
                                         ICyTerminalEdit_v1 termEdit)
        {
            CyCustErr err;

            // We leave the symbol as it is for symbol preview
            if (instQuery.IsPreviewCanvas)
            {
                return(CyCustErr.OK);
            }

            //todo: if single output -> name it "out" instead of "out1"

            // Read Parameters
            CyCompDevParam outWidthParam1  = instQuery.GetCommittedParam("out1_width");
            byte           outWidth1       = byte.Parse(outWidthParam1.Value);
            byte           maxOutBitIndex1 = (byte)(outWidth1 - 1);
            string         outTermName1    = termEdit.GetTermName(OUTPUT_TERM_NAME_1);

            if (maxOutBitIndex1 != 0)
            {
                err = termEdit.TerminalRename(outTermName1, string.Format("{0}[{1}:0]", OUTPUT_TERM_NAME_1, maxOutBitIndex1.ToString()));
            }
            else
            {
                err = termEdit.TerminalRename(outTermName1, string.Format("{0}", OUTPUT_TERM_NAME_1));
            }

            if (err.IsNotOK)
            {
                return(err);
            }



            // Read Parameters
            CyCompDevParam outWidthParam2  = instQuery.GetCommittedParam("out2_width");
            byte           outWidth2       = byte.Parse(outWidthParam2.Value);
            byte           maxOutBitIndex2 = (byte)(outWidth2 - 1);
            string         outTermName2    = termEdit.GetTermName(OUTPUT_TERM_NAME_2);

            if (maxOutBitIndex2 != 0)
            {
                err = termEdit.TerminalRename(outTermName2, string.Format("{0}[{1}:0]", OUTPUT_TERM_NAME_2, maxOutBitIndex2.ToString()));
            }
            else
            {
                err = termEdit.TerminalRename(outTermName2, string.Format("{0}", OUTPUT_TERM_NAME_2));
            }

            if (err.IsNotOK)
            {
                return(err);
            }



            return(CyCustErr.OK);
        }
Exemplo n.º 4
0
 public IEnumerable <CyCustErr> GetErrors()
 {
     foreach (string paramName in m_params.m_inst.GetParamNames())
     {
         CyCompDevParam param = m_params.m_inst.GetCommittedParam(paramName);
         if (param.TabName.Equals(CyCustomizer.ADVANCED_TABNAME))
         {
             if (param.ErrorCount > 0)
             {
                 foreach (string errMsg in param.Errors)
                 {
                     yield return(new CyCustErr(errMsg));
                 }
             }
         }
     }
 }
 // Gets any errors that exist for parameters on the DisplayControl.
 public virtual IEnumerable <CyCustErr> GetErrors()
 {
     foreach (string paramName in m_parameters.InstQuery.GetParamNames())
     {
         CyCompDevParam param = m_parameters.InstQuery.GetCommittedParam(paramName);
         if (param.TabName.Equals(TabName))
         {
             if (param.ErrorCount > 0)
             {
                 foreach (string errMsg in param.Errors)
                 {
                     yield return(new CyCustErr(errMsg));
                 }
             }
         }
     }
 }
        public CyCustErr GetBodyText(ICySystemBuilderCompArgs_v1 args, out string bodyText)
        {
            string appVersion = "";

            System.UInt16 iappVersion;

            CyCompDevParam applicationVersion = args.InstQuery.GetCommittedParam(CyParameters.PARAM_VERSION);

            if (applicationVersion.ErrorCount == 0)
            {
                applicationVersion.TryGetValueAs <System.UInt16>(out iappVersion);
                appVersion = ConvertDecToHex(iappVersion);
            }

            bodyText = String.Format(Resources.SBComponentBodyText, appVersion);

            return(CyCustErr.OK);
        }
        System.Collections.Generic.IEnumerable <CyCustErr> ICyParamEditingControl.GetErrors()
        {
            List <CyCustErr> errs = new List <CyCustErr>();

            foreach (string paramName in m_instEdit.GetParamNames())
            {
                CyCompDevParam param = m_instEdit.GetCommittedParam(paramName);
                if (m_tabNames.Contains(param.TabName))
                {
                    if (param.ErrorCount > 0)
                    {
                        foreach (string errMsg in param.Errors)
                        {
                            errs.Add(new CyCustErr(errMsg));
                        }
                    }
                }
            }

            return(errs);
        }
Exemplo n.º 8
0
 public CyCustErr ResolveEnumParamToDisplay(CyCompDevParam param, out string displayName)
 {
     throw new NotImplementedException();
 }
        // Get parameter values
        private void GetParams(ICyInstEdit_v1 inst)
        {
            m_ADC_Clock = inst.GetCommittedParam(ADC_CLOCK);

            m_ADC_Input_Range = inst.GetCommittedParam(INPUT_RANGE);
            m_ADC_Input_Range_Config2 = inst.GetCommittedParam(INPUT_RANGE_CONFIG2);
            m_ADC_Input_Range_Config3 = inst.GetCommittedParam(INPUT_RANGE_CONFIG3);
            m_ADC_Input_Range_Config4 = inst.GetCommittedParam(INPUT_RANGE_CONFIG4);

            m_ADC_Reference = inst.GetCommittedParam(ADC_REFERENCE);
            m_ADC_Reference_Config2 = inst.GetCommittedParam(ADC_REFERENCE_CONFIG2);
            m_ADC_Reference_Config3 = inst.GetCommittedParam(ADC_REFERENCE_CONFIG3);
            m_ADC_Reference_Config4 = inst.GetCommittedParam(ADC_REFERENCE_CONFIG4);

            m_ADC_Resolution = inst.GetCommittedParam(RESOLUTION);
            m_ADC_Resolution_Config2 = inst.GetCommittedParam(RESOLUTION_CONFIG2);
            m_ADC_Resolution_Config3 = inst.GetCommittedParam(RESOLUTION_CONFIG3);
            m_ADC_Resolution_Config4 = inst.GetCommittedParam(RESOLUTION_CONFIG4);

            m_Conversion_Mode = inst.GetCommittedParam(CONVERSION_MODE);
            m_Conversion_Mode_Config2 = inst.GetCommittedParam(CONVERSION_MODE_CONFIG2);
            m_Conversion_Mode_Config3 = inst.GetCommittedParam(CONVERSION_MODE_CONFIG3);
            m_Conversion_Mode_Config4 = inst.GetCommittedParam(CONVERSION_MODE_CONFIG4);
            m_Input_Buffer_Gain = inst.GetCommittedParam(INPUT_BUFFER_GAIN);
            m_Input_Buffer_Gain_Config2 = inst.GetCommittedParam(INPUT_BUFFER_GAIN_CONFIG2);
            m_Input_Buffer_Gain_Config3 = inst.GetCommittedParam(INPUT_BUFFER_GAIN_CONFIG3);
            m_Input_Buffer_Gain_Config4 = inst.GetCommittedParam(INPUT_BUFFER_GAIN_CONFIG4);
            m_Input_Buffer_Mode = inst.GetCommittedParam(INPUT_BUFFER_MODE);
            m_Input_Buffer_Mode_Config2 = inst.GetCommittedParam(INPUT_BUFFER_MODE_CONFIG2);
            m_Input_Buffer_Mode_Config3 = inst.GetCommittedParam(INPUT_BUFFER_MODE_CONFIG3);
            m_Input_Buffer_Mode_Config4 = inst.GetCommittedParam(INPUT_BUFFER_MODE_CONFIG4);

            m_Sample_Rate = inst.GetCommittedParam(SAMPLE_RATE);
            m_Sample_Rate_Config2 = inst.GetCommittedParam(SAMPLE_RATE_CONFIG2);
            m_Sample_Rate_Config3 = inst.GetCommittedParam(SAMPLE_RATE_CONFIG3);
            m_Sample_Rate_Config4 = inst.GetCommittedParam(SAMPLE_RATE_CONFIG4);
            m_Ref_Voltage = inst.GetCommittedParam(REF_VOLTAGE);
            m_Ref_Voltage_Config2 = inst.GetCommittedParam(REF_VOLTAGE_CONFIG2);
            m_Ref_Voltage_Config3 = inst.GetCommittedParam(REF_VOLTAGE_CONFIG3);
            m_Ref_Voltage_Config4 = inst.GetCommittedParam(REF_VOLTAGE_CONFIG4);

            m_Clock_Frequency = inst.GetCommittedParam(CLOCK_FREQUENCY);
            m_Start_of_Conversion = inst.GetCommittedParam(START_OF_CONVERSION);
            m_Configs = inst.GetCommittedParam(CONFIGS);
            m_ADC_Charge_Pump_Clock = inst.GetCommittedParam(ADC_CHARGE_PUMP_CLOCK);
            m_ADC_Input_Mode = inst.GetCommittedParam(ADC_INPUT_MODE);
            m_Enable_Vref_Vss = inst.GetCommittedParam(ADC_nVref);

            m_Comment_Config1 = inst.GetCommittedParam(ADC_COMMENT_CONFIG1);
            m_Comment_Config2 = inst.GetCommittedParam(ADC_COMMENT_CONFIG2);
            m_Comment_Config3 = inst.GetCommittedParam(ADC_COMMENT_CONFIG3);
            m_Comment_Config4 = inst.GetCommittedParam(ADC_COMMENT_CONFIG4);

            m_Config1_Name = inst.GetCommittedParam(CONFIG1_NAME);
            m_Config2_Name = inst.GetCommittedParam(CONFIG2_NAME);
            m_Config3_Name = inst.GetCommittedParam(CONFIG3_NAME);
            m_Config4_Name = inst.GetCommittedParam(CONFIG4_NAME);

            m_ADC_ExVref_Num = inst.GetCommittedParam("ADC_ExVref_Num");

            m_Vdda_Value = inst.GetCommittedParam(ADC_Vdda_Value);
        }
        // Get parameter values
        private void GetParams(ICyInstEdit_v1 inst)
        {
            m_ADC_Clock = inst.GetCommittedParam(ADC_CLOCK);

            m_ADC_Input_Range         = inst.GetCommittedParam(INPUT_RANGE);
            m_ADC_Input_Range_Config2 = inst.GetCommittedParam(INPUT_RANGE_CONFIG2);
            m_ADC_Input_Range_Config3 = inst.GetCommittedParam(INPUT_RANGE_CONFIG3);
            m_ADC_Input_Range_Config4 = inst.GetCommittedParam(INPUT_RANGE_CONFIG4);

            m_ADC_Reference         = inst.GetCommittedParam(ADC_REFERENCE);
            m_ADC_Reference_Config2 = inst.GetCommittedParam(ADC_REFERENCE_CONFIG2);
            m_ADC_Reference_Config3 = inst.GetCommittedParam(ADC_REFERENCE_CONFIG3);
            m_ADC_Reference_Config4 = inst.GetCommittedParam(ADC_REFERENCE_CONFIG4);

            m_ADC_Resolution         = inst.GetCommittedParam(RESOLUTION);
            m_ADC_Resolution_Config2 = inst.GetCommittedParam(RESOLUTION_CONFIG2);
            m_ADC_Resolution_Config3 = inst.GetCommittedParam(RESOLUTION_CONFIG3);
            m_ADC_Resolution_Config4 = inst.GetCommittedParam(RESOLUTION_CONFIG4);

            m_Conversion_Mode           = inst.GetCommittedParam(CONVERSION_MODE);
            m_Conversion_Mode_Config2   = inst.GetCommittedParam(CONVERSION_MODE_CONFIG2);
            m_Conversion_Mode_Config3   = inst.GetCommittedParam(CONVERSION_MODE_CONFIG3);
            m_Conversion_Mode_Config4   = inst.GetCommittedParam(CONVERSION_MODE_CONFIG4);
            m_Input_Buffer_Gain         = inst.GetCommittedParam(INPUT_BUFFER_GAIN);
            m_Input_Buffer_Gain_Config2 = inst.GetCommittedParam(INPUT_BUFFER_GAIN_CONFIG2);
            m_Input_Buffer_Gain_Config3 = inst.GetCommittedParam(INPUT_BUFFER_GAIN_CONFIG3);
            m_Input_Buffer_Gain_Config4 = inst.GetCommittedParam(INPUT_BUFFER_GAIN_CONFIG4);
            m_Input_Buffer_Mode         = inst.GetCommittedParam(INPUT_BUFFER_MODE);
            m_Input_Buffer_Mode_Config2 = inst.GetCommittedParam(INPUT_BUFFER_MODE_CONFIG2);
            m_Input_Buffer_Mode_Config3 = inst.GetCommittedParam(INPUT_BUFFER_MODE_CONFIG3);
            m_Input_Buffer_Mode_Config4 = inst.GetCommittedParam(INPUT_BUFFER_MODE_CONFIG4);

            m_Sample_Rate         = inst.GetCommittedParam(SAMPLE_RATE);
            m_Sample_Rate_Config2 = inst.GetCommittedParam(SAMPLE_RATE_CONFIG2);
            m_Sample_Rate_Config3 = inst.GetCommittedParam(SAMPLE_RATE_CONFIG3);
            m_Sample_Rate_Config4 = inst.GetCommittedParam(SAMPLE_RATE_CONFIG4);
            m_Ref_Voltage         = inst.GetCommittedParam(REF_VOLTAGE);
            m_Ref_Voltage_Config2 = inst.GetCommittedParam(REF_VOLTAGE_CONFIG2);
            m_Ref_Voltage_Config3 = inst.GetCommittedParam(REF_VOLTAGE_CONFIG3);
            m_Ref_Voltage_Config4 = inst.GetCommittedParam(REF_VOLTAGE_CONFIG4);

            m_Clock_Frequency       = inst.GetCommittedParam(CLOCK_FREQUENCY);
            m_Start_of_Conversion   = inst.GetCommittedParam(START_OF_CONVERSION);
            m_Configs               = inst.GetCommittedParam(CONFIGS);
            m_ADC_Charge_Pump_Clock = inst.GetCommittedParam(ADC_CHARGE_PUMP_CLOCK);
            m_ADC_Input_Mode        = inst.GetCommittedParam(ADC_INPUT_MODE);
            m_Enable_Vref_Vss       = inst.GetCommittedParam(ADC_nVref);

            m_Comment_Config1 = inst.GetCommittedParam(ADC_COMMENT_CONFIG1);
            m_Comment_Config2 = inst.GetCommittedParam(ADC_COMMENT_CONFIG2);
            m_Comment_Config3 = inst.GetCommittedParam(ADC_COMMENT_CONFIG3);
            m_Comment_Config4 = inst.GetCommittedParam(ADC_COMMENT_CONFIG4);

            m_Config1_Name = inst.GetCommittedParam(CONFIG1_NAME);
            m_Config2_Name = inst.GetCommittedParam(CONFIG2_NAME);
            m_Config3_Name = inst.GetCommittedParam(CONFIG3_NAME);
            m_Config4_Name = inst.GetCommittedParam(CONFIG4_NAME);

            m_ADC_ExVref_Num = inst.GetCommittedParam("ADC_ExVref_Num");

            m_Vdda_Value = inst.GetCommittedParam(ADC_Vdda_Value);
        }
Exemplo n.º 11
0
 private void ExpView_ParamChanged(ICyParamEditor custEditor, CyCompDevParam param)
 {
     if (param.ErrorCount == 0)
     {
         ((CyCharLCDControl)(m_editControl.DisplayControl)).InitializeParameters();
     }
 }