public void Init(IDryMssEventOutputPort dryMssEventOutputPort, IWetMssEventOutputPort wetMssEventOutputPort) { dryMssEventOutputPort.DryMssEventRecieved += new DryMssEventRecievedEventHandler(DryEventRecieved); wetMssEventOutputPort.WetMssEventsReceived += new WetMssEventReceivedEventHandler(WetEventRecieved); wetMssEventOutputPort.SendingWetMssEvents += new SendingWetMssEventsEventHandler(OnCycleEnd); }
/// <summary> /// Initializes this DryMssEventHandler. Other methods in this class should not be called beofre calling /// Init(). /// </summary> /// <param name="dryMssEventOutputPort">Sends unprocessed MssEvents from the host.</param> /// <param name="wetMssEventInputPort">Receives processed MssEvents to be sent back to the host</param> /// <param name="mappingMgr">The MappingManager that will be used by mssMsgProcessor</param> public void Init(IDryMssEventOutputPort dryMssEventOutputPort, IWetMssEventInputPort wetMssEventInputPort, IMappingManager mappingMgr, IMssParameterViewer mssParameters) { this.mssMsgProcessor.Init(mappingMgr, mssParameters); this.wetMssEventInputPort = wetMssEventInputPort; dryMssEventOutputPort.DryMssEventRecieved += new DryMssEventRecievedEventHandler(dryMssEventOutputPort_DryMssEventRecieved); }
/// <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; } }