Exemple #1
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="aTopicName">Имя топика для OPC-тегов.</param>
 /// <param name="aOpcConnection">Соединеие с OPC-сервером.</param>
 public InputAreaData(string aTopicName, OpcConnectionHolder aOpcConnection)
 {
     IdCheckOutputItem = new DataItem(aTopicName + ITEMID_INPUTAREA_ID_CHECK_OUT, aOpcConnection);
     IdNumberOutputItem = new DataItem(aTopicName + ITEMID_INPUTAREA_ID_NUMBER_OUT, aOpcConnection);
     IdCheckInputItem = new DataItem(aTopicName + ITEMID_INPUTAREA_ID_CHECK_IN, aOpcConnection);
     IdNumberInputItem = new DataItem(aTopicName + ITEMID_INPUTAREA_ID_NUMBER_IN, aOpcConnection);
 }
Exemple #2
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="aTopicName">Имя топика.</param>
 /// <param name="aOpcConnection">Соединение с OPC-сервером.</param>
 public OutputAreaData(string aTopicName, OpcConnectionHolder aOpcConnection)
 {
     IdCheckOutputItem = new DataItem(aTopicName + ITEMID_OUTPUTAREA_ID_CHECK_OUT, aOpcConnection);
     IdNumberOutputItem = new DataItem(aTopicName + ITEMID_OUTPUTAREA_ID_NUMBER_OUT, aOpcConnection);
     IdCheckInputItem = new DataItem(aTopicName + ITEMID_OUTPUTAREA_ID_CHECK_IN, aOpcConnection);
     IdNumberInputItem = new DataItem(aTopicName + ITEMID_OUTPUTAREA_ID_NUMBER_IN, aOpcConnection);
     WeightOutputItem = new DataItem(aTopicName + ITEMID_OUTPUTAREA_WEIGHT_OUT, aOpcConnection);
     LengthOutputItem = new DataItem(aTopicName + ITEMID_OUTPUTAREA_LENGTH_OUT, aOpcConnection);
 }
Exemple #3
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="aName"></param>
 /// <param name="aOpcConnection"></param>
 public DataItem(string aName, OpcConnectionHolder aOpcConnection)
 {
     Name = aName;
     opcConnection = aOpcConnection;
 }
Exemple #4
0
        /// <summary>
        /// Инициализация.
        /// </summary>
        protected override void DoInitialize()
        {
            try {
                Logger.Info("Инициализация MossnerBridge...");

                oracleConnection = new OracleConnectionHolder(configuration.OracleConfiguration);
                oracleConnection.SetHolderName(ORACLEHOLDER);
                oracleConnection.SetCallback(this);

                opcConnection = new OpcConnectionHolder(configuration.OpcConfiguration);
                opcConnection.SetHolderName(OPCHOLDER);
                opcConnection.SetCallback(this);

                its = new Its();
                its.SetOracleHolder(oracleConnection);

                liveBit = new LiveBit(configuration.OpcConfiguration.TopicName);
                liveBit.SetOpcConnection(opcConnection);

                controllerClient = new ControllerClient(configuration.OpcConfiguration.TopicName, opcConnection);
                controllerClient.SetCallback(this);

                oracleConnection.OpenConnection();
                opcConnection.OpenConnection();
                Logger.Info("Инициализация MossnerBridge завершена.");
            }
            catch (Exception ex) {
                Logger.Error(ex);
            }
        }
Exemple #5
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="aTopicName">Имя топика.</param>
 /// <param name="aOpcConnection">Соединение с OPC-сервером.</param>
 public ControllerClient(string aTopicName, OpcConnectionHolder aOpcConnection)
 {
     inputArea = new InputAreaData(aTopicName, aOpcConnection);
     outputArea = new OutputAreaData(aTopicName, aOpcConnection);
     scrabArea = new ScrabAreaData(aTopicName, aOpcConnection);
 }
Exemple #6
0
 /// <summary>
 /// Устанавливает соединение с OPC-сервером.
 /// </summary>
 /// <param name="aOpcConnection"></param>
 public void SetOpcConnection(OpcConnectionHolder aOpcConnection)
 {
     opcConnection = aOpcConnection;
 }