Esempio n. 1
0
 public void Initialize(OpcServer.OpcList opcName, string parameterName, double minValue, double maxValue, string opcTag, WindowSetParameter.ValueType valueType, int digit = 0, double?firstPrompt = null, double?secondPrompt = null, double?thirdPrompt = null, double?fourthPrompt = null, double?stepFeed = null)
 {
     _opcName      = opcName;
     ParameterName = parameterName;
     _minValue     = minValue;
     _maxValue     = maxValue;
     _opcTag       = opcTag;
     _valueType    = valueType;
     _digit        = digit;
     _firstPrompt  = firstPrompt;
     _secondPrompt = secondPrompt;
     _thirdPrompt  = thirdPrompt;
     _fourthPrompt = fourthPrompt;
     _stepFeed     = stepFeed;
 }
Esempio n. 2
0
 public static void SetParameter(OpcServer.OpcList opcName, string parameterName, double minValue, double maxValue, string opcTag, WindowSetParameter.ValueType valueType, Popup popup = null, int digit = 0, double?firstPrompt = null, double?secondPrompt = null, double?thirdPrompt = null, double?fourthPrompt = null, double?stepFeed = null, string additionalTag = "")
 {
     if (Static.Link)
     {
         WindowSetParameter window = new WindowSetParameter(opcName, parameterName, minValue, maxValue, opcTag, valueType, popup, digit, firstPrompt, secondPrompt, thirdPrompt, fourthPrompt, stepFeed, additionalTag);
         window.Show();
         window.SelText();
     }
     else
     {
         MessageBox.Show("Нет связи с ПЛК", "Ошибка");
     }
 }
Esempio n. 3
0
        //public static void ButtonClick(object obj, object obj1, string tag, float[] val)
        //{
        //    if (Static.Link)
        //    {
        //        if (Equals(obj, obj1))
        //        {
        //            try
        //            {
        //                bool err;
        //                OpcServer.GetInstance().GetOpc(OpcServer.OpcList.Rbu).cl.WriteArray(tag, val, out err);
        //                if (err)
        //                    MessageBox.Show("Возможно запись не прошла.\nПроверьте OPC-сервер или соответствующий тег",
        //                        "Предупреждение");
        //            }
        //            catch (Exception ex)
        //            {
        //                MessageBox.Show("Запись не прошла. Повторите ввод\n" + ex.Message, "Ошибка");
        //            }
        //        }
        //        else
        //        {
        //            MessageBox.Show("Ошибка проверки элемента", "Ошибка");
        //        }
        //    }
        //    else
        //    {
        //        MessageBox.Show("Нет связи с ПЛК", "Ошибка");
        //    }
        //}

        public static void SetParameter(object lbl, object lbl1, OpcServer.OpcList opcName, string parameterName, double minValue, double maxValue, string opcTag, WindowSetParameter.ValueType valueType, Popup popup = null, int digit = 0, double?firstPrompt = null, double?secondPrompt = null, double?thirdPrompt = null, double?fourthPrompt = null, double?stepFeed = null)
        {
            if (Static.Link)
            {
                if (Equals(lbl, lbl1))
                {
                    WindowSetParameter window = new WindowSetParameter(opcName, parameterName, minValue, maxValue, opcTag, valueType, popup, digit, firstPrompt, secondPrompt, thirdPrompt, fourthPrompt, stepFeed);
                    window.Show();
                    window.SelText();
                }
                else
                {
                    MessageBox.Show("Ошибка проверки элемента", "Ошибка");
                }
            }
            else
            {
                MessageBox.Show("Нет связи с ПЛК", "Ошибка");
            }
        }