diff --git a/ControlMonitorClient/CStaticClass.cs b/ControlMonitorClient/CStaticClass.cs index 8cb2367..a8158c0 100644 --- a/ControlMonitorClient/CStaticClass.cs +++ b/ControlMonitorClient/CStaticClass.cs @@ -269,7 +269,7 @@ namespace wcfControlMonitorClient } } - public static int GetManageTaskIndexfromMonitor(int monitorIdx) + public static long GetManageTaskIndexfromMonitor(int monitorIdx) { //20140218 DataView dv = new DataView(); @@ -282,7 +282,7 @@ namespace wcfControlMonitorClient dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; if (dv.Count > 0) { - return Convert.ToInt32(dv[0]["F_ManageTaskIndex"]); + return Convert.ToInt64(dv[0]["F_ManageTaskIndex"]); } else { diff --git a/ControlMonitorClient/FrmClient.cs b/ControlMonitorClient/FrmClient.cs index cf160fa..be2c9e0 100644 --- a/ControlMonitorClient/FrmClient.cs +++ b/ControlMonitorClient/FrmClient.cs @@ -1512,5 +1512,10 @@ namespace wcfControlMonitorClient { FrmUpdateStatus.FormInstance.Show(); } + + //public bool SendInOutMessageToPlc() + //{ + // throw new NotImplementedException(); + //} } } diff --git a/ControlMonitorClient/FrmModifyManage.cs b/ControlMonitorClient/FrmModifyManage.cs index e275217..1818c7d 100644 --- a/ControlMonitorClient/FrmModifyManage.cs +++ b/ControlMonitorClient/FrmModifyManage.cs @@ -113,7 +113,7 @@ namespace wcfControlMonitorClient toolStripSeparator2.Visible = false; return; } - if (Convert.ToInt32(this.dgvManager.CurrentRow.Cells["调度任务索引"].Value) > 0) + if (Convert.ToInt64(this.dgvManager.CurrentRow.Cells["调度任务索引"].Value) > 0) { TSMmanagerOK.Visible = true; @@ -143,7 +143,7 @@ namespace wcfControlMonitorClient char[] scc = new char[1] { ';' }; string[] strsplit = split[1].Split(scc); int mti = 0; - int fid = Convert.ToInt32(split[2]); + long fid = Convert.ToInt64(split[2]); if (strsplit[0] == "") return; switch (strsplit[0]) { @@ -293,12 +293,12 @@ namespace wcfControlMonitorClient throw ex; } } - int GetManageTaskIndexfromMonitor(int monitorIdx) + long GetManageTaskIndexfromMonitor(int monitorIdx) { DataView dv = dbo.ExceSQL("SELECT F_ManageTaskIndex FROM T_Monitor_Task WHERE (F_MonitorIndex = " + monitorIdx + ")").Tables[0].DefaultView; if (dv.Count > 0) { - return Convert.ToInt32(dv[0]["F_ManageTaskIndex"]); + return Convert.ToInt64(dv[0]["F_ManageTaskIndex"]); } else { diff --git a/ControlMonitorClient/FrmModifyMonitor.cs b/ControlMonitorClient/FrmModifyMonitor.cs index 7ce350b..6748059 100644 --- a/ControlMonitorClient/FrmModifyMonitor.cs +++ b/ControlMonitorClient/FrmModifyMonitor.cs @@ -62,7 +62,7 @@ namespace wcfControlMonitorClient tsmAGVGoods.Visible = false; return; } - if (Convert.ToInt32(this.dgvMonitor.CurrentRow.Cells["调度任务索引"].Value) > 0) + if (Convert.ToInt64(this.dgvMonitor.CurrentRow.Cells["调度任务索引"].Value) > 0) { TSMonitor.Visible = true; TSMManager.Visible = true; @@ -335,7 +335,7 @@ namespace wcfControlMonitorClient int devKind; int mindex = Convert.ToInt32(split[1]); - int fid = 0; + long fid = 0; int mankind =0; @@ -343,7 +343,7 @@ namespace wcfControlMonitorClient DataView dv = dbo.ExceSQL("select * from T_Monitor_Task where F_MonitorIndex=" + mindex).Tables[0].DefaultView; if (dv.Count > 0) { - fid = Convert.ToInt32(dv[0]["F_ManageTaskIndex"]); + fid = Convert.ToInt64(dv[0]["F_ManageTaskIndex"]); mankind = Convert.ToInt32(dv[0]["F_ManageTASKKINDINDEX"]); //20100108中间指令被复位时给与提示和警告 DataView dv0 = dbo.ExceSQL("SELECT MIN(F_MonitorIndex) AS mmi FROM dbo.T_Monitor_Task WHERE (F_ManageTaskIndex = " + fid + ") AND (F_ManageTASKKINDINDEX = " + mankind + ")").Tables[0].DefaultView; @@ -730,7 +730,6 @@ namespace wcfControlMonitorClient { MessageBox.Show(errtext, "操作提示:", MessageBoxButtons.OK, MessageBoxIcon.Error); } - TSMMonitorRefresh_Click(); })); } diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/Arrays11.xsd b/ControlMonitorClient/Service References/WcfControlMonitor/Arrays.xsd similarity index 99% rename from ControlMonitorClient/Service References/WcfControlMonitor/Arrays11.xsd rename to ControlMonitorClient/Service References/WcfControlMonitor/Arrays.xsd index 832b3b6..a7215b0 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/Arrays11.xsd +++ b/ControlMonitorClient/Service References/WcfControlMonitor/Arrays.xsd @@ -1,70 +1,70 @@ 锘 - + + + + + + + + + + + + + true - + - - + + - - + + true - + - + - - - - - - - - - - - - - - + + true - + - - + + - + \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/Arrays1.xsd b/ControlMonitorClient/Service References/WcfControlMonitor/Arrays1.xsd deleted file mode 100644 index aa21f2c..0000000 --- a/ControlMonitorClient/Service References/WcfControlMonitor/Arrays1.xsd +++ /dev/null @@ -1,9 +0,0 @@ -锘 - - - - - - - - \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/Model11.xsd b/ControlMonitorClient/Service References/WcfControlMonitor/Model.xsd similarity index 90% rename from ControlMonitorClient/Service References/WcfControlMonitor/Model11.xsd rename to ControlMonitorClient/Service References/WcfControlMonitor/Model.xsd index 6341893..71e1edd 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/Model11.xsd +++ b/ControlMonitorClient/Service References/WcfControlMonitor/Model.xsd @@ -1,26 +1,45 @@ 锘 - - + - - - - true - - + + - - - - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + @@ -40,17 +59,23 @@ + + + + + - + + @@ -59,11 +84,11 @@ - + - + @@ -77,9 +102,12 @@ + + + @@ -89,6 +117,24 @@ + + + + true + + + + + + + + + + + + + + @@ -108,54 +154,18 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + true - - - - - - - - + + + + - + \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/Model1.xsd b/ControlMonitorClient/Service References/WcfControlMonitor/Model1.xsd deleted file mode 100644 index e52fef1..0000000 --- a/ControlMonitorClient/Service References/WcfControlMonitor/Model1.xsd +++ /dev/null @@ -1,133 +0,0 @@ -锘 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/Reference.cs b/ControlMonitorClient/Service References/WcfControlMonitor/Reference.cs index 43961e0..45ceda0 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/Reference.cs +++ b/ControlMonitorClient/Service References/WcfControlMonitor/Reference.cs @@ -1,7 +1,7 @@ 锘//------------------------------------------------------------------------------ // // 姝や唬鐮佺敱宸ュ叿鐢熸垚銆 -// 杩愯鏃剁増鏈:4.0.30319.1 +// 杩愯鏃剁増鏈:4.0.30319.42000 // // 瀵规鏂囦欢鐨勬洿鏀瑰彲鑳戒細瀵艰嚧涓嶆纭殑琛屼负锛屽苟涓斿鏋 // 閲嶆柊鐢熸垚浠g爜锛岃繖浜涙洿鏀瑰皢浼氫涪澶便 @@ -33,7 +33,7 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Runtime.Serialization.OptionalFieldAttribute()] private string EndDeviceField; - private int FIDField; + private long FIDField; private int ManageTaskKindIndexField; @@ -111,7 +111,7 @@ namespace wcfControlMonitorClient.WcfControlMonitor { } [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)] - public int FID { + public long FID { get { return this.FIDField; } @@ -227,7 +227,7 @@ namespace wcfControlMonitorClient.WcfControlMonitor { private int ForkNoField; - private int ManageTaskIndexField; + private long ManageTaskIndexField; private int MonitorIndexField; @@ -363,7 +363,7 @@ namespace wcfControlMonitorClient.WcfControlMonitor { } [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)] - public int ManageTaskIndex { + public long ManageTaskIndex { get { return this.ManageTaskIndexField; } @@ -938,165 +938,205 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.ServiceModel.ServiceContractAttribute(ConfigurationName="WcfControlMonitor.IControlMonitor", CallbackContract=typeof(wcfControlMonitorClient.WcfControlMonitor.IControlMonitorCallback))] public interface IControlMonitor { - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/ShutDownControlSystem", ReplyAction="http://tempuri.org/IControlMonitor/ShutDownControlSystemResponse")] - bool ShutDownControlSystem(out string ErrText); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetReadedAndReportedBarcode", ReplyAction="http://tempuri.org/IControlMonitor/GetReadedAndReportedBarcodeResponse")] + bool GetReadedAndReportedBarcode(out string readedBarcode, out string reportedBarcode, out string errorText, int bindDeviceOfBarcode); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/ShutDownControlSystem", ReplyAction="http://tempuri.org/IControlMonitor/ShutDownControlSystemResponse")] - System.IAsyncResult BeginShutDownControlSystem(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetReadedAndReportedBarcode", ReplyAction="http://tempuri.org/IControlMonitor/GetReadedAndReportedBarcodeResponse")] + System.IAsyncResult BeginGetReadedAndReportedBarcode(int bindDeviceOfBarcode, System.AsyncCallback callback, object asyncState); - bool EndShutDownControlSystem(out string ErrText, System.IAsyncResult result); + bool EndGetReadedAndReportedBarcode(out string readedBarcode, out string reportedBarcode, out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/StartGetALLDeviceState", ReplyAction="http://tempuri.org/IControlMonitor/StartGetALLDeviceStateResponse")] - bool StartGetALLDeviceState(out string Errtext); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetDeviceAllErrors", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceAllErrorsResponse")] + Model.MError GetDeviceAllErrors(out string errorText, int deviceKindIndex); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/StartGetALLDeviceState", ReplyAction="http://tempuri.org/IControlMonitor/StartGetALLDeviceStateResponse")] - System.IAsyncResult BeginStartGetALLDeviceState(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetDeviceAllErrors", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceAllErrorsResponse")] + System.IAsyncResult BeginGetDeviceAllErrors(int deviceKindIndex, System.AsyncCallback callback, object asyncState); - bool EndStartGetALLDeviceState(out string Errtext, System.IAsyncResult result); + Model.MError EndGetDeviceAllErrors(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/StartSendDeviceOrder", ReplyAction="http://tempuri.org/IControlMonitor/StartSendDeviceOrderResponse")] - bool StartSendDeviceOrder(out string Errtext); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetAllRouteinfo", ReplyAction="http://tempuri.org/IControlMonitor/GetAllRouteinfoResponse")] + Model.MRoute[] GetAllRouteinfo(out string errorText); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/StartSendDeviceOrder", ReplyAction="http://tempuri.org/IControlMonitor/StartSendDeviceOrderResponse")] - System.IAsyncResult BeginStartSendDeviceOrder(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetAllRouteinfo", ReplyAction="http://tempuri.org/IControlMonitor/GetAllRouteinfoResponse")] + System.IAsyncResult BeginGetAllRouteinfo(System.AsyncCallback callback, object asyncState); - bool EndStartSendDeviceOrder(out string Errtext, System.IAsyncResult result); + Model.MRoute[] EndGetAllRouteinfo(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/DataClear", ReplyAction="http://tempuri.org/IControlMonitor/DataClearResponse")] - bool DataClear(out string Errtext); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetDeviceJoinRouteinfo", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceJoinRouteinfoResponse")] + Model.MRoute[] GetDeviceJoinRouteinfo(out string errorText, int deviceIndex); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/DataClear", ReplyAction="http://tempuri.org/IControlMonitor/DataClearResponse")] - System.IAsyncResult BeginDataClear(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetDeviceJoinRouteinfo", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceJoinRouteinfoResponse")] + System.IAsyncResult BeginGetDeviceJoinRouteinfo(int deviceIndex, System.AsyncCallback callback, object asyncState); - bool EndDataClear(out string Errtext, System.IAsyncResult result); + Model.MRoute[] EndGetDeviceJoinRouteinfo(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetManageTaskKindFromMonitor", ReplyAction="http://tempuri.org/IControlMonitor/GetManageTaskKindFromMonitorResponse")] - int GetManageTaskKindFromMonitor(out string errtext, int monitorIndex); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetManageTasks", ReplyAction="http://tempuri.org/IControlMonitor/GetManageTasksResponse")] + wcfControlMonitorClient.WcfControlMonitor.ManageTask[] GetManageTasks(out string errorText, string FieldName, string content); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetManageTaskKindFromMonitor", ReplyAction="http://tempuri.org/IControlMonitor/GetManageTaskKindFromMonitorResponse")] - System.IAsyncResult BeginGetManageTaskKindFromMonitor(int monitorIndex, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetManageTasks", ReplyAction="http://tempuri.org/IControlMonitor/GetManageTasksResponse")] + System.IAsyncResult BeginGetManageTasks(string FieldName, string content, System.AsyncCallback callback, object asyncState); - int EndGetManageTaskKindFromMonitor(out string errtext, System.IAsyncResult result); + wcfControlMonitorClient.WcfControlMonitor.ManageTask[] EndGetManageTasks(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetManageTaskIndexFromMonitor", ReplyAction="http://tempuri.org/IControlMonitor/GetManageTaskIndexFromMonitorResponse")] - int GetManageTaskIndexFromMonitor(out string errtext, int monitorIndex); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetMonitorTasks", ReplyAction="http://tempuri.org/IControlMonitor/GetMonitorTasksResponse")] + wcfControlMonitorClient.WcfControlMonitor.MonitorTask[] GetMonitorTasks(out string errorText, string FieldName, string content); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetManageTaskIndexFromMonitor", ReplyAction="http://tempuri.org/IControlMonitor/GetManageTaskIndexFromMonitorResponse")] - System.IAsyncResult BeginGetManageTaskIndexFromMonitor(int monitorIndex, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetMonitorTasks", ReplyAction="http://tempuri.org/IControlMonitor/GetMonitorTasksResponse")] + System.IAsyncResult BeginGetMonitorTasks(string FieldName, string content, System.AsyncCallback callback, object asyncState); - int EndGetManageTaskIndexFromMonitor(out string errtext, System.IAsyncResult result); + wcfControlMonitorClient.WcfControlMonitor.MonitorTask[] EndGetMonitorTasks(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetDeviceKindIndex", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceKindIndexResponse")] - int GetDeviceKindIndex(out string errtext, int deviceIndex); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetDeviceStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceStateInfoResponse")] + wcfControlMonitorClient.WcfControlMonitor.DeviceStateType GetDeviceStateInfo(out string errorText, int deviceIndex); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetDeviceKindIndex", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceKindIndexResponse")] - System.IAsyncResult BeginGetDeviceKindIndex(int deviceIndex, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetDeviceStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceStateInfoResponse")] + System.IAsyncResult BeginGetDeviceStateInfo(int deviceIndex, System.AsyncCallback callback, object asyncState); - int EndGetDeviceKindIndex(out string errtext, System.IAsyncResult result); + wcfControlMonitorClient.WcfControlMonitor.DeviceStateType EndGetDeviceStateInfo(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/SendDeviceReset", ReplyAction="http://tempuri.org/IControlMonitor/SendDeviceResetResponse")] - bool SendDeviceReset(out string errtext, int deviceIndex, int ResetOrder); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/SetDeviceStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/SetDeviceStateInfoResponse")] + bool SetDeviceStateInfo(out string errorText, wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/SendDeviceReset", ReplyAction="http://tempuri.org/IControlMonitor/SendDeviceResetResponse")] - System.IAsyncResult BeginSendDeviceReset(int deviceIndex, int ResetOrder, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/SetDeviceStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/SetDeviceStateInfoResponse")] + System.IAsyncResult BeginSetDeviceStateInfo(wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate, System.AsyncCallback callback, object asyncState); - bool EndSendDeviceReset(out string errtext, System.IAsyncResult result); + bool EndSetDeviceStateInfo(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/Heartbeat", ReplyAction="http://tempuri.org/IControlMonitor/HeartbeatResponse")] - bool Heartbeat(out Model.MonitorInfo monitorinfo); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/SetRouteStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/SetRouteStateInfoResponse")] + bool SetRouteStateInfo(out string errorText, int routeID, bool isEnabled); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/Heartbeat", ReplyAction="http://tempuri.org/IControlMonitor/HeartbeatResponse")] - System.IAsyncResult BeginHeartbeat(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/SetRouteStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/SetRouteStateInfoResponse")] + System.IAsyncResult BeginSetRouteStateInfo(int routeID, bool isEnabled, System.AsyncCallback callback, object asyncState); - bool EndHeartbeat(out Model.MonitorInfo monitorinfo, System.IAsyncResult result); + bool EndSetRouteStateInfo(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetDataView", ReplyAction="http://tempuri.org/IControlMonitor/GetDataViewResponse")] - System.Data.DataTable GetDataView(out string errtext, string SQL); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/SetDeviceJoinRouteStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/SetDeviceJoinRouteStateInfoResponse")] + bool SetDeviceJoinRouteStateInfo(out string errorText, int deviceIndex, bool isEnabled); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetDataView", ReplyAction="http://tempuri.org/IControlMonitor/GetDataViewResponse")] - System.IAsyncResult BeginGetDataView(string SQL, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/SetDeviceJoinRouteStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/SetDeviceJoinRouteStateInfoResponse")] + System.IAsyncResult BeginSetDeviceJoinRouteStateInfo(int deviceIndex, bool isEnabled, System.AsyncCallback callback, object asyncState); - System.Data.DataTable EndGetDataView(out string errtext, System.IAsyncResult result); + bool EndSetDeviceJoinRouteStateInfo(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/ExeSQLNoneQuery", ReplyAction="http://tempuri.org/IControlMonitor/ExeSQLNoneQueryResponse")] - int ExeSQLNoneQuery(out string errtext, string SQL); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetAllCellInfos", ReplyAction="http://tempuri.org/IControlMonitor/GetAllCellInfosResponse")] + wcfControlMonitorClient.WcfControlMonitor.ST_Cell[] GetAllCellInfos(out string errorText); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/ExeSQLNoneQuery", ReplyAction="http://tempuri.org/IControlMonitor/ExeSQLNoneQueryResponse")] - System.IAsyncResult BeginExeSQLNoneQuery(string SQL, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetAllCellInfos", ReplyAction="http://tempuri.org/IControlMonitor/GetAllCellInfosResponse")] + System.IAsyncResult BeginGetAllCellInfos(System.AsyncCallback callback, object asyncState); - int EndExeSQLNoneQuery(out string errtext, System.IAsyncResult result); + wcfControlMonitorClient.WcfControlMonitor.ST_Cell[] EndGetAllCellInfos(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetManDataView", ReplyAction="http://tempuri.org/IControlMonitor/GetManDataViewResponse")] - System.Data.DataTable GetManDataView(out string errtext, string SQL); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetLanguageFields", ReplyAction="http://tempuri.org/IControlMonitor/GetLanguageFieldsResponse")] + string[] GetLanguageFields(out string errorText); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetManDataView", ReplyAction="http://tempuri.org/IControlMonitor/GetManDataViewResponse")] - System.IAsyncResult BeginGetManDataView(string SQL, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetLanguageFields", ReplyAction="http://tempuri.org/IControlMonitor/GetLanguageFieldsResponse")] + System.IAsyncResult BeginGetLanguageFields(System.AsyncCallback callback, object asyncState); - System.Data.DataTable EndGetManDataView(out string errtext, System.IAsyncResult result); + string[] EndGetLanguageFields(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/ExeManSQLNoneQuery", ReplyAction="http://tempuri.org/IControlMonitor/ExeManSQLNoneQueryResponse")] - int ExeManSQLNoneQuery(out string errtext, string SQL); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetLanguageContent", ReplyAction="http://tempuri.org/IControlMonitor/GetLanguageContentResponse")] + wcfControlMonitorClient.WcfControlMonitor.LanguageContent[] GetLanguageContent(out string errorText, string language); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/ExeManSQLNoneQuery", ReplyAction="http://tempuri.org/IControlMonitor/ExeManSQLNoneQueryResponse")] - System.IAsyncResult BeginExeManSQLNoneQuery(string SQL, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetLanguageContent", ReplyAction="http://tempuri.org/IControlMonitor/GetLanguageContentResponse")] + System.IAsyncResult BeginGetLanguageContent(string language, System.AsyncCallback callback, object asyncState); - int EndExeManSQLNoneQuery(out string errtext, System.IAsyncResult result); + wcfControlMonitorClient.WcfControlMonitor.LanguageContent[] EndGetLanguageContent(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetAllManageTask", ReplyAction="http://tempuri.org/IControlMonitor/GetAllManageTaskResponse")] - bool GetAllManageTask(out string errtext); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetDevicesDic", ReplyAction="http://tempuri.org/IControlMonitor/GetDevicesDicResponse")] + wcfControlMonitorClient.WcfControlMonitor.DevicesDic GetDevicesDic(out string errorText); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetAllManageTask", ReplyAction="http://tempuri.org/IControlMonitor/GetAllManageTaskResponse")] - System.IAsyncResult BeginGetAllManageTask(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetDevicesDic", ReplyAction="http://tempuri.org/IControlMonitor/GetDevicesDicResponse")] + System.IAsyncResult BeginGetDevicesDic(System.AsyncCallback callback, object asyncState); - bool EndGetAllManageTask(out string errtext, System.IAsyncResult result); + wcfControlMonitorClient.WcfControlMonitor.DevicesDic EndGetDevicesDic(out string errorText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/DisassembleTask", ReplyAction="http://tempuri.org/IControlMonitor/DisassembleTaskResponse")] - bool DisassembleTask(out string errtext); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/RefreshMonitoringMode", ReplyAction="http://tempuri.org/IControlMonitor/RefreshMonitoringModeResponse")] + bool RefreshMonitoringMode(); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/DisassembleTask", ReplyAction="http://tempuri.org/IControlMonitor/DisassembleTaskResponse")] - System.IAsyncResult BeginDisassembleTask(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/RefreshMonitoringMode", ReplyAction="http://tempuri.org/IControlMonitor/RefreshMonitoringModeResponse")] + System.IAsyncResult BeginRefreshMonitoringMode(System.AsyncCallback callback, object asyncState); - bool EndDisassembleTask(out string errtext, System.IAsyncResult result); + bool EndRefreshMonitoringMode(System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/SetLogicHaveGoods", ReplyAction="http://tempuri.org/IControlMonitor/SetLogicHaveGoodsResponse")] - bool SetLogicHaveGoods(out string errtext, bool ifHaveGoods, int deviceindex); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/RegisterClient", ReplyAction="http://tempuri.org/IControlMonitor/RegisterClientResponse")] + bool RegisterClient(out string errText, string userID, string userDescription); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/SetLogicHaveGoods", ReplyAction="http://tempuri.org/IControlMonitor/SetLogicHaveGoodsResponse")] - System.IAsyncResult BeginSetLogicHaveGoods(bool ifHaveGoods, int deviceindex, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/RegisterClient", ReplyAction="http://tempuri.org/IControlMonitor/RegisterClientResponse")] + System.IAsyncResult BeginRegisterClient(string userID, string userDescription, System.AsyncCallback callback, object asyncState); - bool EndSetLogicHaveGoods(out string errtext, System.IAsyncResult result); + bool EndRegisterClient(out string errText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/DealWithDeviceState", ReplyAction="http://tempuri.org/IControlMonitor/DealWithDeviceStateResponse")] - bool DealWithDeviceState(out string errtext, int deviceindex, byte[] splitbyteValue, byte[] devicestates); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/LogoutClient", ReplyAction="http://tempuri.org/IControlMonitor/LogoutClientResponse")] + bool LogoutClient(out string errText, string userID); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/DealWithDeviceState", ReplyAction="http://tempuri.org/IControlMonitor/DealWithDeviceStateResponse")] - System.IAsyncResult BeginDealWithDeviceState(int deviceindex, byte[] splitbyteValue, byte[] devicestates, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/LogoutClient", ReplyAction="http://tempuri.org/IControlMonitor/LogoutClientResponse")] + System.IAsyncResult BeginLogoutClient(string userID, System.AsyncCallback callback, object asyncState); - bool EndDealWithDeviceState(out string errtext, System.IAsyncResult result); + bool EndLogoutClient(out string errText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/SendAllDeviceStates", ReplyAction="http://tempuri.org/IControlMonitor/SendAllDeviceStatesResponse")] - Model.MDevice SendAllDeviceStates(int device); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/ObtainTask", ReplyAction="http://tempuri.org/IControlMonitor/ObtainTaskResponse")] + bool ObtainTask(string laneway, string Order); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/SendAllDeviceStates", ReplyAction="http://tempuri.org/IControlMonitor/SendAllDeviceStatesResponse")] - System.IAsyncResult BeginSendAllDeviceStates(int device, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/ObtainTask", ReplyAction="http://tempuri.org/IControlMonitor/ObtainTaskResponse")] + System.IAsyncResult BeginObtainTask(string laneway, string Order, System.AsyncCallback callback, object asyncState); - Model.MDevice EndSendAllDeviceStates(System.IAsyncResult result); + bool EndObtainTask(System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/WriteDBData", ReplyAction="http://tempuri.org/IControlMonitor/WriteDBDataResponse")] - bool WriteDBData(out string errtext, int deviceIndex, string DBBlock, string Wdata); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/StopObtainTask", ReplyAction="http://tempuri.org/IControlMonitor/StopObtainTaskResponse")] + bool StopObtainTask(); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/WriteDBData", ReplyAction="http://tempuri.org/IControlMonitor/WriteDBDataResponse")] - System.IAsyncResult BeginWriteDBData(int deviceIndex, string DBBlock, string Wdata, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/StopObtainTask", ReplyAction="http://tempuri.org/IControlMonitor/StopObtainTaskResponse")] + System.IAsyncResult BeginStopObtainTask(System.AsyncCallback callback, object asyncState); - bool EndWriteDBData(out string errtext, System.IAsyncResult result); + bool EndStopObtainTask(System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/ReConnectOPCServer", ReplyAction="http://tempuri.org/IControlMonitor/ReConnectOPCServerResponse")] - bool ReConnectOPCServer(); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/OrderTurnOn", ReplyAction="http://tempuri.org/IControlMonitor/OrderTurnOnResponse")] + bool OrderTurnOn(); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/ReConnectOPCServer", ReplyAction="http://tempuri.org/IControlMonitor/ReConnectOPCServerResponse")] - System.IAsyncResult BeginReConnectOPCServer(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/OrderTurnOn", ReplyAction="http://tempuri.org/IControlMonitor/OrderTurnOnResponse")] + System.IAsyncResult BeginOrderTurnOn(System.AsyncCallback callback, object asyncState); - bool EndReConnectOPCServer(System.IAsyncResult result); + bool EndOrderTurnOn(System.IAsyncResult result); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/OrderTurnOff", ReplyAction="http://tempuri.org/IControlMonitor/OrderTurnOffResponse")] + bool OrderTurnOff(); + + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/OrderTurnOff", ReplyAction="http://tempuri.org/IControlMonitor/OrderTurnOffResponse")] + System.IAsyncResult BeginOrderTurnOff(System.AsyncCallback callback, object asyncState); + + bool EndOrderTurnOff(System.IAsyncResult result); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/DeviceCommunicationInit", ReplyAction="http://tempuri.org/IControlMonitor/DeviceCommunicationInitResponse")] + bool DeviceCommunicationInit(out string ErrText, string CommunicationType); + + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/DeviceCommunicationInit", ReplyAction="http://tempuri.org/IControlMonitor/DeviceCommunicationInitResponse")] + System.IAsyncResult BeginDeviceCommunicationInit(string CommunicationType, System.AsyncCallback callback, object asyncState); + + bool EndDeviceCommunicationInit(out string ErrText, System.IAsyncResult result); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetUsers", ReplyAction="http://tempuri.org/IControlMonitor/GetUsersResponse")] + System.Data.DataTable GetUsers(out string Errtext); + + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetUsers", ReplyAction="http://tempuri.org/IControlMonitor/GetUsersResponse")] + System.IAsyncResult BeginGetUsers(System.AsyncCallback callback, object asyncState); + + System.Data.DataTable EndGetUsers(out string Errtext, System.IAsyncResult result); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/BuildHandTask", ReplyAction="http://tempuri.org/IControlMonitor/BuildHandTaskResponse")] + bool BuildHandTask(out string Errtext, Model.HandTask Handtask); + + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/BuildHandTask", ReplyAction="http://tempuri.org/IControlMonitor/BuildHandTaskResponse")] + System.IAsyncResult BeginBuildHandTask(Model.HandTask Handtask, System.AsyncCallback callback, object asyncState); + + bool EndBuildHandTask(out string Errtext, System.IAsyncResult result); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/BuildHandAssociateTask", ReplyAction="http://tempuri.org/IControlMonitor/BuildHandAssociateTaskResponse")] + bool BuildHandAssociateTask(out string Errtext, int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName); + + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/BuildHandAssociateTask", ReplyAction="http://tempuri.org/IControlMonitor/BuildHandAssociateTaskResponse")] + System.IAsyncResult BeginBuildHandAssociateTask(int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName, System.AsyncCallback callback, object asyncState); + + bool EndBuildHandAssociateTask(out string Errtext, System.IAsyncResult result); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/BuildAutoTask", ReplyAction="http://tempuri.org/IControlMonitor/BuildAutoTaskResponse")] bool BuildAutoTask(out string Errtext, Model.AutoTask Autotask); @@ -1107,10 +1147,10 @@ namespace wcfControlMonitorClient.WcfControlMonitor { bool EndBuildAutoTask(out string Errtext, System.IAsyncResult result); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/ModifyManageTask", ReplyAction="http://tempuri.org/IControlMonitor/ModifyManageTaskResponse")] - bool ModifyManageTask(out string Errtext, int ManKind, int ManagetaskID, int ActionID); + bool ModifyManageTask(out string Errtext, int ManKind, long ManagetaskID, int ActionID); [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/ModifyManageTask", ReplyAction="http://tempuri.org/IControlMonitor/ModifyManageTaskResponse")] - System.IAsyncResult BeginModifyManageTask(int ManKind, int ManagetaskID, int ActionID, System.AsyncCallback callback, object asyncState); + System.IAsyncResult BeginModifyManageTask(int ManKind, long ManagetaskID, int ActionID, System.AsyncCallback callback, object asyncState); bool EndModifyManageTask(out string Errtext, System.IAsyncResult result); @@ -1298,205 +1338,173 @@ namespace wcfControlMonitorClient.WcfControlMonitor { string EndGetUserPassword(out string Errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetReadedAndReportedBarcode", ReplyAction="http://tempuri.org/IControlMonitor/GetReadedAndReportedBarcodeResponse")] - bool GetReadedAndReportedBarcode(out string readedBarcode, out string reportedBarcode, out string errorText, int bindDeviceOfBarcode); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/ShutDownControlSystem", ReplyAction="http://tempuri.org/IControlMonitor/ShutDownControlSystemResponse")] + bool ShutDownControlSystem(out string ErrText); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetReadedAndReportedBarcode", ReplyAction="http://tempuri.org/IControlMonitor/GetReadedAndReportedBarcodeResponse")] - System.IAsyncResult BeginGetReadedAndReportedBarcode(int bindDeviceOfBarcode, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/ShutDownControlSystem", ReplyAction="http://tempuri.org/IControlMonitor/ShutDownControlSystemResponse")] + System.IAsyncResult BeginShutDownControlSystem(System.AsyncCallback callback, object asyncState); - bool EndGetReadedAndReportedBarcode(out string readedBarcode, out string reportedBarcode, out string errorText, System.IAsyncResult result); + bool EndShutDownControlSystem(out string ErrText, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetDeviceAllErrors", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceAllErrorsResponse")] - Model.MError GetDeviceAllErrors(out string errorText, int deviceKindIndex); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/StartGetALLDeviceState", ReplyAction="http://tempuri.org/IControlMonitor/StartGetALLDeviceStateResponse")] + bool StartGetALLDeviceState(out string Errtext); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetDeviceAllErrors", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceAllErrorsResponse")] - System.IAsyncResult BeginGetDeviceAllErrors(int deviceKindIndex, System.AsyncCallback callback, object asyncState); - - Model.MError EndGetDeviceAllErrors(out string errorText, System.IAsyncResult result); - - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetAllRouteinfo", ReplyAction="http://tempuri.org/IControlMonitor/GetAllRouteinfoResponse")] - Model.MRoute[] GetAllRouteinfo(out string errorText); - - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetAllRouteinfo", ReplyAction="http://tempuri.org/IControlMonitor/GetAllRouteinfoResponse")] - System.IAsyncResult BeginGetAllRouteinfo(System.AsyncCallback callback, object asyncState); - - Model.MRoute[] EndGetAllRouteinfo(out string errorText, System.IAsyncResult result); - - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetDeviceJoinRouteinfo", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceJoinRouteinfoResponse")] - Model.MRoute[] GetDeviceJoinRouteinfo(out string errorText, int deviceIndex); - - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetDeviceJoinRouteinfo", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceJoinRouteinfoResponse")] - System.IAsyncResult BeginGetDeviceJoinRouteinfo(int deviceIndex, System.AsyncCallback callback, object asyncState); - - Model.MRoute[] EndGetDeviceJoinRouteinfo(out string errorText, System.IAsyncResult result); - - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetManageTasks", ReplyAction="http://tempuri.org/IControlMonitor/GetManageTasksResponse")] - wcfControlMonitorClient.WcfControlMonitor.ManageTask[] GetManageTasks(out string errorText, string FieldName, string content); - - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetManageTasks", ReplyAction="http://tempuri.org/IControlMonitor/GetManageTasksResponse")] - System.IAsyncResult BeginGetManageTasks(string FieldName, string content, System.AsyncCallback callback, object asyncState); - - wcfControlMonitorClient.WcfControlMonitor.ManageTask[] EndGetManageTasks(out string errorText, System.IAsyncResult result); - - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetMonitorTasks", ReplyAction="http://tempuri.org/IControlMonitor/GetMonitorTasksResponse")] - wcfControlMonitorClient.WcfControlMonitor.MonitorTask[] GetMonitorTasks(out string errorText, string FieldName, string content); - - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetMonitorTasks", ReplyAction="http://tempuri.org/IControlMonitor/GetMonitorTasksResponse")] - System.IAsyncResult BeginGetMonitorTasks(string FieldName, string content, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/StartGetALLDeviceState", ReplyAction="http://tempuri.org/IControlMonitor/StartGetALLDeviceStateResponse")] + System.IAsyncResult BeginStartGetALLDeviceState(System.AsyncCallback callback, object asyncState); - wcfControlMonitorClient.WcfControlMonitor.MonitorTask[] EndGetMonitorTasks(out string errorText, System.IAsyncResult result); + bool EndStartGetALLDeviceState(out string Errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetDeviceStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceStateInfoResponse")] - wcfControlMonitorClient.WcfControlMonitor.DeviceStateType GetDeviceStateInfo(out string errorText, int deviceIndex); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/StartSendDeviceOrder", ReplyAction="http://tempuri.org/IControlMonitor/StartSendDeviceOrderResponse")] + bool StartSendDeviceOrder(out string Errtext); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetDeviceStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceStateInfoResponse")] - System.IAsyncResult BeginGetDeviceStateInfo(int deviceIndex, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/StartSendDeviceOrder", ReplyAction="http://tempuri.org/IControlMonitor/StartSendDeviceOrderResponse")] + System.IAsyncResult BeginStartSendDeviceOrder(System.AsyncCallback callback, object asyncState); - wcfControlMonitorClient.WcfControlMonitor.DeviceStateType EndGetDeviceStateInfo(out string errorText, System.IAsyncResult result); + bool EndStartSendDeviceOrder(out string Errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/SetDeviceStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/SetDeviceStateInfoResponse")] - bool SetDeviceStateInfo(out string errorText, wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/DataClear", ReplyAction="http://tempuri.org/IControlMonitor/DataClearResponse")] + bool DataClear(out string Errtext); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/SetDeviceStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/SetDeviceStateInfoResponse")] - System.IAsyncResult BeginSetDeviceStateInfo(wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/DataClear", ReplyAction="http://tempuri.org/IControlMonitor/DataClearResponse")] + System.IAsyncResult BeginDataClear(System.AsyncCallback callback, object asyncState); - bool EndSetDeviceStateInfo(out string errorText, System.IAsyncResult result); + bool EndDataClear(out string Errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/SetRouteStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/SetRouteStateInfoResponse")] - bool SetRouteStateInfo(out string errorText, int routeID, bool isEnabled); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetManageTaskKindFromMonitor", ReplyAction="http://tempuri.org/IControlMonitor/GetManageTaskKindFromMonitorResponse")] + int GetManageTaskKindFromMonitor(out string errtext, int monitorIndex); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/SetRouteStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/SetRouteStateInfoResponse")] - System.IAsyncResult BeginSetRouteStateInfo(int routeID, bool isEnabled, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetManageTaskKindFromMonitor", ReplyAction="http://tempuri.org/IControlMonitor/GetManageTaskKindFromMonitorResponse")] + System.IAsyncResult BeginGetManageTaskKindFromMonitor(int monitorIndex, System.AsyncCallback callback, object asyncState); - bool EndSetRouteStateInfo(out string errorText, System.IAsyncResult result); + int EndGetManageTaskKindFromMonitor(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/SetDeviceJoinRouteStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/SetDeviceJoinRouteStateInfoResponse")] - bool SetDeviceJoinRouteStateInfo(out string errorText, int deviceIndex, bool isEnabled); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetManageTaskIndexFromMonitor", ReplyAction="http://tempuri.org/IControlMonitor/GetManageTaskIndexFromMonitorResponse")] + long GetManageTaskIndexFromMonitor(out string errtext, int monitorIndex); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/SetDeviceJoinRouteStateInfo", ReplyAction="http://tempuri.org/IControlMonitor/SetDeviceJoinRouteStateInfoResponse")] - System.IAsyncResult BeginSetDeviceJoinRouteStateInfo(int deviceIndex, bool isEnabled, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetManageTaskIndexFromMonitor", ReplyAction="http://tempuri.org/IControlMonitor/GetManageTaskIndexFromMonitorResponse")] + System.IAsyncResult BeginGetManageTaskIndexFromMonitor(int monitorIndex, System.AsyncCallback callback, object asyncState); - bool EndSetDeviceJoinRouteStateInfo(out string errorText, System.IAsyncResult result); + long EndGetManageTaskIndexFromMonitor(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetAllCellInfos", ReplyAction="http://tempuri.org/IControlMonitor/GetAllCellInfosResponse")] - wcfControlMonitorClient.WcfControlMonitor.ST_Cell[] GetAllCellInfos(out string errorText); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetDeviceKindIndex", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceKindIndexResponse")] + int GetDeviceKindIndex(out string errtext, int deviceIndex); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetAllCellInfos", ReplyAction="http://tempuri.org/IControlMonitor/GetAllCellInfosResponse")] - System.IAsyncResult BeginGetAllCellInfos(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetDeviceKindIndex", ReplyAction="http://tempuri.org/IControlMonitor/GetDeviceKindIndexResponse")] + System.IAsyncResult BeginGetDeviceKindIndex(int deviceIndex, System.AsyncCallback callback, object asyncState); - wcfControlMonitorClient.WcfControlMonitor.ST_Cell[] EndGetAllCellInfos(out string errorText, System.IAsyncResult result); + int EndGetDeviceKindIndex(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetLanguageFields", ReplyAction="http://tempuri.org/IControlMonitor/GetLanguageFieldsResponse")] - string[] GetLanguageFields(out string errorText); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/SendDeviceReset", ReplyAction="http://tempuri.org/IControlMonitor/SendDeviceResetResponse")] + bool SendDeviceReset(out string errtext, int deviceIndex, int ResetOrder); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetLanguageFields", ReplyAction="http://tempuri.org/IControlMonitor/GetLanguageFieldsResponse")] - System.IAsyncResult BeginGetLanguageFields(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/SendDeviceReset", ReplyAction="http://tempuri.org/IControlMonitor/SendDeviceResetResponse")] + System.IAsyncResult BeginSendDeviceReset(int deviceIndex, int ResetOrder, System.AsyncCallback callback, object asyncState); - string[] EndGetLanguageFields(out string errorText, System.IAsyncResult result); + bool EndSendDeviceReset(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetLanguageContent", ReplyAction="http://tempuri.org/IControlMonitor/GetLanguageContentResponse")] - wcfControlMonitorClient.WcfControlMonitor.LanguageContent[] GetLanguageContent(out string errorText, string language); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/Heartbeat", ReplyAction="http://tempuri.org/IControlMonitor/HeartbeatResponse")] + bool Heartbeat(out Model.MonitorInfo monitorinfo); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetLanguageContent", ReplyAction="http://tempuri.org/IControlMonitor/GetLanguageContentResponse")] - System.IAsyncResult BeginGetLanguageContent(string language, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/Heartbeat", ReplyAction="http://tempuri.org/IControlMonitor/HeartbeatResponse")] + System.IAsyncResult BeginHeartbeat(System.AsyncCallback callback, object asyncState); - wcfControlMonitorClient.WcfControlMonitor.LanguageContent[] EndGetLanguageContent(out string errorText, System.IAsyncResult result); + bool EndHeartbeat(out Model.MonitorInfo monitorinfo, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetDevicesDic", ReplyAction="http://tempuri.org/IControlMonitor/GetDevicesDicResponse")] - wcfControlMonitorClient.WcfControlMonitor.DevicesDic GetDevicesDic(out string errorText); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetDataView", ReplyAction="http://tempuri.org/IControlMonitor/GetDataViewResponse")] + System.Data.DataTable GetDataView(out string errtext, string SQL); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetDevicesDic", ReplyAction="http://tempuri.org/IControlMonitor/GetDevicesDicResponse")] - System.IAsyncResult BeginGetDevicesDic(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetDataView", ReplyAction="http://tempuri.org/IControlMonitor/GetDataViewResponse")] + System.IAsyncResult BeginGetDataView(string SQL, System.AsyncCallback callback, object asyncState); - wcfControlMonitorClient.WcfControlMonitor.DevicesDic EndGetDevicesDic(out string errorText, System.IAsyncResult result); + System.Data.DataTable EndGetDataView(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/RefreshMonitoringMode", ReplyAction="http://tempuri.org/IControlMonitor/RefreshMonitoringModeResponse")] - bool RefreshMonitoringMode(); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/ExeSQLNoneQuery", ReplyAction="http://tempuri.org/IControlMonitor/ExeSQLNoneQueryResponse")] + int ExeSQLNoneQuery(out string errtext, string SQL); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/RefreshMonitoringMode", ReplyAction="http://tempuri.org/IControlMonitor/RefreshMonitoringModeResponse")] - System.IAsyncResult BeginRefreshMonitoringMode(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/ExeSQLNoneQuery", ReplyAction="http://tempuri.org/IControlMonitor/ExeSQLNoneQueryResponse")] + System.IAsyncResult BeginExeSQLNoneQuery(string SQL, System.AsyncCallback callback, object asyncState); - bool EndRefreshMonitoringMode(System.IAsyncResult result); + int EndExeSQLNoneQuery(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/RegisterClient", ReplyAction="http://tempuri.org/IControlMonitor/RegisterClientResponse")] - bool RegisterClient(out string errText, string userID, string userDescription); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetManDataView", ReplyAction="http://tempuri.org/IControlMonitor/GetManDataViewResponse")] + System.Data.DataTable GetManDataView(out string errtext, string SQL); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/RegisterClient", ReplyAction="http://tempuri.org/IControlMonitor/RegisterClientResponse")] - System.IAsyncResult BeginRegisterClient(string userID, string userDescription, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetManDataView", ReplyAction="http://tempuri.org/IControlMonitor/GetManDataViewResponse")] + System.IAsyncResult BeginGetManDataView(string SQL, System.AsyncCallback callback, object asyncState); - bool EndRegisterClient(out string errText, System.IAsyncResult result); + System.Data.DataTable EndGetManDataView(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/LogoutClient", ReplyAction="http://tempuri.org/IControlMonitor/LogoutClientResponse")] - bool LogoutClient(out string errText, string userID); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/ExeManSQLNoneQuery", ReplyAction="http://tempuri.org/IControlMonitor/ExeManSQLNoneQueryResponse")] + int ExeManSQLNoneQuery(out string errtext, string SQL); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/LogoutClient", ReplyAction="http://tempuri.org/IControlMonitor/LogoutClientResponse")] - System.IAsyncResult BeginLogoutClient(string userID, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/ExeManSQLNoneQuery", ReplyAction="http://tempuri.org/IControlMonitor/ExeManSQLNoneQueryResponse")] + System.IAsyncResult BeginExeManSQLNoneQuery(string SQL, System.AsyncCallback callback, object asyncState); - bool EndLogoutClient(out string errText, System.IAsyncResult result); + int EndExeManSQLNoneQuery(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/ObtainTask", ReplyAction="http://tempuri.org/IControlMonitor/ObtainTaskResponse")] - bool ObtainTask(string laneway, string Order); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetAllManageTask", ReplyAction="http://tempuri.org/IControlMonitor/GetAllManageTaskResponse")] + bool GetAllManageTask(out string errtext); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/ObtainTask", ReplyAction="http://tempuri.org/IControlMonitor/ObtainTaskResponse")] - System.IAsyncResult BeginObtainTask(string laneway, string Order, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetAllManageTask", ReplyAction="http://tempuri.org/IControlMonitor/GetAllManageTaskResponse")] + System.IAsyncResult BeginGetAllManageTask(System.AsyncCallback callback, object asyncState); - bool EndObtainTask(System.IAsyncResult result); + bool EndGetAllManageTask(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/StopObtainTask", ReplyAction="http://tempuri.org/IControlMonitor/StopObtainTaskResponse")] - bool StopObtainTask(); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/DisassembleTask", ReplyAction="http://tempuri.org/IControlMonitor/DisassembleTaskResponse")] + bool DisassembleTask(out string errtext); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/StopObtainTask", ReplyAction="http://tempuri.org/IControlMonitor/StopObtainTaskResponse")] - System.IAsyncResult BeginStopObtainTask(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/DisassembleTask", ReplyAction="http://tempuri.org/IControlMonitor/DisassembleTaskResponse")] + System.IAsyncResult BeginDisassembleTask(System.AsyncCallback callback, object asyncState); - bool EndStopObtainTask(System.IAsyncResult result); + bool EndDisassembleTask(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/OrderTurnOn", ReplyAction="http://tempuri.org/IControlMonitor/OrderTurnOnResponse")] - bool OrderTurnOn(); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/SetLogicHaveGoods", ReplyAction="http://tempuri.org/IControlMonitor/SetLogicHaveGoodsResponse")] + bool SetLogicHaveGoods(out string errtext, bool ifHaveGoods, int deviceindex); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/OrderTurnOn", ReplyAction="http://tempuri.org/IControlMonitor/OrderTurnOnResponse")] - System.IAsyncResult BeginOrderTurnOn(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/SetLogicHaveGoods", ReplyAction="http://tempuri.org/IControlMonitor/SetLogicHaveGoodsResponse")] + System.IAsyncResult BeginSetLogicHaveGoods(bool ifHaveGoods, int deviceindex, System.AsyncCallback callback, object asyncState); - bool EndOrderTurnOn(System.IAsyncResult result); + bool EndSetLogicHaveGoods(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/OrderTurnOff", ReplyAction="http://tempuri.org/IControlMonitor/OrderTurnOffResponse")] - bool OrderTurnOff(); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/DealWithDeviceState", ReplyAction="http://tempuri.org/IControlMonitor/DealWithDeviceStateResponse")] + bool DealWithDeviceState(out string errtext, int deviceindex, byte[] splitbyteValue, byte[] devicestates); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/OrderTurnOff", ReplyAction="http://tempuri.org/IControlMonitor/OrderTurnOffResponse")] - System.IAsyncResult BeginOrderTurnOff(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/DealWithDeviceState", ReplyAction="http://tempuri.org/IControlMonitor/DealWithDeviceStateResponse")] + System.IAsyncResult BeginDealWithDeviceState(int deviceindex, byte[] splitbyteValue, byte[] devicestates, System.AsyncCallback callback, object asyncState); - bool EndOrderTurnOff(System.IAsyncResult result); + bool EndDealWithDeviceState(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/DeviceCommunicationInit", ReplyAction="http://tempuri.org/IControlMonitor/DeviceCommunicationInitResponse")] - bool DeviceCommunicationInit(out string ErrText, string CommunicationType); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/SendAllDeviceStates", ReplyAction="http://tempuri.org/IControlMonitor/SendAllDeviceStatesResponse")] + Model.MDevice SendAllDeviceStates(int device); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/DeviceCommunicationInit", ReplyAction="http://tempuri.org/IControlMonitor/DeviceCommunicationInitResponse")] - System.IAsyncResult BeginDeviceCommunicationInit(string CommunicationType, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/SendAllDeviceStates", ReplyAction="http://tempuri.org/IControlMonitor/SendAllDeviceStatesResponse")] + System.IAsyncResult BeginSendAllDeviceStates(int device, System.AsyncCallback callback, object asyncState); - bool EndDeviceCommunicationInit(out string ErrText, System.IAsyncResult result); + Model.MDevice EndSendAllDeviceStates(System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/GetUsers", ReplyAction="http://tempuri.org/IControlMonitor/GetUsersResponse")] - System.Data.DataTable GetUsers(out string Errtext); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/WriteDBData", ReplyAction="http://tempuri.org/IControlMonitor/WriteDBDataResponse")] + bool WriteDBData(out string errtext, int deviceIndex, string DBBlock, string Wdata); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/GetUsers", ReplyAction="http://tempuri.org/IControlMonitor/GetUsersResponse")] - System.IAsyncResult BeginGetUsers(System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/WriteDBData", ReplyAction="http://tempuri.org/IControlMonitor/WriteDBDataResponse")] + System.IAsyncResult BeginWriteDBData(int deviceIndex, string DBBlock, string Wdata, System.AsyncCallback callback, object asyncState); - System.Data.DataTable EndGetUsers(out string Errtext, System.IAsyncResult result); + bool EndWriteDBData(out string errtext, System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/BuildHandTask", ReplyAction="http://tempuri.org/IControlMonitor/BuildHandTaskResponse")] - bool BuildHandTask(out string Errtext, Model.HandTask Handtask); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/ReConnectOPCServer", ReplyAction="http://tempuri.org/IControlMonitor/ReConnectOPCServerResponse")] + bool ReConnectOPCServer(); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/BuildHandTask", ReplyAction="http://tempuri.org/IControlMonitor/BuildHandTaskResponse")] - System.IAsyncResult BeginBuildHandTask(Model.HandTask Handtask, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/ReConnectOPCServer", ReplyAction="http://tempuri.org/IControlMonitor/ReConnectOPCServerResponse")] + System.IAsyncResult BeginReConnectOPCServer(System.AsyncCallback callback, object asyncState); - bool EndBuildHandTask(out string Errtext, System.IAsyncResult result); + bool EndReConnectOPCServer(System.IAsyncResult result); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/BuildHandAssociateTask", ReplyAction="http://tempuri.org/IControlMonitor/BuildHandAssociateTaskResponse")] - bool BuildHandAssociateTask(out string Errtext, int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IControlMonitor/ActionError", ReplyAction="http://tempuri.org/IControlMonitor/ActionErrorResponse")] + void ActionError(int DeviceIdx, int TaskIdx, int ErrId); - [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/BuildHandAssociateTask", ReplyAction="http://tempuri.org/IControlMonitor/BuildHandAssociateTaskResponse")] - System.IAsyncResult BeginBuildHandAssociateTask(int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName, System.AsyncCallback callback, object asyncState); + [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IControlMonitor/ActionError", ReplyAction="http://tempuri.org/IControlMonitor/ActionErrorResponse")] + System.IAsyncResult BeginActionError(int DeviceIdx, int TaskIdx, int ErrId, System.AsyncCallback callback, object asyncState); - bool EndBuildHandAssociateTask(out string Errtext, System.IAsyncResult result); + void EndActionError(System.IAsyncResult result); } [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] @@ -1533,198 +1541,212 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class ShutDownControlSystemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetReadedAndReportedBarcodeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public ShutDownControlSystemCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetReadedAndReportedBarcodeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string ErrText { + public string readedBarcode { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } + public string reportedBarcode { + get { + base.RaiseExceptionIfNecessary(); + return ((string)(this.results[1])); + } + } + + public string errorText { + get { + base.RaiseExceptionIfNecessary(); + return ((string)(this.results[2])); + } + } + public bool Result { get { base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[1])); + return ((bool)(this.results[3])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class StartGetALLDeviceStateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetDeviceAllErrorsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public StartGetALLDeviceStateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetDeviceAllErrorsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string Errtext { + public string errorText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public bool Result { + public Model.MError Result { get { base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[1])); + return ((Model.MError)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class StartSendDeviceOrderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetAllRouteinfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public StartSendDeviceOrderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetAllRouteinfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string Errtext { + public string errorText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public bool Result { + public Model.MRoute[] Result { get { base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[1])); + return ((Model.MRoute[])(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class DataClearCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetDeviceJoinRouteinfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public DataClearCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetDeviceJoinRouteinfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string Errtext { + public string errorText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public bool Result { + public Model.MRoute[] Result { get { base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[1])); + return ((Model.MRoute[])(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetManageTaskKindFromMonitorCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetManageTasksCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetManageTaskKindFromMonitorCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetManageTasksCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public string errorText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public int Result { + public wcfControlMonitorClient.WcfControlMonitor.ManageTask[] Result { get { base.RaiseExceptionIfNecessary(); - return ((int)(this.results[1])); + return ((wcfControlMonitorClient.WcfControlMonitor.ManageTask[])(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetManageTaskIndexFromMonitorCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetMonitorTasksCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetManageTaskIndexFromMonitorCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetMonitorTasksCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public string errorText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public int Result { + public wcfControlMonitorClient.WcfControlMonitor.MonitorTask[] Result { get { base.RaiseExceptionIfNecessary(); - return ((int)(this.results[1])); + return ((wcfControlMonitorClient.WcfControlMonitor.MonitorTask[])(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetDeviceKindIndexCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetDeviceStateInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetDeviceKindIndexCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetDeviceStateInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public string errorText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public int Result { + public wcfControlMonitorClient.WcfControlMonitor.DeviceStateType Result { get { base.RaiseExceptionIfNecessary(); - return ((int)(this.results[1])); + return ((wcfControlMonitorClient.WcfControlMonitor.DeviceStateType)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class SendDeviceResetCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class SetDeviceStateInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public SendDeviceResetCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public SetDeviceStateInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public string errorText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); @@ -1741,19 +1763,19 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class HeartbeatCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class SetRouteStateInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public HeartbeatCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public SetRouteStateInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public Model.MonitorInfo monitorinfo { + public string errorText { get { base.RaiseExceptionIfNecessary(); - return ((Model.MonitorInfo)(this.results[0])); + return ((string)(this.results[0])); } } @@ -1767,146 +1789,165 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetDataViewCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class SetDeviceJoinRouteStateInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetDataViewCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public SetDeviceJoinRouteStateInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public string errorText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public System.Data.DataTable Result { + public bool Result { get { base.RaiseExceptionIfNecessary(); - return ((System.Data.DataTable)(this.results[1])); + return ((bool)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class ExeSQLNoneQueryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetAllCellInfosCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public ExeSQLNoneQueryCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetAllCellInfosCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public string errorText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public int Result { + public wcfControlMonitorClient.WcfControlMonitor.ST_Cell[] Result { get { base.RaiseExceptionIfNecessary(); - return ((int)(this.results[1])); + return ((wcfControlMonitorClient.WcfControlMonitor.ST_Cell[])(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetManDataViewCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetLanguageFieldsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetManDataViewCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetLanguageFieldsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public string errorText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public System.Data.DataTable Result { + public string[] Result { get { base.RaiseExceptionIfNecessary(); - return ((System.Data.DataTable)(this.results[1])); + return ((string[])(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class ExeManSQLNoneQueryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetLanguageContentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public ExeManSQLNoneQueryCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetLanguageContentCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public string errorText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public int Result { + public wcfControlMonitorClient.WcfControlMonitor.LanguageContent[] Result { get { base.RaiseExceptionIfNecessary(); - return ((int)(this.results[1])); + return ((wcfControlMonitorClient.WcfControlMonitor.LanguageContent[])(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetAllManageTaskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetDevicesDicCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetAllManageTaskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetDevicesDicCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public string errorText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } + public wcfControlMonitorClient.WcfControlMonitor.DevicesDic Result { + get { + base.RaiseExceptionIfNecessary(); + return ((wcfControlMonitorClient.WcfControlMonitor.DevicesDic)(this.results[1])); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class RefreshMonitoringModeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + public RefreshMonitoringModeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + public bool Result { get { base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[1])); + return ((bool)(this.results[0])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class DisassembleTaskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class RegisterClientCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public DisassembleTaskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public RegisterClientCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public string errText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); @@ -1923,16 +1964,16 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class SetLogicHaveGoodsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class LogoutClientCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public SetLogicHaveGoodsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public LogoutClientCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public string errText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); @@ -1949,16 +1990,92 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class DealWithDeviceStateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class ObtainTaskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public DealWithDeviceStateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public ObtainTaskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public bool Result { + get { + base.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class StopObtainTaskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + public StopObtainTaskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + public bool Result { + get { + base.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class OrderTurnOnCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + public OrderTurnOnCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + public bool Result { + get { + base.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class OrderTurnOffCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + public OrderTurnOffCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + public bool Result { + get { + base.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class DeviceCommunicationInitCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + public DeviceCommunicationInitCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + public string ErrText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); @@ -1975,35 +2092,42 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class SendAllDeviceStatesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetUsersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public SendAllDeviceStatesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetUsersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public Model.MDevice Result { + public string Errtext { get { base.RaiseExceptionIfNecessary(); - return ((Model.MDevice)(this.results[0])); + return ((string)(this.results[0])); + } + } + + public System.Data.DataTable Result { + get { + base.RaiseExceptionIfNecessary(); + return ((System.Data.DataTable)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class WriteDBDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class BuildHandTaskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public WriteDBDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public BuildHandTaskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errtext { + public string Errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); @@ -2020,19 +2144,26 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class ReConnectOPCServerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class BuildHandAssociateTaskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public ReConnectOPCServerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public BuildHandAssociateTaskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } + public string Errtext { + get { + base.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + public bool Result { get { base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[0])); + return ((bool)(this.results[1])); } } } @@ -2738,212 +2869,198 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetReadedAndReportedBarcodeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class ShutDownControlSystemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetReadedAndReportedBarcodeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public ShutDownControlSystemCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string readedBarcode { + public string ErrText { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public string reportedBarcode { - get { - base.RaiseExceptionIfNecessary(); - return ((string)(this.results[1])); - } - } - - public string errorText { - get { - base.RaiseExceptionIfNecessary(); - return ((string)(this.results[2])); - } - } - public bool Result { get { base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[3])); + return ((bool)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetDeviceAllErrorsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class StartGetALLDeviceStateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetDeviceAllErrorsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public StartGetALLDeviceStateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public string Errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public Model.MError Result { + public bool Result { get { base.RaiseExceptionIfNecessary(); - return ((Model.MError)(this.results[1])); + return ((bool)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetAllRouteinfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class StartSendDeviceOrderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetAllRouteinfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public StartSendDeviceOrderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public string Errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public Model.MRoute[] Result { + public bool Result { get { base.RaiseExceptionIfNecessary(); - return ((Model.MRoute[])(this.results[1])); + return ((bool)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetDeviceJoinRouteinfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class DataClearCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetDeviceJoinRouteinfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public DataClearCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public string Errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public Model.MRoute[] Result { + public bool Result { get { base.RaiseExceptionIfNecessary(); - return ((Model.MRoute[])(this.results[1])); + return ((bool)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetManageTasksCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetManageTaskKindFromMonitorCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetManageTasksCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetManageTaskKindFromMonitorCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public string errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public wcfControlMonitorClient.WcfControlMonitor.ManageTask[] Result { + public int Result { get { base.RaiseExceptionIfNecessary(); - return ((wcfControlMonitorClient.WcfControlMonitor.ManageTask[])(this.results[1])); + return ((int)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetMonitorTasksCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetManageTaskIndexFromMonitorCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetMonitorTasksCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetManageTaskIndexFromMonitorCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public string errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public wcfControlMonitorClient.WcfControlMonitor.MonitorTask[] Result { + public long Result { get { base.RaiseExceptionIfNecessary(); - return ((wcfControlMonitorClient.WcfControlMonitor.MonitorTask[])(this.results[1])); + return ((long)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetDeviceStateInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetDeviceKindIndexCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetDeviceStateInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetDeviceKindIndexCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public string errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public wcfControlMonitorClient.WcfControlMonitor.DeviceStateType Result { + public int Result { get { base.RaiseExceptionIfNecessary(); - return ((wcfControlMonitorClient.WcfControlMonitor.DeviceStateType)(this.results[1])); + return ((int)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class SetDeviceStateInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class SendDeviceResetCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public SetDeviceStateInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public SendDeviceResetCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public string errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); @@ -2960,19 +3077,19 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class SetRouteStateInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class HeartbeatCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public SetRouteStateInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public HeartbeatCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public Model.MonitorInfo monitorinfo { get { base.RaiseExceptionIfNecessary(); - return ((string)(this.results[0])); + return ((Model.MonitorInfo)(this.results[0])); } } @@ -2986,165 +3103,146 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class SetDeviceJoinRouteStateInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetDataViewCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public SetDeviceJoinRouteStateInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetDataViewCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public string errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public bool Result { + public System.Data.DataTable Result { get { base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[1])); + return ((System.Data.DataTable)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetAllCellInfosCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class ExeSQLNoneQueryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetAllCellInfosCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public ExeSQLNoneQueryCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public string errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public wcfControlMonitorClient.WcfControlMonitor.ST_Cell[] Result { + public int Result { get { base.RaiseExceptionIfNecessary(); - return ((wcfControlMonitorClient.WcfControlMonitor.ST_Cell[])(this.results[1])); + return ((int)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetLanguageFieldsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetManDataViewCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetLanguageFieldsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetManDataViewCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public string errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public string[] Result { + public System.Data.DataTable Result { get { base.RaiseExceptionIfNecessary(); - return ((string[])(this.results[1])); + return ((System.Data.DataTable)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetLanguageContentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class ExeManSQLNoneQueryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetLanguageContentCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public ExeManSQLNoneQueryCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public string errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public wcfControlMonitorClient.WcfControlMonitor.LanguageContent[] Result { + public int Result { get { base.RaiseExceptionIfNecessary(); - return ((wcfControlMonitorClient.WcfControlMonitor.LanguageContent[])(this.results[1])); + return ((int)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetDevicesDicCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetAllManageTaskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetDevicesDicCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public GetAllManageTaskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errorText { + public string errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } - public wcfControlMonitorClient.WcfControlMonitor.DevicesDic Result { - get { - base.RaiseExceptionIfNecessary(); - return ((wcfControlMonitorClient.WcfControlMonitor.DevicesDic)(this.results[1])); - } - } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class RefreshMonitoringModeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - public RefreshMonitoringModeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - public bool Result { get { base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[0])); + return ((bool)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class RegisterClientCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class DisassembleTaskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public RegisterClientCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public DisassembleTaskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errText { + public string errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); @@ -3161,16 +3259,16 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class LogoutClientCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class SetLogicHaveGoodsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public LogoutClientCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public SetLogicHaveGoodsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string errText { + public string errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); @@ -3187,92 +3285,61 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class ObtainTaskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - public ObtainTaskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - public bool Result { - get { - base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[0])); - } - } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class StopObtainTaskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class DealWithDeviceStateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public StopObtainTaskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public DealWithDeviceStateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public bool Result { + public string errtext { get { base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[0])); + return ((string)(this.results[0])); } } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class OrderTurnOnCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - public OrderTurnOnCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } public bool Result { get { base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[0])); + return ((bool)(this.results[1])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class OrderTurnOffCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class SendAllDeviceStatesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public OrderTurnOffCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public SendAllDeviceStatesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public bool Result { + public Model.MDevice Result { get { base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[0])); + return ((Model.MDevice)(this.results[0])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class DeviceCommunicationInitCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class WriteDBDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public DeviceCommunicationInitCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public WriteDBDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string ErrText { + public string errtext { get { base.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); @@ -3289,205 +3356,176 @@ namespace wcfControlMonitorClient.WcfControlMonitor { [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class GetUsersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class ReConnectOPCServerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - public GetUsersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + public ReConnectOPCServerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - public string Errtext { - get { - base.RaiseExceptionIfNecessary(); - return ((string)(this.results[0])); - } - } - - public System.Data.DataTable Result { + public bool Result { get { base.RaiseExceptionIfNecessary(); - return ((System.Data.DataTable)(this.results[1])); + return ((bool)(this.results[0])); } } } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class BuildHandTaskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class ControlMonitorClient : System.ServiceModel.DuplexClientBase, wcfControlMonitorClient.WcfControlMonitor.IControlMonitor { - private object[] results; + private BeginOperationDelegate onBeginGetReadedAndReportedBarcodeDelegate; - public BuildHandTaskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } + private EndOperationDelegate onEndGetReadedAndReportedBarcodeDelegate; - public string Errtext { - get { - base.RaiseExceptionIfNecessary(); - return ((string)(this.results[0])); - } - } + private System.Threading.SendOrPostCallback onGetReadedAndReportedBarcodeCompletedDelegate; - public bool Result { - get { - base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[1])); - } - } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class BuildHandAssociateTaskCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private BeginOperationDelegate onBeginGetDeviceAllErrorsDelegate; - private object[] results; + private EndOperationDelegate onEndGetDeviceAllErrorsDelegate; - public BuildHandAssociateTaskCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } + private System.Threading.SendOrPostCallback onGetDeviceAllErrorsCompletedDelegate; - public string Errtext { - get { - base.RaiseExceptionIfNecessary(); - return ((string)(this.results[0])); - } - } + private BeginOperationDelegate onBeginGetAllRouteinfoDelegate; - public bool Result { - get { - base.RaiseExceptionIfNecessary(); - return ((bool)(this.results[1])); - } - } - } - - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] - public partial class ControlMonitorClient : System.ServiceModel.DuplexClientBase, wcfControlMonitorClient.WcfControlMonitor.IControlMonitor { + private EndOperationDelegate onEndGetAllRouteinfoDelegate; - private BeginOperationDelegate onBeginShutDownControlSystemDelegate; + private System.Threading.SendOrPostCallback onGetAllRouteinfoCompletedDelegate; - private EndOperationDelegate onEndShutDownControlSystemDelegate; + private BeginOperationDelegate onBeginGetDeviceJoinRouteinfoDelegate; - private System.Threading.SendOrPostCallback onShutDownControlSystemCompletedDelegate; + private EndOperationDelegate onEndGetDeviceJoinRouteinfoDelegate; - private BeginOperationDelegate onBeginStartGetALLDeviceStateDelegate; + private System.Threading.SendOrPostCallback onGetDeviceJoinRouteinfoCompletedDelegate; - private EndOperationDelegate onEndStartGetALLDeviceStateDelegate; + private BeginOperationDelegate onBeginGetManageTasksDelegate; - private System.Threading.SendOrPostCallback onStartGetALLDeviceStateCompletedDelegate; + private EndOperationDelegate onEndGetManageTasksDelegate; - private BeginOperationDelegate onBeginStartSendDeviceOrderDelegate; + private System.Threading.SendOrPostCallback onGetManageTasksCompletedDelegate; - private EndOperationDelegate onEndStartSendDeviceOrderDelegate; + private BeginOperationDelegate onBeginGetMonitorTasksDelegate; - private System.Threading.SendOrPostCallback onStartSendDeviceOrderCompletedDelegate; + private EndOperationDelegate onEndGetMonitorTasksDelegate; - private BeginOperationDelegate onBeginDataClearDelegate; + private System.Threading.SendOrPostCallback onGetMonitorTasksCompletedDelegate; - private EndOperationDelegate onEndDataClearDelegate; + private BeginOperationDelegate onBeginGetDeviceStateInfoDelegate; - private System.Threading.SendOrPostCallback onDataClearCompletedDelegate; + private EndOperationDelegate onEndGetDeviceStateInfoDelegate; - private BeginOperationDelegate onBeginGetManageTaskKindFromMonitorDelegate; + private System.Threading.SendOrPostCallback onGetDeviceStateInfoCompletedDelegate; - private EndOperationDelegate onEndGetManageTaskKindFromMonitorDelegate; + private BeginOperationDelegate onBeginSetDeviceStateInfoDelegate; - private System.Threading.SendOrPostCallback onGetManageTaskKindFromMonitorCompletedDelegate; + private EndOperationDelegate onEndSetDeviceStateInfoDelegate; - private BeginOperationDelegate onBeginGetManageTaskIndexFromMonitorDelegate; + private System.Threading.SendOrPostCallback onSetDeviceStateInfoCompletedDelegate; - private EndOperationDelegate onEndGetManageTaskIndexFromMonitorDelegate; + private BeginOperationDelegate onBeginSetRouteStateInfoDelegate; - private System.Threading.SendOrPostCallback onGetManageTaskIndexFromMonitorCompletedDelegate; + private EndOperationDelegate onEndSetRouteStateInfoDelegate; - private BeginOperationDelegate onBeginGetDeviceKindIndexDelegate; + private System.Threading.SendOrPostCallback onSetRouteStateInfoCompletedDelegate; - private EndOperationDelegate onEndGetDeviceKindIndexDelegate; + private BeginOperationDelegate onBeginSetDeviceJoinRouteStateInfoDelegate; - private System.Threading.SendOrPostCallback onGetDeviceKindIndexCompletedDelegate; + private EndOperationDelegate onEndSetDeviceJoinRouteStateInfoDelegate; - private BeginOperationDelegate onBeginSendDeviceResetDelegate; + private System.Threading.SendOrPostCallback onSetDeviceJoinRouteStateInfoCompletedDelegate; - private EndOperationDelegate onEndSendDeviceResetDelegate; + private BeginOperationDelegate onBeginGetAllCellInfosDelegate; - private System.Threading.SendOrPostCallback onSendDeviceResetCompletedDelegate; + private EndOperationDelegate onEndGetAllCellInfosDelegate; - private BeginOperationDelegate onBeginHeartbeatDelegate; + private System.Threading.SendOrPostCallback onGetAllCellInfosCompletedDelegate; - private EndOperationDelegate onEndHeartbeatDelegate; + private BeginOperationDelegate onBeginGetLanguageFieldsDelegate; - private System.Threading.SendOrPostCallback onHeartbeatCompletedDelegate; + private EndOperationDelegate onEndGetLanguageFieldsDelegate; - private BeginOperationDelegate onBeginGetDataViewDelegate; + private System.Threading.SendOrPostCallback onGetLanguageFieldsCompletedDelegate; - private EndOperationDelegate onEndGetDataViewDelegate; + private BeginOperationDelegate onBeginGetLanguageContentDelegate; - private System.Threading.SendOrPostCallback onGetDataViewCompletedDelegate; + private EndOperationDelegate onEndGetLanguageContentDelegate; - private BeginOperationDelegate onBeginExeSQLNoneQueryDelegate; + private System.Threading.SendOrPostCallback onGetLanguageContentCompletedDelegate; - private EndOperationDelegate onEndExeSQLNoneQueryDelegate; + private BeginOperationDelegate onBeginGetDevicesDicDelegate; - private System.Threading.SendOrPostCallback onExeSQLNoneQueryCompletedDelegate; + private EndOperationDelegate onEndGetDevicesDicDelegate; - private BeginOperationDelegate onBeginGetManDataViewDelegate; + private System.Threading.SendOrPostCallback onGetDevicesDicCompletedDelegate; - private EndOperationDelegate onEndGetManDataViewDelegate; + private BeginOperationDelegate onBeginRefreshMonitoringModeDelegate; - private System.Threading.SendOrPostCallback onGetManDataViewCompletedDelegate; + private EndOperationDelegate onEndRefreshMonitoringModeDelegate; - private BeginOperationDelegate onBeginExeManSQLNoneQueryDelegate; + private System.Threading.SendOrPostCallback onRefreshMonitoringModeCompletedDelegate; - private EndOperationDelegate onEndExeManSQLNoneQueryDelegate; + private BeginOperationDelegate onBeginRegisterClientDelegate; - private System.Threading.SendOrPostCallback onExeManSQLNoneQueryCompletedDelegate; + private EndOperationDelegate onEndRegisterClientDelegate; - private BeginOperationDelegate onBeginGetAllManageTaskDelegate; + private System.Threading.SendOrPostCallback onRegisterClientCompletedDelegate; - private EndOperationDelegate onEndGetAllManageTaskDelegate; + private BeginOperationDelegate onBeginLogoutClientDelegate; - private System.Threading.SendOrPostCallback onGetAllManageTaskCompletedDelegate; + private EndOperationDelegate onEndLogoutClientDelegate; - private BeginOperationDelegate onBeginDisassembleTaskDelegate; + private System.Threading.SendOrPostCallback onLogoutClientCompletedDelegate; - private EndOperationDelegate onEndDisassembleTaskDelegate; + private BeginOperationDelegate onBeginObtainTaskDelegate; - private System.Threading.SendOrPostCallback onDisassembleTaskCompletedDelegate; + private EndOperationDelegate onEndObtainTaskDelegate; - private BeginOperationDelegate onBeginSetLogicHaveGoodsDelegate; + private System.Threading.SendOrPostCallback onObtainTaskCompletedDelegate; - private EndOperationDelegate onEndSetLogicHaveGoodsDelegate; + private BeginOperationDelegate onBeginStopObtainTaskDelegate; - private System.Threading.SendOrPostCallback onSetLogicHaveGoodsCompletedDelegate; + private EndOperationDelegate onEndStopObtainTaskDelegate; - private BeginOperationDelegate onBeginDealWithDeviceStateDelegate; + private System.Threading.SendOrPostCallback onStopObtainTaskCompletedDelegate; - private EndOperationDelegate onEndDealWithDeviceStateDelegate; + private BeginOperationDelegate onBeginOrderTurnOnDelegate; - private System.Threading.SendOrPostCallback onDealWithDeviceStateCompletedDelegate; + private EndOperationDelegate onEndOrderTurnOnDelegate; - private BeginOperationDelegate onBeginSendAllDeviceStatesDelegate; + private System.Threading.SendOrPostCallback onOrderTurnOnCompletedDelegate; - private EndOperationDelegate onEndSendAllDeviceStatesDelegate; + private BeginOperationDelegate onBeginOrderTurnOffDelegate; - private System.Threading.SendOrPostCallback onSendAllDeviceStatesCompletedDelegate; + private EndOperationDelegate onEndOrderTurnOffDelegate; - private BeginOperationDelegate onBeginWriteDBDataDelegate; + private System.Threading.SendOrPostCallback onOrderTurnOffCompletedDelegate; - private EndOperationDelegate onEndWriteDBDataDelegate; + private BeginOperationDelegate onBeginDeviceCommunicationInitDelegate; - private System.Threading.SendOrPostCallback onWriteDBDataCompletedDelegate; + private EndOperationDelegate onEndDeviceCommunicationInitDelegate; - private BeginOperationDelegate onBeginReConnectOPCServerDelegate; + private System.Threading.SendOrPostCallback onDeviceCommunicationInitCompletedDelegate; - private EndOperationDelegate onEndReConnectOPCServerDelegate; + private BeginOperationDelegate onBeginGetUsersDelegate; - private System.Threading.SendOrPostCallback onReConnectOPCServerCompletedDelegate; + private EndOperationDelegate onEndGetUsersDelegate; + + private System.Threading.SendOrPostCallback onGetUsersCompletedDelegate; + + private BeginOperationDelegate onBeginBuildHandTaskDelegate; + + private EndOperationDelegate onEndBuildHandTaskDelegate; + + private System.Threading.SendOrPostCallback onBuildHandTaskCompletedDelegate; + + private BeginOperationDelegate onBeginBuildHandAssociateTaskDelegate; + + private EndOperationDelegate onEndBuildHandAssociateTaskDelegate; + + private System.Threading.SendOrPostCallback onBuildHandAssociateTaskCompletedDelegate; private BeginOperationDelegate onBeginBuildAutoTaskDelegate; @@ -3639,155 +3677,131 @@ namespace wcfControlMonitorClient.WcfControlMonitor { private System.Threading.SendOrPostCallback onGetUserPasswordCompletedDelegate; - private BeginOperationDelegate onBeginGetReadedAndReportedBarcodeDelegate; + private BeginOperationDelegate onBeginShutDownControlSystemDelegate; - private EndOperationDelegate onEndGetReadedAndReportedBarcodeDelegate; + private EndOperationDelegate onEndShutDownControlSystemDelegate; - private System.Threading.SendOrPostCallback onGetReadedAndReportedBarcodeCompletedDelegate; + private System.Threading.SendOrPostCallback onShutDownControlSystemCompletedDelegate; - private BeginOperationDelegate onBeginGetDeviceAllErrorsDelegate; + private BeginOperationDelegate onBeginStartGetALLDeviceStateDelegate; - private EndOperationDelegate onEndGetDeviceAllErrorsDelegate; + private EndOperationDelegate onEndStartGetALLDeviceStateDelegate; - private System.Threading.SendOrPostCallback onGetDeviceAllErrorsCompletedDelegate; + private System.Threading.SendOrPostCallback onStartGetALLDeviceStateCompletedDelegate; - private BeginOperationDelegate onBeginGetAllRouteinfoDelegate; + private BeginOperationDelegate onBeginStartSendDeviceOrderDelegate; - private EndOperationDelegate onEndGetAllRouteinfoDelegate; + private EndOperationDelegate onEndStartSendDeviceOrderDelegate; - private System.Threading.SendOrPostCallback onGetAllRouteinfoCompletedDelegate; + private System.Threading.SendOrPostCallback onStartSendDeviceOrderCompletedDelegate; - private BeginOperationDelegate onBeginGetDeviceJoinRouteinfoDelegate; + private BeginOperationDelegate onBeginDataClearDelegate; - private EndOperationDelegate onEndGetDeviceJoinRouteinfoDelegate; + private EndOperationDelegate onEndDataClearDelegate; - private System.Threading.SendOrPostCallback onGetDeviceJoinRouteinfoCompletedDelegate; + private System.Threading.SendOrPostCallback onDataClearCompletedDelegate; - private BeginOperationDelegate onBeginGetManageTasksDelegate; + private BeginOperationDelegate onBeginGetManageTaskKindFromMonitorDelegate; - private EndOperationDelegate onEndGetManageTasksDelegate; + private EndOperationDelegate onEndGetManageTaskKindFromMonitorDelegate; - private System.Threading.SendOrPostCallback onGetManageTasksCompletedDelegate; + private System.Threading.SendOrPostCallback onGetManageTaskKindFromMonitorCompletedDelegate; - private BeginOperationDelegate onBeginGetMonitorTasksDelegate; + private BeginOperationDelegate onBeginGetManageTaskIndexFromMonitorDelegate; - private EndOperationDelegate onEndGetMonitorTasksDelegate; + private EndOperationDelegate onEndGetManageTaskIndexFromMonitorDelegate; - private System.Threading.SendOrPostCallback onGetMonitorTasksCompletedDelegate; + private System.Threading.SendOrPostCallback onGetManageTaskIndexFromMonitorCompletedDelegate; - private BeginOperationDelegate onBeginGetDeviceStateInfoDelegate; + private BeginOperationDelegate onBeginGetDeviceKindIndexDelegate; - private EndOperationDelegate onEndGetDeviceStateInfoDelegate; + private EndOperationDelegate onEndGetDeviceKindIndexDelegate; - private System.Threading.SendOrPostCallback onGetDeviceStateInfoCompletedDelegate; + private System.Threading.SendOrPostCallback onGetDeviceKindIndexCompletedDelegate; - private BeginOperationDelegate onBeginSetDeviceStateInfoDelegate; + private BeginOperationDelegate onBeginSendDeviceResetDelegate; - private EndOperationDelegate onEndSetDeviceStateInfoDelegate; + private EndOperationDelegate onEndSendDeviceResetDelegate; - private System.Threading.SendOrPostCallback onSetDeviceStateInfoCompletedDelegate; + private System.Threading.SendOrPostCallback onSendDeviceResetCompletedDelegate; - private BeginOperationDelegate onBeginSetRouteStateInfoDelegate; + private BeginOperationDelegate onBeginHeartbeatDelegate; - private EndOperationDelegate onEndSetRouteStateInfoDelegate; + private EndOperationDelegate onEndHeartbeatDelegate; - private System.Threading.SendOrPostCallback onSetRouteStateInfoCompletedDelegate; + private System.Threading.SendOrPostCallback onHeartbeatCompletedDelegate; - private BeginOperationDelegate onBeginSetDeviceJoinRouteStateInfoDelegate; + private BeginOperationDelegate onBeginGetDataViewDelegate; - private EndOperationDelegate onEndSetDeviceJoinRouteStateInfoDelegate; + private EndOperationDelegate onEndGetDataViewDelegate; - private System.Threading.SendOrPostCallback onSetDeviceJoinRouteStateInfoCompletedDelegate; + private System.Threading.SendOrPostCallback onGetDataViewCompletedDelegate; - private BeginOperationDelegate onBeginGetAllCellInfosDelegate; + private BeginOperationDelegate onBeginExeSQLNoneQueryDelegate; - private EndOperationDelegate onEndGetAllCellInfosDelegate; + private EndOperationDelegate onEndExeSQLNoneQueryDelegate; - private System.Threading.SendOrPostCallback onGetAllCellInfosCompletedDelegate; + private System.Threading.SendOrPostCallback onExeSQLNoneQueryCompletedDelegate; - private BeginOperationDelegate onBeginGetLanguageFieldsDelegate; + private BeginOperationDelegate onBeginGetManDataViewDelegate; - private EndOperationDelegate onEndGetLanguageFieldsDelegate; + private EndOperationDelegate onEndGetManDataViewDelegate; - private System.Threading.SendOrPostCallback onGetLanguageFieldsCompletedDelegate; + private System.Threading.SendOrPostCallback onGetManDataViewCompletedDelegate; - private BeginOperationDelegate onBeginGetLanguageContentDelegate; + private BeginOperationDelegate onBeginExeManSQLNoneQueryDelegate; - private EndOperationDelegate onEndGetLanguageContentDelegate; + private EndOperationDelegate onEndExeManSQLNoneQueryDelegate; - private System.Threading.SendOrPostCallback onGetLanguageContentCompletedDelegate; + private System.Threading.SendOrPostCallback onExeManSQLNoneQueryCompletedDelegate; - private BeginOperationDelegate onBeginGetDevicesDicDelegate; + private BeginOperationDelegate onBeginGetAllManageTaskDelegate; - private EndOperationDelegate onEndGetDevicesDicDelegate; + private EndOperationDelegate onEndGetAllManageTaskDelegate; - private System.Threading.SendOrPostCallback onGetDevicesDicCompletedDelegate; - - private BeginOperationDelegate onBeginRefreshMonitoringModeDelegate; - - private EndOperationDelegate onEndRefreshMonitoringModeDelegate; - - private System.Threading.SendOrPostCallback onRefreshMonitoringModeCompletedDelegate; - - private BeginOperationDelegate onBeginRegisterClientDelegate; - - private EndOperationDelegate onEndRegisterClientDelegate; - - private System.Threading.SendOrPostCallback onRegisterClientCompletedDelegate; - - private BeginOperationDelegate onBeginLogoutClientDelegate; - - private EndOperationDelegate onEndLogoutClientDelegate; - - private System.Threading.SendOrPostCallback onLogoutClientCompletedDelegate; - - private BeginOperationDelegate onBeginObtainTaskDelegate; - - private EndOperationDelegate onEndObtainTaskDelegate; - - private System.Threading.SendOrPostCallback onObtainTaskCompletedDelegate; + private System.Threading.SendOrPostCallback onGetAllManageTaskCompletedDelegate; - private BeginOperationDelegate onBeginStopObtainTaskDelegate; + private BeginOperationDelegate onBeginDisassembleTaskDelegate; - private EndOperationDelegate onEndStopObtainTaskDelegate; + private EndOperationDelegate onEndDisassembleTaskDelegate; - private System.Threading.SendOrPostCallback onStopObtainTaskCompletedDelegate; + private System.Threading.SendOrPostCallback onDisassembleTaskCompletedDelegate; - private BeginOperationDelegate onBeginOrderTurnOnDelegate; + private BeginOperationDelegate onBeginSetLogicHaveGoodsDelegate; - private EndOperationDelegate onEndOrderTurnOnDelegate; + private EndOperationDelegate onEndSetLogicHaveGoodsDelegate; - private System.Threading.SendOrPostCallback onOrderTurnOnCompletedDelegate; + private System.Threading.SendOrPostCallback onSetLogicHaveGoodsCompletedDelegate; - private BeginOperationDelegate onBeginOrderTurnOffDelegate; + private BeginOperationDelegate onBeginDealWithDeviceStateDelegate; - private EndOperationDelegate onEndOrderTurnOffDelegate; + private EndOperationDelegate onEndDealWithDeviceStateDelegate; - private System.Threading.SendOrPostCallback onOrderTurnOffCompletedDelegate; + private System.Threading.SendOrPostCallback onDealWithDeviceStateCompletedDelegate; - private BeginOperationDelegate onBeginDeviceCommunicationInitDelegate; + private BeginOperationDelegate onBeginSendAllDeviceStatesDelegate; - private EndOperationDelegate onEndDeviceCommunicationInitDelegate; + private EndOperationDelegate onEndSendAllDeviceStatesDelegate; - private System.Threading.SendOrPostCallback onDeviceCommunicationInitCompletedDelegate; + private System.Threading.SendOrPostCallback onSendAllDeviceStatesCompletedDelegate; - private BeginOperationDelegate onBeginGetUsersDelegate; + private BeginOperationDelegate onBeginWriteDBDataDelegate; - private EndOperationDelegate onEndGetUsersDelegate; + private EndOperationDelegate onEndWriteDBDataDelegate; - private System.Threading.SendOrPostCallback onGetUsersCompletedDelegate; + private System.Threading.SendOrPostCallback onWriteDBDataCompletedDelegate; - private BeginOperationDelegate onBeginBuildHandTaskDelegate; + private BeginOperationDelegate onBeginReConnectOPCServerDelegate; - private EndOperationDelegate onEndBuildHandTaskDelegate; + private EndOperationDelegate onEndReConnectOPCServerDelegate; - private System.Threading.SendOrPostCallback onBuildHandTaskCompletedDelegate; + private System.Threading.SendOrPostCallback onReConnectOPCServerCompletedDelegate; - private BeginOperationDelegate onBeginBuildHandAssociateTaskDelegate; + private BeginOperationDelegate onBeginActionErrorDelegate; - private EndOperationDelegate onEndBuildHandAssociateTaskDelegate; + private EndOperationDelegate onEndActionErrorDelegate; - private System.Threading.SendOrPostCallback onBuildHandAssociateTaskCompletedDelegate; + private System.Threading.SendOrPostCallback onActionErrorCompletedDelegate; public ControlMonitorClient(System.ServiceModel.InstanceContext callbackInstance) : base(callbackInstance) { @@ -3809,45 +3823,55 @@ namespace wcfControlMonitorClient.WcfControlMonitor { base(callbackInstance, binding, remoteAddress) { } - public event System.EventHandler ShutDownControlSystemCompleted; + public event System.EventHandler GetReadedAndReportedBarcodeCompleted; - public event System.EventHandler StartGetALLDeviceStateCompleted; + public event System.EventHandler GetDeviceAllErrorsCompleted; - public event System.EventHandler StartSendDeviceOrderCompleted; + public event System.EventHandler GetAllRouteinfoCompleted; - public event System.EventHandler DataClearCompleted; + public event System.EventHandler GetDeviceJoinRouteinfoCompleted; - public event System.EventHandler GetManageTaskKindFromMonitorCompleted; + public event System.EventHandler GetManageTasksCompleted; - public event System.EventHandler GetManageTaskIndexFromMonitorCompleted; + public event System.EventHandler GetMonitorTasksCompleted; - public event System.EventHandler GetDeviceKindIndexCompleted; + public event System.EventHandler GetDeviceStateInfoCompleted; - public event System.EventHandler SendDeviceResetCompleted; + public event System.EventHandler SetDeviceStateInfoCompleted; - public event System.EventHandler HeartbeatCompleted; + public event System.EventHandler SetRouteStateInfoCompleted; - public event System.EventHandler GetDataViewCompleted; + public event System.EventHandler SetDeviceJoinRouteStateInfoCompleted; - public event System.EventHandler ExeSQLNoneQueryCompleted; + public event System.EventHandler GetAllCellInfosCompleted; - public event System.EventHandler GetManDataViewCompleted; + public event System.EventHandler GetLanguageFieldsCompleted; - public event System.EventHandler ExeManSQLNoneQueryCompleted; + public event System.EventHandler GetLanguageContentCompleted; - public event System.EventHandler GetAllManageTaskCompleted; + public event System.EventHandler GetDevicesDicCompleted; - public event System.EventHandler DisassembleTaskCompleted; + public event System.EventHandler RefreshMonitoringModeCompleted; - public event System.EventHandler SetLogicHaveGoodsCompleted; + public event System.EventHandler RegisterClientCompleted; - public event System.EventHandler DealWithDeviceStateCompleted; + public event System.EventHandler LogoutClientCompleted; - public event System.EventHandler SendAllDeviceStatesCompleted; + public event System.EventHandler ObtainTaskCompleted; - public event System.EventHandler WriteDBDataCompleted; + public event System.EventHandler StopObtainTaskCompleted; - public event System.EventHandler ReConnectOPCServerCompleted; + public event System.EventHandler OrderTurnOnCompleted; + + public event System.EventHandler OrderTurnOffCompleted; + + public event System.EventHandler DeviceCommunicationInitCompleted; + + public event System.EventHandler GetUsersCompleted; + + public event System.EventHandler BuildHandTaskCompleted; + + public event System.EventHandler BuildHandAssociateTaskCompleted; public event System.EventHandler BuildAutoTaskCompleted; @@ -3899,3732 +3923,3777 @@ namespace wcfControlMonitorClient.WcfControlMonitor { public event System.EventHandler GetUserPasswordCompleted; - public event System.EventHandler GetReadedAndReportedBarcodeCompleted; - - public event System.EventHandler GetDeviceAllErrorsCompleted; - - public event System.EventHandler GetAllRouteinfoCompleted; - - public event System.EventHandler GetDeviceJoinRouteinfoCompleted; - - public event System.EventHandler GetManageTasksCompleted; + public event System.EventHandler ShutDownControlSystemCompleted; - public event System.EventHandler GetMonitorTasksCompleted; + public event System.EventHandler StartGetALLDeviceStateCompleted; - public event System.EventHandler GetDeviceStateInfoCompleted; + public event System.EventHandler StartSendDeviceOrderCompleted; - public event System.EventHandler SetDeviceStateInfoCompleted; + public event System.EventHandler DataClearCompleted; - public event System.EventHandler SetRouteStateInfoCompleted; + public event System.EventHandler GetManageTaskKindFromMonitorCompleted; - public event System.EventHandler SetDeviceJoinRouteStateInfoCompleted; + public event System.EventHandler GetManageTaskIndexFromMonitorCompleted; - public event System.EventHandler GetAllCellInfosCompleted; + public event System.EventHandler GetDeviceKindIndexCompleted; - public event System.EventHandler GetLanguageFieldsCompleted; + public event System.EventHandler SendDeviceResetCompleted; - public event System.EventHandler GetLanguageContentCompleted; + public event System.EventHandler HeartbeatCompleted; - public event System.EventHandler GetDevicesDicCompleted; + public event System.EventHandler GetDataViewCompleted; - public event System.EventHandler RefreshMonitoringModeCompleted; + public event System.EventHandler ExeSQLNoneQueryCompleted; - public event System.EventHandler RegisterClientCompleted; + public event System.EventHandler GetManDataViewCompleted; - public event System.EventHandler LogoutClientCompleted; + public event System.EventHandler ExeManSQLNoneQueryCompleted; - public event System.EventHandler ObtainTaskCompleted; + public event System.EventHandler GetAllManageTaskCompleted; - public event System.EventHandler StopObtainTaskCompleted; + public event System.EventHandler DisassembleTaskCompleted; - public event System.EventHandler OrderTurnOnCompleted; + public event System.EventHandler SetLogicHaveGoodsCompleted; - public event System.EventHandler OrderTurnOffCompleted; + public event System.EventHandler DealWithDeviceStateCompleted; - public event System.EventHandler DeviceCommunicationInitCompleted; + public event System.EventHandler SendAllDeviceStatesCompleted; - public event System.EventHandler GetUsersCompleted; + public event System.EventHandler WriteDBDataCompleted; - public event System.EventHandler BuildHandTaskCompleted; + public event System.EventHandler ReConnectOPCServerCompleted; - public event System.EventHandler BuildHandAssociateTaskCompleted; + public event System.EventHandler ActionErrorCompleted; - public bool ShutDownControlSystem(out string ErrText) { - return base.Channel.ShutDownControlSystem(out ErrText); + public bool GetReadedAndReportedBarcode(out string readedBarcode, out string reportedBarcode, out string errorText, int bindDeviceOfBarcode) { + return base.Channel.GetReadedAndReportedBarcode(out readedBarcode, out reportedBarcode, out errorText, bindDeviceOfBarcode); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginShutDownControlSystem(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginShutDownControlSystem(callback, asyncState); + public System.IAsyncResult BeginGetReadedAndReportedBarcode(int bindDeviceOfBarcode, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetReadedAndReportedBarcode(bindDeviceOfBarcode, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndShutDownControlSystem(out string ErrText, System.IAsyncResult result) { - return base.Channel.EndShutDownControlSystem(out ErrText, result); + public bool EndGetReadedAndReportedBarcode(out string readedBarcode, out string reportedBarcode, out string errorText, System.IAsyncResult result) { + return base.Channel.EndGetReadedAndReportedBarcode(out readedBarcode, out reportedBarcode, out errorText, result); } - private System.IAsyncResult OnBeginShutDownControlSystem(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginShutDownControlSystem(callback, asyncState); + private System.IAsyncResult OnBeginGetReadedAndReportedBarcode(object[] inValues, System.AsyncCallback callback, object asyncState) { + int bindDeviceOfBarcode = ((int)(inValues[0])); + return this.BeginGetReadedAndReportedBarcode(bindDeviceOfBarcode, callback, asyncState); } - private object[] OnEndShutDownControlSystem(System.IAsyncResult result) { - string ErrText = this.GetDefaultValueForInitialization(); - bool retVal = this.EndShutDownControlSystem(out ErrText, result); + private object[] OnEndGetReadedAndReportedBarcode(System.IAsyncResult result) { + string readedBarcode = this.GetDefaultValueForInitialization(); + string reportedBarcode = this.GetDefaultValueForInitialization(); + string errorText = this.GetDefaultValueForInitialization(); + bool retVal = this.EndGetReadedAndReportedBarcode(out readedBarcode, out reportedBarcode, out errorText, result); return new object[] { - ErrText, + readedBarcode, + reportedBarcode, + errorText, retVal}; } - private void OnShutDownControlSystemCompleted(object state) { - if ((this.ShutDownControlSystemCompleted != null)) { + private void OnGetReadedAndReportedBarcodeCompleted(object state) { + if ((this.GetReadedAndReportedBarcodeCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.ShutDownControlSystemCompleted(this, new ShutDownControlSystemCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetReadedAndReportedBarcodeCompleted(this, new GetReadedAndReportedBarcodeCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void ShutDownControlSystemAsync() { - this.ShutDownControlSystemAsync(null); + public void GetReadedAndReportedBarcodeAsync(int bindDeviceOfBarcode) { + this.GetReadedAndReportedBarcodeAsync(bindDeviceOfBarcode, null); } - public void ShutDownControlSystemAsync(object userState) { - if ((this.onBeginShutDownControlSystemDelegate == null)) { - this.onBeginShutDownControlSystemDelegate = new BeginOperationDelegate(this.OnBeginShutDownControlSystem); + public void GetReadedAndReportedBarcodeAsync(int bindDeviceOfBarcode, object userState) { + if ((this.onBeginGetReadedAndReportedBarcodeDelegate == null)) { + this.onBeginGetReadedAndReportedBarcodeDelegate = new BeginOperationDelegate(this.OnBeginGetReadedAndReportedBarcode); } - if ((this.onEndShutDownControlSystemDelegate == null)) { - this.onEndShutDownControlSystemDelegate = new EndOperationDelegate(this.OnEndShutDownControlSystem); + if ((this.onEndGetReadedAndReportedBarcodeDelegate == null)) { + this.onEndGetReadedAndReportedBarcodeDelegate = new EndOperationDelegate(this.OnEndGetReadedAndReportedBarcode); } - if ((this.onShutDownControlSystemCompletedDelegate == null)) { - this.onShutDownControlSystemCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnShutDownControlSystemCompleted); + if ((this.onGetReadedAndReportedBarcodeCompletedDelegate == null)) { + this.onGetReadedAndReportedBarcodeCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetReadedAndReportedBarcodeCompleted); } - base.InvokeAsync(this.onBeginShutDownControlSystemDelegate, null, this.onEndShutDownControlSystemDelegate, this.onShutDownControlSystemCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetReadedAndReportedBarcodeDelegate, new object[] { + bindDeviceOfBarcode}, this.onEndGetReadedAndReportedBarcodeDelegate, this.onGetReadedAndReportedBarcodeCompletedDelegate, userState); } - public bool StartGetALLDeviceState(out string Errtext) { - return base.Channel.StartGetALLDeviceState(out Errtext); + public Model.MError GetDeviceAllErrors(out string errorText, int deviceKindIndex) { + return base.Channel.GetDeviceAllErrors(out errorText, deviceKindIndex); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginStartGetALLDeviceState(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginStartGetALLDeviceState(callback, asyncState); + public System.IAsyncResult BeginGetDeviceAllErrors(int deviceKindIndex, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetDeviceAllErrors(deviceKindIndex, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndStartGetALLDeviceState(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndStartGetALLDeviceState(out Errtext, result); + public Model.MError EndGetDeviceAllErrors(out string errorText, System.IAsyncResult result) { + return base.Channel.EndGetDeviceAllErrors(out errorText, result); } - private System.IAsyncResult OnBeginStartGetALLDeviceState(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginStartGetALLDeviceState(callback, asyncState); + private System.IAsyncResult OnBeginGetDeviceAllErrors(object[] inValues, System.AsyncCallback callback, object asyncState) { + int deviceKindIndex = ((int)(inValues[0])); + return this.BeginGetDeviceAllErrors(deviceKindIndex, callback, asyncState); } - private object[] OnEndStartGetALLDeviceState(System.IAsyncResult result) { - string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndStartGetALLDeviceState(out Errtext, result); + private object[] OnEndGetDeviceAllErrors(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + Model.MError retVal = this.EndGetDeviceAllErrors(out errorText, result); return new object[] { - Errtext, + errorText, retVal}; } - private void OnStartGetALLDeviceStateCompleted(object state) { - if ((this.StartGetALLDeviceStateCompleted != null)) { + private void OnGetDeviceAllErrorsCompleted(object state) { + if ((this.GetDeviceAllErrorsCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.StartGetALLDeviceStateCompleted(this, new StartGetALLDeviceStateCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetDeviceAllErrorsCompleted(this, new GetDeviceAllErrorsCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void StartGetALLDeviceStateAsync() { - this.StartGetALLDeviceStateAsync(null); + public void GetDeviceAllErrorsAsync(int deviceKindIndex) { + this.GetDeviceAllErrorsAsync(deviceKindIndex, null); } - public void StartGetALLDeviceStateAsync(object userState) { - if ((this.onBeginStartGetALLDeviceStateDelegate == null)) { - this.onBeginStartGetALLDeviceStateDelegate = new BeginOperationDelegate(this.OnBeginStartGetALLDeviceState); + public void GetDeviceAllErrorsAsync(int deviceKindIndex, object userState) { + if ((this.onBeginGetDeviceAllErrorsDelegate == null)) { + this.onBeginGetDeviceAllErrorsDelegate = new BeginOperationDelegate(this.OnBeginGetDeviceAllErrors); } - if ((this.onEndStartGetALLDeviceStateDelegate == null)) { - this.onEndStartGetALLDeviceStateDelegate = new EndOperationDelegate(this.OnEndStartGetALLDeviceState); + if ((this.onEndGetDeviceAllErrorsDelegate == null)) { + this.onEndGetDeviceAllErrorsDelegate = new EndOperationDelegate(this.OnEndGetDeviceAllErrors); } - if ((this.onStartGetALLDeviceStateCompletedDelegate == null)) { - this.onStartGetALLDeviceStateCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnStartGetALLDeviceStateCompleted); + if ((this.onGetDeviceAllErrorsCompletedDelegate == null)) { + this.onGetDeviceAllErrorsCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDeviceAllErrorsCompleted); } - base.InvokeAsync(this.onBeginStartGetALLDeviceStateDelegate, null, this.onEndStartGetALLDeviceStateDelegate, this.onStartGetALLDeviceStateCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetDeviceAllErrorsDelegate, new object[] { + deviceKindIndex}, this.onEndGetDeviceAllErrorsDelegate, this.onGetDeviceAllErrorsCompletedDelegate, userState); } - public bool StartSendDeviceOrder(out string Errtext) { - return base.Channel.StartSendDeviceOrder(out Errtext); + public Model.MRoute[] GetAllRouteinfo(out string errorText) { + return base.Channel.GetAllRouteinfo(out errorText); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginStartSendDeviceOrder(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginStartSendDeviceOrder(callback, asyncState); + public System.IAsyncResult BeginGetAllRouteinfo(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetAllRouteinfo(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndStartSendDeviceOrder(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndStartSendDeviceOrder(out Errtext, result); + public Model.MRoute[] EndGetAllRouteinfo(out string errorText, System.IAsyncResult result) { + return base.Channel.EndGetAllRouteinfo(out errorText, result); } - private System.IAsyncResult OnBeginStartSendDeviceOrder(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginStartSendDeviceOrder(callback, asyncState); + private System.IAsyncResult OnBeginGetAllRouteinfo(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginGetAllRouteinfo(callback, asyncState); } - private object[] OnEndStartSendDeviceOrder(System.IAsyncResult result) { - string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndStartSendDeviceOrder(out Errtext, result); + private object[] OnEndGetAllRouteinfo(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + Model.MRoute[] retVal = this.EndGetAllRouteinfo(out errorText, result); return new object[] { - Errtext, + errorText, retVal}; } - private void OnStartSendDeviceOrderCompleted(object state) { - if ((this.StartSendDeviceOrderCompleted != null)) { + private void OnGetAllRouteinfoCompleted(object state) { + if ((this.GetAllRouteinfoCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.StartSendDeviceOrderCompleted(this, new StartSendDeviceOrderCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetAllRouteinfoCompleted(this, new GetAllRouteinfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void StartSendDeviceOrderAsync() { - this.StartSendDeviceOrderAsync(null); + public void GetAllRouteinfoAsync() { + this.GetAllRouteinfoAsync(null); } - public void StartSendDeviceOrderAsync(object userState) { - if ((this.onBeginStartSendDeviceOrderDelegate == null)) { - this.onBeginStartSendDeviceOrderDelegate = new BeginOperationDelegate(this.OnBeginStartSendDeviceOrder); + public void GetAllRouteinfoAsync(object userState) { + if ((this.onBeginGetAllRouteinfoDelegate == null)) { + this.onBeginGetAllRouteinfoDelegate = new BeginOperationDelegate(this.OnBeginGetAllRouteinfo); } - if ((this.onEndStartSendDeviceOrderDelegate == null)) { - this.onEndStartSendDeviceOrderDelegate = new EndOperationDelegate(this.OnEndStartSendDeviceOrder); + if ((this.onEndGetAllRouteinfoDelegate == null)) { + this.onEndGetAllRouteinfoDelegate = new EndOperationDelegate(this.OnEndGetAllRouteinfo); } - if ((this.onStartSendDeviceOrderCompletedDelegate == null)) { - this.onStartSendDeviceOrderCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnStartSendDeviceOrderCompleted); + if ((this.onGetAllRouteinfoCompletedDelegate == null)) { + this.onGetAllRouteinfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetAllRouteinfoCompleted); } - base.InvokeAsync(this.onBeginStartSendDeviceOrderDelegate, null, this.onEndStartSendDeviceOrderDelegate, this.onStartSendDeviceOrderCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetAllRouteinfoDelegate, null, this.onEndGetAllRouteinfoDelegate, this.onGetAllRouteinfoCompletedDelegate, userState); } - public bool DataClear(out string Errtext) { - return base.Channel.DataClear(out Errtext); + public Model.MRoute[] GetDeviceJoinRouteinfo(out string errorText, int deviceIndex) { + return base.Channel.GetDeviceJoinRouteinfo(out errorText, deviceIndex); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginDataClear(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginDataClear(callback, asyncState); + public System.IAsyncResult BeginGetDeviceJoinRouteinfo(int deviceIndex, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetDeviceJoinRouteinfo(deviceIndex, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndDataClear(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndDataClear(out Errtext, result); + public Model.MRoute[] EndGetDeviceJoinRouteinfo(out string errorText, System.IAsyncResult result) { + return base.Channel.EndGetDeviceJoinRouteinfo(out errorText, result); } - private System.IAsyncResult OnBeginDataClear(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginDataClear(callback, asyncState); + private System.IAsyncResult OnBeginGetDeviceJoinRouteinfo(object[] inValues, System.AsyncCallback callback, object asyncState) { + int deviceIndex = ((int)(inValues[0])); + return this.BeginGetDeviceJoinRouteinfo(deviceIndex, callback, asyncState); } - private object[] OnEndDataClear(System.IAsyncResult result) { - string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndDataClear(out Errtext, result); + private object[] OnEndGetDeviceJoinRouteinfo(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + Model.MRoute[] retVal = this.EndGetDeviceJoinRouteinfo(out errorText, result); return new object[] { - Errtext, + errorText, retVal}; } - private void OnDataClearCompleted(object state) { - if ((this.DataClearCompleted != null)) { + private void OnGetDeviceJoinRouteinfoCompleted(object state) { + if ((this.GetDeviceJoinRouteinfoCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.DataClearCompleted(this, new DataClearCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetDeviceJoinRouteinfoCompleted(this, new GetDeviceJoinRouteinfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void DataClearAsync() { - this.DataClearAsync(null); + public void GetDeviceJoinRouteinfoAsync(int deviceIndex) { + this.GetDeviceJoinRouteinfoAsync(deviceIndex, null); } - public void DataClearAsync(object userState) { - if ((this.onBeginDataClearDelegate == null)) { - this.onBeginDataClearDelegate = new BeginOperationDelegate(this.OnBeginDataClear); + public void GetDeviceJoinRouteinfoAsync(int deviceIndex, object userState) { + if ((this.onBeginGetDeviceJoinRouteinfoDelegate == null)) { + this.onBeginGetDeviceJoinRouteinfoDelegate = new BeginOperationDelegate(this.OnBeginGetDeviceJoinRouteinfo); } - if ((this.onEndDataClearDelegate == null)) { - this.onEndDataClearDelegate = new EndOperationDelegate(this.OnEndDataClear); + if ((this.onEndGetDeviceJoinRouteinfoDelegate == null)) { + this.onEndGetDeviceJoinRouteinfoDelegate = new EndOperationDelegate(this.OnEndGetDeviceJoinRouteinfo); } - if ((this.onDataClearCompletedDelegate == null)) { - this.onDataClearCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnDataClearCompleted); + if ((this.onGetDeviceJoinRouteinfoCompletedDelegate == null)) { + this.onGetDeviceJoinRouteinfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDeviceJoinRouteinfoCompleted); } - base.InvokeAsync(this.onBeginDataClearDelegate, null, this.onEndDataClearDelegate, this.onDataClearCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetDeviceJoinRouteinfoDelegate, new object[] { + deviceIndex}, this.onEndGetDeviceJoinRouteinfoDelegate, this.onGetDeviceJoinRouteinfoCompletedDelegate, userState); } - public int GetManageTaskKindFromMonitor(out string errtext, int monitorIndex) { - return base.Channel.GetManageTaskKindFromMonitor(out errtext, monitorIndex); + public wcfControlMonitorClient.WcfControlMonitor.ManageTask[] GetManageTasks(out string errorText, string FieldName, string content) { + return base.Channel.GetManageTasks(out errorText, FieldName, content); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetManageTaskKindFromMonitor(int monitorIndex, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetManageTaskKindFromMonitor(monitorIndex, callback, asyncState); + public System.IAsyncResult BeginGetManageTasks(string FieldName, string content, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetManageTasks(FieldName, content, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public int EndGetManageTaskKindFromMonitor(out string errtext, System.IAsyncResult result) { - return base.Channel.EndGetManageTaskKindFromMonitor(out errtext, result); + public wcfControlMonitorClient.WcfControlMonitor.ManageTask[] EndGetManageTasks(out string errorText, System.IAsyncResult result) { + return base.Channel.EndGetManageTasks(out errorText, result); } - private System.IAsyncResult OnBeginGetManageTaskKindFromMonitor(object[] inValues, System.AsyncCallback callback, object asyncState) { - int monitorIndex = ((int)(inValues[0])); - return this.BeginGetManageTaskKindFromMonitor(monitorIndex, callback, asyncState); + private System.IAsyncResult OnBeginGetManageTasks(object[] inValues, System.AsyncCallback callback, object asyncState) { + string FieldName = ((string)(inValues[0])); + string content = ((string)(inValues[1])); + return this.BeginGetManageTasks(FieldName, content, callback, asyncState); } - private object[] OnEndGetManageTaskKindFromMonitor(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - int retVal = this.EndGetManageTaskKindFromMonitor(out errtext, result); + private object[] OnEndGetManageTasks(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + wcfControlMonitorClient.WcfControlMonitor.ManageTask[] retVal = this.EndGetManageTasks(out errorText, result); return new object[] { - errtext, + errorText, retVal}; } - private void OnGetManageTaskKindFromMonitorCompleted(object state) { - if ((this.GetManageTaskKindFromMonitorCompleted != null)) { + private void OnGetManageTasksCompleted(object state) { + if ((this.GetManageTasksCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetManageTaskKindFromMonitorCompleted(this, new GetManageTaskKindFromMonitorCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetManageTasksCompleted(this, new GetManageTasksCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetManageTaskKindFromMonitorAsync(int monitorIndex) { - this.GetManageTaskKindFromMonitorAsync(monitorIndex, null); + public void GetManageTasksAsync(string FieldName, string content) { + this.GetManageTasksAsync(FieldName, content, null); } - public void GetManageTaskKindFromMonitorAsync(int monitorIndex, object userState) { - if ((this.onBeginGetManageTaskKindFromMonitorDelegate == null)) { - this.onBeginGetManageTaskKindFromMonitorDelegate = new BeginOperationDelegate(this.OnBeginGetManageTaskKindFromMonitor); + public void GetManageTasksAsync(string FieldName, string content, object userState) { + if ((this.onBeginGetManageTasksDelegate == null)) { + this.onBeginGetManageTasksDelegate = new BeginOperationDelegate(this.OnBeginGetManageTasks); } - if ((this.onEndGetManageTaskKindFromMonitorDelegate == null)) { - this.onEndGetManageTaskKindFromMonitorDelegate = new EndOperationDelegate(this.OnEndGetManageTaskKindFromMonitor); + if ((this.onEndGetManageTasksDelegate == null)) { + this.onEndGetManageTasksDelegate = new EndOperationDelegate(this.OnEndGetManageTasks); } - if ((this.onGetManageTaskKindFromMonitorCompletedDelegate == null)) { - this.onGetManageTaskKindFromMonitorCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetManageTaskKindFromMonitorCompleted); + if ((this.onGetManageTasksCompletedDelegate == null)) { + this.onGetManageTasksCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetManageTasksCompleted); } - base.InvokeAsync(this.onBeginGetManageTaskKindFromMonitorDelegate, new object[] { - monitorIndex}, this.onEndGetManageTaskKindFromMonitorDelegate, this.onGetManageTaskKindFromMonitorCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetManageTasksDelegate, new object[] { + FieldName, + content}, this.onEndGetManageTasksDelegate, this.onGetManageTasksCompletedDelegate, userState); } - public int GetManageTaskIndexFromMonitor(out string errtext, int monitorIndex) { - return base.Channel.GetManageTaskIndexFromMonitor(out errtext, monitorIndex); + public wcfControlMonitorClient.WcfControlMonitor.MonitorTask[] GetMonitorTasks(out string errorText, string FieldName, string content) { + return base.Channel.GetMonitorTasks(out errorText, FieldName, content); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetManageTaskIndexFromMonitor(int monitorIndex, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetManageTaskIndexFromMonitor(monitorIndex, callback, asyncState); + public System.IAsyncResult BeginGetMonitorTasks(string FieldName, string content, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetMonitorTasks(FieldName, content, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public int EndGetManageTaskIndexFromMonitor(out string errtext, System.IAsyncResult result) { - return base.Channel.EndGetManageTaskIndexFromMonitor(out errtext, result); + public wcfControlMonitorClient.WcfControlMonitor.MonitorTask[] EndGetMonitorTasks(out string errorText, System.IAsyncResult result) { + return base.Channel.EndGetMonitorTasks(out errorText, result); } - private System.IAsyncResult OnBeginGetManageTaskIndexFromMonitor(object[] inValues, System.AsyncCallback callback, object asyncState) { - int monitorIndex = ((int)(inValues[0])); - return this.BeginGetManageTaskIndexFromMonitor(monitorIndex, callback, asyncState); + private System.IAsyncResult OnBeginGetMonitorTasks(object[] inValues, System.AsyncCallback callback, object asyncState) { + string FieldName = ((string)(inValues[0])); + string content = ((string)(inValues[1])); + return this.BeginGetMonitorTasks(FieldName, content, callback, asyncState); } - private object[] OnEndGetManageTaskIndexFromMonitor(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - int retVal = this.EndGetManageTaskIndexFromMonitor(out errtext, result); + private object[] OnEndGetMonitorTasks(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + wcfControlMonitorClient.WcfControlMonitor.MonitorTask[] retVal = this.EndGetMonitorTasks(out errorText, result); return new object[] { - errtext, + errorText, retVal}; } - private void OnGetManageTaskIndexFromMonitorCompleted(object state) { - if ((this.GetManageTaskIndexFromMonitorCompleted != null)) { + private void OnGetMonitorTasksCompleted(object state) { + if ((this.GetMonitorTasksCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetManageTaskIndexFromMonitorCompleted(this, new GetManageTaskIndexFromMonitorCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetMonitorTasksCompleted(this, new GetMonitorTasksCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetManageTaskIndexFromMonitorAsync(int monitorIndex) { - this.GetManageTaskIndexFromMonitorAsync(monitorIndex, null); + public void GetMonitorTasksAsync(string FieldName, string content) { + this.GetMonitorTasksAsync(FieldName, content, null); } - public void GetManageTaskIndexFromMonitorAsync(int monitorIndex, object userState) { - if ((this.onBeginGetManageTaskIndexFromMonitorDelegate == null)) { - this.onBeginGetManageTaskIndexFromMonitorDelegate = new BeginOperationDelegate(this.OnBeginGetManageTaskIndexFromMonitor); + public void GetMonitorTasksAsync(string FieldName, string content, object userState) { + if ((this.onBeginGetMonitorTasksDelegate == null)) { + this.onBeginGetMonitorTasksDelegate = new BeginOperationDelegate(this.OnBeginGetMonitorTasks); } - if ((this.onEndGetManageTaskIndexFromMonitorDelegate == null)) { - this.onEndGetManageTaskIndexFromMonitorDelegate = new EndOperationDelegate(this.OnEndGetManageTaskIndexFromMonitor); + if ((this.onEndGetMonitorTasksDelegate == null)) { + this.onEndGetMonitorTasksDelegate = new EndOperationDelegate(this.OnEndGetMonitorTasks); } - if ((this.onGetManageTaskIndexFromMonitorCompletedDelegate == null)) { - this.onGetManageTaskIndexFromMonitorCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetManageTaskIndexFromMonitorCompleted); + if ((this.onGetMonitorTasksCompletedDelegate == null)) { + this.onGetMonitorTasksCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetMonitorTasksCompleted); } - base.InvokeAsync(this.onBeginGetManageTaskIndexFromMonitorDelegate, new object[] { - monitorIndex}, this.onEndGetManageTaskIndexFromMonitorDelegate, this.onGetManageTaskIndexFromMonitorCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetMonitorTasksDelegate, new object[] { + FieldName, + content}, this.onEndGetMonitorTasksDelegate, this.onGetMonitorTasksCompletedDelegate, userState); } - public int GetDeviceKindIndex(out string errtext, int deviceIndex) { - return base.Channel.GetDeviceKindIndex(out errtext, deviceIndex); + public wcfControlMonitorClient.WcfControlMonitor.DeviceStateType GetDeviceStateInfo(out string errorText, int deviceIndex) { + return base.Channel.GetDeviceStateInfo(out errorText, deviceIndex); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetDeviceKindIndex(int deviceIndex, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetDeviceKindIndex(deviceIndex, callback, asyncState); + public System.IAsyncResult BeginGetDeviceStateInfo(int deviceIndex, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetDeviceStateInfo(deviceIndex, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public int EndGetDeviceKindIndex(out string errtext, System.IAsyncResult result) { - return base.Channel.EndGetDeviceKindIndex(out errtext, result); + public wcfControlMonitorClient.WcfControlMonitor.DeviceStateType EndGetDeviceStateInfo(out string errorText, System.IAsyncResult result) { + return base.Channel.EndGetDeviceStateInfo(out errorText, result); } - private System.IAsyncResult OnBeginGetDeviceKindIndex(object[] inValues, System.AsyncCallback callback, object asyncState) { + private System.IAsyncResult OnBeginGetDeviceStateInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { int deviceIndex = ((int)(inValues[0])); - return this.BeginGetDeviceKindIndex(deviceIndex, callback, asyncState); + return this.BeginGetDeviceStateInfo(deviceIndex, callback, asyncState); } - private object[] OnEndGetDeviceKindIndex(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - int retVal = this.EndGetDeviceKindIndex(out errtext, result); + private object[] OnEndGetDeviceStateInfo(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + wcfControlMonitorClient.WcfControlMonitor.DeviceStateType retVal = this.EndGetDeviceStateInfo(out errorText, result); return new object[] { - errtext, + errorText, retVal}; } - private void OnGetDeviceKindIndexCompleted(object state) { - if ((this.GetDeviceKindIndexCompleted != null)) { + private void OnGetDeviceStateInfoCompleted(object state) { + if ((this.GetDeviceStateInfoCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetDeviceKindIndexCompleted(this, new GetDeviceKindIndexCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetDeviceStateInfoCompleted(this, new GetDeviceStateInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetDeviceKindIndexAsync(int deviceIndex) { - this.GetDeviceKindIndexAsync(deviceIndex, null); + public void GetDeviceStateInfoAsync(int deviceIndex) { + this.GetDeviceStateInfoAsync(deviceIndex, null); } - public void GetDeviceKindIndexAsync(int deviceIndex, object userState) { - if ((this.onBeginGetDeviceKindIndexDelegate == null)) { - this.onBeginGetDeviceKindIndexDelegate = new BeginOperationDelegate(this.OnBeginGetDeviceKindIndex); + public void GetDeviceStateInfoAsync(int deviceIndex, object userState) { + if ((this.onBeginGetDeviceStateInfoDelegate == null)) { + this.onBeginGetDeviceStateInfoDelegate = new BeginOperationDelegate(this.OnBeginGetDeviceStateInfo); } - if ((this.onEndGetDeviceKindIndexDelegate == null)) { - this.onEndGetDeviceKindIndexDelegate = new EndOperationDelegate(this.OnEndGetDeviceKindIndex); + if ((this.onEndGetDeviceStateInfoDelegate == null)) { + this.onEndGetDeviceStateInfoDelegate = new EndOperationDelegate(this.OnEndGetDeviceStateInfo); } - if ((this.onGetDeviceKindIndexCompletedDelegate == null)) { - this.onGetDeviceKindIndexCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDeviceKindIndexCompleted); + if ((this.onGetDeviceStateInfoCompletedDelegate == null)) { + this.onGetDeviceStateInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDeviceStateInfoCompleted); } - base.InvokeAsync(this.onBeginGetDeviceKindIndexDelegate, new object[] { - deviceIndex}, this.onEndGetDeviceKindIndexDelegate, this.onGetDeviceKindIndexCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetDeviceStateInfoDelegate, new object[] { + deviceIndex}, this.onEndGetDeviceStateInfoDelegate, this.onGetDeviceStateInfoCompletedDelegate, userState); } - public bool SendDeviceReset(out string errtext, int deviceIndex, int ResetOrder) { - return base.Channel.SendDeviceReset(out errtext, deviceIndex, ResetOrder); + public bool SetDeviceStateInfo(out string errorText, wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate) { + return base.Channel.SetDeviceStateInfo(out errorText, devstate); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSendDeviceReset(int deviceIndex, int ResetOrder, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSendDeviceReset(deviceIndex, ResetOrder, callback, asyncState); + public System.IAsyncResult BeginSetDeviceStateInfo(wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetDeviceStateInfo(devstate, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSendDeviceReset(out string errtext, System.IAsyncResult result) { - return base.Channel.EndSendDeviceReset(out errtext, result); + public bool EndSetDeviceStateInfo(out string errorText, System.IAsyncResult result) { + return base.Channel.EndSetDeviceStateInfo(out errorText, result); } - private System.IAsyncResult OnBeginSendDeviceReset(object[] inValues, System.AsyncCallback callback, object asyncState) { - int deviceIndex = ((int)(inValues[0])); - int ResetOrder = ((int)(inValues[1])); - return this.BeginSendDeviceReset(deviceIndex, ResetOrder, callback, asyncState); + private System.IAsyncResult OnBeginSetDeviceStateInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { + wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate = ((wcfControlMonitorClient.WcfControlMonitor.DeviceStateType)(inValues[0])); + return this.BeginSetDeviceStateInfo(devstate, callback, asyncState); } - private object[] OnEndSendDeviceReset(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSendDeviceReset(out errtext, result); + private object[] OnEndSetDeviceStateInfo(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + bool retVal = this.EndSetDeviceStateInfo(out errorText, result); return new object[] { - errtext, + errorText, retVal}; } - private void OnSendDeviceResetCompleted(object state) { - if ((this.SendDeviceResetCompleted != null)) { + private void OnSetDeviceStateInfoCompleted(object state) { + if ((this.SetDeviceStateInfoCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SendDeviceResetCompleted(this, new SendDeviceResetCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetDeviceStateInfoCompleted(this, new SetDeviceStateInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SendDeviceResetAsync(int deviceIndex, int ResetOrder) { - this.SendDeviceResetAsync(deviceIndex, ResetOrder, null); + public void SetDeviceStateInfoAsync(wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate) { + this.SetDeviceStateInfoAsync(devstate, null); } - public void SendDeviceResetAsync(int deviceIndex, int ResetOrder, object userState) { - if ((this.onBeginSendDeviceResetDelegate == null)) { - this.onBeginSendDeviceResetDelegate = new BeginOperationDelegate(this.OnBeginSendDeviceReset); + public void SetDeviceStateInfoAsync(wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate, object userState) { + if ((this.onBeginSetDeviceStateInfoDelegate == null)) { + this.onBeginSetDeviceStateInfoDelegate = new BeginOperationDelegate(this.OnBeginSetDeviceStateInfo); } - if ((this.onEndSendDeviceResetDelegate == null)) { - this.onEndSendDeviceResetDelegate = new EndOperationDelegate(this.OnEndSendDeviceReset); + if ((this.onEndSetDeviceStateInfoDelegate == null)) { + this.onEndSetDeviceStateInfoDelegate = new EndOperationDelegate(this.OnEndSetDeviceStateInfo); } - if ((this.onSendDeviceResetCompletedDelegate == null)) { - this.onSendDeviceResetCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSendDeviceResetCompleted); + if ((this.onSetDeviceStateInfoCompletedDelegate == null)) { + this.onSetDeviceStateInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetDeviceStateInfoCompleted); } - base.InvokeAsync(this.onBeginSendDeviceResetDelegate, new object[] { - deviceIndex, - ResetOrder}, this.onEndSendDeviceResetDelegate, this.onSendDeviceResetCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSetDeviceStateInfoDelegate, new object[] { + devstate}, this.onEndSetDeviceStateInfoDelegate, this.onSetDeviceStateInfoCompletedDelegate, userState); } - public bool Heartbeat(out Model.MonitorInfo monitorinfo) { - return base.Channel.Heartbeat(out monitorinfo); + public bool SetRouteStateInfo(out string errorText, int routeID, bool isEnabled) { + return base.Channel.SetRouteStateInfo(out errorText, routeID, isEnabled); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginHeartbeat(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginHeartbeat(callback, asyncState); + public System.IAsyncResult BeginSetRouteStateInfo(int routeID, bool isEnabled, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetRouteStateInfo(routeID, isEnabled, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndHeartbeat(out Model.MonitorInfo monitorinfo, System.IAsyncResult result) { - return base.Channel.EndHeartbeat(out monitorinfo, result); + public bool EndSetRouteStateInfo(out string errorText, System.IAsyncResult result) { + return base.Channel.EndSetRouteStateInfo(out errorText, result); } - private System.IAsyncResult OnBeginHeartbeat(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginHeartbeat(callback, asyncState); + private System.IAsyncResult OnBeginSetRouteStateInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { + int routeID = ((int)(inValues[0])); + bool isEnabled = ((bool)(inValues[1])); + return this.BeginSetRouteStateInfo(routeID, isEnabled, callback, asyncState); } - private object[] OnEndHeartbeat(System.IAsyncResult result) { - Model.MonitorInfo monitorinfo = this.GetDefaultValueForInitialization(); - bool retVal = this.EndHeartbeat(out monitorinfo, result); + private object[] OnEndSetRouteStateInfo(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + bool retVal = this.EndSetRouteStateInfo(out errorText, result); return new object[] { - monitorinfo, + errorText, retVal}; } - private void OnHeartbeatCompleted(object state) { - if ((this.HeartbeatCompleted != null)) { + private void OnSetRouteStateInfoCompleted(object state) { + if ((this.SetRouteStateInfoCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.HeartbeatCompleted(this, new HeartbeatCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetRouteStateInfoCompleted(this, new SetRouteStateInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void HeartbeatAsync() { - this.HeartbeatAsync(null); + public void SetRouteStateInfoAsync(int routeID, bool isEnabled) { + this.SetRouteStateInfoAsync(routeID, isEnabled, null); } - public void HeartbeatAsync(object userState) { - if ((this.onBeginHeartbeatDelegate == null)) { - this.onBeginHeartbeatDelegate = new BeginOperationDelegate(this.OnBeginHeartbeat); + public void SetRouteStateInfoAsync(int routeID, bool isEnabled, object userState) { + if ((this.onBeginSetRouteStateInfoDelegate == null)) { + this.onBeginSetRouteStateInfoDelegate = new BeginOperationDelegate(this.OnBeginSetRouteStateInfo); } - if ((this.onEndHeartbeatDelegate == null)) { - this.onEndHeartbeatDelegate = new EndOperationDelegate(this.OnEndHeartbeat); + if ((this.onEndSetRouteStateInfoDelegate == null)) { + this.onEndSetRouteStateInfoDelegate = new EndOperationDelegate(this.OnEndSetRouteStateInfo); } - if ((this.onHeartbeatCompletedDelegate == null)) { - this.onHeartbeatCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnHeartbeatCompleted); + if ((this.onSetRouteStateInfoCompletedDelegate == null)) { + this.onSetRouteStateInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetRouteStateInfoCompleted); } - base.InvokeAsync(this.onBeginHeartbeatDelegate, null, this.onEndHeartbeatDelegate, this.onHeartbeatCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSetRouteStateInfoDelegate, new object[] { + routeID, + isEnabled}, this.onEndSetRouteStateInfoDelegate, this.onSetRouteStateInfoCompletedDelegate, userState); } - public System.Data.DataTable GetDataView(out string errtext, string SQL) { - return base.Channel.GetDataView(out errtext, SQL); + public bool SetDeviceJoinRouteStateInfo(out string errorText, int deviceIndex, bool isEnabled) { + return base.Channel.SetDeviceJoinRouteStateInfo(out errorText, deviceIndex, isEnabled); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetDataView(string SQL, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetDataView(SQL, callback, asyncState); + public System.IAsyncResult BeginSetDeviceJoinRouteStateInfo(int deviceIndex, bool isEnabled, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetDeviceJoinRouteStateInfo(deviceIndex, isEnabled, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.Data.DataTable EndGetDataView(out string errtext, System.IAsyncResult result) { - return base.Channel.EndGetDataView(out errtext, result); + public bool EndSetDeviceJoinRouteStateInfo(out string errorText, System.IAsyncResult result) { + return base.Channel.EndSetDeviceJoinRouteStateInfo(out errorText, result); } - private System.IAsyncResult OnBeginGetDataView(object[] inValues, System.AsyncCallback callback, object asyncState) { - string SQL = ((string)(inValues[0])); - return this.BeginGetDataView(SQL, callback, asyncState); + private System.IAsyncResult OnBeginSetDeviceJoinRouteStateInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { + int deviceIndex = ((int)(inValues[0])); + bool isEnabled = ((bool)(inValues[1])); + return this.BeginSetDeviceJoinRouteStateInfo(deviceIndex, isEnabled, callback, asyncState); } - private object[] OnEndGetDataView(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - System.Data.DataTable retVal = this.EndGetDataView(out errtext, result); + private object[] OnEndSetDeviceJoinRouteStateInfo(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + bool retVal = this.EndSetDeviceJoinRouteStateInfo(out errorText, result); return new object[] { - errtext, + errorText, retVal}; } - private void OnGetDataViewCompleted(object state) { - if ((this.GetDataViewCompleted != null)) { + private void OnSetDeviceJoinRouteStateInfoCompleted(object state) { + if ((this.SetDeviceJoinRouteStateInfoCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetDataViewCompleted(this, new GetDataViewCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetDeviceJoinRouteStateInfoCompleted(this, new SetDeviceJoinRouteStateInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetDataViewAsync(string SQL) { - this.GetDataViewAsync(SQL, null); + public void SetDeviceJoinRouteStateInfoAsync(int deviceIndex, bool isEnabled) { + this.SetDeviceJoinRouteStateInfoAsync(deviceIndex, isEnabled, null); } - public void GetDataViewAsync(string SQL, object userState) { - if ((this.onBeginGetDataViewDelegate == null)) { - this.onBeginGetDataViewDelegate = new BeginOperationDelegate(this.OnBeginGetDataView); + public void SetDeviceJoinRouteStateInfoAsync(int deviceIndex, bool isEnabled, object userState) { + if ((this.onBeginSetDeviceJoinRouteStateInfoDelegate == null)) { + this.onBeginSetDeviceJoinRouteStateInfoDelegate = new BeginOperationDelegate(this.OnBeginSetDeviceJoinRouteStateInfo); } - if ((this.onEndGetDataViewDelegate == null)) { - this.onEndGetDataViewDelegate = new EndOperationDelegate(this.OnEndGetDataView); + if ((this.onEndSetDeviceJoinRouteStateInfoDelegate == null)) { + this.onEndSetDeviceJoinRouteStateInfoDelegate = new EndOperationDelegate(this.OnEndSetDeviceJoinRouteStateInfo); } - if ((this.onGetDataViewCompletedDelegate == null)) { - this.onGetDataViewCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDataViewCompleted); + if ((this.onSetDeviceJoinRouteStateInfoCompletedDelegate == null)) { + this.onSetDeviceJoinRouteStateInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetDeviceJoinRouteStateInfoCompleted); } - base.InvokeAsync(this.onBeginGetDataViewDelegate, new object[] { - SQL}, this.onEndGetDataViewDelegate, this.onGetDataViewCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSetDeviceJoinRouteStateInfoDelegate, new object[] { + deviceIndex, + isEnabled}, this.onEndSetDeviceJoinRouteStateInfoDelegate, this.onSetDeviceJoinRouteStateInfoCompletedDelegate, userState); } - public int ExeSQLNoneQuery(out string errtext, string SQL) { - return base.Channel.ExeSQLNoneQuery(out errtext, SQL); + public wcfControlMonitorClient.WcfControlMonitor.ST_Cell[] GetAllCellInfos(out string errorText) { + return base.Channel.GetAllCellInfos(out errorText); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginExeSQLNoneQuery(string SQL, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginExeSQLNoneQuery(SQL, callback, asyncState); + public System.IAsyncResult BeginGetAllCellInfos(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetAllCellInfos(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public int EndExeSQLNoneQuery(out string errtext, System.IAsyncResult result) { - return base.Channel.EndExeSQLNoneQuery(out errtext, result); + public wcfControlMonitorClient.WcfControlMonitor.ST_Cell[] EndGetAllCellInfos(out string errorText, System.IAsyncResult result) { + return base.Channel.EndGetAllCellInfos(out errorText, result); } - private System.IAsyncResult OnBeginExeSQLNoneQuery(object[] inValues, System.AsyncCallback callback, object asyncState) { - string SQL = ((string)(inValues[0])); - return this.BeginExeSQLNoneQuery(SQL, callback, asyncState); + private System.IAsyncResult OnBeginGetAllCellInfos(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginGetAllCellInfos(callback, asyncState); } - private object[] OnEndExeSQLNoneQuery(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - int retVal = this.EndExeSQLNoneQuery(out errtext, result); + private object[] OnEndGetAllCellInfos(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + wcfControlMonitorClient.WcfControlMonitor.ST_Cell[] retVal = this.EndGetAllCellInfos(out errorText, result); return new object[] { - errtext, + errorText, retVal}; } - private void OnExeSQLNoneQueryCompleted(object state) { - if ((this.ExeSQLNoneQueryCompleted != null)) { + private void OnGetAllCellInfosCompleted(object state) { + if ((this.GetAllCellInfosCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.ExeSQLNoneQueryCompleted(this, new ExeSQLNoneQueryCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetAllCellInfosCompleted(this, new GetAllCellInfosCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void ExeSQLNoneQueryAsync(string SQL) { - this.ExeSQLNoneQueryAsync(SQL, null); + public void GetAllCellInfosAsync() { + this.GetAllCellInfosAsync(null); } - public void ExeSQLNoneQueryAsync(string SQL, object userState) { - if ((this.onBeginExeSQLNoneQueryDelegate == null)) { - this.onBeginExeSQLNoneQueryDelegate = new BeginOperationDelegate(this.OnBeginExeSQLNoneQuery); + public void GetAllCellInfosAsync(object userState) { + if ((this.onBeginGetAllCellInfosDelegate == null)) { + this.onBeginGetAllCellInfosDelegate = new BeginOperationDelegate(this.OnBeginGetAllCellInfos); } - if ((this.onEndExeSQLNoneQueryDelegate == null)) { - this.onEndExeSQLNoneQueryDelegate = new EndOperationDelegate(this.OnEndExeSQLNoneQuery); + if ((this.onEndGetAllCellInfosDelegate == null)) { + this.onEndGetAllCellInfosDelegate = new EndOperationDelegate(this.OnEndGetAllCellInfos); } - if ((this.onExeSQLNoneQueryCompletedDelegate == null)) { - this.onExeSQLNoneQueryCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnExeSQLNoneQueryCompleted); + if ((this.onGetAllCellInfosCompletedDelegate == null)) { + this.onGetAllCellInfosCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetAllCellInfosCompleted); } - base.InvokeAsync(this.onBeginExeSQLNoneQueryDelegate, new object[] { - SQL}, this.onEndExeSQLNoneQueryDelegate, this.onExeSQLNoneQueryCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetAllCellInfosDelegate, null, this.onEndGetAllCellInfosDelegate, this.onGetAllCellInfosCompletedDelegate, userState); } - public System.Data.DataTable GetManDataView(out string errtext, string SQL) { - return base.Channel.GetManDataView(out errtext, SQL); + public string[] GetLanguageFields(out string errorText) { + return base.Channel.GetLanguageFields(out errorText); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetManDataView(string SQL, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetManDataView(SQL, callback, asyncState); + public System.IAsyncResult BeginGetLanguageFields(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetLanguageFields(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.Data.DataTable EndGetManDataView(out string errtext, System.IAsyncResult result) { - return base.Channel.EndGetManDataView(out errtext, result); + public string[] EndGetLanguageFields(out string errorText, System.IAsyncResult result) { + return base.Channel.EndGetLanguageFields(out errorText, result); } - private System.IAsyncResult OnBeginGetManDataView(object[] inValues, System.AsyncCallback callback, object asyncState) { - string SQL = ((string)(inValues[0])); - return this.BeginGetManDataView(SQL, callback, asyncState); - } + private System.IAsyncResult OnBeginGetLanguageFields(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginGetLanguageFields(callback, asyncState); + } - private object[] OnEndGetManDataView(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - System.Data.DataTable retVal = this.EndGetManDataView(out errtext, result); + private object[] OnEndGetLanguageFields(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + string[] retVal = this.EndGetLanguageFields(out errorText, result); return new object[] { - errtext, + errorText, retVal}; } - private void OnGetManDataViewCompleted(object state) { - if ((this.GetManDataViewCompleted != null)) { + private void OnGetLanguageFieldsCompleted(object state) { + if ((this.GetLanguageFieldsCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetManDataViewCompleted(this, new GetManDataViewCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetLanguageFieldsCompleted(this, new GetLanguageFieldsCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetManDataViewAsync(string SQL) { - this.GetManDataViewAsync(SQL, null); + public void GetLanguageFieldsAsync() { + this.GetLanguageFieldsAsync(null); } - public void GetManDataViewAsync(string SQL, object userState) { - if ((this.onBeginGetManDataViewDelegate == null)) { - this.onBeginGetManDataViewDelegate = new BeginOperationDelegate(this.OnBeginGetManDataView); + public void GetLanguageFieldsAsync(object userState) { + if ((this.onBeginGetLanguageFieldsDelegate == null)) { + this.onBeginGetLanguageFieldsDelegate = new BeginOperationDelegate(this.OnBeginGetLanguageFields); } - if ((this.onEndGetManDataViewDelegate == null)) { - this.onEndGetManDataViewDelegate = new EndOperationDelegate(this.OnEndGetManDataView); + if ((this.onEndGetLanguageFieldsDelegate == null)) { + this.onEndGetLanguageFieldsDelegate = new EndOperationDelegate(this.OnEndGetLanguageFields); } - if ((this.onGetManDataViewCompletedDelegate == null)) { - this.onGetManDataViewCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetManDataViewCompleted); + if ((this.onGetLanguageFieldsCompletedDelegate == null)) { + this.onGetLanguageFieldsCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetLanguageFieldsCompleted); } - base.InvokeAsync(this.onBeginGetManDataViewDelegate, new object[] { - SQL}, this.onEndGetManDataViewDelegate, this.onGetManDataViewCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetLanguageFieldsDelegate, null, this.onEndGetLanguageFieldsDelegate, this.onGetLanguageFieldsCompletedDelegate, userState); } - public int ExeManSQLNoneQuery(out string errtext, string SQL) { - return base.Channel.ExeManSQLNoneQuery(out errtext, SQL); + public wcfControlMonitorClient.WcfControlMonitor.LanguageContent[] GetLanguageContent(out string errorText, string language) { + return base.Channel.GetLanguageContent(out errorText, language); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginExeManSQLNoneQuery(string SQL, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginExeManSQLNoneQuery(SQL, callback, asyncState); + public System.IAsyncResult BeginGetLanguageContent(string language, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetLanguageContent(language, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public int EndExeManSQLNoneQuery(out string errtext, System.IAsyncResult result) { - return base.Channel.EndExeManSQLNoneQuery(out errtext, result); + public wcfControlMonitorClient.WcfControlMonitor.LanguageContent[] EndGetLanguageContent(out string errorText, System.IAsyncResult result) { + return base.Channel.EndGetLanguageContent(out errorText, result); } - private System.IAsyncResult OnBeginExeManSQLNoneQuery(object[] inValues, System.AsyncCallback callback, object asyncState) { - string SQL = ((string)(inValues[0])); - return this.BeginExeManSQLNoneQuery(SQL, callback, asyncState); + private System.IAsyncResult OnBeginGetLanguageContent(object[] inValues, System.AsyncCallback callback, object asyncState) { + string language = ((string)(inValues[0])); + return this.BeginGetLanguageContent(language, callback, asyncState); } - private object[] OnEndExeManSQLNoneQuery(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - int retVal = this.EndExeManSQLNoneQuery(out errtext, result); + private object[] OnEndGetLanguageContent(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + wcfControlMonitorClient.WcfControlMonitor.LanguageContent[] retVal = this.EndGetLanguageContent(out errorText, result); return new object[] { - errtext, + errorText, retVal}; } - private void OnExeManSQLNoneQueryCompleted(object state) { - if ((this.ExeManSQLNoneQueryCompleted != null)) { + private void OnGetLanguageContentCompleted(object state) { + if ((this.GetLanguageContentCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.ExeManSQLNoneQueryCompleted(this, new ExeManSQLNoneQueryCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetLanguageContentCompleted(this, new GetLanguageContentCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void ExeManSQLNoneQueryAsync(string SQL) { - this.ExeManSQLNoneQueryAsync(SQL, null); + public void GetLanguageContentAsync(string language) { + this.GetLanguageContentAsync(language, null); } - public void ExeManSQLNoneQueryAsync(string SQL, object userState) { - if ((this.onBeginExeManSQLNoneQueryDelegate == null)) { - this.onBeginExeManSQLNoneQueryDelegate = new BeginOperationDelegate(this.OnBeginExeManSQLNoneQuery); + public void GetLanguageContentAsync(string language, object userState) { + if ((this.onBeginGetLanguageContentDelegate == null)) { + this.onBeginGetLanguageContentDelegate = new BeginOperationDelegate(this.OnBeginGetLanguageContent); } - if ((this.onEndExeManSQLNoneQueryDelegate == null)) { - this.onEndExeManSQLNoneQueryDelegate = new EndOperationDelegate(this.OnEndExeManSQLNoneQuery); + if ((this.onEndGetLanguageContentDelegate == null)) { + this.onEndGetLanguageContentDelegate = new EndOperationDelegate(this.OnEndGetLanguageContent); } - if ((this.onExeManSQLNoneQueryCompletedDelegate == null)) { - this.onExeManSQLNoneQueryCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnExeManSQLNoneQueryCompleted); + if ((this.onGetLanguageContentCompletedDelegate == null)) { + this.onGetLanguageContentCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetLanguageContentCompleted); } - base.InvokeAsync(this.onBeginExeManSQLNoneQueryDelegate, new object[] { - SQL}, this.onEndExeManSQLNoneQueryDelegate, this.onExeManSQLNoneQueryCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetLanguageContentDelegate, new object[] { + language}, this.onEndGetLanguageContentDelegate, this.onGetLanguageContentCompletedDelegate, userState); } - public bool GetAllManageTask(out string errtext) { - return base.Channel.GetAllManageTask(out errtext); + public wcfControlMonitorClient.WcfControlMonitor.DevicesDic GetDevicesDic(out string errorText) { + return base.Channel.GetDevicesDic(out errorText); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetAllManageTask(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetAllManageTask(callback, asyncState); + public System.IAsyncResult BeginGetDevicesDic(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetDevicesDic(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndGetAllManageTask(out string errtext, System.IAsyncResult result) { - return base.Channel.EndGetAllManageTask(out errtext, result); + public wcfControlMonitorClient.WcfControlMonitor.DevicesDic EndGetDevicesDic(out string errorText, System.IAsyncResult result) { + return base.Channel.EndGetDevicesDic(out errorText, result); } - private System.IAsyncResult OnBeginGetAllManageTask(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginGetAllManageTask(callback, asyncState); + private System.IAsyncResult OnBeginGetDevicesDic(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginGetDevicesDic(callback, asyncState); } - private object[] OnEndGetAllManageTask(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndGetAllManageTask(out errtext, result); + private object[] OnEndGetDevicesDic(System.IAsyncResult result) { + string errorText = this.GetDefaultValueForInitialization(); + wcfControlMonitorClient.WcfControlMonitor.DevicesDic retVal = this.EndGetDevicesDic(out errorText, result); return new object[] { - errtext, + errorText, retVal}; } - private void OnGetAllManageTaskCompleted(object state) { - if ((this.GetAllManageTaskCompleted != null)) { + private void OnGetDevicesDicCompleted(object state) { + if ((this.GetDevicesDicCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetAllManageTaskCompleted(this, new GetAllManageTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetDevicesDicCompleted(this, new GetDevicesDicCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetAllManageTaskAsync() { - this.GetAllManageTaskAsync(null); + public void GetDevicesDicAsync() { + this.GetDevicesDicAsync(null); } - public void GetAllManageTaskAsync(object userState) { - if ((this.onBeginGetAllManageTaskDelegate == null)) { - this.onBeginGetAllManageTaskDelegate = new BeginOperationDelegate(this.OnBeginGetAllManageTask); + public void GetDevicesDicAsync(object userState) { + if ((this.onBeginGetDevicesDicDelegate == null)) { + this.onBeginGetDevicesDicDelegate = new BeginOperationDelegate(this.OnBeginGetDevicesDic); } - if ((this.onEndGetAllManageTaskDelegate == null)) { - this.onEndGetAllManageTaskDelegate = new EndOperationDelegate(this.OnEndGetAllManageTask); + if ((this.onEndGetDevicesDicDelegate == null)) { + this.onEndGetDevicesDicDelegate = new EndOperationDelegate(this.OnEndGetDevicesDic); } - if ((this.onGetAllManageTaskCompletedDelegate == null)) { - this.onGetAllManageTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetAllManageTaskCompleted); + if ((this.onGetDevicesDicCompletedDelegate == null)) { + this.onGetDevicesDicCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDevicesDicCompleted); } - base.InvokeAsync(this.onBeginGetAllManageTaskDelegate, null, this.onEndGetAllManageTaskDelegate, this.onGetAllManageTaskCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetDevicesDicDelegate, null, this.onEndGetDevicesDicDelegate, this.onGetDevicesDicCompletedDelegate, userState); } - public bool DisassembleTask(out string errtext) { - return base.Channel.DisassembleTask(out errtext); + public bool RefreshMonitoringMode() { + return base.Channel.RefreshMonitoringMode(); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginDisassembleTask(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginDisassembleTask(callback, asyncState); + public System.IAsyncResult BeginRefreshMonitoringMode(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginRefreshMonitoringMode(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndDisassembleTask(out string errtext, System.IAsyncResult result) { - return base.Channel.EndDisassembleTask(out errtext, result); + public bool EndRefreshMonitoringMode(System.IAsyncResult result) { + return base.Channel.EndRefreshMonitoringMode(result); } - private System.IAsyncResult OnBeginDisassembleTask(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginDisassembleTask(callback, asyncState); + private System.IAsyncResult OnBeginRefreshMonitoringMode(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginRefreshMonitoringMode(callback, asyncState); } - private object[] OnEndDisassembleTask(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndDisassembleTask(out errtext, result); + private object[] OnEndRefreshMonitoringMode(System.IAsyncResult result) { + bool retVal = this.EndRefreshMonitoringMode(result); return new object[] { - errtext, retVal}; } - private void OnDisassembleTaskCompleted(object state) { - if ((this.DisassembleTaskCompleted != null)) { + private void OnRefreshMonitoringModeCompleted(object state) { + if ((this.RefreshMonitoringModeCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.DisassembleTaskCompleted(this, new DisassembleTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.RefreshMonitoringModeCompleted(this, new RefreshMonitoringModeCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void DisassembleTaskAsync() { - this.DisassembleTaskAsync(null); + public void RefreshMonitoringModeAsync() { + this.RefreshMonitoringModeAsync(null); } - public void DisassembleTaskAsync(object userState) { - if ((this.onBeginDisassembleTaskDelegate == null)) { - this.onBeginDisassembleTaskDelegate = new BeginOperationDelegate(this.OnBeginDisassembleTask); + public void RefreshMonitoringModeAsync(object userState) { + if ((this.onBeginRefreshMonitoringModeDelegate == null)) { + this.onBeginRefreshMonitoringModeDelegate = new BeginOperationDelegate(this.OnBeginRefreshMonitoringMode); } - if ((this.onEndDisassembleTaskDelegate == null)) { - this.onEndDisassembleTaskDelegate = new EndOperationDelegate(this.OnEndDisassembleTask); + if ((this.onEndRefreshMonitoringModeDelegate == null)) { + this.onEndRefreshMonitoringModeDelegate = new EndOperationDelegate(this.OnEndRefreshMonitoringMode); } - if ((this.onDisassembleTaskCompletedDelegate == null)) { - this.onDisassembleTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnDisassembleTaskCompleted); + if ((this.onRefreshMonitoringModeCompletedDelegate == null)) { + this.onRefreshMonitoringModeCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnRefreshMonitoringModeCompleted); } - base.InvokeAsync(this.onBeginDisassembleTaskDelegate, null, this.onEndDisassembleTaskDelegate, this.onDisassembleTaskCompletedDelegate, userState); + base.InvokeAsync(this.onBeginRefreshMonitoringModeDelegate, null, this.onEndRefreshMonitoringModeDelegate, this.onRefreshMonitoringModeCompletedDelegate, userState); } - public bool SetLogicHaveGoods(out string errtext, bool ifHaveGoods, int deviceindex) { - return base.Channel.SetLogicHaveGoods(out errtext, ifHaveGoods, deviceindex); + public bool RegisterClient(out string errText, string userID, string userDescription) { + return base.Channel.RegisterClient(out errText, userID, userDescription); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetLogicHaveGoods(bool ifHaveGoods, int deviceindex, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetLogicHaveGoods(ifHaveGoods, deviceindex, callback, asyncState); + public System.IAsyncResult BeginRegisterClient(string userID, string userDescription, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginRegisterClient(userID, userDescription, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetLogicHaveGoods(out string errtext, System.IAsyncResult result) { - return base.Channel.EndSetLogicHaveGoods(out errtext, result); + public bool EndRegisterClient(out string errText, System.IAsyncResult result) { + return base.Channel.EndRegisterClient(out errText, result); } - private System.IAsyncResult OnBeginSetLogicHaveGoods(object[] inValues, System.AsyncCallback callback, object asyncState) { - bool ifHaveGoods = ((bool)(inValues[0])); - int deviceindex = ((int)(inValues[1])); - return this.BeginSetLogicHaveGoods(ifHaveGoods, deviceindex, callback, asyncState); + private System.IAsyncResult OnBeginRegisterClient(object[] inValues, System.AsyncCallback callback, object asyncState) { + string userID = ((string)(inValues[0])); + string userDescription = ((string)(inValues[1])); + return this.BeginRegisterClient(userID, userDescription, callback, asyncState); } - private object[] OnEndSetLogicHaveGoods(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetLogicHaveGoods(out errtext, result); + private object[] OnEndRegisterClient(System.IAsyncResult result) { + string errText = this.GetDefaultValueForInitialization(); + bool retVal = this.EndRegisterClient(out errText, result); return new object[] { - errtext, + errText, retVal}; } - private void OnSetLogicHaveGoodsCompleted(object state) { - if ((this.SetLogicHaveGoodsCompleted != null)) { + private void OnRegisterClientCompleted(object state) { + if ((this.RegisterClientCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetLogicHaveGoodsCompleted(this, new SetLogicHaveGoodsCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.RegisterClientCompleted(this, new RegisterClientCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetLogicHaveGoodsAsync(bool ifHaveGoods, int deviceindex) { - this.SetLogicHaveGoodsAsync(ifHaveGoods, deviceindex, null); + public void RegisterClientAsync(string userID, string userDescription) { + this.RegisterClientAsync(userID, userDescription, null); } - public void SetLogicHaveGoodsAsync(bool ifHaveGoods, int deviceindex, object userState) { - if ((this.onBeginSetLogicHaveGoodsDelegate == null)) { - this.onBeginSetLogicHaveGoodsDelegate = new BeginOperationDelegate(this.OnBeginSetLogicHaveGoods); + public void RegisterClientAsync(string userID, string userDescription, object userState) { + if ((this.onBeginRegisterClientDelegate == null)) { + this.onBeginRegisterClientDelegate = new BeginOperationDelegate(this.OnBeginRegisterClient); } - if ((this.onEndSetLogicHaveGoodsDelegate == null)) { - this.onEndSetLogicHaveGoodsDelegate = new EndOperationDelegate(this.OnEndSetLogicHaveGoods); + if ((this.onEndRegisterClientDelegate == null)) { + this.onEndRegisterClientDelegate = new EndOperationDelegate(this.OnEndRegisterClient); } - if ((this.onSetLogicHaveGoodsCompletedDelegate == null)) { - this.onSetLogicHaveGoodsCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetLogicHaveGoodsCompleted); + if ((this.onRegisterClientCompletedDelegate == null)) { + this.onRegisterClientCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnRegisterClientCompleted); } - base.InvokeAsync(this.onBeginSetLogicHaveGoodsDelegate, new object[] { - ifHaveGoods, - deviceindex}, this.onEndSetLogicHaveGoodsDelegate, this.onSetLogicHaveGoodsCompletedDelegate, userState); + base.InvokeAsync(this.onBeginRegisterClientDelegate, new object[] { + userID, + userDescription}, this.onEndRegisterClientDelegate, this.onRegisterClientCompletedDelegate, userState); } - public bool DealWithDeviceState(out string errtext, int deviceindex, byte[] splitbyteValue, byte[] devicestates) { - return base.Channel.DealWithDeviceState(out errtext, deviceindex, splitbyteValue, devicestates); + public bool LogoutClient(out string errText, string userID) { + return base.Channel.LogoutClient(out errText, userID); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginDealWithDeviceState(int deviceindex, byte[] splitbyteValue, byte[] devicestates, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginDealWithDeviceState(deviceindex, splitbyteValue, devicestates, callback, asyncState); + public System.IAsyncResult BeginLogoutClient(string userID, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginLogoutClient(userID, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndDealWithDeviceState(out string errtext, System.IAsyncResult result) { - return base.Channel.EndDealWithDeviceState(out errtext, result); + public bool EndLogoutClient(out string errText, System.IAsyncResult result) { + return base.Channel.EndLogoutClient(out errText, result); } - private System.IAsyncResult OnBeginDealWithDeviceState(object[] inValues, System.AsyncCallback callback, object asyncState) { - int deviceindex = ((int)(inValues[0])); - byte[] splitbyteValue = ((byte[])(inValues[1])); - byte[] devicestates = ((byte[])(inValues[2])); - return this.BeginDealWithDeviceState(deviceindex, splitbyteValue, devicestates, callback, asyncState); + private System.IAsyncResult OnBeginLogoutClient(object[] inValues, System.AsyncCallback callback, object asyncState) { + string userID = ((string)(inValues[0])); + return this.BeginLogoutClient(userID, callback, asyncState); } - private object[] OnEndDealWithDeviceState(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndDealWithDeviceState(out errtext, result); + private object[] OnEndLogoutClient(System.IAsyncResult result) { + string errText = this.GetDefaultValueForInitialization(); + bool retVal = this.EndLogoutClient(out errText, result); return new object[] { - errtext, + errText, retVal}; } - private void OnDealWithDeviceStateCompleted(object state) { - if ((this.DealWithDeviceStateCompleted != null)) { + private void OnLogoutClientCompleted(object state) { + if ((this.LogoutClientCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.DealWithDeviceStateCompleted(this, new DealWithDeviceStateCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.LogoutClientCompleted(this, new LogoutClientCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void DealWithDeviceStateAsync(int deviceindex, byte[] splitbyteValue, byte[] devicestates) { - this.DealWithDeviceStateAsync(deviceindex, splitbyteValue, devicestates, null); + public void LogoutClientAsync(string userID) { + this.LogoutClientAsync(userID, null); } - public void DealWithDeviceStateAsync(int deviceindex, byte[] splitbyteValue, byte[] devicestates, object userState) { - if ((this.onBeginDealWithDeviceStateDelegate == null)) { - this.onBeginDealWithDeviceStateDelegate = new BeginOperationDelegate(this.OnBeginDealWithDeviceState); + public void LogoutClientAsync(string userID, object userState) { + if ((this.onBeginLogoutClientDelegate == null)) { + this.onBeginLogoutClientDelegate = new BeginOperationDelegate(this.OnBeginLogoutClient); } - if ((this.onEndDealWithDeviceStateDelegate == null)) { - this.onEndDealWithDeviceStateDelegate = new EndOperationDelegate(this.OnEndDealWithDeviceState); + if ((this.onEndLogoutClientDelegate == null)) { + this.onEndLogoutClientDelegate = new EndOperationDelegate(this.OnEndLogoutClient); } - if ((this.onDealWithDeviceStateCompletedDelegate == null)) { - this.onDealWithDeviceStateCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnDealWithDeviceStateCompleted); + if ((this.onLogoutClientCompletedDelegate == null)) { + this.onLogoutClientCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnLogoutClientCompleted); } - base.InvokeAsync(this.onBeginDealWithDeviceStateDelegate, new object[] { - deviceindex, - splitbyteValue, - devicestates}, this.onEndDealWithDeviceStateDelegate, this.onDealWithDeviceStateCompletedDelegate, userState); + base.InvokeAsync(this.onBeginLogoutClientDelegate, new object[] { + userID}, this.onEndLogoutClientDelegate, this.onLogoutClientCompletedDelegate, userState); } - public Model.MDevice SendAllDeviceStates(int device) { - return base.Channel.SendAllDeviceStates(device); + public bool ObtainTask(string laneway, string Order) { + return base.Channel.ObtainTask(laneway, Order); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSendAllDeviceStates(int device, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSendAllDeviceStates(device, callback, asyncState); + public System.IAsyncResult BeginObtainTask(string laneway, string Order, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginObtainTask(laneway, Order, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public Model.MDevice EndSendAllDeviceStates(System.IAsyncResult result) { - return base.Channel.EndSendAllDeviceStates(result); + public bool EndObtainTask(System.IAsyncResult result) { + return base.Channel.EndObtainTask(result); } - private System.IAsyncResult OnBeginSendAllDeviceStates(object[] inValues, System.AsyncCallback callback, object asyncState) { - int device = ((int)(inValues[0])); - return this.BeginSendAllDeviceStates(device, callback, asyncState); + private System.IAsyncResult OnBeginObtainTask(object[] inValues, System.AsyncCallback callback, object asyncState) { + string laneway = ((string)(inValues[0])); + string Order = ((string)(inValues[1])); + return this.BeginObtainTask(laneway, Order, callback, asyncState); } - private object[] OnEndSendAllDeviceStates(System.IAsyncResult result) { - Model.MDevice retVal = this.EndSendAllDeviceStates(result); + private object[] OnEndObtainTask(System.IAsyncResult result) { + bool retVal = this.EndObtainTask(result); return new object[] { retVal}; } - private void OnSendAllDeviceStatesCompleted(object state) { - if ((this.SendAllDeviceStatesCompleted != null)) { + private void OnObtainTaskCompleted(object state) { + if ((this.ObtainTaskCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SendAllDeviceStatesCompleted(this, new SendAllDeviceStatesCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.ObtainTaskCompleted(this, new ObtainTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SendAllDeviceStatesAsync(int device) { - this.SendAllDeviceStatesAsync(device, null); + public void ObtainTaskAsync(string laneway, string Order) { + this.ObtainTaskAsync(laneway, Order, null); } - public void SendAllDeviceStatesAsync(int device, object userState) { - if ((this.onBeginSendAllDeviceStatesDelegate == null)) { - this.onBeginSendAllDeviceStatesDelegate = new BeginOperationDelegate(this.OnBeginSendAllDeviceStates); + public void ObtainTaskAsync(string laneway, string Order, object userState) { + if ((this.onBeginObtainTaskDelegate == null)) { + this.onBeginObtainTaskDelegate = new BeginOperationDelegate(this.OnBeginObtainTask); } - if ((this.onEndSendAllDeviceStatesDelegate == null)) { - this.onEndSendAllDeviceStatesDelegate = new EndOperationDelegate(this.OnEndSendAllDeviceStates); + if ((this.onEndObtainTaskDelegate == null)) { + this.onEndObtainTaskDelegate = new EndOperationDelegate(this.OnEndObtainTask); } - if ((this.onSendAllDeviceStatesCompletedDelegate == null)) { - this.onSendAllDeviceStatesCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSendAllDeviceStatesCompleted); + if ((this.onObtainTaskCompletedDelegate == null)) { + this.onObtainTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnObtainTaskCompleted); } - base.InvokeAsync(this.onBeginSendAllDeviceStatesDelegate, new object[] { - device}, this.onEndSendAllDeviceStatesDelegate, this.onSendAllDeviceStatesCompletedDelegate, userState); + base.InvokeAsync(this.onBeginObtainTaskDelegate, new object[] { + laneway, + Order}, this.onEndObtainTaskDelegate, this.onObtainTaskCompletedDelegate, userState); } - public bool WriteDBData(out string errtext, int deviceIndex, string DBBlock, string Wdata) { - return base.Channel.WriteDBData(out errtext, deviceIndex, DBBlock, Wdata); + public bool StopObtainTask() { + return base.Channel.StopObtainTask(); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginWriteDBData(int deviceIndex, string DBBlock, string Wdata, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginWriteDBData(deviceIndex, DBBlock, Wdata, callback, asyncState); + public System.IAsyncResult BeginStopObtainTask(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginStopObtainTask(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndWriteDBData(out string errtext, System.IAsyncResult result) { - return base.Channel.EndWriteDBData(out errtext, result); + public bool EndStopObtainTask(System.IAsyncResult result) { + return base.Channel.EndStopObtainTask(result); } - private System.IAsyncResult OnBeginWriteDBData(object[] inValues, System.AsyncCallback callback, object asyncState) { - int deviceIndex = ((int)(inValues[0])); - string DBBlock = ((string)(inValues[1])); - string Wdata = ((string)(inValues[2])); - return this.BeginWriteDBData(deviceIndex, DBBlock, Wdata, callback, asyncState); + private System.IAsyncResult OnBeginStopObtainTask(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginStopObtainTask(callback, asyncState); } - private object[] OnEndWriteDBData(System.IAsyncResult result) { - string errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndWriteDBData(out errtext, result); + private object[] OnEndStopObtainTask(System.IAsyncResult result) { + bool retVal = this.EndStopObtainTask(result); return new object[] { - errtext, retVal}; } - private void OnWriteDBDataCompleted(object state) { - if ((this.WriteDBDataCompleted != null)) { + private void OnStopObtainTaskCompleted(object state) { + if ((this.StopObtainTaskCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.WriteDBDataCompleted(this, new WriteDBDataCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.StopObtainTaskCompleted(this, new StopObtainTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void WriteDBDataAsync(int deviceIndex, string DBBlock, string Wdata) { - this.WriteDBDataAsync(deviceIndex, DBBlock, Wdata, null); + public void StopObtainTaskAsync() { + this.StopObtainTaskAsync(null); } - public void WriteDBDataAsync(int deviceIndex, string DBBlock, string Wdata, object userState) { - if ((this.onBeginWriteDBDataDelegate == null)) { - this.onBeginWriteDBDataDelegate = new BeginOperationDelegate(this.OnBeginWriteDBData); + public void StopObtainTaskAsync(object userState) { + if ((this.onBeginStopObtainTaskDelegate == null)) { + this.onBeginStopObtainTaskDelegate = new BeginOperationDelegate(this.OnBeginStopObtainTask); } - if ((this.onEndWriteDBDataDelegate == null)) { - this.onEndWriteDBDataDelegate = new EndOperationDelegate(this.OnEndWriteDBData); + if ((this.onEndStopObtainTaskDelegate == null)) { + this.onEndStopObtainTaskDelegate = new EndOperationDelegate(this.OnEndStopObtainTask); } - if ((this.onWriteDBDataCompletedDelegate == null)) { - this.onWriteDBDataCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnWriteDBDataCompleted); + if ((this.onStopObtainTaskCompletedDelegate == null)) { + this.onStopObtainTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnStopObtainTaskCompleted); } - base.InvokeAsync(this.onBeginWriteDBDataDelegate, new object[] { - deviceIndex, - DBBlock, - Wdata}, this.onEndWriteDBDataDelegate, this.onWriteDBDataCompletedDelegate, userState); + base.InvokeAsync(this.onBeginStopObtainTaskDelegate, null, this.onEndStopObtainTaskDelegate, this.onStopObtainTaskCompletedDelegate, userState); } - public bool ReConnectOPCServer() { - return base.Channel.ReConnectOPCServer(); + public bool OrderTurnOn() { + return base.Channel.OrderTurnOn(); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginReConnectOPCServer(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginReConnectOPCServer(callback, asyncState); + public System.IAsyncResult BeginOrderTurnOn(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginOrderTurnOn(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndReConnectOPCServer(System.IAsyncResult result) { - return base.Channel.EndReConnectOPCServer(result); + public bool EndOrderTurnOn(System.IAsyncResult result) { + return base.Channel.EndOrderTurnOn(result); } - private System.IAsyncResult OnBeginReConnectOPCServer(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginReConnectOPCServer(callback, asyncState); + private System.IAsyncResult OnBeginOrderTurnOn(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginOrderTurnOn(callback, asyncState); } - private object[] OnEndReConnectOPCServer(System.IAsyncResult result) { - bool retVal = this.EndReConnectOPCServer(result); + private object[] OnEndOrderTurnOn(System.IAsyncResult result) { + bool retVal = this.EndOrderTurnOn(result); return new object[] { retVal}; } - private void OnReConnectOPCServerCompleted(object state) { - if ((this.ReConnectOPCServerCompleted != null)) { + private void OnOrderTurnOnCompleted(object state) { + if ((this.OrderTurnOnCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.ReConnectOPCServerCompleted(this, new ReConnectOPCServerCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.OrderTurnOnCompleted(this, new OrderTurnOnCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void ReConnectOPCServerAsync() { - this.ReConnectOPCServerAsync(null); + public void OrderTurnOnAsync() { + this.OrderTurnOnAsync(null); } - public void ReConnectOPCServerAsync(object userState) { - if ((this.onBeginReConnectOPCServerDelegate == null)) { - this.onBeginReConnectOPCServerDelegate = new BeginOperationDelegate(this.OnBeginReConnectOPCServer); + public void OrderTurnOnAsync(object userState) { + if ((this.onBeginOrderTurnOnDelegate == null)) { + this.onBeginOrderTurnOnDelegate = new BeginOperationDelegate(this.OnBeginOrderTurnOn); } - if ((this.onEndReConnectOPCServerDelegate == null)) { - this.onEndReConnectOPCServerDelegate = new EndOperationDelegate(this.OnEndReConnectOPCServer); + if ((this.onEndOrderTurnOnDelegate == null)) { + this.onEndOrderTurnOnDelegate = new EndOperationDelegate(this.OnEndOrderTurnOn); } - if ((this.onReConnectOPCServerCompletedDelegate == null)) { - this.onReConnectOPCServerCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnReConnectOPCServerCompleted); + if ((this.onOrderTurnOnCompletedDelegate == null)) { + this.onOrderTurnOnCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOrderTurnOnCompleted); } - base.InvokeAsync(this.onBeginReConnectOPCServerDelegate, null, this.onEndReConnectOPCServerDelegate, this.onReConnectOPCServerCompletedDelegate, userState); + base.InvokeAsync(this.onBeginOrderTurnOnDelegate, null, this.onEndOrderTurnOnDelegate, this.onOrderTurnOnCompletedDelegate, userState); } - public bool BuildAutoTask(out string Errtext, Model.AutoTask Autotask) { - return base.Channel.BuildAutoTask(out Errtext, Autotask); + public bool OrderTurnOff() { + return base.Channel.OrderTurnOff(); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginBuildAutoTask(Model.AutoTask Autotask, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginBuildAutoTask(Autotask, callback, asyncState); + public System.IAsyncResult BeginOrderTurnOff(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginOrderTurnOff(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndBuildAutoTask(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndBuildAutoTask(out Errtext, result); + public bool EndOrderTurnOff(System.IAsyncResult result) { + return base.Channel.EndOrderTurnOff(result); } - private System.IAsyncResult OnBeginBuildAutoTask(object[] inValues, System.AsyncCallback callback, object asyncState) { - Model.AutoTask Autotask = ((Model.AutoTask)(inValues[0])); - return this.BeginBuildAutoTask(Autotask, callback, asyncState); + private System.IAsyncResult OnBeginOrderTurnOff(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginOrderTurnOff(callback, asyncState); } - private object[] OnEndBuildAutoTask(System.IAsyncResult result) { - string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndBuildAutoTask(out Errtext, result); + private object[] OnEndOrderTurnOff(System.IAsyncResult result) { + bool retVal = this.EndOrderTurnOff(result); return new object[] { - Errtext, retVal}; } - private void OnBuildAutoTaskCompleted(object state) { - if ((this.BuildAutoTaskCompleted != null)) { + private void OnOrderTurnOffCompleted(object state) { + if ((this.OrderTurnOffCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.BuildAutoTaskCompleted(this, new BuildAutoTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.OrderTurnOffCompleted(this, new OrderTurnOffCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void BuildAutoTaskAsync(Model.AutoTask Autotask) { - this.BuildAutoTaskAsync(Autotask, null); + public void OrderTurnOffAsync() { + this.OrderTurnOffAsync(null); } - public void BuildAutoTaskAsync(Model.AutoTask Autotask, object userState) { - if ((this.onBeginBuildAutoTaskDelegate == null)) { - this.onBeginBuildAutoTaskDelegate = new BeginOperationDelegate(this.OnBeginBuildAutoTask); + public void OrderTurnOffAsync(object userState) { + if ((this.onBeginOrderTurnOffDelegate == null)) { + this.onBeginOrderTurnOffDelegate = new BeginOperationDelegate(this.OnBeginOrderTurnOff); } - if ((this.onEndBuildAutoTaskDelegate == null)) { - this.onEndBuildAutoTaskDelegate = new EndOperationDelegate(this.OnEndBuildAutoTask); + if ((this.onEndOrderTurnOffDelegate == null)) { + this.onEndOrderTurnOffDelegate = new EndOperationDelegate(this.OnEndOrderTurnOff); } - if ((this.onBuildAutoTaskCompletedDelegate == null)) { - this.onBuildAutoTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnBuildAutoTaskCompleted); + if ((this.onOrderTurnOffCompletedDelegate == null)) { + this.onOrderTurnOffCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOrderTurnOffCompleted); } - base.InvokeAsync(this.onBeginBuildAutoTaskDelegate, new object[] { - Autotask}, this.onEndBuildAutoTaskDelegate, this.onBuildAutoTaskCompletedDelegate, userState); + base.InvokeAsync(this.onBeginOrderTurnOffDelegate, null, this.onEndOrderTurnOffDelegate, this.onOrderTurnOffCompletedDelegate, userState); } - public bool ModifyManageTask(out string Errtext, int ManKind, int ManagetaskID, int ActionID) { - return base.Channel.ModifyManageTask(out Errtext, ManKind, ManagetaskID, ActionID); + public bool DeviceCommunicationInit(out string ErrText, string CommunicationType) { + return base.Channel.DeviceCommunicationInit(out ErrText, CommunicationType); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginModifyManageTask(int ManKind, int ManagetaskID, int ActionID, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginModifyManageTask(ManKind, ManagetaskID, ActionID, callback, asyncState); + public System.IAsyncResult BeginDeviceCommunicationInit(string CommunicationType, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginDeviceCommunicationInit(CommunicationType, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndModifyManageTask(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndModifyManageTask(out Errtext, result); + public bool EndDeviceCommunicationInit(out string ErrText, System.IAsyncResult result) { + return base.Channel.EndDeviceCommunicationInit(out ErrText, result); } - private System.IAsyncResult OnBeginModifyManageTask(object[] inValues, System.AsyncCallback callback, object asyncState) { - int ManKind = ((int)(inValues[0])); - int ManagetaskID = ((int)(inValues[1])); - int ActionID = ((int)(inValues[2])); - return this.BeginModifyManageTask(ManKind, ManagetaskID, ActionID, callback, asyncState); + private System.IAsyncResult OnBeginDeviceCommunicationInit(object[] inValues, System.AsyncCallback callback, object asyncState) { + string CommunicationType = ((string)(inValues[0])); + return this.BeginDeviceCommunicationInit(CommunicationType, callback, asyncState); } - private object[] OnEndModifyManageTask(System.IAsyncResult result) { - string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndModifyManageTask(out Errtext, result); + private object[] OnEndDeviceCommunicationInit(System.IAsyncResult result) { + string ErrText = this.GetDefaultValueForInitialization(); + bool retVal = this.EndDeviceCommunicationInit(out ErrText, result); return new object[] { - Errtext, + ErrText, retVal}; } - private void OnModifyManageTaskCompleted(object state) { - if ((this.ModifyManageTaskCompleted != null)) { + private void OnDeviceCommunicationInitCompleted(object state) { + if ((this.DeviceCommunicationInitCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.ModifyManageTaskCompleted(this, new ModifyManageTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.DeviceCommunicationInitCompleted(this, new DeviceCommunicationInitCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void ModifyManageTaskAsync(int ManKind, int ManagetaskID, int ActionID) { - this.ModifyManageTaskAsync(ManKind, ManagetaskID, ActionID, null); + public void DeviceCommunicationInitAsync(string CommunicationType) { + this.DeviceCommunicationInitAsync(CommunicationType, null); } - public void ModifyManageTaskAsync(int ManKind, int ManagetaskID, int ActionID, object userState) { - if ((this.onBeginModifyManageTaskDelegate == null)) { - this.onBeginModifyManageTaskDelegate = new BeginOperationDelegate(this.OnBeginModifyManageTask); + public void DeviceCommunicationInitAsync(string CommunicationType, object userState) { + if ((this.onBeginDeviceCommunicationInitDelegate == null)) { + this.onBeginDeviceCommunicationInitDelegate = new BeginOperationDelegate(this.OnBeginDeviceCommunicationInit); } - if ((this.onEndModifyManageTaskDelegate == null)) { - this.onEndModifyManageTaskDelegate = new EndOperationDelegate(this.OnEndModifyManageTask); + if ((this.onEndDeviceCommunicationInitDelegate == null)) { + this.onEndDeviceCommunicationInitDelegate = new EndOperationDelegate(this.OnEndDeviceCommunicationInit); } - if ((this.onModifyManageTaskCompletedDelegate == null)) { - this.onModifyManageTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnModifyManageTaskCompleted); + if ((this.onDeviceCommunicationInitCompletedDelegate == null)) { + this.onDeviceCommunicationInitCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnDeviceCommunicationInitCompleted); } - base.InvokeAsync(this.onBeginModifyManageTaskDelegate, new object[] { - ManKind, - ManagetaskID, - ActionID}, this.onEndModifyManageTaskDelegate, this.onModifyManageTaskCompletedDelegate, userState); + base.InvokeAsync(this.onBeginDeviceCommunicationInitDelegate, new object[] { + CommunicationType}, this.onEndDeviceCommunicationInitDelegate, this.onDeviceCommunicationInitCompletedDelegate, userState); } - public bool ModifyMonitorTask(out string Errtext, int DeviceIndex, int MonitortaskID, int ActionID) { - return base.Channel.ModifyMonitorTask(out Errtext, DeviceIndex, MonitortaskID, ActionID); + public System.Data.DataTable GetUsers(out string Errtext) { + return base.Channel.GetUsers(out Errtext); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginModifyMonitorTask(int DeviceIndex, int MonitortaskID, int ActionID, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginModifyMonitorTask(DeviceIndex, MonitortaskID, ActionID, callback, asyncState); + public System.IAsyncResult BeginGetUsers(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetUsers(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndModifyMonitorTask(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndModifyMonitorTask(out Errtext, result); + public System.Data.DataTable EndGetUsers(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndGetUsers(out Errtext, result); } - private System.IAsyncResult OnBeginModifyMonitorTask(object[] inValues, System.AsyncCallback callback, object asyncState) { - int DeviceIndex = ((int)(inValues[0])); - int MonitortaskID = ((int)(inValues[1])); - int ActionID = ((int)(inValues[2])); - return this.BeginModifyMonitorTask(DeviceIndex, MonitortaskID, ActionID, callback, asyncState); + private System.IAsyncResult OnBeginGetUsers(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginGetUsers(callback, asyncState); } - private object[] OnEndModifyMonitorTask(System.IAsyncResult result) { + private object[] OnEndGetUsers(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndModifyMonitorTask(out Errtext, result); + System.Data.DataTable retVal = this.EndGetUsers(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnModifyMonitorTaskCompleted(object state) { - if ((this.ModifyMonitorTaskCompleted != null)) { + private void OnGetUsersCompleted(object state) { + if ((this.GetUsersCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.ModifyMonitorTaskCompleted(this, new ModifyMonitorTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetUsersCompleted(this, new GetUsersCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void ModifyMonitorTaskAsync(int DeviceIndex, int MonitortaskID, int ActionID) { - this.ModifyMonitorTaskAsync(DeviceIndex, MonitortaskID, ActionID, null); + public void GetUsersAsync() { + this.GetUsersAsync(null); } - public void ModifyMonitorTaskAsync(int DeviceIndex, int MonitortaskID, int ActionID, object userState) { - if ((this.onBeginModifyMonitorTaskDelegate == null)) { - this.onBeginModifyMonitorTaskDelegate = new BeginOperationDelegate(this.OnBeginModifyMonitorTask); + public void GetUsersAsync(object userState) { + if ((this.onBeginGetUsersDelegate == null)) { + this.onBeginGetUsersDelegate = new BeginOperationDelegate(this.OnBeginGetUsers); } - if ((this.onEndModifyMonitorTaskDelegate == null)) { - this.onEndModifyMonitorTaskDelegate = new EndOperationDelegate(this.OnEndModifyMonitorTask); + if ((this.onEndGetUsersDelegate == null)) { + this.onEndGetUsersDelegate = new EndOperationDelegate(this.OnEndGetUsers); } - if ((this.onModifyMonitorTaskCompletedDelegate == null)) { - this.onModifyMonitorTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnModifyMonitorTaskCompleted); + if ((this.onGetUsersCompletedDelegate == null)) { + this.onGetUsersCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetUsersCompleted); } - base.InvokeAsync(this.onBeginModifyMonitorTaskDelegate, new object[] { - DeviceIndex, - MonitortaskID, - ActionID}, this.onEndModifyMonitorTaskDelegate, this.onModifyMonitorTaskCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetUsersDelegate, null, this.onEndGetUsersDelegate, this.onGetUsersCompletedDelegate, userState); } - public bool ModifyManageTaskFork(out string Errtext, int Flag, int FarForkTaskID, int NearForkTaskID) { - return base.Channel.ModifyManageTaskFork(out Errtext, Flag, FarForkTaskID, NearForkTaskID); + public bool BuildHandTask(out string Errtext, Model.HandTask Handtask) { + return base.Channel.BuildHandTask(out Errtext, Handtask); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginModifyManageTaskFork(int Flag, int FarForkTaskID, int NearForkTaskID, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginModifyManageTaskFork(Flag, FarForkTaskID, NearForkTaskID, callback, asyncState); + public System.IAsyncResult BeginBuildHandTask(Model.HandTask Handtask, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginBuildHandTask(Handtask, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndModifyManageTaskFork(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndModifyManageTaskFork(out Errtext, result); + public bool EndBuildHandTask(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndBuildHandTask(out Errtext, result); } - private System.IAsyncResult OnBeginModifyManageTaskFork(object[] inValues, System.AsyncCallback callback, object asyncState) { - int Flag = ((int)(inValues[0])); - int FarForkTaskID = ((int)(inValues[1])); - int NearForkTaskID = ((int)(inValues[2])); - return this.BeginModifyManageTaskFork(Flag, FarForkTaskID, NearForkTaskID, callback, asyncState); + private System.IAsyncResult OnBeginBuildHandTask(object[] inValues, System.AsyncCallback callback, object asyncState) { + Model.HandTask Handtask = ((Model.HandTask)(inValues[0])); + return this.BeginBuildHandTask(Handtask, callback, asyncState); } - private object[] OnEndModifyManageTaskFork(System.IAsyncResult result) { + private object[] OnEndBuildHandTask(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndModifyManageTaskFork(out Errtext, result); + bool retVal = this.EndBuildHandTask(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnModifyManageTaskForkCompleted(object state) { - if ((this.ModifyManageTaskForkCompleted != null)) { + private void OnBuildHandTaskCompleted(object state) { + if ((this.BuildHandTaskCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.ModifyManageTaskForkCompleted(this, new ModifyManageTaskForkCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.BuildHandTaskCompleted(this, new BuildHandTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void ModifyManageTaskForkAsync(int Flag, int FarForkTaskID, int NearForkTaskID) { - this.ModifyManageTaskForkAsync(Flag, FarForkTaskID, NearForkTaskID, null); + public void BuildHandTaskAsync(Model.HandTask Handtask) { + this.BuildHandTaskAsync(Handtask, null); } - public void ModifyManageTaskForkAsync(int Flag, int FarForkTaskID, int NearForkTaskID, object userState) { - if ((this.onBeginModifyManageTaskForkDelegate == null)) { - this.onBeginModifyManageTaskForkDelegate = new BeginOperationDelegate(this.OnBeginModifyManageTaskFork); + public void BuildHandTaskAsync(Model.HandTask Handtask, object userState) { + if ((this.onBeginBuildHandTaskDelegate == null)) { + this.onBeginBuildHandTaskDelegate = new BeginOperationDelegate(this.OnBeginBuildHandTask); } - if ((this.onEndModifyManageTaskForkDelegate == null)) { - this.onEndModifyManageTaskForkDelegate = new EndOperationDelegate(this.OnEndModifyManageTaskFork); + if ((this.onEndBuildHandTaskDelegate == null)) { + this.onEndBuildHandTaskDelegate = new EndOperationDelegate(this.OnEndBuildHandTask); } - if ((this.onModifyManageTaskForkCompletedDelegate == null)) { - this.onModifyManageTaskForkCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnModifyManageTaskForkCompleted); + if ((this.onBuildHandTaskCompletedDelegate == null)) { + this.onBuildHandTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnBuildHandTaskCompleted); } - base.InvokeAsync(this.onBeginModifyManageTaskForkDelegate, new object[] { - Flag, - FarForkTaskID, - NearForkTaskID}, this.onEndModifyManageTaskForkDelegate, this.onModifyManageTaskForkCompletedDelegate, userState); + base.InvokeAsync(this.onBeginBuildHandTaskDelegate, new object[] { + Handtask}, this.onEndBuildHandTaskDelegate, this.onBuildHandTaskCompletedDelegate, userState); } - public bool SetDeviceState(out string Errtext, Model.MDevice Devinfo) { - return base.Channel.SetDeviceState(out Errtext, Devinfo); + public bool BuildHandAssociateTask(out string Errtext, int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName) { + return base.Channel.BuildHandAssociateTask(out Errtext, ConveyorIndex, ConveyorOrder, RgvIndex, RgvOrder, RgvOrderName); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetDeviceState(Model.MDevice Devinfo, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetDeviceState(Devinfo, callback, asyncState); + public System.IAsyncResult BeginBuildHandAssociateTask(int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginBuildHandAssociateTask(ConveyorIndex, ConveyorOrder, RgvIndex, RgvOrder, RgvOrderName, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetDeviceState(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndSetDeviceState(out Errtext, result); + public bool EndBuildHandAssociateTask(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndBuildHandAssociateTask(out Errtext, result); } - private System.IAsyncResult OnBeginSetDeviceState(object[] inValues, System.AsyncCallback callback, object asyncState) { - Model.MDevice Devinfo = ((Model.MDevice)(inValues[0])); - return this.BeginSetDeviceState(Devinfo, callback, asyncState); + private System.IAsyncResult OnBeginBuildHandAssociateTask(object[] inValues, System.AsyncCallback callback, object asyncState) { + int ConveyorIndex = ((int)(inValues[0])); + int ConveyorOrder = ((int)(inValues[1])); + int RgvIndex = ((int)(inValues[2])); + int RgvOrder = ((int)(inValues[3])); + string RgvOrderName = ((string)(inValues[4])); + return this.BeginBuildHandAssociateTask(ConveyorIndex, ConveyorOrder, RgvIndex, RgvOrder, RgvOrderName, callback, asyncState); } - private object[] OnEndSetDeviceState(System.IAsyncResult result) { + private object[] OnEndBuildHandAssociateTask(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetDeviceState(out Errtext, result); + bool retVal = this.EndBuildHandAssociateTask(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnSetDeviceStateCompleted(object state) { - if ((this.SetDeviceStateCompleted != null)) { + private void OnBuildHandAssociateTaskCompleted(object state) { + if ((this.BuildHandAssociateTaskCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetDeviceStateCompleted(this, new SetDeviceStateCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.BuildHandAssociateTaskCompleted(this, new BuildHandAssociateTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetDeviceStateAsync(Model.MDevice Devinfo) { - this.SetDeviceStateAsync(Devinfo, null); + public void BuildHandAssociateTaskAsync(int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName) { + this.BuildHandAssociateTaskAsync(ConveyorIndex, ConveyorOrder, RgvIndex, RgvOrder, RgvOrderName, null); } - public void SetDeviceStateAsync(Model.MDevice Devinfo, object userState) { - if ((this.onBeginSetDeviceStateDelegate == null)) { - this.onBeginSetDeviceStateDelegate = new BeginOperationDelegate(this.OnBeginSetDeviceState); + public void BuildHandAssociateTaskAsync(int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName, object userState) { + if ((this.onBeginBuildHandAssociateTaskDelegate == null)) { + this.onBeginBuildHandAssociateTaskDelegate = new BeginOperationDelegate(this.OnBeginBuildHandAssociateTask); } - if ((this.onEndSetDeviceStateDelegate == null)) { - this.onEndSetDeviceStateDelegate = new EndOperationDelegate(this.OnEndSetDeviceState); + if ((this.onEndBuildHandAssociateTaskDelegate == null)) { + this.onEndBuildHandAssociateTaskDelegate = new EndOperationDelegate(this.OnEndBuildHandAssociateTask); } - if ((this.onSetDeviceStateCompletedDelegate == null)) { - this.onSetDeviceStateCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetDeviceStateCompleted); + if ((this.onBuildHandAssociateTaskCompletedDelegate == null)) { + this.onBuildHandAssociateTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnBuildHandAssociateTaskCompleted); } - base.InvokeAsync(this.onBeginSetDeviceStateDelegate, new object[] { - Devinfo}, this.onEndSetDeviceStateDelegate, this.onSetDeviceStateCompletedDelegate, userState); + base.InvokeAsync(this.onBeginBuildHandAssociateTaskDelegate, new object[] { + ConveyorIndex, + ConveyorOrder, + RgvIndex, + RgvOrder, + RgvOrderName}, this.onEndBuildHandAssociateTaskDelegate, this.onBuildHandAssociateTaskCompletedDelegate, userState); } - public Model.MDevice GetDeviceInfo(out string Errtext, int Deviceindex) { - return base.Channel.GetDeviceInfo(out Errtext, Deviceindex); + public bool BuildAutoTask(out string Errtext, Model.AutoTask Autotask) { + return base.Channel.BuildAutoTask(out Errtext, Autotask); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetDeviceInfo(int Deviceindex, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetDeviceInfo(Deviceindex, callback, asyncState); + public System.IAsyncResult BeginBuildAutoTask(Model.AutoTask Autotask, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginBuildAutoTask(Autotask, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public Model.MDevice EndGetDeviceInfo(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndGetDeviceInfo(out Errtext, result); + public bool EndBuildAutoTask(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndBuildAutoTask(out Errtext, result); } - private System.IAsyncResult OnBeginGetDeviceInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { - int Deviceindex = ((int)(inValues[0])); - return this.BeginGetDeviceInfo(Deviceindex, callback, asyncState); + private System.IAsyncResult OnBeginBuildAutoTask(object[] inValues, System.AsyncCallback callback, object asyncState) { + Model.AutoTask Autotask = ((Model.AutoTask)(inValues[0])); + return this.BeginBuildAutoTask(Autotask, callback, asyncState); } - private object[] OnEndGetDeviceInfo(System.IAsyncResult result) { + private object[] OnEndBuildAutoTask(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - Model.MDevice retVal = this.EndGetDeviceInfo(out Errtext, result); + bool retVal = this.EndBuildAutoTask(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnGetDeviceInfoCompleted(object state) { - if ((this.GetDeviceInfoCompleted != null)) { + private void OnBuildAutoTaskCompleted(object state) { + if ((this.BuildAutoTaskCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetDeviceInfoCompleted(this, new GetDeviceInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.BuildAutoTaskCompleted(this, new BuildAutoTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetDeviceInfoAsync(int Deviceindex) { - this.GetDeviceInfoAsync(Deviceindex, null); + public void BuildAutoTaskAsync(Model.AutoTask Autotask) { + this.BuildAutoTaskAsync(Autotask, null); } - public void GetDeviceInfoAsync(int Deviceindex, object userState) { - if ((this.onBeginGetDeviceInfoDelegate == null)) { - this.onBeginGetDeviceInfoDelegate = new BeginOperationDelegate(this.OnBeginGetDeviceInfo); + public void BuildAutoTaskAsync(Model.AutoTask Autotask, object userState) { + if ((this.onBeginBuildAutoTaskDelegate == null)) { + this.onBeginBuildAutoTaskDelegate = new BeginOperationDelegate(this.OnBeginBuildAutoTask); } - if ((this.onEndGetDeviceInfoDelegate == null)) { - this.onEndGetDeviceInfoDelegate = new EndOperationDelegate(this.OnEndGetDeviceInfo); + if ((this.onEndBuildAutoTaskDelegate == null)) { + this.onEndBuildAutoTaskDelegate = new EndOperationDelegate(this.OnEndBuildAutoTask); } - if ((this.onGetDeviceInfoCompletedDelegate == null)) { - this.onGetDeviceInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDeviceInfoCompleted); + if ((this.onBuildAutoTaskCompletedDelegate == null)) { + this.onBuildAutoTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnBuildAutoTaskCompleted); } - base.InvokeAsync(this.onBeginGetDeviceInfoDelegate, new object[] { - Deviceindex}, this.onEndGetDeviceInfoDelegate, this.onGetDeviceInfoCompletedDelegate, userState); + base.InvokeAsync(this.onBeginBuildAutoTaskDelegate, new object[] { + Autotask}, this.onEndBuildAutoTaskDelegate, this.onBuildAutoTaskCompletedDelegate, userState); } - public System.Data.DataTable GetDeviceInfos(out string Errtext, string erroecode) { - return base.Channel.GetDeviceInfos(out Errtext, erroecode); + public bool ModifyManageTask(out string Errtext, int ManKind, long ManagetaskID, int ActionID) { + return base.Channel.ModifyManageTask(out Errtext, ManKind, ManagetaskID, ActionID); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetDeviceInfos(string erroecode, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetDeviceInfos(erroecode, callback, asyncState); + public System.IAsyncResult BeginModifyManageTask(int ManKind, long ManagetaskID, int ActionID, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginModifyManageTask(ManKind, ManagetaskID, ActionID, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.Data.DataTable EndGetDeviceInfos(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndGetDeviceInfos(out Errtext, result); + public bool EndModifyManageTask(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndModifyManageTask(out Errtext, result); } - private System.IAsyncResult OnBeginGetDeviceInfos(object[] inValues, System.AsyncCallback callback, object asyncState) { - string erroecode = ((string)(inValues[0])); - return this.BeginGetDeviceInfos(erroecode, callback, asyncState); + private System.IAsyncResult OnBeginModifyManageTask(object[] inValues, System.AsyncCallback callback, object asyncState) { + int ManKind = ((int)(inValues[0])); + long ManagetaskID = ((long)(inValues[1])); + int ActionID = ((int)(inValues[2])); + return this.BeginModifyManageTask(ManKind, ManagetaskID, ActionID, callback, asyncState); } - private object[] OnEndGetDeviceInfos(System.IAsyncResult result) { + private object[] OnEndModifyManageTask(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - System.Data.DataTable retVal = this.EndGetDeviceInfos(out Errtext, result); + bool retVal = this.EndModifyManageTask(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnGetDeviceInfosCompleted(object state) { - if ((this.GetDeviceInfosCompleted != null)) { + private void OnModifyManageTaskCompleted(object state) { + if ((this.ModifyManageTaskCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetDeviceInfosCompleted(this, new GetDeviceInfosCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.ModifyManageTaskCompleted(this, new ModifyManageTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetDeviceInfosAsync(string erroecode) { - this.GetDeviceInfosAsync(erroecode, null); + public void ModifyManageTaskAsync(int ManKind, long ManagetaskID, int ActionID) { + this.ModifyManageTaskAsync(ManKind, ManagetaskID, ActionID, null); } - public void GetDeviceInfosAsync(string erroecode, object userState) { - if ((this.onBeginGetDeviceInfosDelegate == null)) { - this.onBeginGetDeviceInfosDelegate = new BeginOperationDelegate(this.OnBeginGetDeviceInfos); + public void ModifyManageTaskAsync(int ManKind, long ManagetaskID, int ActionID, object userState) { + if ((this.onBeginModifyManageTaskDelegate == null)) { + this.onBeginModifyManageTaskDelegate = new BeginOperationDelegate(this.OnBeginModifyManageTask); } - if ((this.onEndGetDeviceInfosDelegate == null)) { - this.onEndGetDeviceInfosDelegate = new EndOperationDelegate(this.OnEndGetDeviceInfos); + if ((this.onEndModifyManageTaskDelegate == null)) { + this.onEndModifyManageTaskDelegate = new EndOperationDelegate(this.OnEndModifyManageTask); } - if ((this.onGetDeviceInfosCompletedDelegate == null)) { - this.onGetDeviceInfosCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDeviceInfosCompleted); + if ((this.onModifyManageTaskCompletedDelegate == null)) { + this.onModifyManageTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnModifyManageTaskCompleted); } - base.InvokeAsync(this.onBeginGetDeviceInfosDelegate, new object[] { - erroecode}, this.onEndGetDeviceInfosDelegate, this.onGetDeviceInfosCompletedDelegate, userState); + base.InvokeAsync(this.onBeginModifyManageTaskDelegate, new object[] { + ManKind, + ManagetaskID, + ActionID}, this.onEndModifyManageTaskDelegate, this.onModifyManageTaskCompletedDelegate, userState); } - public bool SetRouteState(out string Errtext, Model.MRoute Routeinfo) { - return base.Channel.SetRouteState(out Errtext, Routeinfo); + public bool ModifyMonitorTask(out string Errtext, int DeviceIndex, int MonitortaskID, int ActionID) { + return base.Channel.ModifyMonitorTask(out Errtext, DeviceIndex, MonitortaskID, ActionID); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetRouteState(Model.MRoute Routeinfo, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetRouteState(Routeinfo, callback, asyncState); + public System.IAsyncResult BeginModifyMonitorTask(int DeviceIndex, int MonitortaskID, int ActionID, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginModifyMonitorTask(DeviceIndex, MonitortaskID, ActionID, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetRouteState(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndSetRouteState(out Errtext, result); + public bool EndModifyMonitorTask(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndModifyMonitorTask(out Errtext, result); } - private System.IAsyncResult OnBeginSetRouteState(object[] inValues, System.AsyncCallback callback, object asyncState) { - Model.MRoute Routeinfo = ((Model.MRoute)(inValues[0])); - return this.BeginSetRouteState(Routeinfo, callback, asyncState); + private System.IAsyncResult OnBeginModifyMonitorTask(object[] inValues, System.AsyncCallback callback, object asyncState) { + int DeviceIndex = ((int)(inValues[0])); + int MonitortaskID = ((int)(inValues[1])); + int ActionID = ((int)(inValues[2])); + return this.BeginModifyMonitorTask(DeviceIndex, MonitortaskID, ActionID, callback, asyncState); } - private object[] OnEndSetRouteState(System.IAsyncResult result) { + private object[] OnEndModifyMonitorTask(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetRouteState(out Errtext, result); + bool retVal = this.EndModifyMonitorTask(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnSetRouteStateCompleted(object state) { - if ((this.SetRouteStateCompleted != null)) { + private void OnModifyMonitorTaskCompleted(object state) { + if ((this.ModifyMonitorTaskCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetRouteStateCompleted(this, new SetRouteStateCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.ModifyMonitorTaskCompleted(this, new ModifyMonitorTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetRouteStateAsync(Model.MRoute Routeinfo) { - this.SetRouteStateAsync(Routeinfo, null); + public void ModifyMonitorTaskAsync(int DeviceIndex, int MonitortaskID, int ActionID) { + this.ModifyMonitorTaskAsync(DeviceIndex, MonitortaskID, ActionID, null); } - public void SetRouteStateAsync(Model.MRoute Routeinfo, object userState) { - if ((this.onBeginSetRouteStateDelegate == null)) { - this.onBeginSetRouteStateDelegate = new BeginOperationDelegate(this.OnBeginSetRouteState); + public void ModifyMonitorTaskAsync(int DeviceIndex, int MonitortaskID, int ActionID, object userState) { + if ((this.onBeginModifyMonitorTaskDelegate == null)) { + this.onBeginModifyMonitorTaskDelegate = new BeginOperationDelegate(this.OnBeginModifyMonitorTask); } - if ((this.onEndSetRouteStateDelegate == null)) { - this.onEndSetRouteStateDelegate = new EndOperationDelegate(this.OnEndSetRouteState); + if ((this.onEndModifyMonitorTaskDelegate == null)) { + this.onEndModifyMonitorTaskDelegate = new EndOperationDelegate(this.OnEndModifyMonitorTask); } - if ((this.onSetRouteStateCompletedDelegate == null)) { - this.onSetRouteStateCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetRouteStateCompleted); + if ((this.onModifyMonitorTaskCompletedDelegate == null)) { + this.onModifyMonitorTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnModifyMonitorTaskCompleted); } - base.InvokeAsync(this.onBeginSetRouteStateDelegate, new object[] { - Routeinfo}, this.onEndSetRouteStateDelegate, this.onSetRouteStateCompletedDelegate, userState); + base.InvokeAsync(this.onBeginModifyMonitorTaskDelegate, new object[] { + DeviceIndex, + MonitortaskID, + ActionID}, this.onEndModifyMonitorTaskDelegate, this.onModifyMonitorTaskCompletedDelegate, userState); } - public Model.MRoute GetRouteInfo(out string Errtext, decimal RouteID) { - return base.Channel.GetRouteInfo(out Errtext, RouteID); + public bool ModifyManageTaskFork(out string Errtext, int Flag, int FarForkTaskID, int NearForkTaskID) { + return base.Channel.ModifyManageTaskFork(out Errtext, Flag, FarForkTaskID, NearForkTaskID); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetRouteInfo(decimal RouteID, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetRouteInfo(RouteID, callback, asyncState); + public System.IAsyncResult BeginModifyManageTaskFork(int Flag, int FarForkTaskID, int NearForkTaskID, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginModifyManageTaskFork(Flag, FarForkTaskID, NearForkTaskID, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public Model.MRoute EndGetRouteInfo(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndGetRouteInfo(out Errtext, result); + public bool EndModifyManageTaskFork(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndModifyManageTaskFork(out Errtext, result); } - private System.IAsyncResult OnBeginGetRouteInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { - decimal RouteID = ((decimal)(inValues[0])); - return this.BeginGetRouteInfo(RouteID, callback, asyncState); + private System.IAsyncResult OnBeginModifyManageTaskFork(object[] inValues, System.AsyncCallback callback, object asyncState) { + int Flag = ((int)(inValues[0])); + int FarForkTaskID = ((int)(inValues[1])); + int NearForkTaskID = ((int)(inValues[2])); + return this.BeginModifyManageTaskFork(Flag, FarForkTaskID, NearForkTaskID, callback, asyncState); } - private object[] OnEndGetRouteInfo(System.IAsyncResult result) { + private object[] OnEndModifyManageTaskFork(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - Model.MRoute retVal = this.EndGetRouteInfo(out Errtext, result); + bool retVal = this.EndModifyManageTaskFork(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnGetRouteInfoCompleted(object state) { - if ((this.GetRouteInfoCompleted != null)) { + private void OnModifyManageTaskForkCompleted(object state) { + if ((this.ModifyManageTaskForkCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetRouteInfoCompleted(this, new GetRouteInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.ModifyManageTaskForkCompleted(this, new ModifyManageTaskForkCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetRouteInfoAsync(decimal RouteID) { - this.GetRouteInfoAsync(RouteID, null); + public void ModifyManageTaskForkAsync(int Flag, int FarForkTaskID, int NearForkTaskID) { + this.ModifyManageTaskForkAsync(Flag, FarForkTaskID, NearForkTaskID, null); } - public void GetRouteInfoAsync(decimal RouteID, object userState) { - if ((this.onBeginGetRouteInfoDelegate == null)) { - this.onBeginGetRouteInfoDelegate = new BeginOperationDelegate(this.OnBeginGetRouteInfo); + public void ModifyManageTaskForkAsync(int Flag, int FarForkTaskID, int NearForkTaskID, object userState) { + if ((this.onBeginModifyManageTaskForkDelegate == null)) { + this.onBeginModifyManageTaskForkDelegate = new BeginOperationDelegate(this.OnBeginModifyManageTaskFork); } - if ((this.onEndGetRouteInfoDelegate == null)) { - this.onEndGetRouteInfoDelegate = new EndOperationDelegate(this.OnEndGetRouteInfo); + if ((this.onEndModifyManageTaskForkDelegate == null)) { + this.onEndModifyManageTaskForkDelegate = new EndOperationDelegate(this.OnEndModifyManageTaskFork); } - if ((this.onGetRouteInfoCompletedDelegate == null)) { - this.onGetRouteInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetRouteInfoCompleted); + if ((this.onModifyManageTaskForkCompletedDelegate == null)) { + this.onModifyManageTaskForkCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnModifyManageTaskForkCompleted); } - base.InvokeAsync(this.onBeginGetRouteInfoDelegate, new object[] { - RouteID}, this.onEndGetRouteInfoDelegate, this.onGetRouteInfoCompletedDelegate, userState); + base.InvokeAsync(this.onBeginModifyManageTaskForkDelegate, new object[] { + Flag, + FarForkTaskID, + NearForkTaskID}, this.onEndModifyManageTaskForkDelegate, this.onModifyManageTaskForkCompletedDelegate, userState); } - public Model.MRoute[] GetRouteInfos(out string Errtext, int RouteState) { - return base.Channel.GetRouteInfos(out Errtext, RouteState); + public bool SetDeviceState(out string Errtext, Model.MDevice Devinfo) { + return base.Channel.SetDeviceState(out Errtext, Devinfo); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetRouteInfos(int RouteState, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetRouteInfos(RouteState, callback, asyncState); + public System.IAsyncResult BeginSetDeviceState(Model.MDevice Devinfo, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetDeviceState(Devinfo, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public Model.MRoute[] EndGetRouteInfos(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndGetRouteInfos(out Errtext, result); + public bool EndSetDeviceState(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndSetDeviceState(out Errtext, result); } - private System.IAsyncResult OnBeginGetRouteInfos(object[] inValues, System.AsyncCallback callback, object asyncState) { - int RouteState = ((int)(inValues[0])); - return this.BeginGetRouteInfos(RouteState, callback, asyncState); + private System.IAsyncResult OnBeginSetDeviceState(object[] inValues, System.AsyncCallback callback, object asyncState) { + Model.MDevice Devinfo = ((Model.MDevice)(inValues[0])); + return this.BeginSetDeviceState(Devinfo, callback, asyncState); } - private object[] OnEndGetRouteInfos(System.IAsyncResult result) { + private object[] OnEndSetDeviceState(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - Model.MRoute[] retVal = this.EndGetRouteInfos(out Errtext, result); + bool retVal = this.EndSetDeviceState(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnGetRouteInfosCompleted(object state) { - if ((this.GetRouteInfosCompleted != null)) { + private void OnSetDeviceStateCompleted(object state) { + if ((this.SetDeviceStateCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetRouteInfosCompleted(this, new GetRouteInfosCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetDeviceStateCompleted(this, new SetDeviceStateCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetRouteInfosAsync(int RouteState) { - this.GetRouteInfosAsync(RouteState, null); + public void SetDeviceStateAsync(Model.MDevice Devinfo) { + this.SetDeviceStateAsync(Devinfo, null); } - public void GetRouteInfosAsync(int RouteState, object userState) { - if ((this.onBeginGetRouteInfosDelegate == null)) { - this.onBeginGetRouteInfosDelegate = new BeginOperationDelegate(this.OnBeginGetRouteInfos); + public void SetDeviceStateAsync(Model.MDevice Devinfo, object userState) { + if ((this.onBeginSetDeviceStateDelegate == null)) { + this.onBeginSetDeviceStateDelegate = new BeginOperationDelegate(this.OnBeginSetDeviceState); } - if ((this.onEndGetRouteInfosDelegate == null)) { - this.onEndGetRouteInfosDelegate = new EndOperationDelegate(this.OnEndGetRouteInfos); + if ((this.onEndSetDeviceStateDelegate == null)) { + this.onEndSetDeviceStateDelegate = new EndOperationDelegate(this.OnEndSetDeviceState); } - if ((this.onGetRouteInfosCompletedDelegate == null)) { - this.onGetRouteInfosCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetRouteInfosCompleted); + if ((this.onSetDeviceStateCompletedDelegate == null)) { + this.onSetDeviceStateCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetDeviceStateCompleted); } - base.InvokeAsync(this.onBeginGetRouteInfosDelegate, new object[] { - RouteState}, this.onEndGetRouteInfosDelegate, this.onGetRouteInfosCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSetDeviceStateDelegate, new object[] { + Devinfo}, this.onEndSetDeviceStateDelegate, this.onSetDeviceStateCompletedDelegate, userState); } - public bool SetForkCombinWaitTime(out string Errtext, int WaitTime) { - return base.Channel.SetForkCombinWaitTime(out Errtext, WaitTime); + public Model.MDevice GetDeviceInfo(out string Errtext, int Deviceindex) { + return base.Channel.GetDeviceInfo(out Errtext, Deviceindex); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetForkCombinWaitTime(int WaitTime, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetForkCombinWaitTime(WaitTime, callback, asyncState); + public System.IAsyncResult BeginGetDeviceInfo(int Deviceindex, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetDeviceInfo(Deviceindex, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetForkCombinWaitTime(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndSetForkCombinWaitTime(out Errtext, result); + public Model.MDevice EndGetDeviceInfo(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndGetDeviceInfo(out Errtext, result); } - private System.IAsyncResult OnBeginSetForkCombinWaitTime(object[] inValues, System.AsyncCallback callback, object asyncState) { - int WaitTime = ((int)(inValues[0])); - return this.BeginSetForkCombinWaitTime(WaitTime, callback, asyncState); + private System.IAsyncResult OnBeginGetDeviceInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { + int Deviceindex = ((int)(inValues[0])); + return this.BeginGetDeviceInfo(Deviceindex, callback, asyncState); } - private object[] OnEndSetForkCombinWaitTime(System.IAsyncResult result) { + private object[] OnEndGetDeviceInfo(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetForkCombinWaitTime(out Errtext, result); + Model.MDevice retVal = this.EndGetDeviceInfo(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnSetForkCombinWaitTimeCompleted(object state) { - if ((this.SetForkCombinWaitTimeCompleted != null)) { + private void OnGetDeviceInfoCompleted(object state) { + if ((this.GetDeviceInfoCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetForkCombinWaitTimeCompleted(this, new SetForkCombinWaitTimeCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetDeviceInfoCompleted(this, new GetDeviceInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetForkCombinWaitTimeAsync(int WaitTime) { - this.SetForkCombinWaitTimeAsync(WaitTime, null); + public void GetDeviceInfoAsync(int Deviceindex) { + this.GetDeviceInfoAsync(Deviceindex, null); } - public void SetForkCombinWaitTimeAsync(int WaitTime, object userState) { - if ((this.onBeginSetForkCombinWaitTimeDelegate == null)) { - this.onBeginSetForkCombinWaitTimeDelegate = new BeginOperationDelegate(this.OnBeginSetForkCombinWaitTime); + public void GetDeviceInfoAsync(int Deviceindex, object userState) { + if ((this.onBeginGetDeviceInfoDelegate == null)) { + this.onBeginGetDeviceInfoDelegate = new BeginOperationDelegate(this.OnBeginGetDeviceInfo); } - if ((this.onEndSetForkCombinWaitTimeDelegate == null)) { - this.onEndSetForkCombinWaitTimeDelegate = new EndOperationDelegate(this.OnEndSetForkCombinWaitTime); + if ((this.onEndGetDeviceInfoDelegate == null)) { + this.onEndGetDeviceInfoDelegate = new EndOperationDelegate(this.OnEndGetDeviceInfo); } - if ((this.onSetForkCombinWaitTimeCompletedDelegate == null)) { - this.onSetForkCombinWaitTimeCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetForkCombinWaitTimeCompleted); + if ((this.onGetDeviceInfoCompletedDelegate == null)) { + this.onGetDeviceInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDeviceInfoCompleted); } - base.InvokeAsync(this.onBeginSetForkCombinWaitTimeDelegate, new object[] { - WaitTime}, this.onEndSetForkCombinWaitTimeDelegate, this.onSetForkCombinWaitTimeCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetDeviceInfoDelegate, new object[] { + Deviceindex}, this.onEndGetDeviceInfoDelegate, this.onGetDeviceInfoCompletedDelegate, userState); } - public int GetForkCombinWaitTime(out string Errtext) { - return base.Channel.GetForkCombinWaitTime(out Errtext); + public System.Data.DataTable GetDeviceInfos(out string Errtext, string erroecode) { + return base.Channel.GetDeviceInfos(out Errtext, erroecode); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetForkCombinWaitTime(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetForkCombinWaitTime(callback, asyncState); + public System.IAsyncResult BeginGetDeviceInfos(string erroecode, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetDeviceInfos(erroecode, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public int EndGetForkCombinWaitTime(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndGetForkCombinWaitTime(out Errtext, result); + public System.Data.DataTable EndGetDeviceInfos(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndGetDeviceInfos(out Errtext, result); } - private System.IAsyncResult OnBeginGetForkCombinWaitTime(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginGetForkCombinWaitTime(callback, asyncState); + private System.IAsyncResult OnBeginGetDeviceInfos(object[] inValues, System.AsyncCallback callback, object asyncState) { + string erroecode = ((string)(inValues[0])); + return this.BeginGetDeviceInfos(erroecode, callback, asyncState); } - private object[] OnEndGetForkCombinWaitTime(System.IAsyncResult result) { + private object[] OnEndGetDeviceInfos(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - int retVal = this.EndGetForkCombinWaitTime(out Errtext, result); + System.Data.DataTable retVal = this.EndGetDeviceInfos(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnGetForkCombinWaitTimeCompleted(object state) { - if ((this.GetForkCombinWaitTimeCompleted != null)) { + private void OnGetDeviceInfosCompleted(object state) { + if ((this.GetDeviceInfosCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetForkCombinWaitTimeCompleted(this, new GetForkCombinWaitTimeCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetDeviceInfosCompleted(this, new GetDeviceInfosCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetForkCombinWaitTimeAsync() { - this.GetForkCombinWaitTimeAsync(null); + public void GetDeviceInfosAsync(string erroecode) { + this.GetDeviceInfosAsync(erroecode, null); } - public void GetForkCombinWaitTimeAsync(object userState) { - if ((this.onBeginGetForkCombinWaitTimeDelegate == null)) { - this.onBeginGetForkCombinWaitTimeDelegate = new BeginOperationDelegate(this.OnBeginGetForkCombinWaitTime); + public void GetDeviceInfosAsync(string erroecode, object userState) { + if ((this.onBeginGetDeviceInfosDelegate == null)) { + this.onBeginGetDeviceInfosDelegate = new BeginOperationDelegate(this.OnBeginGetDeviceInfos); } - if ((this.onEndGetForkCombinWaitTimeDelegate == null)) { - this.onEndGetForkCombinWaitTimeDelegate = new EndOperationDelegate(this.OnEndGetForkCombinWaitTime); + if ((this.onEndGetDeviceInfosDelegate == null)) { + this.onEndGetDeviceInfosDelegate = new EndOperationDelegate(this.OnEndGetDeviceInfos); } - if ((this.onGetForkCombinWaitTimeCompletedDelegate == null)) { - this.onGetForkCombinWaitTimeCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetForkCombinWaitTimeCompleted); + if ((this.onGetDeviceInfosCompletedDelegate == null)) { + this.onGetDeviceInfosCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDeviceInfosCompleted); } - base.InvokeAsync(this.onBeginGetForkCombinWaitTimeDelegate, null, this.onEndGetForkCombinWaitTimeDelegate, this.onGetForkCombinWaitTimeCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetDeviceInfosDelegate, new object[] { + erroecode}, this.onEndGetDeviceInfosDelegate, this.onGetDeviceInfosCompletedDelegate, userState); } - public bool SetConveyorTimeOutTime(out string Errtext, int Timeout) { - return base.Channel.SetConveyorTimeOutTime(out Errtext, Timeout); + public bool SetRouteState(out string Errtext, Model.MRoute Routeinfo) { + return base.Channel.SetRouteState(out Errtext, Routeinfo); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetConveyorTimeOutTime(int Timeout, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetConveyorTimeOutTime(Timeout, callback, asyncState); + public System.IAsyncResult BeginSetRouteState(Model.MRoute Routeinfo, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetRouteState(Routeinfo, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetConveyorTimeOutTime(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndSetConveyorTimeOutTime(out Errtext, result); + public bool EndSetRouteState(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndSetRouteState(out Errtext, result); } - private System.IAsyncResult OnBeginSetConveyorTimeOutTime(object[] inValues, System.AsyncCallback callback, object asyncState) { - int Timeout = ((int)(inValues[0])); - return this.BeginSetConveyorTimeOutTime(Timeout, callback, asyncState); + private System.IAsyncResult OnBeginSetRouteState(object[] inValues, System.AsyncCallback callback, object asyncState) { + Model.MRoute Routeinfo = ((Model.MRoute)(inValues[0])); + return this.BeginSetRouteState(Routeinfo, callback, asyncState); } - private object[] OnEndSetConveyorTimeOutTime(System.IAsyncResult result) { + private object[] OnEndSetRouteState(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetConveyorTimeOutTime(out Errtext, result); + bool retVal = this.EndSetRouteState(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnSetConveyorTimeOutTimeCompleted(object state) { - if ((this.SetConveyorTimeOutTimeCompleted != null)) { + private void OnSetRouteStateCompleted(object state) { + if ((this.SetRouteStateCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetConveyorTimeOutTimeCompleted(this, new SetConveyorTimeOutTimeCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetRouteStateCompleted(this, new SetRouteStateCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetConveyorTimeOutTimeAsync(int Timeout) { - this.SetConveyorTimeOutTimeAsync(Timeout, null); + public void SetRouteStateAsync(Model.MRoute Routeinfo) { + this.SetRouteStateAsync(Routeinfo, null); } - public void SetConveyorTimeOutTimeAsync(int Timeout, object userState) { - if ((this.onBeginSetConveyorTimeOutTimeDelegate == null)) { - this.onBeginSetConveyorTimeOutTimeDelegate = new BeginOperationDelegate(this.OnBeginSetConveyorTimeOutTime); + public void SetRouteStateAsync(Model.MRoute Routeinfo, object userState) { + if ((this.onBeginSetRouteStateDelegate == null)) { + this.onBeginSetRouteStateDelegate = new BeginOperationDelegate(this.OnBeginSetRouteState); } - if ((this.onEndSetConveyorTimeOutTimeDelegate == null)) { - this.onEndSetConveyorTimeOutTimeDelegate = new EndOperationDelegate(this.OnEndSetConveyorTimeOutTime); + if ((this.onEndSetRouteStateDelegate == null)) { + this.onEndSetRouteStateDelegate = new EndOperationDelegate(this.OnEndSetRouteState); } - if ((this.onSetConveyorTimeOutTimeCompletedDelegate == null)) { - this.onSetConveyorTimeOutTimeCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetConveyorTimeOutTimeCompleted); + if ((this.onSetRouteStateCompletedDelegate == null)) { + this.onSetRouteStateCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetRouteStateCompleted); } - base.InvokeAsync(this.onBeginSetConveyorTimeOutTimeDelegate, new object[] { - Timeout}, this.onEndSetConveyorTimeOutTimeDelegate, this.onSetConveyorTimeOutTimeCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSetRouteStateDelegate, new object[] { + Routeinfo}, this.onEndSetRouteStateDelegate, this.onSetRouteStateCompletedDelegate, userState); } - public int GetConveyorTimeOutTime(out string Errtext) { - return base.Channel.GetConveyorTimeOutTime(out Errtext); + public Model.MRoute GetRouteInfo(out string Errtext, decimal RouteID) { + return base.Channel.GetRouteInfo(out Errtext, RouteID); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetConveyorTimeOutTime(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetConveyorTimeOutTime(callback, asyncState); + public System.IAsyncResult BeginGetRouteInfo(decimal RouteID, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetRouteInfo(RouteID, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public int EndGetConveyorTimeOutTime(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndGetConveyorTimeOutTime(out Errtext, result); + public Model.MRoute EndGetRouteInfo(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndGetRouteInfo(out Errtext, result); } - private System.IAsyncResult OnBeginGetConveyorTimeOutTime(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginGetConveyorTimeOutTime(callback, asyncState); + private System.IAsyncResult OnBeginGetRouteInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { + decimal RouteID = ((decimal)(inValues[0])); + return this.BeginGetRouteInfo(RouteID, callback, asyncState); } - private object[] OnEndGetConveyorTimeOutTime(System.IAsyncResult result) { + private object[] OnEndGetRouteInfo(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - int retVal = this.EndGetConveyorTimeOutTime(out Errtext, result); + Model.MRoute retVal = this.EndGetRouteInfo(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnGetConveyorTimeOutTimeCompleted(object state) { - if ((this.GetConveyorTimeOutTimeCompleted != null)) { + private void OnGetRouteInfoCompleted(object state) { + if ((this.GetRouteInfoCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetConveyorTimeOutTimeCompleted(this, new GetConveyorTimeOutTimeCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetRouteInfoCompleted(this, new GetRouteInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetConveyorTimeOutTimeAsync() { - this.GetConveyorTimeOutTimeAsync(null); + public void GetRouteInfoAsync(decimal RouteID) { + this.GetRouteInfoAsync(RouteID, null); } - public void GetConveyorTimeOutTimeAsync(object userState) { - if ((this.onBeginGetConveyorTimeOutTimeDelegate == null)) { - this.onBeginGetConveyorTimeOutTimeDelegate = new BeginOperationDelegate(this.OnBeginGetConveyorTimeOutTime); + public void GetRouteInfoAsync(decimal RouteID, object userState) { + if ((this.onBeginGetRouteInfoDelegate == null)) { + this.onBeginGetRouteInfoDelegate = new BeginOperationDelegate(this.OnBeginGetRouteInfo); } - if ((this.onEndGetConveyorTimeOutTimeDelegate == null)) { - this.onEndGetConveyorTimeOutTimeDelegate = new EndOperationDelegate(this.OnEndGetConveyorTimeOutTime); + if ((this.onEndGetRouteInfoDelegate == null)) { + this.onEndGetRouteInfoDelegate = new EndOperationDelegate(this.OnEndGetRouteInfo); } - if ((this.onGetConveyorTimeOutTimeCompletedDelegate == null)) { - this.onGetConveyorTimeOutTimeCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetConveyorTimeOutTimeCompleted); + if ((this.onGetRouteInfoCompletedDelegate == null)) { + this.onGetRouteInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetRouteInfoCompleted); } - base.InvokeAsync(this.onBeginGetConveyorTimeOutTimeDelegate, null, this.onEndGetConveyorTimeOutTimeDelegate, this.onGetConveyorTimeOutTimeCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetRouteInfoDelegate, new object[] { + RouteID}, this.onEndGetRouteInfoDelegate, this.onGetRouteInfoCompletedDelegate, userState); } - public bool SetDBConnection(out string Errtext, string MonitorOrManageDB, string ServerHostName, string DBServiceName, string Username, string Password) { - return base.Channel.SetDBConnection(out Errtext, MonitorOrManageDB, ServerHostName, DBServiceName, Username, Password); + public Model.MRoute[] GetRouteInfos(out string Errtext, int RouteState) { + return base.Channel.GetRouteInfos(out Errtext, RouteState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetDBConnection(string MonitorOrManageDB, string ServerHostName, string DBServiceName, string Username, string Password, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetDBConnection(MonitorOrManageDB, ServerHostName, DBServiceName, Username, Password, callback, asyncState); + public System.IAsyncResult BeginGetRouteInfos(int RouteState, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetRouteInfos(RouteState, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetDBConnection(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndSetDBConnection(out Errtext, result); + public Model.MRoute[] EndGetRouteInfos(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndGetRouteInfos(out Errtext, result); } - private System.IAsyncResult OnBeginSetDBConnection(object[] inValues, System.AsyncCallback callback, object asyncState) { - string MonitorOrManageDB = ((string)(inValues[0])); - string ServerHostName = ((string)(inValues[1])); - string DBServiceName = ((string)(inValues[2])); - string Username = ((string)(inValues[3])); - string Password = ((string)(inValues[4])); - return this.BeginSetDBConnection(MonitorOrManageDB, ServerHostName, DBServiceName, Username, Password, callback, asyncState); + private System.IAsyncResult OnBeginGetRouteInfos(object[] inValues, System.AsyncCallback callback, object asyncState) { + int RouteState = ((int)(inValues[0])); + return this.BeginGetRouteInfos(RouteState, callback, asyncState); } - private object[] OnEndSetDBConnection(System.IAsyncResult result) { + private object[] OnEndGetRouteInfos(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetDBConnection(out Errtext, result); + Model.MRoute[] retVal = this.EndGetRouteInfos(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnSetDBConnectionCompleted(object state) { - if ((this.SetDBConnectionCompleted != null)) { + private void OnGetRouteInfosCompleted(object state) { + if ((this.GetRouteInfosCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetDBConnectionCompleted(this, new SetDBConnectionCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetRouteInfosCompleted(this, new GetRouteInfosCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetDBConnectionAsync(string MonitorOrManageDB, string ServerHostName, string DBServiceName, string Username, string Password) { - this.SetDBConnectionAsync(MonitorOrManageDB, ServerHostName, DBServiceName, Username, Password, null); + public void GetRouteInfosAsync(int RouteState) { + this.GetRouteInfosAsync(RouteState, null); } - public void SetDBConnectionAsync(string MonitorOrManageDB, string ServerHostName, string DBServiceName, string Username, string Password, object userState) { - if ((this.onBeginSetDBConnectionDelegate == null)) { - this.onBeginSetDBConnectionDelegate = new BeginOperationDelegate(this.OnBeginSetDBConnection); + public void GetRouteInfosAsync(int RouteState, object userState) { + if ((this.onBeginGetRouteInfosDelegate == null)) { + this.onBeginGetRouteInfosDelegate = new BeginOperationDelegate(this.OnBeginGetRouteInfos); } - if ((this.onEndSetDBConnectionDelegate == null)) { - this.onEndSetDBConnectionDelegate = new EndOperationDelegate(this.OnEndSetDBConnection); + if ((this.onEndGetRouteInfosDelegate == null)) { + this.onEndGetRouteInfosDelegate = new EndOperationDelegate(this.OnEndGetRouteInfos); } - if ((this.onSetDBConnectionCompletedDelegate == null)) { - this.onSetDBConnectionCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetDBConnectionCompleted); + if ((this.onGetRouteInfosCompletedDelegate == null)) { + this.onGetRouteInfosCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetRouteInfosCompleted); } - base.InvokeAsync(this.onBeginSetDBConnectionDelegate, new object[] { - MonitorOrManageDB, - ServerHostName, - DBServiceName, - Username, - Password}, this.onEndSetDBConnectionDelegate, this.onSetDBConnectionCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetRouteInfosDelegate, new object[] { + RouteState}, this.onEndGetRouteInfosDelegate, this.onGetRouteInfosCompletedDelegate, userState); } - public bool GetDBConnection(out string ServerHostName, out string DBServiceName, out string Username, out string Password, out string Errtext, string MonitorOrManageDB) { - return base.Channel.GetDBConnection(out ServerHostName, out DBServiceName, out Username, out Password, out Errtext, MonitorOrManageDB); + public bool SetForkCombinWaitTime(out string Errtext, int WaitTime) { + return base.Channel.SetForkCombinWaitTime(out Errtext, WaitTime); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetDBConnection(string MonitorOrManageDB, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetDBConnection(MonitorOrManageDB, callback, asyncState); + public System.IAsyncResult BeginSetForkCombinWaitTime(int WaitTime, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetForkCombinWaitTime(WaitTime, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndGetDBConnection(out string ServerHostName, out string DBServiceName, out string Username, out string Password, out string Errtext, System.IAsyncResult result) { - return base.Channel.EndGetDBConnection(out ServerHostName, out DBServiceName, out Username, out Password, out Errtext, result); + public bool EndSetForkCombinWaitTime(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndSetForkCombinWaitTime(out Errtext, result); } - private System.IAsyncResult OnBeginGetDBConnection(object[] inValues, System.AsyncCallback callback, object asyncState) { - string MonitorOrManageDB = ((string)(inValues[0])); - return this.BeginGetDBConnection(MonitorOrManageDB, callback, asyncState); + private System.IAsyncResult OnBeginSetForkCombinWaitTime(object[] inValues, System.AsyncCallback callback, object asyncState) { + int WaitTime = ((int)(inValues[0])); + return this.BeginSetForkCombinWaitTime(WaitTime, callback, asyncState); } - private object[] OnEndGetDBConnection(System.IAsyncResult result) { - string ServerHostName = this.GetDefaultValueForInitialization(); - string DBServiceName = this.GetDefaultValueForInitialization(); - string Username = this.GetDefaultValueForInitialization(); - string Password = this.GetDefaultValueForInitialization(); + private object[] OnEndSetForkCombinWaitTime(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndGetDBConnection(out ServerHostName, out DBServiceName, out Username, out Password, out Errtext, result); + bool retVal = this.EndSetForkCombinWaitTime(out Errtext, result); return new object[] { - ServerHostName, - DBServiceName, - Username, - Password, Errtext, retVal}; } - private void OnGetDBConnectionCompleted(object state) { - if ((this.GetDBConnectionCompleted != null)) { + private void OnSetForkCombinWaitTimeCompleted(object state) { + if ((this.SetForkCombinWaitTimeCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetDBConnectionCompleted(this, new GetDBConnectionCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetForkCombinWaitTimeCompleted(this, new SetForkCombinWaitTimeCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetDBConnectionAsync(string MonitorOrManageDB) { - this.GetDBConnectionAsync(MonitorOrManageDB, null); + public void SetForkCombinWaitTimeAsync(int WaitTime) { + this.SetForkCombinWaitTimeAsync(WaitTime, null); } - public void GetDBConnectionAsync(string MonitorOrManageDB, object userState) { - if ((this.onBeginGetDBConnectionDelegate == null)) { - this.onBeginGetDBConnectionDelegate = new BeginOperationDelegate(this.OnBeginGetDBConnection); - } - if ((this.onEndGetDBConnectionDelegate == null)) { - this.onEndGetDBConnectionDelegate = new EndOperationDelegate(this.OnEndGetDBConnection); + public void SetForkCombinWaitTimeAsync(int WaitTime, object userState) { + if ((this.onBeginSetForkCombinWaitTimeDelegate == null)) { + this.onBeginSetForkCombinWaitTimeDelegate = new BeginOperationDelegate(this.OnBeginSetForkCombinWaitTime); } - if ((this.onGetDBConnectionCompletedDelegate == null)) { - this.onGetDBConnectionCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDBConnectionCompleted); + if ((this.onEndSetForkCombinWaitTimeDelegate == null)) { + this.onEndSetForkCombinWaitTimeDelegate = new EndOperationDelegate(this.OnEndSetForkCombinWaitTime); } - base.InvokeAsync(this.onBeginGetDBConnectionDelegate, new object[] { - MonitorOrManageDB}, this.onEndGetDBConnectionDelegate, this.onGetDBConnectionCompletedDelegate, userState); + if ((this.onSetForkCombinWaitTimeCompletedDelegate == null)) { + this.onSetForkCombinWaitTimeCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetForkCombinWaitTimeCompleted); + } + base.InvokeAsync(this.onBeginSetForkCombinWaitTimeDelegate, new object[] { + WaitTime}, this.onEndSetForkCombinWaitTimeDelegate, this.onSetForkCombinWaitTimeCompletedDelegate, userState); } - public bool SetIOStationProperty(out string Errtext, int deviceIndex, int IOStationProperty) { - return base.Channel.SetIOStationProperty(out Errtext, deviceIndex, IOStationProperty); + public int GetForkCombinWaitTime(out string Errtext) { + return base.Channel.GetForkCombinWaitTime(out Errtext); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetIOStationProperty(int deviceIndex, int IOStationProperty, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetIOStationProperty(deviceIndex, IOStationProperty, callback, asyncState); + public System.IAsyncResult BeginGetForkCombinWaitTime(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetForkCombinWaitTime(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetIOStationProperty(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndSetIOStationProperty(out Errtext, result); + public int EndGetForkCombinWaitTime(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndGetForkCombinWaitTime(out Errtext, result); } - private System.IAsyncResult OnBeginSetIOStationProperty(object[] inValues, System.AsyncCallback callback, object asyncState) { - int deviceIndex = ((int)(inValues[0])); - int IOStationProperty = ((int)(inValues[1])); - return this.BeginSetIOStationProperty(deviceIndex, IOStationProperty, callback, asyncState); + private System.IAsyncResult OnBeginGetForkCombinWaitTime(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginGetForkCombinWaitTime(callback, asyncState); } - private object[] OnEndSetIOStationProperty(System.IAsyncResult result) { + private object[] OnEndGetForkCombinWaitTime(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetIOStationProperty(out Errtext, result); + int retVal = this.EndGetForkCombinWaitTime(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnSetIOStationPropertyCompleted(object state) { - if ((this.SetIOStationPropertyCompleted != null)) { + private void OnGetForkCombinWaitTimeCompleted(object state) { + if ((this.GetForkCombinWaitTimeCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetIOStationPropertyCompleted(this, new SetIOStationPropertyCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetForkCombinWaitTimeCompleted(this, new GetForkCombinWaitTimeCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetIOStationPropertyAsync(int deviceIndex, int IOStationProperty) { - this.SetIOStationPropertyAsync(deviceIndex, IOStationProperty, null); + public void GetForkCombinWaitTimeAsync() { + this.GetForkCombinWaitTimeAsync(null); } - public void SetIOStationPropertyAsync(int deviceIndex, int IOStationProperty, object userState) { - if ((this.onBeginSetIOStationPropertyDelegate == null)) { - this.onBeginSetIOStationPropertyDelegate = new BeginOperationDelegate(this.OnBeginSetIOStationProperty); + public void GetForkCombinWaitTimeAsync(object userState) { + if ((this.onBeginGetForkCombinWaitTimeDelegate == null)) { + this.onBeginGetForkCombinWaitTimeDelegate = new BeginOperationDelegate(this.OnBeginGetForkCombinWaitTime); } - if ((this.onEndSetIOStationPropertyDelegate == null)) { - this.onEndSetIOStationPropertyDelegate = new EndOperationDelegate(this.OnEndSetIOStationProperty); + if ((this.onEndGetForkCombinWaitTimeDelegate == null)) { + this.onEndGetForkCombinWaitTimeDelegate = new EndOperationDelegate(this.OnEndGetForkCombinWaitTime); } - if ((this.onSetIOStationPropertyCompletedDelegate == null)) { - this.onSetIOStationPropertyCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetIOStationPropertyCompleted); + if ((this.onGetForkCombinWaitTimeCompletedDelegate == null)) { + this.onGetForkCombinWaitTimeCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetForkCombinWaitTimeCompleted); } - base.InvokeAsync(this.onBeginSetIOStationPropertyDelegate, new object[] { - deviceIndex, - IOStationProperty}, this.onEndSetIOStationPropertyDelegate, this.onSetIOStationPropertyCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetForkCombinWaitTimeDelegate, null, this.onEndGetForkCombinWaitTimeDelegate, this.onGetForkCombinWaitTimeCompletedDelegate, userState); } - public bool SetBlackBoxParameter(out string Errtext, int FileCount, int FileSize) { - return base.Channel.SetBlackBoxParameter(out Errtext, FileCount, FileSize); + public bool SetConveyorTimeOutTime(out string Errtext, int Timeout) { + return base.Channel.SetConveyorTimeOutTime(out Errtext, Timeout); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetBlackBoxParameter(int FileCount, int FileSize, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetBlackBoxParameter(FileCount, FileSize, callback, asyncState); + public System.IAsyncResult BeginSetConveyorTimeOutTime(int Timeout, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetConveyorTimeOutTime(Timeout, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetBlackBoxParameter(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndSetBlackBoxParameter(out Errtext, result); + public bool EndSetConveyorTimeOutTime(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndSetConveyorTimeOutTime(out Errtext, result); } - private System.IAsyncResult OnBeginSetBlackBoxParameter(object[] inValues, System.AsyncCallback callback, object asyncState) { - int FileCount = ((int)(inValues[0])); - int FileSize = ((int)(inValues[1])); - return this.BeginSetBlackBoxParameter(FileCount, FileSize, callback, asyncState); + private System.IAsyncResult OnBeginSetConveyorTimeOutTime(object[] inValues, System.AsyncCallback callback, object asyncState) { + int Timeout = ((int)(inValues[0])); + return this.BeginSetConveyorTimeOutTime(Timeout, callback, asyncState); } - private object[] OnEndSetBlackBoxParameter(System.IAsyncResult result) { + private object[] OnEndSetConveyorTimeOutTime(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetBlackBoxParameter(out Errtext, result); + bool retVal = this.EndSetConveyorTimeOutTime(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnSetBlackBoxParameterCompleted(object state) { - if ((this.SetBlackBoxParameterCompleted != null)) { + private void OnSetConveyorTimeOutTimeCompleted(object state) { + if ((this.SetConveyorTimeOutTimeCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetBlackBoxParameterCompleted(this, new SetBlackBoxParameterCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetConveyorTimeOutTimeCompleted(this, new SetConveyorTimeOutTimeCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetBlackBoxParameterAsync(int FileCount, int FileSize) { - this.SetBlackBoxParameterAsync(FileCount, FileSize, null); + public void SetConveyorTimeOutTimeAsync(int Timeout) { + this.SetConveyorTimeOutTimeAsync(Timeout, null); } - public void SetBlackBoxParameterAsync(int FileCount, int FileSize, object userState) { - if ((this.onBeginSetBlackBoxParameterDelegate == null)) { - this.onBeginSetBlackBoxParameterDelegate = new BeginOperationDelegate(this.OnBeginSetBlackBoxParameter); + public void SetConveyorTimeOutTimeAsync(int Timeout, object userState) { + if ((this.onBeginSetConveyorTimeOutTimeDelegate == null)) { + this.onBeginSetConveyorTimeOutTimeDelegate = new BeginOperationDelegate(this.OnBeginSetConveyorTimeOutTime); } - if ((this.onEndSetBlackBoxParameterDelegate == null)) { - this.onEndSetBlackBoxParameterDelegate = new EndOperationDelegate(this.OnEndSetBlackBoxParameter); + if ((this.onEndSetConveyorTimeOutTimeDelegate == null)) { + this.onEndSetConveyorTimeOutTimeDelegate = new EndOperationDelegate(this.OnEndSetConveyorTimeOutTime); } - if ((this.onSetBlackBoxParameterCompletedDelegate == null)) { - this.onSetBlackBoxParameterCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetBlackBoxParameterCompleted); + if ((this.onSetConveyorTimeOutTimeCompletedDelegate == null)) { + this.onSetConveyorTimeOutTimeCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetConveyorTimeOutTimeCompleted); } - base.InvokeAsync(this.onBeginSetBlackBoxParameterDelegate, new object[] { - FileCount, - FileSize}, this.onEndSetBlackBoxParameterDelegate, this.onSetBlackBoxParameterCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSetConveyorTimeOutTimeDelegate, new object[] { + Timeout}, this.onEndSetConveyorTimeOutTimeDelegate, this.onSetConveyorTimeOutTimeCompletedDelegate, userState); } - public string GetBlackBoxInfo(out string Errtext, string deviceIndex, System.DateTime BeginTime, System.DateTime EndTime) { - return base.Channel.GetBlackBoxInfo(out Errtext, deviceIndex, BeginTime, EndTime); + public int GetConveyorTimeOutTime(out string Errtext) { + return base.Channel.GetConveyorTimeOutTime(out Errtext); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetBlackBoxInfo(string deviceIndex, System.DateTime BeginTime, System.DateTime EndTime, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetBlackBoxInfo(deviceIndex, BeginTime, EndTime, callback, asyncState); + public System.IAsyncResult BeginGetConveyorTimeOutTime(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetConveyorTimeOutTime(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public string EndGetBlackBoxInfo(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndGetBlackBoxInfo(out Errtext, result); + public int EndGetConveyorTimeOutTime(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndGetConveyorTimeOutTime(out Errtext, result); } - private System.IAsyncResult OnBeginGetBlackBoxInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { - string deviceIndex = ((string)(inValues[0])); - System.DateTime BeginTime = ((System.DateTime)(inValues[1])); - System.DateTime EndTime = ((System.DateTime)(inValues[2])); - return this.BeginGetBlackBoxInfo(deviceIndex, BeginTime, EndTime, callback, asyncState); + private System.IAsyncResult OnBeginGetConveyorTimeOutTime(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginGetConveyorTimeOutTime(callback, asyncState); } - private object[] OnEndGetBlackBoxInfo(System.IAsyncResult result) { + private object[] OnEndGetConveyorTimeOutTime(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - string retVal = this.EndGetBlackBoxInfo(out Errtext, result); + int retVal = this.EndGetConveyorTimeOutTime(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnGetBlackBoxInfoCompleted(object state) { - if ((this.GetBlackBoxInfoCompleted != null)) { + private void OnGetConveyorTimeOutTimeCompleted(object state) { + if ((this.GetConveyorTimeOutTimeCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetBlackBoxInfoCompleted(this, new GetBlackBoxInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetConveyorTimeOutTimeCompleted(this, new GetConveyorTimeOutTimeCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetBlackBoxInfoAsync(string deviceIndex, System.DateTime BeginTime, System.DateTime EndTime) { - this.GetBlackBoxInfoAsync(deviceIndex, BeginTime, EndTime, null); + public void GetConveyorTimeOutTimeAsync() { + this.GetConveyorTimeOutTimeAsync(null); } - public void GetBlackBoxInfoAsync(string deviceIndex, System.DateTime BeginTime, System.DateTime EndTime, object userState) { - if ((this.onBeginGetBlackBoxInfoDelegate == null)) { - this.onBeginGetBlackBoxInfoDelegate = new BeginOperationDelegate(this.OnBeginGetBlackBoxInfo); + public void GetConveyorTimeOutTimeAsync(object userState) { + if ((this.onBeginGetConveyorTimeOutTimeDelegate == null)) { + this.onBeginGetConveyorTimeOutTimeDelegate = new BeginOperationDelegate(this.OnBeginGetConveyorTimeOutTime); } - if ((this.onEndGetBlackBoxInfoDelegate == null)) { - this.onEndGetBlackBoxInfoDelegate = new EndOperationDelegate(this.OnEndGetBlackBoxInfo); + if ((this.onEndGetConveyorTimeOutTimeDelegate == null)) { + this.onEndGetConveyorTimeOutTimeDelegate = new EndOperationDelegate(this.OnEndGetConveyorTimeOutTime); } - if ((this.onGetBlackBoxInfoCompletedDelegate == null)) { - this.onGetBlackBoxInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetBlackBoxInfoCompleted); + if ((this.onGetConveyorTimeOutTimeCompletedDelegate == null)) { + this.onGetConveyorTimeOutTimeCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetConveyorTimeOutTimeCompleted); } - base.InvokeAsync(this.onBeginGetBlackBoxInfoDelegate, new object[] { - deviceIndex, - BeginTime, - EndTime}, this.onEndGetBlackBoxInfoDelegate, this.onGetBlackBoxInfoCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetConveyorTimeOutTimeDelegate, null, this.onEndGetConveyorTimeOutTimeDelegate, this.onGetConveyorTimeOutTimeCompletedDelegate, userState); } - public System.Data.DataTable GetAutoTaskHistory(out string Errtext, System.DateTime BeginTime, System.DateTime EndTime) { - return base.Channel.GetAutoTaskHistory(out Errtext, BeginTime, EndTime); + public bool SetDBConnection(out string Errtext, string MonitorOrManageDB, string ServerHostName, string DBServiceName, string Username, string Password) { + return base.Channel.SetDBConnection(out Errtext, MonitorOrManageDB, ServerHostName, DBServiceName, Username, Password); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetAutoTaskHistory(System.DateTime BeginTime, System.DateTime EndTime, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetAutoTaskHistory(BeginTime, EndTime, callback, asyncState); + public System.IAsyncResult BeginSetDBConnection(string MonitorOrManageDB, string ServerHostName, string DBServiceName, string Username, string Password, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetDBConnection(MonitorOrManageDB, ServerHostName, DBServiceName, Username, Password, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.Data.DataTable EndGetAutoTaskHistory(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndGetAutoTaskHistory(out Errtext, result); + public bool EndSetDBConnection(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndSetDBConnection(out Errtext, result); } - private System.IAsyncResult OnBeginGetAutoTaskHistory(object[] inValues, System.AsyncCallback callback, object asyncState) { - System.DateTime BeginTime = ((System.DateTime)(inValues[0])); - System.DateTime EndTime = ((System.DateTime)(inValues[1])); - return this.BeginGetAutoTaskHistory(BeginTime, EndTime, callback, asyncState); + private System.IAsyncResult OnBeginSetDBConnection(object[] inValues, System.AsyncCallback callback, object asyncState) { + string MonitorOrManageDB = ((string)(inValues[0])); + string ServerHostName = ((string)(inValues[1])); + string DBServiceName = ((string)(inValues[2])); + string Username = ((string)(inValues[3])); + string Password = ((string)(inValues[4])); + return this.BeginSetDBConnection(MonitorOrManageDB, ServerHostName, DBServiceName, Username, Password, callback, asyncState); } - private object[] OnEndGetAutoTaskHistory(System.IAsyncResult result) { + private object[] OnEndSetDBConnection(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - System.Data.DataTable retVal = this.EndGetAutoTaskHistory(out Errtext, result); + bool retVal = this.EndSetDBConnection(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnGetAutoTaskHistoryCompleted(object state) { - if ((this.GetAutoTaskHistoryCompleted != null)) { + private void OnSetDBConnectionCompleted(object state) { + if ((this.SetDBConnectionCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetAutoTaskHistoryCompleted(this, new GetAutoTaskHistoryCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetDBConnectionCompleted(this, new SetDBConnectionCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetAutoTaskHistoryAsync(System.DateTime BeginTime, System.DateTime EndTime) { - this.GetAutoTaskHistoryAsync(BeginTime, EndTime, null); + public void SetDBConnectionAsync(string MonitorOrManageDB, string ServerHostName, string DBServiceName, string Username, string Password) { + this.SetDBConnectionAsync(MonitorOrManageDB, ServerHostName, DBServiceName, Username, Password, null); } - public void GetAutoTaskHistoryAsync(System.DateTime BeginTime, System.DateTime EndTime, object userState) { - if ((this.onBeginGetAutoTaskHistoryDelegate == null)) { - this.onBeginGetAutoTaskHistoryDelegate = new BeginOperationDelegate(this.OnBeginGetAutoTaskHistory); + public void SetDBConnectionAsync(string MonitorOrManageDB, string ServerHostName, string DBServiceName, string Username, string Password, object userState) { + if ((this.onBeginSetDBConnectionDelegate == null)) { + this.onBeginSetDBConnectionDelegate = new BeginOperationDelegate(this.OnBeginSetDBConnection); } - if ((this.onEndGetAutoTaskHistoryDelegate == null)) { - this.onEndGetAutoTaskHistoryDelegate = new EndOperationDelegate(this.OnEndGetAutoTaskHistory); + if ((this.onEndSetDBConnectionDelegate == null)) { + this.onEndSetDBConnectionDelegate = new EndOperationDelegate(this.OnEndSetDBConnection); } - if ((this.onGetAutoTaskHistoryCompletedDelegate == null)) { - this.onGetAutoTaskHistoryCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetAutoTaskHistoryCompleted); + if ((this.onSetDBConnectionCompletedDelegate == null)) { + this.onSetDBConnectionCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetDBConnectionCompleted); } - base.InvokeAsync(this.onBeginGetAutoTaskHistoryDelegate, new object[] { - BeginTime, - EndTime}, this.onEndGetAutoTaskHistoryDelegate, this.onGetAutoTaskHistoryCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSetDBConnectionDelegate, new object[] { + MonitorOrManageDB, + ServerHostName, + DBServiceName, + Username, + Password}, this.onEndSetDBConnectionDelegate, this.onSetDBConnectionCompletedDelegate, userState); } - public bool DeleteAutoTaskHistory(out string Errtext, System.DateTime BeginTime, System.DateTime EndTime) { - return base.Channel.DeleteAutoTaskHistory(out Errtext, BeginTime, EndTime); + public bool GetDBConnection(out string ServerHostName, out string DBServiceName, out string Username, out string Password, out string Errtext, string MonitorOrManageDB) { + return base.Channel.GetDBConnection(out ServerHostName, out DBServiceName, out Username, out Password, out Errtext, MonitorOrManageDB); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginDeleteAutoTaskHistory(System.DateTime BeginTime, System.DateTime EndTime, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginDeleteAutoTaskHistory(BeginTime, EndTime, callback, asyncState); + public System.IAsyncResult BeginGetDBConnection(string MonitorOrManageDB, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetDBConnection(MonitorOrManageDB, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndDeleteAutoTaskHistory(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndDeleteAutoTaskHistory(out Errtext, result); + public bool EndGetDBConnection(out string ServerHostName, out string DBServiceName, out string Username, out string Password, out string Errtext, System.IAsyncResult result) { + return base.Channel.EndGetDBConnection(out ServerHostName, out DBServiceName, out Username, out Password, out Errtext, result); } - private System.IAsyncResult OnBeginDeleteAutoTaskHistory(object[] inValues, System.AsyncCallback callback, object asyncState) { - System.DateTime BeginTime = ((System.DateTime)(inValues[0])); - System.DateTime EndTime = ((System.DateTime)(inValues[1])); - return this.BeginDeleteAutoTaskHistory(BeginTime, EndTime, callback, asyncState); + private System.IAsyncResult OnBeginGetDBConnection(object[] inValues, System.AsyncCallback callback, object asyncState) { + string MonitorOrManageDB = ((string)(inValues[0])); + return this.BeginGetDBConnection(MonitorOrManageDB, callback, asyncState); } - private object[] OnEndDeleteAutoTaskHistory(System.IAsyncResult result) { + private object[] OnEndGetDBConnection(System.IAsyncResult result) { + string ServerHostName = this.GetDefaultValueForInitialization(); + string DBServiceName = this.GetDefaultValueForInitialization(); + string Username = this.GetDefaultValueForInitialization(); + string Password = this.GetDefaultValueForInitialization(); string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndDeleteAutoTaskHistory(out Errtext, result); + bool retVal = this.EndGetDBConnection(out ServerHostName, out DBServiceName, out Username, out Password, out Errtext, result); return new object[] { + ServerHostName, + DBServiceName, + Username, + Password, Errtext, retVal}; } - private void OnDeleteAutoTaskHistoryCompleted(object state) { - if ((this.DeleteAutoTaskHistoryCompleted != null)) { + private void OnGetDBConnectionCompleted(object state) { + if ((this.GetDBConnectionCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.DeleteAutoTaskHistoryCompleted(this, new DeleteAutoTaskHistoryCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetDBConnectionCompleted(this, new GetDBConnectionCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void DeleteAutoTaskHistoryAsync(System.DateTime BeginTime, System.DateTime EndTime) { - this.DeleteAutoTaskHistoryAsync(BeginTime, EndTime, null); + public void GetDBConnectionAsync(string MonitorOrManageDB) { + this.GetDBConnectionAsync(MonitorOrManageDB, null); } - public void DeleteAutoTaskHistoryAsync(System.DateTime BeginTime, System.DateTime EndTime, object userState) { - if ((this.onBeginDeleteAutoTaskHistoryDelegate == null)) { - this.onBeginDeleteAutoTaskHistoryDelegate = new BeginOperationDelegate(this.OnBeginDeleteAutoTaskHistory); + public void GetDBConnectionAsync(string MonitorOrManageDB, object userState) { + if ((this.onBeginGetDBConnectionDelegate == null)) { + this.onBeginGetDBConnectionDelegate = new BeginOperationDelegate(this.OnBeginGetDBConnection); } - if ((this.onEndDeleteAutoTaskHistoryDelegate == null)) { - this.onEndDeleteAutoTaskHistoryDelegate = new EndOperationDelegate(this.OnEndDeleteAutoTaskHistory); + if ((this.onEndGetDBConnectionDelegate == null)) { + this.onEndGetDBConnectionDelegate = new EndOperationDelegate(this.OnEndGetDBConnection); } - if ((this.onDeleteAutoTaskHistoryCompletedDelegate == null)) { - this.onDeleteAutoTaskHistoryCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnDeleteAutoTaskHistoryCompleted); + if ((this.onGetDBConnectionCompletedDelegate == null)) { + this.onGetDBConnectionCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDBConnectionCompleted); } - base.InvokeAsync(this.onBeginDeleteAutoTaskHistoryDelegate, new object[] { - BeginTime, - EndTime}, this.onEndDeleteAutoTaskHistoryDelegate, this.onDeleteAutoTaskHistoryCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetDBConnectionDelegate, new object[] { + MonitorOrManageDB}, this.onEndGetDBConnectionDelegate, this.onGetDBConnectionCompletedDelegate, userState); } - public bool SetUserAndPurview(out string Errtext, string UserID, string UserName, string Password, string Purview) { - return base.Channel.SetUserAndPurview(out Errtext, UserID, UserName, Password, Purview); + public bool SetIOStationProperty(out string Errtext, int deviceIndex, int IOStationProperty) { + return base.Channel.SetIOStationProperty(out Errtext, deviceIndex, IOStationProperty); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetUserAndPurview(string UserID, string UserName, string Password, string Purview, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetUserAndPurview(UserID, UserName, Password, Purview, callback, asyncState); + public System.IAsyncResult BeginSetIOStationProperty(int deviceIndex, int IOStationProperty, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetIOStationProperty(deviceIndex, IOStationProperty, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetUserAndPurview(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndSetUserAndPurview(out Errtext, result); + public bool EndSetIOStationProperty(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndSetIOStationProperty(out Errtext, result); } - private System.IAsyncResult OnBeginSetUserAndPurview(object[] inValues, System.AsyncCallback callback, object asyncState) { - string UserID = ((string)(inValues[0])); - string UserName = ((string)(inValues[1])); - string Password = ((string)(inValues[2])); - string Purview = ((string)(inValues[3])); - return this.BeginSetUserAndPurview(UserID, UserName, Password, Purview, callback, asyncState); + private System.IAsyncResult OnBeginSetIOStationProperty(object[] inValues, System.AsyncCallback callback, object asyncState) { + int deviceIndex = ((int)(inValues[0])); + int IOStationProperty = ((int)(inValues[1])); + return this.BeginSetIOStationProperty(deviceIndex, IOStationProperty, callback, asyncState); } - private object[] OnEndSetUserAndPurview(System.IAsyncResult result) { + private object[] OnEndSetIOStationProperty(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetUserAndPurview(out Errtext, result); + bool retVal = this.EndSetIOStationProperty(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnSetUserAndPurviewCompleted(object state) { - if ((this.SetUserAndPurviewCompleted != null)) { + private void OnSetIOStationPropertyCompleted(object state) { + if ((this.SetIOStationPropertyCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetUserAndPurviewCompleted(this, new SetUserAndPurviewCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetIOStationPropertyCompleted(this, new SetIOStationPropertyCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetUserAndPurviewAsync(string UserID, string UserName, string Password, string Purview) { - this.SetUserAndPurviewAsync(UserID, UserName, Password, Purview, null); + public void SetIOStationPropertyAsync(int deviceIndex, int IOStationProperty) { + this.SetIOStationPropertyAsync(deviceIndex, IOStationProperty, null); } - public void SetUserAndPurviewAsync(string UserID, string UserName, string Password, string Purview, object userState) { - if ((this.onBeginSetUserAndPurviewDelegate == null)) { - this.onBeginSetUserAndPurviewDelegate = new BeginOperationDelegate(this.OnBeginSetUserAndPurview); + public void SetIOStationPropertyAsync(int deviceIndex, int IOStationProperty, object userState) { + if ((this.onBeginSetIOStationPropertyDelegate == null)) { + this.onBeginSetIOStationPropertyDelegate = new BeginOperationDelegate(this.OnBeginSetIOStationProperty); } - if ((this.onEndSetUserAndPurviewDelegate == null)) { - this.onEndSetUserAndPurviewDelegate = new EndOperationDelegate(this.OnEndSetUserAndPurview); + if ((this.onEndSetIOStationPropertyDelegate == null)) { + this.onEndSetIOStationPropertyDelegate = new EndOperationDelegate(this.OnEndSetIOStationProperty); } - if ((this.onSetUserAndPurviewCompletedDelegate == null)) { - this.onSetUserAndPurviewCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetUserAndPurviewCompleted); + if ((this.onSetIOStationPropertyCompletedDelegate == null)) { + this.onSetIOStationPropertyCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetIOStationPropertyCompleted); } - base.InvokeAsync(this.onBeginSetUserAndPurviewDelegate, new object[] { - UserID, - UserName, - Password, - Purview}, this.onEndSetUserAndPurviewDelegate, this.onSetUserAndPurviewCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSetIOStationPropertyDelegate, new object[] { + deviceIndex, + IOStationProperty}, this.onEndSetIOStationPropertyDelegate, this.onSetIOStationPropertyCompletedDelegate, userState); } - public bool GetUserAndPurview(out string UserName, out string Password, out string Purview, out string Errtext, string UserID) { - return base.Channel.GetUserAndPurview(out UserName, out Password, out Purview, out Errtext, UserID); + public bool SetBlackBoxParameter(out string Errtext, int FileCount, int FileSize) { + return base.Channel.SetBlackBoxParameter(out Errtext, FileCount, FileSize); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetUserAndPurview(string UserID, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetUserAndPurview(UserID, callback, asyncState); + public System.IAsyncResult BeginSetBlackBoxParameter(int FileCount, int FileSize, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetBlackBoxParameter(FileCount, FileSize, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndGetUserAndPurview(out string UserName, out string Password, out string Purview, out string Errtext, System.IAsyncResult result) { - return base.Channel.EndGetUserAndPurview(out UserName, out Password, out Purview, out Errtext, result); + public bool EndSetBlackBoxParameter(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndSetBlackBoxParameter(out Errtext, result); } - private System.IAsyncResult OnBeginGetUserAndPurview(object[] inValues, System.AsyncCallback callback, object asyncState) { - string UserID = ((string)(inValues[0])); - return this.BeginGetUserAndPurview(UserID, callback, asyncState); + private System.IAsyncResult OnBeginSetBlackBoxParameter(object[] inValues, System.AsyncCallback callback, object asyncState) { + int FileCount = ((int)(inValues[0])); + int FileSize = ((int)(inValues[1])); + return this.BeginSetBlackBoxParameter(FileCount, FileSize, callback, asyncState); } - private object[] OnEndGetUserAndPurview(System.IAsyncResult result) { - string UserName = this.GetDefaultValueForInitialization(); - string Password = this.GetDefaultValueForInitialization(); - string Purview = this.GetDefaultValueForInitialization(); + private object[] OnEndSetBlackBoxParameter(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndGetUserAndPurview(out UserName, out Password, out Purview, out Errtext, result); + bool retVal = this.EndSetBlackBoxParameter(out Errtext, result); return new object[] { - UserName, - Password, - Purview, Errtext, retVal}; } - private void OnGetUserAndPurviewCompleted(object state) { - if ((this.GetUserAndPurviewCompleted != null)) { + private void OnSetBlackBoxParameterCompleted(object state) { + if ((this.SetBlackBoxParameterCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetUserAndPurviewCompleted(this, new GetUserAndPurviewCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetBlackBoxParameterCompleted(this, new SetBlackBoxParameterCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetUserAndPurviewAsync(string UserID) { - this.GetUserAndPurviewAsync(UserID, null); + public void SetBlackBoxParameterAsync(int FileCount, int FileSize) { + this.SetBlackBoxParameterAsync(FileCount, FileSize, null); } - public void GetUserAndPurviewAsync(string UserID, object userState) { - if ((this.onBeginGetUserAndPurviewDelegate == null)) { - this.onBeginGetUserAndPurviewDelegate = new BeginOperationDelegate(this.OnBeginGetUserAndPurview); + public void SetBlackBoxParameterAsync(int FileCount, int FileSize, object userState) { + if ((this.onBeginSetBlackBoxParameterDelegate == null)) { + this.onBeginSetBlackBoxParameterDelegate = new BeginOperationDelegate(this.OnBeginSetBlackBoxParameter); } - if ((this.onEndGetUserAndPurviewDelegate == null)) { - this.onEndGetUserAndPurviewDelegate = new EndOperationDelegate(this.OnEndGetUserAndPurview); + if ((this.onEndSetBlackBoxParameterDelegate == null)) { + this.onEndSetBlackBoxParameterDelegate = new EndOperationDelegate(this.OnEndSetBlackBoxParameter); } - if ((this.onGetUserAndPurviewCompletedDelegate == null)) { - this.onGetUserAndPurviewCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetUserAndPurviewCompleted); + if ((this.onSetBlackBoxParameterCompletedDelegate == null)) { + this.onSetBlackBoxParameterCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetBlackBoxParameterCompleted); } - base.InvokeAsync(this.onBeginGetUserAndPurviewDelegate, new object[] { - UserID}, this.onEndGetUserAndPurviewDelegate, this.onGetUserAndPurviewCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSetBlackBoxParameterDelegate, new object[] { + FileCount, + FileSize}, this.onEndSetBlackBoxParameterDelegate, this.onSetBlackBoxParameterCompletedDelegate, userState); } - public bool SetUserPassword(out string Errtext, string UserID, string Password) { - return base.Channel.SetUserPassword(out Errtext, UserID, Password); + public string GetBlackBoxInfo(out string Errtext, string deviceIndex, System.DateTime BeginTime, System.DateTime EndTime) { + return base.Channel.GetBlackBoxInfo(out Errtext, deviceIndex, BeginTime, EndTime); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetUserPassword(string UserID, string Password, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetUserPassword(UserID, Password, callback, asyncState); + public System.IAsyncResult BeginGetBlackBoxInfo(string deviceIndex, System.DateTime BeginTime, System.DateTime EndTime, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetBlackBoxInfo(deviceIndex, BeginTime, EndTime, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetUserPassword(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndSetUserPassword(out Errtext, result); + public string EndGetBlackBoxInfo(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndGetBlackBoxInfo(out Errtext, result); } - private System.IAsyncResult OnBeginSetUserPassword(object[] inValues, System.AsyncCallback callback, object asyncState) { - string UserID = ((string)(inValues[0])); - string Password = ((string)(inValues[1])); - return this.BeginSetUserPassword(UserID, Password, callback, asyncState); + private System.IAsyncResult OnBeginGetBlackBoxInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { + string deviceIndex = ((string)(inValues[0])); + System.DateTime BeginTime = ((System.DateTime)(inValues[1])); + System.DateTime EndTime = ((System.DateTime)(inValues[2])); + return this.BeginGetBlackBoxInfo(deviceIndex, BeginTime, EndTime, callback, asyncState); } - private object[] OnEndSetUserPassword(System.IAsyncResult result) { + private object[] OnEndGetBlackBoxInfo(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetUserPassword(out Errtext, result); + string retVal = this.EndGetBlackBoxInfo(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnSetUserPasswordCompleted(object state) { - if ((this.SetUserPasswordCompleted != null)) { + private void OnGetBlackBoxInfoCompleted(object state) { + if ((this.GetBlackBoxInfoCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetUserPasswordCompleted(this, new SetUserPasswordCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetBlackBoxInfoCompleted(this, new GetBlackBoxInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetUserPasswordAsync(string UserID, string Password) { - this.SetUserPasswordAsync(UserID, Password, null); + public void GetBlackBoxInfoAsync(string deviceIndex, System.DateTime BeginTime, System.DateTime EndTime) { + this.GetBlackBoxInfoAsync(deviceIndex, BeginTime, EndTime, null); } - public void SetUserPasswordAsync(string UserID, string Password, object userState) { - if ((this.onBeginSetUserPasswordDelegate == null)) { - this.onBeginSetUserPasswordDelegate = new BeginOperationDelegate(this.OnBeginSetUserPassword); + public void GetBlackBoxInfoAsync(string deviceIndex, System.DateTime BeginTime, System.DateTime EndTime, object userState) { + if ((this.onBeginGetBlackBoxInfoDelegate == null)) { + this.onBeginGetBlackBoxInfoDelegate = new BeginOperationDelegate(this.OnBeginGetBlackBoxInfo); } - if ((this.onEndSetUserPasswordDelegate == null)) { - this.onEndSetUserPasswordDelegate = new EndOperationDelegate(this.OnEndSetUserPassword); + if ((this.onEndGetBlackBoxInfoDelegate == null)) { + this.onEndGetBlackBoxInfoDelegate = new EndOperationDelegate(this.OnEndGetBlackBoxInfo); } - if ((this.onSetUserPasswordCompletedDelegate == null)) { - this.onSetUserPasswordCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetUserPasswordCompleted); + if ((this.onGetBlackBoxInfoCompletedDelegate == null)) { + this.onGetBlackBoxInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetBlackBoxInfoCompleted); } - base.InvokeAsync(this.onBeginSetUserPasswordDelegate, new object[] { - UserID, - Password}, this.onEndSetUserPasswordDelegate, this.onSetUserPasswordCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetBlackBoxInfoDelegate, new object[] { + deviceIndex, + BeginTime, + EndTime}, this.onEndGetBlackBoxInfoDelegate, this.onGetBlackBoxInfoCompletedDelegate, userState); } - public string GetUserPassword(out string Errtext, string UserID) { - return base.Channel.GetUserPassword(out Errtext, UserID); + public System.Data.DataTable GetAutoTaskHistory(out string Errtext, System.DateTime BeginTime, System.DateTime EndTime) { + return base.Channel.GetAutoTaskHistory(out Errtext, BeginTime, EndTime); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetUserPassword(string UserID, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetUserPassword(UserID, callback, asyncState); + public System.IAsyncResult BeginGetAutoTaskHistory(System.DateTime BeginTime, System.DateTime EndTime, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetAutoTaskHistory(BeginTime, EndTime, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public string EndGetUserPassword(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndGetUserPassword(out Errtext, result); + public System.Data.DataTable EndGetAutoTaskHistory(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndGetAutoTaskHistory(out Errtext, result); } - private System.IAsyncResult OnBeginGetUserPassword(object[] inValues, System.AsyncCallback callback, object asyncState) { - string UserID = ((string)(inValues[0])); - return this.BeginGetUserPassword(UserID, callback, asyncState); + private System.IAsyncResult OnBeginGetAutoTaskHistory(object[] inValues, System.AsyncCallback callback, object asyncState) { + System.DateTime BeginTime = ((System.DateTime)(inValues[0])); + System.DateTime EndTime = ((System.DateTime)(inValues[1])); + return this.BeginGetAutoTaskHistory(BeginTime, EndTime, callback, asyncState); } - private object[] OnEndGetUserPassword(System.IAsyncResult result) { + private object[] OnEndGetAutoTaskHistory(System.IAsyncResult result) { string Errtext = this.GetDefaultValueForInitialization(); - string retVal = this.EndGetUserPassword(out Errtext, result); + System.Data.DataTable retVal = this.EndGetAutoTaskHistory(out Errtext, result); return new object[] { Errtext, retVal}; } - private void OnGetUserPasswordCompleted(object state) { - if ((this.GetUserPasswordCompleted != null)) { + private void OnGetAutoTaskHistoryCompleted(object state) { + if ((this.GetAutoTaskHistoryCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetUserPasswordCompleted(this, new GetUserPasswordCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetAutoTaskHistoryCompleted(this, new GetAutoTaskHistoryCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetUserPasswordAsync(string UserID) { - this.GetUserPasswordAsync(UserID, null); + public void GetAutoTaskHistoryAsync(System.DateTime BeginTime, System.DateTime EndTime) { + this.GetAutoTaskHistoryAsync(BeginTime, EndTime, null); } - public void GetUserPasswordAsync(string UserID, object userState) { - if ((this.onBeginGetUserPasswordDelegate == null)) { - this.onBeginGetUserPasswordDelegate = new BeginOperationDelegate(this.OnBeginGetUserPassword); + public void GetAutoTaskHistoryAsync(System.DateTime BeginTime, System.DateTime EndTime, object userState) { + if ((this.onBeginGetAutoTaskHistoryDelegate == null)) { + this.onBeginGetAutoTaskHistoryDelegate = new BeginOperationDelegate(this.OnBeginGetAutoTaskHistory); } - if ((this.onEndGetUserPasswordDelegate == null)) { - this.onEndGetUserPasswordDelegate = new EndOperationDelegate(this.OnEndGetUserPassword); + if ((this.onEndGetAutoTaskHistoryDelegate == null)) { + this.onEndGetAutoTaskHistoryDelegate = new EndOperationDelegate(this.OnEndGetAutoTaskHistory); } - if ((this.onGetUserPasswordCompletedDelegate == null)) { - this.onGetUserPasswordCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetUserPasswordCompleted); + if ((this.onGetAutoTaskHistoryCompletedDelegate == null)) { + this.onGetAutoTaskHistoryCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetAutoTaskHistoryCompleted); } - base.InvokeAsync(this.onBeginGetUserPasswordDelegate, new object[] { - UserID}, this.onEndGetUserPasswordDelegate, this.onGetUserPasswordCompletedDelegate, userState); - } + base.InvokeAsync(this.onBeginGetAutoTaskHistoryDelegate, new object[] { + BeginTime, + EndTime}, this.onEndGetAutoTaskHistoryDelegate, this.onGetAutoTaskHistoryCompletedDelegate, userState); + } - public bool GetReadedAndReportedBarcode(out string readedBarcode, out string reportedBarcode, out string errorText, int bindDeviceOfBarcode) { - return base.Channel.GetReadedAndReportedBarcode(out readedBarcode, out reportedBarcode, out errorText, bindDeviceOfBarcode); + public bool DeleteAutoTaskHistory(out string Errtext, System.DateTime BeginTime, System.DateTime EndTime) { + return base.Channel.DeleteAutoTaskHistory(out Errtext, BeginTime, EndTime); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetReadedAndReportedBarcode(int bindDeviceOfBarcode, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetReadedAndReportedBarcode(bindDeviceOfBarcode, callback, asyncState); + public System.IAsyncResult BeginDeleteAutoTaskHistory(System.DateTime BeginTime, System.DateTime EndTime, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginDeleteAutoTaskHistory(BeginTime, EndTime, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndGetReadedAndReportedBarcode(out string readedBarcode, out string reportedBarcode, out string errorText, System.IAsyncResult result) { - return base.Channel.EndGetReadedAndReportedBarcode(out readedBarcode, out reportedBarcode, out errorText, result); + public bool EndDeleteAutoTaskHistory(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndDeleteAutoTaskHistory(out Errtext, result); } - private System.IAsyncResult OnBeginGetReadedAndReportedBarcode(object[] inValues, System.AsyncCallback callback, object asyncState) { - int bindDeviceOfBarcode = ((int)(inValues[0])); - return this.BeginGetReadedAndReportedBarcode(bindDeviceOfBarcode, callback, asyncState); + private System.IAsyncResult OnBeginDeleteAutoTaskHistory(object[] inValues, System.AsyncCallback callback, object asyncState) { + System.DateTime BeginTime = ((System.DateTime)(inValues[0])); + System.DateTime EndTime = ((System.DateTime)(inValues[1])); + return this.BeginDeleteAutoTaskHistory(BeginTime, EndTime, callback, asyncState); } - private object[] OnEndGetReadedAndReportedBarcode(System.IAsyncResult result) { - string readedBarcode = this.GetDefaultValueForInitialization(); - string reportedBarcode = this.GetDefaultValueForInitialization(); - string errorText = this.GetDefaultValueForInitialization(); - bool retVal = this.EndGetReadedAndReportedBarcode(out readedBarcode, out reportedBarcode, out errorText, result); + private object[] OnEndDeleteAutoTaskHistory(System.IAsyncResult result) { + string Errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndDeleteAutoTaskHistory(out Errtext, result); return new object[] { - readedBarcode, - reportedBarcode, - errorText, + Errtext, retVal}; } - private void OnGetReadedAndReportedBarcodeCompleted(object state) { - if ((this.GetReadedAndReportedBarcodeCompleted != null)) { + private void OnDeleteAutoTaskHistoryCompleted(object state) { + if ((this.DeleteAutoTaskHistoryCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetReadedAndReportedBarcodeCompleted(this, new GetReadedAndReportedBarcodeCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.DeleteAutoTaskHistoryCompleted(this, new DeleteAutoTaskHistoryCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetReadedAndReportedBarcodeAsync(int bindDeviceOfBarcode) { - this.GetReadedAndReportedBarcodeAsync(bindDeviceOfBarcode, null); + public void DeleteAutoTaskHistoryAsync(System.DateTime BeginTime, System.DateTime EndTime) { + this.DeleteAutoTaskHistoryAsync(BeginTime, EndTime, null); } - public void GetReadedAndReportedBarcodeAsync(int bindDeviceOfBarcode, object userState) { - if ((this.onBeginGetReadedAndReportedBarcodeDelegate == null)) { - this.onBeginGetReadedAndReportedBarcodeDelegate = new BeginOperationDelegate(this.OnBeginGetReadedAndReportedBarcode); + public void DeleteAutoTaskHistoryAsync(System.DateTime BeginTime, System.DateTime EndTime, object userState) { + if ((this.onBeginDeleteAutoTaskHistoryDelegate == null)) { + this.onBeginDeleteAutoTaskHistoryDelegate = new BeginOperationDelegate(this.OnBeginDeleteAutoTaskHistory); } - if ((this.onEndGetReadedAndReportedBarcodeDelegate == null)) { - this.onEndGetReadedAndReportedBarcodeDelegate = new EndOperationDelegate(this.OnEndGetReadedAndReportedBarcode); + if ((this.onEndDeleteAutoTaskHistoryDelegate == null)) { + this.onEndDeleteAutoTaskHistoryDelegate = new EndOperationDelegate(this.OnEndDeleteAutoTaskHistory); } - if ((this.onGetReadedAndReportedBarcodeCompletedDelegate == null)) { - this.onGetReadedAndReportedBarcodeCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetReadedAndReportedBarcodeCompleted); + if ((this.onDeleteAutoTaskHistoryCompletedDelegate == null)) { + this.onDeleteAutoTaskHistoryCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnDeleteAutoTaskHistoryCompleted); } - base.InvokeAsync(this.onBeginGetReadedAndReportedBarcodeDelegate, new object[] { - bindDeviceOfBarcode}, this.onEndGetReadedAndReportedBarcodeDelegate, this.onGetReadedAndReportedBarcodeCompletedDelegate, userState); + base.InvokeAsync(this.onBeginDeleteAutoTaskHistoryDelegate, new object[] { + BeginTime, + EndTime}, this.onEndDeleteAutoTaskHistoryDelegate, this.onDeleteAutoTaskHistoryCompletedDelegate, userState); } - public Model.MError GetDeviceAllErrors(out string errorText, int deviceKindIndex) { - return base.Channel.GetDeviceAllErrors(out errorText, deviceKindIndex); + public bool SetUserAndPurview(out string Errtext, string UserID, string UserName, string Password, string Purview) { + return base.Channel.SetUserAndPurview(out Errtext, UserID, UserName, Password, Purview); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetDeviceAllErrors(int deviceKindIndex, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetDeviceAllErrors(deviceKindIndex, callback, asyncState); + public System.IAsyncResult BeginSetUserAndPurview(string UserID, string UserName, string Password, string Purview, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetUserAndPurview(UserID, UserName, Password, Purview, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public Model.MError EndGetDeviceAllErrors(out string errorText, System.IAsyncResult result) { - return base.Channel.EndGetDeviceAllErrors(out errorText, result); + public bool EndSetUserAndPurview(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndSetUserAndPurview(out Errtext, result); } - private System.IAsyncResult OnBeginGetDeviceAllErrors(object[] inValues, System.AsyncCallback callback, object asyncState) { - int deviceKindIndex = ((int)(inValues[0])); - return this.BeginGetDeviceAllErrors(deviceKindIndex, callback, asyncState); + private System.IAsyncResult OnBeginSetUserAndPurview(object[] inValues, System.AsyncCallback callback, object asyncState) { + string UserID = ((string)(inValues[0])); + string UserName = ((string)(inValues[1])); + string Password = ((string)(inValues[2])); + string Purview = ((string)(inValues[3])); + return this.BeginSetUserAndPurview(UserID, UserName, Password, Purview, callback, asyncState); } - private object[] OnEndGetDeviceAllErrors(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - Model.MError retVal = this.EndGetDeviceAllErrors(out errorText, result); + private object[] OnEndSetUserAndPurview(System.IAsyncResult result) { + string Errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndSetUserAndPurview(out Errtext, result); return new object[] { - errorText, + Errtext, retVal}; } - private void OnGetDeviceAllErrorsCompleted(object state) { - if ((this.GetDeviceAllErrorsCompleted != null)) { + private void OnSetUserAndPurviewCompleted(object state) { + if ((this.SetUserAndPurviewCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetDeviceAllErrorsCompleted(this, new GetDeviceAllErrorsCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetUserAndPurviewCompleted(this, new SetUserAndPurviewCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetDeviceAllErrorsAsync(int deviceKindIndex) { - this.GetDeviceAllErrorsAsync(deviceKindIndex, null); + public void SetUserAndPurviewAsync(string UserID, string UserName, string Password, string Purview) { + this.SetUserAndPurviewAsync(UserID, UserName, Password, Purview, null); } - public void GetDeviceAllErrorsAsync(int deviceKindIndex, object userState) { - if ((this.onBeginGetDeviceAllErrorsDelegate == null)) { - this.onBeginGetDeviceAllErrorsDelegate = new BeginOperationDelegate(this.OnBeginGetDeviceAllErrors); + public void SetUserAndPurviewAsync(string UserID, string UserName, string Password, string Purview, object userState) { + if ((this.onBeginSetUserAndPurviewDelegate == null)) { + this.onBeginSetUserAndPurviewDelegate = new BeginOperationDelegate(this.OnBeginSetUserAndPurview); } - if ((this.onEndGetDeviceAllErrorsDelegate == null)) { - this.onEndGetDeviceAllErrorsDelegate = new EndOperationDelegate(this.OnEndGetDeviceAllErrors); + if ((this.onEndSetUserAndPurviewDelegate == null)) { + this.onEndSetUserAndPurviewDelegate = new EndOperationDelegate(this.OnEndSetUserAndPurview); } - if ((this.onGetDeviceAllErrorsCompletedDelegate == null)) { - this.onGetDeviceAllErrorsCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDeviceAllErrorsCompleted); + if ((this.onSetUserAndPurviewCompletedDelegate == null)) { + this.onSetUserAndPurviewCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetUserAndPurviewCompleted); } - base.InvokeAsync(this.onBeginGetDeviceAllErrorsDelegate, new object[] { - deviceKindIndex}, this.onEndGetDeviceAllErrorsDelegate, this.onGetDeviceAllErrorsCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSetUserAndPurviewDelegate, new object[] { + UserID, + UserName, + Password, + Purview}, this.onEndSetUserAndPurviewDelegate, this.onSetUserAndPurviewCompletedDelegate, userState); } - public Model.MRoute[] GetAllRouteinfo(out string errorText) { - return base.Channel.GetAllRouteinfo(out errorText); + public bool GetUserAndPurview(out string UserName, out string Password, out string Purview, out string Errtext, string UserID) { + return base.Channel.GetUserAndPurview(out UserName, out Password, out Purview, out Errtext, UserID); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetAllRouteinfo(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetAllRouteinfo(callback, asyncState); + public System.IAsyncResult BeginGetUserAndPurview(string UserID, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetUserAndPurview(UserID, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public Model.MRoute[] EndGetAllRouteinfo(out string errorText, System.IAsyncResult result) { - return base.Channel.EndGetAllRouteinfo(out errorText, result); + public bool EndGetUserAndPurview(out string UserName, out string Password, out string Purview, out string Errtext, System.IAsyncResult result) { + return base.Channel.EndGetUserAndPurview(out UserName, out Password, out Purview, out Errtext, result); } - private System.IAsyncResult OnBeginGetAllRouteinfo(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginGetAllRouteinfo(callback, asyncState); + private System.IAsyncResult OnBeginGetUserAndPurview(object[] inValues, System.AsyncCallback callback, object asyncState) { + string UserID = ((string)(inValues[0])); + return this.BeginGetUserAndPurview(UserID, callback, asyncState); } - private object[] OnEndGetAllRouteinfo(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - Model.MRoute[] retVal = this.EndGetAllRouteinfo(out errorText, result); + private object[] OnEndGetUserAndPurview(System.IAsyncResult result) { + string UserName = this.GetDefaultValueForInitialization(); + string Password = this.GetDefaultValueForInitialization(); + string Purview = this.GetDefaultValueForInitialization(); + string Errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndGetUserAndPurview(out UserName, out Password, out Purview, out Errtext, result); return new object[] { - errorText, + UserName, + Password, + Purview, + Errtext, retVal}; } - private void OnGetAllRouteinfoCompleted(object state) { - if ((this.GetAllRouteinfoCompleted != null)) { + private void OnGetUserAndPurviewCompleted(object state) { + if ((this.GetUserAndPurviewCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetAllRouteinfoCompleted(this, new GetAllRouteinfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetUserAndPurviewCompleted(this, new GetUserAndPurviewCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetAllRouteinfoAsync() { - this.GetAllRouteinfoAsync(null); + public void GetUserAndPurviewAsync(string UserID) { + this.GetUserAndPurviewAsync(UserID, null); } - public void GetAllRouteinfoAsync(object userState) { - if ((this.onBeginGetAllRouteinfoDelegate == null)) { - this.onBeginGetAllRouteinfoDelegate = new BeginOperationDelegate(this.OnBeginGetAllRouteinfo); + public void GetUserAndPurviewAsync(string UserID, object userState) { + if ((this.onBeginGetUserAndPurviewDelegate == null)) { + this.onBeginGetUserAndPurviewDelegate = new BeginOperationDelegate(this.OnBeginGetUserAndPurview); } - if ((this.onEndGetAllRouteinfoDelegate == null)) { - this.onEndGetAllRouteinfoDelegate = new EndOperationDelegate(this.OnEndGetAllRouteinfo); + if ((this.onEndGetUserAndPurviewDelegate == null)) { + this.onEndGetUserAndPurviewDelegate = new EndOperationDelegate(this.OnEndGetUserAndPurview); } - if ((this.onGetAllRouteinfoCompletedDelegate == null)) { - this.onGetAllRouteinfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetAllRouteinfoCompleted); + if ((this.onGetUserAndPurviewCompletedDelegate == null)) { + this.onGetUserAndPurviewCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetUserAndPurviewCompleted); } - base.InvokeAsync(this.onBeginGetAllRouteinfoDelegate, null, this.onEndGetAllRouteinfoDelegate, this.onGetAllRouteinfoCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetUserAndPurviewDelegate, new object[] { + UserID}, this.onEndGetUserAndPurviewDelegate, this.onGetUserAndPurviewCompletedDelegate, userState); } - public Model.MRoute[] GetDeviceJoinRouteinfo(out string errorText, int deviceIndex) { - return base.Channel.GetDeviceJoinRouteinfo(out errorText, deviceIndex); + public bool SetUserPassword(out string Errtext, string UserID, string Password) { + return base.Channel.SetUserPassword(out Errtext, UserID, Password); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetDeviceJoinRouteinfo(int deviceIndex, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetDeviceJoinRouteinfo(deviceIndex, callback, asyncState); + public System.IAsyncResult BeginSetUserPassword(string UserID, string Password, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetUserPassword(UserID, Password, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public Model.MRoute[] EndGetDeviceJoinRouteinfo(out string errorText, System.IAsyncResult result) { - return base.Channel.EndGetDeviceJoinRouteinfo(out errorText, result); + public bool EndSetUserPassword(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndSetUserPassword(out Errtext, result); } - private System.IAsyncResult OnBeginGetDeviceJoinRouteinfo(object[] inValues, System.AsyncCallback callback, object asyncState) { - int deviceIndex = ((int)(inValues[0])); - return this.BeginGetDeviceJoinRouteinfo(deviceIndex, callback, asyncState); + private System.IAsyncResult OnBeginSetUserPassword(object[] inValues, System.AsyncCallback callback, object asyncState) { + string UserID = ((string)(inValues[0])); + string Password = ((string)(inValues[1])); + return this.BeginSetUserPassword(UserID, Password, callback, asyncState); } - private object[] OnEndGetDeviceJoinRouteinfo(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - Model.MRoute[] retVal = this.EndGetDeviceJoinRouteinfo(out errorText, result); + private object[] OnEndSetUserPassword(System.IAsyncResult result) { + string Errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndSetUserPassword(out Errtext, result); return new object[] { - errorText, + Errtext, retVal}; } - private void OnGetDeviceJoinRouteinfoCompleted(object state) { - if ((this.GetDeviceJoinRouteinfoCompleted != null)) { + private void OnSetUserPasswordCompleted(object state) { + if ((this.SetUserPasswordCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetDeviceJoinRouteinfoCompleted(this, new GetDeviceJoinRouteinfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetUserPasswordCompleted(this, new SetUserPasswordCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetDeviceJoinRouteinfoAsync(int deviceIndex) { - this.GetDeviceJoinRouteinfoAsync(deviceIndex, null); + public void SetUserPasswordAsync(string UserID, string Password) { + this.SetUserPasswordAsync(UserID, Password, null); } - public void GetDeviceJoinRouteinfoAsync(int deviceIndex, object userState) { - if ((this.onBeginGetDeviceJoinRouteinfoDelegate == null)) { - this.onBeginGetDeviceJoinRouteinfoDelegate = new BeginOperationDelegate(this.OnBeginGetDeviceJoinRouteinfo); + public void SetUserPasswordAsync(string UserID, string Password, object userState) { + if ((this.onBeginSetUserPasswordDelegate == null)) { + this.onBeginSetUserPasswordDelegate = new BeginOperationDelegate(this.OnBeginSetUserPassword); } - if ((this.onEndGetDeviceJoinRouteinfoDelegate == null)) { - this.onEndGetDeviceJoinRouteinfoDelegate = new EndOperationDelegate(this.OnEndGetDeviceJoinRouteinfo); + if ((this.onEndSetUserPasswordDelegate == null)) { + this.onEndSetUserPasswordDelegate = new EndOperationDelegate(this.OnEndSetUserPassword); } - if ((this.onGetDeviceJoinRouteinfoCompletedDelegate == null)) { - this.onGetDeviceJoinRouteinfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDeviceJoinRouteinfoCompleted); + if ((this.onSetUserPasswordCompletedDelegate == null)) { + this.onSetUserPasswordCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetUserPasswordCompleted); } - base.InvokeAsync(this.onBeginGetDeviceJoinRouteinfoDelegate, new object[] { - deviceIndex}, this.onEndGetDeviceJoinRouteinfoDelegate, this.onGetDeviceJoinRouteinfoCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSetUserPasswordDelegate, new object[] { + UserID, + Password}, this.onEndSetUserPasswordDelegate, this.onSetUserPasswordCompletedDelegate, userState); } - public wcfControlMonitorClient.WcfControlMonitor.ManageTask[] GetManageTasks(out string errorText, string FieldName, string content) { - return base.Channel.GetManageTasks(out errorText, FieldName, content); + public string GetUserPassword(out string Errtext, string UserID) { + return base.Channel.GetUserPassword(out Errtext, UserID); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetManageTasks(string FieldName, string content, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetManageTasks(FieldName, content, callback, asyncState); + public System.IAsyncResult BeginGetUserPassword(string UserID, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetUserPassword(UserID, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public wcfControlMonitorClient.WcfControlMonitor.ManageTask[] EndGetManageTasks(out string errorText, System.IAsyncResult result) { - return base.Channel.EndGetManageTasks(out errorText, result); + public string EndGetUserPassword(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndGetUserPassword(out Errtext, result); } - private System.IAsyncResult OnBeginGetManageTasks(object[] inValues, System.AsyncCallback callback, object asyncState) { - string FieldName = ((string)(inValues[0])); - string content = ((string)(inValues[1])); - return this.BeginGetManageTasks(FieldName, content, callback, asyncState); + private System.IAsyncResult OnBeginGetUserPassword(object[] inValues, System.AsyncCallback callback, object asyncState) { + string UserID = ((string)(inValues[0])); + return this.BeginGetUserPassword(UserID, callback, asyncState); } - private object[] OnEndGetManageTasks(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - wcfControlMonitorClient.WcfControlMonitor.ManageTask[] retVal = this.EndGetManageTasks(out errorText, result); + private object[] OnEndGetUserPassword(System.IAsyncResult result) { + string Errtext = this.GetDefaultValueForInitialization(); + string retVal = this.EndGetUserPassword(out Errtext, result); return new object[] { - errorText, + Errtext, retVal}; } - private void OnGetManageTasksCompleted(object state) { - if ((this.GetManageTasksCompleted != null)) { + private void OnGetUserPasswordCompleted(object state) { + if ((this.GetUserPasswordCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetManageTasksCompleted(this, new GetManageTasksCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetUserPasswordCompleted(this, new GetUserPasswordCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetManageTasksAsync(string FieldName, string content) { - this.GetManageTasksAsync(FieldName, content, null); + public void GetUserPasswordAsync(string UserID) { + this.GetUserPasswordAsync(UserID, null); } - public void GetManageTasksAsync(string FieldName, string content, object userState) { - if ((this.onBeginGetManageTasksDelegate == null)) { - this.onBeginGetManageTasksDelegate = new BeginOperationDelegate(this.OnBeginGetManageTasks); + public void GetUserPasswordAsync(string UserID, object userState) { + if ((this.onBeginGetUserPasswordDelegate == null)) { + this.onBeginGetUserPasswordDelegate = new BeginOperationDelegate(this.OnBeginGetUserPassword); } - if ((this.onEndGetManageTasksDelegate == null)) { - this.onEndGetManageTasksDelegate = new EndOperationDelegate(this.OnEndGetManageTasks); + if ((this.onEndGetUserPasswordDelegate == null)) { + this.onEndGetUserPasswordDelegate = new EndOperationDelegate(this.OnEndGetUserPassword); } - if ((this.onGetManageTasksCompletedDelegate == null)) { - this.onGetManageTasksCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetManageTasksCompleted); + if ((this.onGetUserPasswordCompletedDelegate == null)) { + this.onGetUserPasswordCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetUserPasswordCompleted); } - base.InvokeAsync(this.onBeginGetManageTasksDelegate, new object[] { - FieldName, - content}, this.onEndGetManageTasksDelegate, this.onGetManageTasksCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetUserPasswordDelegate, new object[] { + UserID}, this.onEndGetUserPasswordDelegate, this.onGetUserPasswordCompletedDelegate, userState); } - public wcfControlMonitorClient.WcfControlMonitor.MonitorTask[] GetMonitorTasks(out string errorText, string FieldName, string content) { - return base.Channel.GetMonitorTasks(out errorText, FieldName, content); + public bool ShutDownControlSystem(out string ErrText) { + return base.Channel.ShutDownControlSystem(out ErrText); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetMonitorTasks(string FieldName, string content, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetMonitorTasks(FieldName, content, callback, asyncState); + public System.IAsyncResult BeginShutDownControlSystem(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginShutDownControlSystem(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public wcfControlMonitorClient.WcfControlMonitor.MonitorTask[] EndGetMonitorTasks(out string errorText, System.IAsyncResult result) { - return base.Channel.EndGetMonitorTasks(out errorText, result); + public bool EndShutDownControlSystem(out string ErrText, System.IAsyncResult result) { + return base.Channel.EndShutDownControlSystem(out ErrText, result); } - private System.IAsyncResult OnBeginGetMonitorTasks(object[] inValues, System.AsyncCallback callback, object asyncState) { - string FieldName = ((string)(inValues[0])); - string content = ((string)(inValues[1])); - return this.BeginGetMonitorTasks(FieldName, content, callback, asyncState); + private System.IAsyncResult OnBeginShutDownControlSystem(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginShutDownControlSystem(callback, asyncState); + } + + private object[] OnEndShutDownControlSystem(System.IAsyncResult result) { + string ErrText = this.GetDefaultValueForInitialization(); + bool retVal = this.EndShutDownControlSystem(out ErrText, result); + return new object[] { + ErrText, + retVal}; + } + + private void OnShutDownControlSystemCompleted(object state) { + if ((this.ShutDownControlSystemCompleted != null)) { + InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); + this.ShutDownControlSystemCompleted(this, new ShutDownControlSystemCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + } + } + + public void ShutDownControlSystemAsync() { + this.ShutDownControlSystemAsync(null); + } + + public void ShutDownControlSystemAsync(object userState) { + if ((this.onBeginShutDownControlSystemDelegate == null)) { + this.onBeginShutDownControlSystemDelegate = new BeginOperationDelegate(this.OnBeginShutDownControlSystem); + } + if ((this.onEndShutDownControlSystemDelegate == null)) { + this.onEndShutDownControlSystemDelegate = new EndOperationDelegate(this.OnEndShutDownControlSystem); + } + if ((this.onShutDownControlSystemCompletedDelegate == null)) { + this.onShutDownControlSystemCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnShutDownControlSystemCompleted); + } + base.InvokeAsync(this.onBeginShutDownControlSystemDelegate, null, this.onEndShutDownControlSystemDelegate, this.onShutDownControlSystemCompletedDelegate, userState); + } + + public bool StartGetALLDeviceState(out string Errtext) { + return base.Channel.StartGetALLDeviceState(out Errtext); + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + public System.IAsyncResult BeginStartGetALLDeviceState(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginStartGetALLDeviceState(callback, asyncState); + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + public bool EndStartGetALLDeviceState(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndStartGetALLDeviceState(out Errtext, result); + } + + private System.IAsyncResult OnBeginStartGetALLDeviceState(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginStartGetALLDeviceState(callback, asyncState); } - private object[] OnEndGetMonitorTasks(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - wcfControlMonitorClient.WcfControlMonitor.MonitorTask[] retVal = this.EndGetMonitorTasks(out errorText, result); + private object[] OnEndStartGetALLDeviceState(System.IAsyncResult result) { + string Errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndStartGetALLDeviceState(out Errtext, result); return new object[] { - errorText, + Errtext, retVal}; } - private void OnGetMonitorTasksCompleted(object state) { - if ((this.GetMonitorTasksCompleted != null)) { + private void OnStartGetALLDeviceStateCompleted(object state) { + if ((this.StartGetALLDeviceStateCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetMonitorTasksCompleted(this, new GetMonitorTasksCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.StartGetALLDeviceStateCompleted(this, new StartGetALLDeviceStateCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetMonitorTasksAsync(string FieldName, string content) { - this.GetMonitorTasksAsync(FieldName, content, null); + public void StartGetALLDeviceStateAsync() { + this.StartGetALLDeviceStateAsync(null); } - public void GetMonitorTasksAsync(string FieldName, string content, object userState) { - if ((this.onBeginGetMonitorTasksDelegate == null)) { - this.onBeginGetMonitorTasksDelegate = new BeginOperationDelegate(this.OnBeginGetMonitorTasks); + public void StartGetALLDeviceStateAsync(object userState) { + if ((this.onBeginStartGetALLDeviceStateDelegate == null)) { + this.onBeginStartGetALLDeviceStateDelegate = new BeginOperationDelegate(this.OnBeginStartGetALLDeviceState); } - if ((this.onEndGetMonitorTasksDelegate == null)) { - this.onEndGetMonitorTasksDelegate = new EndOperationDelegate(this.OnEndGetMonitorTasks); + if ((this.onEndStartGetALLDeviceStateDelegate == null)) { + this.onEndStartGetALLDeviceStateDelegate = new EndOperationDelegate(this.OnEndStartGetALLDeviceState); } - if ((this.onGetMonitorTasksCompletedDelegate == null)) { - this.onGetMonitorTasksCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetMonitorTasksCompleted); + if ((this.onStartGetALLDeviceStateCompletedDelegate == null)) { + this.onStartGetALLDeviceStateCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnStartGetALLDeviceStateCompleted); } - base.InvokeAsync(this.onBeginGetMonitorTasksDelegate, new object[] { - FieldName, - content}, this.onEndGetMonitorTasksDelegate, this.onGetMonitorTasksCompletedDelegate, userState); + base.InvokeAsync(this.onBeginStartGetALLDeviceStateDelegate, null, this.onEndStartGetALLDeviceStateDelegate, this.onStartGetALLDeviceStateCompletedDelegate, userState); } - public wcfControlMonitorClient.WcfControlMonitor.DeviceStateType GetDeviceStateInfo(out string errorText, int deviceIndex) { - return base.Channel.GetDeviceStateInfo(out errorText, deviceIndex); + public bool StartSendDeviceOrder(out string Errtext) { + return base.Channel.StartSendDeviceOrder(out Errtext); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetDeviceStateInfo(int deviceIndex, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetDeviceStateInfo(deviceIndex, callback, asyncState); + public System.IAsyncResult BeginStartSendDeviceOrder(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginStartSendDeviceOrder(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public wcfControlMonitorClient.WcfControlMonitor.DeviceStateType EndGetDeviceStateInfo(out string errorText, System.IAsyncResult result) { - return base.Channel.EndGetDeviceStateInfo(out errorText, result); + public bool EndStartSendDeviceOrder(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndStartSendDeviceOrder(out Errtext, result); } - private System.IAsyncResult OnBeginGetDeviceStateInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { - int deviceIndex = ((int)(inValues[0])); - return this.BeginGetDeviceStateInfo(deviceIndex, callback, asyncState); + private System.IAsyncResult OnBeginStartSendDeviceOrder(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginStartSendDeviceOrder(callback, asyncState); } - private object[] OnEndGetDeviceStateInfo(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - wcfControlMonitorClient.WcfControlMonitor.DeviceStateType retVal = this.EndGetDeviceStateInfo(out errorText, result); + private object[] OnEndStartSendDeviceOrder(System.IAsyncResult result) { + string Errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndStartSendDeviceOrder(out Errtext, result); return new object[] { - errorText, + Errtext, retVal}; } - private void OnGetDeviceStateInfoCompleted(object state) { - if ((this.GetDeviceStateInfoCompleted != null)) { + private void OnStartSendDeviceOrderCompleted(object state) { + if ((this.StartSendDeviceOrderCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetDeviceStateInfoCompleted(this, new GetDeviceStateInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.StartSendDeviceOrderCompleted(this, new StartSendDeviceOrderCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetDeviceStateInfoAsync(int deviceIndex) { - this.GetDeviceStateInfoAsync(deviceIndex, null); + public void StartSendDeviceOrderAsync() { + this.StartSendDeviceOrderAsync(null); } - public void GetDeviceStateInfoAsync(int deviceIndex, object userState) { - if ((this.onBeginGetDeviceStateInfoDelegate == null)) { - this.onBeginGetDeviceStateInfoDelegate = new BeginOperationDelegate(this.OnBeginGetDeviceStateInfo); + public void StartSendDeviceOrderAsync(object userState) { + if ((this.onBeginStartSendDeviceOrderDelegate == null)) { + this.onBeginStartSendDeviceOrderDelegate = new BeginOperationDelegate(this.OnBeginStartSendDeviceOrder); } - if ((this.onEndGetDeviceStateInfoDelegate == null)) { - this.onEndGetDeviceStateInfoDelegate = new EndOperationDelegate(this.OnEndGetDeviceStateInfo); + if ((this.onEndStartSendDeviceOrderDelegate == null)) { + this.onEndStartSendDeviceOrderDelegate = new EndOperationDelegate(this.OnEndStartSendDeviceOrder); } - if ((this.onGetDeviceStateInfoCompletedDelegate == null)) { - this.onGetDeviceStateInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDeviceStateInfoCompleted); + if ((this.onStartSendDeviceOrderCompletedDelegate == null)) { + this.onStartSendDeviceOrderCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnStartSendDeviceOrderCompleted); } - base.InvokeAsync(this.onBeginGetDeviceStateInfoDelegate, new object[] { - deviceIndex}, this.onEndGetDeviceStateInfoDelegate, this.onGetDeviceStateInfoCompletedDelegate, userState); + base.InvokeAsync(this.onBeginStartSendDeviceOrderDelegate, null, this.onEndStartSendDeviceOrderDelegate, this.onStartSendDeviceOrderCompletedDelegate, userState); } - public bool SetDeviceStateInfo(out string errorText, wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate) { - return base.Channel.SetDeviceStateInfo(out errorText, devstate); + public bool DataClear(out string Errtext) { + return base.Channel.DataClear(out Errtext); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetDeviceStateInfo(wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetDeviceStateInfo(devstate, callback, asyncState); + public System.IAsyncResult BeginDataClear(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginDataClear(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetDeviceStateInfo(out string errorText, System.IAsyncResult result) { - return base.Channel.EndSetDeviceStateInfo(out errorText, result); + public bool EndDataClear(out string Errtext, System.IAsyncResult result) { + return base.Channel.EndDataClear(out Errtext, result); } - private System.IAsyncResult OnBeginSetDeviceStateInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { - wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate = ((wcfControlMonitorClient.WcfControlMonitor.DeviceStateType)(inValues[0])); - return this.BeginSetDeviceStateInfo(devstate, callback, asyncState); + private System.IAsyncResult OnBeginDataClear(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginDataClear(callback, asyncState); } - private object[] OnEndSetDeviceStateInfo(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetDeviceStateInfo(out errorText, result); + private object[] OnEndDataClear(System.IAsyncResult result) { + string Errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndDataClear(out Errtext, result); return new object[] { - errorText, + Errtext, retVal}; } - private void OnSetDeviceStateInfoCompleted(object state) { - if ((this.SetDeviceStateInfoCompleted != null)) { + private void OnDataClearCompleted(object state) { + if ((this.DataClearCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetDeviceStateInfoCompleted(this, new SetDeviceStateInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.DataClearCompleted(this, new DataClearCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetDeviceStateInfoAsync(wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate) { - this.SetDeviceStateInfoAsync(devstate, null); + public void DataClearAsync() { + this.DataClearAsync(null); } - public void SetDeviceStateInfoAsync(wcfControlMonitorClient.WcfControlMonitor.DeviceStateType devstate, object userState) { - if ((this.onBeginSetDeviceStateInfoDelegate == null)) { - this.onBeginSetDeviceStateInfoDelegate = new BeginOperationDelegate(this.OnBeginSetDeviceStateInfo); + public void DataClearAsync(object userState) { + if ((this.onBeginDataClearDelegate == null)) { + this.onBeginDataClearDelegate = new BeginOperationDelegate(this.OnBeginDataClear); } - if ((this.onEndSetDeviceStateInfoDelegate == null)) { - this.onEndSetDeviceStateInfoDelegate = new EndOperationDelegate(this.OnEndSetDeviceStateInfo); + if ((this.onEndDataClearDelegate == null)) { + this.onEndDataClearDelegate = new EndOperationDelegate(this.OnEndDataClear); } - if ((this.onSetDeviceStateInfoCompletedDelegate == null)) { - this.onSetDeviceStateInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetDeviceStateInfoCompleted); + if ((this.onDataClearCompletedDelegate == null)) { + this.onDataClearCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnDataClearCompleted); } - base.InvokeAsync(this.onBeginSetDeviceStateInfoDelegate, new object[] { - devstate}, this.onEndSetDeviceStateInfoDelegate, this.onSetDeviceStateInfoCompletedDelegate, userState); + base.InvokeAsync(this.onBeginDataClearDelegate, null, this.onEndDataClearDelegate, this.onDataClearCompletedDelegate, userState); } - public bool SetRouteStateInfo(out string errorText, int routeID, bool isEnabled) { - return base.Channel.SetRouteStateInfo(out errorText, routeID, isEnabled); + public int GetManageTaskKindFromMonitor(out string errtext, int monitorIndex) { + return base.Channel.GetManageTaskKindFromMonitor(out errtext, monitorIndex); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetRouteStateInfo(int routeID, bool isEnabled, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetRouteStateInfo(routeID, isEnabled, callback, asyncState); + public System.IAsyncResult BeginGetManageTaskKindFromMonitor(int monitorIndex, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetManageTaskKindFromMonitor(monitorIndex, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetRouteStateInfo(out string errorText, System.IAsyncResult result) { - return base.Channel.EndSetRouteStateInfo(out errorText, result); + public int EndGetManageTaskKindFromMonitor(out string errtext, System.IAsyncResult result) { + return base.Channel.EndGetManageTaskKindFromMonitor(out errtext, result); } - private System.IAsyncResult OnBeginSetRouteStateInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { - int routeID = ((int)(inValues[0])); - bool isEnabled = ((bool)(inValues[1])); - return this.BeginSetRouteStateInfo(routeID, isEnabled, callback, asyncState); + private System.IAsyncResult OnBeginGetManageTaskKindFromMonitor(object[] inValues, System.AsyncCallback callback, object asyncState) { + int monitorIndex = ((int)(inValues[0])); + return this.BeginGetManageTaskKindFromMonitor(monitorIndex, callback, asyncState); } - private object[] OnEndSetRouteStateInfo(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetRouteStateInfo(out errorText, result); + private object[] OnEndGetManageTaskKindFromMonitor(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + int retVal = this.EndGetManageTaskKindFromMonitor(out errtext, result); return new object[] { - errorText, + errtext, retVal}; } - private void OnSetRouteStateInfoCompleted(object state) { - if ((this.SetRouteStateInfoCompleted != null)) { + private void OnGetManageTaskKindFromMonitorCompleted(object state) { + if ((this.GetManageTaskKindFromMonitorCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetRouteStateInfoCompleted(this, new SetRouteStateInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetManageTaskKindFromMonitorCompleted(this, new GetManageTaskKindFromMonitorCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetRouteStateInfoAsync(int routeID, bool isEnabled) { - this.SetRouteStateInfoAsync(routeID, isEnabled, null); + public void GetManageTaskKindFromMonitorAsync(int monitorIndex) { + this.GetManageTaskKindFromMonitorAsync(monitorIndex, null); } - public void SetRouteStateInfoAsync(int routeID, bool isEnabled, object userState) { - if ((this.onBeginSetRouteStateInfoDelegate == null)) { - this.onBeginSetRouteStateInfoDelegate = new BeginOperationDelegate(this.OnBeginSetRouteStateInfo); + public void GetManageTaskKindFromMonitorAsync(int monitorIndex, object userState) { + if ((this.onBeginGetManageTaskKindFromMonitorDelegate == null)) { + this.onBeginGetManageTaskKindFromMonitorDelegate = new BeginOperationDelegate(this.OnBeginGetManageTaskKindFromMonitor); } - if ((this.onEndSetRouteStateInfoDelegate == null)) { - this.onEndSetRouteStateInfoDelegate = new EndOperationDelegate(this.OnEndSetRouteStateInfo); + if ((this.onEndGetManageTaskKindFromMonitorDelegate == null)) { + this.onEndGetManageTaskKindFromMonitorDelegate = new EndOperationDelegate(this.OnEndGetManageTaskKindFromMonitor); } - if ((this.onSetRouteStateInfoCompletedDelegate == null)) { - this.onSetRouteStateInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetRouteStateInfoCompleted); + if ((this.onGetManageTaskKindFromMonitorCompletedDelegate == null)) { + this.onGetManageTaskKindFromMonitorCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetManageTaskKindFromMonitorCompleted); } - base.InvokeAsync(this.onBeginSetRouteStateInfoDelegate, new object[] { - routeID, - isEnabled}, this.onEndSetRouteStateInfoDelegate, this.onSetRouteStateInfoCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetManageTaskKindFromMonitorDelegate, new object[] { + monitorIndex}, this.onEndGetManageTaskKindFromMonitorDelegate, this.onGetManageTaskKindFromMonitorCompletedDelegate, userState); } - public bool SetDeviceJoinRouteStateInfo(out string errorText, int deviceIndex, bool isEnabled) { - return base.Channel.SetDeviceJoinRouteStateInfo(out errorText, deviceIndex, isEnabled); + public long GetManageTaskIndexFromMonitor(out string errtext, int monitorIndex) { + return base.Channel.GetManageTaskIndexFromMonitor(out errtext, monitorIndex); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginSetDeviceJoinRouteStateInfo(int deviceIndex, bool isEnabled, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginSetDeviceJoinRouteStateInfo(deviceIndex, isEnabled, callback, asyncState); + public System.IAsyncResult BeginGetManageTaskIndexFromMonitor(int monitorIndex, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetManageTaskIndexFromMonitor(monitorIndex, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndSetDeviceJoinRouteStateInfo(out string errorText, System.IAsyncResult result) { - return base.Channel.EndSetDeviceJoinRouteStateInfo(out errorText, result); + public long EndGetManageTaskIndexFromMonitor(out string errtext, System.IAsyncResult result) { + return base.Channel.EndGetManageTaskIndexFromMonitor(out errtext, result); } - private System.IAsyncResult OnBeginSetDeviceJoinRouteStateInfo(object[] inValues, System.AsyncCallback callback, object asyncState) { - int deviceIndex = ((int)(inValues[0])); - bool isEnabled = ((bool)(inValues[1])); - return this.BeginSetDeviceJoinRouteStateInfo(deviceIndex, isEnabled, callback, asyncState); + private System.IAsyncResult OnBeginGetManageTaskIndexFromMonitor(object[] inValues, System.AsyncCallback callback, object asyncState) { + int monitorIndex = ((int)(inValues[0])); + return this.BeginGetManageTaskIndexFromMonitor(monitorIndex, callback, asyncState); } - private object[] OnEndSetDeviceJoinRouteStateInfo(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - bool retVal = this.EndSetDeviceJoinRouteStateInfo(out errorText, result); + private object[] OnEndGetManageTaskIndexFromMonitor(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + long retVal = this.EndGetManageTaskIndexFromMonitor(out errtext, result); return new object[] { - errorText, + errtext, retVal}; } - private void OnSetDeviceJoinRouteStateInfoCompleted(object state) { - if ((this.SetDeviceJoinRouteStateInfoCompleted != null)) { + private void OnGetManageTaskIndexFromMonitorCompleted(object state) { + if ((this.GetManageTaskIndexFromMonitorCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.SetDeviceJoinRouteStateInfoCompleted(this, new SetDeviceJoinRouteStateInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetManageTaskIndexFromMonitorCompleted(this, new GetManageTaskIndexFromMonitorCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void SetDeviceJoinRouteStateInfoAsync(int deviceIndex, bool isEnabled) { - this.SetDeviceJoinRouteStateInfoAsync(deviceIndex, isEnabled, null); + public void GetManageTaskIndexFromMonitorAsync(int monitorIndex) { + this.GetManageTaskIndexFromMonitorAsync(monitorIndex, null); } - public void SetDeviceJoinRouteStateInfoAsync(int deviceIndex, bool isEnabled, object userState) { - if ((this.onBeginSetDeviceJoinRouteStateInfoDelegate == null)) { - this.onBeginSetDeviceJoinRouteStateInfoDelegate = new BeginOperationDelegate(this.OnBeginSetDeviceJoinRouteStateInfo); + public void GetManageTaskIndexFromMonitorAsync(int monitorIndex, object userState) { + if ((this.onBeginGetManageTaskIndexFromMonitorDelegate == null)) { + this.onBeginGetManageTaskIndexFromMonitorDelegate = new BeginOperationDelegate(this.OnBeginGetManageTaskIndexFromMonitor); } - if ((this.onEndSetDeviceJoinRouteStateInfoDelegate == null)) { - this.onEndSetDeviceJoinRouteStateInfoDelegate = new EndOperationDelegate(this.OnEndSetDeviceJoinRouteStateInfo); + if ((this.onEndGetManageTaskIndexFromMonitorDelegate == null)) { + this.onEndGetManageTaskIndexFromMonitorDelegate = new EndOperationDelegate(this.OnEndGetManageTaskIndexFromMonitor); } - if ((this.onSetDeviceJoinRouteStateInfoCompletedDelegate == null)) { - this.onSetDeviceJoinRouteStateInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetDeviceJoinRouteStateInfoCompleted); + if ((this.onGetManageTaskIndexFromMonitorCompletedDelegate == null)) { + this.onGetManageTaskIndexFromMonitorCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetManageTaskIndexFromMonitorCompleted); } - base.InvokeAsync(this.onBeginSetDeviceJoinRouteStateInfoDelegate, new object[] { - deviceIndex, - isEnabled}, this.onEndSetDeviceJoinRouteStateInfoDelegate, this.onSetDeviceJoinRouteStateInfoCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetManageTaskIndexFromMonitorDelegate, new object[] { + monitorIndex}, this.onEndGetManageTaskIndexFromMonitorDelegate, this.onGetManageTaskIndexFromMonitorCompletedDelegate, userState); } - public wcfControlMonitorClient.WcfControlMonitor.ST_Cell[] GetAllCellInfos(out string errorText) { - return base.Channel.GetAllCellInfos(out errorText); + public int GetDeviceKindIndex(out string errtext, int deviceIndex) { + return base.Channel.GetDeviceKindIndex(out errtext, deviceIndex); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetAllCellInfos(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetAllCellInfos(callback, asyncState); + public System.IAsyncResult BeginGetDeviceKindIndex(int deviceIndex, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetDeviceKindIndex(deviceIndex, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public wcfControlMonitorClient.WcfControlMonitor.ST_Cell[] EndGetAllCellInfos(out string errorText, System.IAsyncResult result) { - return base.Channel.EndGetAllCellInfos(out errorText, result); + public int EndGetDeviceKindIndex(out string errtext, System.IAsyncResult result) { + return base.Channel.EndGetDeviceKindIndex(out errtext, result); } - private System.IAsyncResult OnBeginGetAllCellInfos(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginGetAllCellInfos(callback, asyncState); + private System.IAsyncResult OnBeginGetDeviceKindIndex(object[] inValues, System.AsyncCallback callback, object asyncState) { + int deviceIndex = ((int)(inValues[0])); + return this.BeginGetDeviceKindIndex(deviceIndex, callback, asyncState); } - private object[] OnEndGetAllCellInfos(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - wcfControlMonitorClient.WcfControlMonitor.ST_Cell[] retVal = this.EndGetAllCellInfos(out errorText, result); + private object[] OnEndGetDeviceKindIndex(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + int retVal = this.EndGetDeviceKindIndex(out errtext, result); return new object[] { - errorText, + errtext, retVal}; } - private void OnGetAllCellInfosCompleted(object state) { - if ((this.GetAllCellInfosCompleted != null)) { + private void OnGetDeviceKindIndexCompleted(object state) { + if ((this.GetDeviceKindIndexCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetAllCellInfosCompleted(this, new GetAllCellInfosCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetDeviceKindIndexCompleted(this, new GetDeviceKindIndexCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetAllCellInfosAsync() { - this.GetAllCellInfosAsync(null); + public void GetDeviceKindIndexAsync(int deviceIndex) { + this.GetDeviceKindIndexAsync(deviceIndex, null); } - public void GetAllCellInfosAsync(object userState) { - if ((this.onBeginGetAllCellInfosDelegate == null)) { - this.onBeginGetAllCellInfosDelegate = new BeginOperationDelegate(this.OnBeginGetAllCellInfos); + public void GetDeviceKindIndexAsync(int deviceIndex, object userState) { + if ((this.onBeginGetDeviceKindIndexDelegate == null)) { + this.onBeginGetDeviceKindIndexDelegate = new BeginOperationDelegate(this.OnBeginGetDeviceKindIndex); } - if ((this.onEndGetAllCellInfosDelegate == null)) { - this.onEndGetAllCellInfosDelegate = new EndOperationDelegate(this.OnEndGetAllCellInfos); + if ((this.onEndGetDeviceKindIndexDelegate == null)) { + this.onEndGetDeviceKindIndexDelegate = new EndOperationDelegate(this.OnEndGetDeviceKindIndex); } - if ((this.onGetAllCellInfosCompletedDelegate == null)) { - this.onGetAllCellInfosCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetAllCellInfosCompleted); + if ((this.onGetDeviceKindIndexCompletedDelegate == null)) { + this.onGetDeviceKindIndexCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDeviceKindIndexCompleted); } - base.InvokeAsync(this.onBeginGetAllCellInfosDelegate, null, this.onEndGetAllCellInfosDelegate, this.onGetAllCellInfosCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetDeviceKindIndexDelegate, new object[] { + deviceIndex}, this.onEndGetDeviceKindIndexDelegate, this.onGetDeviceKindIndexCompletedDelegate, userState); } - public string[] GetLanguageFields(out string errorText) { - return base.Channel.GetLanguageFields(out errorText); + public bool SendDeviceReset(out string errtext, int deviceIndex, int ResetOrder) { + return base.Channel.SendDeviceReset(out errtext, deviceIndex, ResetOrder); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetLanguageFields(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetLanguageFields(callback, asyncState); + public System.IAsyncResult BeginSendDeviceReset(int deviceIndex, int ResetOrder, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSendDeviceReset(deviceIndex, ResetOrder, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public string[] EndGetLanguageFields(out string errorText, System.IAsyncResult result) { - return base.Channel.EndGetLanguageFields(out errorText, result); + public bool EndSendDeviceReset(out string errtext, System.IAsyncResult result) { + return base.Channel.EndSendDeviceReset(out errtext, result); } - private System.IAsyncResult OnBeginGetLanguageFields(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginGetLanguageFields(callback, asyncState); + private System.IAsyncResult OnBeginSendDeviceReset(object[] inValues, System.AsyncCallback callback, object asyncState) { + int deviceIndex = ((int)(inValues[0])); + int ResetOrder = ((int)(inValues[1])); + return this.BeginSendDeviceReset(deviceIndex, ResetOrder, callback, asyncState); } - private object[] OnEndGetLanguageFields(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - string[] retVal = this.EndGetLanguageFields(out errorText, result); + private object[] OnEndSendDeviceReset(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndSendDeviceReset(out errtext, result); return new object[] { - errorText, + errtext, retVal}; } - private void OnGetLanguageFieldsCompleted(object state) { - if ((this.GetLanguageFieldsCompleted != null)) { + private void OnSendDeviceResetCompleted(object state) { + if ((this.SendDeviceResetCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetLanguageFieldsCompleted(this, new GetLanguageFieldsCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SendDeviceResetCompleted(this, new SendDeviceResetCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetLanguageFieldsAsync() { - this.GetLanguageFieldsAsync(null); + public void SendDeviceResetAsync(int deviceIndex, int ResetOrder) { + this.SendDeviceResetAsync(deviceIndex, ResetOrder, null); } - public void GetLanguageFieldsAsync(object userState) { - if ((this.onBeginGetLanguageFieldsDelegate == null)) { - this.onBeginGetLanguageFieldsDelegate = new BeginOperationDelegate(this.OnBeginGetLanguageFields); + public void SendDeviceResetAsync(int deviceIndex, int ResetOrder, object userState) { + if ((this.onBeginSendDeviceResetDelegate == null)) { + this.onBeginSendDeviceResetDelegate = new BeginOperationDelegate(this.OnBeginSendDeviceReset); } - if ((this.onEndGetLanguageFieldsDelegate == null)) { - this.onEndGetLanguageFieldsDelegate = new EndOperationDelegate(this.OnEndGetLanguageFields); + if ((this.onEndSendDeviceResetDelegate == null)) { + this.onEndSendDeviceResetDelegate = new EndOperationDelegate(this.OnEndSendDeviceReset); } - if ((this.onGetLanguageFieldsCompletedDelegate == null)) { - this.onGetLanguageFieldsCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetLanguageFieldsCompleted); + if ((this.onSendDeviceResetCompletedDelegate == null)) { + this.onSendDeviceResetCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSendDeviceResetCompleted); } - base.InvokeAsync(this.onBeginGetLanguageFieldsDelegate, null, this.onEndGetLanguageFieldsDelegate, this.onGetLanguageFieldsCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSendDeviceResetDelegate, new object[] { + deviceIndex, + ResetOrder}, this.onEndSendDeviceResetDelegate, this.onSendDeviceResetCompletedDelegate, userState); } - public wcfControlMonitorClient.WcfControlMonitor.LanguageContent[] GetLanguageContent(out string errorText, string language) { - return base.Channel.GetLanguageContent(out errorText, language); + public bool Heartbeat(out Model.MonitorInfo monitorinfo) { + return base.Channel.Heartbeat(out monitorinfo); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetLanguageContent(string language, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetLanguageContent(language, callback, asyncState); + public System.IAsyncResult BeginHeartbeat(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginHeartbeat(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public wcfControlMonitorClient.WcfControlMonitor.LanguageContent[] EndGetLanguageContent(out string errorText, System.IAsyncResult result) { - return base.Channel.EndGetLanguageContent(out errorText, result); + public bool EndHeartbeat(out Model.MonitorInfo monitorinfo, System.IAsyncResult result) { + return base.Channel.EndHeartbeat(out monitorinfo, result); } - private System.IAsyncResult OnBeginGetLanguageContent(object[] inValues, System.AsyncCallback callback, object asyncState) { - string language = ((string)(inValues[0])); - return this.BeginGetLanguageContent(language, callback, asyncState); + private System.IAsyncResult OnBeginHeartbeat(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginHeartbeat(callback, asyncState); } - private object[] OnEndGetLanguageContent(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - wcfControlMonitorClient.WcfControlMonitor.LanguageContent[] retVal = this.EndGetLanguageContent(out errorText, result); + private object[] OnEndHeartbeat(System.IAsyncResult result) { + Model.MonitorInfo monitorinfo = this.GetDefaultValueForInitialization(); + bool retVal = this.EndHeartbeat(out monitorinfo, result); return new object[] { - errorText, + monitorinfo, retVal}; } - private void OnGetLanguageContentCompleted(object state) { - if ((this.GetLanguageContentCompleted != null)) { + private void OnHeartbeatCompleted(object state) { + if ((this.HeartbeatCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetLanguageContentCompleted(this, new GetLanguageContentCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.HeartbeatCompleted(this, new HeartbeatCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetLanguageContentAsync(string language) { - this.GetLanguageContentAsync(language, null); + public void HeartbeatAsync() { + this.HeartbeatAsync(null); } - public void GetLanguageContentAsync(string language, object userState) { - if ((this.onBeginGetLanguageContentDelegate == null)) { - this.onBeginGetLanguageContentDelegate = new BeginOperationDelegate(this.OnBeginGetLanguageContent); + public void HeartbeatAsync(object userState) { + if ((this.onBeginHeartbeatDelegate == null)) { + this.onBeginHeartbeatDelegate = new BeginOperationDelegate(this.OnBeginHeartbeat); } - if ((this.onEndGetLanguageContentDelegate == null)) { - this.onEndGetLanguageContentDelegate = new EndOperationDelegate(this.OnEndGetLanguageContent); + if ((this.onEndHeartbeatDelegate == null)) { + this.onEndHeartbeatDelegate = new EndOperationDelegate(this.OnEndHeartbeat); } - if ((this.onGetLanguageContentCompletedDelegate == null)) { - this.onGetLanguageContentCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetLanguageContentCompleted); + if ((this.onHeartbeatCompletedDelegate == null)) { + this.onHeartbeatCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnHeartbeatCompleted); } - base.InvokeAsync(this.onBeginGetLanguageContentDelegate, new object[] { - language}, this.onEndGetLanguageContentDelegate, this.onGetLanguageContentCompletedDelegate, userState); + base.InvokeAsync(this.onBeginHeartbeatDelegate, null, this.onEndHeartbeatDelegate, this.onHeartbeatCompletedDelegate, userState); } - public wcfControlMonitorClient.WcfControlMonitor.DevicesDic GetDevicesDic(out string errorText) { - return base.Channel.GetDevicesDic(out errorText); + public System.Data.DataTable GetDataView(out string errtext, string SQL) { + return base.Channel.GetDataView(out errtext, SQL); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetDevicesDic(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetDevicesDic(callback, asyncState); + public System.IAsyncResult BeginGetDataView(string SQL, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetDataView(SQL, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public wcfControlMonitorClient.WcfControlMonitor.DevicesDic EndGetDevicesDic(out string errorText, System.IAsyncResult result) { - return base.Channel.EndGetDevicesDic(out errorText, result); + public System.Data.DataTable EndGetDataView(out string errtext, System.IAsyncResult result) { + return base.Channel.EndGetDataView(out errtext, result); } - private System.IAsyncResult OnBeginGetDevicesDic(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginGetDevicesDic(callback, asyncState); + private System.IAsyncResult OnBeginGetDataView(object[] inValues, System.AsyncCallback callback, object asyncState) { + string SQL = ((string)(inValues[0])); + return this.BeginGetDataView(SQL, callback, asyncState); } - private object[] OnEndGetDevicesDic(System.IAsyncResult result) { - string errorText = this.GetDefaultValueForInitialization(); - wcfControlMonitorClient.WcfControlMonitor.DevicesDic retVal = this.EndGetDevicesDic(out errorText, result); + private object[] OnEndGetDataView(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + System.Data.DataTable retVal = this.EndGetDataView(out errtext, result); return new object[] { - errorText, + errtext, retVal}; } - private void OnGetDevicesDicCompleted(object state) { - if ((this.GetDevicesDicCompleted != null)) { + private void OnGetDataViewCompleted(object state) { + if ((this.GetDataViewCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetDevicesDicCompleted(this, new GetDevicesDicCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetDataViewCompleted(this, new GetDataViewCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetDevicesDicAsync() { - this.GetDevicesDicAsync(null); + public void GetDataViewAsync(string SQL) { + this.GetDataViewAsync(SQL, null); } - public void GetDevicesDicAsync(object userState) { - if ((this.onBeginGetDevicesDicDelegate == null)) { - this.onBeginGetDevicesDicDelegate = new BeginOperationDelegate(this.OnBeginGetDevicesDic); + public void GetDataViewAsync(string SQL, object userState) { + if ((this.onBeginGetDataViewDelegate == null)) { + this.onBeginGetDataViewDelegate = new BeginOperationDelegate(this.OnBeginGetDataView); } - if ((this.onEndGetDevicesDicDelegate == null)) { - this.onEndGetDevicesDicDelegate = new EndOperationDelegate(this.OnEndGetDevicesDic); + if ((this.onEndGetDataViewDelegate == null)) { + this.onEndGetDataViewDelegate = new EndOperationDelegate(this.OnEndGetDataView); } - if ((this.onGetDevicesDicCompletedDelegate == null)) { - this.onGetDevicesDicCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDevicesDicCompleted); + if ((this.onGetDataViewCompletedDelegate == null)) { + this.onGetDataViewCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDataViewCompleted); } - base.InvokeAsync(this.onBeginGetDevicesDicDelegate, null, this.onEndGetDevicesDicDelegate, this.onGetDevicesDicCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetDataViewDelegate, new object[] { + SQL}, this.onEndGetDataViewDelegate, this.onGetDataViewCompletedDelegate, userState); } - public bool RefreshMonitoringMode() { - return base.Channel.RefreshMonitoringMode(); + public int ExeSQLNoneQuery(out string errtext, string SQL) { + return base.Channel.ExeSQLNoneQuery(out errtext, SQL); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginRefreshMonitoringMode(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginRefreshMonitoringMode(callback, asyncState); + public System.IAsyncResult BeginExeSQLNoneQuery(string SQL, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginExeSQLNoneQuery(SQL, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndRefreshMonitoringMode(System.IAsyncResult result) { - return base.Channel.EndRefreshMonitoringMode(result); + public int EndExeSQLNoneQuery(out string errtext, System.IAsyncResult result) { + return base.Channel.EndExeSQLNoneQuery(out errtext, result); } - private System.IAsyncResult OnBeginRefreshMonitoringMode(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginRefreshMonitoringMode(callback, asyncState); + private System.IAsyncResult OnBeginExeSQLNoneQuery(object[] inValues, System.AsyncCallback callback, object asyncState) { + string SQL = ((string)(inValues[0])); + return this.BeginExeSQLNoneQuery(SQL, callback, asyncState); } - private object[] OnEndRefreshMonitoringMode(System.IAsyncResult result) { - bool retVal = this.EndRefreshMonitoringMode(result); + private object[] OnEndExeSQLNoneQuery(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + int retVal = this.EndExeSQLNoneQuery(out errtext, result); return new object[] { + errtext, retVal}; } - private void OnRefreshMonitoringModeCompleted(object state) { - if ((this.RefreshMonitoringModeCompleted != null)) { + private void OnExeSQLNoneQueryCompleted(object state) { + if ((this.ExeSQLNoneQueryCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.RefreshMonitoringModeCompleted(this, new RefreshMonitoringModeCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.ExeSQLNoneQueryCompleted(this, new ExeSQLNoneQueryCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void RefreshMonitoringModeAsync() { - this.RefreshMonitoringModeAsync(null); + public void ExeSQLNoneQueryAsync(string SQL) { + this.ExeSQLNoneQueryAsync(SQL, null); } - public void RefreshMonitoringModeAsync(object userState) { - if ((this.onBeginRefreshMonitoringModeDelegate == null)) { - this.onBeginRefreshMonitoringModeDelegate = new BeginOperationDelegate(this.OnBeginRefreshMonitoringMode); + public void ExeSQLNoneQueryAsync(string SQL, object userState) { + if ((this.onBeginExeSQLNoneQueryDelegate == null)) { + this.onBeginExeSQLNoneQueryDelegate = new BeginOperationDelegate(this.OnBeginExeSQLNoneQuery); } - if ((this.onEndRefreshMonitoringModeDelegate == null)) { - this.onEndRefreshMonitoringModeDelegate = new EndOperationDelegate(this.OnEndRefreshMonitoringMode); + if ((this.onEndExeSQLNoneQueryDelegate == null)) { + this.onEndExeSQLNoneQueryDelegate = new EndOperationDelegate(this.OnEndExeSQLNoneQuery); } - if ((this.onRefreshMonitoringModeCompletedDelegate == null)) { - this.onRefreshMonitoringModeCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnRefreshMonitoringModeCompleted); + if ((this.onExeSQLNoneQueryCompletedDelegate == null)) { + this.onExeSQLNoneQueryCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnExeSQLNoneQueryCompleted); } - base.InvokeAsync(this.onBeginRefreshMonitoringModeDelegate, null, this.onEndRefreshMonitoringModeDelegate, this.onRefreshMonitoringModeCompletedDelegate, userState); + base.InvokeAsync(this.onBeginExeSQLNoneQueryDelegate, new object[] { + SQL}, this.onEndExeSQLNoneQueryDelegate, this.onExeSQLNoneQueryCompletedDelegate, userState); } - - public bool RegisterClient(out string errText, string userID, string userDescription) { - return base.Channel.RegisterClient(out errText, userID, userDescription); + + public System.Data.DataTable GetManDataView(out string errtext, string SQL) { + return base.Channel.GetManDataView(out errtext, SQL); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginRegisterClient(string userID, string userDescription, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginRegisterClient(userID, userDescription, callback, asyncState); + public System.IAsyncResult BeginGetManDataView(string SQL, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetManDataView(SQL, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndRegisterClient(out string errText, System.IAsyncResult result) { - return base.Channel.EndRegisterClient(out errText, result); + public System.Data.DataTable EndGetManDataView(out string errtext, System.IAsyncResult result) { + return base.Channel.EndGetManDataView(out errtext, result); } - private System.IAsyncResult OnBeginRegisterClient(object[] inValues, System.AsyncCallback callback, object asyncState) { - string userID = ((string)(inValues[0])); - string userDescription = ((string)(inValues[1])); - return this.BeginRegisterClient(userID, userDescription, callback, asyncState); + private System.IAsyncResult OnBeginGetManDataView(object[] inValues, System.AsyncCallback callback, object asyncState) { + string SQL = ((string)(inValues[0])); + return this.BeginGetManDataView(SQL, callback, asyncState); } - private object[] OnEndRegisterClient(System.IAsyncResult result) { - string errText = this.GetDefaultValueForInitialization(); - bool retVal = this.EndRegisterClient(out errText, result); + private object[] OnEndGetManDataView(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + System.Data.DataTable retVal = this.EndGetManDataView(out errtext, result); return new object[] { - errText, + errtext, retVal}; } - private void OnRegisterClientCompleted(object state) { - if ((this.RegisterClientCompleted != null)) { + private void OnGetManDataViewCompleted(object state) { + if ((this.GetManDataViewCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.RegisterClientCompleted(this, new RegisterClientCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetManDataViewCompleted(this, new GetManDataViewCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void RegisterClientAsync(string userID, string userDescription) { - this.RegisterClientAsync(userID, userDescription, null); + public void GetManDataViewAsync(string SQL) { + this.GetManDataViewAsync(SQL, null); } - public void RegisterClientAsync(string userID, string userDescription, object userState) { - if ((this.onBeginRegisterClientDelegate == null)) { - this.onBeginRegisterClientDelegate = new BeginOperationDelegate(this.OnBeginRegisterClient); + public void GetManDataViewAsync(string SQL, object userState) { + if ((this.onBeginGetManDataViewDelegate == null)) { + this.onBeginGetManDataViewDelegate = new BeginOperationDelegate(this.OnBeginGetManDataView); } - if ((this.onEndRegisterClientDelegate == null)) { - this.onEndRegisterClientDelegate = new EndOperationDelegate(this.OnEndRegisterClient); + if ((this.onEndGetManDataViewDelegate == null)) { + this.onEndGetManDataViewDelegate = new EndOperationDelegate(this.OnEndGetManDataView); } - if ((this.onRegisterClientCompletedDelegate == null)) { - this.onRegisterClientCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnRegisterClientCompleted); + if ((this.onGetManDataViewCompletedDelegate == null)) { + this.onGetManDataViewCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetManDataViewCompleted); } - base.InvokeAsync(this.onBeginRegisterClientDelegate, new object[] { - userID, - userDescription}, this.onEndRegisterClientDelegate, this.onRegisterClientCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetManDataViewDelegate, new object[] { + SQL}, this.onEndGetManDataViewDelegate, this.onGetManDataViewCompletedDelegate, userState); } - public bool LogoutClient(out string errText, string userID) { - return base.Channel.LogoutClient(out errText, userID); + public int ExeManSQLNoneQuery(out string errtext, string SQL) { + return base.Channel.ExeManSQLNoneQuery(out errtext, SQL); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginLogoutClient(string userID, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginLogoutClient(userID, callback, asyncState); + public System.IAsyncResult BeginExeManSQLNoneQuery(string SQL, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginExeManSQLNoneQuery(SQL, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndLogoutClient(out string errText, System.IAsyncResult result) { - return base.Channel.EndLogoutClient(out errText, result); + public int EndExeManSQLNoneQuery(out string errtext, System.IAsyncResult result) { + return base.Channel.EndExeManSQLNoneQuery(out errtext, result); } - private System.IAsyncResult OnBeginLogoutClient(object[] inValues, System.AsyncCallback callback, object asyncState) { - string userID = ((string)(inValues[0])); - return this.BeginLogoutClient(userID, callback, asyncState); + private System.IAsyncResult OnBeginExeManSQLNoneQuery(object[] inValues, System.AsyncCallback callback, object asyncState) { + string SQL = ((string)(inValues[0])); + return this.BeginExeManSQLNoneQuery(SQL, callback, asyncState); } - private object[] OnEndLogoutClient(System.IAsyncResult result) { - string errText = this.GetDefaultValueForInitialization(); - bool retVal = this.EndLogoutClient(out errText, result); + private object[] OnEndExeManSQLNoneQuery(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + int retVal = this.EndExeManSQLNoneQuery(out errtext, result); return new object[] { - errText, + errtext, retVal}; } - private void OnLogoutClientCompleted(object state) { - if ((this.LogoutClientCompleted != null)) { + private void OnExeManSQLNoneQueryCompleted(object state) { + if ((this.ExeManSQLNoneQueryCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.LogoutClientCompleted(this, new LogoutClientCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.ExeManSQLNoneQueryCompleted(this, new ExeManSQLNoneQueryCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void LogoutClientAsync(string userID) { - this.LogoutClientAsync(userID, null); + public void ExeManSQLNoneQueryAsync(string SQL) { + this.ExeManSQLNoneQueryAsync(SQL, null); } - public void LogoutClientAsync(string userID, object userState) { - if ((this.onBeginLogoutClientDelegate == null)) { - this.onBeginLogoutClientDelegate = new BeginOperationDelegate(this.OnBeginLogoutClient); + public void ExeManSQLNoneQueryAsync(string SQL, object userState) { + if ((this.onBeginExeManSQLNoneQueryDelegate == null)) { + this.onBeginExeManSQLNoneQueryDelegate = new BeginOperationDelegate(this.OnBeginExeManSQLNoneQuery); } - if ((this.onEndLogoutClientDelegate == null)) { - this.onEndLogoutClientDelegate = new EndOperationDelegate(this.OnEndLogoutClient); + if ((this.onEndExeManSQLNoneQueryDelegate == null)) { + this.onEndExeManSQLNoneQueryDelegate = new EndOperationDelegate(this.OnEndExeManSQLNoneQuery); } - if ((this.onLogoutClientCompletedDelegate == null)) { - this.onLogoutClientCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnLogoutClientCompleted); + if ((this.onExeManSQLNoneQueryCompletedDelegate == null)) { + this.onExeManSQLNoneQueryCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnExeManSQLNoneQueryCompleted); } - base.InvokeAsync(this.onBeginLogoutClientDelegate, new object[] { - userID}, this.onEndLogoutClientDelegate, this.onLogoutClientCompletedDelegate, userState); + base.InvokeAsync(this.onBeginExeManSQLNoneQueryDelegate, new object[] { + SQL}, this.onEndExeManSQLNoneQueryDelegate, this.onExeManSQLNoneQueryCompletedDelegate, userState); } - public bool ObtainTask(string laneway, string Order) { - return base.Channel.ObtainTask(laneway, Order); + public bool GetAllManageTask(out string errtext) { + return base.Channel.GetAllManageTask(out errtext); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginObtainTask(string laneway, string Order, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginObtainTask(laneway, Order, callback, asyncState); + public System.IAsyncResult BeginGetAllManageTask(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginGetAllManageTask(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndObtainTask(System.IAsyncResult result) { - return base.Channel.EndObtainTask(result); + public bool EndGetAllManageTask(out string errtext, System.IAsyncResult result) { + return base.Channel.EndGetAllManageTask(out errtext, result); } - private System.IAsyncResult OnBeginObtainTask(object[] inValues, System.AsyncCallback callback, object asyncState) { - string laneway = ((string)(inValues[0])); - string Order = ((string)(inValues[1])); - return this.BeginObtainTask(laneway, Order, callback, asyncState); + private System.IAsyncResult OnBeginGetAllManageTask(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginGetAllManageTask(callback, asyncState); } - private object[] OnEndObtainTask(System.IAsyncResult result) { - bool retVal = this.EndObtainTask(result); + private object[] OnEndGetAllManageTask(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndGetAllManageTask(out errtext, result); return new object[] { + errtext, retVal}; } - private void OnObtainTaskCompleted(object state) { - if ((this.ObtainTaskCompleted != null)) { + private void OnGetAllManageTaskCompleted(object state) { + if ((this.GetAllManageTaskCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.ObtainTaskCompleted(this, new ObtainTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.GetAllManageTaskCompleted(this, new GetAllManageTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void ObtainTaskAsync(string laneway, string Order) { - this.ObtainTaskAsync(laneway, Order, null); + public void GetAllManageTaskAsync() { + this.GetAllManageTaskAsync(null); } - public void ObtainTaskAsync(string laneway, string Order, object userState) { - if ((this.onBeginObtainTaskDelegate == null)) { - this.onBeginObtainTaskDelegate = new BeginOperationDelegate(this.OnBeginObtainTask); + public void GetAllManageTaskAsync(object userState) { + if ((this.onBeginGetAllManageTaskDelegate == null)) { + this.onBeginGetAllManageTaskDelegate = new BeginOperationDelegate(this.OnBeginGetAllManageTask); } - if ((this.onEndObtainTaskDelegate == null)) { - this.onEndObtainTaskDelegate = new EndOperationDelegate(this.OnEndObtainTask); + if ((this.onEndGetAllManageTaskDelegate == null)) { + this.onEndGetAllManageTaskDelegate = new EndOperationDelegate(this.OnEndGetAllManageTask); } - if ((this.onObtainTaskCompletedDelegate == null)) { - this.onObtainTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnObtainTaskCompleted); + if ((this.onGetAllManageTaskCompletedDelegate == null)) { + this.onGetAllManageTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetAllManageTaskCompleted); } - base.InvokeAsync(this.onBeginObtainTaskDelegate, new object[] { - laneway, - Order}, this.onEndObtainTaskDelegate, this.onObtainTaskCompletedDelegate, userState); + base.InvokeAsync(this.onBeginGetAllManageTaskDelegate, null, this.onEndGetAllManageTaskDelegate, this.onGetAllManageTaskCompletedDelegate, userState); } - public bool StopObtainTask() { - return base.Channel.StopObtainTask(); + public bool DisassembleTask(out string errtext) { + return base.Channel.DisassembleTask(out errtext); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginStopObtainTask(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginStopObtainTask(callback, asyncState); + public System.IAsyncResult BeginDisassembleTask(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginDisassembleTask(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndStopObtainTask(System.IAsyncResult result) { - return base.Channel.EndStopObtainTask(result); + public bool EndDisassembleTask(out string errtext, System.IAsyncResult result) { + return base.Channel.EndDisassembleTask(out errtext, result); } - private System.IAsyncResult OnBeginStopObtainTask(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginStopObtainTask(callback, asyncState); + private System.IAsyncResult OnBeginDisassembleTask(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginDisassembleTask(callback, asyncState); } - private object[] OnEndStopObtainTask(System.IAsyncResult result) { - bool retVal = this.EndStopObtainTask(result); + private object[] OnEndDisassembleTask(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndDisassembleTask(out errtext, result); return new object[] { + errtext, retVal}; } - private void OnStopObtainTaskCompleted(object state) { - if ((this.StopObtainTaskCompleted != null)) { + private void OnDisassembleTaskCompleted(object state) { + if ((this.DisassembleTaskCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.StopObtainTaskCompleted(this, new StopObtainTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.DisassembleTaskCompleted(this, new DisassembleTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void StopObtainTaskAsync() { - this.StopObtainTaskAsync(null); + public void DisassembleTaskAsync() { + this.DisassembleTaskAsync(null); } - public void StopObtainTaskAsync(object userState) { - if ((this.onBeginStopObtainTaskDelegate == null)) { - this.onBeginStopObtainTaskDelegate = new BeginOperationDelegate(this.OnBeginStopObtainTask); + public void DisassembleTaskAsync(object userState) { + if ((this.onBeginDisassembleTaskDelegate == null)) { + this.onBeginDisassembleTaskDelegate = new BeginOperationDelegate(this.OnBeginDisassembleTask); } - if ((this.onEndStopObtainTaskDelegate == null)) { - this.onEndStopObtainTaskDelegate = new EndOperationDelegate(this.OnEndStopObtainTask); + if ((this.onEndDisassembleTaskDelegate == null)) { + this.onEndDisassembleTaskDelegate = new EndOperationDelegate(this.OnEndDisassembleTask); } - if ((this.onStopObtainTaskCompletedDelegate == null)) { - this.onStopObtainTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnStopObtainTaskCompleted); + if ((this.onDisassembleTaskCompletedDelegate == null)) { + this.onDisassembleTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnDisassembleTaskCompleted); } - base.InvokeAsync(this.onBeginStopObtainTaskDelegate, null, this.onEndStopObtainTaskDelegate, this.onStopObtainTaskCompletedDelegate, userState); + base.InvokeAsync(this.onBeginDisassembleTaskDelegate, null, this.onEndDisassembleTaskDelegate, this.onDisassembleTaskCompletedDelegate, userState); } - public bool OrderTurnOn() { - return base.Channel.OrderTurnOn(); + public bool SetLogicHaveGoods(out string errtext, bool ifHaveGoods, int deviceindex) { + return base.Channel.SetLogicHaveGoods(out errtext, ifHaveGoods, deviceindex); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginOrderTurnOn(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginOrderTurnOn(callback, asyncState); + public System.IAsyncResult BeginSetLogicHaveGoods(bool ifHaveGoods, int deviceindex, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSetLogicHaveGoods(ifHaveGoods, deviceindex, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndOrderTurnOn(System.IAsyncResult result) { - return base.Channel.EndOrderTurnOn(result); + public bool EndSetLogicHaveGoods(out string errtext, System.IAsyncResult result) { + return base.Channel.EndSetLogicHaveGoods(out errtext, result); } - private System.IAsyncResult OnBeginOrderTurnOn(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginOrderTurnOn(callback, asyncState); + private System.IAsyncResult OnBeginSetLogicHaveGoods(object[] inValues, System.AsyncCallback callback, object asyncState) { + bool ifHaveGoods = ((bool)(inValues[0])); + int deviceindex = ((int)(inValues[1])); + return this.BeginSetLogicHaveGoods(ifHaveGoods, deviceindex, callback, asyncState); } - private object[] OnEndOrderTurnOn(System.IAsyncResult result) { - bool retVal = this.EndOrderTurnOn(result); + private object[] OnEndSetLogicHaveGoods(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndSetLogicHaveGoods(out errtext, result); return new object[] { + errtext, retVal}; } - private void OnOrderTurnOnCompleted(object state) { - if ((this.OrderTurnOnCompleted != null)) { + private void OnSetLogicHaveGoodsCompleted(object state) { + if ((this.SetLogicHaveGoodsCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.OrderTurnOnCompleted(this, new OrderTurnOnCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SetLogicHaveGoodsCompleted(this, new SetLogicHaveGoodsCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void OrderTurnOnAsync() { - this.OrderTurnOnAsync(null); + public void SetLogicHaveGoodsAsync(bool ifHaveGoods, int deviceindex) { + this.SetLogicHaveGoodsAsync(ifHaveGoods, deviceindex, null); } - public void OrderTurnOnAsync(object userState) { - if ((this.onBeginOrderTurnOnDelegate == null)) { - this.onBeginOrderTurnOnDelegate = new BeginOperationDelegate(this.OnBeginOrderTurnOn); - } - if ((this.onEndOrderTurnOnDelegate == null)) { - this.onEndOrderTurnOnDelegate = new EndOperationDelegate(this.OnEndOrderTurnOn); + public void SetLogicHaveGoodsAsync(bool ifHaveGoods, int deviceindex, object userState) { + if ((this.onBeginSetLogicHaveGoodsDelegate == null)) { + this.onBeginSetLogicHaveGoodsDelegate = new BeginOperationDelegate(this.OnBeginSetLogicHaveGoods); } - if ((this.onOrderTurnOnCompletedDelegate == null)) { - this.onOrderTurnOnCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOrderTurnOnCompleted); + if ((this.onEndSetLogicHaveGoodsDelegate == null)) { + this.onEndSetLogicHaveGoodsDelegate = new EndOperationDelegate(this.OnEndSetLogicHaveGoods); } - base.InvokeAsync(this.onBeginOrderTurnOnDelegate, null, this.onEndOrderTurnOnDelegate, this.onOrderTurnOnCompletedDelegate, userState); + if ((this.onSetLogicHaveGoodsCompletedDelegate == null)) { + this.onSetLogicHaveGoodsCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetLogicHaveGoodsCompleted); + } + base.InvokeAsync(this.onBeginSetLogicHaveGoodsDelegate, new object[] { + ifHaveGoods, + deviceindex}, this.onEndSetLogicHaveGoodsDelegate, this.onSetLogicHaveGoodsCompletedDelegate, userState); } - public bool OrderTurnOff() { - return base.Channel.OrderTurnOff(); + public bool DealWithDeviceState(out string errtext, int deviceindex, byte[] splitbyteValue, byte[] devicestates) { + return base.Channel.DealWithDeviceState(out errtext, deviceindex, splitbyteValue, devicestates); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginOrderTurnOff(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginOrderTurnOff(callback, asyncState); + public System.IAsyncResult BeginDealWithDeviceState(int deviceindex, byte[] splitbyteValue, byte[] devicestates, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginDealWithDeviceState(deviceindex, splitbyteValue, devicestates, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndOrderTurnOff(System.IAsyncResult result) { - return base.Channel.EndOrderTurnOff(result); + public bool EndDealWithDeviceState(out string errtext, System.IAsyncResult result) { + return base.Channel.EndDealWithDeviceState(out errtext, result); } - private System.IAsyncResult OnBeginOrderTurnOff(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginOrderTurnOff(callback, asyncState); + private System.IAsyncResult OnBeginDealWithDeviceState(object[] inValues, System.AsyncCallback callback, object asyncState) { + int deviceindex = ((int)(inValues[0])); + byte[] splitbyteValue = ((byte[])(inValues[1])); + byte[] devicestates = ((byte[])(inValues[2])); + return this.BeginDealWithDeviceState(deviceindex, splitbyteValue, devicestates, callback, asyncState); } - private object[] OnEndOrderTurnOff(System.IAsyncResult result) { - bool retVal = this.EndOrderTurnOff(result); + private object[] OnEndDealWithDeviceState(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndDealWithDeviceState(out errtext, result); return new object[] { + errtext, retVal}; } - private void OnOrderTurnOffCompleted(object state) { - if ((this.OrderTurnOffCompleted != null)) { + private void OnDealWithDeviceStateCompleted(object state) { + if ((this.DealWithDeviceStateCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.OrderTurnOffCompleted(this, new OrderTurnOffCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.DealWithDeviceStateCompleted(this, new DealWithDeviceStateCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void OrderTurnOffAsync() { - this.OrderTurnOffAsync(null); + public void DealWithDeviceStateAsync(int deviceindex, byte[] splitbyteValue, byte[] devicestates) { + this.DealWithDeviceStateAsync(deviceindex, splitbyteValue, devicestates, null); } - public void OrderTurnOffAsync(object userState) { - if ((this.onBeginOrderTurnOffDelegate == null)) { - this.onBeginOrderTurnOffDelegate = new BeginOperationDelegate(this.OnBeginOrderTurnOff); + public void DealWithDeviceStateAsync(int deviceindex, byte[] splitbyteValue, byte[] devicestates, object userState) { + if ((this.onBeginDealWithDeviceStateDelegate == null)) { + this.onBeginDealWithDeviceStateDelegate = new BeginOperationDelegate(this.OnBeginDealWithDeviceState); } - if ((this.onEndOrderTurnOffDelegate == null)) { - this.onEndOrderTurnOffDelegate = new EndOperationDelegate(this.OnEndOrderTurnOff); + if ((this.onEndDealWithDeviceStateDelegate == null)) { + this.onEndDealWithDeviceStateDelegate = new EndOperationDelegate(this.OnEndDealWithDeviceState); } - if ((this.onOrderTurnOffCompletedDelegate == null)) { - this.onOrderTurnOffCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOrderTurnOffCompleted); + if ((this.onDealWithDeviceStateCompletedDelegate == null)) { + this.onDealWithDeviceStateCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnDealWithDeviceStateCompleted); } - base.InvokeAsync(this.onBeginOrderTurnOffDelegate, null, this.onEndOrderTurnOffDelegate, this.onOrderTurnOffCompletedDelegate, userState); + base.InvokeAsync(this.onBeginDealWithDeviceStateDelegate, new object[] { + deviceindex, + splitbyteValue, + devicestates}, this.onEndDealWithDeviceStateDelegate, this.onDealWithDeviceStateCompletedDelegate, userState); } - public bool DeviceCommunicationInit(out string ErrText, string CommunicationType) { - return base.Channel.DeviceCommunicationInit(out ErrText, CommunicationType); + public Model.MDevice SendAllDeviceStates(int device) { + return base.Channel.SendAllDeviceStates(device); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginDeviceCommunicationInit(string CommunicationType, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginDeviceCommunicationInit(CommunicationType, callback, asyncState); + public System.IAsyncResult BeginSendAllDeviceStates(int device, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginSendAllDeviceStates(device, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndDeviceCommunicationInit(out string ErrText, System.IAsyncResult result) { - return base.Channel.EndDeviceCommunicationInit(out ErrText, result); + public Model.MDevice EndSendAllDeviceStates(System.IAsyncResult result) { + return base.Channel.EndSendAllDeviceStates(result); } - private System.IAsyncResult OnBeginDeviceCommunicationInit(object[] inValues, System.AsyncCallback callback, object asyncState) { - string CommunicationType = ((string)(inValues[0])); - return this.BeginDeviceCommunicationInit(CommunicationType, callback, asyncState); + private System.IAsyncResult OnBeginSendAllDeviceStates(object[] inValues, System.AsyncCallback callback, object asyncState) { + int device = ((int)(inValues[0])); + return this.BeginSendAllDeviceStates(device, callback, asyncState); } - private object[] OnEndDeviceCommunicationInit(System.IAsyncResult result) { - string ErrText = this.GetDefaultValueForInitialization(); - bool retVal = this.EndDeviceCommunicationInit(out ErrText, result); + private object[] OnEndSendAllDeviceStates(System.IAsyncResult result) { + Model.MDevice retVal = this.EndSendAllDeviceStates(result); return new object[] { - ErrText, retVal}; } - private void OnDeviceCommunicationInitCompleted(object state) { - if ((this.DeviceCommunicationInitCompleted != null)) { + private void OnSendAllDeviceStatesCompleted(object state) { + if ((this.SendAllDeviceStatesCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.DeviceCommunicationInitCompleted(this, new DeviceCommunicationInitCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.SendAllDeviceStatesCompleted(this, new SendAllDeviceStatesCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void DeviceCommunicationInitAsync(string CommunicationType) { - this.DeviceCommunicationInitAsync(CommunicationType, null); + public void SendAllDeviceStatesAsync(int device) { + this.SendAllDeviceStatesAsync(device, null); } - public void DeviceCommunicationInitAsync(string CommunicationType, object userState) { - if ((this.onBeginDeviceCommunicationInitDelegate == null)) { - this.onBeginDeviceCommunicationInitDelegate = new BeginOperationDelegate(this.OnBeginDeviceCommunicationInit); + public void SendAllDeviceStatesAsync(int device, object userState) { + if ((this.onBeginSendAllDeviceStatesDelegate == null)) { + this.onBeginSendAllDeviceStatesDelegate = new BeginOperationDelegate(this.OnBeginSendAllDeviceStates); } - if ((this.onEndDeviceCommunicationInitDelegate == null)) { - this.onEndDeviceCommunicationInitDelegate = new EndOperationDelegate(this.OnEndDeviceCommunicationInit); + if ((this.onEndSendAllDeviceStatesDelegate == null)) { + this.onEndSendAllDeviceStatesDelegate = new EndOperationDelegate(this.OnEndSendAllDeviceStates); } - if ((this.onDeviceCommunicationInitCompletedDelegate == null)) { - this.onDeviceCommunicationInitCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnDeviceCommunicationInitCompleted); + if ((this.onSendAllDeviceStatesCompletedDelegate == null)) { + this.onSendAllDeviceStatesCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSendAllDeviceStatesCompleted); } - base.InvokeAsync(this.onBeginDeviceCommunicationInitDelegate, new object[] { - CommunicationType}, this.onEndDeviceCommunicationInitDelegate, this.onDeviceCommunicationInitCompletedDelegate, userState); + base.InvokeAsync(this.onBeginSendAllDeviceStatesDelegate, new object[] { + device}, this.onEndSendAllDeviceStatesDelegate, this.onSendAllDeviceStatesCompletedDelegate, userState); } - public System.Data.DataTable GetUsers(out string Errtext) { - return base.Channel.GetUsers(out Errtext); + public bool WriteDBData(out string errtext, int deviceIndex, string DBBlock, string Wdata) { + return base.Channel.WriteDBData(out errtext, deviceIndex, DBBlock, Wdata); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginGetUsers(System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginGetUsers(callback, asyncState); + public System.IAsyncResult BeginWriteDBData(int deviceIndex, string DBBlock, string Wdata, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginWriteDBData(deviceIndex, DBBlock, Wdata, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.Data.DataTable EndGetUsers(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndGetUsers(out Errtext, result); + public bool EndWriteDBData(out string errtext, System.IAsyncResult result) { + return base.Channel.EndWriteDBData(out errtext, result); } - private System.IAsyncResult OnBeginGetUsers(object[] inValues, System.AsyncCallback callback, object asyncState) { - return this.BeginGetUsers(callback, asyncState); + private System.IAsyncResult OnBeginWriteDBData(object[] inValues, System.AsyncCallback callback, object asyncState) { + int deviceIndex = ((int)(inValues[0])); + string DBBlock = ((string)(inValues[1])); + string Wdata = ((string)(inValues[2])); + return this.BeginWriteDBData(deviceIndex, DBBlock, Wdata, callback, asyncState); } - private object[] OnEndGetUsers(System.IAsyncResult result) { - string Errtext = this.GetDefaultValueForInitialization(); - System.Data.DataTable retVal = this.EndGetUsers(out Errtext, result); + private object[] OnEndWriteDBData(System.IAsyncResult result) { + string errtext = this.GetDefaultValueForInitialization(); + bool retVal = this.EndWriteDBData(out errtext, result); return new object[] { - Errtext, + errtext, retVal}; } - private void OnGetUsersCompleted(object state) { - if ((this.GetUsersCompleted != null)) { + private void OnWriteDBDataCompleted(object state) { + if ((this.WriteDBDataCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.GetUsersCompleted(this, new GetUsersCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.WriteDBDataCompleted(this, new WriteDBDataCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void GetUsersAsync() { - this.GetUsersAsync(null); + public void WriteDBDataAsync(int deviceIndex, string DBBlock, string Wdata) { + this.WriteDBDataAsync(deviceIndex, DBBlock, Wdata, null); } - public void GetUsersAsync(object userState) { - if ((this.onBeginGetUsersDelegate == null)) { - this.onBeginGetUsersDelegate = new BeginOperationDelegate(this.OnBeginGetUsers); + public void WriteDBDataAsync(int deviceIndex, string DBBlock, string Wdata, object userState) { + if ((this.onBeginWriteDBDataDelegate == null)) { + this.onBeginWriteDBDataDelegate = new BeginOperationDelegate(this.OnBeginWriteDBData); } - if ((this.onEndGetUsersDelegate == null)) { - this.onEndGetUsersDelegate = new EndOperationDelegate(this.OnEndGetUsers); + if ((this.onEndWriteDBDataDelegate == null)) { + this.onEndWriteDBDataDelegate = new EndOperationDelegate(this.OnEndWriteDBData); } - if ((this.onGetUsersCompletedDelegate == null)) { - this.onGetUsersCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetUsersCompleted); + if ((this.onWriteDBDataCompletedDelegate == null)) { + this.onWriteDBDataCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnWriteDBDataCompleted); } - base.InvokeAsync(this.onBeginGetUsersDelegate, null, this.onEndGetUsersDelegate, this.onGetUsersCompletedDelegate, userState); + base.InvokeAsync(this.onBeginWriteDBDataDelegate, new object[] { + deviceIndex, + DBBlock, + Wdata}, this.onEndWriteDBDataDelegate, this.onWriteDBDataCompletedDelegate, userState); } - public bool BuildHandTask(out string Errtext, Model.HandTask Handtask) { - return base.Channel.BuildHandTask(out Errtext, Handtask); + public bool ReConnectOPCServer() { + return base.Channel.ReConnectOPCServer(); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginBuildHandTask(Model.HandTask Handtask, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginBuildHandTask(Handtask, callback, asyncState); + public System.IAsyncResult BeginReConnectOPCServer(System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginReConnectOPCServer(callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndBuildHandTask(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndBuildHandTask(out Errtext, result); + public bool EndReConnectOPCServer(System.IAsyncResult result) { + return base.Channel.EndReConnectOPCServer(result); } - private System.IAsyncResult OnBeginBuildHandTask(object[] inValues, System.AsyncCallback callback, object asyncState) { - Model.HandTask Handtask = ((Model.HandTask)(inValues[0])); - return this.BeginBuildHandTask(Handtask, callback, asyncState); + private System.IAsyncResult OnBeginReConnectOPCServer(object[] inValues, System.AsyncCallback callback, object asyncState) { + return this.BeginReConnectOPCServer(callback, asyncState); } - private object[] OnEndBuildHandTask(System.IAsyncResult result) { - string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndBuildHandTask(out Errtext, result); + private object[] OnEndReConnectOPCServer(System.IAsyncResult result) { + bool retVal = this.EndReConnectOPCServer(result); return new object[] { - Errtext, retVal}; } - private void OnBuildHandTaskCompleted(object state) { - if ((this.BuildHandTaskCompleted != null)) { + private void OnReConnectOPCServerCompleted(object state) { + if ((this.ReConnectOPCServerCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.BuildHandTaskCompleted(this, new BuildHandTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.ReConnectOPCServerCompleted(this, new ReConnectOPCServerCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); } } - public void BuildHandTaskAsync(Model.HandTask Handtask) { - this.BuildHandTaskAsync(Handtask, null); + public void ReConnectOPCServerAsync() { + this.ReConnectOPCServerAsync(null); } - public void BuildHandTaskAsync(Model.HandTask Handtask, object userState) { - if ((this.onBeginBuildHandTaskDelegate == null)) { - this.onBeginBuildHandTaskDelegate = new BeginOperationDelegate(this.OnBeginBuildHandTask); + public void ReConnectOPCServerAsync(object userState) { + if ((this.onBeginReConnectOPCServerDelegate == null)) { + this.onBeginReConnectOPCServerDelegate = new BeginOperationDelegate(this.OnBeginReConnectOPCServer); } - if ((this.onEndBuildHandTaskDelegate == null)) { - this.onEndBuildHandTaskDelegate = new EndOperationDelegate(this.OnEndBuildHandTask); + if ((this.onEndReConnectOPCServerDelegate == null)) { + this.onEndReConnectOPCServerDelegate = new EndOperationDelegate(this.OnEndReConnectOPCServer); } - if ((this.onBuildHandTaskCompletedDelegate == null)) { - this.onBuildHandTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnBuildHandTaskCompleted); + if ((this.onReConnectOPCServerCompletedDelegate == null)) { + this.onReConnectOPCServerCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnReConnectOPCServerCompleted); } - base.InvokeAsync(this.onBeginBuildHandTaskDelegate, new object[] { - Handtask}, this.onEndBuildHandTaskDelegate, this.onBuildHandTaskCompletedDelegate, userState); + base.InvokeAsync(this.onBeginReConnectOPCServerDelegate, null, this.onEndReConnectOPCServerDelegate, this.onReConnectOPCServerCompletedDelegate, userState); } - public bool BuildHandAssociateTask(out string Errtext, int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName) { - return base.Channel.BuildHandAssociateTask(out Errtext, ConveyorIndex, ConveyorOrder, RgvIndex, RgvOrder, RgvOrderName); + public void ActionError(int DeviceIdx, int TaskIdx, int ErrId) { + base.Channel.ActionError(DeviceIdx, TaskIdx, ErrId); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public System.IAsyncResult BeginBuildHandAssociateTask(int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName, System.AsyncCallback callback, object asyncState) { - return base.Channel.BeginBuildHandAssociateTask(ConveyorIndex, ConveyorOrder, RgvIndex, RgvOrder, RgvOrderName, callback, asyncState); + public System.IAsyncResult BeginActionError(int DeviceIdx, int TaskIdx, int ErrId, System.AsyncCallback callback, object asyncState) { + return base.Channel.BeginActionError(DeviceIdx, TaskIdx, ErrId, callback, asyncState); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public bool EndBuildHandAssociateTask(out string Errtext, System.IAsyncResult result) { - return base.Channel.EndBuildHandAssociateTask(out Errtext, result); + public void EndActionError(System.IAsyncResult result) { + base.Channel.EndActionError(result); } - private System.IAsyncResult OnBeginBuildHandAssociateTask(object[] inValues, System.AsyncCallback callback, object asyncState) { - int ConveyorIndex = ((int)(inValues[0])); - int ConveyorOrder = ((int)(inValues[1])); - int RgvIndex = ((int)(inValues[2])); - int RgvOrder = ((int)(inValues[3])); - string RgvOrderName = ((string)(inValues[4])); - return this.BeginBuildHandAssociateTask(ConveyorIndex, ConveyorOrder, RgvIndex, RgvOrder, RgvOrderName, callback, asyncState); + private System.IAsyncResult OnBeginActionError(object[] inValues, System.AsyncCallback callback, object asyncState) { + int DeviceIdx = ((int)(inValues[0])); + int TaskIdx = ((int)(inValues[1])); + int ErrId = ((int)(inValues[2])); + return this.BeginActionError(DeviceIdx, TaskIdx, ErrId, callback, asyncState); } - private object[] OnEndBuildHandAssociateTask(System.IAsyncResult result) { - string Errtext = this.GetDefaultValueForInitialization(); - bool retVal = this.EndBuildHandAssociateTask(out Errtext, result); - return new object[] { - Errtext, - retVal}; + private object[] OnEndActionError(System.IAsyncResult result) { + this.EndActionError(result); + return null; } - private void OnBuildHandAssociateTaskCompleted(object state) { - if ((this.BuildHandAssociateTaskCompleted != null)) { + private void OnActionErrorCompleted(object state) { + if ((this.ActionErrorCompleted != null)) { InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); - this.BuildHandAssociateTaskCompleted(this, new BuildHandAssociateTaskCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); + this.ActionErrorCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState)); } } - public void BuildHandAssociateTaskAsync(int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName) { - this.BuildHandAssociateTaskAsync(ConveyorIndex, ConveyorOrder, RgvIndex, RgvOrder, RgvOrderName, null); + public void ActionErrorAsync(int DeviceIdx, int TaskIdx, int ErrId) { + this.ActionErrorAsync(DeviceIdx, TaskIdx, ErrId, null); } - public void BuildHandAssociateTaskAsync(int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName, object userState) { - if ((this.onBeginBuildHandAssociateTaskDelegate == null)) { - this.onBeginBuildHandAssociateTaskDelegate = new BeginOperationDelegate(this.OnBeginBuildHandAssociateTask); + public void ActionErrorAsync(int DeviceIdx, int TaskIdx, int ErrId, object userState) { + if ((this.onBeginActionErrorDelegate == null)) { + this.onBeginActionErrorDelegate = new BeginOperationDelegate(this.OnBeginActionError); } - if ((this.onEndBuildHandAssociateTaskDelegate == null)) { - this.onEndBuildHandAssociateTaskDelegate = new EndOperationDelegate(this.OnEndBuildHandAssociateTask); + if ((this.onEndActionErrorDelegate == null)) { + this.onEndActionErrorDelegate = new EndOperationDelegate(this.OnEndActionError); } - if ((this.onBuildHandAssociateTaskCompletedDelegate == null)) { - this.onBuildHandAssociateTaskCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnBuildHandAssociateTaskCompleted); + if ((this.onActionErrorCompletedDelegate == null)) { + this.onActionErrorCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnActionErrorCompleted); } - base.InvokeAsync(this.onBeginBuildHandAssociateTaskDelegate, new object[] { - ConveyorIndex, - ConveyorOrder, - RgvIndex, - RgvOrder, - RgvOrderName}, this.onEndBuildHandAssociateTaskDelegate, this.onBuildHandAssociateTaskCompletedDelegate, userState); + base.InvokeAsync(this.onBeginActionErrorDelegate, new object[] { + DeviceIdx, + TaskIdx, + ErrId}, this.onEndActionErrorDelegate, this.onActionErrorCompletedDelegate, userState); } } } diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/Reference.svcmap b/ControlMonitorClient/Service References/WcfControlMonitor/Reference.svcmap index 05efb71..2e75673 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/Reference.svcmap +++ b/ControlMonitorClient/Service References/WcfControlMonitor/Reference.svcmap @@ -1,5 +1,5 @@ - + true true @@ -18,16 +18,16 @@ - + - - - - - - - + + + + + + + diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/System.Data1.xsd b/ControlMonitorClient/Service References/WcfControlMonitor/System.Data.xsd similarity index 100% rename from ControlMonitorClient/Service References/WcfControlMonitor/System.Data1.xsd rename to ControlMonitorClient/Service References/WcfControlMonitor/System.Data.xsd diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/System.Data11.xsd b/ControlMonitorClient/Service References/WcfControlMonitor/System.Data11.xsd deleted file mode 100644 index 8c8a3c0..0000000 --- a/ControlMonitorClient/Service References/WcfControlMonitor/System.Data11.xsd +++ /dev/null @@ -1,17 +0,0 @@ -锘 - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/WcfControlMonitorLib.xsd b/ControlMonitorClient/Service References/WcfControlMonitor/WcfControlMonitorLib.xsd index 0fa5628..f7e1c29 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/WcfControlMonitorLib.xsd +++ b/ControlMonitorClient/Service References/WcfControlMonitor/WcfControlMonitorLib.xsd @@ -13,7 +13,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/configuration.svcinfo b/ControlMonitorClient/Service References/WcfControlMonitor/configuration.svcinfo index d126995..3853452 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/configuration.svcinfo +++ b/ControlMonitorClient/Service References/WcfControlMonitor/configuration.svcinfo @@ -1,10 +1,10 @@ 锘 - + - + - + \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/configuration91.svcinfo b/ControlMonitorClient/Service References/WcfControlMonitor/configuration91.svcinfo index 0f42da2..378e142 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/configuration91.svcinfo +++ b/ControlMonitorClient/Service References/WcfControlMonitor/configuration91.svcinfo @@ -1,5 +1,5 @@ - + @@ -7,43 +7,43 @@ NetTcpBinding_IControlMonitor - 00:01:00 + - 00:01:00 + - 00:10:00 + - 00:01:00 + - + False - + Buffered - + OleTransactions - + StrongWildcard - - 10 + + 0 - 524288 + - + 65536 - - 10 + + 0 - 65536 + False @@ -51,31 +51,31 @@ System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement - - 32 + + 0 - - 8192 + + 0 - - 16384 + + 0 - - 4096 + + 0 - - 16384 + + 0 System.ServiceModel.Configuration.StandardBindingOptionalReliableSessionElement - + True - + 00:10:00 - + False @@ -87,10 +87,10 @@ System.ServiceModel.Configuration.TcpTransportSecurityElement - + Windows - + EncryptAndSign @@ -105,10 +105,13 @@ (闆嗗悎) + + None + System.ServiceModel.Configuration.MessageSecurityOverTcpElement - + Windows @@ -118,10 +121,10 @@ - + - net.tcp://10.152.7.210:4522/ + net.tcp://localhost:4524/ @@ -160,7 +163,7 @@ System.ServiceModel.Configuration.DnsElement - 10.152.7.210 + 127.0.0.1 System.ServiceModel.Configuration.RsaElement diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/service11.wsdl b/ControlMonitorClient/Service References/WcfControlMonitor/service.wsdl similarity index 97% rename from ControlMonitorClient/Service References/WcfControlMonitor/service11.wsdl rename to ControlMonitorClient/Service References/WcfControlMonitor/service.wsdl index a7647c3..daa25a7 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/service11.wsdl +++ b/ControlMonitorClient/Service References/WcfControlMonitor/service.wsdl @@ -1,5 +1,5 @@ 锘 - + @@ -15,130 +15,160 @@ + - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -290,155 +320,131 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -450,85 +456,105 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -630,105 +656,89 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + + + + + @@ -744,8 +754,8 @@ - - + + @@ -753,8 +763,8 @@ - - + + @@ -762,8 +772,8 @@ - - + + @@ -771,8 +781,8 @@ - - + + @@ -780,8 +790,8 @@ - - + + @@ -789,8 +799,8 @@ - - + + @@ -798,8 +808,8 @@ - - + + @@ -807,8 +817,8 @@ - - + + @@ -816,8 +826,8 @@ - - + + @@ -825,8 +835,8 @@ - - + + @@ -834,8 +844,8 @@ - - + + @@ -843,8 +853,8 @@ - - + + @@ -852,8 +862,8 @@ - - + + @@ -861,8 +871,8 @@ - - + + @@ -870,8 +880,8 @@ - - + + @@ -879,8 +889,8 @@ - - + + @@ -888,8 +898,8 @@ - - + + @@ -897,8 +907,8 @@ - - + + @@ -906,8 +916,8 @@ - - + + @@ -915,8 +925,53 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1149,44 +1204,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1194,8 +1213,8 @@ - - + + @@ -1203,8 +1222,8 @@ - - + + @@ -1212,8 +1231,8 @@ - - + + @@ -1221,8 +1240,8 @@ - - + + @@ -1230,8 +1249,8 @@ - - + + @@ -1239,8 +1258,8 @@ - - + + @@ -1248,8 +1267,8 @@ - - + + @@ -1257,8 +1276,8 @@ - - + + @@ -1266,8 +1285,8 @@ - - + + @@ -1275,8 +1294,8 @@ - - + + @@ -1284,8 +1303,8 @@ - - + + @@ -1293,8 +1312,8 @@ - - + + @@ -1302,8 +1321,8 @@ - - + + @@ -1311,8 +1330,8 @@ - - + + @@ -1320,8 +1339,8 @@ - - + + @@ -1329,8 +1348,8 @@ - - + + @@ -1338,8 +1357,8 @@ - - + + @@ -1347,8 +1366,8 @@ - - + + @@ -1356,8 +1375,8 @@ - - + + @@ -1365,8 +1384,8 @@ - - + + @@ -1395,11 +1414,11 @@ - + - net.tcp://10.152.7.210:4522/ + net.tcp://localhost:4524/ - 10.152.7.210 + 127.0.0.1 diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/service22.xsd b/ControlMonitorClient/Service References/WcfControlMonitor/service.xsd similarity index 94% rename from ControlMonitorClient/Service References/WcfControlMonitor/service22.xsd rename to ControlMonitorClient/Service References/WcfControlMonitor/service.xsd index 72836db..ae44b7e 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/service22.xsd +++ b/ControlMonitorClient/Service References/WcfControlMonitor/service.xsd @@ -3,365 +3,428 @@ - + - + + + - + - - + + + + - + - + + + - + - - + + - + - + - - + + - + - + + + - + - - + + - + - + + - + - - + + - + - + + - + - - + + - + - + - - + + - + - - + - + - - + + - + - + + + + - + - - + + - + - + + - + - - - - - - - - - - - - - - - + + - + - - - + - + - - + + - + - - - + - + - - - - - - - - - - - - - - - + + - + - + - + - - + + - + - + - - + + - + - + - - + - + - - + + - + - - + + - + - - - + - + - - + + - + - + + - + - + - + - - - - - + - + - - + - + - + - + - + - - - + - + - - + - + - - - + - + - - + + - + - - - - - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -386,7 +449,7 @@ - + @@ -408,7 +471,7 @@ - + @@ -444,7 +507,7 @@ - + @@ -466,7 +529,7 @@ - + @@ -481,7 +544,7 @@ - + @@ -741,381 +804,332 @@ - + - - - + - + - - - - + + - + - - - + - + - - + + - + - + - - + + - + - - - + - + - - + + - + - - + - + - - + + - + - - + - + - - + + - + - + - - + + - + - + + - + - - + + - + - - - - + - + - - + + - + - - + - + - - + + + + + + + + + + + + + + + - - - - - - + - - + - - - - - - + - - + + - + - + - + - - + + + + + + + + + + + + + + + - - - - - - + - - + - - - - - - + - + + - + - - - - + - + - - + + - + - - - + - + - - + + - + - - + + - + - + + - - - - - - + - + + + - - - - - - + - + + - - - - - - + - + - + - + - + - - + + + - - - - - - + - - - - - - - - - - - - - - - + + - + - - - + - + - - + - + - - - - - + + + - + - - - - + diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/service1.wsdl b/ControlMonitorClient/Service References/WcfControlMonitor/service1.wsdl deleted file mode 100644 index 110fff0..0000000 --- a/ControlMonitorClient/Service References/WcfControlMonitor/service1.wsdl +++ /dev/null @@ -1,1071 +0,0 @@ -锘 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - net.tcp://192.168.0.110:9996/WcfControlMonitorLib - - 192.168.0.110 - - - - - \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/service21.xsd b/ControlMonitorClient/Service References/WcfControlMonitor/service1.xsd similarity index 100% rename from ControlMonitorClient/Service References/WcfControlMonitor/service21.xsd rename to ControlMonitorClient/Service References/WcfControlMonitor/service1.xsd diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/service2.xsd b/ControlMonitorClient/Service References/WcfControlMonitor/service2.xsd deleted file mode 100644 index 0be6477..0000000 --- a/ControlMonitorClient/Service References/WcfControlMonitor/service2.xsd +++ /dev/null @@ -1,885 +0,0 @@ -锘 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/service23.xsd b/ControlMonitorClient/Service References/WcfControlMonitor/service23.xsd deleted file mode 100644 index b4d5ff0..0000000 --- a/ControlMonitorClient/Service References/WcfControlMonitor/service23.xsd +++ /dev/null @@ -1,42 +0,0 @@ -锘 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.DeviceStateType.datasource b/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.DeviceStateType.datasource index e69b6e2..bda1576 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.DeviceStateType.datasource +++ b/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.DeviceStateType.datasource @@ -6,5 +6,5 @@ cause the file to be unrecognizable by the program. --> - wcfControlMonitorClient.WcfControlMonitor.DeviceStateType, Service References.WcfControlMonitor.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + wcfControlMonitorClient.WcfControlMonitor.DeviceStateType, Service References.WcfControlMonitor.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.DevicesDic.datasource b/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.DevicesDic.datasource index ff9f6f2..8e6ebf9 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.DevicesDic.datasource +++ b/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.DevicesDic.datasource @@ -6,5 +6,5 @@ cause the file to be unrecognizable by the program. --> - wcfControlMonitorClient.WcfControlMonitor.DevicesDic, Service References.WcfControlMonitor.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + wcfControlMonitorClient.WcfControlMonitor.DevicesDic, Service References.WcfControlMonitor.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.LanguageContent.datasource b/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.LanguageContent.datasource index b1918d2..e04f41c 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.LanguageContent.datasource +++ b/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.LanguageContent.datasource @@ -6,5 +6,5 @@ cause the file to be unrecognizable by the program. --> - wcfControlMonitorClient.WcfControlMonitor.LanguageContent, Service References.WcfControlMonitor.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + wcfControlMonitorClient.WcfControlMonitor.LanguageContent, Service References.WcfControlMonitor.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.ManageTask.datasource b/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.ManageTask.datasource index 8ad59b1..bcc14ff 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.ManageTask.datasource +++ b/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.ManageTask.datasource @@ -6,5 +6,5 @@ cause the file to be unrecognizable by the program. --> - wcfControlMonitorClient.WcfControlMonitor.ManageTask, Service References.WcfControlMonitor.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + wcfControlMonitorClient.WcfControlMonitor.ManageTask, Service References.WcfControlMonitor.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.MonitorTask.datasource b/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.MonitorTask.datasource index 31d4819..ed2b7db 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.MonitorTask.datasource +++ b/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.MonitorTask.datasource @@ -6,5 +6,5 @@ cause the file to be unrecognizable by the program. --> - wcfControlMonitorClient.WcfControlMonitor.MonitorTask, Service References.WcfControlMonitor.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + wcfControlMonitorClient.WcfControlMonitor.MonitorTask, Service References.WcfControlMonitor.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.ST_Cell.datasource b/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.ST_Cell.datasource index efb7477..5de398e 100644 --- a/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.ST_Cell.datasource +++ b/ControlMonitorClient/Service References/WcfControlMonitor/wcfControlMonitorClient.WcfControlMonitor.ST_Cell.datasource @@ -6,5 +6,5 @@ cause the file to be unrecognizable by the program. --> - wcfControlMonitorClient.WcfControlMonitor.ST_Cell, Service References.WcfControlMonitor.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + wcfControlMonitorClient.WcfControlMonitor.ST_Cell, Service References.WcfControlMonitor.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/ControlMonitorClient/app.config b/ControlMonitorClient/app.config index 61ce68e..886c7ba 100644 --- a/ControlMonitorClient/app.config +++ b/ControlMonitorClient/app.config @@ -52,21 +52,13 @@ - - - - - - + maxBufferPoolSize="5242888" maxReceivedMessageSize="6553688"> + - diff --git a/ControlMonitorClient/wcfControlMonitorClient.csproj b/ControlMonitorClient/wcfControlMonitorClient.csproj index 2bc07fc..b26912c 100644 --- a/ControlMonitorClient/wcfControlMonitorClient.csproj +++ b/ControlMonitorClient/wcfControlMonitorClient.csproj @@ -321,11 +321,6 @@ - - True - True - Reference.svcmap - Form @@ -338,10 +333,21 @@ FrmDeviceErrorSolutions.cs + + True + True + Reference.svcmap + Always + + WCF Proxy Generator + Reference.cs + + + @@ -519,20 +525,20 @@ Settings.settings True - + Designer - + Designer - - + + Designer - + Designer - + Designer @@ -643,21 +649,6 @@ OPCClient - - - - - - - - - - - - WCF Proxy Generator - Reference.cs - - @@ -683,6 +674,9 @@ true + + + - + - - + + @@ -52,11 +52,11 @@ - + - + diff --git a/WcfControlMonitorLib/App.config b/WcfControlMonitorLib/App.config index 70f45ee..66226af 100644 --- a/WcfControlMonitorLib/App.config +++ b/WcfControlMonitorLib/App.config @@ -17,7 +17,7 @@ - http://192.168.0.118:9090/Service/ManageService + http://127.0.0.1:9090/Service/ManageService diff --git a/WcfControlMonitorLib/CCallService.cs b/WcfControlMonitorLib/CCallService.cs index 35f0d50..2e451b0 100644 --- a/WcfControlMonitorLib/CCallService.cs +++ b/WcfControlMonitorLib/CCallService.cs @@ -1045,7 +1045,7 @@ namespace WcfControlMonitorLib data = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; WCS_WMS_PARAM_UPDATE upd = new WCS_WMS_PARAM_UPDATE();//浼犲弬瑙f瀽浣跨敤 if (data.Count > 0) { - upd.taskId = Managertask_Id.ToString(); + upd.taskId = "DC"+Managertask_Id.ToString(); upd.taskStatus = state; if (Convert.ToInt32(data[0]["CONTROL_TASK_TYPE"]) == 1) { upd.endSpaceCode = data[0]["END_DEVICE_CODE"].ToString(); @@ -1340,6 +1340,7 @@ namespace WcfControlMonitorLib static DBOperator dbo = CStaticClass.dbo; static DBOperator dboMan = CStaticClass.dboM; static StringBuilder sql = new StringBuilder(); + static StringBuilder sql2 = new StringBuilder(); static StringBuilder[] wv = { new StringBuilder("2") }; static StringBuilder[] witemnames = { new StringBuilder("") }; static Model.MDevice devinfo = new Model.MDevice(); @@ -1487,17 +1488,18 @@ namespace WcfControlMonitorLib } else { + //鏆傚畾閫氳澶辫触鍜屾帴鍙h繑鍥炲け璐ラ兘鐩存帴鍥為 - sql.Clear(); - sql.Append("select F_EndDevice from T_Base_Route WHERE F_StartDevice =").Append(dataInRequest[i]["DEVICE_CODE"]).Append(" and F_RouteKind=4");//鏌ヨ鍥為浠诲姟鐨勭粓鐐逛綅缃 - DataView dataBackTask = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + sql2.Clear(); + sql2.Append("select F_EndDevice from T_Base_Route WHERE F_StartDevice =").Append(dataInRequest[i]["DEVICE_CODE"]).Append(" and F_RouteKind=4");//鏌ヨ鍥為浠诲姟鐨勭粓鐐逛綅缃 + DataView dataBackTask = dbo.ExceSQL(sql2.ToString()).Tables[0].DefaultView; IO_CONTROL iO_CONTROL = new IO_CONTROL(dataInRequest[i]["DEVICE_CODE"].ToString(), dataBackTask[0]["F_EndDevice"].ToString(), dataInRequest[i]["STOCK_BARCODE"].ToString()); iO_CONTROL.Insert_IOCONTROL();//鏆備笉鑰冭檻鎻掑叆澶辫触鐨勬儏鍐 鍐欏叆IO鍏ュ簱浠诲姟 CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "inboundApply", "寮濮嬭皟鐢╳ms鏈嶅姟澶辫触:", $"杩斿洖鎶ラ敊{resp_data.data}:{resp_data.msg}"); } //鍒犻櫎IOControlApply鐨勬壂鐮佽姹 - sql.Clear(); - sql.Append($"delete from IO_CONTROL_APPLY where STOCK_BARCODE={dataInRequest[i]["STOCK_BARCODE"]} and CONTROL_APPLY_TYPE =1 ");//鏌ヨ鍥為浠诲姟鐨勭粓鐐逛綅缃 + sql.Clear(); + sql.Append($"delete from IO_CONTROL_APPLY where STOCK_BARCODE='{dataInRequest[i]["STOCK_BARCODE"]}' and CONTROL_APPLY_TYPE =1 ");//鏌ヨ鍥為浠诲姟鐨勭粓鐐逛綅缃 dbo.ExceSQL(sql.ToString()); } } @@ -1587,11 +1589,17 @@ namespace WcfControlMonitorLib } public static void StartListenPLC() { - exitThreadInAGVPLCAsk = false; - threadAGVStatusSend = new Thread(new ThreadStart(BeginListenAgvData)); // - threadAGVStatusSend.IsBackground = true; - threadAGVStatusSend.Start(); - threadAGVStatusSend.Join(); + try + { + exitThreadInAGVPLCAsk = false; + threadAGVStatusSend = new Thread(new ThreadStart(BeginListenAgvData)); // + threadAGVStatusSend.IsBackground = true; + threadAGVStatusSend.Start(); + //threadAGVStatusSend.Join(); + }catch (Exception ex) + { + + } } public static void EndListenPLC() { @@ -1658,7 +1666,7 @@ namespace WcfControlMonitorLib //} public IO_CONTROL(CCallService.InBoundApplyBackData indata, string time) { error_code.Clear(); - wms_id = indata.taskId; + wms_id = indata.taskId.Trim('D').Trim('C'); relative_id = -1; barcode = indata.containerCode; if (indata.taskType == 2 || indata.taskType == 3) @@ -1680,7 +1688,16 @@ namespace WcfControlMonitorLib public IO_CONTROL(string startStation,string endStation,string Barcode) { error_code.Clear(); - wms_id = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + DataSet ds = dbo.ExceSQL("select F_ManageTaskIndex from T_Base_Manage_Task_Index_Auto_Task"); + DataView dv = ds.Tables[0].DefaultView; + if (dv.Count > 0) + { + wms_id =( Convert.ToInt32(dv[0]["F_ManageTaskIndex"])+1).ToString(); //鑾峰彇鍥為浠诲姟鍙峰洖閫浠诲姟涓嶉渶瑕丏C寮澶 + //20101124 + sql.Append("UPDATE T_Base_Manage_Task_Index_Auto_Task SET F_ManageTaskIndex =").Append(Convert.ToInt32(wms_id)); + dbo.ExceSQL(sql.ToString()); + } + relative_id = -1; barcode = Barcode; startdevice = startStation; @@ -1694,7 +1711,7 @@ namespace WcfControlMonitorLib public IO_CONTROL(CCallService.OUT_MOVE_DATA outdata, string time, int controltype, string level)//鍑哄簱 绉诲簱 { error_code.Clear(); - wms_id = outdata.taskId; + wms_id = outdata.taskId.Trim('D').Trim('C'); relative_id = -1; barcode = outdata.containerCode; if (outdata.taskType == 2 || outdata.taskType == 3) @@ -1711,10 +1728,10 @@ namespace WcfControlMonitorLib string dTime1 = DateTime.Now.ToString("u"); begintime = dTime1.Substring(0, dTime1.Length - 1); tasklevel = level; - needAgv = outdata.carryType == 2 ? 1 : 0; + // needAgv = outdata.carryType == 2 ? 1 : 0; } //妫鏌ュ弬鏁版槸鍚︽纭 闇瑕佷紭鍖 - bool CheckData() + public bool CheckData(out string msg) { Dictionary all_checking = new Dictionary(); @@ -1765,10 +1782,10 @@ namespace WcfControlMonitorLib error_code.Append(";").Append("鏉$爜涓虹┖"); } - if (int.TryParse(this.wms_id, out int controlid) == false) - { - error_code.Append(";").Append(all_checking["CONTROL_ID_NOT_NUM"].des); //controlid涓嶄负鏁板瓧 - } + //if (int.TryParse(this.wms_id, out int controlid) == false) + //{ + // error_code.Append(";").Append(all_checking["CONTROL_ID_NOT_NUM"].des); //controlid涓嶄负鏁板瓧 + //} if (control_type == 2)//鍑哄簱浠诲姟 @@ -1877,10 +1894,12 @@ namespace WcfControlMonitorLib if (error_code.Length == 0) { + msg = ""; return true; } else { + msg = error_code.ToString(); return false; } } @@ -1888,15 +1907,15 @@ namespace WcfControlMonitorLib // public bool Insert_IOCONTROL() { - if (CheckData() == true) + if (CheckData(out string msg) == true) { try { sql.Clear(); sql.Append(string.Format("INSERT INTO IO_CONTROL (CONTROL_ID, RELATIVE_CONTROL_ID, MANAGE_ID, STOCK_BARCODE, CONTROL_TASK_TYPE, CONTROL_TASK_LEVEL," + - " START_WAREHOUSE_CODE, START_DEVICE_CODE, END_WAREHOUSE_CODE, END_DEVICE_CODE, CONTROL_BEGIN_TIME,CONTROL_STATUS,NeedAgv) " + - "VALUES( {0},'{1}','{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}',{11})", - wms_id, -1, 0, barcode, control_type, tasklevel, warehouse, startdevice, warehouse, enddevice, begintime, 0, needAgv)); + " START_WAREHOUSE_CODE, START_DEVICE_CODE, END_WAREHOUSE_CODE, END_DEVICE_CODE, CONTROL_BEGIN_TIME,CONTROL_STATUS) " + + "VALUES( '{0}','{1}','{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}',{11})", + wms_id, -1, wms_id, barcode, control_type, tasklevel, warehouse, startdevice, warehouse, enddevice, begintime, 0)); dbo.ExceSQL(sql.ToString()); return true; } diff --git a/WcfControlMonitorLib/CCommonFunction.cs b/WcfControlMonitorLib/CCommonFunction.cs index 2704164..1a4885b 100644 --- a/WcfControlMonitorLib/CCommonFunction.cs +++ b/WcfControlMonitorLib/CCommonFunction.cs @@ -105,7 +105,7 @@ namespace WcfControlMonitorLib /// /// /// 璁惧鎸囦护绱㈠紩鍊硷紤锛嶏紞10000 - public int GetMonitorIndex(int managerTaskIndex, int managerTaskKindIndex) + public int GetMonitorIndex(long managerTaskIndex, int managerTaskKindIndex) {//20110104 DataView dvMt = new DataView(); @@ -845,7 +845,7 @@ namespace WcfControlMonitorLib /// 璁惧鎸囦护绱㈠紩 /// 璁惧绱㈠紩 /// 璇︾粏璺緞姝ラ绱㈠紩 - public void SendOrderSuccess(int taskKindIndex, int Managefid, int MonirotIdx, int deviceidx, int detailidx) + public void SendOrderSuccess(int taskKindIndex, long Managefid, int MonirotIdx, int deviceidx, int detailidx) { string AssociateDevice = "";//鍏宠仈璁惧 string LockedDeviceIndex = "";//琚攣瀹氱殑璁惧绱㈠紩缁勶紝浠モ滐紱鈥濆垎闅 @@ -974,7 +974,7 @@ namespace WcfControlMonitorLib } - public int GetManageTaskIndexfromMonitor(int monitorIdx) + public long GetManageTaskIndexfromMonitor(int monitorIdx) { //20100108 DataView dv = new DataView(); @@ -987,7 +987,7 @@ namespace WcfControlMonitorLib dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; if (dv.Count > 0) { - return Convert.ToInt32(dv[0]["F_ManageTaskIndex"]); + return Convert.ToInt64(dv[0]["F_ManageTaskIndex"]); } else { @@ -1095,7 +1095,7 @@ namespace WcfControlMonitorLib - public string GetControlBatchFromManageTask(int taskKindIndex, int Managefid) + public string GetControlBatchFromManageTask(int taskKindIndex, long Managefid) { //20100108 DataView dv = new DataView(); @@ -1125,7 +1125,7 @@ namespace WcfControlMonitorLib } } - public int GetRELATIVECONTORLIDFromManageTask(int taskKindIndex, int Managefid) + public int GetRELATIVECONTORLIDFromManageTask(int taskKindIndex, long Managefid) { //20100108 DataView dv = new DataView(); @@ -1793,7 +1793,7 @@ namespace WcfControlMonitorLib return "-"; } } - public int GetExceptionNOFromManageTask(int FID,int ManTaskKind) + public int GetExceptionNOFromManageTask(long FID,int ManTaskKind) { //20100108 DataTable dt = new DataTable(); @@ -1833,7 +1833,7 @@ namespace WcfControlMonitorLib } } - public string GetBarCodeFromManageTask(int FID, int ManTaskKind) + public string GetBarCodeFromManageTask(long FID, int ManTaskKind) { //20100108 DataTable dt = new DataTable(); @@ -2418,7 +2418,7 @@ namespace WcfControlMonitorLib /// 浠诲姟绫诲瀷绱㈠紩 /// 褰撳墠璁惧绱㈠紩 /// - public bool GetUseableRouteIDSubAndModifyRoute(int manageTaskIdx, int manageKindIdx, int curLocation) + public bool GetUseableRouteIDSubAndModifyRoute(long manageTaskIdx, int manageKindIdx, int curLocation) { DataView dvmi = new DataView(); DataView DMAN = new DataView(); @@ -2883,7 +2883,7 @@ namespace WcfControlMonitorLib devinfo = Model.CGetInfo.GetDeviceInfo(StackIndex); if (devinfo.VirtualStack > 0) StackIndex = devinfo.VirtualStack; - int fid = GetManageTaskIndexfromMonitor(taskindex); + long fid = GetManageTaskIndexfromMonitor(taskindex); int Mankind = GetManageTaskKindIndexFromMonitor(taskindex); int[] zxy = GetCoordinatesFromMonitorTask(taskindex); StringBuilder zxystr = new StringBuilder(); @@ -2926,7 +2926,7 @@ namespace WcfControlMonitorLib } } - public int GetEndDeviceFromManage(int mti, int fid) + public int GetEndDeviceFromManage(int mti, long fid) { DataView dv = new DataView(); try @@ -3002,7 +3002,7 @@ namespace WcfControlMonitorLib try { int mti = GetManageTaskKindIndexFromMonitor(taskindex); - int fid = GetManageTaskIndexfromMonitor(taskindex); + long fid = GetManageTaskIndexfromMonitor(taskindex); sql.Clear(); sql.Append("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE F_ManageTaskIndex=").Append(fid).Append(" and F_ManageTASKKINDINDEX=").Append(mti).Append(" and F_MonitorIndex>").Append(taskindex).Append(" order by F_MonitorIndex asc"); @@ -3031,7 +3031,7 @@ namespace WcfControlMonitorLib try { int mti = GetManageTaskKindIndexFromMonitor(taskindex); - int fid = GetManageTaskIndexfromMonitor(taskindex); + long fid = GetManageTaskIndexfromMonitor(taskindex); sql.Clear(); sql.Append("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE F_ManageTaskIndex=").Append(fid).Append(" and F_ManageTASKKINDINDEX=").Append(mti).Append(" and F_MonitorIndex<").Append(taskindex).Append(" order by F_MonitorIndex asc"); @@ -3414,7 +3414,7 @@ namespace WcfControlMonitorLib DataView dv = new DataView(); char[] cc = new char[1] { '-' }; string[] endCell = ChangeForkCell.Split(cc); - int fid = GetManageTaskIndexfromMonitor(taskindex); + long fid = GetManageTaskIndexfromMonitor(taskindex); int Mankind =GetManageTaskKindIndexFromMonitor(taskindex); //dbo.TransBegin(); try @@ -4223,7 +4223,7 @@ namespace WcfControlMonitorLib /// 浠诲姟绉嶇被 /// 绠$悊浠诲姟ID /// - public int GetFCONTROLTASKTYPEFromManageTask(int taskKindIndex, int Managefid) + public int GetFCONTROLTASKTYPEFromManageTask(int taskKindIndex, long Managefid) { //20100108 DataView dv = new DataView(); @@ -4259,7 +4259,7 @@ namespace WcfControlMonitorLib /// 浠诲姟绉嶇被 /// 绠$悊浠诲姟ID /// - public int GetFEndLayerFromManageTask(int taskKindIndex, int Managefid) + public int GetFEndLayerFromManageTask(int taskKindIndex, long Managefid) { //20100108 DataView dv = new DataView(); diff --git a/WcfControlMonitorLib/CControl.cs b/WcfControlMonitorLib/CControl.cs index 6dd6585..ab62107 100644 --- a/WcfControlMonitorLib/CControl.cs +++ b/WcfControlMonitorLib/CControl.cs @@ -409,7 +409,7 @@ namespace WcfControlMonitorLib } #region 关联指令不是第一个指令不能发送 int rmankind = Model.CGeneralFunction.GetManageTaskKindIndexFromMonitor(Convert.ToInt32(df[0])); - int rman = Model.CGeneralFunction.GetManageTaskIndexfromMonitor(Convert.ToInt32(df[0])); + long rman = Model.CGeneralFunction.GetManageTaskIndexfromMonitor(Convert.ToInt32(df[0])); sql.Remove(0, sql.Length); sql.Append("SELECT MIN(F_MonitorIndex) AS mmi FROM dbo.T_Monitor_Task WHERE (F_ManageTaskIndex = ").Append(rman).Append(") AND (F_ManageTASKKINDINDEX = ").Append(rmankind).Append(")"); dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; @@ -537,7 +537,7 @@ namespace WcfControlMonitorLib } #region 关联指令不是第一个指令不能发送 int rmankind = Model.CGeneralFunction.GetManageTaskKindIndexFromMonitor(Convert.ToInt32(df[0])); - int rman = Model.CGeneralFunction.GetManageTaskIndexfromMonitor(Convert.ToInt32(df[0])); + long rman = Model.CGeneralFunction.GetManageTaskIndexfromMonitor(Convert.ToInt32(df[0])); sql.Remove(0, sql.Length); sql.Append("SELECT MIN(F_MonitorIndex) AS mmi FROM dbo.T_Monitor_Task WHERE (F_ManageTaskIndex = ").Append(rman).Append(") AND (F_ManageTASKKINDINDEX = ").Append(rmankind).Append(")"); dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; @@ -747,7 +747,7 @@ namespace WcfControlMonitorLib if (DeviceIdx == 19003 && DeviceOrder == 2) { - int fid = ccf.GetManageTaskIndexfromMonitor(minMidx); + long fid = ccf.GetManageTaskIndexfromMonitor(minMidx); int mti = ccf.GetManageTaskKindIndexFromMonitor(minMidx); int endlayer = ccf.GetFEndLayerFromManageTask(mti, fid); string barcode = ccf.GetBarCodeFromMonitor(minMidx); @@ -843,7 +843,7 @@ namespace WcfControlMonitorLib dtime = dtime.Substring(0, dtime.Length - 1); int DeviceIdx = _DeviceIdx; int TaskIdx = minMidx; - int fid = ccf.GetManageTaskIndexfromMonitor(TaskIdx); + long fid = ccf.GetManageTaskIndexfromMonitor(TaskIdx); int mti = ccf.GetManageTaskKindIndexFromMonitor(TaskIdx); int DeviceKind = ccf.GetDeviceKindIdx(DeviceIdx);//20100617 int order = ccf.GetDeviceOrderFromMonitor(TaskIdx); @@ -1285,7 +1285,7 @@ namespace WcfControlMonitorLib #region 晟碟检测双升货位入库外侧货位时,系统无未完成的对应的里侧货位入库任务 if (AheadDetect[i].Trim().Substring(0, 1).ToUpper() == "J") { - int Index = ccf.GetManageTaskIndexfromMonitor(minMidx); + long Index = ccf.GetManageTaskIndexfromMonitor(minMidx); int Mk = ccf.GetManageTaskKindIndexFromMonitor(minMidx); sql.Clear(); sql.Append(string.Format("SELECT FLANEWAY,FENDCELL,F_RELATIVECONTORLID FROM T_Manage_Task WHERE (FID = {0} and F_ManageTaskKindIndex={1} )", Index, Mk)); @@ -1388,7 +1388,7 @@ namespace WcfControlMonitorLib if (AheadDetect[i].Trim().Substring(0, 1).ToUpper() == "M")// { - int Index = ccf.GetManageTaskIndexfromMonitor(minMidx); + long Index = ccf.GetManageTaskIndexfromMonitor(minMidx); int Mk = ccf.GetManageTaskKindIndexFromMonitor(minMidx); sql.Clear(); sql.Append(string.Format("SELECT FLANEWAY,FSTARTCELL,F_RELATIVECONTORLID FROM T_Manage_Task WHERE (FID = {0} and F_ManageTaskKindIndex={1} )", Index, Mk)); @@ -2006,7 +2006,7 @@ namespace WcfControlMonitorLib && (CStaticClass.GetDevicePhotoelectric(CorrelInfo[4]) == 0))//外探物,运行//20101124 { //查找本地管理任务做多叉关联配对,关联任务分配近叉 - int mfid = GetEnableDoubleForkManageTask(1, devinfo.DeviceIndex, fid); + long mfid = GetEnableDoubleForkManageTask(1, devinfo.DeviceIndex, fid); if (mfid > 0) { sql.Remove(0, sql.Length); @@ -3003,7 +3003,7 @@ namespace WcfControlMonitorLib int deviceKind = _DeviceKind; int deviceOrder = _DeviceOrder; int manageKindIdx = ccf.GetManageTaskKindIndexFromMonitor(MonitorIndex); - int manageTaskIdx = ccf.GetManageTaskIndexfromMonitor(MonitorIndex); + long manageTaskIdx = ccf.GetManageTaskIndexfromMonitor(MonitorIndex); int tasktype = ccf.GetFCONTROLTASKTYPEFromManageTask(manageKindIdx, manageTaskIdx); devinfo = Model.CGetInfo.GetDeviceInfo(deviceIdx); @@ -3402,7 +3402,8 @@ namespace WcfControlMonitorLib if (corrtask != null) { - int rfid = 0, rmankind = 0, rdev = 0; + long rfid = 0; + int rmankind = 0, rdev = 0; for (int i = 0; i < corrtask.GetLength(0); i++) { if (corrtask[i]!=0) @@ -3800,7 +3801,7 @@ namespace WcfControlMonitorLib /// 控制任务类型 /// 设备索引 /// - int GetEnableDoubleForkManageTask(int controlTaskType, int devindex, int FID) + long GetEnableDoubleForkManageTask(int controlTaskType, int devindex, long FID) { DataView dv0 = new DataView(); DataView dv = new DataView(); try @@ -3819,9 +3820,9 @@ namespace WcfControlMonitorLib { if (dv0[0]["mm"].ToString() == dv[i]["F_MonitorIndex"].ToString()) { - if (FID != Convert.ToInt32(dv[i]["F_ManageTaskIndex"])) + if (FID != Convert.ToInt64(dv[i]["F_ManageTaskIndex"])) { - return Convert.ToInt32(dv[i]["F_ManageTaskIndex"]); + return Convert.ToInt64(dv[i]["F_ManageTaskIndex"]); } } } @@ -3917,7 +3918,7 @@ namespace WcfControlMonitorLib /// 调度任务索引 /// 调度任务类型 /// 最后分配的远、近货叉 - void AlterRoutePath(int Mankind, int FID, int ControlTaskType, char UseAwayFork, int NowDevice) + void AlterRoutePath(int Mankind, long FID, int ControlTaskType, char UseAwayFork, int NowDevice) { DataView dv = new DataView(); DataView dv1 = new DataView(); DataView dvnew = new DataView(); @@ -4004,7 +4005,7 @@ namespace WcfControlMonitorLib //双叉不能同步的反馈距离当前堆垛机位置最短的taskno int manKind = Model.CGeneralFunction.GetManageTaskKindIndexFromMonitor(taskno); - int manFid = Model.CGeneralFunction.GetManageTaskIndexfromMonitor(taskno); + long manFid = Model.CGeneralFunction.GetManageTaskIndexfromMonitor(taskno); int deviceindex = Model.CGeneralFunction.GetDeviceIndexFromMonitor(taskno); int devKind = Model.CGeneralFunction.GetDeviceKindIdx(deviceindex); int devOrder = Model.CGeneralFunction.GetDeviceOrderFromMonitor(taskno); @@ -4037,7 +4038,7 @@ namespace WcfControlMonitorLib #region 关联指令不是第一个指令不能发送 int rmankind = Model.CGeneralFunction.GetManageTaskKindIndexFromMonitor(cortask); - int rman = Model.CGeneralFunction.GetManageTaskIndexfromMonitor(cortask); + long rman = Model.CGeneralFunction.GetManageTaskIndexfromMonitor(cortask); sql.Remove(0, sql.Length); sql.Append("SELECT MIN(F_MonitorIndex) AS mmi FROM dbo.T_Monitor_Task WHERE (F_ManageTaskIndex = ").Append(rman).Append(") AND (F_ManageTASKKINDINDEX = ").Append(rmankind).Append(")"); dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; @@ -4107,7 +4108,7 @@ namespace WcfControlMonitorLib #region 关联指令不是第一个指令不能发送 int rmankind = Model.CGeneralFunction.GetManageTaskKindIndexFromMonitor(cortask); - int rman = Model.CGeneralFunction.GetManageTaskIndexfromMonitor(cortask); + long rman = Model.CGeneralFunction.GetManageTaskIndexfromMonitor(cortask); sql.Remove(0, sql.Length); sql.Append("SELECT MIN(F_MonitorIndex) AS mmi FROM dbo.T_Monitor_Task WHERE (F_ManageTaskIndex = ").Append(rman).Append(") AND (F_ManageTASKKINDINDEX = ").Append(rmankind).Append(")"); dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; @@ -4188,7 +4189,7 @@ namespace WcfControlMonitorLib char[] cc = new char[1] { '-' }; string[] endCell = ChangeStackCell.Split(cc); - int fid = ccf.GetManageTaskIndexfromMonitor(taskindex); + long fid = ccf.GetManageTaskIndexfromMonitor(taskindex); int Mankind = ccf.GetManageTaskKindIndexFromMonitor(taskindex); //dbo.TransBegin(); try @@ -4223,7 +4224,7 @@ namespace WcfControlMonitorLib int GetIOControlStatus(int TaskIndex) { int mankind = ccf.GetManageTaskKindIndexFromMonitor(TaskIndex); - int Fid = ccf.GetManageTaskIndexfromMonitor(TaskIndex); + long Fid = ccf.GetManageTaskIndexfromMonitor(TaskIndex); if (mankind == 1) { sql.Remove(0, sql.Length); @@ -5528,7 +5529,7 @@ namespace WcfControlMonitorLib DataView dvlanestack; StringBuilder mysql = new StringBuilder(); Model.MDevice deviceinfo = null; - int managernum = 0; + long managernum = 0; DBOperator dbo = CStaticClass.dbo; int goallane = 0; int x1 = 0; @@ -6197,7 +6198,7 @@ namespace WcfControlMonitorLib StringBuilder mysql = new StringBuilder(); Model.MDevice deviceinfo = null; - int managernum = 0; + long managernum = 0; AheadDetectUnallow.Clear(); int uselifer = 0;//民航二所 sql.Remove(0, sql.Length); diff --git a/WcfControlMonitorLib/CDisassembleTask - 鍓湰.cs b/WcfControlMonitorLib/CDisassembleTask - 鍓湰.cs new file mode 100644 index 0000000..ba02def --- /dev/null +++ b/WcfControlMonitorLib/CDisassembleTask - 鍓湰.cs @@ -0,0 +1,7259 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Data; +using DBFactory; +using CommonClassLib; +using Microsoft.VisualBasic; +using System.Threading; +using CommonLib; +namespace WcfControlMonitorLib +{ + /// + /// Creator:Richard.liu + /// 任务拆分类 + /// 选取调度任务时以保障设备利用率最大化为原则:1、每个路径端头的入库站台要有一个任务; + /// 2、每个堆垛机要有一个任务(以优先方式决定先执行哪种任务); + /// 3、组合优先方式时,在调度任务完成时调整已拆分任务优先级为最高级9,进行优先执行。 + /// + /// 把调度任务分解成多个监控搬运任务 + /// 分解原则:把一个调度任务按照出入库路径的设备索引排出多个步骤的设备指令 + /// + + + //20091107增加对五个调度策略SelectTask_ManPRI();SelectTask_OnlyIn();SelectTask_InSubjoinOut(); + //SelectTask_OnlyOut();SelectTask_OutSubjoinIn();的优先级相同时根据下达时间的升序执行order by FTASKLEVEL desc,FBEGTIME asc + + public static class CDisassembleTask + { + public static event CDataSourceChangeEventHandler DataChange; + public static void OnDataChange(object sender, CDataChangeEventArgs e) + { + if (DataChange != null) + { + DataChange(sender, e); + } + } + public static event RefreshMonitorEventHandler RefreshMonitor; + public static void OnRefreshMonitor(RefreshMonitorEventArgs e) + { + if (RefreshMonitor != null) + { + RefreshMonitor(e); + } + } + static string stackUcode = "35000,35001,35002,35003,45001"; + static StringBuilder sql = new StringBuilder(); + static Thread mythread; + static bool exitThread = false;//20091107 + private static void BeginListen() + {//20091107 + while (!exitThread ) + { + try + { + MyTaskIntoSteps(); + + } + catch (Exception ex) + { + DisassembleTaskError =ex.StackTrace+ ex.Message; + } + } + } + public static void EndListen() + {//20091107 + exitThread = true; + + if (mythread != null) + { + + dbo.Close(); + + mythread.Abort(); + mythread = null; + } + } + public static void StartListen() + { + exitThread = false; + mythread = new Thread(new ThreadStart(BeginListen)); + mythread.IsBackground = true; + mythread.Start(); + } + static string _DisassembleTaskError=""; + public static string DisassembleTaskError + { + get { return _DisassembleTaskError; } + set { _DisassembleTaskError = value; + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", DisassembleTaskError); + OnRefreshMonitor(rme); + } + } + static DBOperator dbo =new DBOperator();//20130926 + static DBOperator dboM = CStaticClass.dboM; //20130510 + static CCommonFunction ccf = new CCommonFunction(); + + static Model.MDevice devinfo; + + /// + /// 拆分调度任务,不包括手工任务(直接生成存入调度T_Monitor_Task表) + /// + public static void MyTaskIntoSteps() + { + try + { + int Pri = ccf.SelectTaskPriPrecept(); + switch (Pri) + { + case 0://按照调度任务优先级 + SelectTask_ManPRI(); + break; + case 1://单纯入库优先 + SelectTask_OnlyIn(); + break; + case 12://入库优先携带附带运行条件的出库任务 + SelectTask_InSubjoinOut(); + break; + case 2://单纯出库优先 + SelectTask_OnlyOut(); + break; + case 21://出库优先携带附带运行条件的入库任务 + SelectTask_OutSubjoinIn(); + break; + + default: + break; + } + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.MyTaskIntoSteps时发生错误:" +ex.StackTrace+ ex.Message; + } + } + /// + /// 按照调度任务优先级拆分任务 + /// + static void SelectTask_ManPRI() + { + DataView dvM = new DataView(); + DataView dv = new DataView(); + DataView dv1 = new DataView(); + try + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append("select * from T_Manage_Task where ").Append( + " FIntoStepOK='0' order by FTASKLEVEL desc,F_ManageTaskKindIndex asc,FBEGTIME asc, FID asc "); + + dvM = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + dv = new DataView();//20091107 + dv1 = new DataView();//20091107 + Model.MDevice deviceInfo; + for (int i = 0; i < dvM.Count; i++) + { + + + if (dvM[i]["FCONTROLTASKTYPE"].ToString() == "1") + //如果是入库任务:判断起点设备是否有调度命令在执行或者被锁定 + { + //sql = "SELECT F_ManageTASKKINDINDEX, F_DeviceIndex, F_Status FROM T_Monitor_Task" + + // " where F_ManageTASKKINDINDEX=" + dvM[i]["F_ManageTASKKINDINDEX"] + " and F_DeviceIndex=" + dvM[i]["FSTARTDEVICE"] + " and F_Status>=1"; + //dv = dbo.ExceSQL(sql).Tables[0].DefaultView; + //if (dv.Count > 0) + //{ + // continue; + //} + //被锁定 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_DeviceIndex, F_LockedState FROM T_Base_Device where F_DeviceIndex=").Append(dvM[i]["FSTARTDEVICE"]).Append(" and F_LockedState>0"); + + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;//20091107 + if (dv1.Count > 0) + { + continue; + } + } + + if (dvM[i]["FCONTROLTASKTYPE"].ToString() == "2") + //如果是出库任务:判断堆垛机是否有调度命令在执行或者被锁定 + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_ManageTASKKINDINDEX, F_DeviceIndex, F_Status FROM T_Monitor_Task").Append( + " where F_ManageTASKKINDINDEX=").Append(dvM[i]["F_ManageTASKKINDINDEX"]).Append( + " and F_DeviceIndex=").Append(dvM[i]["FSTACK"]).Append(" and F_Status>0 "); + + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + continue; + } + //被锁定20091009 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_DeviceIndex, F_LockedState FROM T_Base_Device where F_DeviceIndex=").Append(dvM[i]["FSTACK"]).Append(" and (F_LockedState>0 or F_ManTaskReserve>0)"); + + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;//20091107 + if (dv1.Count > 0) + { + continue; + } + //20091128 + //判断将要被拆分的出库任务是否在已拆分的队列中有终点相同的出库任务,没有就找一个拆分 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FENDDEVICE=").Append(dvM[i]["FENDDEVICE"]).Append(") and (FSTACK = ").Append( + dvM[i]["FSTACK"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc,FBEGTIME asc"); + + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + continue; + } + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dvM[i]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + GetOutDoubleForkTask(dvM[i]); + } + } + } + //选择最短调度路径并且判断此路径上是否有设备发生故障 + int routeid = MinRouteID(Convert.ToInt32(dvM[i]["FSTARTDEVICE"]), Convert.ToInt32(dvM[i]["FENDDEVICE"]), dvM[i]["FUseAwayFork"]); + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dvM[i]); + } + continue; + } + + + if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1' where FID=").Append(dvM[i]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dvM[i]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + //20100323 + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dvM[i]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + CreateRelativeMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"])); + } + } + } + + } + + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.SelectTask_ManPRI时发生错误:" +ex.StackTrace+ ex.Message; + } + finally + { + dvM.Dispose() ; + dv.Dispose(); + dv1.Dispose(); + } + } + /// + /// 单纯拆分入库任务,没有入库任务时再拆分出库任务 + /// + static void SelectTask_OnlyIn() + { + DataView dvM = new DataView(); DataView dv = new DataView(); DataView dv1 = new DataView(); + try + { + Model.MDevice deviceInfo; + //20101124 + sql.Remove(0, sql.Length); + sql.Append("select * from T_Manage_Task where ").Append( + " FIntoStepOK='0' order by FCONTROLTASKTYPE asc, F_ManageTaskKindIndex asc,FBEGTIME asc, FID asc "); + + dvM = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + for (int i = 0; i < dvM.Count; i++) + { + + + if (dvM[i]["FCONTROLTASKTYPE"].ToString() == "1") + //如果是入库任务:判断起点设备是否有调度命令在执行或者被锁定 + { + //sql = "SELECT F_ManageTASKKINDINDEX, F_DeviceIndex, F_Status FROM T_Monitor_Task" + + // " where F_ManageTASKKINDINDEX=" + dvM[i]["F_ManageTASKKINDINDEX"] + " and F_DeviceIndex=" + dvM[i]["FSTARTDEVICE"] + " and F_Status>0"; + //dv = dbo.ExceSQL(sql).Tables[0].DefaultView; + //if (dv.Count > 0) + //{ + // continue; + //} + //被锁定 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_DeviceIndex, F_LockedState FROM T_Base_Device where F_DeviceIndex=").Append(dvM[i]["FSTARTDEVICE"]).Append(" and F_LockedState>0"); + + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + continue; + } + } + + if (dvM[i]["FCONTROLTASKTYPE"].ToString() == "2") + //如果是出库任务:判断堆垛机是否有调度命令在执行或者被锁定 + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_ManageTASKKINDINDEX, F_DeviceIndex, F_Status FROM T_Monitor_Task").Append( + " where F_ManageTASKKINDINDEX=").Append(dvM[i]["F_ManageTASKKINDINDEX"]).Append( + " and F_DeviceIndex=").Append(dvM[i]["FSTACK"]).Append(" and F_Status>0"); + + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + continue; + } + //被锁定20091009 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_DeviceIndex, F_LockedState FROM T_Base_Device where F_DeviceIndex=").Append(dvM[i]["FSTACK"]).Append(" and (F_LockedState>0 or F_ManTaskReserve>0)"); + + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + continue; + } + ////20091128 + //判断将要被拆分的出库任务是否在已拆分的队列中有终点相同的出库任务,没有就找一个拆分 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FENDDEVICE=").Append(dvM[i]["FENDDEVICE"]).Append(") and (FSTACK = ").Append( + dvM[i]["FSTACK"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc,FBEGTIME asc"); + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + continue; + } + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dvM[i]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + GetOutDoubleForkTask(dvM[i]); + } + } + } + //选择最短调度路径并且判断此路径上是否有设备发生故障 + int routeid = MinRouteID(Convert.ToInt32(dvM[i]["FSTARTDEVICE"]), Convert.ToInt32(dvM[i]["FENDDEVICE"]), dvM[i]["FUseAwayFork"]); + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dvM[i]); + } + continue; + } + + + if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1' where FID=").Append(dvM[i]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dvM[i]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + //20100323 + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dvM[i]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + CreateRelativeMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"])); + } + } + } + + } + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.SelectTask_OnlyIn时发生错误:" +ex.StackTrace+ ex.Message; + } + finally + { + dv.Dispose(); + dv1.Dispose(); + dvM.Dispose(); + } + } + /// + /// 入库优先附带符合运行条件的出库任务 + /// 具体实现:判断T_Manage_Task表中是否有此堆垛机任务正在执行:如果没有,则挑选一个入库任务; + /// 如果有堆垛机正在执行入库任务,并且队列中没有等待执行的堆垛机出库任务,挑选一个此堆垛机的出库任务优先级设为9; + /// + /// + static void SelectTask_InSubjoinOut() + { + DataView dvM = new DataView(); + DataView dv = new DataView();//20091107 + DataView dv12 = new DataView(); + DataView dvv = new DataView(); + DataView dv0 = new DataView(); + DataView dv1 = new DataView(); + DataView dv00 = new DataView(); + try + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_StackIndex FROM T_Base_StackInfo"); + + dvM = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + Model.MDevice deviceInfo; + int routeid = -1; + for (int i = 0; i < dvM.Count; i++) + { + //首先选择此堆垛机所有入库任务,判断那个能执行 + #region 首先选择此堆垛机所有入库任务,判断那个能执行 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT * FROM T_Manage_Task WHERE (FSTATUS = 0) AND (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 1) AND (FIntoStepOK = '0') order by FTASKLEVEL desc,FBEGTIME asc"); + + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;//20091107 + for (int j = 0; j < dv.Count; j++)//有这个堆垛机的入库任务等待拆分 + { + //选择最短调度路径并且判断此路径上是否有设备发生故障 + routeid = MinRouteID(Convert.ToInt32(dv[j]["FSTARTDEVICE"]), Convert.ToInt32(dv[j]["FENDDEVICE"]), dv[j]["FUseAwayFork"]); + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dv[j]); + } + continue; + } + if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"]), routeid, dv[j], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1' where FID=").Append(dv[j]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dv[j]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + //20100323 + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[j]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + CreateRelativeMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"])); + } + } + } + } + + #endregion + + #region 然后给正在执行的入库堆垛机任务配上一个出库任务 + + + //然后给正在执行的入库堆垛机任务配上一个出库任务 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT T_Monitor_Task.F_MonitorIndex FROM T_Monitor_Task ,T_Manage_Task WHERE ").Append( + " (T_Monitor_Task.F_ManageTaskIndex = T_Manage_Task.FID AND ").Append( + " T_Monitor_Task.F_ManageTASKKINDINDEX = T_Manage_Task.F_ManageTaskKindIndex)").Append( + " And (T_Monitor_Task.F_Status = 1 OR T_Monitor_Task.F_Status = 2) AND F_DeviceCommandIndex=5 and ").Append( + "(T_Monitor_Task.F_DeviceIndex = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (T_Manage_Task.FCONTROLTASKTYPE = 1)"); + + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0)//有这个堆垛机的入库任务在执行 + { + #region 有这个堆垛机的入库任务在执行准备携带出库任务 + //20091013 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append( + ") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc,FBEGTIME asc"); + + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count <= 0)//没有此堆垛机的出库任务在排队 + { + #region 挑选此堆垛机的出库任务 + + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT * FROM T_Manage_Task WHERE (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '0') order by FTASKLEVEL desc,FBEGTIME asc"); + + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0)//挑选此堆垛机的出库任务 + { + + routeid = MinRouteID(Convert.ToInt32(dv[0]["FSTARTDEVICE"]), Convert.ToInt32(dv[0]["FENDDEVICE"]), dv[0]["FUseAwayFork"]); + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dv[0]); + } + continue; + } + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[0]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + GetOutDoubleForkTask(dv[0]); + } + } + if (CreateMonitor(Convert.ToInt32(dv[0]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[0]["FID"]), routeid, dv[0], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + int level = Convert.ToInt32(dv[0]["FTASKLEVEL"]) == 100 ? 100 : 9; + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1',FTASKLEVEL=").Append(level).Append(" where FID=").Append(dv[0]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dv[0]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update dbo.T_Monitor_Task set F_MonitorTaskLevel=9 where F_MonitorTaskLevel<>100 and F_ManageTASKKINDINDEX=").Append( + dv[0]["F_ManageTaskKindIndex"]).Append(" and F_ManageTaskIndex=").Append(dv[0]["FID"]); + dbo.ExceSQL(sql.ToString()); + //20100323 + //20101028增加出库关联 + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + CreateRelativeMonitor(Convert.ToInt32(dv[0]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[0]["FID"])); + } + } + } + } + #endregion + } + else + {//20091014 + //20101124 + sql.Remove(0, sql.Length); + //20130710sql.Append("SELECT * FROM T_Manage_Task WHERE (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append( + // ") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '0') order by FTASKLEVEL desc,FBEGTIME asc"); + sql.Append("SELECT MIN(FID) AS FID,FTASKLEVEL,F_ManageTaskKindIndex, FENDDEVICE, FSTARTDEVICE, FSTACK, FUseAwayFork,FENDUCODE FROM T_Manage_Task WHERE (FSTACK = ") + .Append(dvM[i]["F_StackIndex"]).Append(") AND (FSTATUS = 0) AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '0') GROUP BY F_ManageTaskKindIndex,FENDDEVICE,FTASKLEVEL,FSTARTDEVICE,FSTACK, FUseAwayFork,FENDUCODE ORDER BY FTASKLEVEL DESC"); + + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0)//挑选此堆垛机的出库任务 + { + //20091102 + for (int j = 0; j < dv.Count; j++) + { + if (stackUcode.IndexOf(dvM[i]["F_StackIndex"].ToString()) >= 0) + {//20120309 有此堆垛机的出库任务而且FENDUCODE终点相同在排队就不拆分了 + sql.Remove(0, sql.Length); + sql.Append("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FENDUCODE=").Append(dv[j]["FENDUCODE"]).Append( + ") and (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc"); + + } + else + {//20110110有此堆垛机的出库任务而且终点相同在排队就不拆分了 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FENDDEVICE=").Append(dv[j]["FENDDEVICE"]).Append( + ") and (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc"); + + } + dv12 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv12.Count > 0) + { + continue; + } + + routeid = MinRouteID(Convert.ToInt32(dv[j]["FSTARTDEVICE"]), Convert.ToInt32(dv[j]["FENDDEVICE"]), dv[j]["FUseAwayFork"]); + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dv[j]); + } + continue; + } + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[j]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + GetOutDoubleForkTask(dv[j]); + } + } + if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"]), routeid, dv[j], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + int level = Convert.ToInt32(dv[j]["FTASKLEVEL"]) == 100 ? 100 : 9; + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1',FTASKLEVEL=").Append(level).Append(" where FID=").Append(dv[j]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dv[j]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Monitor_Task set F_MonitorTaskLevel=9 where F_MonitorTaskLevel<>100 and F_ManageTASKKINDINDEX=").Append( + dv[j]["F_ManageTaskKindIndex"]).Append(" and F_ManageTaskIndex=").Append(dv[j]["FID"]); + dbo.ExceSQL(sql.ToString()); + //20100323 + //20101028增加出库关联 + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + CreateRelativeMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"])); + } + } + } + + } + } + else + { + //20091107 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("select * from T_Manage_Task WHERE (FSTACK = ").Append( + dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0)"); + dvv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + for (int aa = 0; aa < dvv.Count; aa++) + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FTASKLEVEL=9 WHERE (FTASKLEVEL<>100) and F_ManageTASKKINDINDEX=").Append( + dvv[aa]["F_ManageTaskKindIndex"]).Append(" and FID=").Append(dvv[aa]["FID"]); + dbo.ExceSQL(sql.ToString()); + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Monitor_Task set F_MonitorTaskLevel=9 where F_MonitorTaskLevel<>100 and F_ManageTASKKINDINDEX=").Append( + dvv[aa]["F_ManageTaskKindIndex"]).Append(" and F_ManageTaskIndex=").Append(dvv[aa]["FID"]); + dbo.ExceSQL(sql.ToString()); + } + } + } + #endregion + } + else//没有此堆垛机任务 + { + #region 没有此堆垛机任务 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT * FROM T_Manage_Task WHERE (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FIntoStepOK = '0') order by FTASKLEVEL desc, FCONTROLTASKTYPE asc,FBEGTIME asc"); + + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + //20091102 + for (int j = 0; j < dv.Count; j++) + //if (dv.Count > 0)//随便挑选一个此堆垛机的任务 + { + if (dv[j]["FCONTROLTASKTYPE"].ToString() == "2") + //如果是出库任务:判断堆垛机是否有调度命令在执行或者被锁定 + { + if (stackUcode.IndexOf(dvM[i]["F_StackIndex"].ToString()) >= 0) + {//20120309 有此堆垛机的出库任务而且FENDUCODE终点相同在排队就不拆分了 + sql.Remove(0, sql.Length); + sql.Append("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FENDUCODE=").Append(dv[j]["FENDUCODE"]).Append( + ") and (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc"); + + } + else + {//20110110有此堆垛机的出库任务而且终点相同在排队就不拆分了 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FENDDEVICE=").Append(dv[j]["FENDDEVICE"]).Append( + ") and (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc"); + + } + dv12 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv12.Count > 0) + { + continue; + } + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_ManageTASKKINDINDEX, F_DeviceIndex, F_Status FROM T_Monitor_Task").Append( + " where F_DeviceIndex=").Append(dv[j]["FSTACK"]).Append(" and F_Status>0 "); + dv0 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;//20091107 + if (dv0.Count > 0) + { + continue; + } + //被锁定20091009 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_DeviceIndex, F_LockedState FROM T_Base_Device where F_DeviceIndex=").Append(dv[j]["FSTACK"]).Append(" and (F_LockedState>0 or F_ManTaskReserve>0)"); + + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;//220091007 + if (dv1.Count > 0) + { + continue; + } + //20101028增加出库关联 + + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[j]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + GetOutDoubleForkTask(dv[j]); + } + } + } + routeid = MinRouteID(Convert.ToInt32(dv[j]["FSTARTDEVICE"]), Convert.ToInt32(dv[j]["FENDDEVICE"]), dv[j]["FUseAwayFork"]); + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dv[j]); + } + continue; + } + if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"]), routeid, dv[j], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1' where FID=").Append(dv[j]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dv[j]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + //20100323 + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[j]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + CreateRelativeMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"])); + } + } + } + } + #endregion + } + #endregion + } + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT * FROM T_Manage_Task WHERE ((FSTACK <= 0) or (FCONTROLTASKTYPE=3)) AND (FIntoStepOK = '0') order by FTASKLEVEL desc, FCONTROLTASKTYPE asc,FBEGTIME asc"); + + dvM = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + for (int i = 0; i < dvM.Count; i++)//挑选没有堆垛机参与的任务 + { + //选择最短调度路径并且判断此路径上是否有设备发生故障 + routeid = MinRouteID(Convert.ToInt32(dvM[i]["FSTARTDEVICE"]), Convert.ToInt32(dvM[i]["FENDDEVICE"]), dvM[i]["FUseAwayFork"]); + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dvM[i]); + } + continue; + } + if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1' where FID=").Append(dvM[i]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dvM[i]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + //20100323 + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dvM[i]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + CreateRelativeMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"])); + } + } + } + } + + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.SelectTask_InSubjoinOut时发生错误:" +ex.StackTrace+ ex.Message; + } + finally + { + //20091107 + dvM.Dispose(); + dv.Dispose(); + dv12.Dispose(); + dvv.Dispose(); + dv0.Dispose(); + dv1.Dispose(); + dv00.Dispose(); + } + } + /// + /// 单纯拆分出库任务,没有出库任务时再拆分入库任务 + /// + static void SelectTask_OnlyOut() + { + DataView dvM = new DataView(); DataView dv = new DataView(); DataView dv1 = new DataView(); + try + { + + + //20101124 + sql.Remove(0, sql.Length); + sql.Append("select * from T_Manage_Task where ").Append( + " FIntoStepOK='0' order by FCONTROLTASKTYPE decs, F_ManageTaskKindIndex asc,FBEGTIME asc, FID asc "); + dvM = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + Model.MDevice deviceInfo; + for (int i = 0; i < dvM.Count; i++) + { + + + if (dvM[i]["FCONTROLTASKTYPE"].ToString() == "1") + //如果是入库任务:判断起点设备是否有调度命令在执行或者被锁定 + { + //sql = "SELECT F_ManageTASKKINDINDEX, F_DeviceIndex, F_Status FROM T_Monitor_Task" + + // " where F_ManageTASKKINDINDEX=" + dvM[i]["F_ManageTASKKINDINDEX"] + " and F_DeviceIndex=" + dvM[i]["FSTARTDEVICE"] + " and F_Status>0"; + //dv = dbo.ExceSQL(sql).Tables[0].DefaultView; + //if (dv.Count > 0) + //{ + // continue; + //} + //被锁定 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_DeviceIndex, F_LockedState FROM T_Base_Device where F_DeviceIndex=").Append(dvM[i]["FSTARTDEVICE"]).Append(" and F_LockedState>0"); + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + continue; + } + } + + if (dvM[i]["FCONTROLTASKTYPE"].ToString() == "2") + //如果是出库任务:判断堆垛机是否有调度命令在执行或者被锁定 + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_ManageTASKKINDINDEX, F_DeviceIndex, F_Status FROM T_Monitor_Task").Append( + " where F_ManageTASKKINDINDEX=").Append(dvM[i]["F_ManageTASKKINDINDEX"] + ).Append(" and F_DeviceIndex=").Append(dvM[i]["FSTACK"]).Append(" and F_Status>0 "); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + continue; + } + //被锁定20091009 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_DeviceIndex, F_LockedState FROM T_Base_Device where F_DeviceIndex=").Append(dvM[i]["FSTACK"]).Append(" and (F_LockedState>0 or F_ManTaskReserve>0)"); + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + continue; + } + //20091128 + //判断将要被拆分的出库任务是否在已拆分的队列中有终点相同的出库任务,没有就找一个拆分 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FENDDEVICE=").Append(dvM[i]["FENDDEVICE"]).Append(") and (FSTACK = ").Append( + dvM[i]["FSTACK"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc,FBEGTIME asc"); + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + continue; + } + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dvM[i]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + GetOutDoubleForkTask(dvM[i]); + } + } + } + //选择最短调度路径并且判断此路径上是否有设备发生故障 + int routeid = MinRouteID(Convert.ToInt32(dvM[i]["FSTARTDEVICE"]), Convert.ToInt32(dvM[i]["FENDDEVICE"]), dvM[i]["FUseAwayFork"]); + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dvM[i]); + } + continue; + } + if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1' where FID=").Append(dvM[i]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dvM[i]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + //20100323 + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dvM[i]["FSTACK"])); + if (deviceInfo.IfCorrelDoubleFork == "1") + { + CreateRelativeMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"])); + } + } + + } + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.SelectTask_OnlyOut时发生错误:" +ex.StackTrace+ ex.Message; + } + finally + { + dv.Dispose(); + dv1.Dispose(); + dvM.Dispose(); + } + } + /// + /// 出库优先附带符合运行条件的入库任务 + /// 具体实现:在收到出库任务的完成时,挑选一个可以执行的入库任务把优先级设成最高9 + /// + static void SelectTask_OutSubjoinIn() + { + DataView dvM = new DataView(); + DataView dv = new DataView(); + DataView dv112 = new DataView(); + DataView dv0 = new DataView(); + DataView dv1 = new DataView(); + try + { + Model.MDevice deviceInfo; + //20101124 + int routeid = -1; + sql.Remove(0, sql.Length); + sql.Append("SELECT * FROM T_Manage_Task WHERE ((FSTACK <= 0) or (FCONTROLTASKTYPE=3) or (FCONTROLTASKTYPE=5) OR (FCONTROLTASKTYPE=6)) AND (FIntoStepOK = '0') order by FTASKLEVEL desc, FCONTROLTASKTYPE asc,FBEGTIME asc"); + dvM = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + for (int i = 0; i < dvM.Count; i++)//挑选没有堆垛机参与的任务 + { + //选择最短调度路径并且判断此路径上是否有设备发生故障 + #region update by lyj20180423 + // routeid = MinRouteID(Convert.ToInt32(dvM[i]["FSTARTDEVICE"]), Convert.ToInt32(dvM[i]["FENDDEVICE"]), dvM[i]["FUseAwayFork"]); + routeid = MinRouteID(Convert.ToInt32(dvM[i]["FSTARTDEVICE"]), Convert.ToInt32(dvM[i]["FENDDEVICE"]), dvM[i]["FUseAwayFork"], dvM[i]["FSTARTCELL"].ToString(), dvM[i]["FENDCELL"].ToString(), Convert.ToInt32(dvM[i]["FCONTROLTASKTYPE"])); + #endregion + + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dvM[i]); + } + continue; + } + if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1' where FID=").Append(dvM[i]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dvM[i]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + + //晟碟 添加以下四行代码,移库优先级置为10,(因任务依次按优先级、拆分时间优先执行) + sql.Remove(0, sql.Length); + sql.Append("update T_Monitor_Task set F_MonitorTaskLevel=10 where F_MonitorTaskLevel<>100 and F_ManageTASKKINDINDEX=").Append( + dvM[i]["F_ManageTaskKindIndex"]).Append(" and F_ManageTaskIndex=").Append(dvM[i]["FID"]); + dbo.ExceSQL(sql.ToString()); + //20100323 + CreateRelativeMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"])); + + + + + + } + } + sql.Remove(0, sql.Length); + sql.Append("SELECT F_StackIndex FROM T_Base_StackInfo"); + dvM = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + for (int i = 0; i < dvM.Count; i++) + {//20090928 + #region 首先选择此堆垛机所有入库任务,判断那个能执行 + + + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT * FROM T_Manage_Task WHERE (FSTATUS = 0) AND (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 1) AND (FIntoStepOK = '0') order by FTASKLEVEL desc,FBEGTIME asc"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + for (int j = 0; j < dv.Count; j++)//有这个堆垛机的入库任务等待拆分 + { + //选择最短调度路径并且判断此路径上是否有设备发生故障 + #region update by lyj20180423 + // routeid = MinRouteID(Convert.ToInt32(dv[j]["FSTARTDEVICE"]), Convert.ToInt32(dv[j]["FENDDEVICE"]), dv[j]["FUseAwayFork"]) + routeid = MinRouteID(Convert.ToInt32(dv[j]["FSTARTDEVICE"]), Convert.ToInt32(dv[j]["FENDDEVICE"]), dv[j]["FUseAwayFork"], dv[j]["FSTARTCELL"].ToString(), dv[j]["FENDCELL"].ToString(), Convert.ToInt32(dv[j]["FCONTROLTASKTYPE"])); + #endregion + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dv[j]); + } + continue; + } + if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"]), routeid, dv[j], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1' where FID=").Append(dv[j]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dv[j]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + //20100323 + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[j]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + CreateRelativeMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"])); + } + } + } + } + + #endregion + //20091005 + #region 然后给正在执行的入库堆垛机任务配上一个出库任务 + + + //然后给正在执行的入库堆垛机任务配上一个出库任务 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT T_Monitor_Task.F_MonitorIndex FROM T_Monitor_Task ,T_Manage_Task WHERE ").Append( + " (T_Monitor_Task.F_ManageTaskIndex = T_Manage_Task.FID AND ").Append( + " T_Monitor_Task.F_ManageTASKKINDINDEX = T_Manage_Task.F_ManageTaskKindIndex)").Append( + " And (T_Monitor_Task.F_Status = 1 OR T_Monitor_Task.F_Status = 2) AND F_DeviceCommandIndex=5 and ").Append( + "(T_Monitor_Task.F_DeviceIndex = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (T_Manage_Task.FCONTROLTASKTYPE = 1)"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0)//有这个堆垛机的入库任务在执行 + { + #region 有这个堆垛机的入库任务在执行 + + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc,FBEGTIME asc"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count <= 0)//没有此堆垛机的出库任务在排队或者执行 + { + #region 挑选此堆垛机的出库任务 + + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT * FROM T_Manage_Task WHERE (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '0') order by FTASKLEVEL desc,FBEGTIME asc"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0)//挑选此堆垛机的出库任务 + { + #region update by lyj20180423 + // routeid = MinRouteID(Convert.ToInt32(dv[0]["FSTARTDEVICE"]), Convert.ToInt32(dv[0]["FENDDEVICE"]), dv[0]["FUseAwayFork"]); + routeid = MinRouteID(Convert.ToInt32(dv[0]["FSTARTDEVICE"]), Convert.ToInt32(dv[0]["FENDDEVICE"]), dv[0]["FUseAwayFork"], dv[0]["FSTARTCELL"].ToString(), dv[0]["FENDCELL"].ToString(), Convert.ToInt32(dv[0]["FCONTROLTASKTYPE"])); + #endregion + + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dv[0]); + } + continue; + } + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[0]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + GetOutDoubleForkTask(dv[0]); + } + } + if (CreateMonitor(Convert.ToInt32(dv[0]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[0]["FID"]), routeid, dv[0], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1' where FID=").Append(dv[0]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dv[0]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update dbo.T_Monitor_Task set F_MonitorTaskLevel=9 where F_MonitorTaskLevel<>100 and F_ManageTASKKINDINDEX=").Append( + dv[0]["F_ManageTaskKindIndex"]).Append(" and F_ManageTaskIndex=").Append(dv[0]["FID"]); + dbo.ExceSQL(sql.ToString()); + //20100323 + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[0]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + CreateRelativeMonitor(Convert.ToInt32(dv[0]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[0]["FID"])); + } + } + } + } + #endregion + } + else + { + //20101124 + sql.Remove(0, sql.Length); + //20130710sql.Append("SELECT * FROM T_Manage_Task WHERE (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append( + // ") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '0') order by FTASKLEVEL desc,FBEGTIME asc"); + sql.Append("SELECT MIN(FID) AS FID,FTASKLEVEL,F_ManageTaskKindIndex, FENDDEVICE, FSTARTDEVICE, FSTACK, FUseAwayFork,FENDUCODE,FStartLayer FROM T_Manage_Task WHERE (FSTACK = ") + .Append(dvM[i]["F_StackIndex"]).Append(") AND (FSTATUS = 0) AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '0') GROUP BY F_ManageTaskKindIndex,FENDDEVICE,FTASKLEVEL,FSTARTDEVICE,FSTACK, FUseAwayFork,FENDUCODEF,StartLayer ORDER BY FTASKLEVEL DESC"); + + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0)//挑选此堆垛机的出库任务 + { + + //20091102 + for (int j = 0; j < dv.Count; j++) + { + + //sql.Append("SELECT F_StackIndex FROM T_Base_StackInfo"); + //dvM = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (stackUcode.IndexOf(dvM[i]["F_StackIndex"].ToString()) >= 0) + {//20120309 有此堆垛机的出库任务而且FENDUCODE终点相同在排队就不拆分了 + sql.Remove(0, sql.Length); + sql.Append("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FENDUCODE=").Append(dv[j]["FENDUCODE"]).Append( + ") and (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc"); + } + else + {//20110110有此堆垛机的出库任务而且终点相同在排队就不拆分了 + //20101124 + sql.Remove(0, sql.Length); + //sql.Append("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FENDDEVICE=").Append(dv[j]["FENDDEVICE"]).Append( + // ") and (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc"); + sql.Append("SELECT * FROM T_Manage_Task WHERE (FENDDEVICE=").Append(dv[j]["FENDDEVICE"]).Append( + ") and (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') order by FTASKLEVEL desc");//晟碟同层出库拆分3条就不拆分 + } + + dv112 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + //晟碟根据终点取得限制的数量 + sql.Clear(); + sql.Append("SELECT * FROM T_Base_TaskCount2 WHERE F_DeviceIndex_End = ").Append(Convert.ToInt32(dv[j]["FENDDEVICE"])).Append(" and F_DeviceIndex_Start =").Append( Convert.ToInt32(dv[j]["FSTARTDEVICE"])); + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + if (dv1[0]["F_StackIndex"].ToString() != dvM[i]["F_StackIndex"].ToString()) + { + continue; + } + //晟碟 + if (dv112.Count >= Convert.ToInt32(dv1[0]["F_MaxCount"])) + { + continue; + } + } + + #region update by lyj20180423 + // routeid = MinRouteID(Convert.ToInt32(dv[j]["FSTARTDEVICE"]), Convert.ToInt32(dv[j]["FENDDEVICE"]), dv[j]["FUseAwayFork"]); + routeid = MinRouteID(Convert.ToInt32(dv[0]["FSTARTDEVICE"]), Convert.ToInt32(dv[0]["FENDDEVICE"]), dv[0]["FUseAwayFork"], dv[0]["FSTARTCELL"].ToString(), dv[0]["FENDCELL"].ToString(), Convert.ToInt32(dv[0]["FCONTROLTASKTYPE"])); + #endregion + + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dv[j]); + } + continue; + } + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[j]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + GetOutDoubleForkTask(dv[j]); + } + } + if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"]), routeid, dv[j], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + int level = Convert.ToInt32(dv[j]["FTASKLEVEL"]) == 100 ? 100 : 9; + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1',FTASKLEVEL=").Append(level).Append(" where FID=").Append(dv[j]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dv[j]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Monitor_Task set F_MonitorTaskLevel=9 where F_MonitorTaskLevel<>100 and F_ManageTASKKINDINDEX=").Append( + dv[j]["F_ManageTaskKindIndex"]).Append(" and F_ManageTaskIndex=").Append(dv[j]["FID"]); + dboM.ExceSQL(sql.ToString()); + + #region 拆分成功后修改IOControl表对应任务的状态 lzm20250311 + sql.Remove(0, sql.Length); + sql.Append("update IO_CONTROL set CONTROL_STATUS=10 where MANAGE_ID=").Append(dv[j]["FID"]); + dbo.ExceSQL(sql.ToString()); + #endregion + //20100323 + //20101028增加出库关联 + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + CreateRelativeMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"])); + } + } + } + + + } + } + else + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append("select * from T_Manage_Task WHERE (FSTACK = ").Append( + dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0)"); + DataView dvv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + for (int aa = 0; aa < dvv.Count; aa++) + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FTASKLEVEL=9 WHERE (FTASKLEVEL<>100) and F_ManageTASKKINDINDEX=").Append( + dvv[aa]["F_ManageTaskKindIndex"]).Append(" and FID=").Append(dvv[aa]["FID"]); + dbo.ExceSQL(sql.ToString()); + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Monitor_Task set F_MonitorTaskLevel=9 where F_MonitorTaskLevel<>100 and F_ManageTASKKINDINDEX=").Append( + dvv[aa]["F_ManageTaskKindIndex"]).Append(" and F_ManageTaskIndex=").Append(dvv[aa]["FID"]); + dbo.ExceSQL(sql.ToString()); + } + } + } + #endregion + } + #endregion + //20091005 + else + { + + //首先选择此堆垛机一个出库任务 + #region 首先选择此堆垛机一个出库任务 + + //判断堆垛机是否有调度命令在执行或者被锁定 + //20130620 + sql.Remove(0, sql.Length); + + sql.Append("SELECT F_ManageTASKKINDINDEX, F_DeviceIndex, F_Status FROM T_Monitor_Task").Append( + " where F_DeviceIndex=").Append(dvM[i]["F_StackIndex"]).Append(" and F_Status>0 "); + dv0 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv0.Count > 0) + { + continue; + } + //被锁定20130620 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_DeviceIndex, F_LockedState FROM T_Base_Device where F_DeviceIndex=").Append(dvM[i]["F_StackIndex"]).Append(" and (F_LockedState>0 or F_ManTaskReserve>0)"); + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + continue; + } + sql.Remove(0, sql.Length); + //20130710sql.Append("SELECT * FROM T_Manage_Task WHERE (FSTATUS = 0) AND (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '0') order by FTASKLEVEL desc,FBEGTIME asc"); + + #region update by lyj20180424 加入控制类型和起始cell + //sql.Append("SELECT MIN(FID) AS FID,FTASKLEVEL,F_ManageTaskKindIndex, FENDDEVICE, FSTARTDEVICE, FSTACK, FUseAwayFork,FENDUCODE FROM T_Manage_Task WHERE (FSTACK = ") + // .Append(dvM[i]["F_StackIndex"]).Append(") AND (FSTATUS = 0) AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '0') GROUP BY F_ManageTaskKindIndex,FENDDEVICE,FTASKLEVEL,FSTARTDEVICE,FSTACK, FUseAwayFork,FENDUCODE ORDER BY FTASKLEVEL DESC"); + + sql.Append("SELECT MIN(FID) AS FID,FTASKLEVEL,F_ManageTaskKindIndex, FENDDEVICE, FSTARTDEVICE, FSTACK, FUseAwayFork,FENDUCODE,FCONTROLTASKTYPE,FSTARTCELL,FENDCELL,FStartLayer FROM T_Manage_Task WHERE (FSTACK = ") + .Append(dvM[i]["F_StackIndex"]).Append(") AND (FSTATUS = 0) AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '0') GROUP BY F_ManageTaskKindIndex,FENDDEVICE,FTASKLEVEL,FSTARTDEVICE,FSTACK, FUseAwayFork,FENDUCODE,FCONTROLTASKTYPE,FSTARTCELL,FENDCELL,FStartLayer ORDER BY FTASKLEVEL DESC, FID asc"); + #endregion + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + for (int j = 0; j < dv.Count; j++) + //有这个堆垛机的出库任务等待拆分 + { + if (stackUcode.IndexOf(dvM[i]["F_StackIndex"].ToString()) >= 0) + {//20120309 有此堆垛机的出库任务而且FENDUCODE终点相同在排队就不拆分了 + sql.Remove(0, sql.Length); + sql.Append("SELECT FID, F_ManageTaskKindIndex, FCONTROLTASKTYPE FROM T_Manage_Task WHERE (FENDUCODE=").Append(dv[j]["FENDUCODE"]).Append( + ") and (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc"); + + } + else + {//20110110有此堆垛机的出库任务而且终点相同在排队就不拆分了 + //20101124 + + + sql.Remove(0, sql.Length); + //sql.Append("SELECT * FROM T_Manage_Task WHERE (FENDDEVICE=").Append(dv[j]["FENDDEVICE"]).Append( + // ") and (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') AND (FStatus = 0) order by FTASKLEVEL desc"); + sql.Append("SELECT * FROM T_Manage_Task WHERE (FENDDEVICE=").Append(dv[j]["FENDDEVICE"]).Append( + ") and (FSTACK = ").Append(dvM[i]["F_StackIndex"]).Append(") AND (FCONTROLTASKTYPE = 2) AND (FIntoStepOK = '1') order by FTASKLEVEL desc");//晟碟同层出库拆分3条就不拆分 + + } + dv112 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + sql.Clear(); + sql.Append("SELECT * FROM T_Base_TaskCount2 WHERE F_DeviceIndex_End = ").Append(Convert.ToInt32(dv[j]["FENDDEVICE"])).Append(" and F_DeviceIndex_Start =").Append(Convert.ToInt32(dv[j]["FSTARTDEVICE"])); + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + + if (dv1[0]["F_StackIndex"].ToString() != dvM[i]["F_StackIndex"].ToString()) { + continue; + } + //lzm + if (dv112.Count >= Convert.ToInt32(dv1[0]["F_MaxCount"])) + { + continue; + } + } + + //选择最短调度路径并且判断此路径上是否有设备发生故障 + #region update by lyj20180423 + // routeid = MinRouteID(Convert.ToInt32(dv[j]["FSTARTDEVICE"]), Convert.ToInt32(dv[j]["FENDDEVICE"]), dv[j]["FUseAwayFork"]); + routeid = MinRouteID(Convert.ToInt32(dv[j]["FSTARTDEVICE"]), Convert.ToInt32(dv[j]["FENDDEVICE"]), dv[j]["FUseAwayFork"], dv[j]["FSTARTCELL"].ToString(), dv[j]["FENDCELL"].ToString(), Convert.ToInt32(dv[j]["FCONTROLTASKTYPE"])); + #endregion + + if (routeid == -1) + { + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(dv[j]); + } + continue; + } + //20101028增加出库关联 + deviceInfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[j]["FSTACK"])); + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + GetOutDoubleForkTask(dv[j]); + } + } + if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"]), routeid, dv[j], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1' where FID=").Append(dv[j]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dv[j]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + //20161219 添加以下四行代码,出库任务优先级默认是9,解决出库任务不执行的问题(因任务依次按优先级、拆分时间优先执行) + sql.Remove(0, sql.Length); + sql.Append("update T_Monitor_Task set F_MonitorTaskLevel=9 where F_MonitorTaskLevel<>100 and F_ManageTASKKINDINDEX=").Append( + dv[j]["F_ManageTaskKindIndex"]).Append(" and F_ManageTaskIndex=").Append(dv[j]["FID"]); + dbo.ExceSQL(sql.ToString()); + //20161219 添加以上四行代码 + //20100323 + //20101028增加出库关联 + if (deviceInfo != null) + { + if (deviceInfo.IfCorrelDoubleFork == "1") + { + CreateRelativeMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"])); + } + } + } + } + + #endregion + } + + + } + //20101124 + + + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.SelectTask_OutSubjoinIn时发生错误:" + ex.StackTrace + ex.Message; + } + finally + { + dv.Dispose(); + dv0.Dispose(); + dv1.Dispose(); + dv112.Dispose(); + dvM.Dispose(); + } + } + /// + /// 根据调度任务的起点和终点设备索引查找路径最短的RouteIDSub + /// + /// 起点设备索引 + /// 终点设备索引 + /// + public static int MinRouteID(int startdevice,int enddevice) + { + DataView dv = new DataView(); DataView dvd = new DataView(); DataView dv1 = new DataView(); DataView dv2 = new DataView(); + List minroute=new List() ; + try + { + int retrouteidsub =GetSameStartDeviceEnddeviceRouteID(startdevice, enddevice); + if (retrouteidsub > 0) + { + return retrouteidsub; + } + //选择最短调度路径并且判断此路径上是否有设备发生故障 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT distinct(T_Base_Route_Device.F_RouteIDSub) FROM T_Base_Device,T_Base_Route_Device,").Append( + "T_Base_Route where T_Base_Route_Device.F_RouteID = T_Base_Route.F_RouteID and ").Append( + " T_Base_Route_Device.F_DeviceIndex = T_Base_Device.F_DeviceIndex and ").Append( + " F_StartDevice=").Append(startdevice).Append(" and F_EndDevice=").Append(enddevice).Append(" and F_Status=1"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + //0,routIDSub;1,路径最小值 + if (dv.Count == 0) + { + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", "起点设备:" + startdevice + "和终点设备:" + enddevice + "之间路径不可用!"); + OnRefreshMonitor(rme); + return -1; + } + for (int i = 0; i < dv.Count; i++) + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_RouteIDSub, F_LockedState,T_Base_Device.F_DeviceIndex FROM T_Base_Device,T_Base_Route_Device WHERE ").Append( + " T_Base_Device.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex and (T_Base_Route_Device.F_RouteIDSub = ").Append( + dv[i]["F_RouteIDSub"]).Append(") AND (T_Base_Device.F_LockedState = - 1 or T_Base_Device.F_ErrorCode>=30)");//20121203 + dvd = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvd.Count > 0) + { + int dvin = Convert.ToInt32(dvd[0]["F_DeviceIndex"]); + if ((dvin >= 35001 && dvin <= 35003) || (dvin == 45001)) + {//20120207机器人地位无法取代,不判断是否被禁用 + + } + else + { + continue; + } + } + + List route = new List();//0,routIDSub;1,步长;2,路径使用频率;3,路径设备任务数 + //路径步长(设备总数)最短(权重0.3),路径使用频率最小(权重0.3)的路径,路径设备任务数(权重0.3) + + route.Add(Convert.ToDouble(dv[i]["F_RouteIDSub"]));//RouteIDSub + //20101124 + sql.Remove(0, sql.Length); + sql.Append("select count(F_DeviceIndex) as steps from T_Base_Route_Device where F_RouteIDSub=" + ).Append(dv[i]["F_RouteIDSub"]); + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + route.Add(Convert.ToDouble(dv1[0]["steps"]));//步长 + //route.Add(0); + } + else + { + continue; + } + //路径使用频率:路径执行调度任务的数量 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT COUNT(DISTINCT F_ManageTaskIndex) AS ManCount FROM T_Monitor_Task GROUP BY F_RouteID HAVING (F_RouteID = ").Append(dv[i]["F_RouteIDSub"]).Append(")"); + dv2 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv2.Count > 0) + { + int a = -1; + if (int.TryParse(dv2[0]["ManCount"].ToString(), out a) == true) + { + route.Add(Convert.ToDouble(dv2[0]["ManCount"]));//路径使用频率 + } + else + { + route.Add(0);//路径使用频率 + } + } + else + { + route.Add(0);//路径使用频率 + } + //路径设备任务数 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT COUNT(T_Monitor_Task.F_MonitorIndex) AS mtask FROM T_Monitor_Task ,T_Base_Route_Device where (T_Monitor_Task.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex) and (T_Base_Route_Device.F_RouteIDSub = ").Append(dv[i]["F_RouteIDSub"]).Append(")"); + dv2 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv2.Count > 0) + { + int a = -1; + if (int.TryParse(dv2[0]["mtask"].ToString(), out a) == true) + { + route.Add(Convert.ToDouble(dv2[0]["mtask"]));//路径设备任务数 + } + else + { + route.Add(0);//路径设备任务数 + } + } + else + { + route.Add(0);//路径设备任务数 + } + + //求最短路径((路径步长*0.3+路径使用频率*0.3+设备占有数*0.3)的最小值) + if (minroute.Count == 0) + { + minroute.Add(route[0]); + minroute.Add(route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3); + } + else + { + if (minroute[1] > (route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3)) + { + minroute[0] = route[0]; + minroute[1] = (route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3); + } + } + } + if (minroute.Count > 0) + { + return Convert.ToInt32(minroute[0]); + } + else + { + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", "起点设备:" + startdevice + "和终点设备:" + enddevice + "之间路径不可用!"); + OnRefreshMonitor(rme); + return -1; + } + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.MinRouteID时发生错误:" +ex.StackTrace+ ex.Message; + return -1; + } + finally + { + dv.Dispose(); + dv1.Dispose(); + dv2.Dispose(); + dvd.Dispose(); + minroute = null; + } + + } + /// + /// 20091005 + /// 根据调度任务的起点和终点设备索引查找路径最短的RouteIDSub + /// + /// 起点设备索引 + /// 终点设备索引 + /// /// 当前设备索引 + /// + public static int MinRouteID(int startdevice, int enddevice,int nowdevice) + { + DataView dv = new DataView(); DataView dvd = new DataView(); + DataView dv1 = new DataView(); DataView dv2 = new DataView(); + List minroute = new List();//0,routIDSub;1,路径最小值 + try + { + int retrouteidsub = GetSameStartDeviceEnddeviceRouteID(startdevice, enddevice); + if (retrouteidsub > 0) + { + return retrouteidsub; + } + //选择最短调度路径并且判断此路径上是否有设备发生故障 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT distinct(T_Base_Route_Device.F_RouteIDSub) FROM T_Base_Device,T_Base_Route_Device,").Append( + "T_Base_Route where T_Base_Route_Device.F_RouteID = T_Base_Route.F_RouteID and ").Append( + " T_Base_Route_Device.F_DeviceIndex = T_Base_Device.F_DeviceIndex and ").Append( + " F_StartDevice=").Append(startdevice).Append(" and F_EndDevice=").Append(enddevice).Append(" and F_Status=1 and T_Base_Device.F_DeviceIndex =").Append(nowdevice); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + if (dv.Count == 0) + { + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", "起点设备:" + startdevice + "和终点设备:" + enddevice + "之间路径不可用!"); + OnRefreshMonitor(rme); + return -1; + } + for (int i = 0; i < dv.Count; i++) + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_RouteIDSub, F_LockedState,T_Base_Device.F_DeviceIndex FROM T_Base_Device,T_Base_Route_Device WHERE ").Append( + " T_Base_Device.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex and (T_Base_Route_Device.F_RouteIDSub = ").Append( + dv[i]["F_RouteIDSub"]).Append(") AND (T_Base_Device.F_LockedState = - 1 or T_Base_Device.F_ErrorCode>=30)");//20121203 + dvd = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvd.Count > 0) + { + int dvin = Convert.ToInt32(dvd[0]["F_DeviceIndex"]); + if ((dvin >= 35001 && dvin <= 35003) || (dvin == 45001)) + {//20120207机器人地位无法取代,不判断是否被禁用 + + } + else + { + continue; + } + } + + List route = new List();//0,routIDSub;1,步长;2,路径使用频率;3,路径设备任务数 + //路径步长(设备总数)最短(权重0.3),路径使用频率最小(权重0.3)的路径,路径设备任务数(权重0.3) + + route.Add(Convert.ToDouble(dv[i]["F_RouteIDSub"]));//RouteIDSub + //20101124 + sql.Remove(0, sql.Length); + sql.Append("select count(F_DeviceIndex) as steps from T_Base_Route_Device where F_RouteIDSub=" + ).Append(dv[i]["F_RouteIDSub"]); + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + route.Add(Convert.ToDouble(dv1[0]["steps"]));//步长 + //route.Add(0); + } + else + { + continue; + } + //路径使用频率:路径执行调度任务的数量 + + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT COUNT(DISTINCT F_ManageTaskIndex) AS ManCount FROM T_Monitor_Task GROUP BY F_RouteID HAVING (F_RouteID = ").Append(dv[i]["F_RouteIDSub"]).Append(")"); + dv2 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv2.Count > 0) + { + double a = 0; + if (double.TryParse(dv2[0]["ManCount"].ToString(), out a) == true) + { + route.Add(Convert.ToDouble(dv2[0]["ManCount"]));//路径使用频率 + } + else + { + route.Add(0);//路径使用频率 + } + } + else + { + route.Add(0);//路径使用频率 + } + //路径设备任务数 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT COUNT(T_Monitor_Task.F_MonitorIndex) AS mtask FROM T_Monitor_Task ,T_Base_Route_Device where (T_Monitor_Task.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex) and (T_Base_Route_Device.F_RouteIDSub = ").Append(dv[i]["F_RouteIDSub"]).Append(")"); + dv2 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv2.Count > 0) + { + double a = 0; + if (double.TryParse(dv2[0]["mtask"].ToString(), out a) == true) + { + route.Add(Convert.ToDouble(dv2[0]["mtask"]));//路径设备任务数 + } + else + { + route.Add(0);//路径设备任务数 + } + } + else + { + route.Add(0);//路径设备任务数 + } + + //求最短路径((路径步长*0.3+路径使用频率*0.3+设备占有数*0.3)的最小值) + if (minroute.Count == 0) + { + minroute.Add(route[0]); + minroute.Add(route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3); + } + else + { + if (minroute[1] > (route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3)) + { + minroute[0] = route[0]; + minroute[1] = (route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3); + } + } + } + if (minroute.Count > 0) + { + return Convert.ToInt32(minroute[0]); + } + else + { + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", "起点设备:" + startdevice + "和终点设备:" + enddevice + "之间路径不可用!"); + OnRefreshMonitor(rme); + return -1; + } + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.MinRouteID时发生错误:" +ex.StackTrace+ ex.Message; + return -1; + } + finally + { + dv.Dispose(); + dv1.Dispose(); + dv2.Dispose(); + dvd.Dispose(); + } + + } + /// + /// 根据调度任务的起点和终点设备索引查找路径最短的RouteIDSub + /// + /// 起点设备索引 + /// 终点设备索引 + /// 不考虑路径状态:true和false都可以 + /// + public static int MinRouteID(int startdevice, int enddevice, bool AllStatus, object useAwayfork) + { + //20101124 + DataView dv = new DataView(); + DataView dv1 = new DataView(); DataView dv2 = new DataView(); + StringBuilder dff =new StringBuilder(); + if (useAwayfork.ToString() == "-") + { + dff .Append( "F_UseAwayFork<>'n'"); + } + else + { + dff .Append( "(F_UseAwayFork='" ).Append( useAwayfork ).Append( "' or F_UseAwayFork='-' )");//20101028 + } + //20101124 + try + { + //选择最短调度路径并且判断此路径上是否有设备发生故障 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT distinct(T_Base_Route_Device.F_RouteIDSub) FROM T_Base_Device,T_Base_Route_Device,").Append( + "T_Base_Route where T_Base_Route_Device.F_RouteID = T_Base_Route.F_RouteID and ").Append( + " T_Base_Route_Device.F_DeviceIndex = T_Base_Device.F_DeviceIndex and ").Append( + " F_StartDevice=").Append(startdevice).Append(" and F_EndDevice=").Append(enddevice).Append(" and ").Append(dff.ToString()); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + List minroute = new List();//0,routIDSub;1,路径最小值 + if (dv.Count == 0) + { + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", "起点设备:" + startdevice + "和终点设备:" + enddevice + "之间路径不可用!"); + OnRefreshMonitor(rme); + return -1; + } + for (int i = 0; i < dv.Count; i++) + { + + + List route = new List();//0,routIDSub;1,步长;2,路径使用频率;3,路径设备任务数 + //路径步长(设备总数)最短(权重0.3),路径使用频率最小(权重0.3)的路径,路径设备任务数(权重0.3) + + route.Add(Convert.ToDouble(dv[i]["F_RouteIDSub"]));//RouteIDSub + //20101124 + sql.Remove(0, sql.Length); + sql.Append("select count(F_DeviceIndex) as steps from T_Base_Route_Device where F_RouteIDSub=" + ).Append(dv[i]["F_RouteIDSub"]); + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + route.Add(Convert.ToDouble(dv1[0]["steps"]));//步长 + //route.Add(0); + } + else + { + continue; + } + //路径使用频率:路径执行调度任务的数量 + + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT COUNT(DISTINCT F_ManageTaskIndex) AS ManCount FROM T_Monitor_Task GROUP BY F_RouteID HAVING (F_RouteID = ").Append(dv[i]["F_RouteIDSub"]).Append(")"); + dv2 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv2.Count > 0) + { + double a = 0; + if (double.TryParse(dv2[0]["ManCount"].ToString(), out a) == true) + { + route.Add(Convert.ToDouble(dv2[0]["ManCount"]));//路径使用频率 + } + else + { + route.Add(0);//路径使用频率 + } + } + else + { + route.Add(0);//路径使用频率 + } + //路径设备任务数 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT COUNT(T_Monitor_Task.F_MonitorIndex) AS mtask FROM T_Monitor_Task ,T_Base_Route_Device where (T_Monitor_Task.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex) and (T_Base_Route_Device.F_RouteIDSub = ").Append(dv[i]["F_RouteIDSub"]).Append(")"); + dv2 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv2.Count > 0) + { + double a = 0; + if (double.TryParse(dv2[0]["mtask"].ToString(), out a) == true) + { + route.Add(Convert.ToDouble(dv2[0]["mtask"]));//路径设备任务数 + } + else + { + route.Add(0);//路径设备任务数 + } + } + else + { + route.Add(0);//路径设备任务数 + } + + //求最短路径((路径步长*0.3+路径使用频率*0.3+设备占有数*0.3)的最小值) + if (minroute.Count == 0) + { + minroute.Add(route[0]); + minroute.Add(route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3); + } + else + { + if (minroute[1] > (route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3)) + { + minroute[0] = route[0]; + minroute[1] = (route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3); + } + } + } + if (minroute.Count > 0) + { + return Convert.ToInt32(minroute[0]); + } + else + { + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", "起点设备:" + startdevice + "和终点设备:" + enddevice + "之间路径不可用!"); + OnRefreshMonitor(rme); + return -1; + } + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.MinRouteID时发生错误:" +ex.StackTrace+ ex.Message; + return -1; + } + finally + { + dv.Dispose(); + dv1.Dispose(); + dv2.Dispose(); + } + + } + /// + /// 20100702 + /// 根据调度任务的起点和终点设备索引查找路径最短的RouteIDSub + /// + /// 起点设备索引 + /// 终点设备索引 + /// 是否使用远货叉 + /// + //public static int MinRouteID(int startdevice, int enddevice, object useAwayfork,string FSTARTCELL,string FENDCELL,int tasktype) + public static int MinRouteID(int startdevice, int enddevice, object useAwayfork) + + { + //20101124 + DataView dv = new DataView(); DataView dvd = new DataView(); + DataView dv1 = new DataView(); DataView dv2 = new DataView(); + StringBuilder dff = new StringBuilder(); + if (useAwayfork.ToString() == "-") + { + dff.Append( "F_UseAwayFork<>'n'"); + } + else + { + dff .Append( "(F_UseAwayFork='" ).Append( useAwayfork).Append( "' or F_UseAwayFork='-' )");//20101028 + } + #region 工位堆垛机的路径优选20120207 + //过桥输送机的选择是临近取货位优先 + //35000双顶升机的选择是小列(1排6列;2排26列)选择顶升机32038 + + //if (startdevice == 35000 && (enddevice == 32025 || enddevice == 10100 || enddevice == 10200 || enddevice == 10300)) + //{ + + // dff.Append(" and T_Base_Route_Device.F_DeviceIndex=32038"); + //} + //else + //{ + + //} + #endregion + //20101124 + try + { + int retrouteidsub = GetSameStartDeviceEnddeviceRouteID(startdevice, enddevice); + if (retrouteidsub > 0) + { + return retrouteidsub; + } + //选择最短调度路径并且判断此路径上是否有设备发生故障 + //20101124 + + //int conveyorindex= conveyorNumFromPosition(FSTARTCELL, FENDCELL, startdevice, enddevice, tasktype); + + sql.Remove(0, sql.Length); + sql.Append("SELECT distinct(T_Base_Route_Device.F_RouteIDSub) FROM T_Base_Device,T_Base_Route_Device,").Append( + "T_Base_Route where T_Base_Route_Device.F_RouteID = T_Base_Route.F_RouteID and ").Append( + " T_Base_Route_Device.F_DeviceIndex = T_Base_Device.F_DeviceIndex and ").Append( + " F_StartDevice=").Append(startdevice).Append(" and F_EndDevice=").Append(enddevice).Append(" and ").Append(dff.ToString()).Append(" and F_Status=1 ");//and T_Base_Route_Device.F_DeviceIndex=12018 + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + List minroute = new List();//0,routIDSub;1,路径最小值 + if (dv.Count == 0) + { + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", "起点设备:" + startdevice + "和终点设备:" + enddevice + "之间路径不可用!"); + OnRefreshMonitor(rme); + return -1; + } + for (int i = 0; i < dv.Count; i++) + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_RouteIDSub,F_LockedState,T_Base_Device.F_DeviceIndex FROM T_Base_Device,T_Base_Route_Device WHERE ").Append( + " T_Base_Device.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex and (T_Base_Route_Device.F_RouteIDSub = ").Append( + dv[i]["F_RouteIDSub"]).Append(") AND (T_Base_Device.F_LockedState = - 1 or T_Base_Device.F_ErrorCode>=30)");//20121203 + dvd = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvd.Count > 0) + { + int dvin = Convert.ToInt32(dvd[0]["F_DeviceIndex"]); + if ((dvin >= 35001 && dvin <= 35003) || (dvin == 45001)) + {//20120207机器人地位无法取代,不判断是否被禁用 + + } + else + { + continue; + } + } + + List route = new List();//0,routIDSub;1,步长;2,路径使用频率;3,路径设备任务数 + //路径步长(设备总数)最短(权重0.3),路径使用频率最小(权重0.3)的路径,路径设备任务数(权重0.3) + + route.Add(Convert.ToDouble(dv[i]["F_RouteIDSub"]));//RouteIDSub + //20101124 + sql.Remove(0, sql.Length); + sql.Append("select count(F_DeviceIndex) as steps from T_Base_Route_Device where F_RouteIDSub=" + ).Append(dv[i]["F_RouteIDSub"]); + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + route.Add(Convert.ToDouble(dv1[0]["steps"]));//步长 + //route.Add(0); + } + else + { + continue; + } + //路径使用频率:路径执行调度任务的数量 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT COUNT(DISTINCT F_ManageTaskIndex) AS ManCount FROM T_Monitor_Task GROUP BY F_RouteID HAVING (F_RouteID = ").Append(dv[i]["F_RouteIDSub"]).Append(")"); + dv2 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv2.Count > 0) + { + double a = 0; + if (double.TryParse(dv2[0]["ManCount"].ToString(), out a) == true) + { + route.Add(a);//路径使用频率 + } + else + { + route.Add(0);//路径使用频率 + } + } + else + { + route.Add(0);//路径使用频率 + } + //路径设备任务数 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT COUNT(T_Monitor_Task.F_MonitorIndex) AS mtask FROM T_Monitor_Task ,T_Base_Route_Device where (T_Monitor_Task.F_deviceindex = T_Base_Route_Device.F_deviceindex) and (T_Monitor_Task.F_RouteID = T_Base_Route_Device.F_RouteIDSub) and (T_Base_Route_Device.F_RouteIDSub = ").Append(dv[i]["F_RouteIDSub"]).Append(")"); + dv2 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv2.Count > 0) + { + double a = 0; + if (double.TryParse(dv2[0]["mtask"].ToString(), out a) == true) + { + route.Add(a);//路径设备任务数 + } + else + { + route.Add(0);//路径设备任务数 + } + } + else + { + route.Add(0);//路径设备任务数 + } + + //求最短路径((路径步长*0.3+路径使用频率*0.3+设备占有数*0.3)的最小值) + if (minroute.Count == 0) + { + minroute.Add(route[0]); + minroute.Add(route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3); + } + else + { + if (minroute[1] > (route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3)) + { + minroute[0] = route[0]; + minroute[1] = (route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3); + } + } + } + if (minroute.Count > 0) + { + return Convert.ToInt32(minroute[0]); + } + else + { + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", "起点设备:" + startdevice + "和终点设备:" + enddevice + "之间路径不可用!"); + OnRefreshMonitor(rme); + return -1; + } + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.MinRouteID时发生错误:" +ex.StackTrace+ ex.Message; + return -1; + } + finally + { + dv.Dispose(); + dv1.Dispose(); + dv2.Dispose(); + dvd.Dispose(); + } + + + } + /// + /// + /// + /// 调度任务类型索引 + /// io_control索引 + /// 调度路径的子路径编号 + /// 调度任务行视图 + /// + public static int CreateMonitor(int Mankind,int ManFID, int routeIDSub,DataRowView drv,int status) + { + //关联设备属于需要同步执行的设备组 + //穿梭车、堆垛机、AGV都属于关键设备需要单独调度, + //所以此类设备是路径分段命令的分割点, + //举例:【成品入库路径】 + //1)输送机输送分段控制 + //2)输送机出库(取关联); + //3)RGV将取+RGV取货(取关联)+RGV将送+RGV送货(送关联); + //4)输送机入库(送关联) + //5)输送机输送分段控制 + //6)堆垛机取送货(将取+取货或者将送+送货); + //7)条码扫描仪 + //12)虚拟关键设备 + DataView dvRoute = new DataView(); DataView dvs = new DataView(); + DataView dvahead = new DataView();//add by lyj 20171026 + int tasktype = 0; + try + { + drv = dbo.ExceSQL(string.Format("SELECT * FROM T_Manage_Task WHERE (FID = {0}) AND (F_ManageTaskKindIndex = {1})", ManFID, Mankind)).Tables[0].DefaultView[0];//20130620 + //20110104 + if (ccf.GetMonitorIndex(ManFID, Mankind) >= 29000) + { + + ccf.UpdateMonitorIndex(1); + } + + + //if (isOrNotAllowDisaemble(drv) == false) //20171106 add by lyj 控制出入库 晟碟注释 + //{ + + // return 0; + //} + + #region add by lyj 20171026 + tasktype = Convert.ToInt32(drv["FCONTROLTASKTYPE"]); + + #endregion + //20121203 + //化成A回库和去倒箔间的包含12068的任务分别不能超过六个 + //化成B出库包含12019的不能超过4个; + //化成B去倒箔间和回库的任务包含12034等待执行的不能超过3个 + //立库到化成B倒箔间任务每个巷道最多两个 + //if (ControlTaskAmountUnDisassemble(drv) == true) return 0; 晟碟注释 + + sql.Remove(0, sql.Length); + sql.Append( "SELECT T_Base_Route_Device.F_DeviceIndex,F_DeviceOrder, T_Base_Route_Device.F_SerialNumber, " ).Append( + "T_Base_Device.F_DeviceKindIndex,F_UnControl FROM " ).Append( + "T_Base_Device,T_Base_Route_Device where " ).Append( + "T_Base_Device.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex and F_RouteIDSub=" ).Append( + routeIDSub + " order by F_SerialNumber asc "); + dvRoute = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvRoute.Count == 0) return 0; + dbo.TransBegin(IsolationLevel.ReadCommitted); + int CurSerialNumber = 0; + List PriorDevice0 = new List(), PriorKeyDevice0 = new List(); + StringBuilder AheadDetect =new StringBuilder();//20101124 + StringBuilder RunningLock = new StringBuilder();//20101124 + StringBuilder AheadTrigger = new StringBuilder();//20101124 + string uncontrol = string.Empty; + for (int i = 0; i < dvRoute.Count; i++) + { + AheadDetect.Remove(0,AheadDetect.Length); + RunningLock.Remove(0,RunningLock.Length); + AheadTrigger.Remove(0,AheadTrigger.Length); + uncontrol= (dvRoute[i]["F_UnControl"] + "").ToString(); + + List PriorDevice = new List(), NextDevice = new List(), + CurDevice = new List(), NextKeyDevice = new List();//0设备所引;1设备类型;2:路径序号;3:设备命令 + + #region 20210326_上海晟碟,关键设备的下一个关键设备 + //List SecondNextKeyDevice = new List(); + #endregion + + //防止输送机设备组重复查找关键设备 + if (Convert.ToInt32(dvRoute[i]["F_SerialNumber"]) <= CurSerialNumber) continue; + + CurDevice.Add(Convert.ToInt32(dvRoute[i]["F_DeviceIndex"])); + CurDevice.Add(Convert.ToInt32(dvRoute[i]["F_DeviceKindIndex"])); + CurDevice.Add(Convert.ToInt32(dvRoute[i]["F_SerialNumber"])); + CurDevice.Add(Convert.ToInt32(dvRoute[i]["F_DeviceOrder"])); + NextKeyDevice = GetNextKeyDevice(routeIDSub, Convert.ToInt32(dvRoute[i]["F_SerialNumber"])); + if (NextKeyDevice.Count > 0)//找到关键设备:0设备所引;1设备类型;2:路径序号;3:设备命令 + { + + CurSerialNumber = NextKeyDevice[2]; + NextDevice = GetNextDevice(routeIDSub, NextKeyDevice[2]); + PriorDevice = GetPriorDevice(routeIDSub, NextKeyDevice[2]); + + #region 20210326_上海晟碟,关键设备的下一个关键设备赋值 + + //for (int j = CurSerialNumber + 1; j < dvRoute.Count; j++) + //{ + // SecondNextKeyDevice = GetNextKeyDevice(routeIDSub, j); + // if (SecondNextKeyDevice.Count > 0) + // break; + + //} + + #endregion + + int TriggerTaskNo = 0; + int[] Coor = new int[6] { 0, 0, 0, 0, 0, 0 }; + //20101118 + string tw = string.Empty; + int mainTask = 0; int Rgvorder = 0; + int lifterUP=0,snextq = 0, snexts = 0; + switch (NextKeyDevice[1]) + { + + case 1: + + #region 堆垛机 + if (NextKeyDevice[3] == -1) continue; + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + #region 3、4楼的巷道的同一U型移库操作//20111020 + if (NextDevice.Count > 0 && PriorDevice.Count > 0) + { + if (Convert.ToInt32(drv["FSTARTUCODE"]) > 0 && Convert.ToInt32(drv["FENDUCODE"]) == Convert.ToInt32(drv["FSTARTUCODE"])) + {//直接插入高端设备U型内部的送出指令 + int arrowdev = Convert.ToInt32(drv["FENDCELL"]); + CurDevice[3] = 6; + CurDevice[0] = Convert.ToInt32(drv["FSTARTCELL"]); + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + //CurDevice的F_SendOutDetect里存的光电开关的设备所引。CurDevice有探物 + tw = GetSendOutDetect(CurDevice[0]); + if (tw != "") + {//20101124 + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0])); + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + + + + #endregion + int udev = Convert.ToInt32(drv["FSTARTUCODE"]); + AheadTrigger.Remove(0, AheadTrigger.Length); + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, udev, CurDevice[3], arrowdev) == false) + { + + #region 生成高端输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind);//任务ID + TriggerTaskNo = mindex; + //20101124 + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + " F_AheadDetect,F_TxtParam,F_UseAwayFork)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(udev).Append(",").Append(CurDevice[3]).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(CurDevice[0]).Append("," + arrowdev + ).Append(",'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("','").Append(drv["FUseAwayFork"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + + + #endregion + } + continue; + } + } + #endregion + #region 生成一个设备命令并且获得取送货坐标 + string Uzxy = string.Empty;//20111020 + StringBuilder GetGDDetect = new StringBuilder(""); + StringBuilder SendGDDetect = new StringBuilder(""); + int SendUdevConveyor = 0; + //堆垛机取货: + if (PriorDevice.Count > 0) + { + + #region 插入高端U型线控制//20111020 + if (Convert.ToInt32(drv["FSTARTUCODE"]) > 0) + {//直接插入高端设备U型内部的送出指令 + int arrowdev = 0; + GetUAreaOutputDevice(NextKeyDevice[0], Convert.ToInt32(drv["FSTARTUCODE"]), out arrowdev, out Uzxy); + if (arrowdev > 0) + { + GetGDDetect.Clear(); + GetGDDetect.Append("D-").Append(arrowdev).Append(".0;D-").Append(arrowdev).Append(".2"); + CurDevice[3] = 6; + CurDevice[0] = Convert.ToInt32(drv["FSTARTCELL"]); + if (arrowdev != CurDevice[0]) + { + int udev = Convert.ToInt32(drv["FSTARTUCODE"]); + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + //CurDevice的F_SendOutDetect里存的光电开关的设备所引。CurDevice有探物 + tw = GetSendOutDetect(CurDevice[0]); + if (tw != "") + {//20101124 + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0])); + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + #endregion + + AheadTrigger.Remove(0, AheadTrigger.Length); + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, udev, CurDevice[3], arrowdev) == false) + { + + #region 生成高端输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex; + //20101124 + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + " F_AheadDetect,F_TxtParam,F_UseAwayFork)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(udev).Append(",").Append(CurDevice[3]).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(CurDevice[0]).Append("," + arrowdev + ).Append(",'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("','").Append(drv["FUseAwayFork"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + + + #endregion + } + } + } + } + #endregion + //如果PriorDevice是输送机则生成输送机命令【CurDevice-->PriorDevice目标设备,出库:2】, + //收到输送机PriorDevice的PLC上报的运行状态则提前触发堆垛机将取命令,然后是取送货命令,获取堆垛机取坐标 + #region 前一设备是输送机 + if (uncontrol != "1") + {//20091107 + if (PriorDevice[1] == 2) + { + int arrowdev; + List newcur = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newcur != null) + { + CurDevice = newcur; + + } + + if (CurDevice[0] == PriorDevice[0]) + {//输送机的起点设备和终点设备相同时,目标设备索引置为零 + arrowdev = 0; + #region 运行提前检测光电组 + + //CurDevice的F_BindingDevice里存的光电开关的设备所引。CurDevice有探物 + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + {//20101118 + //20101124 + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0])); + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + tw = GetBindingDeviceIndexOut(CurDevice[0]); + if (tw != "") + {//20101118 + AheadDetect.Append(";D").Append(tw.ToString());//20101124 + } + + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + #endregion + } + else + { + arrowdev = PriorDevice[0]; + CurDevice[3] = 6; + + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + //CurDevice的F_SendOutDetect里存的光电开关的设备所引。CurDevice有探物 + tw = GetSendOutDetect(CurDevice[0]); + if (tw != "") + {//20101124 + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0])); + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + + //20161221 + //20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + List nextConveyor = GetCurConveyorNextDevice(routeIDSub, CurDevice[2]); + if (nextConveyor.Count > 0)//20110331 + { + AheadDetect.Append(";").Append(GetBeDetectedDevices(nextConveyor[0])); + #region lzm20250225 取消重点输送线校验 + //tw = GetBindingDeviceIndex(nextConveyor[0]); + //if (tw != "") + //{//20101124 + // AheadDetect.Append(";D").Append(tw.ToString()); + //} + //tw = GetBindingDeviceIndexOut(nextConveyor[0]); + //if (tw != "") + //{//20101124 + // AheadDetect.Append(";D").Append(tw.ToString()); + //} + #endregion + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + nextConveyor[0].ToString(); + + } + + + #endregion + } + AheadTrigger.Remove(0, AheadTrigger.Length); + AheadTrigger.Append(PriorDevice[0].ToString()); //+ "-" + (被触发的调度任务号);//此设备的运行状态(货物当前位置=PriorDevice[0])触发堆垛机的将取 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, CurDevice[0], CurDevice[3], 0) == false) + { + #region 运行时锁定设备组 + + #endregion + + #region 生成输送机命令 + + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex; + //20101124 + #region update by lyj20180424 穿梭板入库不生成输送机命令 + //if (NextKeyDevice[0]!=10000) + //{ + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + " F_AheadDetect,F_TxtParam,F_UseAwayFork)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(CurDevice[0]).Append(",").Append(CurDevice[3]).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(CurDevice[0]).Append("," + arrowdev + ).Append(",'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("','").Append(drv["FUseAwayFork"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + //} + //sql.Remove(0, sql.Length); + //sql.Append("INSERT INTO T_Monitor_Task ").Append( + // "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + // " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + // " F_AheadDetect,F_TxtParam,F_UseAwayFork)").Append( + //"VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + // ).Append(",").Append(CurDevice[0]).Append(",").Append(CurDevice[3]).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(CurDevice[0]).Append("," + arrowdev + // ).Append(",'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("','").Append(drv["FUseAwayFork"]).Append("')"); + //dbo.ExceSQL(sql.ToString()); + #endregion + + #endregion + } + + } + } + #endregion + + #region 前一设备是条码扫描器等,不载物的关键设备 + + if ((PriorDevice[1] == 7) || (PriorDevice[1] == 12)) + { + int arrowdev; + List newcur = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newcur != null) + { + CurDevice = newcur; + PriorDevice = PriorDevice0; + //输送机的起点设备和终点设备相同时,目标设备索引置为零 + devinfo = Model.CGetInfo.GetDeviceInfo(CurDevice[0]); + if (devinfo.UnControl != "1") + { + arrowdev = 0; + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + //CurDevice的F_BindingDevice里存的光电开关的设备所引。CurDevice有探物 + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + {//20101124 + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0])); + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + #endregion + AheadTrigger.Remove(0, AheadTrigger.Length);//20101124 + AheadTrigger.Append(PriorDevice[0].ToString()); //+ "-" + (被触发的调度任务号);//此设备的运行状态(货物当前位置=PriorDevice[0])触发堆垛机的将取 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, CurDevice[0], CurDevice[3], 0) == false) + { + #region 运行时锁定设备组 + + #endregion + + #region 生成输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex; + sql.Remove(0, sql.Length);//20101124 + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + " F_AheadDetect,F_TxtParam)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(CurDevice[0]).Append(",").Append(CurDevice[3]).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(CurDevice[0]).Append(",").Append(arrowdev + ).Append(",'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + #endregion + } + } + } + + } + #endregion + + //如果PriorDevice是固定站台不生成命令,堆垛机生成取送货命令,获取堆垛机取坐标 + //如果PriorDevice是巷道,PriorDevice不拆分命令,获取堆垛机取坐标,拆分堆垛机命令取送货 + #region 获得取送货坐标 + + + int[] Coor0_2 = new int[6] { 0, 0, 0, 0, 0, 0 }; + //如果NextDevice是巷道,NextDevice不拆分命令,获取堆垛机送坐标,拆分堆垛机命令取送货 + if ((PriorDevice[1] == 7) || (PriorDevice[1] == 12)) + { + PriorDevice = PriorDevice0; + } + if (PriorDevice[1] == 10) + { + #region 插入高端U型线控制//20111020 + if ((Convert.ToInt32(drv["FSTARTUCODE"]) > 0) && (Uzxy != "-")) + { + char[] cc = new char[1] { '-' }; + string[] sp = Uzxy.Split(cc); + for (int ip = 0; ip < sp.Length; ip++) + { + Coor0_2[ip] = Convert.ToInt32(sp[ip]); + } + } + #endregion + else + Coor0_2 = GetStackCoordinateFromManage(Mankind, ManFID, true); + } + else if (PriorDevice[1] == 2) + { + //如果NextDevice是输送机则取送货命令,获取堆垛机送坐标 + + //如果NextDevice是固定站台则取送货命令,获取堆垛机送坐标 + Coor0_2 = GetStackCoordinateFromLaneGate(NextKeyDevice[0], PriorDevice[0], true); + } + + Coor[0] = Coor0_2[0]; + Coor[1] = Coor0_2[1]; + Coor[2] = Coor0_2[2]; + #endregion + } + + //堆垛机送货: + if (NextDevice.Count > 0) + { + int[] Coor3_5 = new int[6] { 0, 0, 0, 0, 0, 0 }; + //如果NextDevice是巷道,NextDevice不拆分命令,获取堆垛机送坐标,拆分堆垛机命令取送货 + if (NextDevice[1] == 10 || (NextDevice[0] == 14005 || NextDevice[0] == 14006)) //20210201_上海晟碟,如果下一个设备为19004提升机,获取终点货位与巷道方式相同 + { + + if (Convert.ToInt32(drv["FENDUCODE"]) > 0) + { + #region 插入高端U型线控制//20111020 + char[] cc = new char[1] { '-' }; int curdev = 0; + GetUAreaInputDevice(NextKeyDevice[0], Convert.ToInt32(drv["FENDUCODE"]), out curdev, out Uzxy); + if (curdev > 0) + { + SendUdevConveyor = curdev; + SendGDDetect.Clear(); + SendGDDetect.Append("D").Append(curdev).Append(".0;D-").Append(curdev).Append(".2"); + string[] sp = Uzxy.Split(cc); + for (int ip = 0; ip < sp.Length; ip++) + { + Coor3_5[3 + ip] = Convert.ToInt32(sp[ip]); + } + } + #endregion + } + + else + { + Coor3_5 = GetStackCoordinateFromManage(Mankind, ManFID, false); + } + } + else if (NextDevice[1] == 2) + { + //如果NextDevice是输送机则取送货命令,获取堆垛机送坐标 + + //如果NextDevice是固定站台则取送货命令,获取堆垛机送坐标 + Coor3_5 = GetStackCoordinateFromLaneGate(NextKeyDevice[0], NextDevice[0], false); + } + + Coor[3] = Coor3_5[3]; + Coor[4] = Coor3_5[4]; + Coor[5] = Coor3_5[5]; + } + #endregion + + #region 20210125_上海晟碟,穿梭板换层任务拆分 民航二所 + + //检测下一个设备是否为19005(换层提升机),如果是,改变拆分逻辑为: + //1.提升机取货至穿梭板所在层 + //2.穿梭板运动至提升机 + //3.提升机送货至目标层 + //4.穿梭板运动至目标货位 + //因为该提升机是由其他两个提货的提升机共同完成的,提前检测需要添加其他两个提升机空闲和无货 + //19004执行完取货需要加锁,防止其他两个提升机运动 + if (NextDevice[0] == 14005 || NextDevice[0] == 14006) + { + //RunningLock.Remove(0, RunningLock.Length); + //RunningLock.Append("19003;19005"); //锁定两个提升机 + int x_c_p = 0;//民航二所 + if (NextDevice[0] == 14005) + { + + x_c_p = 2; + } + else if (NextDevice[0] == 14006) + { + + x_c_p = 31; + } + #region 穿梭板运动到第2列,1表示穿梭板运动 14006运动到第 31列 + + AheadDetect.Remove(0, AheadDetect.Length); + tw = GetBindingDeviceIndex(NextDevice[0]); + if (tw != string.Empty) + { + AheadDetect.Append("D").Append(tw);//19005提升机无货 + } + AheadTrigger.Remove(0, AheadTrigger.Length); + AheadTrigger.Append(NextKeyDevice[0].ToString()); //上海晟碟穿梭版到第一列触发提升机 + + //AheadDetect.Append(";").Append(GetBeDetectedDevices(NextDevice[0]));//19005提升机空闲 + AheadDetect.Append(";").Append(GetBeDetectedDevices(NextKeyDevice[0]));//穿梭版空闲 + + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], 6, 0) == + false) + { + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex;//上海晟碟穿梭版到第2列触发提升机取车 + + sql.Remove(0, sql.Length);//20101124 + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,") + .Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2,") + .Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_RunningLock,F_TxtParam,F_UseAwayFork,F_PriorMonitor,F_AgvTask,F_AGVNextTask)") + .Append("VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",") + .Append(mindex).Append(",").Append(drv["FTASKLEVEL"]).Append(",") + .Append(NextKeyDevice[0]).Append(",1,").Append(routeIDSub).Append(",") + .Append(status).Append(",2").Append(",").Append(x_c_p) + .Append(",").Append(Coor[2]).Append(",").Append(Coor[3]).Append(",") + .Append(Coor[4]).Append(",").Append(Coor[5]).Append(",'") + .Append(AheadDetect.ToString()).Append("','").Append(RunningLock.ToString()) + .Append("','").Append(drv["FPALLETBARCODE"]).Append("','") + .Append(drv["FUseAwayFork"]).Append("',").Append(lifterUP).Append(",") + .Append(snextq).Append(",").Append(snexts).Append(")"); + dbo.ExceSQL(sql.ToString()); + + + } + + + #endregion + + #region 提升机取车 + + Rgvorder = 4; + + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length); + + #region 20210201_提升机取车提前检测,检测两个提升机是否空闲,检测是否有正在执行的其他换层任务 + + //if (NextDevice[0] == 14005) + //{ + // AheadDetect.Append(GetBeDetectedDevices(14003)).Append(";").Append(GetBeDetectedDevices(14004)); + // AheadDetect.Append(";D14003.0;D14004.0;"); + // AheadDetect.Append(";D14005.0");//14005无货 + // AheadDetect.Append(GetBeDetectedDevices(NextDevice[0])); + + //} + //else if (NextDevice[0] == 14006) + //{ + // AheadDetect.Append(GetBeDetectedDevices(14001)).Append(";").Append(GetBeDetectedDevices(14002)); + // AheadDetect.Append(";D14001.0;D14002.0;"); + // AheadDetect.Append(";D14006.0");//14006无货 + // AheadDetect.Append(GetBeDetectedDevices(NextDevice[0])); + //} + #endregion + + + #endregion + + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], Rgvorder, 0) == false) + { + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + + + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,") + .Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2,") + .Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_TxtParam)") + .Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",") + .Append(mindex).Append(",").Append(drv["FTASKLEVEL"]).Append(",") + .Append(NextDevice[0]).Append(",").Append(Rgvorder) + .Append(",").Append(routeIDSub).Append(",").Append(status).Append(",") + .Append(Coor[2]).Append(",0,0,0").Append(",0,0,'") + .Append(AheadDetect.ToString()).Append("','") + .Append(drv["FPALLETBARCODE"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + //sql.Remove(0, sql.Length); + //sql.Append("update T_Monitor_Task set F_Associate=").Append(mindex).Append(" where F_MonitorIndex=").Append(mainTask); + //dbo.ExceSQL(sql.ToString()); + if (AheadTrigger != null) + { + AheadTrigger.Remove(0, AheadTrigger.Length); + AheadTrigger.Append(NextKeyDevice[0]).Append("-").Append(mindex); + + sql.Clear(); + sql.Append("update T_Monitor_Task set F_AheadTrigger='").Append(AheadTrigger).Append("' where F_MonitorIndex=").Append(TriggerTaskNo); + dbo.ExceSQL(sql.ToString()); + + } + + } + #endregion + + #region 穿梭板运动到提升机,1表示穿梭板运动 民航二所两个提升机 + AheadTrigger.Remove(0, AheadTrigger.Length); + AheadDetect.Remove(0, AheadDetect.Length); + tw = GetBindingDeviceIndex(NextDevice[0]); + if (tw != string.Empty) + { + AheadDetect.Append("D").Append(tw);//19005提升机无货 + } + + AheadDetect.Append(";").Append(GetBeDetectedDevices(NextDevice[0]));//19005提升机空闲 + AheadDetect.Append(";").Append(GetBeDetectedDevices(NextKeyDevice[0]));//穿梭版空闲 + + int x_c = 0;//民航二所 + if (NextDevice[0] == 14005) + { + AheadDetect.Append(";D-14005.1"); //D-14005.1为1表明提升机叉子伸到位 + x_c = 1; + } + else if (NextDevice[0] == 14006) + { + AheadDetect.Append(";D-14006.1"); + x_c = 32; + } + + + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], 6, 0) == + false) + { + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + + sql.Remove(0, sql.Length);//20101124 + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,") + .Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2,") + .Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_RunningLock,F_TxtParam,F_UseAwayFork,F_PriorMonitor,F_AgvTask,F_AGVNextTask)") + .Append("VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",") + .Append(mindex).Append(",").Append(drv["FTASKLEVEL"]).Append(",") + .Append(NextKeyDevice[0]).Append(",1,").Append(routeIDSub).Append(",") + .Append(status).Append(",2").Append(",").Append(x_c) + .Append(",").Append(Coor[2]).Append(",").Append(Coor[3]).Append(",") + .Append(Coor[4]).Append(",").Append(Coor[5]).Append(",'") + .Append(AheadDetect.ToString()).Append("','").Append(RunningLock.ToString()) + .Append("','").Append(drv["FPALLETBARCODE"]).Append("','") + .Append(drv["FUseAwayFork"]).Append("',").Append(lifterUP).Append(",") + .Append(snextq).Append(",").Append(snexts).Append(")"); + dbo.ExceSQL(sql.ToString()); + } + + #endregion + + #region 提升机送车 + Rgvorder = 5; + + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length); + + #region 20210201_提升机取车提前检测,检测两个提升机是否空闲,检测是否有正在执行的其他换层任务 + + AheadDetect.Append(GetBeDetectedDevices(NextDevice[0]));//提升机空闲 + tw = GetBindingDeviceIndex(NextDevice[0]); + if (tw != string.Empty) + { + AheadDetect.Append(";D-").Append(tw);//19005提升机有货 + } + + //AheadDetect.Append(";K19005"); + #endregion + + + #endregion + + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], Rgvorder, 0) == false) + { + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,") + .Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2,") + .Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_TxtParam)") + .Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",") + .Append(mindex).Append(",").Append(drv["FTASKLEVEL"]).Append(",") + .Append(NextDevice[0]).Append(",").Append(Rgvorder) + .Append(",").Append(routeIDSub).Append(",").Append(status).Append(",") + .Append(Coor[5]).Append(",0,0,0,").Append("0,0,'") + .Append(AheadDetect.ToString()).Append("','") + .Append(drv["FPALLETBARCODE"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + //sql.Remove(0, sql.Length); + //sql.Append("update T_Monitor_Task set F_Associate=").Append(mindex).Append(" where F_MonitorIndex=").Append(mainTask); + //dbo.ExceSQL(sql.ToString()); + + } + #endregion + + #region 穿梭板运动 + AheadDetect.Remove(0, AheadDetect.Length); + AheadDetect.Append("D-").Append(NextDevice[0]).Append(".0"); + AheadDetect.Append(";").Append(GetBeDetectedDevices(NextDevice[0])); + AheadDetect.Append(";").Append(GetBeDetectedDevices(NextKeyDevice[0]));//穿梭板空闲 + + int mindex1 = ccf.GetMonitorIndex(ManFID, Mankind); + int x_c_S = 0;//民航二所 + if (NextDevice[0] == 14005) + { + AheadDetect.Append(";D-14005.1"); //D-14005.1为1表明提升机叉子伸到位 + x_c_S = 2; + } + else if (NextDevice[0] == 14006) + { + AheadDetect.Append(";D-14006.1"); + x_c_S = 31; + } + sql.Remove(0, sql.Length);//20101124 + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,") + .Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2,") + .Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_RunningLock,F_TxtParam,F_UseAwayFork,F_PriorMonitor,F_AgvTask,F_AGVNextTask)") + .Append("VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",") + .Append(mindex1).Append(",").Append(drv["FTASKLEVEL"]).Append(",") + .Append(NextKeyDevice[0]).Append(",1,").Append(routeIDSub).Append(",") + .Append(status).Append(",").Append(2).Append(",").Append(x_c_S) + .Append(",").Append(Coor[5]).Append(",").Append(2).Append(",") + .Append(2).Append(",").Append(Coor[5]).Append(",'") + .Append(AheadDetect.ToString()).Append("','").Append(RunningLock.ToString()) + .Append("','").Append(drv["FPALLETBARCODE"]).Append("','") + .Append(drv["FUseAwayFork"]).Append("',").Append(lifterUP).Append(",") + .Append(snextq).Append(",").Append(snexts).Append(")"); + dbo.ExceSQL(sql.ToString()); + #endregion + } + #endregion + + #region 202110330_上海晟碟,充电任务 民航二所 + + else if (tasktype == 6) //如果是充电任务 运行到2列 + { + int mindex1 = ccf.GetMonitorIndex(ManFID, Mankind); + sql.Remove(0, sql.Length);//20101124 + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,") + .Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2,") + .Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_RunningLock,F_TxtParam,F_UseAwayFork,F_PriorMonitor,F_AgvTask,F_AGVNextTask)") + .Append("VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",") + .Append(mindex1).Append(",").Append(drv["FTASKLEVEL"]).Append(",") + .Append(NextKeyDevice[0]).Append(",1,").Append(routeIDSub).Append(",") + .Append(status).Append(",").Append(Coor[3]).Append(",").Append(2) + .Append(",").Append(Coor[5]).Append(",").Append(Coor[3]).Append(",") + .Append(2).Append(",").Append(Coor[5]).Append(",'") + .Append(AheadDetect.ToString()).Append("','").Append(RunningLock.ToString()) + .Append("','").Append(drv["FPALLETBARCODE"]).Append("','") + .Append(drv["FUseAwayFork"]).Append("',").Append(lifterUP).Append(",") + .Append(snextq).Append(",").Append(snexts).Append(")"); + dbo.ExceSQL(sql.ToString()); + } + + #endregion + + else + { + #region 生成堆垛机指令:将取+取货+送货 + + #region 取货 + + //取货 + if (PriorDevice.Count > 0) + { + if (PriorDevice[1] == 10) + { + AheadDetect.Remove(0, AheadDetect.Length); + } + RunningLock.Remove(0, RunningLock.Length);//20101124 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + if (PriorDevice[1] == 10) //晟碟 + { + AheadDetect.Remove(0, AheadDetect.Length); + + + //AheadDetect.Append("M").Append(PriorDevice[0].ToString());//出库及移库 取货都要检测 双升货位 + if (NextDevice.Count > 0) + { + if (NextDevice[1] == 10) + { + //AheadDetect.Append(";").Append("J").Append(PriorDevice[0].ToString());//移库的终点 相当于又要入库 + + } + } + + + } + + if (PriorDevice[1] == 2) + {//取货做提前检测 + #region 运行时锁定设备组 + RunningLock.Append(PriorDevice[0].ToString()); + #endregion + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + //20101011 + string[] cdi = ccf.GetLanewayDeviceInfoFromStackDev(NextKeyDevice[0], PriorDevice[0]); + if (cdi != null) + {//顶升机构被堆垛机取货时检测在顶升高位,有货 + //AheadDetect.Append("D-").Append(cdi[1]).Append(";D-").Append(cdi[3]); + AheadDetect.Append(";D-").Append(cdi[3]); + } + //20101011 + else + { + tw = GetBindingDeviceIndex(PriorDevice[0]); + if (tw != "") + {//20101118 + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(PriorDevice[0])); + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + } + + + + //20090803检测设备是否空闲idle + AheadDetect.Append(";").Append("I").Append(PriorDevice[0].ToString()); + // AheadDetect.Append(";R").Append(PriorDevice[0].ToString());//20140109 + #endregion + + if (NextDevice.Count > 0)//晟碟 + { + if (NextDevice[1] == 10) //站台间移库不加J + { + ////AheadDetect.Append(";J").Append(NextKeyDevice[0].ToString());//双升取货就得检查 + } + } + + } + else + { + AheadDetect.Append(GetGDDetect); + } + } + if (NextDevice.Count > 0) + { + if (NextDevice[1] == 2) + { + + + //20101011 + string[] cdi = ccf.GetLanewayDeviceInfoFromStackDev(NextKeyDevice[0], NextDevice[0]); + if (cdi != null) + {///20120906检测被堆垛机送货的顶升机构在顶升高位,无物,近巷道5和远巷道6也无物 + //AheadDetect.Append(";D-").Append(cdi[1]).Append(";D").Append(cdi[3]); + //if (cdi[5] != "") + //{ + // AheadDetect.Append(";D").Append(cdi[5]); + //} + //if (cdi[6] != "") + //{ + // AheadDetect.Append(";D").Append(cdi[6]); + //} + } + else + { + //tw = GetBindingDeviceIndex(NextDevice[0]); + //if (tw != "") + //{ + // AheadDetect.Append(";D").Append(tw.ToString());//20101124 + //} + //tw = GetBindingDeviceIndexOut(NextDevice[0]); + //if (tw != "") + //{ + // AheadDetect.Append(";D").Append(tw.ToString());//20101118 + //} + } + + tw = GetBindingDeviceIndex(NextDevice[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString()).Append(";");//.Append(GetBeDetectedDevices(NextDevice[0]));//20101124 + } + //20101124检测被堆垛机送货的输送机空闲 + AheadDetect.Append(";").Append("I").Append(NextDevice[0].ToString()).Append(";"); + //.Append("N").Append(NextDevice[0].ToString()); + //20140309AheadDetect.Append(";R").Append(NextDevice[0].ToString()); + ////20120405 + //string r2 = "12002,42002,32002,12010,42010,32010,12018,42018,32018"; + + //if (r2.IndexOf(NextDevice[0].ToString()) >= 0) + //{ + // AheadDetect.Append(";D").Append(Convert.ToInt32(NextDevice[0] - 1).ToString()).Append(".0;N").Append(Convert.ToInt32(NextDevice[0] - 1).ToString()); ; + //} + } + else + { + AheadDetect.Append(";").Append(SendGDDetect); + } + } + AheadDetect.Append(";").Append(GetBeDetectedDevices(NextKeyDevice[0]));//20101124 + AheadDetect.Append(";D").Append(GetBindingDeviceIndex(NextKeyDevice[0])); + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], 4, 0) == + false) + { + lifterUP = ccf.GetMonitorIndex(ManFID, Mankind);//升降机顶升 + snextq = ccf.GetMonitorIndex(ManFID, Mankind); + snexts = ccf.GetMonitorIndex(ManFID, Mankind); + + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + + sql.Remove(0, sql.Length);//20101124 + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2,").Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_RunningLock,F_TxtParam,F_UseAwayFork,F_PriorMonitor,F_AgvTask,F_AGVNextTask)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(NextKeyDevice[0]).Append(",2,").Append(routeIDSub).Append(",").Append(status).Append(",").Append(Coor[0]).Append(",").Append(Coor[1] + ).Append(",").Append(Coor[2]).Append(",").Append(Coor[3]).Append(",").Append(Coor[4]).Append(",").Append(Coor[5]) + .Append(",'").Append(AheadDetect.ToString()).Append("','").Append(RunningLock.ToString()).Append("','").Append(drv["FPALLETBARCODE"]) + .Append("','").Append(drv["FUseAwayFork"]).Append("',").Append(lifterUP).Append(",").Append(snextq).Append(",").Append(snexts).Append(")"); + dbo.ExceSQL(sql.ToString()); + } + + + #endregion + + #region 送货 + RunningLock.Remove(0, RunningLock.Length);//20101124 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + if (NextDevice.Count > 0) + { + if (NextDevice[1] == 2) + { + //送货做提前检测+运行时锁定 + ////20120405 + //string r2 = "12002,42002,32002,12010,42010,32010,12018,42018,32018"; + + #region 运行时锁定设备组 + + //sql.Remove(0, sql.Length);//20101124 + //sql.Append("SELECT F_LaneGateDeviceIndex FROM T_Base_Lane_Gate WHERE (F_LaneGateDeviceIndex =").Append(NextDevice[0]).Append(") AND (F_RunLock = '1')"); + //DataView dvlane = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + ////20101124 + //if (dvlane.Count > 0) + //{ + // RunningLock.Append(NextDevice[0].ToString());//20101124 + // //20120405 + // if (r2.IndexOf(NextDevice[0].ToString()) >= 0) + // { + // RunningLock.Append(NextDevice[0].ToString()).Append(";").Append((NextDevice[0] - 1).ToString()); + // } + //} + //else + //{ + // RunningLock.Remove(0, RunningLock.Length);//20101124 + //} + + #endregion + + #region 运行提前检测光电组 + + AheadDetect.Remove(0, AheadDetect.Length); //20101124 + //20101011 + string[] cdi = + ccf.GetLanewayDeviceInfoFromStackDev(NextKeyDevice[0], NextDevice[0]); + if (cdi != null) + { + //20120906检测被堆垛机送货的顶升机构在顶升高位,无物,近巷道5和远巷道6也无物 + //AheadDetect.Append(";D-").Append(cdi[1]).Append(";D").Append(cdi[3]); + //if (cdi[5] != "") + //{ + // AheadDetect.Append(";D").Append(cdi[5]); + //} + + //if (cdi[6] != "") + //{ + // AheadDetect.Append(";D").Append(cdi[6]); + //} + } + else + { + //AheadDetect.Remove(0, AheadDetect.Length); //20101124 + //tw = GetBindingDeviceIndexOut(NextDevice[0]); + //if (tw != "") + //{ + // AheadDetect.Append(";D").Append(tw.ToString()).Append(";") + // .Append(GetBeDetectedDevices(NextDevice[0])); //20101124 + //} + //else + //{ + // AheadDetect.Remove(0, AheadDetect.Length); + //} + } + + tw = GetBindingDeviceIndex(NextDevice[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString()).Append(";"); + // .Append(GetBeDetectedDevices(NextDevice[0])); + } + ////20090803检测设备是否空闲idle + //AheadDetect.Append(";").Append("I").Append(NextDevice[0].ToString());//20101124 + ////20090918给堆垛机送货的输送机增加是否逻辑有物的判断 + //AheadDetect.Append(";").Append("N").Append(NextDevice[0].ToString());//20101124 + + //20101124检测被堆垛机送货的输送机空闲 + AheadDetect.Append(";").Append("I").Append(NextDevice[0].ToString()); + // .Append(";").Append("N").Append(NextDevice[0].ToString()) + ////20120405 + //if (r2.IndexOf(NextDevice[0].ToString()) >= 0) + //{ + // AheadDetect.Append(";D").Append(Convert.ToInt32(NextDevice[0] - 1).ToString()).Append(".0;N").Append(Convert.ToInt32(NextDevice[0] - 1).ToString()); ; + //} + + #endregion + } + else if (NextDevice[1] == 10)// 晟碟 入库和移库送货都加双升检测 + { + //AheadDetect.Append("J").Append(PriorDevice[0].ToString());// 入库和移库送货都加双升检测 + } + else + { + AheadDetect.Append(";").Append(SendGDDetect); + } + + AheadDetect.Append(";") + .Append(GetBeDetectedDevices(NextKeyDevice[0])); //20101124 + AheadDetect.Append(";D-").Append(GetBindingDeviceIndex(NextKeyDevice[0])); + //送货 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], 5, 0) == + false) + { + + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + //mindex = ccf.GetMonitorIndex(ManFID, Mankind);//20110510 + sql.Remove(0, sql.Length); //20101124 + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,") + .Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2,") + .Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_RunningLock,F_TxtParam,F_UseAwayFork,F_PriorMonitor,F_AGVTask,F_AGVNextTask)") + .Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",") + .Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(NextKeyDevice[0]).Append(",3,").Append(routeIDSub) + .Append(",").Append(status).Append(",").Append(Coor[0]).Append(",") + .Append(Coor[1] + ).Append(",").Append(Coor[2]).Append(",").Append(Coor[3]).Append(",") + .Append(Coor[4]).Append(",") + .Append(Coor[5]).Append(",'").Append(AheadDetect.ToString()) + .Append("','").Append(RunningLock.ToString()).Append("','") + .Append(drv["FPALLETBARCODE"]).Append("','").Append(drv["FUseAwayFork"]) + .Append("',").Append(lifterUP).Append(",").Append(snextq).Append(",") + .Append(snexts).Append(")"); + dbo.ExceSQL(sql.ToString()); + //20101124 + } + } + + #endregion + + #endregion + } + + #region 插入高端U型线控制//20111020 + if (NextDevice.Count > 0 && Convert.ToInt32(drv["FENDUCODE"]) > 0) + {//直接插入高端设备U型内部的送出指令 + int arrowdev = Convert.ToInt32(drv["FENDCELL"]); + CurDevice[3] = 6; + int curdev = 0; int udev = Convert.ToInt32(drv["FENDUCODE"]); + GetUAreaInputDevice(NextKeyDevice[0], Convert.ToInt32(drv["FENDUCODE"]), out curdev, out Uzxy); + if (curdev > 0) + { + CurDevice[0] = curdev; + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + //CurDevice的F_SendOutDetect里存的光电开关的设备所引。CurDevice有探物 + tw = GetSendOutDetect(CurDevice[0]); + if (tw != "") + {//20101124 + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0])); + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + + + + #endregion + + AheadTrigger.Remove(0, AheadTrigger.Length); + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, udev, CurDevice[3], arrowdev) == false) + { + + #region 生成高端输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex; + //20101124 + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + " F_AheadDetect,F_TxtParam,F_UseAwayFork)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(udev).Append(",").Append(CurDevice[3]).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(CurDevice[0]).Append("," + arrowdev + ).Append(",'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("','").Append(drv["FUseAwayFork"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + + + #endregion + } + } + } + #endregion + //修改T_Manage_Task的FLANEWAY,FSTACK + sql.Remove(0, sql.Length);//20101124 + sql.Append("SELECT F_LaneDeviceIndex,F_StackIndex FROM T_Base_LaneInfo where F_StackIndex=").Append(NextKeyDevice[0]); + dvs = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + //20101124 + int laneway = 0; + if (dvs.Count > 0) + { + laneway = Convert.ToInt32(dvs[0]["F_LaneDeviceIndex"]); + + }//20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FLANEWAY=").Append(laneway).Append(",FSTACK=").Append(NextKeyDevice[0]).Append(" where (FLANEWAY=-1) and (FSTACK=-1) and (F_ManageTaskKindIndex=").Append(Mankind).Append(") and FID=").Append(ManFID); + dbo.ExceSQL(sql.ToString()); + //20101124 + break; + + #endregion + case 2://输送机(关键点:例如十字路口(有前一个和后一个设备)或者路径终点(没有后一个设备)) + #region 输送机 + if (NextDevice.Count == 0)//终点输送机 + { + if (uncontrol != "1") + {//20091107 + List newcur = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newcur != null) + { + CurDevice = newcur; + } + int arrowdev; + if (CurDevice[0] == NextKeyDevice[0]) + {//输送机的起点设备和终点设备相同时,目标设备索引置为零 + arrowdev = 0; + + #region 运行提前检测光电组 + if ((CurDevice[3] == 1) || ((CurDevice[3] == 2))) + { + //CurDevice的F_BindingDevice里存的光电开关的设备所引。CurDevice有探物 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + { + AheadDetect .Append( "D-" ).Append( tw.ToString() ).Append( ";" ).Append( GetBeDetectedDevices(CurDevice[0]));//20101124 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + tw = GetBindingDeviceIndexOut(CurDevice[0]); + if (tw != "") + { + AheadDetect .Append( ";D" ).Append( tw.ToString());//20101124 + } + + } + //else if (CurDevice[3] == 2) + //{ + // tw = GetBindingDeviceIndexOut(CurDevice[0]); + // if (tw != "") + // { + // AheadDetect = "D-" + tw.ToString() + ";" + GetBeDetectedDevices(CurDevice[0]);//20101118 + // } + // else + // { + // AheadDetect.Remove(0, AheadDetect.Length); + // } + //} + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + #endregion + } + else + { + arrowdev = NextKeyDevice[0]; + CurDevice[3] = 6; + #region 运行提前检测光电组 + //CurDevice的F_SendOutDetect里存的光电开关的设备所引。CurDevice有探物 + + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + string[] cdi = ccf.GetOwnCorrel_DeviceInfo(CurDevice[0]); + if (null != cdi) + {//20100406检测被堆垛机送货的顶升机构在顶升高位,空闲 + AheadDetect.Append(";D-").Append(cdi[1]).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101118 + } + //20101011 + else + { + tw = GetSendOutDetect(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101124 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + //20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + //20161221 + List nextConveyor = GetCurConveyorNextDevice(routeIDSub, CurDevice[2]); + if (nextConveyor.Count > 0)//20110331 + { + AheadDetect.Append(";").Append(GetBeDetectedDevices(nextConveyor[0])); + + tw = GetBindingDeviceIndex(nextConveyor[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101124 + } + tw = GetBindingDeviceIndexOut(nextConveyor[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101124 + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + nextConveyor[0].ToString(); + } + } + + #endregion + } + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, CurDevice[0], CurDevice[3], 0) == false) + { + #region 运行时锁定设备组 + + #endregion + + #region 生成输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + + sql.Remove(0, sql.Length); + sql .Append( "INSERT INTO T_Monitor_Task " ).Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel," ).Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4," ).Append( + " F_AheadDetect,F_TxtParam)" ).Append( + "VALUES (" ).Append( ManFID ).Append( "," ).Append( Mankind ).Append( "," ).Append( mindex ).Append( "," ).Append( drv["FTASKLEVEL"] + ).Append( "," ).Append( CurDevice[0] ).Append( "," ).Append( CurDevice[3] ).Append( "," ).Append( routeIDSub ).Append( "," ).Append( status ).Append( "," ).Append( CurDevice[0] ).Append( "," ).Append( arrowdev + ).Append( ",'" ).Append( AheadDetect.ToString() ).Append( "','" ).Append( drv["FPALLETBARCODE"] ).Append( "')"); + dbo.ExceSQL(sql.ToString()); + #endregion + } + + } + } + + else//20110104与AGV交互的顶升机或者路径十字路口 + { + int arrowdev; + #region 前一设备是输送机 + + if (PriorDevice[1] == 2) + { + if (uncontrol != "1") + {//20091107 + List newcur = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newcur != null) + { + CurDevice = newcur; + } + + + if (CurDevice[0] == PriorDevice[0]) + {//输送机的起点设备和终点设备相同时,目标设备索引置为零 + arrowdev = 0; + #region 运行提前检测光电组 + //CurDevice的F_BindingDevice里存的光电开关的设备所引。CurDevice有探物 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101124 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + tw = GetBindingDeviceIndexOut(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101124 + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + #endregion + } + else + { + arrowdev = PriorDevice[0]; + CurDevice[3] = 6; + #region 运行提前检测光电组 + //CurDevice的F_SendOutDetect里存的光电开关的设备所引。CurDevice有探物 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + tw = GetSendOutDetect(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101124 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + + List nextConveyor = GetCurConveyorNextDevice(routeIDSub, CurDevice[2]); + if (nextConveyor.Count > 0)//20110331 + { + AheadDetect.Append(";").Append(GetBeDetectedDevices(nextConveyor[0]));//20110331 + + tw = GetBindingDeviceIndex(nextConveyor[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101124 + } + tw = GetBindingDeviceIndexOut(nextConveyor[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101124 + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + nextConveyor[0].ToString(); + } + #endregion + } + AheadTrigger.Remove(0, AheadTrigger.Length); + AheadTrigger.Append(PriorDevice[0].ToString()); //+ "-" + (被触发的调度任务号);//此设备的运行状态(货物当前位置=PriorDevice[0])触发堆垛机的将取 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, CurDevice[0], CurDevice[3], 0) == false) + { + #region 运行时锁定设备组 + RunningLock.Clear();//20120420 + + + #endregion + + #region 生成输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex; + sql.Remove(0, sql.Length);//20101124 + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + " F_AheadDetect,F_TxtParam,F_RunningLock)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(CurDevice[0]).Append(",").Append(CurDevice[3]).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(CurDevice[0]).Append(",").Append(arrowdev + ).Append(",'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("','").Append(RunningLock).Append("')"); + dbo.ExceSQL(sql.ToString()); + #endregion + } + + } + + + } + + #endregion + + #region 顶升机前一输送机PriorDevice[0]空闲,有物:允许顶升机下降 + //arrowdev = 0; + //#region 运行提前检测光电组 + ////CurDevice的F_BindingDevice里存的光电开关的设备所引。CurDevice有探物 + //AheadDetect.Remove(0, AheadDetect.Length);//20101124 + + //tw = GetBindingDeviceIndexOut(PriorDevice[0]); + //if (tw != "") + //{ + // AheadDetect.Append(";D-").Append(tw.ToString());//20101124 + //} + //AheadDetect.Append(";I").Append( PriorDevice[0].ToString()); + //#endregion + //AheadTrigger.Remove(0, AheadTrigger.Length); + + //if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], NextKeyDevice[3], 0) == false) + //{ + // #region 运行时锁定设备组 + + // #endregion + + // #region 生成输送机命令 + // int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + // TriggerTaskNo = mindex; + // sql.Remove(0, sql.Length);//20101124 + // sql.Append("INSERT INTO T_Monitor_Task ").Append( + // "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + // " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + // " F_AheadDetect,F_TxtParam)").Append( + // "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + // ).Append(",").Append(NextKeyDevice[0]).Append(",").Append(NextKeyDevice[3]).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(NextKeyDevice[0]).Append(",").Append(arrowdev + // ).Append(",'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("')"); + // dbo.ExceSQL(sql.ToString()); + // #endregion + //} + #endregion + } + #endregion + break; + case 4: + #region RGV + //RGV取货: + if (PriorDevice.Count > 0) + { + //如果PriorDevice是输送机则生成输送机命令【CurDevice-->PriorDevice目标设备,出库:2】, + //收到输送机PriorDevice的PLC上报的运行状态则提前触发RGV运行命令(7),然后是取送货命令,获取堆垛机取坐标 + #region 前一设备是输送机 + + if (PriorDevice[1] == 2) + { + if ((uncontrol != "1") && (CurDevice[1] == 2)) + {//20091107 + List newcur = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newcur != null) + { + CurDevice = newcur; + } + int arrowdev; + + if (CurDevice[0] == PriorDevice[0]) + {//输送机的起点设备和终点设备相同时,目标设备索引置为零 + arrowdev = 0; + #region 运行提前检测光电组 + //CurDevice的F_BindingDevice里存的光电开关的设备所引。CurDevice有探物 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + { + // AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101124 + AheadDetect.Append("D-").Append(tw.ToString()); + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + tw = GetBindingDeviceIndexOut(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101124 + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + #endregion + } + else + { + arrowdev = PriorDevice[0]; + CurDevice[3] = 6; + #region 运行提前检测光电组 + //CurDevice的F_SendOutDetect里存的光电开关的设备所引。CurDevice有探物 + AheadDetect.Remove(0, AheadDetect.Length);//20101124 + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101124 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + + //List nextConveyor = GetCurConveyorNextDevice(routeIDSub, CurDevice[2]); + //if (nextConveyor.Count > 0)//20110331 + //{ + // AheadDetect.Append(";").Append(GetBeDetectedDevices(nextConveyor[0])); + // tw = GetBindingDeviceIndex(nextConveyor[0]); + // if (tw != "") + // { + // AheadDetect.Append(";D").Append(tw.ToString());//20101124 + // } + // tw = GetBindingDeviceIndexOut(nextConveyor[0]); + // if (tw != "") + // { + // AheadDetect.Append(";D").Append(tw.ToString());//20101124 + // } + // ////20090803检测设备是否空闲idle + // //AheadDetect += ";" + "I" + nextConveyor[0].ToString(); + //} + #endregion + } + AheadTrigger.Remove(0, AheadTrigger.Length); + AheadTrigger.Append(PriorDevice[0].ToString()); //+ "-" + (被触发的调度任务号);//此设备的运行状态(货物当前位置=PriorDevice[0])触发堆垛机的将取 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, CurDevice[0], CurDevice[3], 0) == false) + { + #region 运行时锁定设备组 + + #endregion + + #region 生成输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex; + sql.Remove(0, sql.Length);//20101124 + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + " F_AheadDetect,F_TxtParam)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(CurDevice[0]).Append(",").Append(CurDevice[3]).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(CurDevice[0]).Append(",").Append(arrowdev + ).Append(",'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + #endregion + } + + } + + + + } + else + {//20111020 + List newPrior = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newPrior != null) + { + PriorDevice = newPrior; + } + } + #endregion + + #region 获得RGV运行的接货位的设备索引 + Coor[0] = PriorDevice[0]; + Coor[1] = 0; + Coor[2] = 0; + Coor[3] = 0; + Coor[4] = 0; + Coor[5] = 0; + #endregion + + #region RGV的接货(被关联的任务) + Rgvorder = 4; //GetRGVOrder(PriorDevice[0], true); + + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length); + #region 目标输送机运行提前检测光电组 + if (NextDevice.Count > 0) + { + if (NextDevice[0] == 13003 || NextDevice[0] == 13004)//民航二所出库对接站台 + { + tw = GetBindingDeviceIndex(NextDevice[0]); + // AheadDetect.Append(";D-").Append(tw.ToString()).Append(";"); + } + else + { + //民航二所入库取时候不用判断目标 提升机只用来入库 目标放不下去也得取上来 加快节奏 + //tw = GetBindingDeviceIndex(NextDevice[0]);//目标输送机入口无探物,能运行 + //if (tw != "") + //{ + // AheadDetect.Append(";D").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(NextDevice[0]));//20101124 + //} + //20111215 + tw = GetBindingDeviceIndexOut(NextDevice[0]);//目标输送机出口无探物,能运行 + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101118 + } + //20090803检测设备是否空闲idle + //AheadDetect.Append(";").Append("I").Append(NextDevice[0].ToString());//20101124 + //AheadDetect.Append(";I").Append(NextDevice[0]);//.Append(";L").Append(NextDevice[0]); //20160421 + } + } + #endregion + #region 取货输送机运行提前检测光电组 + if (PriorDevice[0] == 13001 || PriorDevice[0] == 13002)//民航二所入库对接站台 + { + tw = GetBindingDeviceIndex(PriorDevice[0]); + // AheadDetect.Append(";D-").Append(tw.ToString()).Append(";"); + } + else + { + tw = GetBindingDeviceIndex(PriorDevice[0]); + if (tw != "") + { + AheadDetect.Append(";D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(PriorDevice[0])); + } + //else + //{ + // AheadDetect.Remove(0, AheadDetect.Length); + //} + //20090803检测设备是否空闲idle + // AheadDetect.Append(";").Append("I").Append(PriorDevice[0].ToString());//20101124 + } + #endregion + tw = GetBindingDeviceIndex(NextKeyDevice[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(NextKeyDevice[0])); + } + // AheadDetect.Append(";I").Append(NextKeyDevice[0]); + + #endregion + + + + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], Rgvorder, 0) == false) + { + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + sql.Remove(0, sql.Length); + sql .Append( "INSERT INTO T_Monitor_Task " ).Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel," ).Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2," ).Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_TxtParam)" ).Append( + "VALUES (" ).Append( ManFID ).Append( "," ).Append( Mankind ).Append( "," ).Append( mindex ).Append( "," ).Append( drv["FTASKLEVEL"] + ).Append( "," ).Append( NextKeyDevice[0] ).Append( "," ).Append( Rgvorder).Append( "," ).Append( routeIDSub ).Append( "," ).Append( status ).Append( "," ).Append( PriorDevice[0] ).Append( ",0" ).Append( + ",0,0,0,0,'" ).Append( AheadDetect.ToString() ).Append( "','" ).Append( drv["FPALLETBARCODE"] ).Append( "')"); + dbo.ExceSQL(sql.ToString()); + sql.Remove(0, sql.Length); + sql.Append("update T_Monitor_Task set F_Associate=" ).Append( mindex ).Append( " where F_MonitorIndex=" ).Append( mainTask); + dbo.ExceSQL(sql.ToString()); + + } + //20101124 + #endregion + + #region RGV是条码绑定设备需要条码比对 + //int barcodedev = GetBarcodeDeviceFromBindDevice(NextKeyDevice[0]); + //if (barcodedev > 0) + //{ + // #region 生成条码比对命令 + // if (DeviceAndOrderExitInMonitor(Mankind, ManFID, barcodedev, 1, 0) == false) + // { + // int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + // sql.Remove(0, sql.Length); + // sql.Append("INSERT INTO T_Monitor_Task ").Append( + // "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + // " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + // " F_AheadDetect,F_TxtParam)").Append( + // "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + // ).Append(",").Append(barcodedev).Append(",").Append(1).Append(",").Append(ccf.GetRouteIDsub(barcodedev)).Append(",").Append(status).Append(",0,0,'").Append("").Append("','").Append(drv["FPALLETBARCODE"]).Append("')"); + // dbo.ExceSQL(sql.ToString()); + // } + // #endregion + //} + #endregion + } + + //获得RGV运行的送货位的设备索引: + if (NextDevice.Count > 0) + { + Coor[0] = NextDevice[0]; + Coor[1] = 0; + Coor[2] = 0; + Coor[3] = 0; + Coor[4] = 0; + Coor[5] = 0; + + #region RGV的送货 + + Rgvorder =5;// GetRGVOrder(NextDevice[0], false); + + + + #region 运行提前检测光电组 + + + AheadDetect .Remove(0,AheadDetect.Length); + if (NextDevice[0] == 13003 || NextDevice[0] == 13004)//民航二所出库对接站台 + { + tw = GetBindingDeviceIndex(NextDevice[0]); + //AheadDetect.Append(";D-").Append(tw.ToString()).Append(";"); + } + else + { + + tw = GetBindingDeviceIndex(NextDevice[0]);//目标输送机入口无探物,能运行 + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(NextDevice[0]));//20101118 + } + //else + //{ + // AheadDetect.Remove(0, AheadDetect.Length); + //} + //20111215 + //tw = GetBindingDeviceIndexOut(NextDevice[0]);//目标输送机出口无探物,能运行 + //if (tw != "") + //{ + // AheadDetect.Append(";D").Append(tw.ToString());//20101118 + //} + //AheadDetect.Append(";I").Append(NextDevice[0]).Append(";L").Append(NextDevice[0]); //20160421 + } + tw = GetBindingDeviceIndex(NextKeyDevice[0]);//RGV有探物,能运行 + if (tw != "") + { + AheadDetect .Append(";" ).Append( "D-" ).Append( tw.ToString() ).Append( ";" ).Append( GetBeDetectedDevices(NextKeyDevice[0]));//20101118 + } + // AheadDetect.Append(";I").Append(NextKeyDevice[0]); + #endregion + + #region 20210201_上海晟碟,如果是穿梭板取送货提升机,添加K19004,判断是否有19004的换层任务,如果有,先不执行 + + //if (NextKeyDevice[0] == 19003 || NextKeyDevice[0] == 19004) + //{ + // AheadDetect.Append(";K19005"); + //} + + #endregion + + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], Rgvorder, 0) == false) + { + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + sql.Remove(0, sql.Length); + sql .Append( "INSERT INTO T_Monitor_Task " ).Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel," ).Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2," ).Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_TxtParam)" ).Append( + "VALUES (" ).Append( ManFID ).Append( "," ).Append( Mankind ).Append( "," ).Append( mindex ).Append( "," ).Append( drv["FTASKLEVEL"] + ).Append( "," ).Append( NextKeyDevice[0] ).Append( "," ).Append( Rgvorder ).Append( "," ).Append( routeIDSub ).Append( "," ).Append( status ).Append( "," ).Append( NextDevice[0] ).Append( ",0" ).Append( + ",0,0,0,0,'" ).Append( AheadDetect.ToString() ).Append( "','" ).Append( drv["FPALLETBARCODE"] ).Append( "')"); + dbo.ExceSQL(sql.ToString()); + mainTask = mindex; + } + + #endregion + + } + + break; + + + + #endregion + case 6: + #region AGV + + #region 生成一个设备命令并且获得取送货坐标 + //AGV取货: + if (PriorDevice.Count > 0) + { + #region 前一设备是输送机 + AheadDetect.Remove(0, AheadDetect.Length); + if (PriorDevice[1] == 2) + { + if (uncontrol != "1") + {//20091107 + bool IfConveyor = false; + if (PriorKeyDevice0.Count > 0) + { + if (PriorKeyDevice0[1] != 2)//20110104前一关键设备不是类输送机 + { + IfConveyor = false; + } + else + { + IfConveyor = true; + } + } + else + { + IfConveyor = false; + } + if (IfConveyor == false)//20110104前一关键设备不是类输送机 + { + List newcur = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newcur != null) + { + CurDevice = newcur; + } + int arrowdev; + if (CurDevice[0] == PriorDevice[0]) + {//输送机的起点设备和终点设备相同时,目标设备索引置为零 + arrowdev = 0; + #region 运行提前检测光电组 + //CurDevice的F_BindingDevice里存的光电开关的设备所引。CurDevice有探物 + #region 威派格注释 + //tw = GetBindingDeviceIndex(CurDevice[0]); + //if (tw != "") + //{ + // AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101118 + + + //} + //else + //{ + // AheadDetect.Remove(0, AheadDetect.Length); + //} + #endregion + tw = GetSendOutDetect(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101118 + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + if (CStaticClass.AGVAllowSingleFork == "0")//20100710 + { + #region 隔壁输送机空闲无物 + //奇数加一;偶数减一 + if ((CurDevice[0] % 2) == 0) + { + AheadDetect.Append(";D").Append(GetBindingDeviceIndexOut(CurDevice[0] - 1).ToString());//20101118 + } + else + { + AheadDetect.Append(";D").Append(GetBindingDeviceIndexOut(CurDevice[0] + 1).ToString());//20101118 + } + #endregion + } + #endregion + } + else + { + arrowdev = PriorDevice[0]; + CurDevice[3] = 6; + #region 运行提前检测光电组 + //CurDevice的F_SendOutDetect里存的光电开关的设备所引。CurDevice有探物 + tw = GetSendOutDetect(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101118 + + + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + + List nextConveyor = GetCurConveyorNextDevice(routeIDSub, CurDevice[2]); + if (nextConveyor.Count > 0)//20110331 + { + AheadDetect.Append(";").Append(GetBeDetectedDevices(nextConveyor[0])); + tw = GetBindingDeviceIndex(nextConveyor[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101118 + } + tw = GetBindingDeviceIndexOut(nextConveyor[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101118 + } + + AheadDetect.Append(";").Append("N").Append(nextConveyor[0].ToString()); + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + nextConveyor[0].ToString(); + } + + #region 22034\22035 + if (arrowdev == 22036)//20101203 + { + AheadDetect.Append(";D").Append("22036.0"); + } + if (arrowdev == 22037)//20101203 + { + AheadDetect.Append(";D").Append("22037.0"); + } + #endregion + #endregion + } + + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, CurDevice[0], CurDevice[3], 0) == false) + { + #region 运行时锁定设备组 + + #endregion + + #region 生成输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex; + sql.Remove(0, sql.Length); + sql.Append( "INSERT INTO T_Monitor_Task " ).Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel," ).Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4," ).Append( + " F_AheadDetect,F_TxtParam)" ).Append( + "VALUES (" ).Append( ManFID ).Append( "," ).Append( Mankind ).Append( "," ).Append( mindex ).Append( "," ).Append( drv["FTASKLEVEL"] + ).Append( "," ).Append( CurDevice[0] ).Append( "," ).Append( CurDevice[3] ).Append( "," ).Append( routeIDSub ).Append( "," ).Append( status ).Append( "," ).Append( CurDevice[0] ).Append( "," ).Append( arrowdev + ).Append( ",'" ).Append( AheadDetect.ToString() ).Append( "','" ).Append( drv["FPALLETBARCODE"] ).Append( "')"); + dbo.ExceSQL(sql.ToString()); + #endregion + } + #region 顶升机下降20110210 + //AheadDetect.Remove(0, AheadDetect.Length); + //AheadDetect.Append("I").Append(Convert.ToString(arrowdev-2)).Append(";I").Append(Convert.ToString(arrowdev)); + //tw = ccf.GetBindingDeviceIndexOut(arrowdev - 2); + //if (tw != "") + //{ + // AheadDetect .Append( ";D-" ).Append( tw.ToString()); + //} + //AheadDetect.Append(";D").Append(arrowdev.ToString()).Append(".2");//20110331 + //if (DeviceAndOrderExitInMonitor(Mankind, ManFID, arrowdev, 8, 0) == false) + //{ + // #region 运行时锁定设备组 + + // #endregion + + // #region 生成输送机命令 + // int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + + // sql.Remove(0, sql.Length); + // sql.Append( "INSERT INTO T_Monitor_Task " ).Append( + // "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel," ).Append( + // " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4," ).Append( + // " F_AheadDetect,F_TxtParam)" ).Append( + // "VALUES (" ).Append( ManFID ).Append( "," ).Append( Mankind ).Append( "," ).Append( mindex ).Append( "," ).Append( drv["FTASKLEVEL"] + // ).Append( "," ).Append( arrowdev ).Append( "," ).Append( 8 ).Append( "," ).Append( routeIDSub ).Append( "," ).Append( status + // ).Append( "," ).Append( arrowdev ).Append( "," ).Append( 0 + // ).Append( ",'" ).Append( AheadDetect.ToString() ).Append( "','" ).Append( drv["FPALLETBARCODE"] ).Append( "')"); + // dbo.ExceSQL(sql.ToString()); + // #endregion + //} + #endregion + } + } + } + + #endregion + + int[] Coor0_2 = new int[6] { 0, 0, 0, 0, 0, 0 }; + //如果PriorDevice是AGV通道,PriorDevice不拆分命令,获取送坐标,拆分AGV命令取、送货 + if (PriorDevice[1] == 11) + { + Coor0_2 =GetAGVAddressFromManage (Mankind, ManFID, true); + } + else + { + //如果NextDevice是输送机则取送货命令,获取送坐标 + + //如果NextDevice是固定站台则取送货命令,获取送坐标 + Coor0_2[1] =PriorDevice[0]; + } + Coor[0] = Coor0_2[0]; + Coor[1] = Coor0_2[1];//站台设备索引 + Coor[2] = Coor0_2[2]; + } + if (NextDevice.Count > 0) + { + int[] Coor3_5 = new int[6] { 0, 0, 0, 0, 0, 0 }; + //如果NextDevice是AGV通道,NextDevice不拆分命令,获取送坐标,拆分AGV命令取、送货 + if (NextDevice[1] == 11) + { + Coor3_5 = GetAGVAddressFromManage(Mankind, ManFID, false); + } + else + { + //如果NextDevice是输送机则取送货命令,获取送坐标 + + //如果NextDevice是固定站台则取送货命令,获取送坐标 + Coor3_5[4] =NextDevice[0]; + } + Coor[3] = Coor3_5[3]; + Coor[4] = Coor3_5[4];//站台设备索引 + Coor[5] = Coor3_5[5]; + } + #endregion + + #region 生成AGV指令:取送货//20110104 + //转换调度任务类型和AGV任务类型 + int agvorder = 0; + int station; + #region AGV取货 + if (PriorDevice.Count > 0) + { + agvorder = 2;//AGV取货 + RunningLock.Remove(0, RunningLock.Length) ; + AheadDetect.Remove(0, AheadDetect.Length); + + station = Coor[1]; + ; + if (CStaticClass.GetDeviceKindIdx(station) == 2) + {//20100714 + #region 运行时锁定设备组 + RunningLock.Append(station.ToString()); + //取货时锁定隔壁输送机 + if (CStaticClass.AGVAllowSingleFork == "0") + { + if ((PriorDevice[0] % 2) == 0) + { + RunningLock .Append( ";" ).Append( (PriorDevice[0] - 1).ToString()); + } + else + { + RunningLock.Append( ";" ).Append( (PriorDevice[0] + 1).ToString()); + } + } + #endregion + if (station == 12001) + { + AheadDetect.Append("D-").Append(GetBindingDeviceIndex(station).ToString()).Append(";I").Append(station.ToString()); + } + else + if (station == 12002) + { + AheadDetect.Append("D-12002.0").Append(";I").Append(station.ToString()); + } + else + { + AheadDetect.Append("D-").Append(GetBindingDeviceIndexOut(station).ToString()).Append(";I").Append(station.ToString()); + } + #region 增加检测顶升是否在低位20100710 + //AheadDetect .Append( ";D-" ).Append( PriorDevice[0].ToString() ).Append( ".2"); + #endregion + } + + if (NextDevice.Count > 0) + { + station = Coor[4]; + + + //if (CStaticClass.GetDeviceKindIdx(station) == 2) + // {//20100714 + // if (station == 12002) + // { + // AheadDetect.Append(";D12002.0;D12002.1;D12002.2").Append(";I").Append(station.ToString()).Append(";N").Append(station.ToString()); + // } + // else + // { + // AheadDetect.Append(";D").Append(GetBindingDeviceIndex(station).ToString()).Append(";I").Append(station.ToString()).Append(";N").Append(station.ToString()); + // } + // } + + } + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], agvorder, 0) == false) + {//20091107 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + mindex = ccf.GetMonitorIndex(ManFID, Mankind);//20110104 + mindex = ccf.GetMonitorIndex(ManFID, Mankind);//20110104 + sql.Remove(0, sql.Length); + sql .Append( "INSERT INTO T_Monitor_Task " ).Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel," ).Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2," ).Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_RunningLock,F_TxtParam,F_UseAwayFork)" ).Append( + "VALUES (" ).Append( ManFID ).Append( "," ).Append( Mankind ).Append( "," ).Append( mindex ).Append( "," ).Append( drv["FTASKLEVEL"] + ).Append( "," ).Append( NextKeyDevice[0] ).Append( ",").Append(agvorder).Append("," ).Append( routeIDSub ).Append( "," ).Append( status ).Append( "," ).Append( Coor[0] ).Append( "," ).Append( Coor[1] + ).Append( "," ).Append( Coor[2] ).Append( "," ).Append( Coor[3] ).Append( "," ).Append( Coor[4] ).Append( "," ).Append( Coor[5] ).Append( ",'" ) + .Append( AheadDetect.ToString() ).Append( "','" ).Append( RunningLock.ToString() ).Append( "','" ).Append( drv["FPALLETBARCODE"] ).Append( "','" ).Append( drv["FUseAwayFork"] ).Append( "')"); + dbo.ExceSQL(sql.ToString()); + + } + + + } + #endregion + + #region AGV送货 + if (NextDevice.Count > 0) + { + agvorder = 3;//AGV送货 + RunningLock.Remove(0, RunningLock.Length); + AheadDetect.Remove(0, AheadDetect.Length); + + station = Coor[4]; + + + if (CStaticClass.GetDeviceKindIdx(station) == 2) + {//20100714 + + agvorder = 1;//AGV运动 + + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], agvorder, 0) == false) + { + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + mindex = ccf.GetMonitorIndex(ManFID, Mankind);//20110104 + mindex = ccf.GetMonitorIndex(ManFID, Mankind);//20110104 + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2,").Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_RunningLock,F_TxtParam,F_UseAwayFork)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(NextKeyDevice[0]).Append(",").Append(agvorder).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(Coor[0]).Append(",").Append(Coor[4] + ).Append(",").Append(Coor[2]).Append(",").Append(Coor[3]).Append(",").Append(Coor[4]).Append(",").Append(Coor[5]).Append(",'") + .Append(AheadDetect.ToString()).Append("','").Append(RunningLock.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("','").Append(drv["FUseAwayFork"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + } + if (station == 12001) + { + AheadDetect.Append(";D12001.0;D12001.1").Append(";I").Append(station.ToString()).Append(";N").Append(station.ToString()); + } + else + if (station == 12002) + { + AheadDetect.Append(";D12002.0;D12002.1;D12002.2").Append(";I").Append(station.ToString()).Append(";N").Append(station.ToString()); + } + else + { + AheadDetect.Append(";D").Append(GetBindingDeviceIndex(station).ToString()).Append(";I").Append(station.ToString()).Append(";N").Append(station.ToString()); + } + AheadDetect.Append(";L").Append(station.ToString());//20160421 + RunningLock.Append(station.ToString()); + } + + agvorder = 3;//AGV送货 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], agvorder, 0) == false) + {//20091107 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + mindex = ccf.GetMonitorIndex(ManFID, Mankind);//20110104 + mindex = ccf.GetMonitorIndex(ManFID, Mankind);//20110104 + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2,").Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_RunningLock,F_TxtParam,F_UseAwayFork)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(NextKeyDevice[0]).Append(",").Append(agvorder).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(Coor[0]).Append(",").Append(Coor[1] + ).Append(",").Append(Coor[2]).Append(",").Append(Coor[3]).Append(",").Append(Coor[4]).Append(",").Append(Coor[5]).Append(",'") + .Append(AheadDetect.ToString()).Append("','").Append(RunningLock.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("','").Append(drv["FUseAwayFork"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + + } + + + } + #endregion + #endregion + + #endregion + break; + case 7: + #region 条码扫描仪(托盘条码比对1) + if (PriorDevice.Count > 0) + { + //如果PriorDevice是输送机则生成输送机命令【CurDevice-->PriorDevice目标设备,出库:2】, + //收到输送机PriorDevice的PLC上报的运行状态则提前触发RGV运行命令(7),然后是取送货命令,获取堆垛机取坐标 + #region 前一设备是输送机 + AheadDetect.Remove(0, AheadDetect.Length); + if (PriorDevice[1] == 2) + { + if ((uncontrol != "1") && (CurDevice[1]==2)) + {//20091107 + List newcur = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newcur != null) + { + CurDevice = newcur; + } + int arrowdev; + if (CurDevice[0] == PriorDevice[0]) + {//输送机的起点设备和终点设备相同时,目标设备索引置为零 + arrowdev = 0; + #region 运行提前检测光电组 + if (CurDevice[3] == 1) + { + //CurDevice的F_BindingDevice里存的光电开关的设备所引。CurDevice有探物 + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + { + AheadDetect .Append( "D-" ).Append( tw.ToString() ).Append( ";" ).Append( GetBeDetectedDevices(CurDevice[0]));//20101118 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + tw = GetBindingDeviceIndexOut(CurDevice[0]); + if (tw != "") + { + AheadDetect .Append( ";D" + tw.ToString());//20101118 + } + + } + else if (CurDevice[3] == 2) + { + tw = GetBindingDeviceIndexOut(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101118 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append(";D" + tw.ToString());//20101118 + } + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + #endregion + } + else + { + arrowdev = PriorDevice[0]; + CurDevice[3] = 6; + #region 运行提前检测光电组 + //CurDevice的F_SendOutDetect里存的光电开关的设备所引。CurDevice有探物 + string[] cdi = ccf.GetOwnCorrel_DeviceInfo(CurDevice[0] ); + if (null != cdi) + {//20100406检测被堆垛机送货的顶升机构在顶升高位,空闲 + AheadDetect.Append(";D-").Append(cdi[1]).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101118 + } + //20101011 + else + { + tw = GetSendOutDetect(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0])); + + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + + List nextConveyor = GetCurConveyorNextDevice(routeIDSub, CurDevice[2]); + if (nextConveyor.Count > 0)//20110331 + { + AheadDetect.Append(";").Append(GetBeDetectedDevices(nextConveyor[0])); + tw = GetBindingDeviceIndex(nextConveyor[0]); + if ((tw != "")&&(nextConveyor[0]!=12304)&&(nextConveyor[0]!=12310))//20130510 + { + AheadDetect.Append(";D").Append(tw.ToString());//20101118 + } + tw = GetBindingDeviceIndexOut(nextConveyor[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101118 + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + nextConveyor[0].ToString(); + } + + } + + #endregion + } + AheadDetect.Append(";").Append(GetBeDetectedDevices(CurDevice[0])); + AheadTrigger.Remove(0, AheadTrigger.Length); + AheadTrigger .Append( PriorDevice[0].ToString()); //+ "-" + (被触发的调度任务号);//此设备的运行状态(货物当前位置=PriorDevice[0])触发堆垛机的将取 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, CurDevice[0], CurDevice[3], 0) == false) + { + + + #region 生成输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex; + sql.Remove(0, sql.Length); + sql .Append( "INSERT INTO T_Monitor_Task " ).Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel," ).Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4," ).Append( + " F_AheadDetect,F_TxtParam)" ).Append( + "VALUES (" ).Append( ManFID ).Append( "," ).Append( Mankind ).Append( "," ).Append( mindex ).Append( "," ).Append( drv["FTASKLEVEL"] + ).Append( "," ).Append( CurDevice[0] ).Append( "," ).Append( CurDevice[3] ).Append( "," ).Append( routeIDSub ).Append( "," ).Append( status ).Append( "," ).Append( CurDevice[0] ).Append( "," ).Append( arrowdev + ).Append( ",'" ).Append( AheadDetect.ToString() ).Append( "','" ).Append( drv["FPALLETBARCODE"] ).Append( "')"); + dbo.ExceSQL(sql.ToString()); + #endregion + + + } + } + } + + #endregion + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length); + tw = GetBindingDeviceIndexOut(PriorDevice[0]); + if (tw != "") + { + AheadDetect.Append("D-").Append(tw.ToString()); + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + #endregion + } + + + #region 生成条码比对命令 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], NextKeyDevice[3], 0) == false) + { + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + sql.Remove(0, sql.Length); + sql .Append( "INSERT INTO T_Monitor_Task " ).Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel," ).Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4," ).Append( + " F_AheadDetect,F_TxtParam)" ).Append( + "VALUES (" ).Append( ManFID ).Append( "," ).Append( Mankind ).Append( "," ).Append( mindex ).Append( "," ).Append( drv["FTASKLEVEL"] + ).Append( "," ).Append( NextKeyDevice[0] ).Append( "," ).Append( NextKeyDevice[3] ).Append( "," ).Append( routeIDSub ).Append( "," ).Append( status ).Append( ",0,0,'" ).Append( AheadDetect.ToString() ).Append( "','" ).Append( drv["FPALLETBARCODE"] ).Append( "')"); + dbo.ExceSQL(sql.ToString()); + } + #endregion + + + #endregion + break; + case 8://20130510 + case 17://20161221 拆垛机器人 + #region 拆垛机器人、称重设备(拆垛、称重命令1) + if (PriorDevice.Count > 0) + { + //如果PriorDevice是输送机则生成输送机命令【CurDevice-->PriorDevice目标设备,出库:2】, + //收到输送机PriorDevice的PLC上报的运行状态则提前触发RGV运行命令(7),然后是取送货命令,获取堆垛机取坐标 + #region 前一设备是输送机 + AheadDetect.Remove(0, AheadDetect.Length); + if (PriorDevice[1] == 2) + { + if ((uncontrol != "1") && (CurDevice[1] == 2)) + {//20091107 + List newcur = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newcur != null) + { + CurDevice = newcur; + } + int arrowdev; + if (CurDevice[0] == PriorDevice[0]) + {//输送机的起点设备和终点设备相同时,目标设备索引置为零 + arrowdev = 0; + #region 运行提前检测光电组 + if (CurDevice[3] == 1) + { + //CurDevice的F_BindingDevice里存的光电开关的设备所引。CurDevice有探物 + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101118 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + tw = GetBindingDeviceIndexOut(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append(";D" + tw.ToString());//20101118 + } + + } + else if (CurDevice[3] == 2) + { + tw = GetBindingDeviceIndexOut(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append("D-").Append(tw.ToString()).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101118 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append(";D" + tw.ToString());//20101118 + } + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + #endregion + } + else + { + arrowdev = PriorDevice[0]; + CurDevice[3] = 6; + #region 运行提前检测光电组 + //CurDevice的F_SendOutDetect里存的光电开关的设备所引。CurDevice有探物 + string[] cdi = ccf.GetOwnCorrel_DeviceInfo(CurDevice[0]); + if (null != cdi) + {//20100406检测被堆垛机送货的顶升机构在顶升高位,空闲 + AheadDetect.Append(";D-").Append(cdi[1]).Append(";").Append(GetBeDetectedDevices(CurDevice[0]));//20101118 + } + //20101011 + else + { + tw = GetSendOutDetect(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append("D-").Append(tw.ToString());//20101118 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + + List nextConveyor = GetCurConveyorNextDevice(routeIDSub, CurDevice[2]); + if (nextConveyor.Count > 0)//20110331 + { + AheadDetect.Append(";").Append(GetBeDetectedDevices(nextConveyor[0])); + tw = GetBindingDeviceIndex(nextConveyor[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101118 + } + tw = GetBindingDeviceIndexOut(nextConveyor[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101118 + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + nextConveyor[0].ToString(); + } + + } + + #endregion + } + AheadDetect.Append(";").Append(GetBeDetectedDevices(CurDevice[0])); + //AheadTrigger.Remove(0, AheadTrigger.Length); + //AheadTrigger.Append(PriorDevice[0].ToString()); //+ "-" + (被触发的调度任务号);//此设备的运行状态(货物当前位置=PriorDevice[0])触发堆垛机的将取 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, CurDevice[0], CurDevice[3], 0) == false) + { + #region 运行时锁定设备组 + //if ((CurDevice[0] == 32037) || (CurDevice[0] == 32050)) + //{ + // RunningLock.Clear(); + // RunningLock.Append(Convert.ToInt32(CurDevice[0] - 1)); + //} + #endregion + + #region 生成输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex; + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + " F_AheadDetect,F_TxtParam)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(CurDevice[0]).Append(",").Append(CurDevice[3]).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(CurDevice[0]).Append(",").Append(arrowdev + ).Append(",'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + #endregion + + + } + } + } + + #endregion + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length); + AheadDetect.Append(";").Append(GetBeDetectedDevices(PriorDevice[0])); + + tw = GetBindingDeviceIndexOut(PriorDevice[0]); + if (tw != "") + { + AheadDetect.Append(";D-").Append(tw.ToString());//20101118 + } + AheadDetect.Append(";").Append(GetBeDetectedDevices(NextKeyDevice[0]));//20101124 + #endregion + #region 注释 + //if (CurDevice[0] == 12304 || CurDevice[0] == 12310) + //{//20130510 16006,16008 + // int dev = GetBarcodeDeviceFromBindDevice(CurDevice[0]); + // #region 生成条码比对命令1 + // if (DeviceAndOrderExitInMonitor(Mankind, ManFID, dev, 1, 0) == false) + // { + // int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + // sql.Remove(0, sql.Length); + // sql.Append("INSERT INTO T_Monitor_Task ").Append( + // "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + // " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + // " F_AheadDetect,F_TxtParam)").Append( + // "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + // ).Append(",").Append(dev).Append(",").Append(1).Append(",").Append(ccf.GetRouteIDsub(dev)).Append(",").Append(status).Append(",0,0,'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("')"); + // dbo.ExceSQL(sql.ToString()); + // } + // #endregion + //} + #endregion + + } + + + #region 生成拆垛称重命令1 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], NextKeyDevice[3], 0) == false) + { + //内筒或箱体的类型写入F_NumParam1 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + " F_AheadDetect,F_TxtParam)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(NextKeyDevice[0]).Append(",").Append(NextKeyDevice[3]).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",0,").Append(drv["GOODS_NUM"]).Append(",'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + } + #endregion + + + #endregion + break; + case 12: + #region 虚拟关键设备(只作为路径分割点) + if (PriorDevice.Count > 0) + { + //如果PriorDevice是输送机则生成输送机命令【CurDevice-->PriorDevice目标设备,出库:2】, + //收到输送机PriorDevice的PLC上报的运行状态则提前触发RGV运行命令(7),然后是取送货命令,获取堆垛机取坐标 + #region 前一设备是输送机 + AheadDetect.Remove(0, AheadDetect.Length); + if (PriorDevice[1] == 2) + { + if (uncontrol != "1") + {//20091107 + List newcur = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newcur != null) + { + CurDevice = newcur; + } + int arrowdev; + if (CurDevice[0] == PriorDevice[0]) + {//输送机的起点设备和终点设备相同时,目标设备索引置为零 + arrowdev = 0; + #region 运行提前检测光电组 + //20101011 + string[] cdi = ccf.GetOwnCorrel_DeviceInfo(CurDevice[0]); + if ((null!= cdi)&&(CurDevice[3] == 2)) + {//20100406检测被堆垛机送货的顶升机构在顶升高位,空闲 + AheadDetect .Append( ";D-" ).Append( cdi[1] ).Append( ";" ).Append( GetBeDetectedDevices(CurDevice[0]));//20101118 + } + //20101011 + else + { + if (CurDevice[3] == 1) + { + //CurDevice的F_BindingDevice里存的光电开关的设备所引。CurDevice有探物 + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + { + AheadDetect .Append( "D-" ).Append( tw.ToString() ).Append( ";" ).Append( GetBeDetectedDevices(CurDevice[0]));//20101118 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + tw = GetBindingDeviceIndexOut(CurDevice[0]); + if (tw != "") + { + AheadDetect .Append( ";D" ).Append( tw.ToString());//20101118 + } + } + else if ((CurDevice[3] == 2) )//20110510反转 + { + //CurDevice的F_BindingDevice里存的光电开关的设备所引。CurDevice有探物 + #region 注释 by lyj 20171113 + // tw = GetBindingDeviceIndexOut(CurDevice[0]); + #endregion + tw = GetSendOutDetect(CurDevice[0]); + if (tw != "") + { + AheadDetect .Append( "D-" ).Append( tw.ToString() ).Append( ";" ).Append( GetBeDetectedDevices(CurDevice[0]));//20101118 + } + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101118 + } + } + + } + //else if (CurDevice[3] == 2) + //{ + // tw = GetBindingDeviceIndexOut(CurDevice[0]); + // if (tw != "") + // { + // AheadDetect = "D-" + tw.ToString() + ";" + GetBeDetectedDevices(CurDevice[0]);//20101118 + // } + // else + // { + // AheadDetect.Remove(0, AheadDetect.Length); + // } + //} + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + #endregion + } + else + { + arrowdev = PriorDevice[0]; + CurDevice[3] = 6; + #region 运行提前检测光电组 + //CurDevice的F_SendOutDetect里存的光电开关的设备所引。CurDevice有探物 + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + {//20091107 + AheadDetect .Append( "D-" ).Append( tw.ToString() ).Append( ";" ).Append( GetBeDetectedDevices(CurDevice[0]));//20101118 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + + + //List nextConveyor = GetCurConveyorNextDevice(routeIDSub, CurDevice[2]); + //if (nextConveyor.Count > 0)//20110331 + //{ + // AheadDetect.Append(";").Append(GetBeDetectedDevices(nextConveyor[0])); + // tw = GetBindingDeviceIndex(nextConveyor[0]); + // if (tw != "") + // { + // AheadDetect.Append(";D").Append(tw.ToString());//20101118 + // } + // tw = GetBindingDeviceIndexOut(nextConveyor[0]); + // if (tw != "") + // { + // AheadDetect.Append(";D").Append(tw.ToString());//20101118 + // } + // //20090803检测设备是否空闲idle + // AheadDetect += ";" + "I" + nextConveyor[0].ToString(); + //} + #endregion + } + + //#region 20210326_上海晟碟,如果是出入库提升机还要判断下一个输送线是否有货 + + //if (NextDevice[0] == 19003 || NextDevice[0] == 19005) + //{ + // if (SecondNextKeyDevice.Count > 0) + // { + // int iNextDevice = GetPriorDevice(routeIDSub, SecondNextKeyDevice[2])[0]; + // tw = GetBindingDeviceIndex(iNextDevice); + // if (tw != "") + // { + // AheadDetect.Append(";D").Append(tw.ToString());//20101118 + // } + // } + + //} + + //#endregion + + + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, CurDevice[0], CurDevice[3], 0) == false) + { + #region 运行时锁定设备组 + + #endregion + + #region 生成输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex; + sql.Remove(0, sql.Length); + sql .Append( "INSERT INTO T_Monitor_Task " ).Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel," ).Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4," ).Append( + " F_AheadDetect,F_TxtParam)" ).Append( + "VALUES (" ).Append( ManFID ).Append( "," ).Append( Mankind ).Append( "," ).Append( mindex ).Append( "," ).Append( drv["FTASKLEVEL"] + ).Append( "," ).Append( CurDevice[0] ).Append( "," ).Append( CurDevice[3] ).Append( "," ).Append( routeIDSub ).Append( "," ).Append( status ).Append( "," ).Append( CurDevice[0] ).Append( "," ).Append( arrowdev + ).Append( ",'" ).Append( AheadDetect.ToString() ).Append( "','" ).Append( drv["FPALLETBARCODE"] ).Append( "')"); + dbo.ExceSQL(sql.ToString()); + #endregion + + + } + + } + } + #endregion + + } + #endregion + break; + case 30: + #region 20100617和管理交互虚拟设备,1:出库托盘确认 + AheadDetect.Remove(0, AheadDetect.Length); + if (PriorDevice.Count > 0) + { + //如果PriorDevice是输送机则生成输送机命令【CurDevice-->PriorDevice目标设备,出库:2】, + //收到输送机PriorDevice的PLC上报的运行状态则提前触发RGV运行命令(7),然后是取送货命令,获取堆垛机取坐标 + #region 前一设备是输送机 + + if (PriorDevice[1] == 2) + { + if (uncontrol != "1") + {//20091107 + List newcur = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newcur != null) + { + CurDevice = newcur; + } + int arrowdev; + if (CurDevice[0] == PriorDevice[0]) + {//输送机的起点设备和终点设备相同时,目标设备索引置为零 + arrowdev = 0; + #region 运行提前检测光电组 + if ((CurDevice[3] == 1) || (CurDevice[3] == 2)) + { + //CurDevice的F_BindingDevice里存的光电开关的设备所引。CurDevice有探物 + tw = GetBindingDeviceIndex(CurDevice[0]); + if (tw != "") + { + AheadDetect .Append( "D-" ).Append( tw.ToString() ).Append( ";" ).Append( GetBeDetectedDevices(CurDevice[0]));//20101118 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + tw = GetBindingDeviceIndexOut(CurDevice[0]); + if (tw != "") + { + AheadDetect .Append( ";D" ).Append( tw.ToString());//20101118 + } + + } + //else if (CurDevice[3] == 2) + //{ + // tw = GetBindingDeviceIndexOut(CurDevice[0]); + // if (tw != "") + // { + // AheadDetect = "D-" + tw.ToString() + ";" + GetBeDetectedDevices(CurDevice[0]);//20101118 + // } + // else + // { + // AheadDetect.Remove(0, AheadDetect.Length); + // } + //} + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + #endregion + } + else + { + arrowdev = PriorDevice[0]; + CurDevice[3] = 6; + #region 运行提前检测光电组 + //CurDevice的F_SendOutDetect里存的光电开关的设备所引。CurDevice有探物 + tw = GetSendOutDetect(CurDevice[0]); + if (tw != "") + { + AheadDetect .Append( "D-" ).Append( tw.ToString());//20101118 + } + else + { + AheadDetect.Remove(0, AheadDetect.Length); + } + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + CurDevice[0].ToString(); + + List nextConveyor = GetCurConveyorNextDevice(routeIDSub, CurDevice[2]); + if (nextConveyor.Count > 0)//20110331 + { + AheadDetect.Append(";").Append(GetBeDetectedDevices(nextConveyor[0])); + tw = GetBindingDeviceIndex(nextConveyor[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101118 + } + tw = GetBindingDeviceIndexOut(nextConveyor[0]); + if (tw != "") + { + AheadDetect.Append(";D").Append(tw.ToString());//20101118 + } + + ////20090803检测设备是否空闲idle + //AheadDetect += ";" + "I" + nextConveyor[0].ToString(); + } + #endregion + } + AheadTrigger.Remove(0, AheadTrigger.Length); + AheadTrigger .Append( PriorDevice[0].ToString()); //+ "-" + (被触发的调度任务号);//此设备的运行状态(货物当前位置=PriorDevice[0])触发堆垛机的将取 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, CurDevice[0], CurDevice[3], 0) == false) + { + #region 运行时锁定设备组 + + #endregion + + #region 生成输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex; + sql.Remove(0, sql.Length); + sql .Append( "INSERT INTO T_Monitor_Task " ).Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel," ).Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4," ).Append( + " F_AheadDetect,F_TxtParam)" ).Append( + "VALUES (" ).Append( ManFID ).Append( "," ).Append( Mankind ).Append( "," ).Append( mindex ).Append( "," ).Append( drv["FTASKLEVEL"] + ).Append( "," ).Append( CurDevice[0] ).Append( "," ).Append( CurDevice[3] ).Append( "," ).Append( routeIDSub ).Append( "," ).Append( status ).Append( "," ).Append( CurDevice[0] ).Append( "," ).Append( arrowdev + ).Append( ",'" ).Append( AheadDetect.ToString() ).Append( "','" ).Append( drv["FPALLETBARCODE"] ).Append( "')"); + dbo.ExceSQL(sql.ToString()); + #endregion + + + } + } + } + + #endregion + + } + #region 运行提前检测光电组 + + //tw = GetBindingDeviceIndexOut(PriorDevice[0]); + //if (tw != "") + //{ + // AheadDetect = "D-" + tw.ToString();//20101118 + //} + //else + //{ + // AheadDetect.Remove(0, AheadDetect.Length); + //} + #endregion + + #region 生成和管理交互虚拟设备的【出库确认】命令 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], NextKeyDevice[3], 0) == false) + { + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + sql.Remove(0, sql.Length); + sql .Append( "INSERT INTO T_Monitor_Task " ).Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel," ).Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4," ).Append( + " F_AheadDetect,F_TxtParam)" ).Append( + "VALUES (" ).Append( ManFID ).Append( "," ).Append( Mankind ).Append( "," ).Append( mindex ).Append( "," ).Append( drv["FTASKLEVEL"] + ).Append( "," ).Append( NextKeyDevice[0] ).Append( "," ).Append( NextKeyDevice[3] ).Append( "," ).Append( routeIDSub ).Append( "," ).Append( status ).Append( ",0,0,'" ).Append( AheadDetect ).Append( "','" ).Append( drv["FPALLETBARCODE"] + "')"); + dbo.ExceSQL(sql.ToString()); + } + #endregion + + + #endregion + break; + #region add by lyj20180424双叉提升机类型 + case 40: + #region 双叉提升机取货 + //双叉提升机取货: + if (PriorDevice.Count > 0) + { + //如果PriorDevice是输送机则生成输送机命令【CurDevice-->PriorDevice目标设备,出库:2】, + //收到输送机PriorDevice的PLC上报的运行状态则提前触发RGV运行命令(7),然后是取送货命令,获取堆垛机取坐标 + #region 前一设备是输送机 + + if (PriorDevice[1] == 2) + { + if ((uncontrol != "1") && (CurDevice[1] == 2)) + {//20091107 + List newcur = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newcur != null) + { + CurDevice = newcur; + } + int arrowdev; + + if (CurDevice[0] == PriorDevice[0]) + {//输送机的起点设备和终点设备相同时,目标设备索引置为零 + arrowdev = 0; + + } + else + { + arrowdev = PriorDevice[0]; + CurDevice[3] = 6; + + } + sql.Remove(0, sql.Length); + sql.Append("select * from T_Base_AheadDetect where F_DeviceIndex=").Append(CurDevice[0]).Append("and F_TaskType=").Append(tasktype).Append(" and F_CommondIndex=6").Append(" and F_GoalDeviceIndex=").Append(PriorDevice[0]); + dvahead = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + if (dvahead.Count > 0) + { + AheadDetect.Remove(0, AheadDetect.Length); + AheadDetect.Append(dvahead[0]["F_AheadDetect"].ToString()); + } + + + AheadTrigger.Remove(0, AheadTrigger.Length); + AheadTrigger.Append(PriorDevice[0].ToString()); //+ "-" + (被触发的调度任务号);//此设备的运行状态(货物当前位置=PriorDevice[0])触发堆垛机的将取 + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, CurDevice[0], CurDevice[3], 0) == false) + { + #region 运行时锁定设备组 + + #endregion + + #region 生成输送机命令 + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + TriggerTaskNo = mindex; + sql.Remove(0, sql.Length);//20101124 + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,").Append( + " F_AheadDetect,F_TxtParam)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(CurDevice[0]).Append(",").Append(CurDevice[3]).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(CurDevice[0]).Append(",").Append(arrowdev + ).Append(",'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + #endregion + } + + } + + + + } + else + {//20111020 + List newPrior = NewCurDevice(PriorDevice0, PriorKeyDevice0); + if (newPrior != null) + { + PriorDevice = newPrior; + } + } + #endregion + + #region 获得RGV运行的接货位的设备索引 + Coor[0] = PriorDevice[0]; + Coor[1] = 0; + Coor[2] = 0; + Coor[3] = 0; + Coor[4] = 0; + Coor[5] = 0; + #endregion + + #region RGV的接货(被关联的任务) + Rgvorder = 4; //GetRGVOrder(PriorDevice[0], true); + + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length); + #region 提前检测从数据库里取 add by lyj20180424 + if (tasktype == 1) + { + + sql.Remove(0, sql.Length); + sql.Append("select * from T_Base_AheadDetect where F_DeviceIndex=").Append(NextKeyDevice[0]).Append("and F_TaskType=1 and F_CommondIndex=4").Append(" and F_GoalDeviceIndex=").Append(PriorDevice[0]); + dvahead = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + if (dvahead.Count > 0) + { + AheadDetect.Remove(0, AheadDetect.Length); + AheadDetect.Append(dvahead[0]["F_AheadDetect"].ToString()); + } + + } + else if (tasktype == 2) + { + int goaldevice=12037; + sql.Remove(0, sql.Length); + //sql.Append("select * from T_Base_AheadDetect where F_DeviceIndex=").Append(NextKeyDevice[0]).Append("and F_TaskType=2 and F_CommondIndex=4").Append(" and F_GoalDeviceIndex=").Append(NextDevice[0]); + + sql.Append("select * from T_Base_AheadDetect where F_DeviceIndex=").Append(NextKeyDevice[0]).Append("and F_TaskType=2 and F_CommondIndex=4").Append(" and F_GoalDeviceIndex=").Append(PriorDevice[0]); + dvahead = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + if (dvahead.Count > 0) + { + AheadDetect.Remove(0, AheadDetect.Length); + AheadDetect.Append(dvahead[0]["F_AheadDetect"].ToString()); + } + + } + + #endregion + #endregion + + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], Rgvorder, 0) == false) + { + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2,").Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_TxtParam)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(NextKeyDevice[0]).Append(",").Append(Rgvorder).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(PriorDevice[0]).Append(",0").Append( + ",0,").Append(PriorDevice[0]).Append(",0,0,'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + sql.Remove(0, sql.Length); + sql.Append("update T_Monitor_Task set F_Associate=").Append(mindex).Append(" where F_MonitorIndex=").Append(mainTask); + dbo.ExceSQL(sql.ToString()); + + } + //20101124 + #endregion + + + } + + //获得RGV运行的送货位的设备索引: + if (NextDevice.Count > 0) + { + Coor[0] = NextDevice[0]; + Coor[1] = 0; + Coor[2] = 0; + Coor[3] = 0; + Coor[4] = 0; + Coor[5] = 0; + + #region RGV的送货 + + Rgvorder = 5;// GetRGVOrder(NextDevice[0], false); + + + + #region 运行提前检测光电组 + AheadDetect.Remove(0, AheadDetect.Length); + #region 送货从数据库里取 add by lyj 20171026 + if (tasktype == 1) + { + + sql.Remove(0, sql.Length); + sql.Append("select * from T_Base_AheadDetect where F_DeviceIndex=").Append(NextKeyDevice[0]).Append("and F_TaskType=1 and F_CommondIndex=5").Append(" and F_GoalDeviceIndex=").Append(NextDevice[0]); + dvahead = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + if (dvahead.Count > 0) + { + AheadDetect.Remove(0, AheadDetect.Length); + AheadDetect.Append(dvahead[0]["F_AheadDetect"].ToString()); + } + + } + else if (tasktype == 2) + { + + sql.Remove(0, sql.Length); + + // sql.Append("select * from T_Base_AheadDetect where F_DeviceIndex=").Append(NextKeyDevice[0]).Append("and F_TaskType=2 and F_CommondIndex=5").Append(" and F_GoalDeviceIndex=").Append(NextDevice[0]); + sql.Append("select * from T_Base_AheadDetect where F_DeviceIndex=").Append(NextKeyDevice[0]).Append("and F_TaskType=2 and F_CommondIndex=5").Append(" and F_GoalDeviceIndex=").Append(NextDevice[0]); + dvahead = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + if (dvahead.Count > 0) + { + AheadDetect.Remove(0, AheadDetect.Length); + AheadDetect.Append(dvahead[0]["F_AheadDetect"].ToString()); + } + + } + + #endregion + #endregion + + if (DeviceAndOrderExitInMonitor(Mankind, ManFID, NextKeyDevice[0], Rgvorder, 0) == false) + { + int mindex = ccf.GetMonitorIndex(ManFID, Mankind); + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO T_Monitor_Task ").Append( + "(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,").Append( + " F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam2,").Append( + " F_NumParam3, F_NumParam4,F_NumParam5, F_NumParam6,F_AheadDetect,F_TxtParam)").Append( + "VALUES (").Append(ManFID).Append(",").Append(Mankind).Append(",").Append(mindex).Append(",").Append(drv["FTASKLEVEL"] + ).Append(",").Append(NextKeyDevice[0]).Append(",").Append(Rgvorder).Append(",").Append(routeIDSub).Append(",").Append(status).Append(",").Append(NextDevice[0]).Append(",0").Append( + ",0,").Append(NextDevice[0]).Append(",0,0,'").Append(AheadDetect.ToString()).Append("','").Append(drv["FPALLETBARCODE"]).Append("')"); + dbo.ExceSQL(sql.ToString()); + mainTask = mindex; + } + + #endregion + + } + + break; + + + + #endregion + #endregion + default: + break; + } + } + else + { + + } + PriorDevice0 = PriorDevice; + PriorKeyDevice0 = NextKeyDevice; + //20091107 + PriorDevice = null; + NextKeyDevice = null; + CurDevice = null; + NextKeyDevice = null; + } + //20120820 + string dtime = DateTime.Now.ToString("u"); + dtime = dtime.Substring(0, dtime.Length - 1); + dbo.ExecuteSql(string.Format("update T_Monitor_Task set F_SplitTime= '{0}' where F_ManageTASKKINDINDEX={1} and F_ManageTASKINDEX={2}",dtime,Mankind,ManFID));//20120616 + dbo.TransCommit(); + //20091107 + PriorDevice0 = null; + PriorKeyDevice0 = null; + + CDataChangeEventArgs cea = new CDataChangeEventArgs(null, null); + OnDataChange("CreateMonitor",cea); + return 1; + } + catch (Exception ex) + { + + DisassembleTaskError = "ControlSystem.CDisassembleTask.CreateMonitor时发生错误:" + ex.StackTrace+ex.Message ; + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", DisassembleTaskError); + OnRefreshMonitor(rme); + dbo.TransRollback(); + + return 0; + } + finally + { + //dvRoute.Dispose(); + //dvs.Dispose(); + + } + } + /// + /// 特殊任务需要控制任务数量,不进行拆分,返回值true就不拆分 + /// + /// + /// + public static bool ControlTaskAmountUnDisassemble(DataRowView drv) + {//20121203 + DataView dv = new DataView(); + try + { + if (Convert.ToInt32(drv["FSTARTDEVICE"]) == 19001 && Convert.ToInt32(drv["FENDDEVICE"]) != 19001) + {//化成A回库和去倒箔间的包含12068的任务分别不能超过六个(12076,12083,18001,18002...18005) + sql.Clear(); + sql.Append("SELECT count(distinct FID) as taskamount FROM T_Monitor_Task,T_Manage_Task WHERE T_Monitor_Task.F_ManageTASKKINDINDEX = T_Manage_Task.F_ManageTaskKindIndex") + .Append(" AND T_Monitor_Task.F_ManageTaskIndex = T_Manage_Task.FID and T_Monitor_Task.F_DeviceIndex = 12068 and FSTARTDEVICE=19001 "); + if (Convert.ToInt32(drv["FENDDEVICE"]) == 12076 || Convert.ToInt32(drv["FENDDEVICE"]) == 12083) + { + sql.Append(" and (FENDDEVICE=12076 or FENDDEVICE=12083) "); + } + else + { + sql.Append(" and (FENDDEVICE<>12076 and FENDDEVICE<>12083 and FENDDEVICE<>19001) "); + } + object ob = dbo.GetSingle(sql.ToString()); + if (ob != null) + { + if (Convert.ToInt32(ob) > 6) + { + return true; + } + } + } + else if (Convert.ToInt32(drv["FSTARTDEVICE"]) != 19002 && Convert.ToInt32(drv["FENDDEVICE"]) == 19002 ) + {//化成B出库包含12019的不能超过4个; + sql.Clear(); + sql.Append("SELECT count(distinct FID) as taskamount FROM T_Monitor_Task,T_Manage_Task WHERE T_Monitor_Task.F_ManageTASKKINDINDEX = T_Manage_Task.F_ManageTaskKindIndex") + .Append(" AND T_Monitor_Task.F_ManageTaskIndex = T_Manage_Task.FID and T_Monitor_Task.F_DeviceIndex = 12019 "); + sql.Append(" and (FENDDEVICE=19002 and FSTARTDEVICE<>19002) "); + object ob = dbo.GetSingle(sql.ToString()); + if (ob != null) + { + if (Convert.ToInt32(ob) > 4) + { + return true; + } + } + } + else if (Convert.ToInt32(drv["FSTARTDEVICE"]) == 19002 && Convert.ToInt32(drv["FENDDEVICE"]) != 19002 ) + {//化成B去倒箔间和回库的任务包含12034等待执行的不能超过3个 + sql.Clear(); + sql.Append("SELECT count(distinct FID) as taskamount FROM T_Monitor_Task,T_Manage_Task WHERE T_Monitor_Task.F_ManageTASKKINDINDEX = T_Manage_Task.F_ManageTaskKindIndex") + .Append(" AND T_Monitor_Task.F_ManageTaskIndex = T_Manage_Task.FID and T_Monitor_Task.F_DeviceIndex = 12034 and f_status=0 and FSTARTDEVICE=19002 "); + if (Convert.ToInt32(drv["FENDDEVICE"]) == 12042 || Convert.ToInt32(drv["FENDDEVICE"]) == 12051) + { + sql.Append(" and (FENDDEVICE=12042 or FENDDEVICE=12051) "); + } + else + { + sql.Append(" and (FENDDEVICE<>12042 and FENDDEVICE<>12051 and FENDDEVICE<>19002) "); + } + object ob = dbo.GetSingle(sql.ToString()); + if (ob != null) + { + if (Convert.ToInt32(ob) > 3) + { + return true; + } + } + } + else if (Convert.ToInt32(drv["FSTARTDEVICE"]) >= 18001 && Convert.ToInt32(drv["FSTARTDEVICE"]) <= 18005 && (Convert.ToInt32(drv["FENDDEVICE"]) == 12042 || Convert.ToInt32(drv["FENDDEVICE"]) == 12051)) + {//立库到化成B倒箔间任务每个巷道最多两个 + sql.Clear(); + sql.Append("SELECT count(distinct FID) as taskamount FROM T_Monitor_Task,T_Manage_Task WHERE T_Monitor_Task.F_ManageTASKKINDINDEX = T_Manage_Task.F_ManageTaskKindIndex") + .Append(" AND T_Monitor_Task.F_ManageTaskIndex = T_Manage_Task.FID and (FENDDEVICE=12042 or FENDDEVICE=12051) and FSTARTDEVICE=").Append(Convert.ToInt32(drv["FSTARTDEVICE"])); + + object ob = dbo.GetSingle(sql.ToString()); + if (ob != null) + { + if (Convert.ToInt32(ob) >=2) + { + return true; + } + } + } + return false; + } + catch (Exception ex) + { + DisassembleTaskError = "拆分任务时,判断是否二楼检定任务是否超过最大缓存8垛:" + ex.Message; + return false; + } + } + /// + /// 查找路径运行方向的反方向的最近的设备,返回值:索引0:设备所引;索引1:设备类型;2:路径序号;3:设备命令 + /// + /// 路径ID + /// 路径上的序号 + /// + public static List GetPriorDevice(int CurRouteIDSub, int CurSerialNumber) + { + + List keyDevice = new List(); + DataView dvRoute = new DataView(); + try + { + //后续设备最近的设备 + sql.Remove(0, sql.Length); + sql.Append( "SELECT T_Base_Route_Device.F_DeviceIndex,F_DeviceOrder, T_Base_Route_Device.F_SerialNumber, " ).Append( + "T_Base_Device_Command.F_DeviceCommandIndex,T_Base_Device.F_DeviceKindIndex FROM T_Base_Device_Command " ).Append( + ",T_Base_Device,T_Base_Route_Device where T_Base_Device_Command.F_DeviceKindIndex = T_Base_Device.F_DeviceKindIndex" ).Append( + " and T_Base_Device.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex and F_RouteIDSub=" ).Append( + CurRouteIDSub ).Append( " and F_SerialNumber < " ).Append( CurSerialNumber ).Append( " order by F_SerialNumber desc "); + dvRoute = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvRoute.Count > 0) + { + keyDevice.Add(Convert.ToInt32(dvRoute[0]["F_DeviceIndex"])); + keyDevice.Add(Convert.ToInt32(dvRoute[0]["F_DeviceKindIndex"])); + keyDevice.Add(Convert.ToInt32(dvRoute[0]["F_SerialNumber"])); + keyDevice.Add(Convert.ToInt32(dvRoute[0]["F_DeviceOrder"])); + } + return keyDevice; + } + catch (Exception ex) + { + DisassembleTaskError = string.Format("ControlSystem.CDisassembleTask.GetPriorDevice:{0}" , ex.StackTrace+ex.Message ); + return null; + } + finally + { + keyDevice=null; + dvRoute.Dispose() ; + + } + } + /// + /// 对于长串输送机组,需要判断当前设备的下一个设备是否具备发送状态 + /// + /// 当前调度的子路径 + /// 输送机组的当前输送机对应的路径序号 + /// + static List GetCurConveyorNextDevice(int CurRouteIDSub, int CurSerialNumber) + { + List CurDeviceNextDev = new List();//20130510 return CurDeviceNextDev;//20120906嘉兴特殊 + DataView dvRoute = new DataView(); + try + { + //找到前一个设备CurDevice的下一个设备 + sql.Remove(0, sql.Length ); + sql.Append("SELECT T_Base_Route_Device.F_DeviceIndex,F_DeviceOrder, T_Base_Route_Device.F_SerialNumber, " ).Append( + "T_Base_Device_Command.F_DeviceCommandIndex,T_Base_Device.F_DeviceKindIndex FROM T_Base_Device_Command " ).Append( + ",T_Base_Device,T_Base_Route_Device where T_Base_Device_Command.F_DeviceKindIndex = T_Base_Device.F_DeviceKindIndex" ).Append( + " and T_Base_Device.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex and F_RouteIDSub=" ).Append( + CurRouteIDSub ).Append( " and F_SerialNumber > " ).Append( CurSerialNumber ).Append( " and T_Base_Device.F_DeviceKindIndex=2 order by F_SerialNumber asc "); + dvRoute = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvRoute.Count > 0) + { + CurDeviceNextDev.Add(Convert.ToInt32(dvRoute[0]["F_DeviceIndex"])); + CurDeviceNextDev.Add(Convert.ToInt32(dvRoute[0]["F_DeviceKindIndex"])); + CurDeviceNextDev.Add(Convert.ToInt32(dvRoute[0]["F_SerialNumber"])); + CurDeviceNextDev.Add(Convert.ToInt32(dvRoute[0]["F_DeviceOrder"])); + } + return CurDeviceNextDev; + } + catch (Exception ex) + { + DisassembleTaskError = string.Format("ControlSystem.CDisassembleTask.GetCurConveyorNextDevice:{0}" ,ex.StackTrace+ex.Message ); + return null; + } + finally + { + CurDeviceNextDev=null; + dvRoute.Dispose(); + + } + } + /// + /// 查找路径方向上最近的关键设备,返回值:索引0:设备所引;索引1:设备类型;2:路径序号;3:设备命令 + /// + /// 路径ID + /// 路径上的序号 + /// + static List GetNextKeyDevice(int CurRouteIDSub, int CurSerialNumber) + { + List keyDevice = new List(); DataView dvRoute = new DataView(); DataView dv = new DataView(); + try + { + //首先判断本设备是否为关键设备 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_SerialNumber, T_Base_Device.F_DeviceIndex,F_DeviceOrder,F_DeviceKindIndex FROM T_Base_Device," ).Append( + "T_Base_Route_Device where T_Base_Device.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex " ).Append( + " and F_RouteIDSub=" ).Append( CurRouteIDSub ).Append( " and F_SerialNumber=" ).Append( CurSerialNumber + ).Append( " and F_KeyDevice = '1'"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + keyDevice.Add(Convert.ToInt32(dv[0]["F_DeviceIndex"])); + keyDevice.Add(Convert.ToInt32(dv[0]["F_DeviceKindIndex"])); + keyDevice.Add(Convert.ToInt32(dv[0]["F_SerialNumber"])); + keyDevice.Add(Convert.ToInt32(dv[0]["F_DeviceOrder"])); + return keyDevice; + } + //然后依次判断后续设备最近的关键设备 + sql.Remove(0, sql.Length); + sql .Append( "SELECT T_Base_Route_Device.F_DeviceIndex,F_DeviceOrder, T_Base_Route_Device.F_SerialNumber, " ).Append( + "T_Base_Device_Command.F_DeviceCommandIndex,T_Base_Device.F_DeviceKindIndex FROM T_Base_Device_Command " ).Append( + ",T_Base_Device,T_Base_Route_Device where T_Base_Device_Command.F_DeviceKindIndex = T_Base_Device.F_DeviceKindIndex" ).Append( + " and T_Base_Device.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex and F_RouteIDSub=" ).Append( + CurRouteIDSub ).Append( " and F_SerialNumber > " ).Append( CurSerialNumber ).Append( " and T_Base_Device.F_KeyDevice = '1' order by F_SerialNumber asc "); + dvRoute = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvRoute.Count > 0) + { + keyDevice.Add(Convert.ToInt32(dvRoute[0]["F_DeviceIndex"])); + keyDevice.Add(Convert.ToInt32(dvRoute[0]["F_DeviceKindIndex"])); + keyDevice.Add(Convert.ToInt32(dvRoute[0]["F_SerialNumber"])); + keyDevice.Add(Convert.ToInt32(dvRoute[0]["F_DeviceOrder"])); + + } + return keyDevice; + } + catch (Exception ex) + { + DisassembleTaskError = string.Format("ControlSystem.CDisassembleTask.GetNextKeyDevice:{0}" ,ex.StackTrace+ex.Message ); + return null; + } + finally + { + keyDevice=null; + dvRoute.Dispose(); + dv.Dispose(); + + } + } + /// + /// 查找路径方向上下一个设备,返回值:索引0:设备所引;索引1:设备类型;2:路径序号;3:设备命令 + /// + /// 路径ID + /// 路径上的序号 + /// + public static List GetNextDevice(int CurRouteIDSub, int CurSerialNumber) + { + List keyDevice = new List(); DataView dvRoute = new DataView(); + try + { + //然后依次判断后续设备最近的设备 + sql.Remove(0, sql.Length); + sql .Append( "SELECT T_Base_Route_Device.F_DeviceIndex,F_DeviceOrder, T_Base_Route_Device.F_SerialNumber, " ).Append( + "T_Base_Device_Command.F_DeviceCommandIndex,T_Base_Device.F_DeviceKindIndex FROM T_Base_Device_Command " ).Append( + ",T_Base_Device,T_Base_Route_Device where T_Base_Device_Command.F_DeviceKindIndex = T_Base_Device.F_DeviceKindIndex" ).Append( + " and T_Base_Device.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex and F_RouteIDSub=" ).Append( + CurRouteIDSub ).Append( " and F_SerialNumber > " ).Append( CurSerialNumber ).Append( " order by F_SerialNumber asc "); + dvRoute = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvRoute.Count > 0) + { + keyDevice.Add(Convert.ToInt32(dvRoute[0]["F_DeviceIndex"])); + keyDevice.Add(Convert.ToInt32(dvRoute[0]["F_DeviceKindIndex"])); + keyDevice.Add(Convert.ToInt32(dvRoute[0]["F_SerialNumber"])); + keyDevice.Add(Convert.ToInt32(dvRoute[0]["F_DeviceOrder"])); + + } + return keyDevice; + } + catch (Exception ex) + { + DisassembleTaskError = string.Format( "ControlSystem.CDisassembleTask.GetNextDevice:{0}" ,ex.StackTrace+ex.Message ); + return null; + } + finally + { + keyDevice=null; + dvRoute.Dispose(); + + } + } + /// + /// 获得AGV坐标 + /// + /// 调度任务类型 + /// 调度任务索引 + /// 搬运任务类型:1,入库(送坐标);2:出库(取坐标);3:移库(取和送坐标) + /// + static int[] GetAGVAddressFromManage(int Mankind, int ManFID, DataRowView drv) + { + int[] stackCoo = new int[6] { 0, 0, 0, 0, 0, 0 };//取排-列-层(Z-X-Y);送排-列-层(Z-X-Y) + + char[] cc = new char[1] { '-' }; + string[] split = new string[3]; + DataView dv = new DataView(); + try + { + switch (Convert.ToInt32(drv["FCONTROLTASKTYPE"])) + { + case 1://入库,取坐标:机台站台;送坐标:路径下一个设备 + sql.Remove(0, sql.Length); + sql .Append( "SELECT FSTARTCELL,FSTARTDEVICE,FENDDEVICE FROM T_Manage_Task WHERE (FID = " ).Append( ManFID ).Append( ") AND (F_ManageTaskKindIndex = " ).Append( Mankind ).Append( ")"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + stackCoo[0] = 0; + stackCoo[1] =Convert.ToInt32(dv[0]["FSTARTCELL"]); + stackCoo[2] = 0; + + stackCoo[3] = 0; + stackCoo[4] = 0; + stackCoo[5] = 0; + } + else + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromManage时没能从调度任务获得AGV坐标!"; + return null; + } + break; + + case 2://出库:取坐标在路径上一个设备取;送坐标:机台站台 + sql.Remove(0, sql.Length); + sql .Append( "SELECT FENDCELL,FENDDEVICE FROM T_Manage_Task WHERE (FID = " ).Append( ManFID ).Append( ") AND (F_ManageTaskKindIndex = " ).Append( Mankind ).Append( ")"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + stackCoo[0] = 0; + stackCoo[1] = 0; + stackCoo[2] = 0; + + stackCoo[3] = 0; + stackCoo[4] = Convert.ToInt32(dv[0]["FENDCELL"]); + stackCoo[5] = 0; + } + else + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromManage时没能从调度任务获得AGV坐标!"; + return null; + } + break; + + default: + break; + case 3://移库,取坐标:机台站台;送坐标:路径下一个设备 + sql.Remove(0, sql.Length); + sql .Append( "SELECT FSTARTCELL,FSTARTDEVICE,FENDCELL,FENDDEVICE FROM T_Manage_Task WHERE (FID = " ).Append( ManFID ).Append( ") AND (F_ManageTaskKindIndex = " ).Append( Mankind ).Append( ")"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + stackCoo[0] = 0; int a = 0; + if (int.TryParse(dv[0]["FSTARTCELL"].ToString(),out a)==true) + { + stackCoo[1] = Convert.ToInt32(dv[0]["FSTARTCELL"]); + } + else + { + stackCoo[1] = 0; + } + stackCoo[2] = 0; + + stackCoo[3] = 0; + if(int.TryParse (dv[0]["FENDCELL"].ToString(),out a)==true) + { + stackCoo[4] = Convert.ToInt32(dv[0]["FENDCELL"]); + } + else + { + stackCoo[4] = 0; + } + stackCoo[5] = 0; + } + else + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromManage时没能从调度任务获得AGV坐标!"; + return null; + } + break; + } + + + return stackCoo; + } + catch (Exception ex) + { + DisassembleTaskError = string.Format( "ControlSystem.CDisassembleTask.GetAGVAddressFromManage:{0}" , ex.StackTrace+ex.Message ); + return null; + } + finally + { + stackCoo = null; + + cc = null ; + split =null ; + dv.Dispose() ; + } + + } + /// + /// 20101219根据是否是在AGV通道取货,判断坐标 + /// + /// + /// + /// + /// + static int[] GetAGVAddressFromManage(int Mankind, int ManFID,bool IfGetGoods) + { + int[] stackCoo = new int[6] { 0, 0, 0, 0, 0, 0 };//取排-列-层(Z-X-Y);送排-列-层(Z-X-Y) + + char[] cc = new char[1] { '-' }; + string[] split = new string[3]; + DataView dv = new DataView(); + try + { + switch (IfGetGoods) + { + case true://在AGV通道取货,取坐标:机台站台;送坐标:路径下一个设备 + sql.Remove(0, sql.Length); + sql .Append( "SELECT FSTARTCELL,FSTARTDEVICE,FENDDEVICE FROM T_Manage_Task WHERE (FID = " ).Append( ManFID ).Append( ") AND (F_ManageTaskKindIndex = " ).Append( Mankind ).Append( ")"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + stackCoo[0] = 0; + stackCoo[1] =Convert.ToInt32(dv[0]["FSTARTCELL"]); + stackCoo[2] = 0; + + stackCoo[3] = 0; + stackCoo[4] = 0; + stackCoo[5] = 0; + } + else + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromManage时没能从调度任务获得AGV坐标!"; + return null; + } + break; + + case false://向AGV通道送货:取坐标在路径上一个设备取;送坐标:机台站台 + sql.Remove(0, sql.Length); + sql .Append( "SELECT FENDCELL,FENDDEVICE FROM T_Manage_Task WHERE (FID = " ).Append( ManFID ).Append( ") AND (F_ManageTaskKindIndex = " ).Append( Mankind ).Append( ")"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + stackCoo[0] = 0; + stackCoo[1] = 0; + stackCoo[2] = 0; + + stackCoo[3] = 0; + stackCoo[4] = Convert.ToInt32(dv[0]["FENDCELL"]); + stackCoo[5] = 0; + } + else + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromManage时没能从调度任务获得AGV坐标!"; + return null; + } + break; + + default: + break; + + } + + + return stackCoo; + } + catch (Exception ex) + { + DisassembleTaskError = string.Format( "ControlSystem.CDisassembleTask.GetAGVAddressFromManage:{0}" ,ex.StackTrace+ex.Message ); + return null; + } + finally + { + stackCoo = null; + + cc = null ; + split =null ; + dv.Dispose(); + } + + } + /// + /// 在表T_Base_AGV_Gate获得AGV地址 + /// + /// AGV地址对应的设备索引 + /// + static int GetAGVAddressFromAgvGate(int devindex) + { + DataView dv = new DataView(); + try + { + sql.Remove(0, sql.Length); + sql.Append("select F_Address from T_Base_AGV_Gate where F_AGVGateDeviceIndex=" ).Append( devindex); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + return Convert.ToInt32(dv[0]["F_Address"]); + } + else + { + return -1; + } + } + catch (Exception ex) + { + DisassembleTaskError = string.Format( "ControlSystem.CDisassembleTask.GetAGVAddressFromAgvGate:{0}" ,ex.StackTrace+ex.Message ); + return -1; + } + finally + { + dv.Dispose(); + } + } + /// + /// 获得堆垛机坐标取排-列-层(Z-X-Y);送排-列-层(Z-X-Y) + /// + /// 调度任务类型 + /// 调度任务索引 + /// 搬运任务类型:1,入库(送坐标);2:出库(取坐标);3:移库(取和送坐标) + /// + static int[] GetStackCoordinateFromManage(int Mankind, int ManFID,DataRowView drv) + { + int[] stackCoo = new int[6] { 0, 0, 0, 0, 0, 0 };//取排-列-层(Z-X-Y);送排-列-层(Z-X-Y) + char[] cc = new char[1] {'-' }; + string[] split = new string[3]; + DataView dv = new DataView(); + try + { + sql.Remove(0, sql.Length); + switch (Convert.ToInt32(drv["FCONTROLTASKTYPE"])) + { + case 1://入库,送坐标 + sql .Append( "SELECT FENDCELL FROM T_Manage_Task WHERE (FID = " ).Append( ManFID ).Append( ") AND (F_ManageTaskKindIndex = " ).Append( Mankind ).Append( ")"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + split = dv[0]["FENDCELL"].ToString().Split(cc); + stackCoo[3] = Convert.ToInt32(split[0]); + stackCoo[4] = Convert.ToInt32(split[1]); + stackCoo[5] = Convert.ToInt32(split[2]); + } + else + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromManage时没能从调度任务获得堆垛机坐标!"; + return null; + } + break; + + case 2://出库,取坐标 + sql.Append( "SELECT FSTARTCELL FROM T_Manage_Task WHERE (FID = " ).Append( ManFID ).Append( ") AND (F_ManageTaskKindIndex = " ).Append( Mankind ).Append( ")"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + split = dv[0]["FSTARTCELL"].ToString().Split(cc); + stackCoo[0] = Convert.ToInt32(split[0]); + stackCoo[1] = Convert.ToInt32(split[1]); + stackCoo[2] = Convert.ToInt32(split[2]); + } + else + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromManage时没能从调度任务获得堆垛机坐标!"; + return null; + } + break; + case 3: + sql .Append( "SELECT FSTARTCELL,FENDCELL FROM T_Manage_Task WHERE (FID = " ).Append( ManFID ).Append( ") AND (F_ManageTaskKindIndex = " ).Append( Mankind ).Append( ")"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + if (dv[0]["FSTARTCELL"].ToString() != "-") + { + split = dv[0]["FSTARTCELL"].ToString().Split(cc); + stackCoo[0] = Convert.ToInt32(split[0]); + stackCoo[1] = Convert.ToInt32(split[1]); + stackCoo[2] = Convert.ToInt32(split[2]); + } + if (dv[0]["FENDCELL"].ToString() != "-") + { + split = dv[0]["FENDCELL"].ToString().Split(cc); + stackCoo[3] = Convert.ToInt32(split[0]); + stackCoo[4] = Convert.ToInt32(split[1]); + stackCoo[5] = Convert.ToInt32(split[2]); + } + } + else + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromManage时没能从调度任务获得堆垛机坐标!"; + return null; + } + break; + default: + break; + } + return stackCoo; + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromManage调度任务的坐标有误!"+ex.StackTrace+ex.Message ; + return null; + } + + finally{ + stackCoo = null; + + cc = null ; + split=null ; + dv.Dispose() ; + + } + } + /// + /// 20101219根据是否在巷道取货,判断坐标 + /// + /// + /// + /// + /// + static int[] GetStackCoordinateFromManage(int Mankind, int ManFID,bool IfGetGoods) + { + int[] stackCoo = new int[6] { 0, 0, 0, 0, 0, 0 };//取排-列-层(Z-X-Y);送排-列-层(Z-X-Y) + char[] cc = new char[1] { '-' }; + string[] split = new string[3]; + DataView dv = new DataView(); + try + { + sql.Remove(0, sql.Length); + switch (IfGetGoods) + { + case false://向巷道送货,送坐标 + sql.Append("SELECT FENDCELL FROM T_Manage_Task WHERE (FID = ").Append(ManFID).Append(") AND (F_ManageTaskKindIndex = ").Append(Mankind).Append(")"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + split = dv[0]["FENDCELL"].ToString().Split(cc); + stackCoo[3] = Convert.ToInt32(split[0]); + stackCoo[4] = Convert.ToInt32(split[1]); + stackCoo[5] = Convert.ToInt32(split[2]); + } + else + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromManage时没能从调度任务获得堆垛机坐标!"; + return null; + } + break; + + case true://在巷道取货,取坐标 + sql.Append("SELECT FSTARTCELL FROM T_Manage_Task WHERE (FID = ").Append(ManFID).Append(") AND (F_ManageTaskKindIndex = ").Append(Mankind).Append(")"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + split = dv[0]["FSTARTCELL"].ToString().Split(cc); + stackCoo[0] = Convert.ToInt32(split[0]); + stackCoo[1] = Convert.ToInt32(split[1]); + stackCoo[2] = Convert.ToInt32(split[2]); + } + else + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromManage时没能从调度任务获得堆垛机坐标!"; + return null; + } + break; + + default: + break; + } + return stackCoo; + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromManage调度任务的坐标有误!" +ex.StackTrace+ ex.Message; + return null; + } + + finally + { + stackCoo = null; + + cc = null; + split = null; + dv.Dispose(); + + } + } + /// + /// 获得巷道的出入口处设备对应的堆垛机坐标取排-列-层(Z-X-Y);送排-列-层(Z-X-Y) + /// + /// 设备索引 + /// 是否取货 + /// + static int[] GetStackCoordinateFromLaneGate(int stackIndex,int devIndex,bool ifGet) + { + char[] cc = new char[1] { '-' };//20100305 + string[] split; + int[] rt = new int[6] { 0,0,0,0,0,0}; + DataView dv = new DataView(); + int LaneWay = ccf.GetLaneWayFromLaneInfo(stackIndex); + + try + { + sql.Remove(0, sql.Length); + #region 注释 by lyj 20171117 + // sql.Append("select * from T_Base_Lane_Gate where F_LaneGateDeviceIndex=" ).Append( devIndex ).Append( " and F_LaneIndex=").Append(LaneWay); + #endregion + sql.Append("select * from T_Base_Lane_Gate where F_LaneGateDeviceIndex=").Append(devIndex); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + if (ifGet == true)//取坐标 + { + //20100305 + split = dv[0]["F_ZXY"].ToString().Split(cc); + + rt[0] = Convert.ToInt32(split[0]);//排Z + rt[1] = Convert.ToInt32(split[1]);//列X + rt[2] = Convert.ToInt32(split[2]);//层Y + //20100305 + } + else//送坐标 + { + //20100305 + split = dv[0]["F_ZXY"].ToString().Split(cc); + + rt[3] = Convert.ToInt32(split[0]);//排Z + rt[4] = Convert.ToInt32(split[1]);//列X + rt[5] = Convert.ToInt32(split[2]);//层Y + //20100305 + } + + } + return rt; + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetStackCoordinateFromLaneGate:" +ex.StackTrace+ ex.Message; + return null; + } + finally + { + cc =null ; + split=null ; + rt =null ; + dv.Dispose() ; + } + } + /// + /// 获得设备的入库口探物光电的设备索引值 + /// + /// 设备索引 + /// + /// 20101118 + static string GetBindingDeviceIndex(int devinx) + { + + try + { + devinfo = Model.CGetInfo.GetDeviceInfo(devinx); + + if (devinfo.BindingDevice == null) return ""; + return devinfo.BindingDevice; + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetBindingDeviceIndex:" +ex.StackTrace+ ex.Message; + return ""; + } + finally + { + devinfo = null; + } + + } + /// + /// 获得输送机设备的出库口探物光电的设备索引值 + /// + /// 设备索引 + /// + /// 20101118 + static string GetBindingDeviceIndexOut(int devinx) + { + + try + { + devinfo = Model.CGetInfo.GetDeviceInfo(devinx); + if (devinfo.BindingDeviceOut == null)return ""; + return devinfo.BindingDeviceOut; + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetBindingDeviceIndexOut:" +ex.StackTrace+ ex.Message; + return ""; + } + finally + { + devinfo = null; + } + + } + /// + ///被临近设备运行前检测的光电信号对应的设备索引组(故障,正转,反转,上升,下降等), + /// 索引之间使用分号“;”隔开,索引前面加负号“-”表示需要检测值为“1”的信号 + /// + /// 设备索引 + /// + static string GetBeDetectedDevices(int devinx) + { + + try + { + devinfo = Model.CGetInfo.GetDeviceInfo(devinx); + return devinfo.BeDetected; + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetBeDetectedDevices:" +ex.StackTrace+ ex.Message; + return null ; + } + finally + { + devinfo = null; + } + + } + /// + /// 获取输送机执行送出命令时,需要提前检测的光电开关设备索引 + /// + /// 设备索引 + /// + /// 20101118 + static string GetSendOutDetect(int devinx) + { + + try + { + devinfo = Model.CGetInfo.GetDeviceInfo(devinx); + if (devinfo.SendOutDetect == null)return ""; + return devinfo.SendOutDetect; + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetSendOutDetect:" +ex.StackTrace+ ex.Message; + return ""; + } + finally + { + devinfo = null; + } + + } + + + /// + /// 获取设备是否逻辑有货 + /// + /// 设备索引 + /// + static string GetIfHaveGoods(int devinx) + { + + + DataView db = new DataView(); + try + { + sql.Remove(0, sql.Length); + sql .Append( "SELECT F_HaveGoods FROM T_Base_Device WHERE (F_DeviceIndex = " ).Append( devinx ).Append( ") and F_HaveGoods is not null"); + db = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (db.Count > 0) + { + return db[0]["F_HaveGoods"].ToString(); + } + else + return ""; + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetIfHaveGoods:" +ex.StackTrace+ ex.Message; + return ""; + } + + finally + { + db.Dispose(); + + } + } + /// + /// + /// + /// RGV地址的设备索引号 + /// 是否是接货 + /// + static int GetRGVOrder(int devidx,bool IfGet) + {//(2-左接货3-左送货)或者(4-右接货5-右送货) + int order = 0; + DataView dv = new DataView(); + try + { + sql.Remove(0, sql.Length); + sql.Append("SELECT F_IFChannelLeft, F_RGVGateDeviceIndex" ).Append( + " FROM T_Base_RGV_Gate WHERE (F_RGVGateDeviceIndex = " ).Append( devidx ).Append( ")"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + if (dv[0]["F_IFChannelLeft"].ToString() == "1") + { + if (IfGet == true) + { + order = 2; + } + else + { + order = 3; + } + } + else + { + if (IfGet == true) + { + order = 4; + } + else + { + order = 5; + } + } + } + return order; + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetRGVOrder:" +ex.StackTrace + ex.Message; + return 0; + } + finally + { + dv.Dispose(); + } + } + /// + /// 获得AGV的前一个设备信息 + /// 20090625 + /// + /// 路径子编号 + /// AGV设备的路径序号 + /// + static List GetAGVPriorDevice(int CurRouteIDSub, int CurSerialNumber) + { + DataView dvRoute = new DataView(); + List Device = new List(); + try + { + sql.Remove(0, sql.Length); + sql .Append( "SELECT T_Base_Route_Device.F_DeviceIndex,F_DeviceOrder, T_Base_Route_Device.F_SerialNumber, " ).Append( + "T_Base_Device_Command.F_DeviceCommandIndex,T_Base_Device.F_DeviceKindIndex FROM T_Base_Device_Kind,T_Base_Device_Command " ).Append( + ",T_Base_Device,T_Base_Route_Device where T_Base_Device_Command.F_DeviceKindIndex = T_Base_Device.F_DeviceKindIndex" ).Append( + " and T_Base_Device_Kind.F_DeviceKindIndex = T_Base_Device_Command.F_DeviceKindIndex and T_Base_Device.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex and F_RouteIDSub=" ).Append( + CurRouteIDSub ).Append( " and F_SerialNumber < " ).Append( CurSerialNumber ).Append( " and F_GoodsMoveKindIndex=1 order by F_SerialNumber desc "); + dvRoute = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvRoute.Count > 0) + { + Device.Add(Convert.ToInt32(dvRoute[0]["F_DeviceIndex"])); + Device.Add(Convert.ToInt32(dvRoute[0]["F_DeviceKindIndex"])); + Device.Add(Convert.ToInt32(dvRoute[0]["F_SerialNumber"])); + Device.Add(Convert.ToInt32(dvRoute[0]["F_DeviceOrder"])); + } + return Device; + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.GetAGVPriorDevice:" +ex.StackTrace+ ex.Message; + return null; + } + finally + { + Device=null ; + dvRoute.Dispose(); + } + + } + /// + /// 判断调度表T_Monitor_Task是否存在调度任务的设备和命令 + /// + /// 调度任务类型 + /// 调度任务索引 + /// 设备所引 + /// 设备命令 + /// + public static bool DeviceAndOrderExitInMonitor(int Mankind, int ManFID, int DeviceIndex,int Order,int ArrowAddress) + { + DataView dv = new DataView(); + try + { + if (Order == -1) return true; + sql.Remove(0, sql.Length); + switch (ccf.GetDeviceKindIdx(DeviceIndex)) + { + case 1://堆垛机 + sql .Append( "SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = " ).Append( ManFID ).Append( ")" ).Append( + " AND (F_ManageTASKKINDINDEX = " ).Append( Mankind ).Append( ") AND (F_DeviceIndex = " ).Append( DeviceIndex ).Append( ")" ).Append( + " AND (F_DeviceCommandIndex = " ).Append( Order ).Append( ")"); + break; + case 2://输送机 + sql .Append( "SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = " ).Append( ManFID ).Append( ")" ).Append( + " AND (F_ManageTASKKINDINDEX = " ).Append( Mankind ).Append( ") AND (F_DeviceIndex = " ).Append( DeviceIndex ).Append( ")" ).Append( + " AND (F_DeviceCommandIndex = " ).Append( Order ).Append( ")"); + break; + case 4://RGV + sql .Append( "SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = " ).Append( ManFID ).Append( ")" ).Append( + " AND (F_ManageTASKKINDINDEX = " ).Append( Mankind ).Append( ") AND (F_DeviceIndex = " ).Append( DeviceIndex ).Append( ")" ).Append( + " AND (F_DeviceCommandIndex = " ).Append( Order ).Append( ") and F_NumParam1=" ).Append( ArrowAddress ); + break; + case 6://AGV + sql .Append("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = " ).Append( ManFID ).Append( ")" ).Append( + " AND (F_ManageTASKKINDINDEX = " ).Append( Mankind ).Append( ") AND (F_DeviceIndex = " ).Append( DeviceIndex ).Append( ")" ).Append( + " AND (F_DeviceCommandIndex = " ).Append( Order ).Append( ")"); + break; + default: + sql .Append( "SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = " ).Append( ManFID ).Append( ")" ).Append( + " AND (F_ManageTASKKINDINDEX = " ).Append( Mankind ).Append( ") AND (F_DeviceIndex = " ).Append( DeviceIndex ).Append( ")" ).Append( + " AND (F_DeviceCommandIndex = " ).Append( Order ).Append( ")"); + break; + } + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + return true; + } + else + { + return false; + } + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.DeviceAndOrderExitInMonitor:" +ex.StackTrace+ ex.Message; + return false; + } + finally + { + dv.Dispose(); + + } + } + /// + /// 找到不能移动托盘的关键设备的前一个设备:例如,条码扫描器前一个位置(运动反方向)的输送机 + /// + /// 关键设备的前一个设备 + /// 关键设备 + /// + static List NewCurDevice(List prirorDevice, List prirorKeydevice) + {//0设备所引;1设备类型;2:路径序号;3:设备命令 + DataView dv = new DataView(); + try + { + if ((prirorKeydevice.Count > 0) && (prirorDevice.Count > 0)) + { + sql.Remove(0, sql.Length); + sql.Append("SELECT F_GoodsMoveKindIndex, F_DeviceKindIndex FROM T_Base_Device_Kind WHERE " ).Append( + "(F_DeviceKindIndex = " ).Append( prirorKeydevice[1] ).Append( ") and (F_GoodsMoveKindIndex=2)"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + if (Model.CGetInfo.GetDeviceInfo(prirorDevice[0]).UnControl != "1") + { + return prirorDevice; + } + else + { + return null; + } + } + else + { + return null; + } + } + else + { + return null; + } + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.NewCurDevice:" +ex.StackTrace+ ex.Message; + return null; + } + finally + { + prirorDevice=null; + prirorKeydevice=null; + dv.Dispose(); + } + } + /// + /// 获取可用的目标位置:入库的巷道或者出库站台;同时修改调度任务为不可拆分状态 + /// + /// T_Manage_Task表的行记录 + /// + public static void GetUsableDestination(DataRowView dr) + { + DataView dvIO = new DataView(); DataTable dtd = new DataTable(); + try + { + dr = dbo.ExceSQL(string.Format("SELECT * FROM T_Manage_Task WHERE (FID = {0}) AND (F_ManageTaskKindIndex = {1})", Convert.ToInt32(dr["FID"]), Convert.ToInt32(dr["F_ManageTaskKindIndex"]))).Tables[0].DefaultView[0];//20130620 + + //只修申请改调度任务的路径,不修改调度自动任务路径 + if (dr["F_ManageTaskKindIndex"].ToString() != "1") return; + + + string adviceDev = string.Empty; + //20100610查找一个路径可用,任务数最少的终点设备 + Dictionary advDev = new Dictionary(); + object ob; + + //20091107 + sql.Remove(0, sql.Length); + sql.Append("select CONTROL_ID, CONTROL_STATUS from IO_Control where (CONTROL_ID = ").Append(Convert.ToInt32(dr["FID"])).Append(") AND ((CONTROL_STATUS=").Append(Model.CGeneralFunction.TASKALTERROUTEAPPLY).Append(") or (CONTROL_STATUS=").Append(Model.CGeneralFunction.TASKALTERROUTEREPLY).Append("))"); + dvIO = dboM.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvIO.Count <= 0) + { + sql.Remove(0, sql.Length); + sql.Append("SELECT F_TASKKIND, F_DESTINATION FROM T_Base_Destination WHERE (F_Warehouse='").Append(dr["FENDWAREHOUSE"]).Append("') and (F_TASKKIND = ").Append(dr["FCONTROLTASKTYPE"]).Append(") and (F_AbendStation=1) and (F_DESTINATION=").Append(dr["FENDDEVICE"]).Append(")"); + dtd = dbo.ExceSQL(sql.ToString()).Tables[0]; + if (dtd.Rows.Count > 0)//原来终点是应急站台那么还分配这个站台,不需要改变 + { + adviceDev = dtd.Rows[0]["F_DESTINATION"].ToString(); + //20091005 + return; + } + else + { + //查找可用目标位置 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_TASKKIND, F_DESTINATION FROM T_Base_Destination WHERE (F_Warehouse='").Append(dr["FENDWAREHOUSE"]).Append("') and (F_TASKKIND = ").Append(dr["FCONTROLTASKTYPE"]).Append(") and (F_DESTINATION <>").Append(dr["FENDDEVICE"]).Append(") and (F_AbendStation=0)"); + DataTable dt = dbo.ExceSQL(sql.ToString()).Tables[0]; + if (dt.Rows.Count > 0) + { + for (int i = 0; i < dt.Rows.Count; i++) + { + if (CDisassembleTask.MinRouteID(Convert.ToInt32(dr["FSTARTDEVICE"]), Convert.ToInt32(dt.Rows[i]["F_DESTINATION"]), dr["FUseAwayFork"]) != -1) + { + //20100610统计到终点设备正在执行的任务数 + sql.Remove(0, sql.Length); + sql.Append("SELECT count(FENDDEVICE) as counts FROM T_Manage_Task where FENDDEVICE='").Append(dt.Rows[i]["F_DESTINATION"]).Append("' and fstatus>0"); + ob = dbo.GetSingle(sql.ToString()); + advDev.Add(Convert.ToInt32(dt.Rows[i]["F_DESTINATION"]), Convert.ToInt32(ob)); + + //20100610 adviceDev = dt.Rows[i]["F_DESTINATION"].ToString(); + //break; + } + } + if (advDev.Count == 0)//20100610 + { + + return; + + + } + else + {//20100610 + int mincount = 9999; + foreach (int aaa in advDev.Keys) + { + if (advDev[aaa] < mincount) + { + mincount = advDev[aaa]; + adviceDev = aaa.ToString(); + } + } + if (adviceDev == "") + { + + return; + + } + } + } + else + { + return; + } + } + + + //DataView DV = dboM.ExceSQL("select IO_CONTROL_APPLY_SEQ.NEXTVAL FROM DUAL").Tables[0].DefaultView; + //20101108int fid = dboM.GetManageTableIndex("IO_CONTROL_APPLY"); + string dtime = DateTime.Now.ToString("u"); + dtime = dtime.Substring(0, dtime.Length - 1); + //20091128 + dboM.TransBegin(); + try + { + sql.Remove(0, sql.Length); + sql.Append(" update IO_CONTROL set CONTROL_STATUS=").Append(Model.CGeneralFunction.TASKALTERROUTEAPPLY).Append(" where CONTROL_ID=").Append(dr["FID"]); + dboM.ExceSQL(sql.ToString()); + //向管理申请修改任务// + int appid = dboM.GetManageTableIndex("IO_CONTROL_APPLY", true);//CONTROL_APPLY_ID + + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO IO_CONTROL_APPLY (CONTROL_APPLY_ID, CONTROL_ID,CONTROL_APPLY_TYPE,WAREHOUSE_CODE, STOCK_BARCODE, DEVICE_CODE, APPLY_TASK_STATUS, CREATE_TIME, ").Append( + " CONTROL_APPLY_REMARK)").Append( + "VALUES (").Append(appid).Append(",").Append(dr["FID"] + ",2,'" + dr["FENDWAREHOUSE"]).Append("','").Append(dr["FPALLETBARCODE"]).Append("','").Append(adviceDev).Append("',0,'").Append(dtime).Append("',null)"); + dboM.ExceSQL(sql.ToString()); + dboM.TransCommit(); + //修改调度任务为不可拆分状态 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='-' where (FID = ").Append(Convert.ToInt32(dr["FID"])).Append(") AND (F_ManageTASKKINDINDEX =1)"); + dbo.ExceSQL(sql.ToString()); + CommonClassLib.CCarryConvert.WriteDarkCasket("CControl.GetUsableDestination", "拆分任务,向管理申请改道", "管理任务:" + dr["FID"].ToString(), "条码:" + dr["FPALLETBARCODE"].ToString().ToUpper()); + + + } + catch (Exception ex) + { + DisassembleTaskError = string.Format("拆分任务,向管理申请改道时:{0}", ex.StackTrace+ex.Message ); + dboM.TransRollback(); + } + } + } + catch (Exception ex) + { + throw ex; + } + finally + { + dvIO.Dispose(); + dtd.Dispose(); + } + + } + + public static void CreateRelativeMonitor(int manKind, int FID) + {//20120906 + + //if (DoubleForkSingleCell(manKind, FID) == true) return; + int relativeFID = -1; + DataView dv=new DataView() ; DataView dvs=new DataView() ; + try + { + sql.Remove(0, sql.Length); + sql.Append("SELECT F_RELATIVECONTORLID FROM T_Manage_Task WHERE (FID = " ).Append( FID ).Append( ") AND (F_ManageTaskKindIndex = " ).Append( manKind ).Append( ") and (F_RELATIVECONTORLID<>-1)"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + relativeFID = Convert.ToInt32(dv[0]["F_RELATIVECONTORLID"]); + } + else + { + return ; + + } + //多叉关联调度任务在此拆分20100323 + //获取多叉关联任务的路径和任务信息,递归调用CreateMonitor + + + if (relativeFID != -1) + { + sql.Remove(0, sql.Length); + sql.Append("SELECT T_Manage_Task.* FROM T_Manage_Task WHERE (F_RELATIVECONTORLID = ").Append(relativeFID).Append(") AND (F_ManageTaskKindIndex = ").Append(manKind).Append(") and (FIntoStepOK=0)"); + dvs = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + for (int j = 0; j < dvs.Count;j++ ) + { + int minrid = MinRouteID(Convert.ToInt32(dvs[j]["FSTARTDEVICE"]), Convert.ToInt32(dvs[j]["FENDDEVICE"]), dvs[j]["FUseAwayFork"]); + if (minrid != -1) + { + if (CreateMonitor(manKind, Convert.ToInt32(dvs[j]["FID"]), minrid, dvs[j], 0) > 0) + { + //分解完成,修改T_Manage_Task表FIntoStepOK=1 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='1' where FID=").Append(dvs[j]["FID"] + ).Append(" and F_ManageTaskKindIndex=").Append(dvs[0]["F_ManageTaskKindIndex"]); + dbo.ExceSQL(sql.ToString()); + CDataChangeEventArgs cea = new CDataChangeEventArgs(null, null); + OnDataChange("CreateRelativeMonitor", cea); + } + } + } + } + + } + catch (Exception ex) + { + DisassembleTaskError = "CreateRelativeMonitor,"+ex.StackTrace+ex.Message ; + } + finally + { + dv.Dispose(); + dvs.Dispose(); + } + } + /// + /// 找到一个双叉最合适货位,修改关联关系 + /// + /// + public static void GetOutDoubleForkTask(DataRowView dr) + {//sqlser的 SUBSTRING(express1,1开始,2);C#的.Substring(0开始, 2) + DataView dv = new DataView(); + try + { + //20170104 出库任务数量限制,不能关联出库任务 + if (ccf.GetTaskCountsCanDisassembleToEndDevice(Convert.ToInt32(dr["FID"]), Convert.ToInt32(dr["FENDDEVICE"])) == false) return; + dr = dbo.ExceSQL(string.Format("SELECT * FROM T_Manage_Task WHERE (FID = {0}) AND (F_ManageTaskKindIndex = {1})", Convert.ToInt32(dr["FID"]), Convert.ToInt32(dr["F_ManageTaskKindIndex"]))).Tables[0].DefaultView[0];//20130620 + + if (dr["F_RELATIVECONTORLID"].ToString() != "-1") return; + + + int forwlimitX = 0, backlimitX = 0; + sql.Remove(0, sql.Length); + sql.Append("SELECT F_ForwardLimitX, F_BackLimitX FROM T_Base_LaneInfo WHERE (F_LaneDeviceIndex = ").Append(dr["FLANEWAY"]).Append(")"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + forwlimitX = Convert.ToInt32(dv[0]["F_ForwardLimitX"]); + backlimitX = Convert.ToInt32(dv[0]["F_BackLimitX"]); + } + else + return; + int forkamount = 1; + sql.Clear(); + sql.Append("SELECT F_ForkAmount FROM T_Base_StackInfo WHERE F_StackIndex = ").Append(Convert.ToInt32(dr["FSTACK"])); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + forkamount = Convert.ToInt32(dv[0]["F_ForkAmount"])-1; + } + else + return; + StringBuilder sqladd = new StringBuilder(" "); + if (forwlimitX.ToString() == dr["FStartCol"].ToString()) + { + sqladd.Append(" and FStartCol <>").Append(forwlimitX).Append(" "); + } + else if (backlimitX.ToString() == dr["FStartCol"].ToString()) + { + sqladd.Append(" and FStartCol <>").Append(backlimitX).Append(" "); + } + else + { + sqladd.Append(" "); + } + //列的速度是层的速度的3倍,所以层的差值要乘以三(提升一层的时间相当于移动三列的时间) + sql.Remove(0, sql.Length); + if (CStaticClass.DBFactory == "OracleDBFactory") + {//20151120调度系统oracle的特殊语句 + sql.Append("SELECT ").Append(" F_ManageTaskKindIndex, FID, MIN(POWER(FStartCol - ").Append(dr["FStartCol"]).Append(", 2) + POWER((FStartLayer - ").Append( + dr["FStartLayer"]).Append(") * 3, 2)) AS Expr1 FROM T_Manage_Task WHERE (FIntoStepOK = '0') AND rownum<=").Append(forkamount).Append( + " and (FSTATUS = 0 and FUseAwayFork<>'3') AND (FCONTROLTASKTYPE = ").Append(dr["FCONTROLTASKTYPE"]).Append(") AND (FLOGIC_AREA = '").Append(dr["FLOGIC_AREA"]).Append( + "') AND (FCONTORL_BATCH = '").Append(dr["FCONTORL_BATCH"]).Append("') AND (FLANEWAY = ").Append(dr["FLANEWAY"]).Append( + ") AND (F_RELATIVECONTORLID = - 1) and F_ManageTaskKindIndex=").Append(dr["F_ManageTaskKindIndex"]).Append(" and FID<>").Append(dr["fid"]).Append( + sqladd.ToString()).Append(" GROUP BY F_ManageTaskKindIndex, FID order by Expr1 asc"); + } + else + {//20151120调度系统SQLServer的特殊语句 + sql.Append("SELECT TOP ").Append(forkamount).Append(" F_ManageTaskKindIndex, FID, MIN(POWER(FStartCol - ").Append(dr["FStartCol"]).Append(", 2) + POWER((FStartLayer - ").Append( + dr["FStartLayer"]).Append(") * 3, 2)) AS Expr1 FROM T_Manage_Task WHERE (FIntoStepOK = '0') AND ").Append( + "(FSTATUS = 0 and FUseAwayFork<>'3') AND (FCONTROLTASKTYPE = ").Append(dr["FCONTROLTASKTYPE"]).Append(") AND (FLOGIC_AREA = '").Append(dr["FLOGIC_AREA"]).Append( + "') AND (FCONTORL_BATCH = '").Append(dr["FCONTORL_BATCH"]).Append("') AND (FLANEWAY = ").Append(dr["FLANEWAY"]).Append( + ") AND (F_RELATIVECONTORLID = - 1) and F_ManageTaskKindIndex=").Append(dr["F_ManageTaskKindIndex"]).Append(" and FID<>").Append(dr["fid"]).Append( + sqladd.ToString()).Append(" GROUP BY F_ManageTaskKindIndex, FID order by Expr1 asc"); + } + + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + for (int i = 0; i < dv.Count; i++) + { + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set F_RELATIVECONTORLID=").Append(dr["fid"]).Append(" where FID=").Append(dv[i]["FID"]).Append(" and F_ManageTaskKindIndex=").Append(dr["F_ManageTaskKindIndex"]); + dbo.ExecuteSql(sql.ToString()); + + } + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set F_RELATIVECONTORLID=").Append(dr["fid"]).Append(" where FID=").Append(dr["fid"]).Append(" and F_ManageTaskKindIndex=").Append(dr["F_ManageTaskKindIndex"]); + dbo.ExecuteSql(sql.ToString()); + + } + catch (Exception ex) + { + throw ex; + } + finally + { + dv.Dispose(); + } + } + + /// + /// 20110412是否存在不同的逻辑区域未通过条码分道 + /// + /// 逻辑区域 + /// + public static bool IfExitElseAreaTask(int mankind,int FID) + { + DataView dv = new DataView(); + try + { + object ob = dbo.GetSingle(string.Format("select FLOGIC_AREA from T_Manage_Task where F_ManageTaskKindIndex={0} and FID={1} and FCONTROLTASKTYPE=2 and FLOGIC_AREA>'20000'", mankind, FID)); + if (ob != null) + { + sql.Remove(0, sql.Length); + sql.Append("SELECT F_NumParam4 FROM T_Manage_Task ,T_Monitor_Task where F_NumParam4=12030 and T_Manage_Task.F_ManageTaskKindIndex = T_Monitor_Task.F_ManageTASKKINDINDEX AND T_Manage_Task.FID = T_Monitor_Task.F_ManageTaskIndex and FCONTROLTASKTYPE=2 and T_Monitor_Task.F_ManageTaskKindIndex=1 and FLOGIC_AREA>'20000' and FLOGIC_AREA <>'").Append(ob.ToString()).Append("'");//and FSTATUS>020110412 + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + return true; + + } + else + { + return false; + } + } + else + { + return false; + } + } + catch (Exception ex) + { + DisassembleTaskError = string.Format("拆分任务时,判断是否存在同一逻辑区域且不同批号的出库任务:{0}", ex.StackTrace+ex.Message ); + return false; + } + finally + { + dv.Dispose(); + } + } + + static bool GetUAreaOutputDevice(int StackIndex,int UCode,out int OutputUdevice,out string OutputUZxy) + { + DataView dv = new DataView(); + OutputUdevice = 0; + OutputUZxy = "-"; + try + { + dv = dbo.ExceSQL(string.Format("SELECT DISTINCT F_OutputUDevice, F_OutputUZxy FROM T_Base_UArea,ST_CELL where T_Base_UArea.F_UCODE = ST_CELL.FUCODE and (T_Base_UArea.F_UCODE = {0}) AND (ST_CELL.FStack = {1})", UCode, StackIndex)).Tables[0].DefaultView; + if (dv.Count > 0) + { + OutputUdevice = Convert.ToInt32(dv[0]["F_OutputUDevice"]); + OutputUZxy = dv[0]["F_OutputUZxy"].ToString(); + } + return true; + } + catch (Exception ex) + { + DisassembleTaskError = string.Format("CDisassembleTask.GetUAreaOutputDevice错误:{0}", ex.StackTrace+ex.Message ); + return false; + } + finally + { + dv.Dispose(); + } + + } + static bool GetUAreaInputDevice(int StackIndex,int UCode, out int InputUdevice, out string InputUZxy) + { + DataView dv = new DataView(); + InputUdevice = 0; + InputUZxy = "-"; + try + { + dv = dbo.ExceSQL(string.Format("SELECT DISTINCT F_InputUDevice, F_InputUZxy FROM T_Base_UArea,ST_CELL where T_Base_UArea.F_UCODE = ST_CELL.FUCODE and (T_Base_UArea.F_UCODE = {0}) AND (ST_CELL.FStack = {1})", UCode, StackIndex)).Tables[0].DefaultView; + if (dv.Count > 0) + { + InputUdevice = Convert.ToInt32(dv[0]["F_InputUDevice"]); + InputUZxy = dv[0]["F_InputUZxy"].ToString(); + } + return true; + } + catch (Exception ex) + { + DisassembleTaskError = string.Format("CDisassembleTask.GetUAreaOutputDevice错误:{0}", ex.StackTrace+ex.Message ); + return false; + } + finally + { + dv.Dispose(); + } + + } + static bool DoubleForkSingleCell(int manKind,int FID) + { + DataView dv = new DataView(); + try + { + dv = dbo.ExceSQL(string.Format("SELECT T_Manage_Task.FID FROM T_Manage_Task ,ST_CELL WHERE T_Manage_Task.FSTARTWAREHOUSE = ST_CELL.FWAREHOUSE AND T_Manage_Task.FSTARTCELL = ST_CELL.FCELLCODE and ST_CELL.FDoubleFork = '3' AND T_Manage_Task.FID = {1} AND T_Manage_Task.F_ManageTaskKindIndex = {0}", manKind, FID)).Tables[0].DefaultView; + if (dv.Count > 0) + { + return true; + } + else + { + dv = dbo.ExceSQL(string.Format("SELECT T_Manage_Task.FID FROM T_Manage_Task ,ST_CELL WHERE T_Manage_Task.FENDWAREHOUSE = ST_CELL.FWAREHOUSE AND T_Manage_Task.FENDCELL = ST_CELL.FCELLCODE and ST_CELL.FDoubleFork = '3' AND T_Manage_Task.FID = {1} AND T_Manage_Task.F_ManageTaskKindIndex = {0}", manKind, FID)).Tables[0].DefaultView; + if (dv.Count > 0) + { + return true; + } + else + { + return false; + } + } + } + catch (Exception ex) + { + throw ex; + } + finally + { + dv.Dispose(); + } + } + static int GetBarcodeDeviceFromBindDevice(int barcodeBindDevice) + { + DataView ob = new DataView(); + try + { + ob = dbo.ExceSQL(string.Format("SELECT F_DeviceIndex FROM T_Base_PLC_Ask WHERE (F_BindingDevice = {0})", barcodeBindDevice)).Tables[0].DefaultView; + if (ob.Count > 0) + { + return Convert.ToInt32(ob[0][0]); + } + else + { + return 0; + } + } + catch (Exception ex) + { + throw ex; + } + finally + { + ob.Dispose(); + } + } + static int GetSameStartDeviceEnddeviceRouteID(int startdevice, int enddevice) + { + DataView dv=new DataView(); + try + { + sql.Remove(0, sql.Length); + sql.Append("SELECT distinct(T_Base_Route_Device.F_RouteIDSub) FROM T_Base_Device,T_Base_Route_Device,").Append( + "T_Base_Route where T_Base_Route_Device.F_RouteID = T_Base_Route.F_RouteID and ").Append( + " T_Base_Route_Device.F_DeviceIndex = T_Base_Device.F_DeviceIndex and ").Append( + " F_StartDevice=").Append(startdevice).Append(" and F_EndDevice=").Append(enddevice).Append(" and F_StartDevice=F_EndDevice and (F_StartDevice=30100 or F_StartDevice=30200 or F_StartDevice=40100)"); + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + if (dv.Count > 0) + { + return Convert.ToInt32(dv[0][0]); + } + else + { + return -1; + } + } + catch (Exception ex) + { + throw ex; + } + finally + { + dv.Dispose(); + } + } + + + + /// + /// 是否允许任务拆分 ,同一个站台有入库任务出库任务不拆分 20171106 by lyj add + /// + /// + /// + + + /* + * 方法名:isOrNotAllowDisaemble + * 作 者:LYJ + * 方法功能:是否允许任务拆分 ,同一个站台有入库任务出库任务不拆分 + * 参数介绍: + * 返 回 值:返回true表示拆分,false表示不拆分 + * 完成日期:2018/01/15 + * 维护人员: + * 维护日期: + * 维护原因: + * 当前版本:1.0 + * 前继版本:1.0beta + */ + public static bool isOrNotAllowDisaemble(DataRowView drv) + { + DataView dvoutin=new DataView();; + int tasktype = 0; + int startdevice = 0; + int enddevice = 0; + Model.MDevice devinfoion; + string intask = string.Empty; + string outtask = string.Empty; + try + { + tasktype = Convert.ToInt32(drv["FCONTROLTASKTYPE"]); + + startdevice = Convert.ToInt32(drv["FSTARTDEVICE"]); + + enddevice = Convert.ToInt32(drv["FENDDEVICE"]); + + #region add by lyj20180621穿梭板不控制出入库数量 + if (tasktype == 1) + { + if (enddevice == 18005) + { + return true; + } + + } + else if (tasktype == 2) + { + if (startdevice == 18005) + { + return true; + } + } + + #endregion + if (tasktype == 1) + { + + + outtask = "select * from T_Manage_Task where FCONTROLTASKTYPE=2 and FENDDEVICE =" + startdevice; + + sql.Remove(0, sql.Length); + + sql.Append(outtask); + + dvoutin = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + if (dvoutin.Count > 0) + { + return false; + } + + } + else if (tasktype == 2 ) + { + + + intask = "select * from T_Manage_Task where FCONTROLTASKTYPE=1 and FSTARTDEVICE =" + enddevice; + + //sql.Remove(0, sql.Length); + + sql.Append(intask); + + dvoutin = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + if (dvoutin.Count > 0) + { + return false; + } + devinfoion = Model.CGetInfo.GetDeviceInfo(enddevice); + + + if (devinfoion.SplitByte_0==1) + { + + return false; + } + + + + + } + #region 拣选任务的控制,每次只拆分一个拣选任务 20160303 add by lyj + //else if (tasktype == 2 && Convert.ToInt32(drv["FChooseTask"]) == 1) + //{ + + // #region update by lyj 20160525 站台占用拣选任务不拆分 + // checkStationStatus = "select * from T_Base_Device where F_StationStatus=1 and F_DeviceIndex=" + enddevice; + + // sql.Remove(0, sql.Length); + + // sql.Append(checkStationStatus); + + // dvoutin = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + // if (dvoutin.Count > 0) + // { + // return false; + // } + // #endregion + + // #region update by lyj 20160525 针对同一个站台每次有一个拣选任务拆分 + // choosetask = "select * from T_Manage_Task where FCONTROLTASKTYPE=2 and FChooseTask=1 and FIntoStepOK=1 and FENDDEVICE =" + enddevice; + + // sql.Remove(0, sql.Length); + + // sql.Append(choosetask); + + // dvoutin = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + // if (dvoutin.Count > 0) + // { + // return false; + // } + + // #endregion + + // #region add by lyj 20160525 有入库任务时拣选任务不拆分 + // if (startdevice < 18004) + // { + + // if (enddevice == 52107 || enddevice == 62101 || enddevice == 72101) + // { + // intask = "select * from T_Manage_Task where FCONTROLTASKTYPE=1 and FSTARTDEVICE in ('52107','62101','72101')"; + + // } + // else + // { + + // intask = "select * from T_Manage_Task where FCONTROLTASKTYPE=1 and FSTARTDEVICE =" + enddevice; + // } + + // } + // else + // { + // if (enddevice == 52008 || enddevice == 62001 || enddevice == 72001) + // { + // intask = "select * from T_Manage_Task where FCONTROLTASKTYPE=1 and FSTARTDEVICE in ('52008','62001','72001')"; + + // } + // else + // { + // intask = "select * from T_Manage_Task where FCONTROLTASKTYPE=1 and FSTARTDEVICE =" + enddevice; + // } + + // } + + // sql.Remove(0, sql.Length); + + // sql.Append(intask); + + // dvoutin = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + + // if (dvoutin.Count > 0) + // { + // return false; + // } + // #endregion + + // updateStationStatus = "update T_Base_Device set F_StationStatus=1 where F_DeviceIndex=" + enddevice; + + // sql.Remove(0, sql.Length); + + // sql.Append(updateStationStatus); + + // dbo.ExceSQL(sql.ToString()); + //} + #endregion + return true; + + } + catch (Exception eiad) + { + return false; + } + + } + + + + + /* + * 方法名:conveyorNumFromPosition + * 作 者:LYJ + * 方法功能:根据起始位置找到合适的输送机编号 + * 参数介绍: + * 返 回 值:输送机编号 + * 完成日期:2018/04/23 + * 维护人员: + * 维护日期: + * 维护原因: + * 当前版本:1.0 + * 前继版本:1.0beta + */ + public static int conveyorNumFromPosition(string FSTARTCELL, string FENDCELL, int startdevice, int enddevice,int tasktype) + { + + + string sy = "";//表示层 + int iy = 0;//表示层 + int deviceindex = 0; + DataView dvconveyor = new DataView(); ; + string sqlconveyor = string.Empty; + try + { + + if(tasktype==1&&(startdevice==18001||enddevice==18001)) + { + + if(FENDCELL!=null) + { + if (FENDCELL.Length == 8) + { + sy = FENDCELL.Substring(6); + if(sy!="") + { + iy = Convert.ToInt32(sy); + sqlconveyor = "select * from T_Base_conveyorNumFromPosition where FTASKTYPE=1 and F_Station ="+ startdevice + " and FLAYER=" + iy; + sql.Remove(0, sql.Length); + + sql.Append(sqlconveyor); + + dvconveyor = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvconveyor.Count>0) + { + deviceindex = Convert.ToInt32(dvconveyor[0]["FCONVEYORNUM"]); + } + + } + + } + } + + } + else if (tasktype == 2 && (startdevice == 18001 || enddevice == 18001)) + { + if (FSTARTCELL != null) + { + if (FSTARTCELL.Length == 8) + { + sy = FSTARTCELL.Substring(6); + if (sy != "") + { + iy = Convert.ToInt32(sy); + sqlconveyor = "select * from T_Base_conveyorNumFromPosition where FTASKTYPE=2 and F_Station =" + enddevice + " and FLAYER=" + iy; + sql.Remove(0, sql.Length); + + sql.Append(sqlconveyor); + + dvconveyor = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvconveyor.Count > 0) + { + deviceindex = Convert.ToInt32(dvconveyor[0]["FCONVEYORNUM"]); + } + + } + + } + } + } + + + + + + + + + + + return deviceindex; + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.MinRouteID时发生错误:" + ex.Message; + return 0; + } + + } + + + /// + /// 20100702 + /// 根据调度任务的起点和终点设备索引查找路径最短的RouteIDSub update by lyj20180423 + /// + /// 起点设备索引 + /// 终点设备索引 + /// 是否使用远货叉 + /// + // public static int MinRouteID(int startdevice, int enddevice, object useAwayfork) + public static int MinRouteID(int startdevice, int enddevice, object useAwayfork,string FSTARTCELL,string FENDCELL,int tasktype) + + { + //20101124 + DataView dv = new DataView(); DataView dvd = new DataView(); + DataView dv1 = new DataView(); DataView dv2 = new DataView(); + StringBuilder dff = new StringBuilder(); + if (useAwayfork.ToString() == "-") + { + dff.Append("F_UseAwayFork<>'n'"); + } + else + { + dff.Append("(F_UseAwayFork='").Append(useAwayfork).Append("' or F_UseAwayFork='-' )");//20101028 + } + #region 工位堆垛机的路径优选20120207 + //过桥输送机的选择是临近取货位优先 + //35000双顶升机的选择是小列(1排6列;2排26列)选择顶升机32038 + + //if (startdevice == 35000 && (enddevice == 32025 || enddevice == 10100 || enddevice == 10200 || enddevice == 10300)) + //{ + + // dff.Append(" and T_Base_Route_Device.F_DeviceIndex=32038"); + //} + //else + //{ + + //} + #endregion + //20101124 + try + { + int retrouteidsub = GetSameStartDeviceEnddeviceRouteID(startdevice, enddevice); + if (retrouteidsub > 0) + { + return retrouteidsub; + } + //选择最短调度路径并且判断此路径上是否有设备发生故障 + //20101124 + #region add by lyj20180424 找到与层匹配的输送机 + //if ((tasktype == 1 || tasktype == 2)&&(startdevice==18001||enddevice==18001)) + //{ + // int conveyorindex = conveyorNumFromPosition(FSTARTCELL, FENDCELL, startdevice, enddevice, tasktype); + + // sql.Remove(0, sql.Length); + // sql.Append("SELECT distinct(T_Base_Route_Device.F_RouteIDSub) FROM T_Base_Device,T_Base_Route_Device,").Append( + // "T_Base_Route where T_Base_Route_Device.F_RouteID = T_Base_Route.F_RouteID and ").Append( + // " T_Base_Route_Device.F_DeviceIndex = T_Base_Device.F_DeviceIndex and ").Append( + // " F_StartDevice=").Append(startdevice).Append(" and F_EndDevice=").Append(enddevice).Append(" and ").Append(dff.ToString()).Append(" and F_Status=1 and T_Base_Route_Device.F_DeviceIndex=").Append(conveyorindex);//and T_Base_Route_Device.F_DeviceIndex=12018 + //} + //else + //{ + // sql.Remove(0, sql.Length); + // sql.Append("SELECT distinct(T_Base_Route_Device.F_RouteIDSub) FROM T_Base_Device,T_Base_Route_Device,").Append( + // "T_Base_Route where T_Base_Route_Device.F_RouteID = T_Base_Route.F_RouteID and ").Append( + // " T_Base_Route_Device.F_DeviceIndex = T_Base_Device.F_DeviceIndex and ").Append( + // " F_StartDevice=").Append(startdevice).Append(" and F_EndDevice=").Append(enddevice).Append(" and ").Append(dff.ToString()).Append(" and F_Status=1 ");//and T_Base_Route_Device.F_DeviceIndex=12018 + //} + sql.Remove(0, sql.Length); + sql.Append("SELECT distinct(T_Base_Route_Device.F_RouteIDSub) FROM T_Base_Device,T_Base_Route_Device,").Append( + "T_Base_Route where T_Base_Route_Device.F_RouteID = T_Base_Route.F_RouteID and ").Append( + " T_Base_Route_Device.F_DeviceIndex = T_Base_Device.F_DeviceIndex and ").Append( + " F_StartDevice=").Append(startdevice).Append(" and F_EndDevice=").Append(enddevice).Append(" and ").Append(dff.ToString()).Append(" and F_Status=1 "); + #endregion + dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + List minroute = new List();//0,routIDSub;1,路径最小值 + if (dv.Count == 0) + { + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", "起点设备:" + startdevice + "和终点设备:" + enddevice + "之间路径不可用!"); + OnRefreshMonitor(rme); + return -1; + } + for (int i = 0; i < dv.Count; i++) + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_RouteIDSub,F_LockedState,T_Base_Device.F_DeviceIndex FROM T_Base_Device,T_Base_Route_Device WHERE ").Append( + " T_Base_Device.F_DeviceIndex = T_Base_Route_Device.F_DeviceIndex and (T_Base_Route_Device.F_RouteIDSub = ").Append( + dv[i]["F_RouteIDSub"]).Append(") AND (T_Base_Device.F_LockedState = - 1 or T_Base_Device.F_ErrorCode>=30)");//20121203 + dvd = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dvd.Count > 0) + { + int dvin = Convert.ToInt32(dvd[0]["F_DeviceIndex"]); + if ((dvin >= 35001 && dvin <= 35003) || (dvin == 45001)) + {//20120207机器人地位无法取代,不判断是否被禁用 + + } + else + { + continue; + } + } + + List route = new List();//0,routIDSub;1,步长;2,路径使用频率;3,路径设备任务数 + //路径步长(设备总数)最短(权重0.3),路径使用频率最小(权重0.3)的路径,路径设备任务数(权重0.3) + + route.Add(Convert.ToDouble(dv[i]["F_RouteIDSub"]));//RouteIDSub + //20101124 + sql.Remove(0, sql.Length); + sql.Append("select count(F_DeviceIndex) as steps from T_Base_Route_Device where F_RouteIDSub=" + ).Append(dv[i]["F_RouteIDSub"]); + dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv1.Count > 0) + { + route.Add(Convert.ToDouble(dv1[0]["steps"]));//步长 + //route.Add(0); + } + else + { + continue; + } + //路径使用频率:路径执行调度任务的数量 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT COUNT(DISTINCT F_ManageTaskIndex) AS ManCount FROM T_Monitor_Task GROUP BY F_RouteID HAVING (F_RouteID = ").Append(dv[i]["F_RouteIDSub"]).Append(")"); + dv2 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv2.Count > 0) + { + double a = 0; + if (double.TryParse(dv2[0]["ManCount"].ToString(), out a) == true) + { + route.Add(a);//路径使用频率 + } + else + { + route.Add(0);//路径使用频率 + } + } + else + { + route.Add(0);//路径使用频率 + } + //路径设备任务数 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT COUNT(T_Monitor_Task.F_MonitorIndex) AS mtask FROM T_Monitor_Task ,T_Base_Route_Device where (T_Monitor_Task.F_deviceindex = T_Base_Route_Device.F_deviceindex) and (T_Monitor_Task.F_RouteID = T_Base_Route_Device.F_RouteIDSub) and (T_Base_Route_Device.F_RouteIDSub = ").Append(dv[i]["F_RouteIDSub"]).Append(")"); + dv2 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + if (dv2.Count > 0) + { + double a = 0; + if (double.TryParse(dv2[0]["mtask"].ToString(), out a) == true) + { + route.Add(a);//路径设备任务数 + } + else + { + route.Add(0);//路径设备任务数 + } + } + else + { + route.Add(0);//路径设备任务数 + } + + //求最短路径((路径步长*0.3+路径使用频率*0.3+设备占有数*0.3)的最小值) + if (minroute.Count == 0) + { + minroute.Add(route[0]); + minroute.Add(route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3); + } + else + { + if (minroute[1] > (route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3)) + { + minroute[0] = route[0]; + minroute[1] = (route[1] * 0.3 + route[2] * 0.3 + route[3] * 0.3); + } + } + } + if (minroute.Count > 0) + { + return Convert.ToInt32(minroute[0]); + } + else + { + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", "起点设备:" + startdevice + "和终点设备:" + enddevice + "之间路径不可用!"); + OnRefreshMonitor(rme); + return -1; + } + } + catch (Exception ex) + { + DisassembleTaskError = "ControlSystem.CDisassembleTask.MinRouteID时发生错误:" + ex.StackTrace + ex.Message; + return -1; + } + finally + { + dv.Dispose(); + dv1.Dispose(); + dv2.Dispose(); + dvd.Dispose(); + } + + + } + + } + +} diff --git a/WcfControlMonitorLib/CDisassembleTask.cs b/WcfControlMonitorLib/CDisassembleTask.cs index ba02def..af046b9 100644 --- a/WcfControlMonitorLib/CDisassembleTask.cs +++ b/WcfControlMonitorLib/CDisassembleTask.cs @@ -234,7 +234,7 @@ namespace WcfControlMonitorLib } - if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt64(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 //20101124 @@ -367,7 +367,7 @@ namespace WcfControlMonitorLib } - if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt64(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 //20101124 @@ -446,7 +446,7 @@ namespace WcfControlMonitorLib } continue; } - if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"]), routeid, dv[j], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt64(dv[j]["FID"]), routeid, dv[j], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 //20101124 @@ -522,7 +522,7 @@ namespace WcfControlMonitorLib GetOutDoubleForkTask(dv[0]); } } - if (CreateMonitor(Convert.ToInt32(dv[0]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[0]["FID"]), routeid, dv[0], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dv[0]["F_ManageTaskKindIndex"]), Convert.ToInt64(dv[0]["FID"]), routeid, dv[0], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 int level = Convert.ToInt32(dv[0]["FTASKLEVEL"]) == 100 ? 100 : 9; @@ -603,7 +603,7 @@ namespace WcfControlMonitorLib GetOutDoubleForkTask(dv[j]); } } - if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"]), routeid, dv[j], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt64(dv[j]["FID"]), routeid, dv[j], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 int level = Convert.ToInt32(dv[j]["FTASKLEVEL"]) == 100 ? 100 : 9; @@ -729,7 +729,7 @@ namespace WcfControlMonitorLib } continue; } - if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"]), routeid, dv[j], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt64(dv[j]["FID"]), routeid, dv[j], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 //20101124 @@ -770,7 +770,7 @@ namespace WcfControlMonitorLib } continue; } - if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt64(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 //20101124 @@ -902,7 +902,7 @@ namespace WcfControlMonitorLib } continue; } - if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt64(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 //20101124 @@ -967,7 +967,7 @@ namespace WcfControlMonitorLib } continue; } - if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt32(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dvM[i]["F_ManageTaskKindIndex"]), Convert.ToInt64(dvM[i]["FID"]), routeid, dvM[i], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 //20101124 @@ -1018,7 +1018,7 @@ namespace WcfControlMonitorLib } continue; } - if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"]), routeid, dv[j], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt64(dv[j]["FID"]), routeid, dv[j], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 //20101124 @@ -1093,7 +1093,7 @@ namespace WcfControlMonitorLib GetOutDoubleForkTask(dv[0]); } } - if (CreateMonitor(Convert.ToInt32(dv[0]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[0]["FID"]), routeid, dv[0], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dv[0]["F_ManageTaskKindIndex"]), Convert.ToInt64(dv[0]["FID"]), routeid, dv[0], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 //20101124 @@ -1196,7 +1196,7 @@ namespace WcfControlMonitorLib GetOutDoubleForkTask(dv[j]); } } - if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"]), routeid, dv[j], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt64(dv[j]["FID"]), routeid, dv[j], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 int level = Convert.ToInt32(dv[j]["FTASKLEVEL"]) == 100 ? 100 : 9; @@ -1355,7 +1355,7 @@ namespace WcfControlMonitorLib GetOutDoubleForkTask(dv[j]); } } - if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt32(dv[j]["FID"]), routeid, dv[j], 0) > 0) + if (CreateMonitor(Convert.ToInt32(dv[j]["F_ManageTaskKindIndex"]), Convert.ToInt64(dv[j]["FID"]), routeid, dv[j], 0) > 0) { //分解完成,修改T_Manage_Task表FIntoStepOK=1 //20101124 @@ -2055,7 +2055,7 @@ namespace WcfControlMonitorLib /// 调度路径的子路径编号 /// 调度任务行视图 /// - public static int CreateMonitor(int Mankind,int ManFID, int routeIDSub,DataRowView drv,int status) + public static int CreateMonitor(int Mankind,long ManFID, int routeIDSub,DataRowView drv,int status) { //关联设备属于需要同步执行的设备组 //穿梭车、堆垛机、AGV都属于关键设备需要单独调度, @@ -5471,7 +5471,7 @@ namespace WcfControlMonitorLib /// 调度任务索引 /// 搬运任务类型:1,入库(送坐标);2:出库(取坐标);3:移库(取和送坐标) /// - static int[] GetAGVAddressFromManage(int Mankind, int ManFID, DataRowView drv) + static int[] GetAGVAddressFromManage(int Mankind, long ManFID, DataRowView drv) { int[] stackCoo = new int[6] { 0, 0, 0, 0, 0, 0 };//取排-列-层(Z-X-Y);送排-列-层(Z-X-Y) @@ -5587,7 +5587,7 @@ namespace WcfControlMonitorLib /// /// /// - static int[] GetAGVAddressFromManage(int Mankind, int ManFID,bool IfGetGoods) + static int[] GetAGVAddressFromManage(int Mankind, long ManFID,bool IfGetGoods) { int[] stackCoo = new int[6] { 0, 0, 0, 0, 0, 0 };//取排-列-层(Z-X-Y);送排-列-层(Z-X-Y) @@ -5702,7 +5702,7 @@ namespace WcfControlMonitorLib /// 调度任务索引 /// 搬运任务类型:1,入库(送坐标);2:出库(取坐标);3:移库(取和送坐标) /// - static int[] GetStackCoordinateFromManage(int Mankind, int ManFID,DataRowView drv) + static int[] GetStackCoordinateFromManage(int Mankind, long ManFID,DataRowView drv) { int[] stackCoo = new int[6] { 0, 0, 0, 0, 0, 0 };//取排-列-层(Z-X-Y);送排-列-层(Z-X-Y) char[] cc = new char[1] {'-' }; @@ -5799,7 +5799,7 @@ namespace WcfControlMonitorLib /// /// /// - static int[] GetStackCoordinateFromManage(int Mankind, int ManFID,bool IfGetGoods) + static int[] GetStackCoordinateFromManage(int Mankind, long ManFID,bool IfGetGoods) { int[] stackCoo = new int[6] { 0, 0, 0, 0, 0, 0 };//取排-列-层(Z-X-Y);送排-列-层(Z-X-Y) char[] cc = new char[1] { '-' }; @@ -6168,7 +6168,7 @@ namespace WcfControlMonitorLib /// 设备所引 /// 设备命令 /// - public static bool DeviceAndOrderExitInMonitor(int Mankind, int ManFID, int DeviceIndex,int Order,int ArrowAddress) + public static bool DeviceAndOrderExitInMonitor(int Mankind, long ManFID, int DeviceIndex,int Order,int ArrowAddress) { DataView dv = new DataView(); try diff --git a/WcfControlMonitorLib/CGetState.cs b/WcfControlMonitorLib/CGetState.cs index 2ae73de..4318693 100644 --- a/WcfControlMonitorLib/CGetState.cs +++ b/WcfControlMonitorLib/CGetState.cs @@ -72,7 +72,7 @@ namespace WcfControlMonitorLib } } public int[] _States; - int _fid; + long _fid; int _mti; //int _relativeFID; //int _iotype=0; @@ -563,7 +563,7 @@ namespace WcfControlMonitorLib try { int tsorder = 0; - int fid = _fid; + long fid = _fid; int mti = _mti; int relativeFID = ccf.GetRELATIVECONTORLIDFromManageTask(mti, fid); if (relativeFID == -1) relativeFID = 0; @@ -1124,7 +1124,7 @@ namespace WcfControlMonitorLib } if (saveBarcode == true && mti !=4) { - dbo.ExecuteSql(string.Format("UPDATE T_Base_Device SET F_ManTaskReserve={2},F_PALLETBARCODE = '{0}' WHERE (F_DeviceIndex = {1})", barcode, DeviceIdx, Convert.ToInt32(mti.ToString()+fid.ToString())));//20140309 + dbo.ExecuteSql(string.Format("UPDATE T_Base_Device SET F_ManTaskReserve={2},F_PALLETBARCODE = '{0}' WHERE (F_DeviceIndex = {1})", barcode, DeviceIdx, Convert.ToInt64(mti.ToString()+fid.ToString())));//20140309 } #endregion sql.Remove(0, sql.Length); @@ -1627,7 +1627,7 @@ namespace WcfControlMonitorLib #endregion if (GetManage_Kind(TaskIdx) == false) return; - int fid = _fid; + long fid = _fid; int mti = _mti; if (fid <= 0) return; @@ -2091,7 +2091,7 @@ namespace WcfControlMonitorLib } - int fid = ccf.GetManageTaskIndexfromMonitor(TaskIdx); + long fid = ccf.GetManageTaskIndexfromMonitor(TaskIdx); int mti = ccf.GetManageTaskKindIndexFromMonitor(TaskIdx); int ControlType = ccf.GetFCONTROLTASKTYPEFromManageTask(mti, fid);//民航二 //dbo.TransBegin(); @@ -2306,7 +2306,7 @@ namespace WcfControlMonitorLib ds = dbo.ExceSQL(sql.ToString()); if (ds.Tables[0].DefaultView.Count > 0) { - _fid = Convert.ToInt32(ds.Tables[0].DefaultView[0]["F_ManageTaskIndex"]); + _fid = Convert.ToInt64(ds.Tables[0].DefaultView[0]["F_ManageTaskIndex"]); _mti = Convert.ToInt32(ds.Tables[0].DefaultView[0]["F_ManageTaskKindIndex"]); return true; } @@ -2329,7 +2329,7 @@ namespace WcfControlMonitorLib - public void ReturnManageInfo(int fid, int mti, string cap, bool IFOK) + public void ReturnManageInfo(long fid, int mti, string cap, bool IFOK) { string dtime = DateTime.Now.ToString("u");//20101028 dtime = dtime.Substring(0, dtime.Length - 1);//20101028 @@ -2742,7 +2742,7 @@ namespace WcfControlMonitorLib public void GetKindDeviceState(int TaskIdx, int DeviceIdx, int State) { - int fid = ccf.GetManageTaskIndexfromMonitor(TaskIdx); + long fid = ccf.GetManageTaskIndexfromMonitor(TaskIdx); int mti = ccf.GetManageTaskKindIndexFromMonitor(TaskIdx); if (fid <= 0) return; if (State >= 10)//故障 @@ -3046,7 +3046,7 @@ namespace WcfControlMonitorLib /// 调度任务索引 /// 设备索引 /// 设备指令索引 - bool AppendMoveCellOperate(int mti, int fid, int device,int monitorindex) + bool AppendMoveCellOperate(int mti, long fid, int device,int monitorindex) {//20120820 DataView dv = new DataView(); try @@ -3125,7 +3125,7 @@ namespace WcfControlMonitorLib } } - bool AppendStackMoveCellOperate(int mti, int fid, int device, int monitorindex) + bool AppendStackMoveCellOperate(int mti, long fid, int device, int monitorindex) {//20120820 string newuseawayfork=string.Empty; char[] cc = new char[1] { '-' }; diff --git a/WcfControlMonitorLib/CObtainTask - 鍓湰.cs b/WcfControlMonitorLib/CObtainTask - 鍓湰.cs new file mode 100644 index 0000000..af73d87 --- /dev/null +++ b/WcfControlMonitorLib/CObtainTask - 鍓湰.cs @@ -0,0 +1,1882 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Data; +using DBFactory; +using System.Threading; +using Microsoft.VisualBasic; +using CommonLib; +using ICommLayer; +namespace WcfControlMonitorLib +{ + /// + /// Creator:Richard.liu + /// 获取调度任务 + /// + public static class CObtainTask + { + public static event CDataSourceChangeEventHandler DataChange; + public static void OnDataChange(object sender,CDataChangeEventArgs e) + { + if (DataChange != null) + { + DataChange(sender, e); + } + } + public static event RefreshMonitorEventHandler RefreshMonitor; + public static void OnRefreshMonitor(RefreshMonitorEventArgs e) + { + if (RefreshMonitor != null) + { + RefreshMonitor(e); + } + } + static ISendDeviceOrder sdo; + static StringBuilder[] wv = { new StringBuilder("2") }; + static StringBuilder[] witemnames = { new StringBuilder("") }; + static CGetState cgs = new CGetState(); + static CCommonFunction ccf = new CCommonFunction(); + static Thread mythread; + static bool exitThread = false;//20091107 + static Model.MDevice devinfo; + static StringBuilder sbs = new StringBuilder(); + static StringBuilder temp = new StringBuilder(); + private static void BeginListen() + {//20091107 + while (!exitThread ) + { + GetManagerTask(); + + } + } + public static void EndListen() + {//20091107 + exitThread = true; + + if (mythread != null) + { + + dbo.Close(); + dboM.Close(); + mythread.Abort(); + mythread = null; + } + } + public static void StartListen() + { + exitThread = false; + mythread = new Thread(new ThreadStart(BeginListen)); + mythread.IsBackground = true; + mythread.Start(); + } + + static string _CObtainTaskError=""; + + public static string CObtainTaskError + { + get { return _CObtainTaskError; } + set { _CObtainTaskError = value; + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", _CObtainTaskError); + OnRefreshMonitor(rme); + } + } + static DBOperator dbo = CStaticClass.dbo;//20130510 + static DBOperator dboM = CStaticClass.dboM;//20130510 + /// + /// 获得调度任务 + /// + public static int GetManagerTask() + { + //是否考虑同时读取IO_CONTROLDETAIL表的数据到本地数据库 + DataSet dsIOC = new DataSet(); + DataView dvIOC = new DataView(); + + DataView dv = new DataView(); + DataView dvnew = new DataView(); + DataView dvmi = new DataView(); + DataView DMAN = new DataView(); + DataView dvc = new DataView(); + object obj = null; + #region //受流量限制的出库任务,变量初始化20151120 + StringBuilder startcell = new StringBuilder(""); + StringBuilder endcell = new StringBuilder(""); + StringBuilder notin = new StringBuilder(" and END_DEVICE_CODE not in ("); + #endregion + + try + { + int RecCount = 0; + + #region 受流量限制的出库任务,T_Base_TaskCount应该考虑对流量控制的区域增加优先级//20151120 + dvc = dbo.ExceSQL("SELECT F_DeviceIndex,F_MAXCOUNT FROM T_Base_TaskCount where F_MAXCOUNT>0").Tables[0].DefaultView; + for (int i = 0; i < dvc.Count; i++) + { + if (i == 0) + { + notin.Append("'").Append(dvc[i]["F_DeviceIndex"]).Append("'"); + } + else + { + notin.Append(",'").Append(dvc[i]["F_DeviceIndex"]).Append("'"); + } + int leftTask = 0; + dvnew = dbo.ExceSQL(string.Format("SELECT count(fid) as fids FROM T_Manage_Task where FCONTROLTASKTYPE=2 and FENDDEVICE='{0}'", dvc[i]["F_DeviceIndex"])).Tables[0].DefaultView;//晟碟 出库 + if (dvnew.Count > 0) + { + leftTask = Convert.ToInt32(dvc[i]["F_MAXCOUNT"]) - Convert.ToInt32(dvnew[0]["fids"]); + + } + else + { + leftTask = Convert.ToInt32(dvc[i]["F_MAXCOUNT"]); + } + if (leftTask > 0) + { + #region 到此终点的任务按照巷道等待执行和执行中任务数由小到大依次出叉数量的任务 + // + dvnew = dbo.ExceSQL(string.Format("SELECT F_StartDevice,(SELECT COUNT(FID) FROM T_Manage_Task where FSTARTDEVICE=F_StartDevice)+(SELECT count(F_MonitorIndex) FROM T_Monitor_Task where F_DeviceIndex =convert(int,'11'+ substring(convert(varchar,F_StartDevice),3,3)) and F_DeviceCommandIndex=5) as aaa FROM T_Base_Route where F_EndDevice={0} and F_RouteKind=2 order by aaa asc", Convert.ToInt32(dvc[i]["F_DeviceIndex"]))).Tables[0].DefaultView;//晟碟光限制出库 + + for (int xd = 0; xd < dvnew.Count; xd++) + { + startcell.Clear(); + if (CStaticClass.DBFactory == "OracleDBFactory") + {//20151120调度系统oracle的特殊语句 + obj = dbo.GetSingle(string.Format("SELECT FCELLCODE from ST_CELL where rownum=1 and FLaneWay={0} order by FCELLCODE asc", dvnew[xd]["F_StartDevice"])); + } + else + { + obj = dbo.GetSingle(string.Format("SELECT top 1 FCELLCODE from ST_CELL where FLaneWay={0} order by FCELLCODE asc", dvnew[xd]["F_StartDevice"])); + } + if (obj != null) + { + startcell.Append(obj.ToString()); + } + else + { + startcell.Append("-"); + } + endcell.Clear(); + if (CStaticClass.DBFactory == "OracleDBFactory") + {//20151120调度系统oracle的特殊语句 + obj = dbo.GetSingle(string.Format("SELECT FCELLCODE from ST_CELL where rownum=1 and FLaneWay={0} order by FCELLCODE desc", dvnew[xd]["F_StartDevice"])); + } + else + { + obj = dbo.GetSingle(string.Format("SELECT top 1 FCELLCODE from ST_CELL where FLaneWay={0} order by FCELLCODE desc", dvnew[xd]["F_StartDevice"])); + } + + if (obj != null) + { + endcell.Append(obj.ToString()); + } + else + { + endcell.Append("-"); + } + + + obj = dbo.GetSingle(string.Format("SELECT F_ForkAmount from T_Base_StackInfo where F_LaneNo like '%{0}%'", dvnew[xd]["F_StartDevice"])); + int forkcount = 1; + if (obj != null) + { + forkcount = Convert.ToInt32(obj); + } + sbs.Remove(0, sbs.Length); + if (CStaticClass.ManDBFactory == "OracleDBFactory") + {//20151120调度系统oracle的特殊语句 + sbs.Append("select CONTROL_ID from IO_CONTROL where rownum<=").Append(forkcount); + } + else + { + sbs.Append("select top ").Append(forkcount).Append(" CONTROL_ID from IO_CONTROL where CONTROL_TASK_TYPE=2 AND 1=1 ");//晟碟 光限制出库 + } + sbs.Append(" and CONTROL_STATUS=").Append(Model.CGeneralFunction.TASKWAIT.ToString());// + sbs.Append(" and START_DEVICE_CODE>='").Append(startcell).Append("' "); + sbs.Append(" and START_DEVICE_CODE<='").Append(endcell).Append("' "); + sbs.Append(" and END_DEVICE_CODE='").Append(dvc[i]["F_DeviceIndex"]).Append("'"); + sbs.Append(" order by CONTROL_TASK_LEVEL desc,CONTROL_BEGIN_TIME asc,CONTROL_ID asc "); + dvIOC = dboM.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + { + for (int inew = 0; inew < dvIOC.Count; inew++) + ObtainDoubleForkTask(dvIOC[inew]["CONTROL_ID"], "0"); + } + leftTask = leftTask - dvIOC.Count; + if (leftTask <= 0) break; + } + #endregion + } + } + notin.Append(")"); + #endregion + + #region 限制获取的排货位限制 + + temp.Remove(0, temp.Length);//20101208 + if (CStaticClass.ManZWhere.ToString().Length > 0)//20101124 + { + temp.Append(CStaticClass.ManZWhere.ToString()); + temp.Replace("or", "and (", 0, 4); + temp.Append(")"); + } + else + { + temp.Append(" and 1=1"); + } + #endregion + + #region 20210324_上海晟碟,轮询判断拣选站台指示灯状态与管理表订单状态是否一致 + + //dvIOC = dbo.ExceSQL("SELECT * FROM IO_Station_Status").Tables[0].DefaultView; + //if(dvIOC.Count > 0) + //{ + // int iDeviceIndex; + // int iStatus; + // Model.MDevice deviceInfo = new Model.MDevice(); + // for (int i = 0; i < dvIOC.Count; i++) + // { + // iDeviceIndex = Convert.ToInt32(dvIOC[i]["F_StationID"]); + // iStatus = Convert.ToInt32(dvIOC[i]["F_Status"]); + // deviceInfo = Model.CGetInfo.GetDeviceInfo(iDeviceIndex * 10 + 1); + // if(deviceInfo.ReturnMessage == null || deviceInfo.ReturnMessage[0] != iStatus) + // { + // witemnames[0].Clear(); + // witemnames[0].Append(Model.CGeneralFunction.DBSend).Append(".").Append(Convert.ToString(deviceInfo.Dbw1Address + 0)).Append(",b"); + // wv[0].Clear(); + // wv[0].Append(iStatus.ToString()); + // sdo = CommLayerFactory.CommModeCreate.CreateSendDeviceOrder(deviceInfo.DeviceIndex); + // sdo.WriteDBData(witemnames, wv, deviceInfo.S7Connection); + // int[] lStatus = { iStatus }; + // deviceInfo.ReturnMessage = lStatus; + // CommonClassLib.CCarryConvert.WriteDarkCasket("OPCClient", "更改拣选站台塔灯颜色", deviceInfo.DeviceIndex.ToString(), "更改为:" + iStatus); + // } + // } + //} + + #endregion + + sbs.Remove(0, sbs.Length);//20110602增加获取任务时的读取单叉执行的状态 + sbs.Append("select * from IO_CONTROL where ((CONTROL_STATUS="); + sbs.Append(Model.CGeneralFunction.TASKWAIT.ToString()); + sbs.Append(") or (CONTROL_STATUS=").Append(Model.CGeneralFunction.TASKSINGLEFORKRUN.ToString()).Append(") or (CONTROL_STATUS="); + sbs.Append(Model.CGeneralFunction.TASKALTERROUTEREPLY.ToString()); + sbs.Append(")) " + temp.ToString()).Append(" ").Append("and (CONTROL_TASK_TYPE<>2 or (CONTROL_TASK_TYPE=2 ").Append(notin).Append("))");//.Append(notin);//晟碟 + sbs.Append(" order by CONTROL_TASK_LEVEL desc,CONTROL_ID asc");//20151120 + dsIOC = dboM.ExceSQL(sbs.ToString()); + dvIOC = dsIOC.Tables[0].DefaultView; + //string sstite, estite; + if (dvIOC.Count > 0) + { + + + string FENDCELL = ""; char[] cc = new char[1] { '-' }; + int FENDDEVICE = 0; + for (int i = 0; i < dvIOC.Count; i++) + { + #region 任务暂停和恢复 + ////20091128 + //if ((dvIOC[i]["CONTROL_STATUS"].ToString() == "0") && (dvIOC[i]["CONTROL_ISRETURN"].ToString() == "3")) + //{//任务恢复 + // dbo.ExceSQL("update T_Manage_Task set FIntoStepOK=0 where (FID = " + Convert.ToInt32(dvIOC[i]["FID"]) + ") AND (F_ManageTASKKINDINDEX =1) and (FIntoStepOK='-')"); + // dboM.ExceSQL("update IO_CONTROL set CONTROL_ISRETURN=0 where CONTROL_ID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // continue; + //} + //if ((dvIOC[i]["CONTROL_STATUS"].ToString() == "0") && (dvIOC[i]["CONTROL_ISRETURN"].ToString() == "2")) + //{ //未拆分的任务暂停 + // int rs = dbo.ExecuteSql("update T_Manage_Task set FIntoStepOK='-' where (FID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) and (FIntoStepOK='0')"); + // if (rs == 0) + // { + // //已拆分未执行的任务暂停 + // dvMT = dbo.ExceSQL("select fid from T_Manage_Task where (FID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) and (FIntoStepOK='1') and (FSTATUS=0)").Tables[0].DefaultView; + // if (dvMT.Count > 0) + // { + // dbo.ExceSQL("delete from T_Monitor_Task where (F_ManageTaskIndex= " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) "); + // dbo.ExceSQL("update T_Manage_Task set FIntoStepOK='-' where (FID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) "); + + // } + + // } + // //dboM.ExceSQL("update IO_CONTROL set CONTROL_ISRETURN=0 where CONTROL_ID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // continue; + //} + //else + //{ + // //上报管理FSTATUS=940 + // #region 正在执行的任务暂停 + // if (dvIOC[i]["CONTROL_ISRETURN"].ToString() == "2") + // { + // //正在执行的任务暂停 + // dvMT = dbo.ExceSQL("select fid from T_Manage_Task where (FID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) and (FIntoStepOK='1') and (FSTATUS>0)").Tables[0].DefaultView; + // if (dvMT.Count > 0) + // { + // //只有暂停“正在运行的堆垛机非送货指令”或者“等待执行的堆垛机送货指令”,输送机无法暂停 + // dvMT = dbo.ExceSQL("select F_MonitorIndex,F_Status,F_DeviceIndex,F_DeviceCommandIndex from T_Monitor_Task where (F_ManageTaskIndex= " + + // Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) order by F_MonitorIndex asc").Tables[0].DefaultView; + // if (dvMT.Count > 0) + // { + // if (ccf.GetDeviceKindIdx(Convert.ToInt32(dvMT[0]["F_DeviceIndex"])) == 1) + // { + // if ((dvMT[0]["F_DeviceCommandIndex"].ToString() == "5") && (Convert.ToInt32(dvMT[0]["F_Status"]) == 0)) + // {//等待执行的堆垛机送货指令可以改道原货位 + // dbo.ExceSQL("update T_Manage_Task set FExceptionNO='940' where (FID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) "); + + // dbo.ExceSQL("update T_Monitor_Task set F_AheadDetect='',F_NumParam4=F_NumParam1,F_NumParam5=F_NumParam2,F_NumParam6=F_NumParam3 where F_MonitorIndex=" + dvMT[0]["F_MonitorIndex"]); + // dbo.ExceSQL("update T_Monitor_Task set F_Status=-1 where F_MonitorIndex>" + dvMT[0]["F_MonitorIndex"] + // + " and F_Status=0 and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // dvMT = dbo.ExceSQL("select * from T_Monitor_Task where F_Status=-1 and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Tables[0].DefaultView; + // for (int ii = 0; ii < dvMT.Count; ii++) + // { + // cgs.ActionComplete(Convert.ToInt32(dvMT[ii]["F_DeviceIndex"]), Convert.ToInt32(dvMT[ii]["F_MonitorIndex"]), 900); + // } + // dbo.ExceSQL("update T_Manage_Task set FIntoStepOK='-' where (FID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) "); + // //dboM.ExceSQL("update IO_CONTROL set CONTROL_ISRETURN=0 where CONTROL_ID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // } + // else if (dvMT[0]["F_DeviceCommandIndex"].ToString() == "2") + // {//正在执行堆垛机将取指令,后续任务都取消;等待执行的堆垛机将取指令和后续任务都取消 + // dbo.ExceSQL("update T_Manage_Task set FExceptionNO='940' where (FID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) "); + // dbo.ExceSQL("update T_Monitor_Task set F_Status=-1 where F_MonitorIndex>=" + dvMT[0]["F_MonitorIndex"] + // + " and F_Status=0 and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // dvMT = dbo.ExceSQL("select * from T_Monitor_Task where F_MonitorIndex>=" + dvMT[0]["F_MonitorIndex"] + // + " and F_Status=-1 and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Tables[0].DefaultView; + // for (int ii = 0; ii < dvMT.Count; ii++) + // { + // cgs.ActionComplete(Convert.ToInt32(dvMT[ii]["F_DeviceIndex"]), Convert.ToInt32(dvMT[ii]["F_MonitorIndex"]), 900); + // } + // dbo.ExceSQL("update T_Manage_Task set FIntoStepOK='-' where (FID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) "); + // //dboM.ExceSQL("update IO_CONTROL set CONTROL_ISRETURN=0 where CONTROL_ID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // } + // else if (dvMT[0]["F_DeviceCommandIndex"].ToString() == "4") + // {//正在执行堆垛机取货指令,后续任务都改道原货位;等待执行的堆垛机取货指令和后续任务都取消 + // dbo.ExceSQL("update T_Manage_Task set FExceptionNO='940' where (FID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) "); + // if (Convert.ToInt32(dvMT[0]["F_Status"]) >= 1) + // { + // dbo.ExceSQL("update T_Monitor_Task set F_AheadDetect='',F_NumParam4=F_NumParam1,F_NumParam5=F_NumParam2,F_NumParam6=F_NumParam3 where F_MonitorIndex>" + + // dvMT[0]["F_MonitorIndex"] + " and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // //删除送货之后的输送机任务 + // dvSend = dbo.ExceSQL("select F_MonitorIndex from T_Monitor_Task where F_DeviceIndex=" + dvMT[0]["F_DeviceIndex"] + // + " and F_DeviceCommandIndex=5 and F_Status=0 and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Tables[0].DefaultView; + // if (dvSend.Count > 0) + // { + // dbo.ExceSQL("update T_Monitor_Task set F_Status=-1 where F_MonitorIndex>" + dvSend[0]["F_MonitorIndex"] + // + " and F_Status=0 and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // dvMT = dbo.ExceSQL("select * from T_Monitor_Task where F_MonitorIndex>" + dvSend[0]["F_MonitorIndex"] + // + " and F_Status=-1 and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Tables[0].DefaultView; + // for (int ii = 0; ii < dvMT.Count; ii++) + // { + // cgs.ActionComplete(Convert.ToInt32(dvMT[ii]["F_DeviceIndex"]), Convert.ToInt32(dvMT[ii]["F_MonitorIndex"]), 900); + // } + // } + // //dboM.ExceSQL("update IO_CONTROL set CONTROL_ISRETURN=0 where CONTROL_ID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // } + // else if (dvMT[0]["F_Status"].ToString() == "0") + // { + // dbo.ExceSQL("update T_Monitor_Task set F_Status=-1 where F_MonitorIndex>=" + dvMT[0]["F_MonitorIndex"] + // + " and F_Status=0 and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // dvMT = dbo.ExceSQL("select * from T_Monitor_Task where F_MonitorIndex>=" + dvMT[0]["F_MonitorIndex"] + // + " and F_Status=-1 and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["FID"])).Tables[0].DefaultView; + // for (int ii = 0; ii < dvMT.Count; ii++) + // { + // cgs.ActionComplete(Convert.ToInt32(dvMT[ii]["F_DeviceIndex"]), Convert.ToInt32(dvMT[ii]["F_MonitorIndex"]), 900); + // } + // //dboM.ExceSQL("update IO_CONTROL set CONTROL_ISRETURN=0 where CONTROL_ID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // } + // dbo.ExceSQL("update T_Manage_Task set FIntoStepOK='-' where (FID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) "); + // } + // else if (dvMT[0]["F_DeviceCommandIndex"].ToString() == "3") + // {//正在执行堆垛机将送指令,后续任务都改道原货位;等待执行的堆垛机将送指令和后续任务都改道原货位 + // dbo.ExceSQL("update T_Manage_Task set FExceptionNO='940' where (FID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) "); + // if (dvMT[0]["F_Status"].ToString() == "0") + // { + // dbo.ExceSQL("update T_Monitor_Task set F_AheadDetect='',F_NumParam4=F_NumParam1,F_NumParam5=F_NumParam2,F_NumParam6=F_NumParam3 where F_MonitorIndex>=" + + // dvMT[0]["F_MonitorIndex"] + " and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // //dboM.ExceSQL("update IO_CONTROL set CONTROL_ISRETURN=0 where CONTROL_ID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // } + // else if (Convert.ToInt32(dvMT[0]["F_Status"]) >= 1) + // { + // dbo.ExceSQL("update T_Monitor_Task set F_AheadDetect='',F_NumParam4=F_NumParam1,F_NumParam5=F_NumParam2,F_NumParam6=F_NumParam3 where F_MonitorIndex>" + + // dvMT[0]["F_MonitorIndex"] + " and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // //dboM.ExceSQL("update IO_CONTROL set CONTROL_ISRETURN=0 where CONTROL_ID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // } + // //删除送货之后的输送机任务 + // dvSend = dbo.ExceSQL("select F_MonitorIndex from T_Monitor_Task where F_DeviceIndex=" + dvMT[0]["F_DeviceIndex"] + // + " and F_DeviceCommandIndex=5 and F_Status=0 and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Tables[0].DefaultView; + // if (dvSend.Count > 0) + // { + // dbo.ExceSQL("update T_Monitor_Task set F_Status=-1 where F_MonitorIndex>" + dvSend[0]["F_MonitorIndex"] + // + " and F_Status=0 and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + // dvMT = dbo.ExceSQL("select * from T_Monitor_Task where F_MonitorIndex>" + dvSend[0]["F_MonitorIndex"] + // + " and F_Status=-1 and F_ManageTASKKINDINDEX=1 and F_ManageTaskIndex=" + Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Tables[0].DefaultView; + // for (int ii = 0; ii < dvMT.Count; ii++) + // { + // cgs.ActionComplete(Convert.ToInt32(dvMT[ii]["F_DeviceIndex"]), Convert.ToInt32(dvMT[ii]["F_MonitorIndex"]), 900); + // } + // } + // dbo.ExceSQL("update T_Manage_Task set FIntoStepOK='-' where (FID = " + Convert.ToInt32(dvIOC[i]["CONTROL_ID"]) + ") AND (F_ManageTASKKINDINDEX =1) "); + // } + + + // } + // continue; + // } + + // } + // } + // #endregion + //} + #endregion + + bool UseOldRoute = false; + #region 新任务 + + if ((dvIOC[i]["CONTROL_STATUS"].ToString() == Model.CGeneralFunction.TASKWAIT.ToString()) || (dvIOC[i]["CONTROL_STATUS"].ToString() == Model.CGeneralFunction.TASKSINGLEFORKRUN.ToString())) + { + //20120906 + #region 控制三四楼的出库任务,有其他批号没通过主道合流扫描器就不获取任务 + ////42529;32710 + //if (dvIOC[i]["END_DEVICE_CODE"].ToString().Length == 5) + //{ + // if (dvIOC[i]["END_DEVICE_CODE"].ToString().Substring(0, 1) == "3") + // { + // if (IFExitSameLayerUnSameEndDevice(dvIOC[i]["END_DEVICE_CODE"].ToString().Substring(0, 1), 32710, dvIOC[i]["END_DEVICE_CODE"].ToString()) == true) + // { + // continue; + // } + // } + // else if (dvIOC[i]["END_DEVICE_CODE"].ToString().Substring(0, 1) == "4") + // { + // if (IFExitSameLayerUnSameEndDevice(dvIOC[i]["END_DEVICE_CODE"].ToString().Substring(0, 1), 42529, dvIOC[i]["END_DEVICE_CODE"].ToString()) == true) + // { + // continue; + // } + // } + //} + #endregion + + #region 四楼检定回库一体化平台准备放行(不满16箱) + //46006\46007\46008:站台到站台,直接转给电气 + if (("46006,46007,46008".IndexOf(dvIOC[i]["START_DEVICE_CODE"].ToString()) >= 0) && + ("46006,46007,46008".IndexOf(dvIOC[i]["END_DEVICE_CODE"].ToString()) >= 0) && + (dvIOC[i]["START_DEVICE_CODE"].ToString() == dvIOC[i]["END_DEVICE_CODE"].ToString())) + { + IntegrativeNotifyDischarging(Convert.ToInt32(dvIOC[i]["CONTROL_ID"]), Convert.ToInt32(dvIOC[i]["START_DEVICE_CODE"])); + continue; + } + #endregion + #region 四楼检定回库的三个道码垛控制46007,46008,46006---42639 + //电气申请放行后,管理下达任务,第一个任务给电气写入放行信号,电气自己清除,放行后,记录批号,相同批号禁止重复写入放行信号 + //正在放行的单元最后一箱通过42664后清除记录批号,获取其他单元任务;42664的F_BoxBarcode记录批号,F_TaskIndex记录放行单元号 + if ("46007,46008,46006".IndexOf(dvIOC[i]["START_DEVICE_CODE"].ToString()) >= 0) + { + if (ManageSendDischargingTask(Convert.ToInt32(dvIOC[i]["START_DEVICE_CODE"]), dvIOC[i]["CONTORL_BATCH"].ToString(), 42664, Convert.ToInt32(dvIOC[i]["END_DEVICE_CODE"])) == false) + { + continue; + } + } + + #endregion + + bool Ifobtain = true; + #region 20120906判断是否是嘉兴一楼三个条码一起配叉任务,三个任务都存在时一起获取 + StringBuilder[] relBarcodes = GetRelativeBarCodes(dvIOC[i]["START_DEVICE_CODE"].ToString(), dvIOC[i]["STOCK_BARCODE"].ToString()); + int[] relFID = null; + if (relBarcodes != null) + { + relFID = new int[relBarcodes.GetLength(0)]; + int ri = 0; int tep = 0; + for (int j = 0; j < relBarcodes.GetLength(0); j++) + { + tep = GetIOControlFromBarcode(relBarcodes[j]); + if (tep <= 0) + { + Ifobtain = false; + } + else + { + relFID[ri] = tep; + ri++; + } + + } + } + #endregion + if (Ifobtain == true) + {//20120906全部获取后,一起关联多叉任务 + if (relFID != null) + { + for (int j = 0; j < relFID.GetLength(0); j++) + { + ObtainDoubleForkTask(relFID[j], "0"); + } + } + ObtainDoubleForkTask(dvIOC[i]["CONTROL_ID"], "0"); + string FUseAwayFork = "0"; + if (relFID != null) + { + for (int j = 0; j < relFID.GetLength(0); j++) + {//20120906分配一楼关联任务货叉 + FUseAwayFork = GetFUseForkFromManage(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); ; + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Manage_Task set FUseAwayFork=").Append(FUseAwayFork).Append(",F_RELATIVECONTORLID=").Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(" where F_ManageTaskKindIndex=1").Append(" and FID=").Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + dbo.ExecuteSql(sbs.ToString()); + FUseAwayFork = GetFUseForkFromManage(relFID[j]); + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Manage_Task set FUseAwayFork=").Append(FUseAwayFork).Append(",F_RELATIVECONTORLID=").Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(" where F_ManageTaskKindIndex=1").Append(" and FID=").Append(relFID[j]); + dbo.ExecuteSql(sbs.ToString()); + }// + } + else + { + if ("12055,12054,12053,12052".IndexOf(dvIOC[i]["START_DEVICE_CODE"].ToString().Substring(0, 5)) >= 0) + { + FUseAwayFork = GetFUseForkFromManage(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); ; + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Manage_Task set FUseAwayFork=").Append(FUseAwayFork).Append(" where F_ManageTaskKindIndex=1").Append(" and FID=").Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + dbo.ExecuteSql(sbs.ToString()); + } + } + + RecCount++; + } + } + + #endregion + + #region 修改路径的答复 + + else if (dvIOC[i]["CONTROL_STATUS"].ToString() == Model.CGeneralFunction.TASKALTERROUTEREPLY.ToString()) + { + int a = 0; + if (int.TryParse(dvIOC[i]["END_DEVICE_CODE"].ToString(), out a) == false) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT FLaneWay FROM ST_CELL where FCELLCODE='").Append(dvIOC[i]["END_DEVICE_CODE"]).Append("' and FWAREHOUSE='").Append(dvIOC[i]["END_WAREHOUSE_CODE"]).Append("'"); + obj = dbo.GetSingle(sbs.ToString()); + //20101124 + if (obj != null) + { + FENDDEVICE = Convert.ToInt32(obj); + } + else + { + CObtainTaskError = string.Format("获取任务的修改路径的答复:没找到调度任务索引:{0},修改后的终点位置!", dvIOC[i]["CONTROL_ID"].ToString()); + continue; + } + FENDCELL = dvIOC[i]["END_DEVICE_CODE"].ToString(); + //20100304 + if (ccf.GetExceptionNOFromManageTask(Convert.ToInt32(dvIOC[i]["CONTROL_ID"]), 1) == Model.CGeneralFunction.TASKREPEATINPUT) + { + UseOldRoute = true; + + } + } + else + { + FENDDEVICE = Convert.ToInt32(dvIOC[i]["END_DEVICE_CODE"]); + //20090910 + if (ccf.GetExceptionNOFromManageTask(Convert.ToInt32(dvIOC[i]["CONTROL_ID"]), 1) == Model.CGeneralFunction.TASKREPEATINPUT) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_TASKKIND, F_DESTINATION FROM T_Base_Destination WHERE (F_TASKKIND = ").Append(dvIOC[i]["CONTROL_TASK_TYPE"]).Append(") and (F_AbendStation=1) and (F_DESTINATION=").Append(FENDDEVICE).Append(")"); + dv = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + //20101124 + if (dv.Count > 0)//是应急站台,把原来的终点改为起点改道至应急站台 + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Manage_Task set FSTARTDEVICE=FENDDEVICE,FSTARTCELL=FENDCELL where (FID = ").Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX =1)"); + dbo.ExceSQL(sbs.ToString()); + } + else + { + UseOldRoute = true; + } + + } + FENDCELL = "-"; + + #region 20101028转换AGV的坐标为通道 + + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_ChannelsIndex FROM T_Base_AGV_Gate WHERE (F_AGVGateDeviceIndex = ").Append(Convert.ToInt32(dvIOC[i]["END_DEVICE_CODE"])).Append(") "); + obj = dbo.GetSingle(sbs.ToString()); + + if (obj != null) + { + FENDDEVICE = Convert.ToInt32(obj); + FENDCELL = dvIOC[i]["END_DEVICE_CODE"].ToString(); + } + else + { + FENDDEVICE = Convert.ToInt32(dvIOC[i]["END_DEVICE_CODE"]); + FENDCELL = "-"; + } + #endregion + } + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Manage_Task set FENDDEVICE='").Append(FENDDEVICE).Append("',FENDCELL='").Append(FENDCELL).Append("' where (FID = ").Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX =1)"); + dbo.ExceSQL(sbs.ToString()); + //已经开始执行的需要更改调度任务) + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT * FROM T_Monitor_Task WHERE (F_ManageTaskIndex = ").Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX =1) AND (F_Status =3) order by F_MonitorIndex asc"); + dvmi = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dvmi.Count > 0) + {//已经开始执行的需要更改调度任务 + //判断申请修改路径的第一个调度任务: + int monitorIndex = (int)dvmi[0]["F_MonitorIndex"]; + int associateMonitor = -1; + if (dvmi[0]["F_Associate"] != DBNull.Value) + { + associateMonitor = Convert.ToInt32(dvmi[0]["F_Associate"]); + } + int devindex = Convert.ToInt32(dvmi[0]["F_DeviceIndex"]); + int devKind = ccf.GetDeviceKindIdx(Convert.ToInt32(dvmi[0]["F_DeviceIndex"])); + int devCommand = Convert.ToInt32(dvmi[0]["F_DeviceCommandIndex"]); + int routeID = Convert.ToInt32(dvmi[0]["F_RouteID"]); + int NumParam1 = Convert.ToInt32(dvmi[0]["F_NumParam1"]); + int NumParam4 = Convert.ToInt32(dvmi[0]["F_NumParam4"]); + string AheadDetect = dvmi[0]["F_AheadDetect"].ToString(); + + + + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("select * from T_Manage_Task where (FID = ").Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX =1)"); + DMAN = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (DMAN.Count > 0) + { + + + //20091107 + int routeidNew = 0; + if (UseOldRoute == false) + { + routeidNew = CDisassembleTask.MinRouteID(Convert.ToInt32(DMAN[0]["FSTARTDEVICE"]), Convert.ToInt32(DMAN[0]["FENDDEVICE"]), DMAN[0]["FUseAwayFork"]); + } + else + {//970送货时货架有货,还是用原来路径 + routeidNew = routeID; + } + + //20091005 + if (routeidNew == -1) + { + + //考虑重新向管理申请改道 + if (CStaticClass.DeviceErrorAutoModifyRoutePath == "1") + {//20091107 + GetUsableDestination(DMAN[0]); + } + + continue; + } + //20091005 + //删除原来的申请修改路径任务,拆分新的任务并且只保留现有设备开始的任务 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("DELETE FROM T_Monitor_Task WHERE (F_ManageTaskIndex = ").Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX =1) AND (F_Status =3)"); + dbo.ExceSQL(sbs.ToString()); + //20090910 + if (CDisassembleTask.CreateMonitor(1, Convert.ToInt32(dvIOC[i]["CONTROL_ID"]), routeidNew, DMAN[0], 3) <= 0) + { + //重新生成申请修改路径的申请任务 + sbs.Remove(0, sbs.Length); + sbs.Append("INSERT INTO T_Monitor_Task "); + sbs.Append("(F_ManageTaskIndex, F_ManageTASKKINDINDEX, F_MonitorIndex,F_MonitorTaskLevel,"); + sbs.Append(" F_DeviceIndex, F_DeviceCommandIndex, F_RouteID, F_Status,F_NumParam1, F_NumParam4,"); + sbs.Append(" F_AheadDetect,F_TxtParam)"); + sbs.Append("VALUES (").Append(dvIOC[i]["CONTROL_ID"]).Append(",1,").Append(monitorIndex) + .Append(",1,").Append(devindex).Append(",").Append(devCommand).Append(",").Append(routeID) + .Append(",3,").Append(NumParam1).Append(",").Append(NumParam4).Append(",'").Append(AheadDetect) + .Append("','").Append(dvIOC[i]["STOCK_BARCODE"]).Append("')"); + dbo.ExceSQL(sbs.ToString()); + continue; + } + + if (devKind == 4) + { + if (devCommand == 7) + { + int RGVsn = ccf.GetSerialNumberFromRouteDevice(routeID, devindex); + int Consn = ccf.GetSerialNumberFromRouteDevice(routeID, NumParam1); + + #region RGV运动到接货点 + if (RGVsn > Consn) + { + //删除RGV运动到接货点之前的任务 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_DeviceIndex = "); + sbs.Append(devindex).Append(") AND (F_DeviceCommandIndex = 7) AND (F_RouteID = ").Append(routeidNew); + sbs.Append(") AND (F_Status = 3) AND (F_NumParam1 = ").Append(NumParam1).Append(")"); + dvnew = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dvnew.Count > 0) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("delete from T_Monitor_Task where F_MonitorIndex<").Append(dvnew[0]["F_MonitorIndex"]).Append(" and (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Monitor_Task set F_Status =0 where (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + } + + + } + #endregion + + #region RGV运动到送货点 + if (RGVsn < Consn) + { + int RGVsn1 = ccf.GetSerialNumberFromRouteDevice(routeidNew, devindex); + //找到接货输送机设备索引 + List nextcon = CDisassembleTask.GetNextDevice(routeidNew, RGVsn1); + int condev = nextcon[0]; + //删除RGV运动到送货点之前的任务 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_DeviceIndex = "); + sbs.Append(devindex).Append(") AND (F_DeviceCommandIndex = 7) AND (F_RouteID = ").Append(routeidNew); + sbs.Append(") AND (F_Status = 3) AND (F_NumParam1 = ").Append(condev).Append(")"); + dvnew = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dvnew.Count > 0) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("delete from T_Monitor_Task where F_MonitorIndex<").Append(dvnew[0]["F_MonitorIndex"]); + sbs.Append(" and (F_ManageTaskIndex = ").Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Monitor_Task set F_Status =0 where (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + } + + } + #endregion + } + + #region RGV送货 + + if ((devCommand == 3) || (devCommand == 5)) + { + int RGVsn = ccf.GetSerialNumberFromRouteDevice(routeidNew, devindex); + //找到接货输送机设备索引 + List nextcon = CDisassembleTask.GetNextDevice(routeidNew, RGVsn); + int condev = nextcon[0]; + //删除RGV运动到送货点之前的任务 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_DeviceIndex = "); + sbs.Append(devindex).Append(") AND (F_DeviceCommandIndex = 7) AND (F_RouteID = ").Append(routeidNew); + sbs.Append(") AND (F_Status = 3) AND (F_NumParam1 = ").Append(condev).Append(")"); + dvnew = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dvnew.Count > 0) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("delete from T_Monitor_Task where F_MonitorIndex<").Append(dvnew[0]["F_MonitorIndex"]).Append(" and (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Monitor_Task set F_Status =0 where (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + } + + + } + #endregion + + #region RGV接货 + if ((devCommand == 2) || (devCommand == 4)) + { + int RGVsn = ccf.GetSerialNumberFromRouteDevice(routeidNew, devindex); + //找到送货输送机设备索引 + List priorcon = CDisassembleTask.GetPriorDevice(routeidNew, RGVsn); + int condev = priorcon[0]; + //删除RGV运动到接货点之前的任务 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_DeviceIndex = "); + sbs.Append(devindex).Append(") AND (F_DeviceCommandIndex = 7) AND (F_RouteID = ").Append(routeidNew); + sbs.Append(") AND (F_Status = 3) AND (F_NumParam1 = ").Append(condev).Append(")"); + dvnew = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dvnew.Count > 0) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("delete from T_Monitor_Task where F_MonitorIndex<").Append(dvnew[0]["F_MonitorIndex"]).Append(" and (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Monitor_Task set F_Status =0 where (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + } + + + } + #endregion + } + if (devKind == 2) + { + #region 输送机送货 + if (devCommand == 3) + { + int consn = ccf.GetSerialNumberFromRouteDevice(routeidNew, devindex); + //找到接货RGV设备索引 + List nextrgv = CDisassembleTask.GetNextDevice(routeidNew, consn); + int rgvdev = nextrgv[0]; + + //删除RGV运动到接货点之前的任务 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_DeviceIndex = "); + sbs.Append(rgvdev).Append(") AND (F_DeviceCommandIndex = 7) AND (F_RouteID = ").Append(routeidNew); + sbs.Append(") AND (F_Status = 3) AND (F_NumParam1 = ").Append(devindex).Append(")"); + dvnew = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dvnew.Count > 0) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("delete from T_Monitor_Task where F_MonitorIndex<").Append(dvnew[0]["F_MonitorIndex"]).Append(" and (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Monitor_Task set F_Status =0 where (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + } + + } + #endregion + + #region 输送机的接货 + + if (devCommand == 4) + { + int consn = ccf.GetSerialNumberFromRouteDevice(routeID, devindex); + //找到送货RGV设备索引 + List priorrgv = CDisassembleTask.GetPriorDevice(routeID, consn); + int rgvdev = priorrgv[0]; + int rgvsn = ccf.GetSerialNumberFromRouteDevice(routeidNew, rgvdev); + List nextdev = CDisassembleTask.GetNextDevice(routeidNew, rgvdev); + int condev = nextdev[0]; + //删除RGV运动到送货点之前的任务 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_DeviceIndex = "); + sbs.Append(rgvdev).Append(") AND (F_DeviceCommandIndex = 7) AND (F_RouteID = ").Append(routeidNew); + sbs.Append(") AND (F_Status = 3) AND (F_NumParam1 = ").Append(condev).Append(")"); + dvnew = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dvnew.Count > 0) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("delete from T_Monitor_Task where F_MonitorIndex<").Append(dvnew[0]["F_MonitorIndex"]).Append(" and (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Monitor_Task set F_Status =0 where (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + } + + } + + #endregion + + + #region 输送机的送出 + if (devCommand == 6) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_DeviceIndex = "); + sbs.Append(devindex).Append(") AND (F_DeviceCommandIndex = 6) AND (F_RouteID = ").Append(routeidNew).Append(") AND (F_Status = 3) "); + dvnew = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dvnew.Count > 0) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("delete from T_Monitor_Task where F_MonitorIndex<").Append(dvnew[0]["F_MonitorIndex"]).Append(" and (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + int CurrentLocation = 0; + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT FCurrentLocation FROM T_Manage_Task where FID=").Append(dvIOC[i]["CONTROL_ID"]).Append(" and F_ManageTaskKindIndex=1"); + dvc = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dvc.Count > 0) + { + CurrentLocation = Convert.ToInt32(dvc[0]["FCurrentLocation"]); + } + if (CurrentLocation == 0) continue; + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Monitor_Task set F_DeviceIndex=").Append(CurrentLocation).Append(" where F_MonitorIndex=").Append(dvnew[0]["F_MonitorIndex"]); + dbo.ExceSQL(sbs.ToString()); + //20090910已经搬运到CurrentLocation(F_NumParam4=CurrentLocation) 删除送出任务 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("delete from T_Monitor_Task where F_DeviceIndex=").Append(CurrentLocation).Append(" and F_NumParam4=").Append(CurrentLocation); + dbo.ExceSQL(sbs.ToString()); + //20091102 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Base_Device set F_LockedState=0 where F_LockedState=").Append(monitorIndex); + dbo.ExceSQL(sbs.ToString()); + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Monitor_Task set F_Status =0 where (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + + + } + } + #endregion + + } + #region 堆垛机的送货重和其它任务 + if (devKind == 1) + { + //堆垛机的送货重,只保留堆垛机的送货任务 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_DeviceIndex = "); + sbs.Append(devindex).Append(") AND (F_DeviceCommandIndex = ").Append(devCommand).Append(") AND (F_RouteID = ").Append(routeidNew).Append(") AND (F_Status = 3)"); + dvnew = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dvnew.Count > 0) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("delete from T_Monitor_Task where F_MonitorIndex<").Append(dvnew[0]["F_MonitorIndex"]).Append(" and (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Base_Device set F_LockedState=0 where F_DeviceIndex=").Append(devindex); + dbo.ExceSQL(sbs.ToString()); + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Monitor_Task set F_Status =0 where (F_ManageTaskIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX = 1) AND (F_Status = 3)"); + dbo.ExceSQL(sbs.ToString()); + } + + + } + #endregion + + }//20090910 + + + } + else//未拆分的,修改目标位置和状态(FSTATUS='40'禁用拆分的FIntoStepOK='-'改为FIntoStepOK='0'; + { + //20091128必须使用FENDCELL + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update T_Manage_Task set FENDDEVICE='").Append(FENDDEVICE).Append("',FENDCELL='").Append(FENDCELL).Append("', FIntoStepOK=0 where (FID = ").Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(") AND (F_ManageTASKKINDINDEX =1) and (FIntoStepOK='-')"); + dbo.ExceSQL(sbs.ToString()); + } + //修改T_Manage_Task的FLANEWAY,FSTACK + int flaneway = -1, stackno = -1; + if (int.TryParse(dvIOC[i]["START_DEVICE_CODE"].ToString(), out a) == false) + {//货位编码 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT FLaneWay FROM ST_CELL where FCELLCODE='").Append(dvIOC[i]["START_DEVICE_CODE"]).Append("' and FWAREHOUSE='").Append(dvIOC[i]["START_WAREHOUSE_CODE"]).Append("'"); + obj = dbo.GetSingle(sbs.ToString()); + if (obj != null) + { + flaneway = Convert.ToInt32(obj); + } + } + else + { + if (int.TryParse(dvIOC[i]["END_DEVICE_CODE"].ToString(), out a) == false) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT FLaneWay FROM ST_CELL where FCELLCODE='").Append(dvIOC[i]["END_DEVICE_CODE"]).Append("' and FWAREHOUSE='").Append(dvIOC[i]["END_WAREHOUSE_CODE"]).Append("'"); + obj = dbo.GetSingle(sbs.ToString()); + if (obj != null) + { + flaneway = Convert.ToInt32(obj); + } + } + } + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_StackIndex, F_LaneNo FROM T_Base_StackInfo "); + sbs.Append(" where (F_LaneNo='").Append(flaneway).Append("') OR (F_LaneNo like '%").Append(";").Append(flaneway).Append("') OR (F_LaneNo='").Append(flaneway).Append(";").Append("%') "); + + dv = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + stackno = Convert.ToInt32(dv[0]["F_StackIndex"]); + } + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update dbo.T_Manage_Task set FLANEWAY=").Append(flaneway).Append(",FSTACK=").Append(stackno).Append(" where F_ManageTaskKindIndex=1 and FID=").Append(dvIOC[i]["CONTROL_ID"]); + dbo.ExceSQL(sbs.ToString()); + //20091107 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("update IO_control set CONTROL_status=").Append(Model.CGeneralFunction.TASKRUN).Append(" where (CONTROL_ID = ").Append(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])).Append(")"); + dboM.ExceSQL(sbs.ToString()); + CDataChangeEventArgs cea = new CDataChangeEventArgs(null, null); + OnDataChange("获取任务,GetManagerTask", cea); + } + + #endregion + + + + + } + if (RecCount > 0) + { + //显示调度任务 + CDataChangeEventArgs cea = new CDataChangeEventArgs(null, null); + OnDataChange("获取到管理任务", cea); + + + return RecCount; + } + else + { + //_CObtainTaskError = "没有获得任何调度任务!"; + return 0; + } + } + else + { + //_CObtainTaskError = "管理程序没有下达新的搬运任务!"; + return 0; + } + //20091107 + + } + catch (Exception ex) + { + CObtainTaskError = string.Format("获得调度任务失败,{0}!", ex.StackTrace + ex.Message); + + //throw ex; + return 0; + } + finally + { + dsIOC.Dispose(); + dvIOC.Dispose(); + DMAN.Dispose(); + dv.Dispose(); + dvc.Dispose(); + dvmi.Dispose(); + dvnew.Dispose(); + } + } + + private static bool ManageSendDischargingTask(int startdev, string batch, int ScanDeviceIdx,int arrowDev) + { + //startdev46006/46007/46008管理通知PLC放行对应设备号:设备号+“3” + //ScanDeviceIdx42664的F_BoxBarcode记录批号,F_TaskIndex记录放行单元号 + //arrowDev是42639控制批号放行,其余不控制 + DataView dv = new DataView(); + try + { + if (arrowDev == 42639) + { + sbs.Clear(); + sbs.Append(string.Format("SELECT F_TaskIndex,F_BoxBarcode FROM T_Base_PLC_Ask WHERE (F_TaskIndex>0 and F_DeviceIndex = {0})", ScanDeviceIdx)); + dv = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + if (dv[0]["F_TaskIndex"].ToString() == startdev.ToString() && dv[0]["F_BoxBarcode"].ToString() == batch) + { + return true; + } + else + { + return false; + } + } + } + + devinfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(startdev.ToString() + "3")); + + witemnames[0].Clear(); + witemnames[0].Append("DB1." + devinfo.Dbw1Address.ToString()).Append(",b"); + wv[0].Clear(); + wv[0].Append("2"); + + sdo = CommLayerFactory.CommModeCreate.CreateSendDeviceOrder(devinfo.DeviceIndex); + if (sdo.WriteDBData(witemnames, wv,devinfo.S7Connection) == true) + { + CommonClassLib.CCarryConvert.WriteDarkCasket("OPCClient", "管理通知PLC放行", startdev.ToString(), "批号:" + batch); + if (arrowDev == 42639) + { + dbo.ExecuteSql(string.Format("UPDATE T_Base_PLC_Ask SET F_TaskIndex = {0}, F_BoxBarcode = '{1}' WHERE (F_DeviceIndex = {2})", startdev, batch, ScanDeviceIdx)); + } + } + return true; + } + catch (Exception ex) + { + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", string.Format("获取任务IntegrativeNotifyDischarging时:{0}", ex.StackTrace+ex.Message )); + OnRefreshMonitor(rme); + return false; + } + finally + { + dv.Dispose(); + } + } + + private static bool IFExitSameLayerUnSameEndDevice(string layer, int barcodeBindDevice, string endDevice) + { + DataView dv = new DataView(); + try + { + dv = dbo.ExceSQL(string.Format("SELECT T_Monitor_Task.F_MonitorIndex, T_Manage_Task.FENDDEVICE, T_Monitor_Task.F_NumParam4 FROM T_Manage_Task,T_Monitor_Task where T_Manage_Task.FID = T_Monitor_Task.F_ManageTaskIndex and T_Manage_Task.F_ManageTaskKindIndex = T_Monitor_Task.F_ManageTASKKINDINDEX and (T_Manage_Task.FENDDEVICE LIKE '{0}%') AND (T_Manage_Task.FENDDEVICE <> '{1}') AND (T_Monitor_Task.F_NumParam4 = {2})", layer, endDevice, barcodeBindDevice)).Tables[0].DefaultView; + if (dv.Count > 0) + { + return true ; + } + else + { + return false; + } + } + catch (Exception ex) + { + CObtainTaskError = string.Format("获取任务时,判断是否有同层不同检定单元任务未通过合流扫描器IFExitSameLayerUnSameEndDevice:{0}", ex.StackTrace+ex.Message ); + return false; + } + finally + { + dv.Dispose(); + } + } + + private static string GetFUseForkFromManage(int p) + { + DataView dv = new DataView(); + try + { + dv = dboM.ExceSQL(string.Format("SELECT START_DEVICE_CODE FROM IO_CONTROL WHERE (CONTROL_ID ={0})", p)).Tables[0].DefaultView; + if (dv.Count > 0) + { + return dv[0]["START_DEVICE_CODE"].ToString().Trim().Substring(5, 1); + + } + else + { + return "0"; + } + } + catch (Exception ex) + { + CObtainTaskError = string.Format("获取任务时,查找任务的货叉GetFUseForkFromManage:{0}", ex.StackTrace+ex.Message ); + return "0"; + } + finally + { + dv.Dispose(); + } + } + + static void RecordMaxManageTaskFID(int fid) + { + //20101124 + StringBuilder sql = new StringBuilder(); + + DataSet ds= dbo.ExceSQL("select F_ManageTaskIndex from T_Base_Manage_Task_Index_Auto_Task"); + DataView dv = ds.Tables[0].DefaultView; + if (dv.Count > 0) + { + if (fid > Convert.ToInt32(dv[0]["F_ManageTaskIndex"])) + { + //20101124 + sql.Append("UPDATE T_Base_Manage_Task_Index_Auto_Task SET F_ManageTaskIndex =" ).Append( fid); + dbo.ExceSQL(sql.ToString()); + } + } + else + { + //20101124 + sql.Append("INSERT INTO T_Base_Manage_Task_Index_Auto_Task (F_ManageTaskIndex)VALUES (" ).Append( fid ).Append( ")"); + dbo.ExceSQL(sql.ToString()); + } + } + /// + /// 20091005 + /// 获取可用的目标位置:入库的巷道或者出库站台 + /// + /// T_Manage_Task表的行记录 + /// + public static void GetUsableDestination(DataRowView dr) + { + //20100610查找一个路径可用,任务数最少的终点设备 + Dictionary advDev = new Dictionary(); + object ob; + //只修申请改调度任务的路径,不修改调度自动任务路径 + if (dr["F_ManageTaskKindIndex"].ToString() != "1") return; + StringBuilder sql=new StringBuilder();//20101124 + string adviceDev = ""; + sql.Append("SELECT F_TASKKIND, F_DESTINATION FROM T_Base_Destination WHERE (F_Warehouse='").Append(dr["FENDWAREHOUSE"]).Append("') and (F_TASKKIND = ").Append(dr["FCONTROLTASKTYPE"]).Append(") and (F_AbendStation=1) and (F_DESTINATION=").Append(dr["FENDDEVICE"]).Append(")");//20101124 + DataTable dtd = dbo.ExceSQL(sql.ToString()).Tables[0];//20101124 + if (dtd.Rows.Count > 0)//原来终点是应急站台那么还分配这个站台,不需要改变 + { + adviceDev = dtd.Rows[0]["F_DESTINATION"].ToString(); + //20091005 + return; + } + else + { + //查找可用目标位置 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT F_TASKKIND, F_DESTINATION FROM T_Base_Destination WHERE (F_Warehouse='").Append(dr["FENDWAREHOUSE"]).Append("') and (F_TASKKIND = ").Append(dr["FCONTROLTASKTYPE"]).Append(") and (F_DESTINATION <>").Append(dr["FENDDEVICE"]).Append(") and (F_AbendStation=0)"); + DataTable dt = dbo.ExceSQL(sql.ToString()).Tables[0]; + //20101124 + if (dt.Rows.Count > 0) + { + for (int i = 0; i < dt.Rows.Count; i++) + { + if (CDisassembleTask.MinRouteID(Convert.ToInt32(dr["FSTARTDEVICE"]), Convert.ToInt32(dt.Rows[i]["F_DESTINATION"]), dr["FUseAwayFork"]) != -1) + { + //20100610统计到终点设备正在执行的任务数 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("SELECT count(FENDDEVICE) as counts FROM T_Manage_Task where FENDDEVICE='" ).Append( dt.Rows[i]["F_DESTINATION"] ).Append( "' and fstatus>0"); + ob = dbo.GetSingle(sql.ToString()); + advDev.Add(Convert.ToInt32(dt.Rows[i]["F_DESTINATION"]), Convert.ToInt32(ob)); + + //20100610 adviceDev = dt.Rows[i]["F_DESTINATION"].ToString(); + //break; + } + } + if (advDev.Count == 0)//20100610 + { + + return ; + + + } + else + {//20100610 + int mincount = 9999; + foreach (int aaa in advDev.Keys) + { + if (advDev[aaa] < mincount) + { + mincount = advDev[aaa]; + adviceDev = aaa.ToString(); + } + } + if (adviceDev == "") + { + + return ; + + } + } + } + else + { + return; + } + } + + //DataView DV = dboM.ExceSQL("select IO_CONTROL_APPLY_SEQ.NEXTVAL FROM DUAL").Tables[0].DefaultView; + //20101108int fid = dboM.GetManageTableIndex("IO_CONTROL_APPLY"); + string dtime = DateTime.Now.ToString("u"); + dtime = dtime.Substring(0, dtime.Length - 1); + //20091128 + dboM.TransBegin(); + try + { + //20101124 + sql.Remove(0, sql.Length); + sql.Append(" update IO_CONTROL set CONTROL_STATUS=" ).Append( Model.CGeneralFunction.TASKALTERROUTEAPPLY ).Append( " where CONTROL_ID=" ).Append( dr["FID"] ); + dboM.ExceSQL(sql.ToString()); + //向管理申请修改任务// + //20101124 + int appid = dboM.GetManageTableIndex("IO_CONTROL_APPLY", true);//CONTROL_APPLY_ID + + sql.Remove(0, sql.Length); + sql.Append("INSERT INTO IO_CONTROL_APPLY ( CONTROL_APPLY_ID,CONTROL_ID,CONTROL_APPLY_TYPE,WAREHOUSE_CODE, STOCK_BARCODE, DEVICE_CODE, APPLY_TASK_STATUS, CREATE_TIME, "); + sql.Append(" CONTROL_APPLY_REMARK)").Append("VALUES (" ).Append(appid).Append(",").Append( dr["FID"] ).Append( ",2,'" ).Append( dr["FENDWAREHOUSE"] ).Append( "','" ).Append( dr["FPALLETBARCODE"] ).Append( "','" ).Append( adviceDev ).Append( "',0,'" ).Append( dtime ).Append( "',null)"); + + dboM.ExceSQL(sql.ToString()); + dboM.TransCommit(); + //20091102修改调度任务为不可拆分状态 + //20101124 + sql.Remove(0, sql.Length); + sql.Append("update T_Manage_Task set FIntoStepOK='-' where (FID = " ).Append( Convert.ToInt32(dr["FID"]) ).Append( ") AND (F_ManageTASKKINDINDEX =1)"); + dbo.ExceSQL(sql.ToString()); + CommonClassLib.CCarryConvert.WriteDarkCasket("CObtainTask.GetUsableDestination", "获取任务时,向管理申请改道", "管理任务:" + dr["FID"].ToString(), "条码:" + dr["FPALLETBARCODE"].ToString().ToUpper()); + + + } + catch (Exception ex) + { + CObtainTaskError = string.Format("获取任务时,向管理申请改道:{0}", ex.StackTrace+ex.Message ); + dboM.TransRollback(); + } + + } + + + public static bool IfDeleteOutTask(int fid, int deleteflag) + { //20101124 + try + { + if (1 != deleteflag) + { + return false; + } + + StringBuilder strsql = new StringBuilder("select FIntoStepOK from T_Manage_Task where F_ManageTaskKindIndex=1 and FID= "); + strsql.Append(fid ).Append( " and FIntoStepOK <> '1' "); + DataView dv = dbo.ExceSQL(strsql.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + strsql.Remove(0, strsql.Length); + strsql.Append("DELETE FROM T_Manage_Task WHERE (F_ManageTaskKindIndex = 1) AND (FID = " ).Append( fid ).Append( ")"); + dbo.ExceSQL(strsql.ToString()); + strsql.Remove(0, strsql.Length); + strsql.Append("update IO_Control set CONTROL_STATUS=" ).Append( Model.CGeneralFunction.TASKCANCEL ).Append( " where CONTROL_ID=" ).Append( fid); + + dboM.ExceSQL(strsql.ToString()); + return true; + + } + else + { + return false; + } + } + catch (Exception ex) + { + throw ex; + } + } + /// + /// 20101028获取关联任务,同时返回主任务的应该分配的货叉:距离控制柜由近及远货叉序号依次1,2,3,4;'-'代表未分配货叉 + /// + /// 关联任务FID + /// 是否使用远货叉,默认值"-" + /// + static string ObtainDoubleForkTask(object RelativeControlID,string UseAwayFork) + { + + + int i = 0; + DataView dvl; + object obj = null; + string FSTARTCELL = ""; string FENDCELL = ""; char[] cc = new char[1] { '-' }; + int FSTARTDEVICE = 0; int FENDDEVICE = 0; int FSTARTUCODE = 0; int FENDUCODE = 0; + string LOGIC_AREA = string.Empty; + string flaneway = "-1"; + int stackno = -1; + int FStartCol = 0, FStartLayer = 0, FEndCol = 0, FEndLayer = 0; + try + { + //20101124 + sbs.Remove(0, sbs.Length);//20101208 + sbs.Append("select * from IO_CONTROL where CONTROL_ID=").Append(RelativeControlID); + DataView dvIOC = dboM.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dvIOC.Count == 0) return "-"; + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT T_Base_Manage_Task_Kind.F_TaskKindIndex, "); + sbs.Append("T_Manage_Task.F_ManageTaskKindIndex, T_Manage_Task.FID "); + sbs.Append("FROM T_Base_Manage_Task_Kind , T_Manage_Task where "); + sbs.Append("T_Base_Manage_Task_Kind.F_TaskKindIndex = T_Manage_Task.F_ManageTaskKindIndex "); + sbs.Append(" and T_Base_Manage_Task_Kind.F_TaskKindIndex=1 and T_Manage_Task.FID = "); + + sbs.Append(RelativeControlID); + + dvl = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + //20101124 + + if (dvl.Count > 0)// 插入调度任务新记录 + { + return "-"; + } + + int a = 0; + if (int.TryParse(dvIOC[i]["START_DEVICE_CODE"].ToString(), out a) == false) + {//货位编码 + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT FLaneWay,FStack FROM ST_CELL where FCELLCODE='"); + sbs.Append(dvIOC[i]["START_DEVICE_CODE"]).Append("' and FWAREHOUSE='").Append(dvIOC[i]["START_WAREHOUSE_CODE"]).Append("'"); + dvl = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + //20101124 + if (dvl.Count > 0) + { + flaneway = dvl[0]["FLaneWay"].ToString(); + stackno = Convert.ToInt32(dvl[0]["FStack"]);//20101028 + FStartCol = Convert.ToInt32(dvIOC[i]["START_DEVICE_CODE"].ToString().Substring(3, 2)); + FStartLayer = Convert.ToInt32(dvIOC[i]["START_DEVICE_CODE"].ToString().Substring(6, 2)); + } + + } + else + { + + if (int.TryParse(dvIOC[i]["END_DEVICE_CODE"].ToString(), out a) == false) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT FLaneWay,FStack FROM ST_CELL where FCELLCODE='"); + sbs.Append(dvIOC[i]["END_DEVICE_CODE"]); + sbs.Append("' and FWAREHOUSE='").Append(dvIOC[i]["END_WAREHOUSE_CODE"]).Append("'"); + + dvl = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + //20101124 + + if (dvl.Count > 0) + { + flaneway = dvl[0]["FLaneWay"].ToString(); + stackno = Convert.ToInt32(dvl[0]["FStack"]);//20101028 + FEndCol = Convert.ToInt32(dvIOC[i]["END_DEVICE_CODE"].ToString().Substring(3, 2)); + FEndLayer = Convert.ToInt32(dvIOC[i]["END_DEVICE_CODE"].ToString().Substring(6, 2)); + } + } + } + //20101028 + + + //记录调度任务最大索引FID到表T_Base_Manage_Task_Index_Auto_Task + RecordMaxManageTaskFID(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + + if (int.TryParse(dvIOC[i]["START_DEVICE_CODE"].ToString(), out a) == true) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT T_Base_AGV_Gate.F_ChannelsIndex FROM T_Base_Device,T_Base_AGV_Gate where T_Base_Device.F_DeviceIndex = T_Base_AGV_Gate.F_AGVGateDeviceIndex and (T_Base_Device.F_DeviceKindIndex = 9) and (F_AGVGateDeviceIndex = "); + sbs.Append(Convert.ToInt32(dvIOC[i]["START_DEVICE_CODE"])).Append(") "); + obj = dbo.GetSingle(sbs.ToString()); + + if ((obj != null)) + {//AGV站台编码 + FSTARTDEVICE = Convert.ToInt32(obj); + FSTARTCELL = dvIOC[i]["START_DEVICE_CODE"].ToString(); + } + + else + {//站台编码 + FSTARTDEVICE = Convert.ToInt32(dvIOC[i]["START_DEVICE_CODE"]); + FSTARTCELL = "-"; + } + + } + else + {//货位编码 + //20111020 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT FLaneWay,FUCODE,FUCONVEYOR FROM ST_CELL where FCELLCODE='").Append(dvIOC[i]["START_DEVICE_CODE"]) + .Append("' and FWAREHOUSE='").Append(dvIOC[i]["START_WAREHOUSE_CODE"]).Append("'"); + dvl = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + + if (dvl.Count > 0) + { + FSTARTDEVICE = Convert.ToInt32(dvl[0]["FLaneWay"]); + if (dvl[0]["FUCODE"].ToString() != "0") + { + FSTARTCELL = dvl[0]["FUCONVEYOR"].ToString(); + FSTARTUCODE = Convert.ToInt32(dvl[0]["FUCODE"]); + } + else + { + FSTARTCELL = dvIOC[i]["START_DEVICE_CODE"].ToString(); + } + } + else + { + CObtainTaskError = string.Format("获取任务时:没找到调度任务索引:{0},的起点位置!", dvIOC[i]["CONTROL_ID"].ToString()); + return "-"; + } + + //20111020 + } + if (int.TryParse(dvIOC[i]["END_DEVICE_CODE"].ToString(), out a) == true) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT T_Base_AGV_Gate.F_ChannelsIndex FROM T_Base_Device,T_Base_AGV_Gate where T_Base_Device.F_DeviceIndex = T_Base_AGV_Gate.F_AGVGateDeviceIndex and (T_Base_Device.F_DeviceKindIndex = 9) and (F_AGVGateDeviceIndex = ") + .Append(Convert.ToInt32(dvIOC[i]["END_DEVICE_CODE"])).Append(") "); + obj = dbo.GetSingle(sbs.ToString()); + + if ((obj != null)) + {//AGV站台编码 + FENDDEVICE = Convert.ToInt32(obj); + FENDCELL = dvIOC[i]["END_DEVICE_CODE"].ToString(); + } + + else + {//站台编码 + FENDDEVICE = Convert.ToInt32(dvIOC[i]["END_DEVICE_CODE"]); + FENDCELL = "-"; + } + } + else + {//货位编码 + //20111020 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT FLaneWay,FUCODE,FUCONVEYOR FROM ST_CELL where FCELLCODE='").Append(dvIOC[i]["END_DEVICE_CODE"]) + .Append("' and FWAREHOUSE='").Append(dvIOC[i]["END_WAREHOUSE_CODE"]).Append("'"); + + dvl = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + + if (dvl.Count > 0) + { + FENDDEVICE = Convert.ToInt32(dvl[0]["FLaneWay"]); + if (dvl[0]["FUCODE"].ToString() != "0") + { + FENDCELL = dvl[0]["FUCONVEYOR"].ToString(); + FENDUCODE = Convert.ToInt32(dvl[0]["FUCODE"]); + } + else + { + FENDCELL = dvIOC[i]["END_DEVICE_CODE"].ToString(); + } + } + else + { + CObtainTaskError = string.Format("获取任务时:没找到调度任务索引:{0},的终点位置!", dvIOC[i]["CONTROL_ID"].ToString()); + return "-"; + } + //20111020 + + } + + + int FTASKLEVEL = 0;//空托盘组出库的优先级应该最大 + FTASKLEVEL = dvIOC[i]["CONTROL_TASK_LEVEL"] == DBNull.Value ? 0 : Convert.ToInt32(dvIOC[i]["CONTROL_TASK_LEVEL"]); + if (FENDDEVICE == 22052 || FENDDEVICE == 22066)//到拆盘及的任务20170103 + { + FTASKLEVEL=100; + } + if (UseAwayFork == "0") + { + string[] lc = new string[2] { "0", "0" }; + devinfo = Model.CGetInfo.GetDeviceInfo(FSTARTDEVICE); + if (devinfo != null) + { + if (int.TryParse(FSTARTCELL.ToString(), out a) == true) + { + //20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_UseAwayFork FROM T_Base_AGV_Gate WHERE (F_ChannelsIndex=").Append(FSTARTDEVICE) + .Append(") and ( F_AGVGateDeviceIndex= ").Append(FSTARTCELL).Append(")"); + obj = dbo.GetSingle(sbs.ToString()).ToString(); + //20101124 + if (obj != null) + {//AGV站台的双叉属性 + UseAwayFork = obj.ToString(); + } + } + else + { + if (devinfo.DeviceKind == 2) + { + UseAwayFork = devinfo.DoubleFork; + } + } + if (FEndCol > 0) + { + UseAwayFork = ccf.GetLimitXForkNo(FEndCol, FENDDEVICE); + + } + + } + if (UseAwayFork == "0") + { + devinfo = Model.CGetInfo.GetDeviceInfo(FENDDEVICE); + if (devinfo != null) + { + if (int.TryParse(FENDCELL.ToString(), out a) == true) + { + ////20101124 + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_UseAwayFork FROM T_Base_AGV_Gate WHERE (F_ChannelsIndex=").Append(FENDDEVICE) + .Append(") and ( F_AGVGateDeviceIndex= ").Append(FENDCELL).Append(")"); + obj = dbo.GetSingle(sbs.ToString()).ToString(); + //20101124 + if (obj != null) + { + UseAwayFork = obj.ToString(); + } + } + else + { + if (devinfo.DeviceKind == 2) + { + UseAwayFork = devinfo.DoubleFork; + } + } + if (FStartCol > 0) + { + UseAwayFork = ccf.GetLimitXForkNo(FStartCol, FSTARTDEVICE); + + } + + } + + } + } + + + int FSTATUS = 0; + + #region 初始化LOGIC_AREA + LOGIC_AREA = FENDDEVICE.ToString(); + + #endregion + + //20111020 + //P工装板,B标准,G高货位,D大货位 + object[] ob = new object[31] { dvIOC[i]["CONTROL_ID"], 1, dvIOC[i]["MANAGE_ID"], dvIOC[i]["RELATIVE_CONTROL_ID"], dvIOC[i]["STOCK_BARCODE"].ToString(), + 1, dvIOC[i]["CONTROL_TASK_TYPE"],FTASKLEVEL,0,dvIOC[i]["START_WAREHOUSE_CODE"],FSTARTCELL,FSTARTDEVICE, + dvIOC[i]["END_WAREHOUSE_CODE"] ,FENDCELL,FENDDEVICE,FSTATUS,Convert.ToDateTime(dvIOC[i]["CONTROL_BEGIN_TIME"]).ToString("yyyy-MM-dd HH:mm:ss"), + dvIOC[i]["CONTROL_END_TIME"].ToString(),0,dvIOC[i]["CONTROL_REMARK"].ToString().Replace("'",""),flaneway,stackno,UseAwayFork,"", + LOGIC_AREA,FStartCol,FStartLayer,FEndCol,FEndLayer,FSTARTUCODE,FENDUCODE}; + sbs.Remove(0, sbs.Length); + sbs.AppendFormat(string.Format("INSERT INTO T_Manage_Task(FID, F_ManageTaskKindIndex,FMANAGEID,F_RELATIVECONTORLID,FPALLETBARCODE,FMANAGETASKTYPE," + + "FCONTROLTASKTYPE, FTASKLEVEL, FISRETURN,FSTARTWAREHOUSE, FSTARTCELL, FSTARTDEVICE,FENDWAREHOUSE,FENDCELL,FENDDEVICE, FSTATUS, FBEGTIME, FENDTIME," + + "FIntoStepOK,FREMARK,FLANEWAY,FSTACK,FUseAwayFork,FCONTORL_BATCH,FLOGIC_AREA,FStartCol,FStartLayer,FEndCol,FEndLayer,FSTARTUCODE,FENDUCODE)VALUES ({0},{1},{2},{3},'{4}'," + + "'{5}',{6},{7},{8},'{9}','{10}',{11},'{12}','{13}',{14},{15},'{16}','{17}','{18}','{19}',{20},{21},'{22}','{23}','{24}',{25},{26},{27},{28},{29},{30})", ob)); + int rc = dbo.ExecuteSql(sbs.ToString()); + CommonClassLib.CCarryConvert.WriteDarkCasket("CObtainTask", "获取任务:", ",条码[" + dvIOC[i]["STOCK_BARCODE"].ToString() + "]", ",CONTROL_ID:" + dvIOC[i]["CONTROL_ID"].ToString()); + ob = null; + //20111020 + if (rc == 0) return "-"; + else + { + + if (dvIOC[i]["CONTROL_STATUS"].ToString() != Model.CGeneralFunction.TASKSINGLEFORKRUN.ToString()) + { + sbs.Remove(0, sbs.Length); + sbs.Append("update IO_CONTROL set CONTROL_STATUS=").Append(Model.CGeneralFunction.TASKCONTROLREADED) + .Append(" where CONTROL_ID=").Append(dvIOC[i]["CONTROL_ID"]); + dboM.ExecuteSql(sbs.ToString()); + + } + + return UseAwayFork; + } + } + catch (Exception ex) + { + CObtainTaskError = "ObtainDoubleForkTask,"+ex.StackTrace+ex.Message ; + return "0"; + } + } + + private static int GetIOControlFromBarcode(StringBuilder stringBuilder) + { + DataView dv = new DataView(); + try + { + dv = dboM.ExceSQL(string.Format("SELECT CONTROL_ID FROM IO_CONTROL WHERE (STOCK_BARCODE = '{0}')",stringBuilder)).Tables[0].DefaultView; + if (dv.Count > 0) + { + return Convert.ToInt32(dv[0]["CONTROL_ID"]); + } + else + { + return 0; + } + } + catch (Exception ex) + { + CObtainTaskError = string.Format("获取任务时,通过条码查找任务GetIOControlFromBarcode:{0}", ex.StackTrace+ex.Message ); + return 0; + } + finally + { + dv.Dispose(); + } + } + + private static StringBuilder[] GetRelativeBarCodes(string startdevice,string BarCode) + {//20140218 + int binddev = 0; + int.TryParse(startdevice.Substring(0,5), out binddev); + if (binddev == 0) return null; + StringBuilder[] RelativeBarCodes ; + DataView dv = new DataView(); + try + { + dv = dbo.ExceSQL(string.Format("SELECT F_FirstProject,F_BarcodeLength FROM T_Base_PLC_Ask WHERE F_BindingDevice ={1} and (F_FirstProject LIKE '%{0}%')", BarCode, binddev)).Tables[0].DefaultView; + if (dv.Count > 0) + { + int bclength=Convert.ToInt32(dv[0]["F_BarcodeLength"]); + int amount = Convert.ToInt32(dv[0]["F_FirstProject"].ToString().Length) / bclength; + if (amount <= 1) return null; + RelativeBarCodes = new StringBuilder[amount - 1]; + for (int i = 0; i < (amount - 1); i++) + { + RelativeBarCodes[i] = new StringBuilder(""); + } + int getAmount = 0; + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < amount; i++) + { + sb.Clear(); + sb.Append(dv[0]["F_FirstProject"].ToString().Substring(i * bclength + i, bclength)); + if (sb.ToString() != BarCode) + { + RelativeBarCodes[getAmount].Append(sb); + getAmount++; + } + } + return RelativeBarCodes; + } + else + { + return null; + } + } + catch (Exception ex) + { + CObtainTaskError = string.Format("获取任务时,GetRelativeBarCodes判断是否存在多叉入库关联任务的条码:{0}", ex.StackTrace+ex.Message ); + return null; + } + finally + { + dv.Dispose(); + } + } + /// + /// 是否存在同一逻辑区域且不同批号的出库任务没过分道扫描器 + /// + /// 批号 + /// 逻辑区域 + /// + static bool IfSameAreaExitElseBatch(string Batch, string Area) + { + try + { + object ob = null; + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT FID FROM T_Manage_Task WHERE FCONTROLTASKTYPE=2 and F_ManageTaskKindIndex=1 and FLOGIC_AREA ='").Append(Area).Append("'");// 20110331AND FCONTORL_BATCH <> '").Append(Batch).Append("' + DataView dv = dbo.ExceSQL(sbs.ToString()).Tables[0].DefaultView; + if (dv.Count > 0) + { + for (int i = 0; i < dv.Count; i++) + { + sbs.Remove(0, sbs.Length); + sbs.Append("SELECT F_NumParam4 FROM T_Monitor_Task WHERE F_ManageTASKKINDINDEX = 1 AND F_ManageTaskIndex = ").Append(Convert.ToInt32(dv[i]["FID"]));//20110331 + ob = dbo.ExecuteSql(sbs.ToString()); + if (ob != null) + { + if (ob.ToString() == "12030") + { + return true; + } + } + else + { + return true; + } + } + return false; + } + else + { + return false; + } + } + catch (Exception ex) + { + CObtainTaskError = string.Format("获取任务时,判断是否存在同一逻辑区域且不同批号的出库任务:{0}" , ex.StackTrace+ex.Message ); + return false; + } + } + + static void ManageTaskComplete(int fid,int mti) + { + DataView dv = dbo.ExceSQL("SELECT F_ManageTaskKindIndex, F_ManageTaskIndex,F_DeviceIndex,F_MonitorIndex,F_Status,F_DeviceCommandIndex " + + ",F_NumParam2,F_NumParam5,F_TxtParam FROM T_Monitor_Task Where F_ManageTaskIndex=" + fid + " and F_ManageTaskKindIndex= " + + mti).Tables[0].DefaultView; + if (dv.Count > 0) + { + + for (int i = 0; i < dv.Count; i++) + { + if (Convert.ToInt32(dv[i]["F_Status"]) >= 1) + { + cgs.ActionComplete(Convert.ToInt32(dv[i]["F_DeviceIndex"]), Convert.ToInt32(dv[i]["F_MonitorIndex"]), 1); + } + else + { + cgs.ActionComplete(Convert.ToInt32(dv[i]["F_DeviceIndex"]), Convert.ToInt32(dv[i]["F_MonitorIndex"]), Model.CGeneralFunction.TASKFINISH); + } + } + + } + } + + static void IntegrativeNotifyDischarging(int fid, int DeviceIdx) + {//一体化平台通知准备放行对应设备:DeviceIdx+“1” + DataView dv = new DataView(); + try + { + devinfo = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(DeviceIdx.ToString() + "1")); + + witemnames[0].Clear(); + witemnames[0].Append("DB1." + devinfo.Dbw1Address.ToString()).Append(",b"); + wv[0].Clear(); + wv[0].Append("2"); + + sdo = CommLayerFactory.CommModeCreate.CreateSendDeviceOrder(devinfo.DeviceIndex); + if (sdo.WriteDBData(witemnames, wv, devinfo.S7Connection) == true) + { + CommonClassLib.CCarryConvert.WriteDarkCasket("OPCClient", "一体化平台通知准备放行", DeviceIdx.ToString(), "CONTROL_ID:" + fid.ToString()); + sbs.Remove(0, sbs.Length); + sbs.Append("update IO_CONTROL set CONTROL_STATUS=").Append(Model.CGeneralFunction.TASKFINISH) + .Append(" where CONTROL_ID=").Append(fid); + dboM.ExecuteSql(sbs.ToString()); + } + + } + catch (Exception ex) + { + RefreshMonitorEventArgs rme = new RefreshMonitorEventArgs("tsStatus", string.Format("获取任务IntegrativeNotifyDischarging时:{0}", ex.StackTrace+ex.Message )); + OnRefreshMonitor(rme); + return; + } + finally + { + dv.Dispose(); + } + } + } +} diff --git a/WcfControlMonitorLib/CObtainTask.cs b/WcfControlMonitorLib/CObtainTask.cs index af73d87..3d8cfa6 100644 --- a/WcfControlMonitorLib/CObtainTask.cs +++ b/WcfControlMonitorLib/CObtainTask.cs @@ -1208,7 +1208,7 @@ namespace WcfControlMonitorLib } } - static void RecordMaxManageTaskFID(int fid) + static void RecordMaxManageTaskFID(long fid) { //20101124 StringBuilder sql = new StringBuilder(); @@ -1217,7 +1217,7 @@ namespace WcfControlMonitorLib DataView dv = ds.Tables[0].DefaultView; if (dv.Count > 0) { - if (fid > Convert.ToInt32(dv[0]["F_ManageTaskIndex"])) + if (fid > Convert.ToInt64(dv[0]["F_ManageTaskIndex"])) { //20101124 sql.Append("UPDATE T_Base_Manage_Task_Index_Auto_Task SET F_ManageTaskIndex =" ).Append( fid); @@ -1473,7 +1473,7 @@ namespace WcfControlMonitorLib //记录调度任务最大索引FID到表T_Base_Manage_Task_Index_Auto_Task - RecordMaxManageTaskFID(Convert.ToInt32(dvIOC[i]["CONTROL_ID"])); + RecordMaxManageTaskFID(Convert.ToInt64(dvIOC[i]["CONTROL_ID"])); if (int.TryParse(dvIOC[i]["START_DEVICE_CODE"].ToString(), out a) == true) { diff --git a/WcfControlMonitorLib/IBasicControlMonitor.cs b/WcfControlMonitorLib/IBasicControlMonitor.cs index f759dee..0fc758a 100644 --- a/WcfControlMonitorLib/IBasicControlMonitor.cs +++ b/WcfControlMonitorLib/IBasicControlMonitor.cs @@ -227,7 +227,7 @@ namespace WcfControlMonitorLib /// /// [OperationContract] - bool ModifyManageTask(int ManKind, int ManagetaskID, int ActionID, out string Errtext); + bool ModifyManageTask(int ManKind, long ManagetaskID, int ActionID, out string Errtext); /// /// 璁惧鎸囦护璋冩暣 /// @@ -245,7 +245,7 @@ namespace WcfControlMonitorLib /// [OperationContract] bool SetDeviceState(Model.MDevice Devinfo, out string Errtext); - + /// /// 鑾峰緱璁惧淇℃伅 /// @@ -479,7 +479,7 @@ namespace WcfControlMonitorLib /// 璁惧鎸囦护绱㈠紩 /// [OperationContract] - int GetManageTaskIndexFromMonitor(out string errtext, int monitorIndex); + long GetManageTaskIndexFromMonitor(out string errtext, int monitorIndex); /// /// 鑾峰緱璁惧绉嶇被绱㈠紩 /// @@ -564,6 +564,8 @@ namespace WcfControlMonitorLib /// [OperationContract] byte[] GetOneDeviceOrCellString(int DeviceIdx,int ForkIdx,string CellCode,out string errorText); + + // ControlMonitorClient } } diff --git a/WcfControlMonitorLib/IControlMonitor.cs b/WcfControlMonitorLib/IControlMonitor.cs index a5f0342..d415aee 100644 --- a/WcfControlMonitorLib/IControlMonitor.cs +++ b/WcfControlMonitorLib/IControlMonitor.cs @@ -12,6 +12,7 @@ namespace WcfControlMonitorLib /// /// 璋冨害wcf鎺ュ彛 /// + /// //[ServiceContract] [ServiceContract(CallbackContract = typeof(IClient))] public interface IControlMonitor @@ -227,7 +228,7 @@ namespace WcfControlMonitorLib /// /// [OperationContract] - bool ModifyManageTask(int ManKind, int ManagetaskID,int ActionID, out string Errtext); + bool ModifyManageTask(int ManKind, long ManagetaskID,int ActionID, out string Errtext); /// /// 璁惧鎸囦护璋冩暣 /// @@ -489,7 +490,7 @@ namespace WcfControlMonitorLib /// 璁惧鎸囦护绱㈠紩 /// [OperationContract] - int GetManageTaskIndexFromMonitor(out string errtext, int monitorIndex); + long GetManageTaskIndexFromMonitor(out string errtext, int monitorIndex); /// /// 鑾峰緱璁惧绉嶇被绱㈠紩 /// @@ -558,6 +559,7 @@ namespace WcfControlMonitorLib bool WriteDBData(int deviceIndex, string DBBlock, string Wdata, out string errtext); [OperationContract] bool ReConnectOPCServer();//20130817richard + [OperationContract] void ActionError(int DeviceIdx, int TaskIdx, int ErrId); } /// @@ -590,12 +592,12 @@ namespace WcfControlMonitorLib IAsyncResult BeginSendOrderMessage(Model.MonitorInfo mi, AsyncCallback callBack, object state); void EndSendOrderMessage(IAsyncResult ar); - /// - /// 鍙戦丳LC鍑哄叆搴撴ā寮 - /// - /// - [OperationContract] - bool SendInOutMessageToPlc(); + ///// + ///// 鍙戦丳LC鍑哄叆搴撴ā寮 + ///// + ///// + //[OperationContract] + //bool SendInOutMessageToPlc(); } [DataContract] @@ -693,7 +695,7 @@ namespace WcfControlMonitorLib [DataMember(IsRequired = true)] public int ManageTaskKindIndex { set; get; } [DataMember(IsRequired = true)] - public int FID { set; get; } + public long FID { set; get; } [DataMember] public string PalletBarcode { set; get; } [DataMember(IsRequired = true)] @@ -720,7 +722,7 @@ namespace WcfControlMonitorLib [DataMember] public string BarCode { set; get; } [DataMember(IsRequired = true)] - public int ManageTaskIndex { set; get; } + public long ManageTaskIndex { set; get; } [DataMember(IsRequired = true)] public int MonitorIndex { set; get; } [DataMember(IsRequired = true)] diff --git a/WcfControlMonitorLib/SControlMonitor.cs b/WcfControlMonitorLib/SControlMonitor.cs index 4fa0178..93b54ad 100644 --- a/WcfControlMonitorLib/SControlMonitor.cs +++ b/WcfControlMonitorLib/SControlMonitor.cs @@ -566,7 +566,7 @@ namespace WcfControlMonitorLib void ResetSendorder(int askdev, int taskindex, int routeid, int arrowdev) { StringBuilder sql = new StringBuilder(); - int fid = ccf.GetManageTaskIndexfromMonitor(taskindex); + long fid = ccf.GetManageTaskIndexfromMonitor(taskindex); int mankind = ccf.GetManageTaskKindIndexFromMonitor(taskindex); if (DeviceInRouteSub(askdev, routeid) == true) @@ -1208,7 +1208,7 @@ namespace WcfControlMonitorLib /// 璋冨害浠诲姟绱㈠紩 /// 璋冨害浠诲姟绫诲埆 /// - bool GetUsableDestination(int manageTaskIdx, int manageKindIdx) + bool GetUsableDestination(long manageTaskIdx, int manageKindIdx) { //20091128 //DataView DV; @@ -1344,7 +1344,7 @@ namespace WcfControlMonitorLib /// 浠诲姟绫诲瀷绱㈠紩 /// 褰撳墠璁惧绱㈠紩 /// - bool GetUseableRouteIDSub(int manageTaskIdx, int manageKindIdx, int curLocation) + bool GetUseableRouteIDSub(long manageTaskIdx, int manageKindIdx, int curLocation) { DataView dvmi = new DataView(); DataView DMAN = new DataView(); @@ -1749,7 +1749,7 @@ namespace WcfControlMonitorLib try { - int fid = ccf.GetManageTaskIndexfromMonitor(taskindex); + long fid = ccf.GetManageTaskIndexfromMonitor(taskindex); int mti = ccf.GetManageTaskKindIndexFromMonitor(taskindex); if (ccf.GetFCONTROLTASKTYPEFromManageTask(mti, fid) == 2) return; sql.Remove(0, sql.Length); @@ -2741,7 +2741,7 @@ namespace WcfControlMonitorLib CStaticClass.ObtainManageTask = true; CCallService.StartListen();//姘戣埅浜屾墍 鎵撳紑寮鍏冲悗鍚敤绾跨▼璋冪敤绠$悊绯荤粺鐨剋ebapi鎺ュ彛 - + // CObtainTask.StartListen(); return true; } catch @@ -2811,7 +2811,8 @@ namespace WcfControlMonitorLib SocketsTCPIP.CClientTCPIP.InitAllClientTCPIP(); CParsePLCData.StartListen(); CCallService.StartListenPLC();//灞变笢鏃朵唬 - + // CDisassembleTask.StartListen(); + // CDisassembleTask.StartListen(); CUpdateIoControl.StartListen(); // NewWrieDarkCasket 浣嶇疆1 OPCClient.CCommonOPCClient.CreateSubscriptionGroup(); @@ -3592,12 +3593,12 @@ namespace WcfControlMonitorLib dv.Dispose(); } } - public bool ModifyManageTask(int Mankind, int ManagetaskID, int ActionID, out string Errtext) + public bool ModifyManageTask(int Mankind, long ManagetaskID, int ActionID, out string Errtext) { string barcode = ccf.GetBarCodeFromManageTask(ManagetaskID, Mankind); int mti = Mankind; - int fid = ManagetaskID; + long fid = ManagetaskID; int ControlType = ccf.GetFCONTROLTASKTYPEFromManageTask(mti, fid);//姘戣埅浜屾墍 StringBuilder sql = new StringBuilder();//姘戣埅浜屾墍 @@ -3914,7 +3915,7 @@ namespace WcfControlMonitorLib //string userID = ClientShowLists[client].ToString(); int mankind = ccf.GetManageTaskKindIndexFromMonitor(MonitortaskID); - int fid = ccf.GetManageTaskIndexfromMonitor(MonitortaskID); + long fid = ccf.GetManageTaskIndexfromMonitor(MonitortaskID); dv = dbo.ExceSQL("SELECT * FROM T_Monitor_Task Where F_MonitorIndex=" + MonitortaskID).Tables[0].DefaultView; if (dv.Count > 0) @@ -4085,7 +4086,7 @@ namespace WcfControlMonitorLib { int lockstate = 0; - int manTaskReserve = Devinfo.ManTaskReserve; + long manTaskReserve = Devinfo.ManTaskReserve; int chargeLock = Devinfo.Switch_Lock; int errcode = 0; if (Devinfo.RunState == 4) @@ -5015,7 +5016,7 @@ namespace WcfControlMonitorLib /// /// 璁惧鎸囦护绱㈠紩 /// - public int GetManageTaskIndexFromMonitor(out string errtext, int monitorIndex) + public long GetManageTaskIndexFromMonitor(out string errtext, int monitorIndex) { try { @@ -5827,7 +5828,8 @@ namespace WcfControlMonitorLib #region 鏍规嵁鐢垫皵鎶ュ憡涓夊弶鍏宠仈,閰嶄笁鍙 string aa; - int mankind = 0, fid1 = 0, fid2 = 0, fid3 = 0, relFID = 0, tindex = 0; + int mankind = 0, tindex = 0; + long relFID = 0,fid1 = 0, fid2 = 0, fid3 = 0; if (taskindex3 > 0) { mankind = GetManageTaskKindFromMonitor(out aa, taskindex3); @@ -7780,7 +7782,7 @@ namespace WcfControlMonitorLib CommonClassLib.CCarryConvert.WriteDarkCasket("OPCClient", "鎺ユ敹绉伴噸淇℃伅", devidx.ToString(), "閲嶉噺锛" + weight.ToString()); //鍚戠鐞嗗啓鍏ラ噸閲 int mpindex = ccf.GetMonitorTaskIndexFromSendedDevice(devidx); - int manfid = ccf.GetManageTaskIndexfromMonitor(mpindex); + long manfid = ccf.GetManageTaskIndexfromMonitor(mpindex); int manKind = ccf.GetManageTaskKindIndexFromMonitor(mpindex); if (manKind == 1) { @@ -7996,11 +7998,11 @@ namespace WcfControlMonitorLib //devidx = 15002;////妯℃嫙娴嬭瘯 - - int fidd1 = 0, fidd2 = 0, mankindd = 0, relFIDD = 0; + int mankindd = 0; + long fidd1 = 0, fidd2 = 0, relFIDD = 0; string aainfo = string.Empty; int mankind = GetManageTaskKindFromMonitor(out aainfo, taskindex); - int mantaskindex = GetManageTaskIndexFromMonitor(out aainfo, taskindex); + long mantaskindex = GetManageTaskIndexFromMonitor(out aainfo, taskindex); int tasktypee = ccf.GetFCONTROLTASKTYPEFromManageTask(mankind, mantaskindex); int layer = 0; layer = ccf.getLayerFromMonitorTask(taskindex); diff --git a/webapi/WindowsFormsApp1/APIChannel.cs b/webapi/WindowsFormsApp1/APIChannel.cs index 89a0f1b..1bb4a7a 100644 --- a/webapi/WindowsFormsApp1/APIChannel.cs +++ b/webapi/WindowsFormsApp1/APIChannel.cs @@ -157,6 +157,7 @@ namespace WindowsFormsApp1 //CCallService.CANCEL_DATA canceldata = new CCallService.CANCEL_DATA(); //canceldata = wms_wcs_cancel.data; // CCallService.CANCEL_RES_DATA cancelReturn = new CCallService.CANCEL_RES_DATA(); + wms_wcs_cancel.taskId = wms_wcs_cancel.taskId.Trim('D').Trim('C'); string sql = "select * from t_manage_task where FID = '" + wms_wcs_cancel.taskId + "'"; dv = dbo.ExceSQL(sql).Tables[0].DefaultView; if (dv.Count == 1) @@ -257,6 +258,7 @@ namespace WindowsFormsApp1 //CCallService.CANCEL_DATA canceldata = new CCallService.CANCEL_DATA(); //canceldata = wms_wcs_cancel.data; // CCallService.CANCEL_RES_DATA cancelReturn = new CCallService.CANCEL_RES_DATA(); + wms_wcs_cancel.taskId =wms_wcs_cancel.taskId.Trim('D').Trim('C'); string sql = "select * from t_manage_task where FID = '" + wms_wcs_cancel.taskId + "'"; dv = dbo.ExceSQL(sql).Tables[0].DefaultView; if (dv.Count == 1) @@ -622,7 +624,7 @@ namespace WindowsFormsApp1 public IO_CONTROL(CCallService.OUT_MOVE_DATA outdata, string time,string level)//鍑哄簱 绉诲簱 { error_code.Clear(); - wms_id = outdata.taskId; + wms_id = outdata.taskId.Trim('D').Trim('C'); relative_id = -1; barcode = outdata.containerCode; if (outdata.taskType == 2 || outdata.taskType == 3) @@ -644,7 +646,7 @@ namespace WindowsFormsApp1 public IO_CONTROL(CCallService.WMS_WCS_PARAM_IN indata, string time, string level)//鍏ュ簱 { error_code.Clear(); - wms_id = indata.taskId; + wms_id = indata.taskId.Trim('D').Trim('C'); relative_id = -1; barcode = indata.containerCode; if (indata.taskType == 2 || indata.taskType == 3)