예제 #1
0
파일: InputAreaData.cs 프로젝트: desla/AS
 /// <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);
 }
예제 #2
0
파일: OutputAreaData.cs 프로젝트: desla/AS
 /// <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);
 }
예제 #3
0
파일: DataItem.cs 프로젝트: desla/AS
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="aName"></param>
 /// <param name="aOpcConnection"></param>
 public DataItem(string aName, OpcConnectionHolder aOpcConnection)
 {
     Name = aName;
     opcConnection = aOpcConnection;
 }
예제 #4
0
파일: MossnerBridge.cs 프로젝트: desla/AS
        /// <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);
            }
        }
예제 #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);
 }
예제 #6
0
파일: LiveBit.cs 프로젝트: desla/AS
 /// <summary>
 /// Устанавливает соединение с OPC-сервером.
 /// </summary>
 /// <param name="aOpcConnection"></param>
 public void SetOpcConnection(OpcConnectionHolder aOpcConnection)
 {
     opcConnection = aOpcConnection;
 }