Example #1
0
        public IdentifierTest()
        {
            // D1
            TestD1      = new MCBEDescription();
            TestD1.id   = "1";
            TestD1.text = "D1";

            // D2
            TestD2            = new MCBEDescription();
            TestD2.id         = "2";
            TestD2.isInternal = true;
            TestD2.text       = "D2";

            // R1
            TestR1             = new MCBERule();
            TestR1.id          = "1";
            TestR1.priority    = 1;
            TestR1.antecedents = new Dictionary <string, bool>()
            {
                { "1", true }
            };
            TestR1.consequents = new Dictionary <string, bool>()
            {
                { "2", true }
            };
        }
Example #2
0
        public void Answer(MCBEDescription desc, bool answer)
        {
            if (desc == null)
            {
                throw new NullReferenceException();
            }

            Answer(desc.id, answer);
        }
        private void repaintTestStatuses()
        {
            candidatesListBoxTabTestItem.Items.Clear();
            candidatesListBoxTabTestItem.Items.AddRange(identifier.Candidates.ToArray());

            string state = "-";

            switch (identifier.State)
            {
            case MCBECore.Identifier.ResultState.Continue: state = "検討中"; break;

            case MCBECore.Identifier.ResultState.Determined: state = "決定"; break;

            case MCBECore.Identifier.ResultState.Unknown: state = "不明"; break;

            default: break;
            }
            stateLabelTabTestItem.Text = state;

            MCBEDescription determined = identifier.Determined;

            if (determined == null)
            {
                resultLabelTabTestItem.Text = "-";
            }
            else
            {
                if (determined.comment != null)
                {
                    resultLabelTabTestItem.Text = $"{determined.comment}: {determined.text}";
                }
                else
                {
                    resultLabelTabTestItem.Text = determined.text;
                }
            }

            var descToAsk = identifier.DescriptionToAsk();

            if (descToAsk != null)
            {
                if (descToAsk.comment != null)
                {
                    descriptionToAskLabelTabTestItem.Text = $"{descToAsk.comment}: {descToAsk.text}";
                }
                else
                {
                    descriptionToAskLabelTabTestItem.Text = $"{descToAsk.id.Substring(0, 8)}: {descToAsk.text}";
                }
            }
        }
        private void addButtonTabDescsItem_Click(object sender, EventArgs e)
        {
            if (descriptionsListBoxTabDescsItem.Items.Count > 0 && !validate(type: ModelValidator.ValidateType.Descriptions))
            {
                return;
            }

            var desc = new MCBEDescription();

            desc.id         = Guid.NewGuid().ToString();
            desc.isInternal = false;
            desc.comment    = $"D{description_serial_number}";

            descriptionsListBoxTabDescsItem.Items.Add(desc);
            descriptionsListBoxTabDescsItem.SelectedIndex = descriptionsListBoxTabDescsItem.Items.Count - 1;

            description_serial_number++;

            isModelChanged = true;
        }