private void siteEditSaveButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int       siteId = _sitesPanel.SelectedItemId;
         sconnSite site   = sconnDataShare.getSite(siteId);
         site.siteName            = SiteNameInput.Text;
         site.serverIP            = SiteHostnameInput.Text;
         site.serverPort          = int.Parse(SitePortInput.Text);
         site.statusCheckInterval = int.Parse(SiteIntervalInput.Text);
         site.authPasswd          = SitePasswordInput.Text;
         _configManager.saveConfig();
         InitSiteList();  //reload gui
         ConfigChanged.Invoke(this, new EventArgs());
     }
     catch (Exception err)
     {
     }
 }
예제 #2
0
        private void Bootstrap_FindAndLoad_UsbDevices()
        {
            USB usbcomm = new USB();
            //   usbcomm.UsbComm_Test_Trx();
            //  usbcomm.UsbComm_Sample_Trx();
            bool usbConn = usbcomm.TestConnection();

            if (usbConn)
            {
                sconnSite site = new sconnSite("USB_PROG", 400, "", 0, "");   //string siteName, int intervalMs, string server, int port, string password)
                site.UsbCom = true;
                sconnDataShare.addSite(site);
                _configManager.saveConfig();
            }


            // string resp = usbcomm.ReadUsbBlocking();
            // usbcomm.TransmitLoop();
        }