public void RestartEpcisClient()
 {
     try
     {
         uploadingThread.Abort();
     }
     catch { }
     myJtextEpcisClient = new JtextEpicsClient(config.PvNames);
     uploadingThread    = new Thread(Uploading);
     uploadingThread.Start();
 }
Example #2
0
 public EPCISOperator(string configFilePath)
 {
     Config = new EPCISConfig(configFilePath);
     try
     {
         configEpcisClient = new JtextEpicsClient(Config.PvNames, null);
         isConfigOnline    = true;
     }
     catch
     {
         isConfigOnline = false;
     }
 }
Example #3
0
 public int TrySetPV(string pvName, int value)
 {
     if (Config.PvNames.Contains(pvName) && isConfigOnline)
     {
         try
         {
             configEpcisClient[pvName] = value;
             return(0);
         }
         catch (Exception e)
         {
             return(-1);
         }
     }
     else if (Config.PvNames.Contains(pvName) && !isConfigOnline)
     {
         try
         {
             configEpcisClient         = new JtextEpicsClient(Config.PvNames, null);
             configEpcisClient[pvName] = value;
             isConfigOnline            = true;
             return(0);
         }
         catch (Exception e)
         {
             return(-1);
         }
     }
     else
     {
         string[] name = new string[] { pvName };
         try
         {
             epcisClient         = new JtextEpicsClient(name);
             epcisClient[pvName] = value;
             return(0);
         }
         catch
         {
             return(-1);
         }
     }
 }
Example #4
0
 public object TryGetPV(string pvName)
 {
     if (Config.PvNames.Contains(pvName) && isConfigOnline)
     {
         try
         {
             return(configEpcisClient.GetPV(pvName));
         }
         catch (Exception e)
         {
             return("Exception! Error Message: " + e.ToString());
         }
     }
     else if (Config.PvNames.Contains(pvName) && !isConfigOnline)
     {
         try
         {
             configEpcisClient = new JtextEpicsClient(Config.PvNames, null);
             isConfigOnline    = true;
             return(configEpcisClient.GetPV(pvName));
         }
         catch (Exception e)
         {
             return("Exception! Error Message: " + e.ToString());
         }
     }
     else
     {
         string[] name = new string[] { pvName };
         try
         {
             epcisClient = new JtextEpicsClient(name);
             return(epcisClient.GetPV(pvName));
         }
         catch (Exception e)
         {
             return("Exception! Error Message: " + e.ToString());
         }
     }
 }