protected void ConstructNonSerializableMembers()
        {
            this.sendEventsToHostTrigger = new SendMssEventsToHostTrigger();
            this.paramMsgHandler         = new ParameterMsgHandler();
            this.dryMssEventHandler      = new DryMssEventHandler();

            this._dryMssEventRelay = new DryMssEventRelay();
            this._wetMssEventRelay = new WetMssEventRelay();
            this._hostInfoRelay    = new HostInfoRelay();

            this.mssEventGenrator        = new MssEventGenerator();
            this._mssParameters          = new MssParameters();
            this.msgEntryMetadataFactory = new Factory_MssMsgRangeEntryMetadata();
            this.msgInfoFactory          = new Factory_MssMsgInfo();
            this.transformPresetMgr      = new TransformPresetMgr();
            this.eventLogger             = new EventLogger();
        }
Пример #2
0
        /// <summary>
        ///     Initializes this MappingDlg. Init() must be called for this MappingDlg to work correctly.
        /// </summary>
        /// <param name="mappingEntry"> MappingEntry instance to use for the mappingEntry member variable.</param>
        /// <param name="useMappingEntryForDefaultValues">
        ///     If true, use the data in <paramref name="mappingEntry"/> to populate the entry fields.
        /// </param>
        public void Init(IMappingEntry mappingEntry,
                         bool useMappingEntryForDefaultValues,
                         Factory_MssMsgRangeEntryMetadata msgMetadataFactory,
                         IFactory_MssMsgInfo msgInfoFactory,
                         IDryMssEventOutputPort dryEventOut)
        {
            this.mappingEntry = mappingEntry;
            this.UseMappingEntryForDefaultValues = useMappingEntryForDefaultValues;
            this.MsgMetadataFactory = msgMetadataFactory;
            this.MsgInfoFactory     = msgInfoFactory;
            this.dryEventOut        = dryEventOut;

            this.dryEventOut.DryMssEventRecieved +=
                new DryMssEventRecievedEventHandler(dryMssEventOutputPort_DryMssEventRecieved);

            if (useMappingEntryForDefaultValues == true)
            {
                //Initializes inMsgMetadata and outMsgMetadata
                this.inTypeCombo.Text  = MssMsg.MssMsgTypeNames[(int)this.mappingEntry.InMssMsgRange.MsgType];
                this.outTypeCombo.Text = MssMsg.MssMsgTypeNames[(int)this.mappingEntry.OutMssMsgRange.MsgType];

                this.inMsgMetadata.UseExistingMsgRange(mappingEntry.InMssMsgRange);
                this.outMsgMetadata.UseExistingMsgRange(mappingEntry.OutMssMsgRange);

                //This could be disabled if we are editing a mapping with an input type like Parameter. If
                //this is disabled then we don't want to check it off because that will make it impossible
                //to edit the output fields.
                if (this.outSameAsInCheckBox.Enabled)
                {
                    this.outSameAsInCheckBox.Checked =
                        (this.mappingEntry.InMssMsgRange.Equals(this.mappingEntry.OutMssMsgRange));
                }
            }
            else
            {
                //Initializes inMsgMetadata and outMsgMetadata
                this.inTypeCombo.SelectedIndex = 0;

                this.mappingEntry.CurveShapeInfo = new CurveShapeInfo();
                this.mappingEntry.CurveShapeInfo.InitWithDefaultValues();

                this.outSameAsInCheckBox.Checked = true;
            }
        }