Exemplo n.º 1
0
Arquivo: Its.cs Projeto: desla/AS
 /// <summary>
 /// Устанавливает соединение с базой данных.
 /// </summary>
 /// <param name="aOracleConnection">Соединение с БД.</param>
 public void SetOracleHolder(OracleConnectionHolder aOracleConnection)
 {
     oracleConnection = aOracleConnection;
 }
Exemplo n.º 2
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);
            }
        }