Home > Net >  liandongtiaoshi
liandongtiaoshi

Time:11-25

Public void TdTestTask (TDObject obj, double stdTpt, double dPc)
{
for (int i=0; I & lt; Obj. BatName. Count; I++)
{
String sTempIp=obj. BatName [I];
# region - continue to command -
//add thread task
if (! TdTask. The Contains (RealDataQueue [sTempIp]. Addr + "-" + RealDataQueue [sTempIp] Chid)
& & (EnumState) RealDataBuffer. Instance. RealDataQueue [sTempIp] RealtimeData. Stepname==EnumState. WaitTempDebug)
{
TdTask. Add (RealDataQueue [sTempIp]. Addr + "-" + RealDataQueue [sTempIp] Chid);
Thread.Sleep(1000);
Task. Factory. StartNew (()=& gt;
{
Console. WriteLine (" add thread: "+ sTempIp);
//create the clock
A Stopwatch stopWath=new Stopwatch ();
StopWath. Start ();

While (true)
{
Thread.Sleep(1000);
//the Console. WriteLine (" time: "+ stopWath. ElapsedMilliseconds. ToString ());

If ((EnumState) RealDataBuffer. Instance. RealDataQueue [sTempIp] RealtimeData. Stepname!=EnumState. WaitTempDebug)
{
Thread.sleep (2000);
TdTask. Remove (RealDataQueue [sTempIp]. Addr + "-" + RealDataQueue [sTempIp] Chid);
break;
}
Arriving//whether the temperature and time 30 minutes
Double dTdTmp=RealDataQueue [sTempIp]. RealtimeAuxData. Auxtempperc [0]/1000.000;
Double hldTmp=TdBuffer. Instance. GetIncubatorTemp (RealDataQueue [sTempIp]. Addr, RealDataQueue [sTempIp] Chid);

//the Console. WriteLine (" dTdTmp: "+ dTdTmp. ToString ());
//the Console. WriteLine (" stdTpt: "+ stdTpt. ToString ());
//the Console. WriteLine (" dPc: "+ dPc. The ToString ());
//the Console. WriteLine (" hldTmp: "+ hldTmp. ToString ());
If ((dTdTmp & gt;=(stdTpt - dPc) & amp; & DTdTmp & lt;=(stdTpt + dPc)) & amp; &
(hldTmp & gt;=(stdTpt 0.5) & amp; & HldTmp & lt;=(0.5) stdTpt +))
{
If (stopWath ElapsedMilliseconds & gt;
=1800000){
Console. WriteLine (" continue to command: "+ stopWath. ElapsedMilliseconds. ToString ());
ActionBase action=new JumpAction (null, 0).
List Param=new List (a);
List LstSelect=new List (a);

LstSelect. The Clear ();
LstSelect. Add (RealDataQueue [sTempIp]);
Param. The Clear ();
The Command Command=new Command (EnmuControl. Jump, lstSelect, 0);
The command. Stepguid="0";//currentObject. Stepguid;
Command. Stepguid=command. Stepguid. Replace (" \ 0 ", ""). The Trim ();
Param. Add (command);
Action. DoAction (param, RealDataQueue [sTempIp]. Addr, RealDataQueue [sTempIp] Chid);
Console. WriteLine (" removing the thread: "+ RealDataQueue [sTempIp]. Addr +" - "+ RealDataQueue [sTempIp] Chid);
//the Console. WriteLine (" time: "+ stopWath. ElapsedMilliseconds. ToString ());
Thread.sleep (2000);
TdTask. Remove (RealDataQueue [sTempIp]. Addr + "-" + RealDataQueue [sTempIp] Chid);
break;
}
}
The else
StopWath. Restart ();
}
}
);
}
# endregion
}
}
# endregion
  • Related