コード例 #1
0
        public void ProcessSignal(SignalRequirementsSignalRequirement signalRequirement)
        {
            InstrumentDAO dao = new InstrumentDAO();
            List <Tuple <string, object, string> > attributes = new List <Tuple <string, object, string> >();

            foreach (SignalRequirementsSignalRequirementTsfClassAttribute attribute in signalRequirement.TsfClassAttribute)
            {
                TsfClassAttributeName name = attribute.Name;
                if (attribute.Value != null)
                {
                    if (attribute.Value.Item is DatumType)
                    {
                        DatumType datum = attribute.Value.Item as DatumType;
                        Object    value = Datum.GetNominalDatumValue(datum);
                        if (value != null)
                        {
                            attributes.Add(new Tuple <string, object, string>(name.Value, value, datum.unitQualifier));
                        }
                    }
                }
            }

            lvInstruments.BeginUpdate();
            try
            {
                foreach (ListViewItem lvi in lvInstruments.Items)
                {
                    lvi.BackColor = Color.White;
                }

                ICollection <object> ids = dao.FindCapableEquipment(attributes);
                foreach (ListViewItem lvi in lvInstruments.Items)
                {
                    var testStationInstrumentData = lvi.Tag as TestStationInstrumentData;
                    if (testStationInstrumentData != null)
                    {
                        var instrument = testStationInstrumentData.InstrumentDescription;
                        if (instrument != null)
                        {
                            foreach (var id in ids)
                            {
                                if (id.Equals(instrument.uuid))
                                {
                                    lvi.BackColor = Color.PaleGreen;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e2)
            {
                LogManager.Debug("Error In TSF Class: {0}", signalRequirement.TsfClass.tsfClassName);
                foreach (Tuple <string, object, string> tuple in attributes)
                {
                    LogManager.Debug("     {0} = {1} {2}", tuple.Item1, tuple.Item2, tuple.Item3);
                }
            }
            lvInstruments.EndUpdate();
        }
コード例 #2
0
        protected virtual void OnSignalRequirementSelected(SignalRequirementsSignalRequirement obj)
        {
            ItemSelectionDeligate <SignalRequirementsSignalRequirement> handler = SignalRequirementSelected;

            if (handler != null)
            {
                handler(obj, EventArgs.Empty);
            }
        }
コード例 #3
0
        public void ProcessSignal( SignalRequirementsSignalRequirement signalRequirement )
        {
            InstrumentDAO dao = new InstrumentDAO();
            List<Tuple<string, object, string>> attributes = new List<Tuple<string, object, string>>();
            foreach (SignalRequirementsSignalRequirementTsfClassAttribute attribute in signalRequirement.TsfClassAttribute)
            {
                TsfClassAttributeName name = attribute.Name;
                if (attribute.Value != null)
                {
                    if (attribute.Value.Item is DatumType)
                    {
                        DatumType datum = attribute.Value.Item as DatumType;
                        Object value = Datum.GetNominalDatumValue(datum);
                        if (value != null)
                        {
                            attributes.Add(new Tuple<string, object, string>(name.Value, value, datum.unitQualifier));
                        }
                    }
                }
            }

            lvInstruments.BeginUpdate();
            try
            {
                foreach (ListViewItem lvi in lvInstruments.Items)
                    lvi.BackColor = Color.White;

                ICollection<object> ids = dao.FindCapableEquipment(attributes);
                foreach (ListViewItem lvi in lvInstruments.Items)
                {
                    var testStationInstrumentData = lvi.Tag as TestStationInstrumentData;
                    if (testStationInstrumentData != null)
                    {
                        var instrument = testStationInstrumentData.InstrumentDescription;
                        if (instrument != null)
                        {
                            foreach (var id in ids)
                            {
                                if (id.Equals( instrument.uuid ))
                                    lvi.BackColor = Color.PaleGreen;
                            }
                        }
                    }
                }
            }
            catch (Exception e2)
            {
                LogManager.Debug("Error In TSF Class: {0}", signalRequirement.TsfClass.tsfClassName);
                foreach (Tuple<string, object, string> tuple in attributes)
                {
                    LogManager.Debug("     {0} = {1} {2}", tuple.Item1, tuple.Item2, tuple.Item3);
                }

            }
            lvInstruments.EndUpdate();
        }
コード例 #4
0
 private void lvSignals_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lvSignals.SelectedItems.Count > 0)
     {
         ListViewItem lvi = lvSignals.SelectedItems[0];
         SignalRequirementsSignalRequirement signalRequirement = lvi.Tag as SignalRequirementsSignalRequirement;
         if (signalRequirement != null)
         {
             OnSignalRequirementSelected(signalRequirement);
         }
     }
 }
コード例 #5
0
        public void ProcessSignal(SignalRequirementsSignalRequirement signalRequirement)
        {
            var dao        = new InstrumentDAO();
            var attributes = (from attribute
                              in signalRequirement.TsfClassAttribute
                              let name = attribute.Name
                                         where attribute.Value != null
                                         where attribute.Value.Item is DatumType
                                         let value = Datum.GetNominalDatumValue((DatumType)attribute.Value.Item)
                                                     let qualifier = ((DatumType)attribute.Value.Item).unitQualifier
                                                                     where value != null
                                                                     select new Tuple <string, object, string>(name.Value, value, qualifier)).ToList();

            lvTestStations.BeginUpdate();
            try
            {
                foreach (ListViewItem lvi in lvTestStations.Items)
                {
                    lvi.BackColor = Color.White;
                }

                ICollection <object> ids = dao.FindCapableEquipment(attributes);
                foreach (ListViewItem lvi in lvTestStations.Items)
                {
                    var instrument = lvi.Tag as TestStationDescription11;
                    if (instrument != null)
                    {
                        foreach (var id in ids)
                        {
                            if (id.Equals(instrument.uuid))
                            {
                                lvi.BackColor = Color.PaleGreen;
                            }
                        }
                    }
                }
            }
            catch (Exception e2)
            {
                LogManager.Debug("Error In TSF Class: {0}", signalRequirement.TsfClass.tsfClassName);
                foreach (Tuple <string, object, string> tuple in attributes)
                {
                    LogManager.Debug("     {0} = {1} {2}", tuple.Item1, tuple.Item2, tuple.Item3);
                }
            }
            lvTestStations.EndUpdate();
        }
コード例 #6
0
        public void ProcessSignal(SignalRequirementsSignalRequirement signalRequirement)
        {
            var dao = new InstrumentDAO();
            var attributes = ( from attribute
                                 in signalRequirement.TsfClassAttribute
                                let name = attribute.Name
                              where attribute.Value != null
                              where attribute.Value.Item is DatumType
                                let value = Datum.GetNominalDatumValue( (DatumType) attribute.Value.Item )
                               let qualifier = ((DatumType)attribute.Value.Item).unitQualifier
                              where value != null
                             select new Tuple<string, object, string>( name.Value, value, qualifier ) ).ToList();

            lvTestStations.BeginUpdate();
            try
            {
                foreach (ListViewItem lvi in lvTestStations.Items)
                    lvi.BackColor = Color.White;

                ICollection<object> ids = dao.FindCapableEquipment(attributes);
                foreach (ListViewItem lvi in lvTestStations.Items)
                {
                    var instrument = lvi.Tag as TestStationDescription11;
                    if (instrument != null)
                    {
                        foreach (var id in ids)
                        {
                            if (id.Equals(instrument.uuid))
                                lvi.BackColor = Color.PaleGreen;
                        }
                    }
                }
            }
            catch (Exception e2)
            {
                LogManager.Debug("Error In TSF Class: {0}", signalRequirement.TsfClass.tsfClassName);
                foreach (Tuple<string, object, string> tuple in attributes)
                {
                    LogManager.Debug("     {0} = {1} {2}", tuple.Item1, tuple.Item2, tuple.Item3);
                }

            }
            lvTestStations.EndUpdate();
        }
コード例 #7
0
 protected virtual void OnSignalRequirementSelected( SignalRequirementsSignalRequirement obj )
 {
     ItemSelectionDeligate<SignalRequirementsSignalRequirement> handler = SignalRequirementSelected;
     if (handler != null) handler( obj, EventArgs.Empty );
 }
コード例 #8
0
 void requiredSignals_SignalRequirementSelected(SignalRequirementsSignalRequirement signalRequirement, EventArgs args)
 {
     availableInstruments.ProcessSignal( signalRequirement );
     availableTestStations.ProcessSignal(signalRequirement);
 }
コード例 #9
0
 void requiredSignals_SignalRequirementSelected(SignalRequirementsSignalRequirement signalRequirement, EventArgs args)
 {
     availableInstruments.ProcessSignal(signalRequirement);
     availableTestStations.ProcessSignal(signalRequirement);
 }