示例#1
0
 public static System.Boolean AddItemsTSS(
     OPCTrendLib.OPCData.OpcGroup target,
     OPCTrendLib.OPCData.OPCItemDef[] arrDef, out OPCTrendLib.OPCData.OPCItemResult[] arrRes)
 {
     arrRes = new OPCTrendLib.OPCData.OPCItemResult[1];
     return(true);
 }
示例#2
0
 public static void Refresh2TSS(
     OPCTrendLib.OPCData.OpcGroup target,
     OPCTrendLib.OPCDataInterface.OPCDATASOURCE sourceMode, System.Int32 transactionID, out System.Int32 cancelID)
 {
     cancelID = 1;
     return;
 }
示例#3
0
 public static OPCTrendLib.OPCData.OpcGroup AddGroupTSS(
     OPCTrendLib.OPCData.OpcServer target,
     System.String groupName, System.Boolean setActive, System.Int32 requestedUpdateRate)
 {
     //return target.AddGroup(groupName, setActive, requestedUpdateRate);
     OPCTrendLib.OPCDataInterface.IOPCServer server = null;
     OPCTrendLib.OPCData.OpcGroup            group  = new OPCTrendLib.OPCData.OpcGroup(ref server, false, groupName, setActive, requestedUpdateRate);
     return(group);
 }
示例#4
0
        public static System.Boolean RemoveItemsTSS(
            OPCTrendLib.OPCData.OpcGroup target,
            System.Int32[] arrHSrv, out System.Int32[] arrErr)
        {
            arrErr = new Int32[1];

            /*string currentmethod = Dottest.Framework.Stubs.CurrentTestMethod.Name;
             * if (currentmethod.Equals("TestRemoveOPCItem03"))
             * {
             *  throw new Exception("Error 0X40005660. The RPC server is unavailable.");
             * }*/
            return(true);
        }
示例#5
0
 public static System.Boolean AddItemsMSS(
     OPCTrendLib.OPCData.OpcGroup target,
     OPCTrendLib.OPCData.OPCItemDef[] arrDef, out OPCTrendLib.OPCData.OPCItemResult[] arrRes)
 {
     arrRes = null; object result;
     // NOTE: out and ref parameters are not passed from a test specific stub
     if (TestSpecificStubsUtil.RunTestSpecificStub(System.Reflection.MethodBase.GetCurrentMethod(), new object[] { target, arrDef, arrRes }, out result))
     {
         string currentmethod = Dottest.Framework.Stubs.CurrentTestMethod.Name;
         if (currentmethod.Equals("TestAddOPCItem04"))
         {
             arrRes = new OPCTrendLib.OPCData.OPCItemResult[1];
             OPCTrendLib.OPCData.OPCItemResult resu = new OPCTrendLib.OPCData.OPCItemResult();
             resu.Error = OPCTrendLib.OPCHeader.HRESULTS.OPC_E_UNKNOWNITEMID;
             arrRes[0]  = resu;
         }
         else if (currentmethod.Equals("TestAddOPCItem06"))
         {
             arrRes = null;
         }
         else if (currentmethod.Equals("TestAddOPCItem08"))
         {
             arrRes = new OPCTrendLib.OPCData.OPCItemResult[1];
         }
         else if (currentmethod.Equals("TestAddOPCItem07"))
         {
             arrRes = new OPCTrendLib.OPCData.OPCItemResult[1];
             OPCTrendLib.OPCData.OPCItemResult resu = new OPCTrendLib.OPCData.OPCItemResult();
             resu.Error        = OPCTrendLib.OPCHeader.HRESULTS.S_OK;
             resu.AccessRights = OPCTrendLib.OPCDataInterface.OPCACCESSRIGHTS.OPC_WRITEABLE;
             arrRes[0]         = resu;
         }
         else
         {
             arrRes = new OPCTrendLib.OPCData.OPCItemResult[1];
             OPCTrendLib.OPCData.OPCItemResult resu = new OPCTrendLib.OPCData.OPCItemResult();
             resu.Error        = OPCTrendLib.OPCHeader.HRESULTS.S_OK;
             resu.AccessRights = OPCTrendLib.OPCDataInterface.OPCACCESSRIGHTS.OPC_READABLE;
             arrRes[0]         = resu;
         }
         return(true);
     }
     else
     {
         return(target.AddItems(arrDef, out arrRes));
     }
 }
示例#6
0
 public static System.Boolean RemoveItemsMSS(
     OPCTrendLib.OPCData.OpcGroup target,
     System.Int32[] arrHSrv, out System.Int32[] arrErr)
 {
     arrErr = null; object result;
     // NOTE: out and ref parameters are not passed from a test specific stub
     if (TestSpecificStubsUtil.RunTestSpecificStub(System.Reflection.MethodBase.GetCurrentMethod(), new object[] { target, arrHSrv, arrErr }, out result))
     {
         arrErr = new Int32[1];
         string currentmethod = Dottest.Framework.Stubs.CurrentTestMethod.Name;
         if (currentmethod.Equals("TestRemoveOPCItem03"))
         {
             throw new Exception("Error 0X40005660. The RPC server is unavailable.");
         }
         return(true);
     }
     else
     {
         return(target.RemoveItems(arrHSrv, out arrErr));
     }
 }
示例#7
0
 public static void Refresh2MSS(
     OPCTrendLib.OPCData.OpcGroup target,
     OPCTrendLib.OPCDataInterface.OPCDATASOURCE sourceMode, System.Int32 transactionID, out System.Int32 cancelID)
 {
     cancelID = 0; object result;
     // NOTE: out and ref parameters are not passed from a test specific stub
     if (TestSpecificStubsUtil.RunTestSpecificStub(System.Reflection.MethodBase.GetCurrentMethod(), new object[] { target, sourceMode, transactionID, cancelID }, out result))
     {
         string currentmethod = Dottest.Framework.Stubs.CurrentTestMethod.Name;
         if (currentmethod.Equals("TestAddOPCItem09"))
         {
             throw new System.Runtime.InteropServices.COMException();
         }
         else if (currentmethod.Equals("TestAddOPCItem10"))
         {
             throw new System.Runtime.InteropServices.COMException("Error -- The RPC server is unavailable.");
         }
         return;
     }
     else
     {
         target.Refresh2(sourceMode, transactionID, out cancelID);
     }
 }