Ejemplo n.º 1
0
 public bool TestConnection()
 {
     if (!Testing)
     {
         try
         {
             Testing = true;
             if (ProcessConnectionServer != null)
             {
                 try
                 {
                     ProcessConnectionServer.CallTest();
                 }
                 catch (Exception ex)
                 {
                     ProcessConnectionServer = null;
                     Database.LogCriticalError("Could not establish connection with server : IP='" + WorkbenchWPF.ServerIP + "' Port='" + Database.ServerPort + "' - " + ex.Message);
                     return(false);
                 }
                 return(true);
             }
             return(false);
         }
         finally
         {
             Testing = false;
             FirstConnectionAttempted = true;
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
        public void SetDataPoint(int l_iAutomationFunctionId, int l_iPortId, Object p_Value)
        {
            if (TestConnection() == true)
            {
                long   l_iUniqueKey = CreateUniqueKey(l_iAutomationFunctionId, l_iPortId);
                long[] SetValueKey  = new long[] { l_iUniqueKey };
                Object p_ValueUsed  = p_Value;
                Type   l_ValueType  = p_Value.GetType();
                switch (l_ValueType.Name.ToLower())
                {
                case "float":
                case "single":
                {
                    float  l_fValue = (float)p_Value;
                    double l_dValue = System.Convert.ToDouble(l_fValue);
                    p_ValueUsed = l_dValue;
                }
                break;

                default:
                    break;
                }
                Object[] SetValue = new Object[] { p_ValueUsed };
                ProcessConnectionServer.SetProperties(SetValueKey, SetValue);
            }
        }
Ejemplo n.º 3
0
 public int ReceiveFocusOnControllerPrototypeCommand()
 {
     if (TestConnection() == true)
     {
         return(ProcessConnectionServer.ReceiveFocusOnControllerPrototypeCommand());
     }
     return(0);
 }
Ejemplo n.º 4
0
 public String GetDesignation(int p_iAutomationFunctionId)
 {
     if (TestConnection() == true)
     {
         return(ProcessConnectionServer.GetDesignation(p_iAutomationFunctionId));
     }
     return(String.Empty);
 }
Ejemplo n.º 5
0
 public void FocusOnAutomationFunction(int p_iAutomationFunctionId)
 {
     if (TestConnection() == true &&
         WorkbenchWPF.Instance.EnableSimuPactSelection)
     {
         ProcessConnectionServer.FocusOnAutomationFunction(p_iAutomationFunctionId);
     }
 }
Ejemplo n.º 6
0
 public void GetData()
 {
     if (TestConnection() == true)
     {
         try
         {
             if (Keys != null)
             {
                 Object[] l_NewValues   = ProcessConnectionServer.GetProperties(Keys);
                 int      l_iIndexCount = 0;
                 foreach (long l_iKey in Keys)
                 {
                     Object l_NewValue = l_NewValues[l_iIndexCount];
                     GetValueDictionary[l_iKey] = l_NewValue;
                     l_iIndexCount++;
                 }
             }
         }
         catch (Exception ex)
         {
             Database.LogError("Exception occured during ProcessConnection GetData() : " + ex.Message);
         }
     }
 }