private void lst_Servers_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (lst_Servers.SelectedItem != null)
     {
         mServerItem selectedServer = (mServerItem)lst_Servers.SelectedItem;
         Model.selectedOPCserver.UrlString = selectedServer.UrlString;
     }
 }
        private void Connect()
        {
            mServerItem selected_Server = (mServerItem)lst_Servers.SelectedItem;

            if (selected_Server != null)
            {
                if (opcServer.ConnectServer(selected_Server.UrlString))
                {
                    Model.changeState(ModelState.opcConneted);
                }
                Model.selectedOPCserver = opcServer.selectedServer;
            }
        }
Esempio n. 3
0
        public void Initialize()
        {
            opcListServers      = new ObservableCollection <mServerItem>();
            opcTreeNodes        = new ObservableCollection <mTreeNode>();
            opcListTagsInBranch = new ObservableCollection <mItem>();
            opcMonitoredTags    = new ObservableCollection <mTag>();
            opcSubscribedTags   = new ObservableCollection <mTag>();
            selectedOPCserver   = new mServerItem(true);

            messageLog = new ObservableCollection <gLogEntity>();
            messageLog.Add(new gLogEntity("Start log"));

            btn_ClearTags_isEnable   = false;
            btn_Connect_isEnable     = true;
            btn_LoadConfig_isEnable  = true;
            btn_SaveConfig_isEnable  = false;
            btn_TryConfig_isEnable   = false;
            btn_Subscribe_isEnable   = false;
            btn_SyncOff_isEnable     = true;
            btn_SyncOn_isEnable      = true;
            btn_Unsubscribe_isEnable = false;
            btn_Search_isEnable      = true;

            list_Branches_isEnable       = true;
            list_Servers_isEnable        = true;
            list_SubscribedTags_isEnable = true;
            list_Tags_isEnable           = true;

            dgrid_Monitored_isVisible  = false;
            dgrid_Subscribed_isVisible = true;

            lbl_InitConnection_isVisible = true;

            infoLineColor = new SolidColorBrush(Colors.White);

            isLocalDBConnected  = false;
            isRemoteDBConnected = false;
            isSyncInProgress    = false;

            gError   = new gErrorEntity(1, "Created in model");
            opcError = new vmError(gError);
        }