示例#1
0
        private void AlertListeners(object aCurrentValue, object aQuality, object aTimestamp)
        {
            var eventArgs = new OpcValueChangedEventArgs(aCurrentValue, (int)aQuality, (DateTime)aTimestamp);

            foreach (var listener in listeners)
            {
                listener.OnValueChanged(this, eventArgs);
            }
        }
示例#2
0
 /// <summary>
 /// Срабатывает при изменении значения тега.
 /// </summary>
 /// <param name="aOpcValue">Тег ОРС.</param>
 /// <param name="aValueChangedEventArgs">Параметры.</param>
 public void OnValueChanged(IOpcValue aOpcValue, OpcValueChangedEventArgs aValueChangedEventArgs)
 {
     if (aOpcValue.Name.Equals(opcTagsList[DB601_NEW_BATCH_REQUEST])) {
         if (Convert.ToBoolean(aValueChangedEventArgs.Value)) {
             CastPlanRequest();
             TryResetCastPlanRequest();
         }
     }
     //else if (aOpcValue.Name.Equals(opcTagsList[DB620_DATA_READY])) {
     //    if (Convert.ToBoolean(aValueChangedEventArgs.Value)) {
     //        FinishedProductIsReady();
     //        TryResetFinishedProduct();
     //    }
     //}
     else {
         logger.Error("Неизвестный ОРС-тег: " + aOpcValue.Name);
     }
 }
 private void AlertListeners(object aCurrentValue, object aQuality, object aTimestamp)
 {
     var eventArgs = new OpcValueChangedEventArgs(aCurrentValue, (int)aQuality, (DateTime)aTimestamp);
     foreach (var listener in listeners) {
         listener.OnValueChanged(this, eventArgs);
     }
 }
示例#4
0
文件: CastLine.cs 项目: desla/LK
 public void OnValueChanged(IOpcValue aOpcValue, OpcValueChangedEventArgs aValueChangedEventArgs)
 {
     if (aOpcValue.Name == DB600_NEW_BATCH_RECEIVED) {
         if ((bool)aValueChangedEventArgs.Value == true) {
             Console.WriteLine("Получены данные из ИТС:");
             Console.WriteLine("Номер плавки: " + tag[DB600_CAST_NUM].ReadCurrentValue());
             Console.WriteLine("Номер миксера: " + tag[DB600_FURNACE_NUM].ReadCurrentValue());
             Console.WriteLine("Идентификатор плавки: " + tag[DB600_MELT_ID].ReadCurrentValue());
             Console.WriteLine("Наименование продукции: " + tag[DB600_PRODUCT_NAME].ReadCurrentValue());
             aOpcValue.WriteValue("false");
         }
     }
 }
        /// <summary>
        /// Колбэк на правую границу массива.        
        /// </summary>
        /// <param name="aOpcValue"></param>
        /// <param name="aValueChangedEventArgs"></param>
        public void OnValueChanged(IOpcValue aOpcValue, OpcValueChangedEventArgs aValueChangedEventArgs)
        {
            if (!isScanning) {
                Console.WriteLine("FAIL " + aValueChangedEventArgs.Value);
                return;
            }

            var rightIndex = Convert.ToInt32(aValueChangedEventArgs.Value);
            AddPreviosDataBlockToQueue(rightIndex);
        }
 public void OnValueChanged(IOpcValue aOpcValue, OpcValueChangedEventArgs aEventArgs)
 {
     if (listener != null) {
         listener.OnActivationTagValueChanged((bool)aEventArgs.Value);
     }
 }