예제 #1
0
 /// <summary>
 /// Установить ConnectionHolder для инициализации конфигурации.
 /// </summary>
 /// <param name="aConnection">ConnectionHolder.</param>
 public void SetOracleConnection(OracleConnectionHolder aConnection)
 {
     oracleConnection = aConnection;
 }
예제 #2
0
파일: WagstaffBridge.cs 프로젝트: desla/AS
        /// <summary>
        /// Инициализация и настройска элементов системы.
        /// </summary>
        protected override void DoInitialize()
        {
            try {
                LoadConfiguration();

                Logger.Info("Инициализация...");
                opcConnection = new OpcConnectionHolder(configuration.opcConfiguration);
                opcConnection.SetHolderName(OPCHOLDER);
                opcConnection.SetCallback(this);
                oracleConnection = new OracleConnectionHolder(configuration.oracleConfiguration);
                oracleConnection.SetHolderName(ORACLEHOLDER);
                oracleConnection.SetCallback(this);
                wagsSqlConnection = new MsSqlConnectionHolder(configuration.wagsSqlConfiguration);
                wagsSqlConnection.SetHolderName(WAGSSQLHOLDER);
                wagsSqlConnection.SetCallback(this);
                bufferSqlConnection = new MsSqlConnectionHolder(configuration.bufSqlConfiguration);
                bufferSqlConnection.SetHolderName(BUFSQLHOLDER);
                bufferSqlConnection.SetCallback(this);

                wagstaffCurrdata = new DataReader();
                wagstaffCurrdata.SetCallback(this);
                wagstaffCurrdata.SetConfiguration(configuration.WagstaffCurdataConfiguration);
                wagstaffCurrdata.SetOpcConnectionHolder(opcConnection);

                wagstaffActivator = new DataReaderActivator();
                wagstaffActivator.SetOpcConnection(opcConnection);
                wagstaffActivator.SetDataReader(wagstaffCurrdata);
                wagstaffActivator.SetActivationItemName("[WAGT0]SYS_PV_StatePos");

                mixerCurrData = new DataReader();
                mixerCurrData.SetCallback(this);
                mixerCurrData.SetConfiguration(configuration.MixerCurrdataConfiguration);
                mixerCurrData.SetOpcConnectionHolder(opcConnection);

                its = new DataWriter();
                its.SetOracleConnectionHolder(oracleConnection);

                buffer = new DataBuffer();
                configuration.SetOracleConnection(oracleConnection); // для инициализации
                buffer.SetConfiguration(configuration);
                buffer.SetSqlConnection(bufferSqlConnection);
                buffer.SetDataWriter(its);
                buffer.SetAttemptsInterval(5 * 60 * 1000); // в миллисекундах

                castScheduleExport = new CastScheduleExport();
                castScheduleExport.SetCheckingInterval(60 * 1000);
                castScheduleExport.SetOracleConnection(oracleConnection);
                castScheduleExport.SetSqlConnection(wagsSqlConnection);

                recipeImport = new RecipeImport();
                recipeImport.SetCheckingInterval(60 * 1000);
                recipeImport.SetOracleConnection(oracleConnection);
                recipeImport.SetSqlConnection(wagsSqlConnection);

                opcConnection.OpenConnection();
                oracleConnection.OpenConnection();
                bufferSqlConnection.OpenConnection();
                wagsSqlConnection.OpenConnection();
            }
            catch (Exception ex) {
                Logger.Error(ex);
            }
        }
예제 #3
0
파일: DataWriter.cs 프로젝트: desla/AS
 /// <summary>
 /// Установить ConnectionHolder для ИТЦ.
 /// </summary>
 /// <param name="aConnectionHolder">ConnectionHolder.</param>
 public void SetOracleConnectionHolder(OracleConnectionHolder aConnectionHolder)
 {
     oracleConnection = aConnectionHolder;
 }