public void AtCommandTester() { int dacServerPort = 5055; var _DacServer = new GprsDtuServer(dacServerPort); var dtm = new DACTaskManager(_DacServer, DbAccessorHelper.DbAccessor.QueryDtuNodes(), DbAccessorHelper.DbAccessor.GetUnfinishedTasks()); string tid = ""; uint dtu = 2; int taskId = dtm.ArrangeInstantTask(tid, dtu, this.cmds, null); }
public void TestMsSqlInstantTask() { // Client Simulator client = new DtuClient("127.0.0.1", 5055); client.OnReceived += OnMsg; GprsDtuServer _server = new GprsDtuServer(5055); _server.Start(); client.Connect(20120049, "18651895100", "192.168.1.42"); DbAccessorHelper.Init(new MsDbAccessor(this.mssqlConnStr)); // Thread.Sleep(8000); string tid = new Guid().ToString(); List <uint> sensors = new List <uint> { (uint)17 }; DACTask ut = new DACTask(tid, 1, sensors, TaskType.INSTANT, this.OnTaskFinished); // tm = new DACTaskManager(_server, DbAccessorHelper.DbAccessor.QueryDtuNodes(), DbAccessorHelper.DbAccessor.GetUnfinishedTasks()); // tm.DealDailyWork(); // Thread.Sleep(8000); int r = tm.ArrangeInstantTask(tid, 1, sensors, this.OnTaskFinished, false); System.Console.WriteLine("result = {0}", r); }