2730 lines
134 KiB
C#
2730 lines
134 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Text;
|
|||
|
using System.Data;
|
|||
|
using System.Resources;
|
|||
|
using System.Drawing;
|
|||
|
using DBFactory;
|
|||
|
using ICommLayer;
|
|||
|
using CommLayerFactory;
|
|||
|
using System.Globalization;
|
|||
|
using System.Net;
|
|||
|
using Microsoft.VisualBasic;
|
|||
|
using System.Web.UI.WebControls;
|
|||
|
using System.Linq;
|
|||
|
namespace ControlSystem
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Creator:Richard.liu
|
|||
|
/// <20><><EFBFBD><EFBFBD><EFBFBD>豸״̬<D7B4><CCAC>
|
|||
|
///
|
|||
|
/// <20><>Ҫ<EFBFBD><D2AA><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// 1.<2E><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>״̬<D7B4><CCAC><EFBFBD>߱<EFBFBD><DFB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>F_SerialNumber<65><72>=<3D><>ǰֵ<C7B0><D6B5>
|
|||
|
/// 2.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬<EFBFBD><EBA3AC><EFBFBD><EFBFBD>һ<EFBFBD>Ź<EFBFBD><C5B9><EFBFBD><EFBFBD>룩
|
|||
|
/// 3.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֳ<EFBFBD><D6B3><EFBFBD><EFBFBD>ƴ<EFBFBD><C6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>źţ<C5BA>1-<2D>ط<EFBFBD><D8B7><EFBFBD>ǰ<EFBFBD>豸ָ<E8B1B8><D6B8>
|
|||
|
/// 2-<2D><><EFBFBD><EFBFBD><EFBFBD>ĵ<DEB8>ǰ<EFBFBD>豸<EFBFBD><E8B1B8>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF>λ<EFBFBD><CEBB>
|
|||
|
/// 4.<2E><><EFBFBD>ٻ<EFBFBD><D9BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD>λ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>ͬһ<CDAC><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>̽<EFBFBD><CCBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ǰλ<C7B0>ã<EFBFBD>
|
|||
|
/// <20><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// 5.<2E><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȳ<EFBFBD><C8B2><EFBFBD><EFBFBD>жϣ<D0B6><CFA3><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>ȣ<EFBFBD>
|
|||
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Я<EFBFBD><D0AF><EFBFBD><EFBFBD><EFBFBD>⣬<EFBFBD><E2A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Я<EFBFBD><D0AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// 6.<2E><><EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><C5B4>ݵ<EFBFBD><DDB5><EFBFBD>ǰ<EFBFBD>豸ʱ<E8B1B8><CAB1><EFBFBD>ѱ<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>ǰһ<C7B0>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// ͬʱ<CDAC>ѵ<EFBFBD>ǰ<EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// 7.<2E><><EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD><DDB9>ϵ㵥<CFB5><E3B5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>õķ<C3B5><C4B7><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD><D0B7><EFBFBD>
|
|||
|
/// 8.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// 9.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>豸״̬
|
|||
|
/// </summary>
|
|||
|
public class CGetState
|
|||
|
{
|
|||
|
Model.MError errs;
|
|||
|
Model.MDevice devinfo;
|
|||
|
ISendDeviceOrder sdo;
|
|||
|
IGetDeviceState gds;
|
|||
|
CCommonFunction ccf = new CCommonFunction();
|
|||
|
DBOperator dbo1 =CStaticClass.dbo1;
|
|||
|
DBOperator dbo = CStaticClass.dbo;
|
|||
|
DBOperator dboM =CStaticClass.dboM;
|
|||
|
//20100108
|
|||
|
CControl ccl = new CControl();
|
|||
|
string _CGetStateError = "";//<2F><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
|
|||
|
public string CGetStateError
|
|||
|
{
|
|||
|
get { return _CGetStateError; }
|
|||
|
set { _CGetStateError = value; }
|
|||
|
}
|
|||
|
public int[] _States;
|
|||
|
int _fid;
|
|||
|
int _mti;
|
|||
|
//int _iotype=0;
|
|||
|
//int _endnode=0;
|
|||
|
/// <summary>
|
|||
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>豸<EFBFBD><E8B1B8>״̬
|
|||
|
/// </summary>
|
|||
|
public CGetState()
|
|||
|
{
|
|||
|
//dbo.Open();
|
|||
|
//if (dboM.Open() == false)
|
|||
|
//{
|
|||
|
// if (FrmControlMonitor.FormInstance.GetObjectText("tsStatus").IndexOf("<22><><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD>") < 0)
|
|||
|
// {
|
|||
|
|
|||
|
// FrmControlMonitor.FormInstance.FlashPanit("tsStatus", "<22><><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD>", true);
|
|||
|
// }
|
|||
|
//}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
private static Dictionary<string, DateTime> _lastExecTimeDict = new Dictionary<string, DateTime>();
|
|||
|
|
|||
|
// <20><><EFBFBD>Ķ<EFBFBD>ʱ
|
|||
|
/// <summary>
|
|||
|
/// <20><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8>"<22><><EFBFBD><EFBFBD>"ʱ ɾ<><C9BE><EFBFBD>豸ָ<E8B1B8><D6B8> , <20><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8>ռ<EFBFBD><D5BC>״̬F_LockedState=0<><30>
|
|||
|
///·<><C2B7><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8>F_LockedDeviceIndex<65><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>Ӧ<EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
|||
|
///
|
|||
|
///<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>豸ָ<E8B1B8><D6B8><EFBFBD><EFBFBD>? <20><>,<2C><>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IO_Control<6F><6C>FSTATUS=2<><32>"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
/// T_Manage_Task<73><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>״̬FSTATUS=2 <20><>
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public void GetDeviceState()
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
DataView dv=new DataView();
|
|||
|
DataView dvm = new DataView();
|
|||
|
//20091107
|
|||
|
DataView dvmo = new DataView();
|
|||
|
int devKind;
|
|||
|
|
|||
|
int DeviceIdx;
|
|||
|
int TaskIdx=0;
|
|||
|
StringBuilder[] wv = new StringBuilder[1]{ new StringBuilder("")} ;
|
|||
|
StringBuilder[] witemnames = new StringBuilder[1] { new StringBuilder("") };
|
|||
|
//20100617<31><37><EFBFBD>Ӻ<D3BA><CDB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸,<2C><><EFBFBD><EFBFBD>30
|
|||
|
//20120915
|
|||
|
|
|||
|
DataView dd = dbo.ExceSQL("SELECT F_DeviceIndex,F_DeviceKindIndex,F_MaxSendCount,F_SendInterval FROM T_Base_Device WHERE (F_DeviceKindIndex = 1) OR (F_DeviceKindIndex = 2 ) OR (F_DeviceKindIndex = 4) OR (F_DeviceKindIndex = 7) OR (F_DeviceKindIndex = 6) OR (F_DeviceKindIndex = 30)").Tables[0].DefaultView;
|
|||
|
|
|||
|
for (int j = 0; j < dd.Count; j++)
|
|||
|
{
|
|||
|
DateTime dt1 = DateTime.Now;
|
|||
|
DeviceIdx = Convert.ToInt32(dd[j]["F_DeviceIndex"]);
|
|||
|
devKind = Convert.ToInt32(dd[j]["F_DeviceKindIndex"]);
|
|||
|
//20100609
|
|||
|
devinfo = Model.CGetInfo.GetDeviceInfo(DeviceIdx);
|
|||
|
|
|||
|
//ɨ<><C9A8>ͷ
|
|||
|
if (dd[j]["F_DeviceKindIndex"].ToString() == "7")
|
|||
|
{
|
|||
|
string gdata2 = CStaticClass.GetStringData(DeviceIdx);
|
|||
|
if (!string.IsNullOrEmpty(gdata2))
|
|||
|
{
|
|||
|
string cleanStr = gdata2.Replace("\0", "");
|
|||
|
DateTime now = DateTime.Now;
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>60<36><30>δ<EFBFBD><CEB4><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>ֹ<EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
var keysToRemove = _lastExecTimeDict
|
|||
|
.Where(kv => (now - kv.Value).TotalSeconds > 60)
|
|||
|
.Select(kv => kv.Key)
|
|||
|
.ToList();
|
|||
|
|
|||
|
foreach (var key in keysToRemove)
|
|||
|
{
|
|||
|
_lastExecTimeDict.Remove(key);
|
|||
|
}
|
|||
|
|
|||
|
// <20>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫִ<D2AA><D6B4><EFBFBD><EFBFBD><DFBC><EFBFBD>8<EFBFBD><38><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>һ<EFBFBD>Σ<EFBFBD>
|
|||
|
bool shouldExecute = false;
|
|||
|
if (!_lastExecTimeDict.ContainsKey(gdata2) || (now - _lastExecTimeDict[gdata2]).TotalSeconds >= 12)
|
|||
|
{
|
|||
|
_lastExecTimeDict[gdata2] = now;
|
|||
|
shouldExecute = true;
|
|||
|
}
|
|||
|
|
|||
|
if (shouldExecute)
|
|||
|
{
|
|||
|
DataView Manage = dbo.ExceSQL($"select * from T_Manage_Task where FSTATUS=-1 and FPALLETBARCODE ='{gdata2}'").Tables[0].DefaultView;
|
|||
|
|
|||
|
if (Manage.Count > 0) // <20>п<EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Manage_Task set FSTATUS=0 where FID=" + Convert.ToInt32(Manage[0]["FID"]));
|
|||
|
}
|
|||
|
else // <20><><EFBFBD><EFBFBD>У<EFBFBD><D0A3>ʧ<EFBFBD><CAA7><EFBFBD>˳<EFBFBD>ȥ
|
|||
|
{
|
|||
|
//<2F>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ִ<EFBFBD>е<EFBFBD><D0B5>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>о<EFBFBD>Ҫ<EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
DataView Manage2 = dbo.ExceSQL($"select * from T_Manage_Task where FSTATUS=0 and F_ManageTaskKindIndex = 2").Tables[0].DefaultView;
|
|||
|
if (Manage2.Count==0)
|
|||
|
{
|
|||
|
CreateMonitor.CreateMove(12002, 12001, 6);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
else//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸
|
|||
|
{
|
|||
|
if (CStaticClass.Order == true)
|
|||
|
{
|
|||
|
GetKindDeviceState(TaskIdx, DeviceIdx, 0);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
dv = null;
|
|||
|
dvm = null;
|
|||
|
dvmo = null;
|
|||
|
dd = null;
|
|||
|
|
|||
|
}
|
|||
|
catch(Exception ex)
|
|||
|
{
|
|||
|
if (FrmControlMonitor.FormInstance.GetObjectText("tsStatus").IndexOf("<22><>ȡ<EFBFBD>豸״̬ʱ<CCAC><CAB1>"+ex.Message) < 0)
|
|||
|
{
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit("tsStatus", "<22><>ȡ<EFBFBD>豸״̬ʱ<CCAC><CAB1>" + ex.Message, true);
|
|||
|
|
|||
|
}
|
|||
|
//throw ex;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
/// <param name="DeviceIdx"></param>
|
|||
|
public void ActionIdle(int DeviceIdx)
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8>"<22><><EFBFBD><EFBFBD>"ʱ ɾ<><C9BE><EFBFBD>豸ָ<E8B1B8><D6B8> , <20><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8>ռ<EFBFBD><D5BC>״̬F_LockedState=0<><30>
|
|||
|
///·<><C2B7><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8>F_LockedDeviceIndex<65><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>Ӧ<EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
///
|
|||
|
///<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>豸ָ<E8B1B8><D6B8><EFBFBD><EFBFBD>? <20><>,<2C><>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IO_Control<6F><6C>FSTATUS=2<><32>"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
/// T_Manage_Task<73><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>״̬FSTATUS=2 <20><>
|
|||
|
/// </summary>
|
|||
|
/// <param name="DeviceIdx"><3E>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD></param>
|
|||
|
/// <param name="TaskIdx"><3E>豸ָ<E8B1B8><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
///<param name="ClearZero"><3E>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:1<><31><EFBFBD>㣻900<30><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>999<39>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
public void ActionComplete(int DeviceIdx,int TaskIdx,int ClearZero)
|
|||
|
{
|
|||
|
if (TaskIdx == 0) return;
|
|||
|
devinfo=Model.CGetInfo.GetDeviceInfo(DeviceIdx);
|
|||
|
int devKind = ccf.GetDeviceKindIdx(DeviceIdx);
|
|||
|
//20100305
|
|||
|
int[] zxy = ccf.GetCoordinatesFromMonitorTask(TaskIdx);
|
|||
|
string zxystr = "";
|
|||
|
if (zxy != null)
|
|||
|
{
|
|||
|
zxystr = (zxy[3].ToString().Length ==1 ? "0" + zxy[3].ToString() : zxy[3].ToString()) + "-" +
|
|||
|
((zxy[4].ToString().Length == 1) ? ("0" + zxy[4].ToString()) : (zxy[4].ToString())) + "-" +
|
|||
|
((zxy[5].ToString().Length == 1) ? ("0" + zxy[5].ToString()) : (zxy[5].ToString()));
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
int order = ccf.GetDeviceOrderFromMonitor(TaskIdx);
|
|||
|
if (order == -1)
|
|||
|
{
|
|||
|
_CGetStateError = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>м<EFBFBD><D0BC>䣡";
|
|||
|
return;
|
|||
|
}
|
|||
|
if (GetManage_Kind(TaskIdx) == false) return;
|
|||
|
int errrcode= ccf.GetExceptionNOFromManageTask(_fid,_mti );
|
|||
|
int ControlType=ccf.GetFCONTROLTASKTYPEFromManageTask(_mti,_fid);
|
|||
|
//20100710
|
|||
|
int AgvNextDeviceKind = 0;
|
|||
|
if ((devKind == 6)&&(order==2))
|
|||
|
{
|
|||
|
AgvNextDeviceKind = ccf.GetDeviceKindIdx(zxy[4]);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
//20100108
|
|||
|
DataView dvman;
|
|||
|
DataView dv;
|
|||
|
DataView dvlane;
|
|||
|
DataView Inv = null;
|
|||
|
string dtime;
|
|||
|
//
|
|||
|
|
|||
|
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Я<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȳ<EFBFBD><EFBFBD>ԵĴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Я<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȳ<EFBFBD><EFBFBD>ԵĴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⽻<EFBFBD>棩
|
|||
|
int Pri = ccf.SelectTaskPriPrecept();
|
|||
|
//20091016
|
|||
|
if (((Pri == 21) || (Pri == 12)) && (devKind == 1) && (ccf.GetFCONTROLTASKTYPEFromManageTask(_mti, _fid) == 2))//<2F>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȳ<EFBFBD><C8B2><EFBFBD>Я<EFBFBD><D0AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
string mansql = "select * from T_Manage_Task where FTASKLEVEL=10 and FSTACK = " + DeviceIdx + " AND (FCONTROLTASKTYPE = 1) AND (FIntoStepOK = '1') ";
|
|||
|
//20100108
|
|||
|
dvman=dbo.ExceSQL(mansql).Tables[0].DefaultView ;
|
|||
|
if (dvman.Count <= 0)
|
|||
|
{
|
|||
|
mansql = "SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FSTACK = " + DeviceIdx + ") AND (FCONTROLTASKTYPE = 1) AND (FIntoStepOK = '1') order by FTASKLEVEL desc, F_ManageTaskKindIndex desc,FID asc";
|
|||
|
dvman = dbo.ExceSQL(mansql).Tables[0].DefaultView;
|
|||
|
for (int ii = 0; ii < dvman.Count; ii++)
|
|||
|
{
|
|||
|
string sql = "select * from T_Monitor_Task where F_ManageTASKKINDINDEX=" + dvman[ii]["F_ManageTASKKINDINDEX"] + " and F_ManageTaskIndex=" + dvman[ii]["FID"] + " order by F_MonitorIndex asc";
|
|||
|
//20100108
|
|||
|
dv = dbo.ExceSQL(sql).Tables[0].DefaultView;
|
|||
|
if (dv.Count > 0)
|
|||
|
{
|
|||
|
int stackkind = ccf.GetDeviceKindIdx(Convert.ToInt32(dv[0]["F_DeviceIndex"]));
|
|||
|
if (stackkind == 1)
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Monitor_Task set F_MonitorTaskLevel=10 where F_ManageTASKKINDINDEX=" + dvman[ii]["F_ManageTASKKINDINDEX"] + " and F_ManageTaskIndex=" + dvman[ii]["FID"] + "");
|
|||
|
dbo.ExceSQL("update T_Manage_Task set FTASKLEVEL=10 where F_ManageTASKKINDINDEX=" + dvman[ii]["F_ManageTASKKINDINDEX"] + " and FID=" + dvman[ii]["FID"] + "");
|
|||
|
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
//dbo.TransBegin();
|
|||
|
try
|
|||
|
{
|
|||
|
|
|||
|
int fid = _fid;
|
|||
|
int mti = _mti;
|
|||
|
string cap;
|
|||
|
|
|||
|
//20101011
|
|||
|
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԤԼ<EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԤԼ<EFBFBD><EFBFBD>
|
|||
|
if ((devKind == 1) || (devKind == 4))
|
|||
|
{
|
|||
|
object ob = dbo.GetSingle("select count(F_MonitorIndex) as counts from T_Monitor_Task " +
|
|||
|
" where F_ManageTaskIndex =" + fid + " and F_ManageTaskKindIndex= " + mti + " and F_DeviceIndex=" + DeviceIdx);
|
|||
|
if (Convert.ToInt32(ob) == 1)
|
|||
|
{
|
|||
|
|
|||
|
#region <EFBFBD>й<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԤԼ<EFBFBD><EFBFBD>//20100710
|
|||
|
ob = dbo.GetSingle("SELECT T_Manage_Task.FID FROM T_Manage_Task ,T_Monitor_Task where T_Manage_Task.F_ManageTaskKindIndex = T_Monitor_Task.F_ManageTASKKINDINDEX AND T_Manage_Task.FID = T_Monitor_Task.F_ManageTaskIndex and (T_Manage_Task.F_RELATIVECONTORLID = " + fid + ") AND (T_Manage_Task.F_ManageTaskKindIndex = " + mti + ") and F_DeviceIndex=" + DeviceIdx + "");
|
|||
|
if (ob != null)
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_ManTaskReserve=" + (mti.ToString() + ob.ToString()) + " where F_ManTaskReserve=" + (mti.ToString() + fid.ToString()) + " and F_DeviceIndex=" + DeviceIdx);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_ManTaskReserve=0 where F_ManTaskReserve=" + (mti.ToString() + fid.ToString()) + " and F_DeviceIndex=" + DeviceIdx);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
//20100108
|
|||
|
dv = dbo.ExceSQL("select count(F_MonitorIndex) as counts from T_Monitor_Task " +
|
|||
|
" where F_ManageTaskIndex =" + fid + " and F_ManageTaskKindIndex= " + mti).Tables[0].DefaultView;
|
|||
|
if (dv.Count > 0)
|
|||
|
{
|
|||
|
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
if ((Convert.ToInt32(dv[0]["counts"]) == 1)) //20091016
|
|||
|
{
|
|||
|
//<2F>̶<EFBFBD>·<EFBFBD><C2B7>ģʽ
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>fid<69><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>طֽ<D8B7><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
if (mti == 1)
|
|||
|
{
|
|||
|
if (CObtainTask.IsInv == 1)//<2F>̿<EFBFBD>
|
|||
|
{
|
|||
|
CObtainTask.IsInv = 0;
|
|||
|
Inv = dbo.ExceSQL($"SELECT COUNT(*) AS count,FMANAGEID FROM T_Manage_Task WHERE FMANAGEID = (SELECT FMANAGEID FROM T_Manage_Task WHERE FID = {fid}) GROUP BY FMANAGEID").Tables[0].DefaultView;
|
|||
|
|
|||
|
cap = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
//<2F><><EFBFBD><EFBFBD>FSTATUS=999<39><39>970<37>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB>ع<EFBFBD><D8B9><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3><EFBFBD>ɣ<EFBFBD>980<38>Ѷ<EFBFBD><D1B6><EFBFBD>ȡ<EFBFBD>չ<EFBFBD><D5B9><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3><EFBFBD>ɣ<EFBFBD>990<39><30><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD>쳣<EFBFBD><ECB3A3><EFBFBD>ɣ<EFBFBD>
|
|||
|
//<2F><><EFBFBD>ȳ<EFBFBD><C8B3><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>900;950<35>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>̻<EFBFBD><CCBB>IJ<EFBFBD><C4B2>ǿ<EFBFBD><C7BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;940<34>˹<EFBFBD><CBB9><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//20090902
|
|||
|
if (errrcode >= 900)//<2F>쳣<EFBFBD><ECB3A3><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
if (errrcode == Model.CGeneralFunction.TASKDELETE)
|
|||
|
ClearZero = errrcode;
|
|||
|
else if (errrcode == Model.CGeneralFunction.TASKREPEATINPUT)
|
|||
|
errrcode = Model.CGeneralFunction.TASKREPEATINPUT;//<2F>ij<EFBFBD><C4B3>ģ<DEB8><C4A3><EFBFBD>ǰ<EFBFBD><C7B0>Model.CGeneralFunction.TASKFINISH
|
|||
|
else if (errrcode == Model.CGeneralFunction.TASKEMPTYOUTPUT)
|
|||
|
dboM.ExceSQL("update IO_Control set ERROR_TEXT='<27>Ѷ<EFBFBD><D1B6><EFBFBD>ȡ<EFBFBD>չ<EFBFBD><D5B9><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3><EFBFBD><EFBFBD>' where CONTROL_ID=" + fid);
|
|||
|
else if (errrcode == Model.CGeneralFunction.TASKABEND)
|
|||
|
dboM.ExceSQL("update IO_Control set ERROR_TEXT='<27>쳣<EFBFBD><ECB3A3><EFBFBD><EFBFBD>' where CONTROL_ID=" + fid);
|
|||
|
else if (errrcode == Model.CGeneralFunction.TASKTYPEERROR)
|
|||
|
dboM.ExceSQL("update IO_Control set ERROR_TEXT='<27>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>̻<EFBFBD><CCBB>IJ<EFBFBD><C4B2>ǿ<EFBFBD><C7BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' where CONTROL_ID=" + fid);
|
|||
|
else if (errrcode == Model.CGeneralFunction.TASKSTOPOUTPUT)
|
|||
|
dboM.ExceSQL("update IO_Control set ERROR_TEXT='<27>˹<EFBFBD><CBB9><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' where CONTROL_ID=" + fid);
|
|||
|
|
|||
|
//20100304
|
|||
|
switch (CStaticClass.ManDBFactory)
|
|||
|
{
|
|||
|
case "OracleDBFactory":
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME =sysdate, CONTROL_STATUS=" + errrcode + " where CONTROL_ID=" + fid);
|
|||
|
break;
|
|||
|
case "SQLServerDBFactory":
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME =GETDATE(), CONTROL_STATUS=" + errrcode + " where CONTROL_ID=" + fid);
|
|||
|
break;
|
|||
|
case "OleDBFactory":
|
|||
|
dtime = DateTime.Now.ToString("u");
|
|||
|
dtime = dtime.Substring(0, dtime.Length - 1);
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME ='" + dtime + "', CONTROL_STATUS=" + errrcode + " where CONTROL_ID=" + fid);
|
|||
|
break;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
else if (errrcode != Model.CGeneralFunction.TASKCHANGEFORK)//20110525
|
|||
|
{
|
|||
|
//<2F><><EFBFBD><EFBFBD>FSTATUS=999
|
|||
|
switch (CStaticClass.ManDBFactory)
|
|||
|
{
|
|||
|
case "OracleDBFactory":
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME =sysdate, CONTROL_STATUS=" + Model.CGeneralFunction.TASKFINISH + " where CONTROL_ID=" + fid);
|
|||
|
break;
|
|||
|
case "SQLServerDBFactory":
|
|||
|
if ((zxy[0] == 12043) && (zxy[3] == 18007 || zxy[3] == 12049 || zxy[3] == 12054))
|
|||
|
{
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME =GETDATE(), CONTROL_STATUS=" + Model.CGeneralFunction.TASKPACKFINISH + ",END_DEVICE_CODE=" + zxy[3] + " where CONTROL_ID=" + fid);
|
|||
|
}
|
|||
|
else
|
|||
|
if (zxy[0] == 32080 && order == 7)
|
|||
|
{
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME =GETDATE(), CONTROL_STATUS=" + Model.CGeneralFunction.TASKUNPACKFINISH + " where CONTROL_ID=" + fid);
|
|||
|
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
if (Inv.Count>0)
|
|||
|
{
|
|||
|
int taskID = Convert.ToInt32(Inv[0]["FMANAGEID"]);
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME =GETDATE(), CONTROL_STATUS=" + Model.CGeneralFunction.TASKFINISH + " where CONTROL_ID=" + taskID);
|
|||
|
CreateMonitor.WcsToManageTaskOver(taskID);
|
|||
|
}
|
|||
|
}
|
|||
|
break;
|
|||
|
case "OleDBFactory":
|
|||
|
dtime = DateTime.Now.ToString("u");
|
|||
|
dtime = dtime.Substring(0, dtime.Length - 1);
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME ='" + dtime + "', CONTROL_STATUS=" + Model.CGeneralFunction.TASKFINISH + " where CONTROL_ID=" + fid);
|
|||
|
break;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
cap = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
//<2F><><EFBFBD><EFBFBD>FSTATUS=999<39><39>970<37>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB>ع<EFBFBD><D8B9><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3><EFBFBD>ɣ<EFBFBD>980<38>Ѷ<EFBFBD><D1B6><EFBFBD>ȡ<EFBFBD>չ<EFBFBD><D5B9><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3><EFBFBD>ɣ<EFBFBD>990<39><30><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD>쳣<EFBFBD><ECB3A3><EFBFBD>ɣ<EFBFBD>
|
|||
|
//<2F><><EFBFBD>ȳ<EFBFBD><C8B3><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>900;950<35>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>̻<EFBFBD><CCBB>IJ<EFBFBD><C4B2>ǿ<EFBFBD><C7BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;940<34>˹<EFBFBD><CBB9><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//20090902
|
|||
|
if (errrcode >= 900)//<2F>쳣<EFBFBD><ECB3A3><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
if (errrcode == Model.CGeneralFunction.TASKDELETE)
|
|||
|
ClearZero = errrcode;
|
|||
|
else if (errrcode == Model.CGeneralFunction.TASKREPEATINPUT)
|
|||
|
errrcode = Model.CGeneralFunction.TASKREPEATINPUT;//<2F>ij<EFBFBD><C4B3>ģ<DEB8><C4A3><EFBFBD>ǰ<EFBFBD><C7B0>Model.CGeneralFunction.TASKFINISH
|
|||
|
else if (errrcode == Model.CGeneralFunction.TASKEMPTYOUTPUT)
|
|||
|
dboM.ExceSQL("update IO_Control set ERROR_TEXT='<27>Ѷ<EFBFBD><D1B6><EFBFBD>ȡ<EFBFBD>չ<EFBFBD><D5B9><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3><EFBFBD><EFBFBD>' where CONTROL_ID=" + fid);
|
|||
|
else if (errrcode == Model.CGeneralFunction.TASKABEND)
|
|||
|
dboM.ExceSQL("update IO_Control set ERROR_TEXT='<27>쳣<EFBFBD><ECB3A3><EFBFBD><EFBFBD>' where CONTROL_ID=" + fid);
|
|||
|
else if (errrcode == Model.CGeneralFunction.TASKTYPEERROR)
|
|||
|
dboM.ExceSQL("update IO_Control set ERROR_TEXT='<27>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>̻<EFBFBD><CCBB>IJ<EFBFBD><C4B2>ǿ<EFBFBD><C7BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' where CONTROL_ID=" + fid);
|
|||
|
else if (errrcode == Model.CGeneralFunction.TASKSTOPOUTPUT)
|
|||
|
dboM.ExceSQL("update IO_Control set ERROR_TEXT='<27>˹<EFBFBD><CBB9><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' where CONTROL_ID=" + fid);
|
|||
|
|
|||
|
//20100304
|
|||
|
switch (CStaticClass.ManDBFactory)
|
|||
|
{
|
|||
|
case "OracleDBFactory":
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME =sysdate, CONTROL_STATUS=" + errrcode + " where CONTROL_ID=" + fid);
|
|||
|
break;
|
|||
|
case "SQLServerDBFactory":
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME =GETDATE(), CONTROL_STATUS=" + errrcode + " where CONTROL_ID=" + fid);
|
|||
|
break;
|
|||
|
case "OleDBFactory":
|
|||
|
dtime = DateTime.Now.ToString("u");
|
|||
|
dtime = dtime.Substring(0, dtime.Length - 1);
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME ='" + dtime + "', CONTROL_STATUS=" + errrcode + " where CONTROL_ID=" + fid);
|
|||
|
break;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
else if (errrcode != Model.CGeneralFunction.TASKCHANGEFORK)//20110525
|
|||
|
{
|
|||
|
//<2F><><EFBFBD><EFBFBD>FSTATUS=999
|
|||
|
switch (CStaticClass.ManDBFactory)
|
|||
|
{
|
|||
|
case "OracleDBFactory":
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME =sysdate, CONTROL_STATUS=" + Model.CGeneralFunction.TASKFINISH + " where CONTROL_ID=" + fid);
|
|||
|
break;
|
|||
|
case "SQLServerDBFactory":
|
|||
|
if ((zxy[0] == 12043) && (zxy[3] == 18007 || zxy[3] == 12049 || zxy[3] == 12054))
|
|||
|
{
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME =GETDATE(), CONTROL_STATUS=" + Model.CGeneralFunction.TASKPACKFINISH + ",END_DEVICE_CODE=" + zxy[3] + " where CONTROL_ID=" + fid);
|
|||
|
}
|
|||
|
else
|
|||
|
if (zxy[0] == 32080 && order == 7)
|
|||
|
{
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME =GETDATE(), CONTROL_STATUS=" + Model.CGeneralFunction.TASKUNPACKFINISH + " where CONTROL_ID=" + fid);
|
|||
|
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME =GETDATE(), CONTROL_STATUS=" + Model.CGeneralFunction.TASKFINISH + " where CONTROL_ID=" + fid);
|
|||
|
CreateMonitor.WcsToManageTaskOver(fid);
|
|||
|
}
|
|||
|
break;
|
|||
|
case "OleDBFactory":
|
|||
|
dtime = DateTime.Now.ToString("u");
|
|||
|
dtime = dtime.Substring(0, dtime.Length - 1);
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_END_TIME ='" + dtime + "', CONTROL_STATUS=" + Model.CGeneralFunction.TASKFINISH + " where CONTROL_ID=" + fid);
|
|||
|
break;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
else if (mti == 4)
|
|||
|
{
|
|||
|
cap = "<22>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
cap = "<22><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>";
|
|||
|
}
|
|||
|
if ((errrcode == Model.CGeneralFunction.TASKCHANGEFORK)&&(devKind==1)&&(devinfo.IfCorrelDoubleFork=="1"))//20101011<31><31><EFBFBD><EFBFBD><EFBFBD>洦<EFBFBD><E6B4A6>
|
|||
|
{
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1A3ACB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棬<E6A3AC><D7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1A3ACB5><EFBFBD>λȡ<CEBB><C8A1><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD>ʵ<EFBFBD><CAB5>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FExceptionNO==null
|
|||
|
AppendMoveCellOperate(mti, fid, DeviceIdx, TaskIdx);
|
|||
|
}
|
|||
|
else
|
|||
|
{//20101011
|
|||
|
//<2F><>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>//20091128
|
|||
|
if ((ClearZero == Model.CGeneralFunction.TASKDELETE) || (ClearZero == Model.CGeneralFunction.TASKSTOPOUTPUT))//<2F><><EFBFBD>ȳ<EFBFBD><C8B3><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>900<30><30><EFBFBD>˹<EFBFBD><CBB9><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>940
|
|||
|
{
|
|||
|
ReturnManageInfo(fid, mti, cap, false);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
ReturnManageInfo(fid, mti, cap, true);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸ȫ<E8B1B8><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_LockedState=0 where F_LockedState=" + TaskIdx);
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_CreateLock='0' where F_DeviceIndex=" + DeviceIdx);
|
|||
|
if (ClearZero != Model.CGeneralFunction.TASKDELETE)//20100710ɾ<30><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
//<2F>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><DFBC><EFBFBD>20100710
|
|||
|
dvlane = dbo.ExceSQL("SELECT F_LaneGateDeviceIndex FROM T_Base_Lane_Gate where F_LaneGateDeviceIndex=" + DeviceIdx).Tables[0].DefaultView;
|
|||
|
if (dvlane.Count > 0)
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_HaveGoods=0 where F_DeviceIndex=" + DeviceIdx + " and F_HaveGoods=1");
|
|||
|
}
|
|||
|
else
|
|||
|
{//AGV<47>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><DFBC><EFBFBD>20100710
|
|||
|
dvlane = dbo.ExceSQL("SELECT F_AGVGateDeviceIndex FROM T_Base_AGV_Gate where F_AGVGateDeviceIndex=" + DeviceIdx).Tables[0].DefaultView;
|
|||
|
if (dvlane.Count > 0)
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_HaveGoods=0 where F_DeviceIndex=" + DeviceIdx);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
#region <EFBFBD>Ѷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>AGV<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>20101011
|
|||
|
|
|||
|
if (ClearZero != Model.CGeneralFunction.TASKDELETE)//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
if ((devKind == 1) && ((order == 4) || (order == 5) || (order == 6)))//20101011
|
|||
|
{
|
|||
|
bool sh = false;//20101011
|
|||
|
bool qh = false;//20101011
|
|||
|
if (order == 5) sh = true;//20101011
|
|||
|
if (order == 4) qh = true;//20101011
|
|||
|
if (order == 6)//20101011
|
|||
|
{
|
|||
|
sh = true;
|
|||
|
qh = true;
|
|||
|
}
|
|||
|
if (sh == true)//20101011
|
|||
|
{
|
|||
|
//20090918<31><38><EFBFBD>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
////20100609<30><39>Ϊʹ<CEAA><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
dvlane = dbo.ExceSQL("SELECT T_Base_Lane_Gate.F_LaneGateDeviceIndex from T_Base_Lane_Gate,T_Base_LaneInfo " +
|
|||
|
" where T_Base_Lane_Gate.F_LaneIndex = T_Base_LaneInfo.F_LaneDeviceIndex and T_Base_Lane_Gate.F_ZXY='" + zxystr + "' " +
|
|||
|
" and T_Base_LaneInfo.F_StackIndex=" + DeviceIdx).Tables[0].DefaultView;
|
|||
|
if (dvlane.Count > 0)
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_HaveGoods=1 where F_DeviceIndex=" + dvlane[0]["F_LaneGateDeviceIndex"]);
|
|||
|
}
|
|||
|
}
|
|||
|
if (qh == true)//<2F><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD>//20101011
|
|||
|
{
|
|||
|
zxystr = (zxy[0].ToString().Length == 1 ? "0" + zxy[0].ToString() : zxy[0].ToString()) + "-" +
|
|||
|
((zxy[1].ToString().Length == 1) ? ("0" + zxy[1].ToString()) : (zxy[1].ToString())) + "-" +
|
|||
|
((zxy[2].ToString().Length == 1) ? ("0" + zxy[2].ToString()) : (zxy[2].ToString()));
|
|||
|
dvlane = dbo.ExceSQL("SELECT T_Base_Lane_Gate.F_LaneGateDeviceIndex from T_Base_Lane_Gate,T_Base_LaneInfo " +
|
|||
|
" where T_Base_Lane_Gate.F_LaneIndex = T_Base_LaneInfo.F_LaneDeviceIndex and T_Base_Lane_Gate.F_ZXY='" + zxystr + "' " +
|
|||
|
" and T_Base_LaneInfo.F_StackIndex=" + DeviceIdx).Tables[0].DefaultView;
|
|||
|
if (dvlane.Count > 0)
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_HaveGoods=0 where F_DeviceIndex=" + dvlane[0]["F_LaneGateDeviceIndex"]);
|
|||
|
dbo.ExecuteSql("update T_Base_PLC_Ask set F_TaskIndex=0,F_Remark='' where F_DeviceIndex=" + dvlane[0]["F_LaneGateDeviceIndex"]);//20101011
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
else if ((devKind == 6) && (order == 2)&&(AgvNextDeviceKind==2))//AGV<47><56><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB>Ż<EFBFBD>20100710
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_HaveGoods=1 where F_DeviceIndex=" + zxy[4]);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
|
|||
|
//dbo.TransCommit();
|
|||
|
//<2F><>PLC<4C><43><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>ͷ<EFBFBD><CDB7>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0B6BC><EFBFBD><EFBFBD>
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD>жϴ<D0B6><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//ISendDeviceOrder sdo;
|
|||
|
if (ClearZero == 1)
|
|||
|
{
|
|||
|
if ((devKind == 4) || (devKind == 2))
|
|||
|
{//<2F><><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>RGV<47><56><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
sdo = CommModeCreate.CreateSendDeviceOrder(DeviceIdx);
|
|||
|
sdo.SendDeviceOrder(2, 0, 0, DeviceIdx, 0);
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
if ((devKind == 1)) //<2F>Ѷ<EFBFBD><D1B6><EFBFBD>
|
|||
|
{
|
|||
|
|
|||
|
sdo = CommModeCreate.CreateSendDeviceOrder(DeviceIdx);
|
|||
|
sdo.SendDeviceOrder(2, 0, 0, DeviceIdx, 0, 0, 0, 0, 0, 0);
|
|||
|
}
|
|||
|
if (mti == 1)
|
|||
|
{
|
|||
|
dboM.ExceSQL("UPDATE IO_CONTROL SET ERROR_TEXT ='' WHERE CONTROL_ID=" + fid + " and CONTROL_STATUS<900");
|
|||
|
}
|
|||
|
}
|
|||
|
if ((ccf.GetCorrel_DeviceIndex(DeviceIdx)==0) && (ControlType == 1))
|
|||
|
{
|
|||
|
// dbo.ExecuteSql("update T_Base_PLC_Ask set F_TaskIndex=0,F_Remark='' where (F_DeviceIndex=" + DeviceIdx + ")");
|
|||
|
}
|
|||
|
//20101220 ÿ<>ε<EFBFBD><CEB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>µ<EFBFBD><C2B5>̻<EFBFBD><CCBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
if (zxy != null && (zxy[3] == 12076 || zxy[3] == 12082 || zxy[3] == 12088 || zxy[3] == 22049 || zxy[3] == 32069))
|
|||
|
{
|
|||
|
dbo.ExecuteSql("update T_Base_PLC_Ask set F_BarCode=F_BarCode +'" + ccf.GetBarCodeFromMonitor(TaskIdx) + "' where (F_BindingDevice=" + DeviceIdx + ")");
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
//2013 <20><>¼<EFBFBD><C2BC><EFBFBD>ɵ<EFBFBD>monitor
|
|||
|
dbo.ExceSQL("insert into t_bak_monitor_task select * from T_Monitor_Task where F_MonitorIndex=" + TaskIdx);
|
|||
|
dbo.ExceSQL("update T_BAK_Monitor_Task set F_EndTime ='" + DateTime.Now.ToString("u") + "' where F_MonitorIndex=" + TaskIdx);
|
|||
|
dbo.ExceSQL("delete from T_Monitor_Task where F_MonitorIndex=" + TaskIdx);
|
|||
|
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
//dbo.TransRollback();
|
|||
|
if (FrmControlMonitor.FormInstance.GetObjectText("tsStatus").IndexOf("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" + ex.Message) < 0)
|
|||
|
{
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit("tsStatus", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" + ex.Message, true);
|
|||
|
|
|||
|
}
|
|||
|
//throw ex;
|
|||
|
}
|
|||
|
finally
|
|||
|
{//20100108
|
|||
|
dvman=null ;
|
|||
|
dv=null ;
|
|||
|
dvlane=null ;
|
|||
|
}
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><DAB6>̲߳<DFB3><CCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<51><4C><EFBFBD><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
public void ActionDeadLock()
|
|||
|
{//20100108
|
|||
|
DataView dv;
|
|||
|
try
|
|||
|
{
|
|||
|
dv = dbo.ExceSQL("select * from T_DeadLock where f_flag=0 order by f_id asc").Tables[0].DefaultView;
|
|||
|
for (int i = 0; i < dv.Count; i++)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
dbo.ExceSQL(dv[i]["f_SQL"].ToString());
|
|||
|
dbo.ExceSQL("update T_DeadLock set f_flag=1 where f_id=" + dv[i]["f_id"] + "");
|
|||
|
}
|
|||
|
catch
|
|||
|
{
|
|||
|
continue;
|
|||
|
}
|
|||
|
}
|
|||
|
}//20100108
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw ex;
|
|||
|
}
|
|||
|
finally
|
|||
|
{
|
|||
|
dv = null;
|
|||
|
}
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// <20><>д<EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>״̬<D7B4>֣<EFBFBD>IO_Control,T_Manage_Task,T_Monitor_task<73><6B>
|
|||
|
/// </summary>
|
|||
|
/// <param name="DeviceIdx"><3E>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD></param>
|
|||
|
/// <param name="TaskIdx"><3E>豸ָ<E8B1B8><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
/// <param name="ErrId"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
public void ActionError(int DeviceIdx, int TaskIdx,int ErrId)
|
|||
|
{
|
|||
|
//dbo.TransBegin();
|
|||
|
//20100108
|
|||
|
DataView dvmon;
|
|||
|
DataTable dt;
|
|||
|
DataView dv0;
|
|||
|
DataView dvm;
|
|||
|
//DataView dvIO;
|
|||
|
//DataRowView dr;
|
|||
|
//DataView DV;
|
|||
|
//DataView dvc;
|
|||
|
|
|||
|
|
|||
|
try
|
|||
|
{
|
|||
|
//090915
|
|||
|
|
|||
|
// string monsql = "SELECT F_MonitorIndex FROM T_Monitor_Task where F_Status =1 and F_DeviceIndex =" + DeviceIdx;
|
|||
|
//modify by zx 20121011
|
|||
|
string monsql = "SELECT F_MonitorIndex FROM T_Monitor_Task where F_DeviceIndex =" + DeviceIdx;
|
|||
|
//20100108
|
|||
|
dvmon = dbo.ExceSQL(monsql).Tables[0].DefaultView;
|
|||
|
if ((dvmon.Count > 0) && (TaskIdx == 0))
|
|||
|
{
|
|||
|
TaskIdx = Convert.ToInt32(dvmon[0]["F_MonitorIndex"]);
|
|||
|
}
|
|||
|
//090915
|
|||
|
//<2F>й<EFBFBD><D0B9><EFBFBD>¼<EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
string devstr = "SELECT F_DeviceIndex FROM T_Base_Device where F_DeviceIndex=" + DeviceIdx + " and F_ErrorTaskNo=" + TaskIdx + "";
|
|||
|
//20100108
|
|||
|
dt = dbo.ExceSQL(devstr).Tables[0];
|
|||
|
if (dt.Rows.Count >= 1)
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Monitor_Task set F_Status= " + ErrId + " where (F_MonitorIndex= " + TaskIdx + ") and ((F_Status<> " + ErrId + ") and (F_Status<> 3))");
|
|||
|
return;
|
|||
|
}
|
|||
|
devinfo = Model.CGetInfo.GetDeviceInfo(DeviceIdx);
|
|||
|
int devKind = ccf.GetDeviceKindIdx(DeviceIdx);
|
|||
|
|
|||
|
if (GetManage_Kind(TaskIdx) == false) return;
|
|||
|
int fid = _fid;
|
|||
|
int mti = _mti;
|
|||
|
//string fwarehouse = "";
|
|||
|
//string fcode = "";
|
|||
|
//int flane = 0;
|
|||
|
errs = Model.CGetInfo.GetErrorInfo(Convert.ToInt32(devKind.ToString() + ErrId.ToString()));
|
|||
|
|
|||
|
if (errs!=null && errs.ErrorIndex > 0)
|
|||
|
{
|
|||
|
//20100108
|
|||
|
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/*
|
|||
|
//<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>29<32><39>ÿ<EFBFBD><C3BF><EFBFBD>豸<EFBFBD><E8B1B8>F_LocalPort<72><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>(id)<29><>F_RemotePort<72><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD>ֵ(index)<29><>1--12<31><32>
|
|||
|
//<2F><><EFBFBD><EFBFBD>F_LocalPort<72><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>F_LockedState=0<>Ͱѱ<CDB0><D1B1><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>F_LockedState<74><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F2B2BBB4><EFBFBD>
|
|||
|
int ic = dbo.ExecuteSql("update T_Base_Device set F_LockedState=" + DeviceIdx + " where F_DeviceIndex=" + devinfo.LocalPort + " and F_LockedState=0");
|
|||
|
if (ic == 1)
|
|||
|
{
|
|||
|
string hrs = "http://" + CStaticClass.CameraIP + "/camera/ptz?command=preset&id=" + devinfo.LocalPort + "&index=" + devinfo.RemotePort + "&username=" + CStaticClass.CameraUsername + "&password=" + CStaticClass.CameraPassword;
|
|||
|
HttpWebRequest myReq =(HttpWebRequest)WebRequest.Create(hrs);
|
|||
|
myReq = null;
|
|||
|
}
|
|||
|
*/
|
|||
|
#endregion
|
|||
|
|
|||
|
|
|||
|
FrmMain.FormInstance.notifyIcon1.BalloonTipText = "<22><><EFBFBD><EFBFBD>:" +devinfo.DeviceName+","+ DeviceIdx + "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>" + errs.ErrorName;
|
|||
|
FrmMain.FormInstance.notifyIcon1.ShowBalloonTip(10000, "<22><><EFBFBD><EFBFBD>", devinfo.DeviceName + "," + DeviceIdx + "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>" + errs.ErrorName, System.Windows.Forms.ToolTipIcon.Warning);
|
|||
|
if (mti == 1)
|
|||
|
{
|
|||
|
dboM.ExceSQL("update IO_Control set ERROR_TEXT='" + devinfo.DeviceName + "," + DeviceIdx + errs.ErrorName + "' where CONTROL_ID=" + fid);
|
|||
|
}
|
|||
|
//20100108
|
|||
|
dv0 = dbo.ExceSQL("SELECT F_DeviceIndex, F_ErrorIndex FROM T_Base_Device_Error_Log Where F_ManageTaskNo=" + fid + " and F_DeviceIndex=" + DeviceIdx + " and F_ErrorIndex=" + errs.ErrorIndex).Tables[0].DefaultView;
|
|||
|
string dtime = DateTime.Now.ToString("u");//20110603
|
|||
|
|
|||
|
dtime = dtime.Substring(0, dtime.Length - 1);
|
|||
|
if (dv0.Count > 0)
|
|||
|
{//20091107
|
|||
|
dbo.ExceSQL("UPDATE T_Base_Device_Error_Log SET F_DateTime ='" + dtime + "' Where F_DeviceIndex=" + DeviceIdx + " and F_ErrorIndex=" + errs.ErrorIndex + " and F_ManageTaskNo=" + fid);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
dbo.ExceSQL("INSERT INTO T_Base_Device_Error_Log (F_ManageTaskNo,F_DeviceIndex, F_ErrorIndex, F_DateTime) VALUES (" + fid + "," + DeviceIdx + "," + errs.ErrorIndex + ",'" + dtime + "')");
|
|||
|
}
|
|||
|
}
|
|||
|
//20090925
|
|||
|
#region 2240<EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD>ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//&& (mti == 1)
|
|||
|
//if ((DeviceIdx == 2240))
|
|||
|
//{
|
|||
|
// if ((ErrId == 49))
|
|||
|
// {
|
|||
|
// #region <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>rgv<67>ͻ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1><EFBFBD>
|
|||
|
// if (ccf.GetMonitorFromAssociate(TaskIdx) > 0) return;
|
|||
|
// #endregion
|
|||
|
// //2246,2243,2203,2212<31>ͻص<CDBB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
// //<2F>Ȱ<EFBFBD><C8B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD>ͻ<EFBFBD>λ<EFBFBD><CEBB>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD>λ<EFBFBD>ø<EFBFBD>Ϊԭ<CEAA><D4AD>λ<EFBFBD>ã<EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><C2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3B1A8B8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// string FSTARTDEVICE = "", FSTARTCELL = "", FENDDEVICE = "", FENDCELL = "";
|
|||
|
// //20100108
|
|||
|
// dvm = dbo.ExceSQL("SELECT * FROM T_Manage_Task where F_ManageTaskKindIndex=" + mti + " and FID=" + fid).Tables[0].DefaultView;
|
|||
|
// if (dvm.Count > 0)
|
|||
|
// {
|
|||
|
// if ((dvm[0]["FSTARTDEVICE"].ToString() == "2246") || (dvm[0]["FSTARTDEVICE"].ToString() == "2243") || (dvm[0]["FSTARTDEVICE"].ToString() == "2212") || (dvm[0]["FSTARTDEVICE"].ToString() == "2203"))
|
|||
|
// {
|
|||
|
// FSTARTDEVICE = "2246";
|
|||
|
// FSTARTCELL = "-";
|
|||
|
// }
|
|||
|
// else
|
|||
|
// {
|
|||
|
// FSTARTDEVICE = dvm[0]["FSTARTDEVICE"].ToString();
|
|||
|
// FSTARTCELL = dvm[0]["FSTARTCELL"].ToString();
|
|||
|
// }
|
|||
|
// FENDDEVICE = dvm[0]["FENDDEVICE"].ToString();
|
|||
|
// FENDCELL = dvm[0]["FENDCELL"].ToString();
|
|||
|
|
|||
|
// }
|
|||
|
// else
|
|||
|
// {
|
|||
|
// return;
|
|||
|
// }
|
|||
|
|
|||
|
// dbo.ExceSQL("update T_Base_Device set F_LockedState=0 where F_LockedState=" + TaskIdx);
|
|||
|
// dbo.ExceSQL("update T_Base_Device set F_CreateLock='0' where F_DeviceIndex=" + DeviceIdx);
|
|||
|
|
|||
|
// dbo.ExceSQL("delete from T_Monitor_Task where F_MonitorIndex=" + TaskIdx);
|
|||
|
// dbo.ExceSQL("update T_Manage_Task set FCONTROLTASKTYPE=1,FSTATUS=0,FIntoStepOK='0',FENDDEVICE='" + FSTARTDEVICE + "',FENDCELL='" + FSTARTCELL + "',FSTARTDEVICE=2240,FSTARTCELL='-',FExceptionNO=" + Model.CGeneralFunction.TASKTYPEERROR + " where F_ManageTaskKindIndex=" + mti + " and FID=" + fid);
|
|||
|
|
|||
|
// }
|
|||
|
//}
|
|||
|
|
|||
|
#endregion
|
|||
|
//if (errs == null)
|
|||
|
if (errs == null)
|
|||
|
{
|
|||
|
errs = new Model.MError();
|
|||
|
errs.ErrorName = "<22><><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD> " + ErrId + "δ<><CEB4><EFBFBD><EFBFBD>";
|
|||
|
}
|
|||
|
//20090915
|
|||
|
dbo.ExceSQL("update T_Monitor_Task set F_Status= " + ErrId + " where F_MonitorIndex= " + TaskIdx + " and (F_Status<> 3)");
|
|||
|
//<2F><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>ִ<EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_ErrorTaskNo= " + TaskIdx + " where F_DeviceIndex= " + DeviceIdx);
|
|||
|
dbo.ExceSQL("update T_Manage_Task set FERRORCODE='" + devinfo.DeviceName + "," + DeviceIdx + errs.ErrorName + "' where F_ManageTaskKindIndex=" + mti + " and FID=" + fid);
|
|||
|
if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1")
|
|||
|
{//20091107
|
|||
|
#region <EFBFBD>Ѷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>쳣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>պ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>أ<EFBFBD>
|
|||
|
|
|||
|
|
|||
|
if ((devKind == 1)&& (mti == 1))//<2F>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>//20100710<31><30><EFBFBD>¶<EFBFBD><C2B6><EFBFBD>˫<EFBFBD><CBAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
int rfid=-1;
|
|||
|
object obr = dbo.GetSingle("SELECT F_RELATIVECONTORLID FROM T_Manage_Task WHERE (FID = " + fid + ") AND (F_ManageTaskKindIndex = " + mti + ") and (F_RELATIVECONTORLID<>-1)");
|
|||
|
if (obr != null)
|
|||
|
{
|
|||
|
rfid = Convert.ToInt32(obr);
|
|||
|
}
|
|||
|
string errAwayfork = "0";
|
|||
|
if ((ErrId == Model.CGeneralFunction.STACKEMPTYOUTPUT) || (ErrId == Model.CGeneralFunction.STACKREPEATINPUT))
|
|||
|
{
|
|||
|
errAwayfork = "0";
|
|||
|
|
|||
|
}
|
|||
|
if ((ErrId == Model.CGeneralFunction.STACKEMPTYOUTPUTAWAY) || (ErrId == Model.CGeneralFunction.STACKREPEATINPUTAWAY))
|
|||
|
{
|
|||
|
errAwayfork = "1";
|
|||
|
|
|||
|
}
|
|||
|
if ((ErrId == Model.CGeneralFunction.STACKEMPTYOUTPUTDOUBLE) || (ErrId == Model.CGeneralFunction.STACKREPEATINPUTDOUBLE))
|
|||
|
{
|
|||
|
errAwayfork = "-";
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
#region <EFBFBD>Ѷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD>//20100710
|
|||
|
//43 <20>Ż<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棩<EFBFBD><E6A3A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>ڣ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1B1A8B8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//60 <09>Ż<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><D0BB><EFBFBD>Զ<EFBFBD>棩<EFBFBD><E6A3A9>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1B1A8B8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//61 <09>Ż<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><D0BB><EFBFBD>˫<EFBFBD>棩<EFBFBD><E6A3A9>˫<EFBFBD><CBAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3><EFBFBD>
|
|||
|
if ((ErrId == Model.CGeneralFunction.STACKREPEATINPUT) ||
|
|||
|
(ErrId == Model.CGeneralFunction.STACKREPEATINPUTAWAY) ||
|
|||
|
(ErrId == Model.CGeneralFunction.STACKREPEATINPUTDOUBLE))
|
|||
|
{
|
|||
|
|
|||
|
//<2F>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>48;<3B>쳣<EFBFBD><ECB3A3><EFBFBD><EFBFBD>970
|
|||
|
|
|||
|
#region <EFBFBD>Ӽ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
//#region <20>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
////20091107
|
|||
|
////20100108
|
|||
|
//dvIO = dboM.ExceSQL("select CONTROL_ID, CONTROL_STATUS from IO_Control where (CONTROL_ID = " + fid + ") AND ((CONTROL_STATUS=" + Model.CGeneralFunction.TASKREPEATINPUT + ") or (CONTROL_STATUS=" + Model.CGeneralFunction.TASKALTERROUTEREPLY + "))").Tables[0].DefaultView;
|
|||
|
//if (dvIO.Count <= 0)
|
|||
|
//{
|
|||
|
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// //20100108
|
|||
|
// dvm = dbo.ExceSQL("select * from T_Manage_Task WHERE (FID = " + fid + ") AND (F_ManageTASKKINDINDEX =" + mti + ")").Tables[0].DefaultView;
|
|||
|
// if (dvm.Count > 0)
|
|||
|
// {
|
|||
|
// fwarehouse = dvm[0]["FWAREHOUSE"].ToString();
|
|||
|
// flane = Convert.ToInt32(dvm[0]["FLANEWAY"]);
|
|||
|
// fcode = dvm[0]["FENDCELL"].ToString();
|
|||
|
// if (ccf.QueryCellIfExit(fwarehouse, flane, fcode) == true)
|
|||
|
// {
|
|||
|
// //20091128
|
|||
|
// //20100108
|
|||
|
// dr = dvm[0];
|
|||
|
// //20100108
|
|||
|
// //DV = dboM.ExceSQL("select IO_CONTROL_APPLY_SEQ.NEXTVAL FROM DUAL").Tables[0].DefaultView;
|
|||
|
// int id = dboM.GetManageTableIndex("IO_CONTROL_APPLY");
|
|||
|
|
|||
|
// string dtime = DateTime.Now.ToString("u");
|
|||
|
// dtime = dtime.Substring(0, dtime.Length - 1);
|
|||
|
// dboM.TransBegin();
|
|||
|
// try
|
|||
|
// {
|
|||
|
|
|||
|
// if (CStaticClass.ManDBFactory == "OracleDBFactory")
|
|||
|
// {
|
|||
|
|
|||
|
// dboM.ExceSQL("update IO_Control set CONTROL_STATUS=" + Model.CGeneralFunction.TASKREPEATINPUT + ",ERROR_TEXT='" + DeviceIdx + errs.ErrorName + ";ԭ<><D4AD>λ<EFBFBD><CEBB>" + "'||END_DEVICE_CODE where CONTROL_ID=" + fid);
|
|||
|
// }
|
|||
|
// else
|
|||
|
// {
|
|||
|
// dboM.ExceSQL("update IO_Control set CONTROL_STATUS=" + Model.CGeneralFunction.TASKREPEATINPUT + ",ERROR_TEXT='" + DeviceIdx + errs.ErrorName + ";ԭ<><D4AD>λ<EFBFBD><CEBB>" + "'+END_DEVICE_CODE where CONTROL_ID=" + fid);
|
|||
|
// }
|
|||
|
// string sql = "INSERT INTO IO_CONTROL_APPLY (CONTROL_APPLY_ID, CONTROL_ID,CONTROL_APPLY_TYPE, WAREHOUSE_CODE, STOCK_BARCODE, DEVICE_CODE,APPLY_TASK_STATUS, FCREATETIME, FREMARK)" +
|
|||
|
// "VALUES (" + id + "," + dr["FID"] + ",2,'" + dr["FENDWAREHOUSE"] + "','" + dr["FPALLETBARCODE"] + "','" + dr["FENDDEVICE"] + "',0,'" + dtime + "',null)";
|
|||
|
// dboM.ExceSQL(sql);
|
|||
|
// dboM.TransCommit();
|
|||
|
|
|||
|
// dbo.ExceSQL("update T_Manage_Task set FExceptionNO=" + Model.CGeneralFunction.TASKREPEATINPUT + ",FERRORCODE='" + DeviceIdx + errs.ErrorName + ";ԭ<><D4AD>λ<EFBFBD><CEBB>" + "'+ FENDCELL where (F_ManageTaskKindIndex = " + mti + ") AND (FID = " + fid + ")");
|
|||
|
// //<2F><>ManageTaskIdx<64><78>ManageKindIdx <20>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>
|
|||
|
// dbo.ExceSQL("UPDATE T_Monitor_Task SET F_Status = 3 WHERE (F_ManageTaskIndex = " + fid + ") AND (F_ManageTASKKINDINDEX =" + mti + ")");
|
|||
|
|
|||
|
|
|||
|
|
|||
|
// }
|
|||
|
// catch (Exception ex)
|
|||
|
// {
|
|||
|
// _CGetStateError = "<22>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD>ͻ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><D8B9>ϣ<EFBFBD><CFA3>ĵ<EFBFBD>ʱ<EFBFBD><CAB1>" + ex.Message;
|
|||
|
// dboM.TransRollback();
|
|||
|
// }
|
|||
|
// }
|
|||
|
// }
|
|||
|
//}//20091107
|
|||
|
//#endregion
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region <EFBFBD>ijǰ<EFBFBD>
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>㣬ɾ<E3A3AC><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1A3ACBD><EFBFBD>lockstate<74><65>Ȼ<EFBFBD><C8BB>ֱ<EFBFBD>Ӹĵ<D3B8><C4B5><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1442<34><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1441
|
|||
|
//System.Threading.Thread.Sleep(3000);
|
|||
|
|
|||
|
//20100710
|
|||
|
int[] zxy = ccf.GetCoordinatesFromMonitorTask(TaskIdx);
|
|||
|
string zxystr = "";
|
|||
|
if (zxy != null)
|
|||
|
{
|
|||
|
//<2F>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
zxystr = (zxy[3].ToString().Length == 1 ? "0" + zxy[3].ToString() : zxy[3].ToString()) + "-" +
|
|||
|
((zxy[4].ToString().Length == 1) ? ("0" + zxy[4].ToString()) : (zxy[4].ToString())) + "-" +
|
|||
|
((zxy[5].ToString().Length == 1) ? ("0" + zxy[5].ToString()) : (zxy[5].ToString()));
|
|||
|
}
|
|||
|
dvm = dbo.ExceSQL("SELECT F_ZXY FROM T_Base_Lane_Gate WHERE (F_ZXY = '" + zxystr + "')").Tables[0].DefaultView;
|
|||
|
if (dvm.Count > 0)
|
|||
|
{//<2F><><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>Ӧ<EFBFBD>Ļ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϳձ<CDBF><D5B1><EFBFBD>
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
if ((ErrId == Model.CGeneralFunction.STACKREPEATINPUT) ||
|
|||
|
(ErrId == Model.CGeneralFunction.STACKREPEATINPUTAWAY))
|
|||
|
{
|
|||
|
DataView dvr = dbo.ExceSQL("SELECT F_ManageTaskIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = " + fid + ") AND (F_ManageTaskKindIndex = " + mti + ") AND (F_UseAwayFork = '" + errAwayfork + "')").Tables[0].DefaultView;
|
|||
|
if (dvr.Count <= 0)
|
|||
|
{
|
|||
|
|
|||
|
dvr = dbo.ExceSQL("SELECT FID FROM T_Manage_Task,T_Monitor_Task WHERE (F_RELATIVECONTORLID = " + fid + ") AND (T_Monitor_Task.F_ManageTaskKindIndex = " + mti + ") AND (F_UseAwayFork = '" + errAwayfork + "') AND (T_Monitor_Task.F_ManageTaskKindIndex=T_Manage_Task.F_ManageTaskKindIndex) AND (FID=F_ManageTaskIndex)").Tables[0].DefaultView;
|
|||
|
if (dvr.Count > 0)
|
|||
|
{
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1B1A8BE><EFBFBD>˫<EFBFBD><CBAB>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//if (Model.CGeneralFunction.DoubleForkIfSync(TaskIdx, DeviceIdx, 1) == true)
|
|||
|
//{
|
|||
|
// ActionComplete(DeviceIdx, TaskIdx, 1);
|
|||
|
//}
|
|||
|
fid = Convert.ToInt16(dvr[0]["FID"]);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{//<2F>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˫<EFBFBD><CBAB>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1B1A8B8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//if (Model.CGeneralFunction.DoubleForkIfSync(TaskIdx, DeviceIdx, 1) == true)
|
|||
|
//{
|
|||
|
// string[] df = Model.CGeneralFunction.GetDoubleForkMonitorInfo(TaskIdx, DeviceIdx);
|
|||
|
// if (df != null)
|
|||
|
// {
|
|||
|
// ActionComplete(DeviceIdx, Convert.ToInt32(df[0]), 1);
|
|||
|
// }
|
|||
|
//}
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
sdo = CommModeCreate.CreateSendDeviceOrder(DeviceIdx);
|
|||
|
sdo.SendDeviceOrder(2, 0, 0, DeviceIdx, 0, 0, 0, 0, 0, 0);
|
|||
|
|
|||
|
AA:
|
|||
|
//<2F>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB>أ<EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//<2F><>Ӧ<EFBFBD><D3A6>վ̨<D5BE><CCA8><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ӧ<EFBFBD><D3A6>վ̨
|
|||
|
//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3B1A8B8>쳣<EFBFBD><ECB3A3><EFBFBD><EFBFBD>970
|
|||
|
if (CStaticClass.ManDBFactory == "OracleDBFactory")
|
|||
|
{
|
|||
|
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_STATUS=" + Model.CGeneralFunction.TASKREPEATINPUT + ",ERROR_TEXT='" + DeviceIdx + errs.ErrorName + ";ԭ<><D4AD>λ<EFBFBD><CEBB>" + "'||END_DEVICE_CODE where CONTROL_ID=" + fid);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
dboM.ExceSQL("update IO_Control set CONTROL_STATUS=" + Model.CGeneralFunction.TASKREPEATINPUT + ",ERROR_TEXT='" + DeviceIdx + errs.ErrorName + ";ԭ<><D4AD>λ<EFBFBD><CEBB>" + "'+END_DEVICE_CODE where CONTROL_ID=" + fid);
|
|||
|
}
|
|||
|
dbo.ExceSQL("update T_Monitor_Task set F_STATUS=3 where F_ManageTaskKindIndex=" + mti + " and F_ManageTaskIndex=" + fid );
|
|||
|
dbo.ExceSQL("update T_Manage_Task set FExceptionNO=" + Model.CGeneralFunction.TASKREPEATINPUT + ",FERRORCODE= '"+devinfo.DeviceName + "," + DeviceIdx + errs.ErrorName+",ԭ<><D4AD>λ: '+FENDCELL where (F_ManageTaskKindIndex = " + mti + ") AND (FID = " + fid + ")");
|
|||
|
|
|||
|
|
|||
|
if ((ErrId == Model.CGeneralFunction.STACKREPEATINPUTDOUBLE))
|
|||
|
{
|
|||
|
if (rfid != -1)
|
|||
|
{
|
|||
|
fid = rfid;
|
|||
|
rfid = -1;
|
|||
|
goto AA;
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
|
|||
|
#region <EFBFBD>Ѷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>մ<EFBFBD><EFBFBD><EFBFBD>//20100710
|
|||
|
//46 ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棩<EFBFBD><E6A3A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1B1A8B8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//62 ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEBB><EFBFBD>Զ<EFBFBD>棩<EFBFBD><E6A3A9>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1B1A8B8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//63 ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEBB><EFBFBD>˫<EFBFBD>棩<EFBFBD><E6A3A9>˫<EFBFBD><CBAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>
|
|||
|
|
|||
|
if ((ErrId == Model.CGeneralFunction.STACKEMPTYOUTPUTDOUBLE) ||
|
|||
|
(ErrId == Model.CGeneralFunction.STACKEMPTYOUTPUTAWAY) ||
|
|||
|
(ErrId == Model.CGeneralFunction.STACKEMPTYOUTPUT))
|
|||
|
{
|
|||
|
//20100710
|
|||
|
int[] zxy = ccf.GetCoordinatesFromMonitorTask(TaskIdx);
|
|||
|
string zxystr = "";
|
|||
|
if (zxy != null)
|
|||
|
{
|
|||
|
//<2F>Ѷ<EFBFBD><D1B6><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
zxystr = (zxy[0].ToString().Length == 1 ? "0" + zxy[0].ToString() : zxy[0].ToString()) + "-" +
|
|||
|
((zxy[1].ToString().Length == 1) ? ("0" + zxy[1].ToString()) : (zxy[1].ToString())) + "-" +
|
|||
|
((zxy[2].ToString().Length == 1) ? ("0" + zxy[2].ToString()) : (zxy[2].ToString()));
|
|||
|
}
|
|||
|
dvm = dbo.ExceSQL("SELECT F_ZXY FROM T_Base_Lane_Gate WHERE (F_ZXY = '"+zxystr+"')").Tables[0].DefaultView;
|
|||
|
if (dvm.Count > 0)
|
|||
|
{//<2F><><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>Ӧ<EFBFBD>Ļ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>
|
|||
|
return;
|
|||
|
}
|
|||
|
if ((ErrId == Model.CGeneralFunction.STACKEMPTYOUTPUTAWAY) ||
|
|||
|
(ErrId == Model.CGeneralFunction.STACKEMPTYOUTPUT))
|
|||
|
{
|
|||
|
|
|||
|
|
|||
|
DataView dvr = dbo.ExceSQL("SELECT F_ManageTaskIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = " + fid + ") AND (F_ManageTaskKindIndex = " + mti + ") AND (F_UseAwayFork = '" + errAwayfork + "')").Tables[0].DefaultView;
|
|||
|
if (dvr.Count <= 0)
|
|||
|
{
|
|||
|
|
|||
|
dvr = dbo.ExceSQL("SELECT FID FROM T_Manage_Task,T_Monitor_Task WHERE (F_RELATIVECONTORLID = " + fid + ") AND (T_Monitor_Task.F_ManageTaskKindIndex = " + mti + ") AND (F_UseAwayFork = '" + errAwayfork + "') AND (T_Monitor_Task.F_ManageTaskKindIndex=T_Manage_Task.F_ManageTaskKindIndex) AND (FID=F_ManageTaskIndex)").Tables[0].DefaultView;
|
|||
|
if (dvr.Count > 0)
|
|||
|
{
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1B1A8BE><EFBFBD>˫<EFBFBD><CBAB>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if (Model.CGeneralFunction.DoubleForkIfSync(TaskIdx, DeviceIdx, 1) == true)
|
|||
|
{
|
|||
|
ActionComplete(DeviceIdx, TaskIdx, 1);
|
|||
|
}
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
fid = Convert.ToInt16(dvr[0]["FID"]);
|
|||
|
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
//<2F>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˫<EFBFBD><CBAB>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1B1A8B8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if (Model.CGeneralFunction.DoubleForkIfSync(TaskIdx, DeviceIdx, 1) == true)
|
|||
|
{
|
|||
|
string[] df = Model.CGeneralFunction.GetDoubleForkMonitorInfo(TaskIdx, DeviceIdx);
|
|||
|
if (df != null)
|
|||
|
{
|
|||
|
ActionComplete(DeviceIdx, Convert.ToInt32(df[0]), 1);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
sdo = CommModeCreate.CreateSendDeviceOrder(DeviceIdx);
|
|||
|
sdo.SendDeviceOrder(2, 0, 0, DeviceIdx, 0, 0, 0, 0, 0, 0);
|
|||
|
|
|||
|
BB:
|
|||
|
//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3B1A8B8>쳣<EFBFBD><ECB3A3><EFBFBD><EFBFBD>980
|
|||
|
dbo.ExceSQL("update T_Monitor_Task set F_STATUS=-1 where F_ManageTaskKindIndex=" + mti + " and F_ManageTaskIndex=" + fid + " and F_STATUS=0");
|
|||
|
dbo.ExceSQL("update T_Manage_Task set FExceptionNO=" + Model.CGeneralFunction.TASKEMPTYOUTPUT + " where (F_ManageTaskKindIndex = " + mti + ") AND (FID = " + fid + ")");
|
|||
|
//20100108
|
|||
|
dvm = dbo.ExceSQL("select * from T_Monitor_Task WHERE (F_ManageTaskIndex = " + fid + ") AND (F_ManageTASKKINDINDEX =" + mti + ")").Tables[0].DefaultView;
|
|||
|
for (int i = 0; i < dvm.Count; i++)
|
|||
|
{//20091023
|
|||
|
ActionComplete(Convert.ToInt32(dvm[i]["F_DeviceIndex"]), Convert.ToInt32(dvm[i]["F_MonitorIndex"]), Model.CGeneralFunction.TASKDELETE);
|
|||
|
}
|
|||
|
if (ErrId == Model.CGeneralFunction.STACKEMPTYOUTPUTDOUBLE)
|
|||
|
{
|
|||
|
if (rfid != -1)
|
|||
|
{
|
|||
|
fid = rfid;
|
|||
|
rfid = -1;
|
|||
|
goto BB;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
if (devinfo.UseCommonDB == "1")
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
//if (((devKind == 2) || (devKind == 4)))
|
|||
|
//{//<2F><><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// sdo = CommModeCreate.CreateSendDeviceOrder(DeviceIdx);
|
|||
|
// sdo.SendDeviceOrder(2, 0, 0, DeviceIdx, 0);
|
|||
|
//}
|
|||
|
//if ((devKind == 1)) //<2F>Ѷ<EFBFBD><D1B6><EFBFBD>
|
|||
|
//{
|
|||
|
|
|||
|
// sdo = CommModeCreate.CreateSendDeviceOrder(DeviceIdx);
|
|||
|
// sdo.SendDeviceOrder(2, 0, 0, DeviceIdx, 0, 0, 0, 0, 0, 0);
|
|||
|
//}
|
|||
|
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
//dbo.TransRollback();
|
|||
|
if (FrmControlMonitor.FormInstance.GetObjectText("tsStatus").IndexOf("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" + ex.Message) < 0)
|
|||
|
{
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit("tsStatus", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" + ex.Message, true);
|
|||
|
|
|||
|
}
|
|||
|
//throw ex;
|
|||
|
}
|
|||
|
finally
|
|||
|
{//20100108
|
|||
|
dvmon=null;
|
|||
|
dt = null;
|
|||
|
dv0 = null;
|
|||
|
dvm = null;
|
|||
|
//dvIO = null;
|
|||
|
//dr = null;
|
|||
|
//DV = null;
|
|||
|
//dvc = null;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// <20>豸<EFBFBD><E8B1B8>ʼ<EFBFBD><CABC><EFBFBD>У<EFBFBD>
|
|||
|
/// 1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>̽<EFBFBD><CCBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD>е<EFBFBD>λ<EFBFBD>û<EFBFBD>д<EFBFBD><D0B4><EFBFBD>ع<EFBFBD><D8B9><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// 2<><32><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD>ʼִ<CABC><D6B4>״̬
|
|||
|
/// 3<><33><EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
/// <param name="DeviceIdx"><3E>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD></param>
|
|||
|
/// <param name="TaskIdx"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
public void ActionStartRun(int DeviceIdx, int TaskIdx)
|
|||
|
{
|
|||
|
if (TaskIdx <= 0)
|
|||
|
return;
|
|||
|
|
|||
|
int mti = ccf.GetManageTaskIndexfromMonitor(TaskIdx);
|
|||
|
int mtikind = ccf.GetManageTaskKindIndexFromMonitor(TaskIdx);
|
|||
|
//dbo.TransBegin();
|
|||
|
//DataView dvma;
|
|||
|
//DataView dvma1;
|
|||
|
DataView dvlane;
|
|||
|
DataView dv;
|
|||
|
try
|
|||
|
{
|
|||
|
|
|||
|
|
|||
|
#region <EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
|
|||
|
dbo.ExceSQL("update T_Monitor_Task set F_Status=2 where F_Status=1 and F_MonitorIndex=" + TaskIdx);
|
|||
|
#endregion
|
|||
|
|
|||
|
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD>е<EFBFBD>λ<EFBFBD>û<EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
dbo.ExceSQL("update T_Manage_Task set FCurrentLocation=" +
|
|||
|
DeviceIdx + " where F_ManageTaskKindIndex=" + mtikind + " and FID=" + mti + "");
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><D2B2>¼<EFBFBD><C2BC>ǰλ<C7B0>ã<EFBFBD><C3A3><EFBFBD>Ҫ<EFBFBD>Ǹ<EFBFBD><C7B8><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
dbo.ExceSQL("update T_Monitor_Task set F_CurrentLocation=" +
|
|||
|
DeviceIdx + " where F_MonitorIndex=" + TaskIdx);
|
|||
|
//<2F>豸<EFBFBD><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
//20090918<31><38><EFBFBD>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>F_HaveGoods=0
|
|||
|
//20100108
|
|||
|
dvlane = dbo.ExceSQL("SELECT F_LaneGateDeviceIndex FROM T_Base_Lane_Gate where F_LaneGateDeviceIndex=" + DeviceIdx).Tables[0].DefaultView;
|
|||
|
if (dvlane.Count > 0 || DeviceIdx == 12010)
|
|||
|
{
|
|||
|
if (DeviceIdx == 12010)
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_HaveGoods=0 where F_DeviceIndex=12012 and F_HaveGoods = 1");
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_HaveGoods=0 where F_DeviceIndex=" + DeviceIdx);
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{//20100710
|
|||
|
dvlane = dbo.ExceSQL("SELECT F_AGVGateDeviceIndex FROM T_Base_AGV_Gate where F_AGVGateDeviceIndex=" + DeviceIdx).Tables[0].DefaultView;
|
|||
|
if (dvlane.Count > 0)
|
|||
|
{
|
|||
|
dbo.ExceSQL("update T_Base_Device set F_HaveGoods=0 where F_DeviceIndex=" + DeviceIdx);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
//dbo.TransCommit();
|
|||
|
//RefreshControlMonitor(DeviceIdx);
|
|||
|
//20091107
|
|||
|
if (CStaticClass.MovedDeviceAheadTrigger == "1")
|
|||
|
{
|
|||
|
#region <EFBFBD>ж<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<EFBFBD>豸<EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|||
|
//<2F><><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>F_AheadTrigger
|
|||
|
//20100108
|
|||
|
dv = dbo.ExceSQL("select F_AheadTrigger from T_Monitor_Task " +
|
|||
|
"where F_MonitorIndex=" + TaskIdx + " and F_AheadTrigger like '" + DeviceIdx.ToString() + "-" + "%'").Tables[0].DefaultView;
|
|||
|
if (dv.Count > 0)
|
|||
|
{
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
char[] cc = new char[1] { '-' };
|
|||
|
string[] sp = dv[0]["F_AheadTrigger"].ToString().Split(cc);
|
|||
|
if (sp.GetLength(0) > 0)
|
|||
|
{
|
|||
|
int TriTask = Convert.ToInt32(sp[1]);
|
|||
|
//20100108 CControl ccl = new CControl();
|
|||
|
if (ccl.SendMonitorTask(TriTask) == true)
|
|||
|
{
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
dbo.ExceSQL("update T_Monitor_Task set F_AheadTrigger ='' where F_MonitorIndex=" + TaskIdx);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|
|||
|
|
|||
|
#region <EFBFBD><EFBFBD>TaskIdx<EFBFBD><EFBFBD>ǰһ<EFBFBD>豸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//dbo.ExceSQL("update T_Base_Device set F_LockedState=0 where F_LockedState=" + TaskIdx);
|
|||
|
//dbo.ExceSQL("update T_Base_Device set F_LockedState="+TaskIdx+" where F_DeviceIndex=" + DeviceIdx);
|
|||
|
#endregion
|
|||
|
|
|||
|
//zhangxy <20>ij<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>תʱ<D7AA><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>״̬ Ϊ12.
|
|||
|
//if ((DeviceIdx == 2141 || DeviceIdx == 2142 || DeviceIdx == 3141 || DeviceIdx == 3142) && (mtikind == 1))
|
|||
|
//{
|
|||
|
|
|||
|
// dboM.ExceSQL("update IO_CONTROL set CONTROL_STATUS=12 where CONTROL_ID=" + mti);
|
|||
|
|
|||
|
//}
|
|||
|
//20101220,<2C><><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>ͳ<EFBFBD>ָ<EFBFBD><D6B8>ʱ<EFBFBD><CAB1><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
// if (DeviceIdx == 12076 || DeviceIdx == 12082 || DeviceIdx == 12088 || DeviceIdx == 22049 || DeviceIdx == 32069)
|
|||
|
|
|||
|
if (DeviceIdx == 22049 || DeviceIdx == 32069 || DeviceIdx == 32080)//2<><32><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD><CCBB><EFBFBD>3<EFBFBD><33><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD><CCBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD><CCBB><EFBFBD><EFBFBD>ͳ<EFBFBD>ָ<EFBFBD><D6B8>ִ<EFBFBD><D6B4>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ɡ<EFBFBD>
|
|||
|
{
|
|||
|
int DeviceOrder = ccf.GetDeviceOrderFromMonitor(TaskIdx);
|
|||
|
if(DeviceOrder==6)
|
|||
|
{
|
|||
|
int endindex=ccf.GetEndTransDevice(DeviceIdx, TaskIdx);
|
|||
|
if (endindex>0)
|
|||
|
{
|
|||
|
ActionComplete(endindex,TaskIdx, 0);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
if (DeviceIdx == 12074 || DeviceIdx == 12080 || DeviceIdx == 12086)//1<><31><EFBFBD><EFBFBD><EFBFBD>ݲɼ<DDB2><C9BC><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>תָ<D7AA><D6B8>ִ<EFBFBD><D6B4>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ɡ<EFBFBD>
|
|||
|
{
|
|||
|
//int DeviceOrder = ccf.GetDeviceOrderFromMonitor(TaskIdx);
|
|||
|
//if (DeviceOrder == 2)
|
|||
|
//{
|
|||
|
// ActionComplete(DeviceIdx, TaskIdx, 0);
|
|||
|
|
|||
|
//}
|
|||
|
}
|
|||
|
#region RGV<EFBFBD><EFBFBD><EFBFBD>Ȳ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
#region 4301<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Я<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//4218<31><38><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//4211-4212<31><32><EFBFBD>⣻4207-4208<30><38><EFBFBD>⣻4203-4204<30><34><EFBFBD>⣻
|
|||
|
//4210-4209<30><39><EFBFBD>⣻4206-4205<30><35><EFBFBD>⣻4202-4201<30><31><EFBFBD>⣻
|
|||
|
//if (DeviceIdx == 4301)
|
|||
|
//{
|
|||
|
|
|||
|
// if (ccf.GetFCONTROLTASKTYPEFromManageTask(mtikind, mti) == 1)
|
|||
|
// {
|
|||
|
// //<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Я<EFBFBD><D0AF><EFBFBD><EFBFBD><EFBFBD>յ㵽4220<32><30><EFBFBD><EFBFBD><EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD>9<EFBFBD><39><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>
|
|||
|
// //20100108
|
|||
|
// dvma = dbo.ExceSQL("SELECT T_Manage_Task.F_ManageTaskKindIndex, T_Manage_Task.FID, T_Monitor_Task.F_MonitorIndex" +
|
|||
|
// " FROM T_Manage_Task ,T_Monitor_Task WHERE T_Manage_Task.F_ManageTaskKindIndex = T_Monitor_Task.F_ManageTASKKINDINDEX " +
|
|||
|
// "AND T_Manage_Task.FID = T_Monitor_Task.F_ManageTaskIndex and T_Monitor_Task.F_MonitorTaskLevel = 9 and FENDDEVICE=4220 and " +
|
|||
|
// "FCONTROLTASKTYPE=2 and FSTATUS =2").Tables[0].DefaultView;
|
|||
|
// if (dvma.Count <= 0)
|
|||
|
// {
|
|||
|
// //<2F><><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD>Я<EFBFBD><D0AF><EFBFBD><EFBFBD>RGV<47><56><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1A3ACB7><EFBFBD>һ<EFBFBD><D2BB>Я<EFBFBD><D0AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// //20100108
|
|||
|
// dvma1 = dbo.ExceSQL("SELECT T_Manage_Task.F_ManageTaskKindIndex, T_Manage_Task.FID " +
|
|||
|
// " FROM T_Manage_Task WHERE FENDDEVICE=4220 and " +
|
|||
|
// "FCONTROLTASKTYPE=2 and FSTATUS =2").Tables[0].DefaultView;
|
|||
|
// for (int i = 0; i < dvma1.Count; i++)
|
|||
|
// {
|
|||
|
// DataView dvmo = dbo.ExceSQL("SELECT F_MonitorIndex,F_DeviceIndex,F_DeviceCommandIndex FROM T_Monitor_Task " +
|
|||
|
// "where F_ManageTaskIndex=" + dvma1[i]["FID"] + " and F_ManageTASKKINDINDEX=" + dvma1[i]["F_ManageTaskKindIndex"] +
|
|||
|
// " and F_MonitorTaskLevel <> 9 order by F_MonitorIndex asc").Tables[0].DefaultView;
|
|||
|
// if (dvmo.Count > 0)
|
|||
|
// {
|
|||
|
// if ((dvmo[0]["F_DeviceCommandIndex"].ToString() == "3") && (ccf.GetDeviceKindIdx(Convert.ToInt32(dvmo[0]["F_DeviceIndex"])) == 2))
|
|||
|
// {
|
|||
|
// dbo.ExceSQL("update T_Monitor_Task set F_MonitorTaskLevel=9 where F_ManageTaskIndex=" + dvma1[i]["FID"] + " and F_ManageTASKKINDINDEX=" + dvma1[i]["F_ManageTaskKindIndex"] + "");
|
|||
|
// break;
|
|||
|
// }
|
|||
|
// }
|
|||
|
// }
|
|||
|
// }
|
|||
|
|
|||
|
// }
|
|||
|
//}
|
|||
|
#endregion
|
|||
|
#endregion
|
|||
|
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
_CGetStateError = "ControlSystem.CGetState<74><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" + ex.Message;
|
|||
|
//dbo.TransRollback();
|
|||
|
}
|
|||
|
finally
|
|||
|
{//20100108
|
|||
|
//dvma = null;
|
|||
|
//dvma1 = null;
|
|||
|
dvlane = null;
|
|||
|
dv = null;
|
|||
|
}
|
|||
|
}
|
|||
|
public bool GetManage_Kind(int taskidx)
|
|||
|
{//20100108
|
|||
|
DataSet ds;
|
|||
|
try
|
|||
|
{
|
|||
|
//CCommonFunction ccf=new CCommonFunction();
|
|||
|
ds = dbo.ExceSQL("SELECT F_ManageTaskIndex, F_ManageTaskKindIndex, F_MonitorIndex FROM T_Monitor_Task Where F_MonitorIndex=" + taskidx);
|
|||
|
if (ds.Tables[0].DefaultView.Count > 0)
|
|||
|
{
|
|||
|
_fid = Convert.ToInt32(ds.Tables[0].DefaultView[0]["F_ManageTaskIndex"]);
|
|||
|
_mti = Convert.ToInt32(ds.Tables[0].DefaultView[0]["F_ManageTaskKindIndex"]);
|
|||
|
//if (_mti == 1)
|
|||
|
//{
|
|||
|
// DataView dv = dbo.ExceSQL("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE, FENDDEVICE FROM T_Manage_Task where FID=" + _fid + " and F_ManageTaskKindIndex=" + _mti).Tables[0].DefaultView;
|
|||
|
// if (dv.Count > 0)
|
|||
|
// {
|
|||
|
// _endnode = Convert.ToInt32(dv[0]["FENDDEVICE"]);
|
|||
|
// _iotype = Convert.ToInt32(ccf.GetIOType(dv[0]["FCONTROLTASKTYPE"].ToString()));
|
|||
|
// }
|
|||
|
//}
|
|||
|
return true;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw ex;
|
|||
|
}
|
|||
|
finally
|
|||
|
{//20100108
|
|||
|
ds = null;
|
|||
|
}
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// <20>жϴ<D0B6><CFB4>豸<EFBFBD><E8B1B8><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڰ<EFBFBD><DAB0><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
/// <param name="deviceIdx"><3E>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD></param>
|
|||
|
/// <returns></returns>
|
|||
|
public bool DevcieIfHaveGoods(int deviceIdx)
|
|||
|
{
|
|||
|
devinfo = Model.CGetInfo.GetDeviceInfo(deviceIdx);
|
|||
|
if (devinfo.BindingDevice!=null)
|
|||
|
{
|
|||
|
switch (devinfo.DeviceKind)
|
|||
|
{
|
|||
|
case 1://5,6
|
|||
|
|
|||
|
break;
|
|||
|
case 2://1,2,3
|
|||
|
|
|||
|
break;
|
|||
|
case 3:
|
|||
|
|
|||
|
break;
|
|||
|
case 4:
|
|||
|
|
|||
|
break;
|
|||
|
default:
|
|||
|
break;
|
|||
|
}
|
|||
|
//<2F><>ȡ<EFBFBD>豸̽<E8B1B8><CCBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ1<D6B5><31>0
|
|||
|
if (CStaticClass.GetDevicePhotoelectric(Convert.ToInt32(devinfo.BindingDevice)) == 1)
|
|||
|
{
|
|||
|
return true;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// <20>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫ<EFBFBD><D2AA>ȷ<EFBFBD><C8B7>
|
|||
|
/// </summary>
|
|||
|
/// <param name="mti"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
/// <param name="fid"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
/// <returns></returns>
|
|||
|
public bool IfSoftConfirm(int mti, int fid)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
DataSet ds = dbo.ExceSQL("SELECT FID,F_ManageTaskKindIndex,FCONTROLTASKTYPE, FCODE,FSOFTCONFIRM FROM T_Manage_Task,T_ITEMTASKTYPE where FCONTROLTASKTYPE =FCODE and FSOFTCONFIRM='1' and F_ManageTaskKindIndex=" + mti + " and FID= " + fid);
|
|||
|
if (ds.Tables[0].DefaultView.Count > 0)
|
|||
|
{
|
|||
|
return true;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw ex;
|
|||
|
}
|
|||
|
}
|
|||
|
public void SetStackPalletTask(int FMANAGEID)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
//<2F><>FMANAGEID<49><44>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD>Ӧһ<D3A6><D2BB>FMANAGEID<49><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>״̬
|
|||
|
dbo.ExceSQL("update T_Manage_Task set FIntoStepOK='0' where FIntoStepOK='-' and FMANAGEID=" +FMANAGEID);
|
|||
|
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw ex;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
//ˢ<>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
public void RefreshControlMonitor(int devidx)
|
|||
|
{//_States[5] == DeviceIdx
|
|||
|
try
|
|||
|
{
|
|||
|
|
|||
|
|
|||
|
if (CStaticClass.RealRefresh == true)
|
|||
|
{
|
|||
|
//<2F><>ʾ<EFBFBD>豸ָ<E8B1B8><D6B8>
|
|||
|
DataSet ds = dbo1.ExceSQL("select * from V_Monitor_Task where " +CStaticClass.Monstatus);
|
|||
|
FrmControlMonitor.FormInstance.MonitorRefresh(ds.Tables[0].DefaultView);
|
|||
|
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
FrmControlMonitor.FormInstance.ManagerRefresh(
|
|||
|
dbo1.ExceSQL("select * from V_Manage_Task where "+CStaticClass.Manstatus).Tables[0].DefaultView);
|
|||
|
}
|
|||
|
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
DataSet dsD = dbo1.ExceSQL("SELECT F_DeviceIndex,F_DeviceKindIndex,F_BindingDevice FROM T_Base_Device where F_DeviceIndex=" + devidx);
|
|||
|
DataView DvD = dsD.Tables[0].DefaultView;
|
|||
|
if (DvD.Count > 0)
|
|||
|
{
|
|||
|
switch (Convert.ToInt32(DvD[0]["F_DeviceKindIndex"]))
|
|||
|
{
|
|||
|
case 1://<2F>Ѷ<EFBFBD><D1B6><EFBFBD>
|
|||
|
FlashStack(Convert.ToInt32(DvD[0]["F_DeviceIndex"]));
|
|||
|
break;
|
|||
|
case 4://RGV<47><56><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
FlashRGV(Convert.ToInt32(DvD[0]["F_DeviceIndex"]));
|
|||
|
break;
|
|||
|
case 6://AGV/LGV
|
|||
|
FlashAGV(Convert.ToInt32(DvD[0]["F_DeviceIndex"]));
|
|||
|
break;
|
|||
|
default://<2F><><EFBFBD><EFBFBD><EFBFBD>豸
|
|||
|
FlashElseDevice(Convert.ToInt32(DvD[0]["F_DeviceIndex"]));
|
|||
|
break;
|
|||
|
}
|
|||
|
//if ((DvD[0]["F_BindingDevice"] != DBNull.Value) && ((DvD[0]["F_BindingDevice"].ToString().Trim() != "")))//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸
|
|||
|
//{
|
|||
|
// FlashBindDevice(DvD[0]["F_BindingDevice"].ToString());
|
|||
|
//}
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw ex;
|
|||
|
}
|
|||
|
}
|
|||
|
//2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,5<><35><EFBFBD>豸<EFBFBD><E8B1B8>
|
|||
|
public void FlashStack(int devindex)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
if (_States == null) return;
|
|||
|
char[] cc=new char[1]{';'};
|
|||
|
string[] split;
|
|||
|
string strflag;
|
|||
|
int laneno;
|
|||
|
int x;
|
|||
|
string strGet;
|
|||
|
strGet = GetControl_Picture(devindex);
|
|||
|
if (strGet != "")
|
|||
|
{
|
|||
|
split = strGet.Split(cc);
|
|||
|
}
|
|||
|
else//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ʾ
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
if (_States == null) return;
|
|||
|
if (_States[1] >= 30)//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
strflag = "Err";
|
|||
|
}
|
|||
|
else if (_States[1] == 1)//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
strflag = "";
|
|||
|
}
|
|||
|
else//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
strflag = "Goods";
|
|||
|
}
|
|||
|
//////////////////////////////
|
|||
|
///////////////////////////////
|
|||
|
//<2F><>4<EFBFBD>֣<EFBFBD><D6A3>Ѷ<EFBFBD><D1B6><EFBFBD>x<EFBFBD><78><EFBFBD>꣬<EFBFBD><EAA3AC>-<2D>ع<EFBFBD><D8B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<2E><><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD>ڣ<EFBFBD>6ʱ<36>ǣ<EFBFBD><C7A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>ڣ<EFBFBD>6ʱ<36>ǣ<EFBFBD><C7A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//Ӧ<><D3A6><EFBFBD><EFBFBD>T_Base_StackInfo<66>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if (_States[3] >= 16)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
laneno = 2;
|
|||
|
x=_States[3]-16;
|
|||
|
}
|
|||
|
else//1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
laneno = 1;
|
|||
|
x=15-_States[3];
|
|||
|
}
|
|||
|
ResourceManager rm = new ResourceManager("ControlSystem.Properties.Resources", this.GetType().Assembly);
|
|||
|
char[] dot = new char[1] { '.'};
|
|||
|
string[] picfile = split[1].Split(dot);
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(split[0], (System.Drawing.Image)rm.GetObject(strflag + picfile[0]));
|
|||
|
|
|||
|
DataSet ds = dbo.ExceSQL("select * from t_base_LaneInfo where F_LaneDeviceIndex="+laneno );
|
|||
|
DataView dv = ds.Tables[0].DefaultView;
|
|||
|
if (dv.Count > 0)
|
|||
|
{
|
|||
|
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(split[0],Convert.ToInt32(dv[0]["F_LeftY"]),(Convert.ToInt32(dv[0]["F_LeftX"])
|
|||
|
+ x * Convert.ToInt32(dv[0]["F_ShelfWidth"])));
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
if (FrmControlMonitor.FormInstance.GetObjectText("tsStatus").IndexOf("<22>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>ʱ<EFBFBD><CAB1>" + ex.Message) < 0)
|
|||
|
{
|
|||
|
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit("tsStatus", "<22>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>ʱ<EFBFBD><CAB1>" + ex.Message, true);
|
|||
|
}
|
|||
|
//throw ex;
|
|||
|
}
|
|||
|
}
|
|||
|
public void FlashAGV(int devindex)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
|
|||
|
char[] cc = new char[1] { ';' };
|
|||
|
string[] split;
|
|||
|
string strflag;
|
|||
|
string strGet;
|
|||
|
strGet = GetControl_Picture(devindex);
|
|||
|
if (strGet != "")
|
|||
|
{
|
|||
|
split = strGet.Split(cc);
|
|||
|
}
|
|||
|
else//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ʾ
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
if (_States[1] >= 30)//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
strflag = "Err";
|
|||
|
}
|
|||
|
else if (_States[1] == 1)//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
strflag = "";
|
|||
|
}
|
|||
|
else//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
strflag = "Goods";
|
|||
|
}
|
|||
|
ResourceManager rm = new ResourceManager("ControlSystem.Properties.Resources", this.GetType().Assembly);
|
|||
|
char[] dot = new char[1] { '.' };
|
|||
|
string[] picfile = split[1].Split(dot);
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(split[0], (System.Drawing.Image)rm.GetObject(strflag + picfile[0]));
|
|||
|
DataSet ds = dbo.ExceSQL("select * from T_Base_AGV_Gate where F_Address='" + _States[3] +"'");
|
|||
|
DataView dv = ds.Tables[0].DefaultView;
|
|||
|
if (dv.Count > 0)
|
|||
|
{
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(split[0],Convert.ToInt32(dv[0]["F_Top"]),
|
|||
|
Convert.ToInt32(dv[0]["F_Left"]));
|
|||
|
}
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(split[0],System.Windows.Forms.ImageLayout.Stretch);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
if (FrmControlMonitor.FormInstance.GetObjectText("tsStatus").IndexOf("AGV<47><56><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>ʱ<EFBFBD><CAB1>" + ex.Message) < 0)
|
|||
|
{
|
|||
|
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit("tsStatus", "AGV<47><56><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>ʱ<EFBFBD><CAB1>" + ex.Message, true);
|
|||
|
}
|
|||
|
//throw ex;
|
|||
|
}
|
|||
|
}
|
|||
|
public void FlashRGV(int devindex)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
|
|||
|
char[] cc = new char[1] { ';' };
|
|||
|
string[] split;
|
|||
|
string strflag;
|
|||
|
string strGet;
|
|||
|
strGet = GetControl_Picture(devindex);
|
|||
|
if (strGet != "")
|
|||
|
{
|
|||
|
split = strGet.Split(cc);
|
|||
|
}
|
|||
|
else//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ʾ
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
if (_States[1] >= 30)//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
strflag = "Err";
|
|||
|
}
|
|||
|
else if (_States[1] == 1)//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
strflag = "";
|
|||
|
}
|
|||
|
else//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
strflag = "Goods";
|
|||
|
}
|
|||
|
ResourceManager rm = new ResourceManager("ControlSystem.Properties.Resources", this.GetType().Assembly);
|
|||
|
char[] dot = new char[1] { '.' };
|
|||
|
string[] picfile = split[1].Split(dot);
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(split[0],(System.Drawing.Image)rm.GetObject(strflag + picfile[0]));
|
|||
|
DataSet ds = dbo.ExceSQL("select * from T_Base_RGV_Gate where F_Address='" + _States[3] + "'");
|
|||
|
DataView dv = ds.Tables[0].DefaultView;
|
|||
|
if (dv.Count > 0)
|
|||
|
{
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(split[0],Convert.ToInt32(dv[0]["F_Top"]),
|
|||
|
Convert.ToInt32(dv[0]["F_Left"]));
|
|||
|
}
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(split[0],System.Windows.Forms.ImageLayout.Stretch);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
if (FrmControlMonitor.FormInstance.GetObjectText("tsStatus").IndexOf("RGV<47><56><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>ʱ<EFBFBD><CAB1>" + ex.Message) < 0)
|
|||
|
{
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit("tsStatus", "RGV<47><56><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>ʱ<EFBFBD><CAB1>" + ex.Message, true);
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
//throw ex;
|
|||
|
}
|
|||
|
}
|
|||
|
public void FlashElseDevice(int devindex)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
|
|||
|
char[] cc = new char[1] { ';' };
|
|||
|
string[] split;
|
|||
|
string strflag;
|
|||
|
string strGet;
|
|||
|
strGet = GetControl_Picture(devindex);
|
|||
|
if (strGet != "")
|
|||
|
{
|
|||
|
split = strGet.Split(cc);
|
|||
|
}
|
|||
|
else//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ʾ
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
if (_States == null) return;
|
|||
|
if (_States[1] >= 10)//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
strflag = "Err";
|
|||
|
}
|
|||
|
else if ((_States[1] == 1) || (_States[1] == 2) || (_States[1] == 3) || (_States[1] == 4) || (_States[1] ==5 ) || (_States[1] ==6 ) || (_States[1] ==7 ) || (_States[1] ==8 ))//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
strflag = "";
|
|||
|
}
|
|||
|
else//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
strflag = "Goods";
|
|||
|
}
|
|||
|
ResourceManager rm = new ResourceManager("ControlSystem.Properties.Resources", this.GetType().Assembly);
|
|||
|
char[] dot = new char[1] { '.' };
|
|||
|
string[] picfile = split[1].Split(dot);
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(split[0],(System.Drawing.Image)rm.GetObject(strflag + picfile[0]));
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
if (FrmControlMonitor.FormInstance.GetObjectText("tsStatus").IndexOf("<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>ʱ<EFBFBD><CAB1>" + ex.Message) < 0)
|
|||
|
{
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit("tsStatus", "<22>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>ʱ<EFBFBD><CAB1>" + ex.Message, true);
|
|||
|
|
|||
|
}
|
|||
|
//throw ex;
|
|||
|
}
|
|||
|
}
|
|||
|
public void FlashBindDevice(string BindDevice)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
char[] cc = new char[1] { ';' };
|
|||
|
string[] split = BindDevice.Split(cc);
|
|||
|
string StrGet;
|
|||
|
string[] pic;
|
|||
|
|
|||
|
int[] States;
|
|||
|
ResourceManager rm = new ResourceManager("ControlSystem.Properties.Resources", this.GetType().Assembly);
|
|||
|
char[] dot = new char[1] { '.' };
|
|||
|
string[] picfile;
|
|||
|
for (int i = split.GetLowerBound(0); i <= split.GetUpperBound(0); i++)
|
|||
|
{
|
|||
|
StrGet = GetControl_Picture(Convert.ToInt32(split[i]));
|
|||
|
if (StrGet != "")
|
|||
|
{
|
|||
|
pic = StrGet.Split(cc);
|
|||
|
picfile = pic[1].Split(dot);
|
|||
|
gds = CommModeCreate.CreateGetDeviceState(Convert.ToInt32(split[i]));
|
|||
|
States = gds.GetDeviceState(Convert.ToInt32(split[i]), 64777);//1<><31><EFBFBD><EFBFBD>,2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,5<>豸<EFBFBD><E8B1B8>
|
|||
|
if (States != null)
|
|||
|
{
|
|||
|
|
|||
|
if (States[0] == 1)
|
|||
|
{
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(pic[0], true);
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(pic[0],
|
|||
|
(System.Drawing.Image)rm.GetObject(picfile[0]));
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(pic[0], false);
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(pic[0],false);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw ex;
|
|||
|
}
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// F_ControlName<6D><65><EFBFBD>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>Ŀؼ<C4BF><D8BC><EFBFBD><EFBFBD><EFBFBD>;F_Picture<72>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ͼƬ<CDBC><C6AC>
|
|||
|
/// </summary>
|
|||
|
/// <param name="devindex"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public string GetControl_Picture(int devindex)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
string data;
|
|||
|
DataSet ds = dbo.ExceSQL("SELECT F_DeviceIndex, F_Picture, F_ControlName FROM T_Base_Device Where F_DeviceIndex =" + devindex + " and F_DeviceVisual=1 ");
|
|||
|
if (ds.Tables[0].DefaultView.Count > 0)
|
|||
|
{
|
|||
|
data = ds.Tables[0].DefaultView[0]["F_ControlName"].ToString() + ";" + ds.Tables[0].DefaultView[0]["F_Picture"].ToString();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
data = "";
|
|||
|
}
|
|||
|
return data;
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw ex;
|
|||
|
}
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// <20>ж<EFBFBD><D0B6>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA>·<EFBFBD><C2B7><EFBFBD>и<EFBFBD><D0B8>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
/// <param name="RouteKindIdx">·<><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
/// <param name="DevIdx"><3E>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD></param>
|
|||
|
/// <param name="Order"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
/// <returns></returns>
|
|||
|
public bool IFDeviceLastOrder(int DetailIdx,int DevIdx,int order)
|
|||
|
{
|
|||
|
char[] cc = new char[1] { ';' };
|
|||
|
string[] split;
|
|||
|
DataView dv = dbo.ExceSQL("SELECT F_DetailIndex,F_DeviceIndex, F_Orders FROM T_Base_Route_Detail Where F_DeviceIndex=" + DevIdx + " and F_DetailIndex="+DetailIdx ).Tables[0].DefaultView;
|
|||
|
if (dv.Count > 0)
|
|||
|
{
|
|||
|
if (dv[0]["F_Orders"].ToString().IndexOf(';') >= 0)
|
|||
|
{
|
|||
|
split = dv[0]["F_Orders"].ToString().Split(cc);
|
|||
|
if (order ==Convert.ToInt32( split[split.GetUpperBound(0)]))
|
|||
|
{
|
|||
|
return true;
|
|||
|
}
|
|||
|
else
|
|||
|
return false;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return true;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
public string GetDetailIndexFromMonitor(int taskIdx)
|
|||
|
{
|
|||
|
DataView dv = dbo.ExceSQL("select F_DetailIndex,F_DeviceCommandIndex from T_Monitor_Task where F_MonitorIndex=" + taskIdx).Tables[0].DefaultView;
|
|||
|
if (dv.Count > 0)
|
|||
|
{
|
|||
|
return dv[0]["F_DetailIndex"].ToString() + "-" + dv[0]["F_DeviceCommandIndex"].ToString();
|
|||
|
}
|
|||
|
else
|
|||
|
return "";
|
|||
|
}
|
|||
|
public void ReturnManageInfo(int fid, int mti, string cap, bool IFOK)
|
|||
|
{
|
|||
|
string dtime = DateTime.Now.ToString("u");//20101028
|
|||
|
dtime = dtime.Substring(0, dtime.Length - 1);//20101028
|
|||
|
char[] cc = new char[1] { '-' };
|
|||
|
string[] fcc;
|
|||
|
DataView dv;
|
|||
|
try
|
|||
|
{
|
|||
|
//200906240111<31><31><EFBFBD>ӻ<EFBFBD>λ<EFBFBD><CEBB>¼:<3A><><EFBFBD><EFBFBD>1-<2D><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2-<2D><>ʼλ<CABC><CEBB><EFBFBD><EFBFBD><DEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3-<2D><>ʼλ<CABC><CEBB><EFBFBD><EFBFBD><DEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>л<EFBFBD>
|
|||
|
//20100108
|
|||
|
dv = dbo.ExceSQL("SELECT * FROM T_Manage_Task where F_ManageTaskKindIndex=" + mti + " and FID=" + fid + "").Tables[0].DefaultView;
|
|||
|
if (dv.Count > 0)
|
|||
|
{
|
|||
|
if (IFOK == true)
|
|||
|
{
|
|||
|
|
|||
|
switch (dv[0]["FCONTROLTASKTYPE"].ToString())
|
|||
|
{
|
|||
|
case "1":
|
|||
|
if (dv[0]["FENDCELL"].ToString().IndexOf("-")>0)//20100905
|
|||
|
{
|
|||
|
fcc = dv[0]["FENDCELL"].ToString().Split(cc);
|
|||
|
dbo.ExceSQL("UPDATE ST_CELL SET FRUNSTATUS=0,FCELLSTATUS = 1,FPALLETBARCODE='" + dv[0]["FPALLETBARCODE"] + "' WHERE (FLaneWay=" + dv[0]["FENDDEVICE"] + " and F_Z='" +
|
|||
|
fcc[0] + "' and F_X='" + fcc[1] + "' and F_Y='" + fcc[2] + "')");
|
|||
|
}
|
|||
|
break;
|
|||
|
case "2":
|
|||
|
// if (CStaticClass.StopTestLane == true)
|
|||
|
{
|
|||
|
if (dv[0]["FSTARTCELL"].ToString().IndexOf("-") > 0)//20100905
|
|||
|
{
|
|||
|
fcc = dv[0]["FSTARTCELL"].ToString().Split(cc);
|
|||
|
dbo.ExceSQL("UPDATE ST_CELL SET FRUNSTATUS=0,FCELLSTATUS =0,FPALLETBARCODE='-' WHERE (FLaneWay=" + dv[0]["FSTARTDEVICE"] + " and F_Z=" +
|
|||
|
fcc[0] + " and F_X=" + fcc[1] + " and F_Y=" + fcc[2] + ")");
|
|||
|
}
|
|||
|
}
|
|||
|
break;
|
|||
|
case "3":
|
|||
|
if (CStaticClass.StopTestLane == true)
|
|||
|
{
|
|||
|
if (dv[0]["FENDCELL"].ToString().IndexOf("-") > 0)//20100905
|
|||
|
{
|
|||
|
fcc = dv[0]["FENDCELL"].ToString().Split(cc);//FRUNSTATUS=0,
|
|||
|
dbo.ExceSQL("UPDATE ST_CELL SET FCELLSTATUS = 1,FPALLETBARCODE='" + dv[0]["FPALLETBARCODE"] + "' WHERE (FLaneWay=" + dv[0]["FENDDEVICE"] + " and F_Z=" +
|
|||
|
fcc[0] + " and F_X=" + fcc[1] + " and F_Y=" + fcc[2] + ")");
|
|||
|
}
|
|||
|
if (dv[0]["FSTARTCELL"].ToString().IndexOf("-") > 0)//20100905
|
|||
|
{
|
|||
|
fcc = dv[0]["FSTARTCELL"].ToString().Split(cc);//FRUNSTATUS=0,
|
|||
|
dbo.ExceSQL("UPDATE ST_CELL SET FCELLSTATUS =0,FPALLETBARCODE='-' WHERE (FLaneWay=" + dv[0]["FSTARTDEVICE"] + " and F_Z=" +
|
|||
|
fcc[0] + " and F_X=" + fcc[1] + " and F_Y=" + fcc[2] + ")");
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{//<2F><><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>
|
|||
|
string nextcell = GetNextCell((int)dv[0]["FLANEWAY"], dv[0]["FSTARTCELL"].ToString(),dv[0]["FENDCELL"].ToString());
|
|||
|
string cell = "";
|
|||
|
int laneway = (int)dv[0]["FLANEWAY"];
|
|||
|
if (nextcell.Contains(";") == true)
|
|||
|
{
|
|||
|
char[] ccc = new char[1] { ';' };
|
|||
|
string[] sp = nextcell.Split(ccc);
|
|||
|
cell = sp[1];
|
|||
|
laneway = Convert.ToInt32(sp[0]);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
cell = nextcell;
|
|||
|
}
|
|||
|
int AutoManageIdx = ccf.GetTempManageIdx();
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T_Manage_Task(<28><><EFBFBD><EFBFBD><EFBFBD>µĵ<C2B5><C4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><>
|
|||
|
//ccf.RecordMaxTempManageTaskFID(AutoManageIdx);
|
|||
|
dbo.ExceSQL("INSERT INTO T_Manage_Task(FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE," +
|
|||
|
" FSTARTDEVICE, FSTARTCELL, FENDDEVICE, FENDCELL, FLANEWAY, FSTACK)VALUES " +
|
|||
|
"(" + AutoManageIdx + ",2,3,'" + dv[0]["FLANEWAY"] + "','" + dv[0]["FENDCELL"].ToString() +
|
|||
|
"','" + laneway + "','" + cell + "'," + laneway + "," + dv[0]["FSTACK"] + ")");
|
|||
|
|
|||
|
ccf.SetRunStatus(ccf.GetWarehouseIndex(), Convert.ToInt32(dv[0]["FLANEWAY"]), dv[0]["FENDCELL"].ToString(), "1");
|
|||
|
ccf.SetRunStatus(ccf.GetWarehouseIndex(), laneway, cell, "1");
|
|||
|
}
|
|||
|
break;
|
|||
|
default:
|
|||
|
break;
|
|||
|
}
|
|||
|
|
|||
|
//if (CStaticClass.TestTemp == true)
|
|||
|
//{
|
|||
|
// //<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FISRETURNֱ<4E>ӳ<EFBFBD><D3B3><EFBFBD>
|
|||
|
// if (dv[0]["FCONTROLTASKTYPE"].ToString() == "1")
|
|||
|
// {
|
|||
|
|
|||
|
// int AutoManageIdx = ccf.GetTempManageIdx();
|
|||
|
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>T_Manage_Task(<28><><EFBFBD><EFBFBD><EFBFBD>µĵ<C2B5><C4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><>
|
|||
|
// //ccf.RecordMaxTempManageTaskFID(AutoManageIdx);
|
|||
|
// dbo.ExceSQL("INSERT INTO T_Manage_Task(FID,FPALLETBARCODE, F_ManageTaskKindIndex, FCONTROLTASKTYPE, FWAREHOUSE," +
|
|||
|
// " FSTARTDEVICE, FSTARTCELL, FENDDEVICE, FENDCELL, FLANEWAY, FSTACK)VALUES " +
|
|||
|
// "(" + AutoManageIdx + ",'" + dv[0]["FPALLETBARCODE"] + "',2,2,12," + dv[0]["FLANEWAY"] + ",'" + dv[0]["FENDCELL"].ToString() +
|
|||
|
// "'," + dv[0]["FISRETURN"] + ",'-'," + dv[0]["FLANEWAY"] + "," + dv[0]["FSTACK"] + ")");
|
|||
|
|
|||
|
|
|||
|
// }
|
|||
|
//}
|
|||
|
//20101028
|
|||
|
dbo.ExceSQL("update T_Manage_Task set FSTATUS=999,FENDTIME='"+dtime+"' where FID=" + fid + " and F_ManageTaskKindIndex= " + mti);
|
|||
|
|
|||
|
//add by zx 20121213 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD><CCBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
int enddevice = Convert.ToInt32(dv[0]["FENDDEVICE"]);
|
|||
|
|
|||
|
RecordBarCodeForDiePan(fid, enddevice);
|
|||
|
SendMsgtoLamp(fid);
|
|||
|
|
|||
|
//add by zx 20121213 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD><CCBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
switch (dv[0]["FCONTROLTASKTYPE"].ToString())
|
|||
|
{
|
|||
|
case "1":
|
|||
|
if (dv[0]["FENDCELL"].ToString().IndexOf("-") > 0)//20100905
|
|||
|
{
|
|||
|
fcc = dv[0]["FENDCELL"].ToString().Split(cc);
|
|||
|
dbo.ExceSQL("UPDATE ST_CELL SET FRUNSTATUS=0,FPALLETBARCODE='' WHERE (FLaneWay=" + dv[0]["FENDDEVICE"] + " and F_Z='" +
|
|||
|
fcc[0] + "' and F_X='" + fcc[1] + "' and F_Y='" + fcc[2] + "')");
|
|||
|
}
|
|||
|
break;
|
|||
|
case "2":
|
|||
|
if (dv[0]["FSTARTCELL"].ToString().IndexOf("-") > 0)//20100905
|
|||
|
{
|
|||
|
fcc = dv[0]["FSTARTCELL"].ToString().Split(cc);
|
|||
|
dbo.ExceSQL("UPDATE ST_CELL SET FRUNSTATUS=0,FPALLETBARCODE='" + dv[0]["FPALLETBARCODE"] + "' WHERE (FLaneWay=" + dv[0]["FSTARTDEVICE"] + " and F_Z=" +
|
|||
|
fcc[0] + " and F_X=" + fcc[1] + " and F_Y=" + fcc[2] + ")");
|
|||
|
}
|
|||
|
break;
|
|||
|
case "3":
|
|||
|
if (dv[0]["FENDCELL"].ToString().IndexOf("-") > 0)//20100905
|
|||
|
{
|
|||
|
fcc = dv[0]["FENDCELL"].ToString().Split(cc);
|
|||
|
dbo.ExceSQL("UPDATE ST_CELL SET FRUNSTATUS=0,FPALLETBARCODE='' WHERE (FLaneWay=" + dv[0]["FENDDEVICE"] + " and F_Z=" +
|
|||
|
fcc[0] + " and F_X=" + fcc[1] + " and F_Y=" + fcc[2] + ")");
|
|||
|
}
|
|||
|
if (dv[0]["FSTARTCELL"].ToString().IndexOf("-") > 0)//20100905
|
|||
|
{
|
|||
|
fcc = dv[0]["FSTARTCELL"].ToString().Split(cc);
|
|||
|
dbo.ExceSQL("UPDATE ST_CELL SET FRUNSTATUS=0,FPALLETBARCODE='" + dv[0]["FPALLETBARCODE"] + "' WHERE (FLaneWay=" + dv[0]["FSTARTDEVICE"] + " and F_Z=" +
|
|||
|
fcc[0] + " and F_X=" + fcc[1] + " and F_Y=" + fcc[2] + ")");
|
|||
|
}
|
|||
|
|
|||
|
break;
|
|||
|
default:
|
|||
|
break;
|
|||
|
}
|
|||
|
//20101028
|
|||
|
dbo.ExceSQL("update T_Manage_Task set FSTATUS=900,FENDTIME='" + dtime + "' where FID=" + fid + " and F_ManageTaskKindIndex= " + mti);
|
|||
|
}
|
|||
|
}
|
|||
|
dbo.ExceSQL("delete from T_Manage_Task where FID=" + fid + " and F_ManageTaskKindIndex= " + mti);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw ex;
|
|||
|
}
|
|||
|
finally
|
|||
|
{
|
|||
|
dv = null;
|
|||
|
}
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸״̬
|
|||
|
/// </summary>
|
|||
|
/// <param name="TaskIdx"><3E>豸ָ<E8B1B8><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
/// <param name="DeviceIdx"><3E>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD></param>
|
|||
|
/// /// <param name="RouteIDSub"><3E><><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD>ı<EFBFBD><C4B1><EFBFBD></param>
|
|||
|
public void GetKindDeviceState(int TaskIdx, int DeviceIdx,int RouteIDSub)
|
|||
|
{
|
|||
|
int[] States;
|
|||
|
try
|
|||
|
{
|
|||
|
// DateTime dt1 = DateTime.Now;
|
|||
|
|
|||
|
States = CStaticClass.GetDeviceState(DeviceIdx);//1<><31><EFBFBD><EFBFBD>,2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,5<>豸<EFBFBD><E8B1B8>
|
|||
|
// DateTime dt2 = DateTime.Now;
|
|||
|
|
|||
|
// System.Diagnostics.Trace.WriteLine(DeviceIdx + "******" + Convert.ToString(dt2 - dt1));
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
if (FrmControlMonitor.FormInstance.GetObjectText("tsStatus").IndexOf("<22><>ȡ״̬ʱ<CCAC><CAB1>" + ex.Message) < 0)
|
|||
|
{
|
|||
|
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit("tsStatus", "<22><>ȡ״̬ʱ<CCAC><CAB1>" + ex.Message, true);
|
|||
|
}
|
|||
|
return;
|
|||
|
}
|
|||
|
if (DeviceIdx == 12012)
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
_States = States;
|
|||
|
if (States == null)//û<><C3BB><EFBFBD>յ<EFBFBD><D5B5>κη<CEBA><CEB7><EFBFBD>ֵ
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
TaskIdx = States[2];
|
|||
|
int runstatus =States[1];
|
|||
|
if (TaskIdx <= 0 || runstatus <=0)
|
|||
|
{
|
|||
|
|
|||
|
//<2F><><EFBFBD>̻<EFBFBD><CCBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD><C6A1><EFBFBD><EFBFBD>ͺ<EFBFBD>2<EFBFBD><32><EFBFBD>Ӻ<EFBFBD>ϵͳ<CFB5>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if (DeviceIdx == 12028)
|
|||
|
{
|
|||
|
DataView dvtemp = dbo.ExceSQL("select F_MonitorIndex ,F_StartTime from T_Monitor_Task where F_DeviceIndex =12028 and F_DeviceCommandIndex in (7,8) and F_Status =1").Tables[0].DefaultView;
|
|||
|
if (dvtemp.Count > 0)
|
|||
|
{
|
|||
|
if (Information.IsDate(dvtemp[0]["F_StartTime"]))//20110513
|
|||
|
{
|
|||
|
if (Convert.ToDateTime(dvtemp[0]["F_StartTime"]).AddSeconds(2) > DateTime.Now)//
|
|||
|
{
|
|||
|
TaskIdx = Convert.ToInt32(dvtemp[0]["F_MonitorIndex"]);
|
|||
|
ActionComplete(DeviceIdx, TaskIdx, 1);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
return;
|
|||
|
}
|
|||
|
int fid = ccf.GetManageTaskIndexfromMonitor(TaskIdx);
|
|||
|
int mti = ccf.GetManageTaskKindIndexFromMonitor(TaskIdx);
|
|||
|
if (States[1] >= 10)//<2F><><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
//<2F><>д<EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>״̬<D7B4>֣<EFBFBD>IO_Control,T_Manage_Task,T_Monitor_task<73><6B>
|
|||
|
|
|||
|
ActionError(DeviceIdx, TaskIdx, States[1]);//
|
|||
|
#region ˫<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>ͬʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//devinfo = Model.CGetInfo.GetDeviceInfo(DeviceIdx);
|
|||
|
//if (devinfo.IfCorrelDoubleFork == "1")
|
|||
|
//{
|
|||
|
// if (Model.CGeneralFunction.DoubleForkIfSync(TaskIdx, DeviceIdx, 1) == true)
|
|||
|
// {
|
|||
|
// string[] df = Model.CGeneralFunction.GetDoubleForkMonitorInfo(TaskIdx, DeviceIdx);
|
|||
|
// if (df != null)
|
|||
|
// {
|
|||
|
// ActionError(Convert.ToInt32(df[2]), Convert.ToInt32(df[0]), States[1]);
|
|||
|
// }
|
|||
|
// }
|
|||
|
//}
|
|||
|
#endregion
|
|||
|
//ˢ<>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
|
|||
|
}
|
|||
|
switch (ccf.GetDeviceKindIdx(DeviceIdx))
|
|||
|
{
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><CCBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>豸
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>дT_Manage_Task<73>ĵ<EFBFBD>ǰλ<C7B0><CEBB>
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź͵<C5BA>ǰλ<C7B0><CEBB><EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><C5B4>ݵ<EFBFBD><DDB5><EFBFBD>ǰ<EFBFBD>豸ʱ<E8B1B8><CAB1><EFBFBD>ѱ<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>ǰһ<C7B0>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//ͬʱ<CDAC>ѵ<EFBFBD>ǰ<EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
case 1://<2F>Ѷ<EFBFBD><D1B6><EFBFBD>:
|
|||
|
//1-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2-<2D><><EFBFBD><EFBFBD>;3-Ҫ<><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD><D8B7><EFBFBD><EFBFBD><EFBFBD>;
|
|||
|
//4-֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
if ((States[1] == 1))//<2F><>ʼ<EFBFBD><CABC><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD>T_Monitor_Task<73><6B>F_Status=2// || (States[0] == 2)
|
|||
|
{//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><CCBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>豸
|
|||
|
// CommonClassLib.CCarryConvert.WriteDarkCasket("ActionStartRun", "start", DeviceIdx.ToString(), string.Empty);
|
|||
|
|
|||
|
ActionStartRun(DeviceIdx, TaskIdx);
|
|||
|
// CommonClassLib.CCarryConvert.WriteDarkCasket("ActionStartRun", "end", DeviceIdx.ToString(), string.Empty);
|
|||
|
if (mti == 1)
|
|||
|
{//20100714
|
|||
|
dboM.ExecuteSql("update IO_CONTROL set CONTROL_STATUS=11 where CONTROL_ID=" + fid + "");
|
|||
|
}
|
|||
|
#region ˫<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//20100323
|
|||
|
devinfo = Model.CGetInfo.GetDeviceInfo(DeviceIdx);
|
|||
|
if (devinfo.IfCorrelDoubleFork == "1")
|
|||
|
{
|
|||
|
if (Model.CGeneralFunction.DoubleForkIfSync(TaskIdx, DeviceIdx, 1) == true)
|
|||
|
{
|
|||
|
string[] df = Model.CGeneralFunction.GetDoubleForkMonitorInfo(TaskIdx, DeviceIdx);
|
|||
|
if (df != null)
|
|||
|
{
|
|||
|
ActionStartRun(Convert.ToInt32( df[2]),Convert.ToInt32( df[0]));
|
|||
|
if (mti == 1)
|
|||
|
{//20100714
|
|||
|
fid = ccf.GetManageTaskIndexfromMonitor(Convert.ToInt32(df[0]));
|
|||
|
dboM.ExecuteSql("update IO_CONTROL set CONTROL_STATUS=11 where CONTROL_ID=" + fid + "");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
//ˢ<>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
|
|||
|
}
|
|||
|
if (States[1] == 2)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,Ӧ<><D3A6>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
string[] df = Model.CGeneralFunction.GetDoubleForkMonitorInfo(TaskIdx, DeviceIdx);
|
|||
|
bool snyc=Model.CGeneralFunction.DoubleForkIfSync(TaskIdx, DeviceIdx, 1) ;
|
|||
|
//20100702 int dfm = ccf.GetCorrelDoubleForkFromMonitor(TaskIdx);
|
|||
|
// CommonClassLib.CCarryConvert.WriteDarkCasket("ActionComplete", "start", DeviceIdx.ToString(), string.Empty );
|
|||
|
ActionComplete(DeviceIdx, TaskIdx,1);
|
|||
|
// CommonClassLib.CCarryConvert.WriteDarkCasket("ActionComplete", "end", DeviceIdx.ToString(), string.Empty);
|
|||
|
//ˢ<>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
#region ˫<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><EFBFBD>첽<EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD>ִ<EFBFBD>й<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//20100323
|
|||
|
devinfo = Model.CGetInfo.GetDeviceInfo(DeviceIdx);
|
|||
|
if ((devinfo.IfCorrelDoubleFork == "1") && (df != null))//20100702
|
|||
|
{
|
|||
|
|
|||
|
if (snyc== true)//20100702
|
|||
|
{
|
|||
|
ActionComplete(DeviceIdx, Convert.ToInt32(df[0]), 1);//20100702
|
|||
|
|
|||
|
}
|
|||
|
else
|
|||
|
{//20100702
|
|||
|
|
|||
|
ccl.SendMonitorTask(Convert.ToInt32( df[0]));
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|
|||
|
|
|||
|
break;
|
|||
|
case 2://<2F><><EFBFBD>ͻ<EFBFBD>
|
|||
|
|
|||
|
if ((States[1] == 1))//<2F><>ʼ<EFBFBD><CABC><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD>T_Monitor_Task<73><6B>F_Status=2// || (States[0] == 2)
|
|||
|
{//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><CCBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>豸
|
|||
|
// CommonClassLib.CCarryConvert.WriteDarkCasket("ActionStartRun", "start", DeviceIdx.ToString(), string.Empty);
|
|||
|
if (DeviceIdx == 12012)
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
ActionStartRun(DeviceIdx, TaskIdx);
|
|||
|
// CommonClassLib.CCarryConvert.WriteDarkCasket("ActionStartRun", "end", DeviceIdx.ToString(), string.Empty);
|
|||
|
#region ˫<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//20100323
|
|||
|
devinfo = Model.CGetInfo.GetDeviceInfo(DeviceIdx);
|
|||
|
if (devinfo.IfCorrelDoubleFork == "1")
|
|||
|
{
|
|||
|
if (Model.CGeneralFunction.DoubleForkIfSync(TaskIdx, DeviceIdx, 2) == true)
|
|||
|
{
|
|||
|
string[] df = Model.CGeneralFunction.GetDoubleForkMonitorInfo(TaskIdx, DeviceIdx);
|
|||
|
if (df != null)
|
|||
|
{
|
|||
|
ActionStartRun(Convert.ToInt32(df[2]), Convert.ToInt32(df[0]));
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
//ˢ<>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
|
|||
|
}
|
|||
|
if (States[1] == 2)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
string[] df = Model.CGeneralFunction.GetDoubleForkMonitorInfo(TaskIdx, DeviceIdx);
|
|||
|
bool snyc = Model.CGeneralFunction.DoubleForkIfSync(TaskIdx, DeviceIdx, 2);
|
|||
|
devinfo = Model.CGetInfo.GetDeviceInfo(DeviceIdx);
|
|||
|
if (devinfo.IfCorrelDoubleFork == "1")//20101220
|
|||
|
{
|
|||
|
int updowndevice=ccf.GetUpAndDownDevices(DeviceIdx,devinfo.Dbw1Address);
|
|||
|
if(-1!=updowndevice)
|
|||
|
{
|
|||
|
GetKindDeviceState(0,updowndevice,0);
|
|||
|
}
|
|||
|
}
|
|||
|
//20100702 int dfm = ccf.GetCorrelDoubleForkFromMonitor(TaskIdx);
|
|||
|
// CommonClassLib.CCarryConvert.WriteDarkCasket("ActionComplete", "start", DeviceIdx.ToString(), string.Empty);
|
|||
|
ActionComplete(DeviceIdx, TaskIdx, 1);
|
|||
|
// CommonClassLib.CCarryConvert.WriteDarkCasket("ActionComplete", "end", DeviceIdx.ToString(), string.Empty);
|
|||
|
//ˢ<>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
#region ˫<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><EFBFBD>첽<EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD>ִ<EFBFBD>й<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//20100323
|
|||
|
//devinfo = Model.CGetInfo.GetDeviceInfo(DeviceIdx);
|
|||
|
if (devinfo.IfCorrelDoubleFork == "1")
|
|||
|
{
|
|||
|
|
|||
|
if ((devinfo.IfCorrelDoubleFork == "1") && (df != null))//20100702
|
|||
|
{
|
|||
|
|
|||
|
if (snyc == true)//20100702
|
|||
|
{
|
|||
|
ActionComplete(DeviceIdx, Convert.ToInt32(df[0]), 1);//20100702
|
|||
|
|
|||
|
}
|
|||
|
else
|
|||
|
{//20100702
|
|||
|
|
|||
|
ccl.SendMonitorTask(Convert.ToInt32(df[0]));
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
case 4://<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if ((States[1] == 1)) //<2F><>ʼ<EFBFBD><CABC><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD>T_Monitor_Task<73><6B>F_Status=2// || (States[0] == 2)
|
|||
|
{//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><CCBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>豸
|
|||
|
ActionStartRun(DeviceIdx, TaskIdx);
|
|||
|
//ˢ<>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
}
|
|||
|
if (States[1] == 2)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
ActionComplete(DeviceIdx, TaskIdx,1);
|
|||
|
//ˢ<>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
}
|
|||
|
break;
|
|||
|
case 5://<2F><><EFBFBD>̻<EFBFBD>
|
|||
|
|
|||
|
break;
|
|||
|
case 6://AGV<47><56>
|
|||
|
|
|||
|
break;
|
|||
|
case 7://<2F><><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD>:<3A><>Ҫ<EFBFBD><D2AA>IO_ControlDetail<69><6C><EFBFBD>ȶ<EFBFBD><C8B6><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|||
|
|
|||
|
break;
|
|||
|
case 8://<2F><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>IO_ControlDetail<69><6C>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|||
|
|
|||
|
break;
|
|||
|
case 9://վ̨
|
|||
|
|
|||
|
break;
|
|||
|
case 10://<2F><><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
break;
|
|||
|
case 11://<2F>ּ<EFBFBD><D6BC><EFBFBD>
|
|||
|
|
|||
|
break;
|
|||
|
case 12://<2F><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>
|
|||
|
|
|||
|
break;
|
|||
|
case 13://<2F><><EFBFBD>豸
|
|||
|
|
|||
|
break;
|
|||
|
case 14://ȷ<>ϰ<EFBFBD>ť
|
|||
|
|
|||
|
break;
|
|||
|
case 15://<2F><>ʱ<EFBFBD><CAB1>
|
|||
|
|
|||
|
break;
|
|||
|
case 16://ָʾ<D6B8><CABE>
|
|||
|
|
|||
|
break;
|
|||
|
case 17://<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
break;
|
|||
|
case 18://<2F><><EFBFBD><EFBFBD><E2BFAA>
|
|||
|
|
|||
|
break;
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9>翪<EFBFBD>ص<EFBFBD><D8B5>ź<EFBFBD>
|
|||
|
/// </summary>
|
|||
|
public void GetAllLESwitch()
|
|||
|
{
|
|||
|
//IGetDeviceState gds;
|
|||
|
int[] States;
|
|||
|
CCommonFunction ccf = new CCommonFunction();
|
|||
|
DataView dv = new DataView();
|
|||
|
int temp;
|
|||
|
char[] cc = new char[1] { ';' };
|
|||
|
ResourceManager rm = new ResourceManager("ControlSystem.Properties.Resources", this.GetType().Assembly);
|
|||
|
char[] dot = new char[1] { '.' };
|
|||
|
string[] picfile;
|
|||
|
string StrGet;
|
|||
|
string[] pic;
|
|||
|
int IfVis = 0;
|
|||
|
|
|||
|
try
|
|||
|
{
|
|||
|
dv = dbo.ExceSQL("SELECT F_DeviceIndex,F_DBW2Address FROM T_Base_Device WHERE (F_DeviceKindIndex = 28)").Tables[0].DefaultView;
|
|||
|
if (dv.Count > 0)
|
|||
|
{
|
|||
|
gds = CommModeCreate.CreateGetDeviceState(Convert.ToInt32(dv[0]["F_DeviceIndex"]));
|
|||
|
States = gds.GetDeviceState(Convert.ToInt32(dv[0]["F_DeviceIndex"]), 0);
|
|||
|
}
|
|||
|
else
|
|||
|
return;
|
|||
|
if (States != null)
|
|||
|
{
|
|||
|
DataView dvle = dbo.ExceSQL("SELECT F_DeviceIndex, F_DeviceKindIndex,F_DBWGetLength," +
|
|||
|
" F_DBW2Address, F_DeviceVisual FROM T_Base_Device WHERE (F_DeviceVisual = 1)" +
|
|||
|
" AND (F_DeviceKindIndex = 18) and (F_DBWGetLength is not NULL) and (F_DBW2Address is not NULL)").Tables[0].DefaultView;
|
|||
|
int glen = 0;
|
|||
|
|
|||
|
for (int i = 0; i < dvle.Count; i++)
|
|||
|
{
|
|||
|
temp = Convert.ToInt32(dvle[i]["F_DBWAddress"]) - Convert.ToInt32(dv[0]["F_DBWAddress"]);
|
|||
|
if (Convert.ToInt32((Convert.ToDecimal(dvle[i]["F_DBWGetLength"]) * 16 - 1)) > 7)
|
|||
|
{
|
|||
|
glen = Convert.ToInt32((Convert.ToDecimal(dvle[i]["F_DBWGetLength"]) * 16 - 1)) - 8;
|
|||
|
temp = temp + 1;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
glen = Convert.ToInt32((Convert.ToDecimal(dvle[i]["F_DBWGetLength"]) * 16 - 1));
|
|||
|
}
|
|||
|
if (temp >= 0)
|
|||
|
{
|
|||
|
IfVis = CommonClassLib.CCarryConvert.GetBitFromInteger(States[temp], glen);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
StrGet = GetControl_Picture(Convert.ToInt32(dvle[i]["F_DeviceIndex"]));
|
|||
|
if (StrGet != "")
|
|||
|
{
|
|||
|
pic = StrGet.Split(cc);
|
|||
|
picfile = pic[1].Split(dot);
|
|||
|
|
|||
|
if (IfVis == 1)
|
|||
|
{
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(pic[0], true);
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(pic[0],
|
|||
|
(System.Drawing.Image)rm.GetObject(picfile[0]));
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit(pic[0], false);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
else
|
|||
|
continue;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
if (gds.CommLayerError != null)
|
|||
|
{
|
|||
|
if (FrmControlMonitor.FormInstance.GetObjectText("tsStatus").IndexOf("ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9>翪<EFBFBD>ص<EFBFBD><D8B5>ź<EFBFBD>ʱ<EFBFBD><CAB1>" + gds.CommLayerError) < 0)
|
|||
|
{
|
|||
|
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit("tsStatus", "ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9>翪<EFBFBD>ص<EFBFBD><D8B5>ź<EFBFBD>ʱ<EFBFBD><CAB1>" + gds.CommLayerError, true);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
if (FrmControlMonitor.FormInstance.GetObjectText("tsStatus").IndexOf("ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9>翪<EFBFBD>ص<EFBFBD><D8B5>ź<EFBFBD>ʱ<EFBFBD><CAB1>" + ex.Message) < 0)
|
|||
|
{
|
|||
|
|
|||
|
FrmControlMonitor.FormInstance.FlashPanit("tsStatus", "ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9>翪<EFBFBD>ص<EFBFBD><D8B5>ź<EFBFBD>ʱ<EFBFBD><CAB1>" + ex.Message, true);
|
|||
|
}
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
string GetNextCell(int lane, string strcell,string endcell)
|
|||
|
{
|
|||
|
//int laneNew = 2801;
|
|||
|
char[] cc = new char[1] { '-' };
|
|||
|
string[] sp = strcell.Split(cc);
|
|||
|
string[] ep = endcell.Split(cc);
|
|||
|
if (sp.Length > 2)
|
|||
|
{
|
|||
|
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
//DataView dv = dbo.ExceSQL("SELECT * FROM ST_CELL WHERE (FLaneWay=" + lane + " and F_Z=" +
|
|||
|
// sp[0] + " and F_X=" + sp[1] + " and F_Y=" + sp[2] + ")").Tables[0].DefaultView;
|
|||
|
//if (dv.Count > 0)
|
|||
|
//{
|
|||
|
// DataView dv0 = dbo.ExceSQL("SELECT * FROM ST_CELL WHERE FLaneWay=" + lane + " and FID>" + dv[0]["FID"] + " order by fid asc").Tables[0].DefaultView;
|
|||
|
// if (dv0.Count > 0)
|
|||
|
// {
|
|||
|
// if (lane == 2801)
|
|||
|
// {
|
|||
|
// if ((dv0[0]["FCELLCODE"].ToString() == "2-1-8") || (dv0[0]["FCELLCODE"].ToString() == "2-2-8"))
|
|||
|
// {
|
|||
|
// return "2-3-1";
|
|||
|
// }
|
|||
|
|
|||
|
|
|||
|
// }
|
|||
|
// return dv0[0]["FCELLCODE"].ToString();
|
|||
|
// }
|
|||
|
// else
|
|||
|
// {
|
|||
|
// return "1-1-1";
|
|||
|
// }
|
|||
|
//}
|
|||
|
//else
|
|||
|
//{
|
|||
|
// return "1-1-1";
|
|||
|
//}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region <EFBFBD><EFBFBD><EFBFBD>ܶԽǵ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
//switch (lane)
|
|||
|
//{
|
|||
|
// case 2801:
|
|||
|
// if (Convert.ToInt32(sp[1]) <= 1)
|
|||
|
// {
|
|||
|
// DataView dv0 = dbo.ExceSQL("SELECT * FROM ST_CELL WHERE FLaneWay=" + lane + " and FCELLSTATUS=0 and FRUNSTATUS=0 order by fid desc").Tables[0].DefaultView;
|
|||
|
// if (dv0.Count > 0)
|
|||
|
// {
|
|||
|
// return lane.ToString() + ";" + dv0[0]["FCELLCODE"].ToString();
|
|||
|
// }
|
|||
|
// return "2-36-1";
|
|||
|
// }
|
|||
|
// else
|
|||
|
// {
|
|||
|
// return "1-1-1";
|
|||
|
// }
|
|||
|
|
|||
|
// case 2802:
|
|||
|
// if (Convert.ToInt32(sp[1]) <= 1)
|
|||
|
// {
|
|||
|
// DataView dv0 = dbo.ExceSQL("SELECT * FROM ST_CELL WHERE FLaneWay=" + lane + " and FCELLSTATUS=0 and FRUNSTATUS=0 order by fid desc").Tables[0].DefaultView;
|
|||
|
// if (dv0.Count > 0)
|
|||
|
// {
|
|||
|
// return lane.ToString() + ";" + dv0[0]["FCELLCODE"].ToString();
|
|||
|
// }
|
|||
|
// return "2-36-1";
|
|||
|
// }
|
|||
|
// else
|
|||
|
// {
|
|||
|
// return "1-1-1";
|
|||
|
// }
|
|||
|
|
|||
|
// case 2803:
|
|||
|
// if (Convert.ToInt32(sp[1]) <= 1)
|
|||
|
// {
|
|||
|
// DataView dv0 = dbo.ExceSQL("SELECT * FROM ST_CELL WHERE FLaneWay=" + lane + " and FCELLSTATUS=0 and FRUNSTATUS=0 order by fid desc").Tables[0].DefaultView;
|
|||
|
// if (dv0.Count > 0)
|
|||
|
// {
|
|||
|
// return lane.ToString() + ";" + dv0[0]["FCELLCODE"].ToString();
|
|||
|
// }
|
|||
|
// return "2-36-1";
|
|||
|
// }
|
|||
|
// else
|
|||
|
// {
|
|||
|
// return "1-1-1";
|
|||
|
// }
|
|||
|
|
|||
|
// default:
|
|||
|
// return "1-1-1";
|
|||
|
|
|||
|
//}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䵹<EFBFBD><EFBFBD>
|
|||
|
|
|||
|
//switch (lane)
|
|||
|
//{
|
|||
|
|
|||
|
// case 2801:
|
|||
|
|
|||
|
// //return "2802;1-36-8";
|
|||
|
// laneNew = 2802;
|
|||
|
// break;
|
|||
|
// case 2802:
|
|||
|
// //return "2803;1-36-8";
|
|||
|
// laneNew = 2803;
|
|||
|
// break;
|
|||
|
// case 2803:
|
|||
|
// //return "2801;1-36-8";
|
|||
|
// laneNew = 2801;
|
|||
|
// break;
|
|||
|
// default:
|
|||
|
// //return "2801;1-1-1";
|
|||
|
// laneNew = 2801;
|
|||
|
// break;
|
|||
|
//}
|
|||
|
//DataView dv0 = dbo.ExceSQL("SELECT * FROM ST_CELL WHERE FLaneWay=" + laneNew + " and FCELLSTATUS=0 and FRUNSTATUS=0 order by fid desc").Tables[0].DefaultView;
|
|||
|
//if (dv0.Count > 0)
|
|||
|
//{
|
|||
|
// return laneNew.ToString() + ";" + dv0[0]["FCELLCODE"].ToString();
|
|||
|
//}
|
|||
|
//else
|
|||
|
//{
|
|||
|
// return "2801;1-1-1";
|
|||
|
//}
|
|||
|
#endregion
|
|||
|
|
|||
|
|
|||
|
int f_xx = Convert.ToInt32(sp[1]);
|
|||
|
int f_yy = Convert.ToInt32(sp[2]);
|
|||
|
int f_zz = Convert.ToInt32(sp[0]);
|
|||
|
DataView dv00 = dbo.ExceSQL("select F_StartCol, F_EndCol ,F_LeftY from T_Base_LaneInfo where F_LaneDeviceIndex =" + lane).Tables[0].DefaultView;
|
|||
|
int F_EndCol = Convert.ToInt32(dv00[0]["F_EndCol"]);
|
|||
|
int F_LeftY = Convert.ToInt32(dv00[0]["F_LeftY"]);
|
|||
|
int F_StartCol = Convert.ToInt32(dv00[0]["F_StartCol"]);
|
|||
|
f_xx = f_xx + 1;
|
|||
|
if (f_zz == 5 )
|
|||
|
{
|
|||
|
do
|
|||
|
{
|
|||
|
f_xx++;
|
|||
|
} while ((f_xx == 2 || f_xx == 3 || f_xx == 42 || f_xx == 15 || f_xx == 16 || f_xx == 17 || f_xx == 28 || f_xx == 29|| f_xx == 30 || f_xx == 43));
|
|||
|
}
|
|||
|
if (f_xx > F_EndCol)
|
|||
|
{
|
|||
|
f_xx = F_StartCol;
|
|||
|
}
|
|||
|
f_yy = f_yy + 1;
|
|||
|
if (f_yy > F_LeftY)
|
|||
|
{
|
|||
|
f_yy = 1;
|
|||
|
}
|
|||
|
DataView dv0 = dbo.ExceSQL("SELECT * FROM ST_CELL WHERE (FLaneWay=" + lane + ") and F_X=" + f_xx + " and F_Y= " + f_yy + "and F_Z =" + f_zz).Tables[0].DefaultView;
|
|||
|
if (dv0.Count > 0)
|
|||
|
{
|
|||
|
return dv0[0]["FCELLCODE"].ToString();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
CommonClassLib.CCarryConvert.WriteDarkCasket("GetNextCell", dv0[0]["FCELLCODE"].ToString(), string.Empty , string.Empty);
|
|||
|
return "1-1-1";
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return "2801;1-1-1";
|
|||
|
}
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
/// <>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ʵ<EFBFBD>յ<EFBFBD><D5B5><EFBFBD>λ<EFBFBD><CEBB>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>ָ<EFBFBD><D6B8>
|
|||
|
/// </summary>
|
|||
|
/// <param name="mti"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
/// <param name="fid"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
/// <param name="device"><3E>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD></param>
|
|||
|
/// <param name="monitorindex"><3E>豸ָ<E8B1B8><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
void AppendMoveCellOperate(int mti, int fid, int device,int monitorindex)
|
|||
|
{
|
|||
|
|
|||
|
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>꣬<EFBFBD><EAA3AC>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬<EFBFBD><EBA3AC><EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>棬<EFBFBD><E6A3AC>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>
|
|||
|
string manzxy = dbo.GetSingle("SELECT FENDCELL FROM T_Manage_Task WHERE (FID = " + fid + ") AND (F_ManageTaskKindIndex = " + mti + ")").ToString();
|
|||
|
char[] cc = new char[1] { '-' };
|
|||
|
string[] spcell = manzxy.Split(cc);
|
|||
|
string newuseawayfork;
|
|||
|
DataView dv = dbo.ExceSQL("select F_NumParam4, F_NumParam5,F_NumParam6, F_RouteID,F_MonitorTaskLevel, F_UseAwayFork, F_TxtParam from T_Monitor_Task where F_MonitorIndex=" + monitorindex).Tables[0].DefaultView;
|
|||
|
if (dv[0]["F_UseAwayFork"].ToString() == "1")
|
|||
|
{
|
|||
|
newuseawayfork = "0";
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
newuseawayfork = "1";
|
|||
|
}
|
|||
|
dbo.ExecuteSql("update T_Manage_Task set FExceptionNO=NULL,FUseAwayFork='" + newuseawayfork + "' where F_ManageTaskKindIndex=" + mti + " and FID=" + fid);
|
|||
|
|
|||
|
int lev=int.Parse( dv[0]["F_MonitorTaskLevel"].ToString());
|
|||
|
int routeid=int.Parse( dv[0]["F_RouteID"].ToString());
|
|||
|
int fnp1=int.Parse( dv[0]["F_NumParam4"].ToString());
|
|||
|
int fnp2=int.Parse( dv[0]["F_NumParam5"].ToString());
|
|||
|
int fnp3=int.Parse( dv[0]["F_NumParam6"].ToString());
|
|||
|
string pcode=dv[0]["F_TxtParam"].ToString();
|
|||
|
//string aheaddetect=;
|
|||
|
int mindex = ccf.GetMonitorIndex(fid, mti);
|
|||
|
dbo.ExecuteSql("INSERT INTO T_Monitor_Task (F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex, F_MonitorTaskLevel," +
|
|||
|
" F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2, F_NumParam3, F_NumParam4, F_NumParam5," +
|
|||
|
" F_NumParam6, F_TxtParam, F_AheadDetect, F_UseAwayFork)VALUES " +
|
|||
|
"(" + fid + "," + mti + "," + mindex + "," + lev + "," + device + ",4," + routeid + ",0," + fnp1 + "," + fnp2 + "," + fnp3 + "," +
|
|||
|
spcell[0] + "," + spcell[1] + "," + spcell[2] + ",'"+pcode+"',NULL,'"+newuseawayfork+"')");
|
|||
|
mindex = ccf.GetMonitorIndex(fid, mti);
|
|||
|
dbo.ExecuteSql("INSERT INTO T_Monitor_Task (F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex, F_MonitorTaskLevel," +
|
|||
|
" F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2, F_NumParam3, F_NumParam4, F_NumParam5," +
|
|||
|
" F_NumParam6, F_TxtParam, F_AheadDetect, F_UseAwayFork)VALUES " +
|
|||
|
"(" + fid + "," + mti + "," + mindex + "," + lev + "," + device + ",5," + routeid + ",0," + fnp1 + "," + fnp2 + "," + fnp3 + "," +
|
|||
|
spcell[0] + "," + spcell[1] + "," + spcell[2] + ",'" + pcode + "',NULL,'" + newuseawayfork + "')");
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// <20><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD><CCBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
/// <param name="fid"></param>
|
|||
|
void RecordBarCodeForDiePan(int fid, int enddevice)
|
|||
|
{
|
|||
|
StringBuilder sb = new StringBuilder();
|
|||
|
string STOCK_BARCODE = string.Empty;
|
|||
|
int startdevice = 0;
|
|||
|
|
|||
|
DataView dvs = dbo.ExceSQL("select * from T_Manage_Task t where (t.FENDDEVICE = 12853 or t.FENDDEVICE =12839) and FExceptionNO is null and fid =" + fid).Tables[0].DefaultView;
|
|||
|
if (dvs.Count <= 0)
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
STOCK_BARCODE = dvs[0]["FPALLETBARCODE"].ToString();
|
|||
|
startdevice = Convert.ToInt32(dvs[0]["FSTARTDEVICE"]);
|
|||
|
}
|
|||
|
|
|||
|
DataView dvAsk = dbo.ExceSQL("select * from T_Base_PLC_Ask t where t.F_BindingDevice = " + enddevice).Tables[0].DefaultView;
|
|||
|
if (dvAsk.Count > 0)
|
|||
|
{
|
|||
|
if (dvAsk[0]["F_BarCode"] != DBNull.Value || dvAsk[0]["F_BarCode"].ToString() != string.Empty)
|
|||
|
{
|
|||
|
sb.Append(dvAsk[0]["F_BarCode"].ToString());
|
|||
|
}
|
|||
|
}
|
|||
|
if (sb.ToString().Contains(STOCK_BARCODE))
|
|||
|
{
|
|||
|
|
|||
|
CommonClassLib.CCarryConvert.WriteDarkCasket("OPCClient", "<22><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣʧ<CFA2><CAA7>", startdevice.ToString(), "<22><><EFBFBD>μ<EFBFBD>¼<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>" + STOCK_BARCODE + "<22>Ѵ<EFBFBD><D1B4><EFBFBD>");
|
|||
|
return;
|
|||
|
}
|
|||
|
sb.Append(STOCK_BARCODE).Append("|");
|
|||
|
dbo.ExceSQL("update T_Base_PLC_Ask set F_BarCode ='" + sb.ToString() + "' where F_BindingDevice = " + enddevice);
|
|||
|
CommonClassLib.CCarryConvert.WriteDarkCasket("OPCClient", "<22><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ɹ<EFBFBD>", startdevice.ToString(), sb.ToString());
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// <20><><EFBFBD><EFBFBD><EFBFBD>ȶԲ<C8B6><D4B2><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䵽<EFBFBD><E4B5BD>12835<33>쳣<EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>߸<EFBFBD><DFB8><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>쳣<EFBFBD><ECB3A3>
|
|||
|
/// </summary>
|
|||
|
void SendMsgtoLamp(int fid )
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
DataView dv = dbo.ExceSQL("select top 1 * from T_Manage_Task inner join T_Monitor_Task on T_Manage_Task .FID =T_Monitor_Task .F_ManageTaskIndex where T_Manage_Task .FID =" + fid + " and T_Manage_Task .F_ManageTaskKindIndex =1 and T_Manage_Task .FExceptionNO =990 order by T_Monitor_Task.F_MonitorIndex ").Tables[0].DefaultView;
|
|||
|
if (dv.Count > 0)
|
|||
|
{
|
|||
|
if (Convert.ToInt32(dv[0]["F_NumParam1"]) == 12918 && Convert.ToInt32(dv[0]["F_NumParam4"]) == 12835)
|
|||
|
{
|
|||
|
StringBuilder[] wv = new StringBuilder[1] { new StringBuilder("") };
|
|||
|
StringBuilder[] witemnames = new StringBuilder[1] { new StringBuilder("") };
|
|||
|
witemnames[0].Remove(0, witemnames[0].Length);
|
|||
|
wv[0].Remove(0, wv[0].Length);
|
|||
|
devinfo = Model.CGetInfo.GetDeviceInfo(12835);
|
|||
|
sdo = CommModeCreate.CreateSendDeviceOrder(12835);
|
|||
|
witemnames[0].Append("DB2,byte").Append(Convert.ToString((devinfo.Dbw2Address + 4)));
|
|||
|
wv[0].Append("1");
|
|||
|
sdo.WriteDBData(witemnames, wv, 12835);
|
|||
|
CommonClassLib.CCarryConvert.WriteDarkCasket("OPCClient", "<22><><EFBFBD><EFBFBD><EFBFBD>ȶԴ<C8B6><D4B4><EFBFBD><EFBFBD><EFBFBD>12835<33><35><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" + dv[0]["FID"].ToString(), "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ" + dv[0]["FSTARTCELL"].ToString() + ";<3B>յ<EFBFBD><D5B5>豸" + dv[0]["FENDDEVICE"].ToString());
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw ex;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|