Beispiel #1
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);
        }
        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);
        }