예제 #1
0
        private void ZoneModlueS(string Rob1, TxObjectList Rob1Sigs, string Rob2, TxObjectList Rob2Sigs, string[] Zone, ITxPlcModule p1)
        {
            TxPlcExpressionBuilder eb1 = new TxPlcExpressionBuilder();

            try
            {
                foreach (string z in Zone)
                {
                    string str1 = textBox12.Text.Replace("X", z);
                    string str2 = textBox11.Text.Replace("X", z);

                    eb1.Add(TxPlcExpressionOperator.Not);
                    eb1.Add(FindSig(Rob1Sigs, str1, true));
                    eb1.Add(TxPlcExpressionOperator.And);
                    eb1.Add(TxPlcExpressionOperator.LeftParenthesis);
                    eb1.Add(TxPlcExpressionOperator.Not);
                    eb1.Add(FindSig(Rob2Sigs, str2, false));
                    eb1.Add(TxPlcExpressionOperator.Or);
                    eb1.Add(FindSig(Rob2Sigs, str1, true));
                    eb1.Add(TxPlcExpressionOperator.RightParenthesis);
                    p1.AddEntry(FindSig(Rob1Sigs, str2, false), eb1.Expression);
                }
            }
            catch (System.Exception ex)
            {
            }
        }
예제 #2
0
        private void ZoneModlueM(string Rob1, TxObjectList Rob1Sigs, string Rob2, TxObjectList Rob2Sigs, string[] Zone, ITxPlcModule p1)
        {
            TxPlcExpressionBuilder eb1 = new TxPlcExpressionBuilder();

            try
            {
                foreach (string z in Zone)
                {
                    string str1 = textBox1.Text.Replace("Rob", Rob1).Replace("X", z);
                    string str2 = textBox3.Text.Replace("Rob", Rob2).Replace("X", z);
                    string str3 = textBox2.Text.Replace("Rob", Rob2).Replace("X", z);
                    string str4 = textBox2.Text.Replace("Rob", Rob1).Replace("X", z);

                    eb1.Add(FindSig(Rob1Sigs, str1, true));
                    eb1.Add(TxPlcExpressionOperator.And);
                    eb1.Add(FindSig(Rob2Sigs, str2, true));
                    eb1.Add(TxPlcExpressionOperator.And);
                    eb1.Add(TxPlcExpressionOperator.Not);
                    eb1.Add(FindSig(Rob2Sigs, str3, false));
                    p1.AddEntry(FindSig(Rob1Sigs, str4, false), eb1.Expression);
                }
            }
            catch (System.Exception ex)
            {
            }
        }