コード例 #1
0
        public void WriteBitWise(string dbName, Int64 CTID, int value, AgentType agentType)
        {
            DataTable table;
            DataRow   row;

            if (agentType.Equals(AgentType.Slave))
            {
                //find the table
                table = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)];
                //find the row
                row = table.Select("CTID = " + Convert.ToString(CTID) + " AND slaveIdentifier = '" + Config.Slave + "'")[0];
            }
            else
            {
                //find the table
                table = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)];
                //find the row
                row = table.Select("CTID = " + Convert.ToString(CTID))[0];
            }

            //update the row if it doesn't contain the specified bit
            if ((row.Field <int>("syncBitWise") & value) == 0)
            {
                row["syncBitWise"] = row.Field <int>("syncBitWise") + value;
                //commit the changes
                //table.AcceptChanges();
            }
        }
コード例 #2
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (i < locations.Count)
        {
            if (alive[i])
            {
                Coordinate currentPos = locations[i];
                transform.position = new Vector2(currentPos.x, currentPos.y);
            }
            else if (!dead)
            {
                renderer.color = Color.blue;
                dead           = true;
            }
            i++;
        }
        else
        {
            if (type.Equals(AgentType.APID))
            {
                renderer.color = Color.white;
            }
            else
            {
                renderer.color = Color.red;
            }

            i    = 0;
            dead = false;
        }
    }
コード例 #3
0
 public DataRow GetLastCTBatch(string dbName, AgentType agentType, string slaveIdentifier = "")
 {
     //for slave we have to pass the slave identifier in and use tblCTSlaveVersion
     if (agentType.Equals(AgentType.Slave))
     {
         DataTable tblCTSlaveVersion = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)];
         return(tblCTSlaveVersion.Select("slaveIdentifier = '" + slaveIdentifier + "'", "CTID DESC")[0]);
     }
     else
     {
         DataTable tblCTVersion = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)];
         return(tblCTVersion.Select(null, "CTID DESC")[0]);
     }
 }
コード例 #4
0
        public int ReadBitWise(string dbName, Int64 CTID, AgentType agentType)
        {
            DataTable table;
            DataRow   row;

            if (agentType.Equals(AgentType.Slave))
            {
                //find the table
                table = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)];
                //find the row
                row = table.Select("CTID = " + Convert.ToString(CTID) + " AND slaveIdentifier = '" + Config.Slave + "'")[0];
            }
            else
            {
                //find the table
                table = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)];
                //find the row
                row = table.Select("CTID = " + Convert.ToString(CTID))[0];
            }
            return(row.Field <int>("syncBitWise"));
        }
コード例 #5
0
ファイル: TestDataUtils.cs プロジェクト: mavencode01/tesla
        public void WriteBitWise(string dbName, Int64 CTID, int value, AgentType agentType)
        {
            DataTable table;
            DataRow row;
            if (agentType.Equals(AgentType.Slave)) {
                //find the table
                table = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)];
                //find the row
                row = table.Select("CTID = " + Convert.ToString(CTID) + " AND slaveIdentifier = '" + Config.Slave + "'")[0];
            } else {
                //find the table
                table = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)];
                //find the row
                row = table.Select("CTID = " + Convert.ToString(CTID))[0];
            }

            //update the row if it doesn't contain the specified bit
            if ((row.Field<int>("syncBitWise") & value) == 0) {
                row["syncBitWise"] = row.Field<int>("syncBitWise") + value;
                //commit the changes
                //table.AcceptChanges();
            }
        }
コード例 #6
0
ファイル: TestDataUtils.cs プロジェクト: mavencode01/tesla
 public int ReadBitWise(string dbName, Int64 CTID, AgentType agentType)
 {
     DataTable table;
     DataRow row;
     if (agentType.Equals(AgentType.Slave)) {
         //find the table
         table = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)];
         //find the row
         row = table.Select("CTID = " + Convert.ToString(CTID) + " AND slaveIdentifier = '" + Config.Slave + "'")[0];
     } else {
         //find the table
         table = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)];
         //find the row
         row = table.Select("CTID = " + Convert.ToString(CTID))[0];
     }
     return row.Field<int>("syncBitWise");
 }
コード例 #7
0
ファイル: TestDataUtils.cs プロジェクト: mavencode01/tesla
 public DataRow GetLastCTBatch(string dbName, AgentType agentType, string slaveIdentifier = "")
 {
     //for slave we have to pass the slave identifier in and use tblCTSlaveVersion
     if (agentType.Equals(AgentType.Slave)) {
         DataTable tblCTSlaveVersion = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)];
         return tblCTSlaveVersion.Select("slaveIdentifier = '" + slaveIdentifier + "'", "CTID DESC")[0];
     } else {
         DataTable tblCTVersion = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)];
         return tblCTVersion.Select(null, "CTID DESC")[0];
     }
 }