|
|
@@ -98,6 +98,7 @@ namespace CarMeterSystem
|
|
|
wgt = 0;
|
|
|
temporaryResult = "";
|
|
|
temporaryCarNo = "";
|
|
|
+ NewMessageArrived += new HandleMessageDelegate(OnMessageArrived);//rxh add
|
|
|
if (!string.IsNullOrEmpty(PbCache.sportInfo.ledIp) && PbCache.monitor.isTakeOver != "1" && PbCache.monitor.isTakeOver != "2")
|
|
|
{
|
|
|
led_controler = new LED_Control(PbCache.sportInfo.ledIp);
|
|
|
@@ -114,7 +115,8 @@ namespace CarMeterSystem
|
|
|
btnFH.Visible = true;
|
|
|
}
|
|
|
btnTare.Visible = false;
|
|
|
- timer1.Start();
|
|
|
+ //timer1.Start();//rxh delete
|
|
|
+ //StartRefreshData(0);//rxh add
|
|
|
lbPointName.Text = PbCache.sportInfo.baseSpotName;
|
|
|
ucCarMeterInfoJisco1.setMeterType(PbCache.bussinessTypeName);
|
|
|
tableLayoutPanelPromptMsg.CellBorderStyle = (TableLayoutPanelCellBorderStyle)BorderStyle.FixedSingle;
|
|
|
@@ -132,9 +134,10 @@ namespace CarMeterSystem
|
|
|
|
|
|
public void init()
|
|
|
{
|
|
|
+ isMeasureSuccess = false;
|
|
|
|
|
|
PbCache.mwPreFirst = meterWorkCarActualFirst;
|
|
|
-
|
|
|
+
|
|
|
PbCache.isPre = false;
|
|
|
|
|
|
//不显示重量
|
|
|
@@ -147,7 +150,8 @@ namespace CarMeterSystem
|
|
|
btnTare.Visible = false;
|
|
|
|
|
|
btnSave.Enabled = true;
|
|
|
- timer1.Start();
|
|
|
+ //timer1.Start();//rxh detele
|
|
|
+ StartRefreshData(0);//rxh add
|
|
|
lbPointName.Text = PbCache.sportInfo.baseSpotName;
|
|
|
ucCarMeterInfoJisco1.setMeterType(PbCache.bussinessTypeName);
|
|
|
tableLayoutPanelPromptMsg.CellBorderStyle = (TableLayoutPanelCellBorderStyle)BorderStyle.FixedSingle;
|
|
|
@@ -175,7 +179,7 @@ namespace CarMeterSystem
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (PbCache.collect != null && PbCache.collect.weightStatus != 0)
|
|
|
+ if (PbCache.collect != null && PbCache.collect.weightStatus != 0)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
@@ -231,13 +235,14 @@ namespace CarMeterSystem
|
|
|
#endregion 红外对射及量程验证
|
|
|
|
|
|
//仪表重量验证
|
|
|
- if (!dataValidity.ValidMethod(PbCache.lockWgt)) {
|
|
|
+ if (!dataValidity.ValidMethod(PbCache.lockWgt))
|
|
|
+ {
|
|
|
PbCache.isLockFrm = false;
|
|
|
btnSave.Enabled = true;
|
|
|
setMsg(PbCache.ResultMessage);
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//物资名称验证与类型类型的关系验证;业务类型验证
|
|
|
if (!validMatterName.ValidMethod(preTrack))
|
|
|
{
|
|
|
@@ -650,7 +655,7 @@ namespace CarMeterSystem
|
|
|
|
|
|
if (strRm.Data.result) //说明:标识当前跑了一个场景成功了;场景完成后则返回,不再进行下一个场景的执行操作;
|
|
|
{
|
|
|
- PbCache.ResultMessage = strRm.Data.resultInfo;
|
|
|
+ PbCache.ResultMessage = strRm.Data.resultInfo;
|
|
|
setMsg(PbCache.ResultMessage);
|
|
|
Monitor(strRm.Data);
|
|
|
if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
|
|
|
@@ -696,48 +701,48 @@ namespace CarMeterSystem
|
|
|
}
|
|
|
//else
|
|
|
//{
|
|
|
- //ExecuteMethod em = new ExecuteMethod();
|
|
|
- //try
|
|
|
- //{
|
|
|
- // btnSave.Enabled = false;
|
|
|
- // strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "OuterCarJISCO", "MeterMethod", new object[] { new PreTrackScale { } });
|
|
|
- // if (!string.IsNullOrEmpty(strRm.ResultMessage))
|
|
|
- // {
|
|
|
- // setMsg(strRm.ResultMessage);
|
|
|
- // strMsg = strRm.ResultMessage;
|
|
|
- // PbCache.ResultMessage = strRm.ResultMessage;
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // setMsg(strRm.Data.resultInfo);
|
|
|
- // strMsg = strRm.Data.resultInfo;
|
|
|
- // PbCache.ResultMessage = strRm.Data.resultInfo;
|
|
|
- // }
|
|
|
- // if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
|
|
|
- // {
|
|
|
- // led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
|
|
|
- // }
|
|
|
- // RESTfulResult<string> rms = monitor.doUpdateWf(new MeterWorkMonitor { pointNo = PbCache.sportInfo.baseSpotNo, ferroalloyResult = "1" });
|
|
|
- // if (!rms.Succeed)
|
|
|
- // {
|
|
|
- // lg.WriteLog(3, PbCache.lockCarNo + "求助写入失败");
|
|
|
- // }
|
|
|
- // isStop = false;
|
|
|
- //}
|
|
|
- //catch (Exception exp)
|
|
|
- //{
|
|
|
- // PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
|
|
|
- // //这里是未找到方法的情况
|
|
|
- // lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
|
|
|
- // setMsg(PbCache.ResultMessage);
|
|
|
- // if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
|
|
|
- // {
|
|
|
- // led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
|
|
|
- // }
|
|
|
- // //break;
|
|
|
- // isStop = false;
|
|
|
- // return;
|
|
|
- //}
|
|
|
+ //ExecuteMethod em = new ExecuteMethod();
|
|
|
+ //try
|
|
|
+ //{
|
|
|
+ // btnSave.Enabled = false;
|
|
|
+ // strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "OuterCarJISCO", "MeterMethod", new object[] { new PreTrackScale { } });
|
|
|
+ // if (!string.IsNullOrEmpty(strRm.ResultMessage))
|
|
|
+ // {
|
|
|
+ // setMsg(strRm.ResultMessage);
|
|
|
+ // strMsg = strRm.ResultMessage;
|
|
|
+ // PbCache.ResultMessage = strRm.ResultMessage;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // setMsg(strRm.Data.resultInfo);
|
|
|
+ // strMsg = strRm.Data.resultInfo;
|
|
|
+ // PbCache.ResultMessage = strRm.Data.resultInfo;
|
|
|
+ // }
|
|
|
+ // if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
|
|
|
+ // {
|
|
|
+ // led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
|
|
|
+ // }
|
|
|
+ // RESTfulResult<string> rms = monitor.doUpdateWf(new MeterWorkMonitor { pointNo = PbCache.sportInfo.baseSpotNo, ferroalloyResult = "1" });
|
|
|
+ // if (!rms.Succeed)
|
|
|
+ // {
|
|
|
+ // lg.WriteLog(3, PbCache.lockCarNo + "求助写入失败");
|
|
|
+ // }
|
|
|
+ // isStop = false;
|
|
|
+ //}
|
|
|
+ //catch (Exception exp)
|
|
|
+ //{
|
|
|
+ // PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
|
|
|
+ // //这里是未找到方法的情况
|
|
|
+ // lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
|
|
|
+ // setMsg(PbCache.ResultMessage);
|
|
|
+ // if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
|
|
|
+ // {
|
|
|
+ // led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
|
|
|
+ // }
|
|
|
+ // //break;
|
|
|
+ // isStop = false;
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
//}
|
|
|
}
|
|
|
}
|
|
|
@@ -783,10 +788,10 @@ namespace CarMeterSystem
|
|
|
_ = BeginInvoke(new Action(() => { shotImageScreen(); }));
|
|
|
|
|
|
string sPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "imgShort\\";
|
|
|
-
|
|
|
+
|
|
|
//获取正式目录文件中,本次tempID相关图片
|
|
|
ArrayList files = imageCurlControl.GetFiles(sPath + "formalImg", ".jpg");
|
|
|
- foreach(string filename in files)
|
|
|
+ foreach (string filename in files)
|
|
|
{
|
|
|
// 将原图片重命名为正式图片名称
|
|
|
if (File.Exists(filename) && filename.Contains(PbCache.tempImgId))
|
|
|
@@ -804,7 +809,7 @@ namespace CarMeterSystem
|
|
|
temporaryResult = PbCache.ResultMessage;
|
|
|
temporaryCarNo = PbCache.collect.carno;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
//提示信息,
|
|
|
//txtMsgInfo.Text = PbCache.ResultMessage;
|
|
|
lblog = string.IsNullOrEmpty(PbCache.ResultMessage) ? strMsg : PbCache.ResultMessage;//偶尔出现ResultMessage为空的情况
|
|
|
@@ -868,7 +873,7 @@ namespace CarMeterSystem
|
|
|
else
|
|
|
ucWeightCarTJXJG1.setWeightType("毛重");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}));
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
@@ -882,11 +887,21 @@ namespace CarMeterSystem
|
|
|
lg.WriteLog(3, PbCache.lockCarNo + "称重保存失败:" + ex.Message);
|
|
|
PbCache.isLockFrm = false;
|
|
|
btnSave.Enabled = true;
|
|
|
+ isStop = false;
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- lg.WriteLog(13, PbCache.lockCarNo + "保存事件异常:" + ex.Message);
|
|
|
+ //语音播报
|
|
|
+ //vicPlayClass.GetVoicePlay("称重数据保存失败", PbCache.lockCarNo);
|
|
|
+ //提示信息,
|
|
|
+ //txtMsgInfo.Text = "称重数据保存失败";
|
|
|
+ lblog = "称重数据保存失败!" + ex.Message;
|
|
|
+ DoShowlbLog(lblog);
|
|
|
+ lg.WriteLog(3, PbCache.lockCarNo + "称重保存失败:" + ex.Message);
|
|
|
+ PbCache.isLockFrm = false;
|
|
|
+ btnSave.Enabled = true;
|
|
|
+ isStop = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -903,9 +918,9 @@ namespace CarMeterSystem
|
|
|
|
|
|
PbModelDbService<string> pbp = new PbModelDbService<string>();
|
|
|
RESTfulResult<string> rmT = pbp.executeSqlDataWf(sqls);
|
|
|
- if (rmT.Succeed && rmT.Data != null && rmT.Data.Length>10)
|
|
|
+ if (rmT.Succeed && rmT.Data != null && rmT.Data.Length > 10)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
@@ -925,7 +940,8 @@ namespace CarMeterSystem
|
|
|
/// <summary>
|
|
|
/// 终端截图
|
|
|
/// </summary>
|
|
|
- public void shotImage() {
|
|
|
+ public void shotImage()
|
|
|
+ {
|
|
|
try
|
|
|
{
|
|
|
#region 截取图片信息
|
|
|
@@ -967,7 +983,7 @@ namespace CarMeterSystem
|
|
|
CameraShotCls cameraShot = new CameraShotCls();
|
|
|
cameraShot.CapMethod(tempID);
|
|
|
|
|
|
- lg.WriteLog(35, "完成全部拍照 成功标识:" + PbCache.shotSuccess.ToString() +"车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
|
|
|
+ lg.WriteLog(35, "完成全部拍照 成功标识:" + PbCache.shotSuccess.ToString() + "车号:" + PbCache.lockCarNo + ";重量:" + PbCache.lockWgt + ";时间:" + DateTime.Now.ToLongTimeString());
|
|
|
|
|
|
//*/
|
|
|
|
|
|
@@ -1029,12 +1045,12 @@ namespace CarMeterSystem
|
|
|
|
|
|
//验证校秤数据
|
|
|
private validCalibration vCalib = new validCalibration();
|
|
|
-
|
|
|
+
|
|
|
//验证对射
|
|
|
private validParkStatus valid = new validParkStatus();
|
|
|
//是否已经播放不验证对射语音
|
|
|
bool isPlayCalibVoice = false;
|
|
|
-
|
|
|
+
|
|
|
//是否已经播放停留超时语音
|
|
|
bool isPlayOvertimeVoice = false;
|
|
|
|
|
|
@@ -1078,6 +1094,10 @@ namespace CarMeterSystem
|
|
|
MeterBaseCar resgiterCarTimer = new MeterBaseCar();
|
|
|
frmMatMsgInfo frmMatMsgInfo = new frmMatMsgInfo();
|
|
|
private void timer1_Tick(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ DualWeight();//rxh modify
|
|
|
+ }
|
|
|
+ private void DualWeight()
|
|
|
{
|
|
|
if (!isStop)
|
|
|
{
|
|
|
@@ -1088,7 +1108,7 @@ namespace CarMeterSystem
|
|
|
}
|
|
|
try
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
|
|
|
if (PbCache.collect.weight < 500)
|
|
|
{
|
|
|
@@ -1097,8 +1117,9 @@ namespace CarMeterSystem
|
|
|
ucWeightCarTJXJG1.setWgtBackColor(false);
|
|
|
isCalibration = true;
|
|
|
PbCache.addWgt = 0;
|
|
|
- this.Hide();
|
|
|
- hidWindow();
|
|
|
+ InRuning = false;//rxh add
|
|
|
+ //this.Hide();//rxh detele
|
|
|
+ //hidWindow();//rxh detele
|
|
|
return;
|
|
|
}
|
|
|
else
|
|
|
@@ -1189,7 +1210,7 @@ namespace CarMeterSystem
|
|
|
if (!string.IsNullOrEmpty(PbCache.monitor.isOverWgt) && PbCache.monitor.isTakeOver == "2" && !isOverSound) //&& !PbCache.isLockFrm)
|
|
|
{
|
|
|
ucWeightCarTJXJG1.setWgtBackColor(true);//称重完成后,显示颜色;
|
|
|
- //txtMsgInfo.Text = "计量完成";
|
|
|
+ //txtMsgInfo.Text = "计量完成";
|
|
|
setMsg("计量完成");
|
|
|
vicPlayClass.GetVoicePlay("计量完成,请离开秤台", PbCache.collect.carno);
|
|
|
PbCache.voiceType = 1;
|
|
|
@@ -1416,7 +1437,7 @@ namespace CarMeterSystem
|
|
|
carService.addCar(new MeterBaseCar { carNo = PbCache.collect.carno, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
|
|
|
registerCar = true;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1438,9 +1459,9 @@ namespace CarMeterSystem
|
|
|
led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未识别,请联系处理");
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
- resCarListScaleTimer = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.collect.carno, validFlag = "0" });
|
|
|
+
|
|
|
+ resCarListScaleTimer = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.collect.carno, validFlag = "0" });
|
|
|
if (resCarListScaleTimer.Succeed)
|
|
|
{
|
|
|
if (resCarListScaleTimer.Data != null && resCarListScaleTimer.Data.Count == 1)
|
|
|
@@ -1449,7 +1470,8 @@ namespace CarMeterSystem
|
|
|
//厂内车辆
|
|
|
if (carScaleTimer.carTypeNo == "001004003")
|
|
|
{
|
|
|
- btnSelPreType.Visible = true;
|
|
|
+ //btnSelPreType.Visible = true;
|
|
|
+ setMsgInfo(btnSelPreType, "true", "2");//rxh add
|
|
|
preTrackScaleCarTimer.carNo = PbCache.collect.carno;
|
|
|
preTrackScaleCarTimer.lineDesc = "1";
|
|
|
rmScaleListCarTimer = PreTrackScaleService.doQueryByFlag(preTrackScaleCarTimer);
|
|
|
@@ -1556,7 +1578,8 @@ namespace CarMeterSystem
|
|
|
}
|
|
|
|
|
|
PbCache.isLockFrm = false;
|
|
|
- btnSave.Enabled = true;
|
|
|
+ //btnSave.Enabled = true;//rxh add
|
|
|
+ setMsgInfo(btnSave, "true", "2");//rxh add
|
|
|
|
|
|
rtInfo rt = new rtInfo();
|
|
|
rt.isWarn = true;
|
|
|
@@ -1565,7 +1588,7 @@ namespace CarMeterSystem
|
|
|
|
|
|
if (!string.IsNullOrEmpty(PbCache.collect.carno))
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
resgiterCarTimer.carNo = PbCache.collect.carno;
|
|
|
resgiterCarTimer.carTypeNo = AppConfigCache.carTypeNo;
|
|
|
resgiterCarTimer.carTypeName = AppConfigCache.carTypeName;
|
|
|
@@ -1585,11 +1608,11 @@ namespace CarMeterSystem
|
|
|
PbCache.lockWgt = PbCache.collect.weight;
|
|
|
|
|
|
//2021年3月15日 期限皮重显示按钮的显示方法修改 isShowBtnTare ValidMethod
|
|
|
- if (termTareCar.isShowBtnTare(TrackCarNo))
|
|
|
- {
|
|
|
- lg.WriteLog(3, string.Format("9车辆[{0}进入期限皮重显示按钮的显示判断", TrackCarNo));
|
|
|
- btnTare.Visible = true;
|
|
|
- }
|
|
|
+ //if (termTareCar.isShowBtnTare(TrackCarNo))
|
|
|
+ //{
|
|
|
+ // lg.WriteLog(3, string.Format("9车辆[{0}进入期限皮重显示按钮的显示判断", TrackCarNo));
|
|
|
+ // btnTare.Visible = true;
|
|
|
+ //}
|
|
|
//
|
|
|
|
|
|
#endregion 查一次是否可留期限皮,可以则显示按钮
|
|
|
@@ -1607,15 +1630,23 @@ namespace CarMeterSystem
|
|
|
//2021年5月10日界面显示单位,调整为T
|
|
|
if (PbCache.collect.weight > firstWgt)
|
|
|
{
|
|
|
- txtGroess.Text = Math.Round((double)PbCache.collect.weight / 1000, 2) + "";
|
|
|
- txtTare.Text = Math.Round(firstWgt / 1000, 2) + "";
|
|
|
+ //txtGroess.Text = Math.Round((double)PbCache.collect.weight / 1000, 2) + "";
|
|
|
+ //txtTare.Text = Math.Round(firstWgt / 1000, 2) + "";
|
|
|
+ //rxh modify
|
|
|
+ setMsgInfo(txtGroess, Math.Round((double)PbCache.collect.weight / 1000, 2) + "", "0");
|
|
|
+ setMsgInfo(txtTare, Math.Round(firstWgt / 1000, 2) + "", "0");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- txtTare.Text = Math.Round((double)PbCache.collect.weight / 1000, 2) + "";
|
|
|
- txtGroess.Text = Math.Round(firstWgt / 1000, 2) + "";
|
|
|
+ //txtTare.Text = Math.Round((double)PbCache.collect.weight / 1000, 2) + "";
|
|
|
+ //txtGroess.Text = Math.Round(firstWgt / 1000, 2) + "";
|
|
|
+ //rxh modify
|
|
|
+ setMsgInfo(txtTare, Math.Round((double)PbCache.collect.weight / 1000, 2) + "", "0");
|
|
|
+ setMsgInfo(txtGroess, Math.Round(firstWgt / 1000, 2) + "", "0");
|
|
|
}
|
|
|
- txtNet.Text = Math.Round(Math.Abs(PbCache.collect.weight - firstWgt) / 1000, 2) + "";
|
|
|
+ //txtNet.Text = Math.Round(Math.Abs(PbCache.collect.weight - firstWgt) / 1000, 2) + "";
|
|
|
+ //rxh modify
|
|
|
+ setMsgInfo(txtNet, Math.Round(Math.Abs(PbCache.collect.weight - firstWgt) / 1000, 2) + "", "0");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1631,7 +1662,8 @@ namespace CarMeterSystem
|
|
|
{
|
|
|
if (!btnSave.Visible)//PbCache.isLockFrm
|
|
|
{
|
|
|
- btnSave.Visible = true;
|
|
|
+ //btnSave.Visible = true;//rxh delete
|
|
|
+ setMsgInfo(btnSave, "true", "2");//rxh add
|
|
|
}
|
|
|
if (!isVoiceDownCar)
|
|
|
{
|
|
|
@@ -1651,7 +1683,8 @@ namespace CarMeterSystem
|
|
|
lg.WriteLog(25, PbCache.lockCarNo + "Sleep后点击保存按钮");
|
|
|
if (PbCache.collect.weight > 500)
|
|
|
{
|
|
|
- this.btnSave.PerformClick();
|
|
|
+ //this.btnSave.PerformClick();//rxh deleted
|
|
|
+ setMsgInfo(btnSave, "true", "7");//rxh add
|
|
|
}
|
|
|
lg.WriteLog(25, PbCache.lockCarNo + "PerformClick后保存按钮");
|
|
|
}
|
|
|
@@ -1662,7 +1695,8 @@ namespace CarMeterSystem
|
|
|
if (!btnSave.Enabled)
|
|
|
{
|
|
|
PbCache.isLockFrm = false;
|
|
|
- btnSave.Enabled = true;
|
|
|
+ //btnSave.Enabled = true;//rxh delete
|
|
|
+ setMsgInfo(btnSave, "true", "2");//rxh add
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1686,7 +1720,8 @@ namespace CarMeterSystem
|
|
|
|
|
|
if (btnSave.Visible && !PbCache.isLockFrm)
|
|
|
{
|
|
|
- btnSave.Visible = false;
|
|
|
+ //btnSave.Visible = false;//rxh delete
|
|
|
+ setMsgInfo(btnSave, "false", "2");//rxh add
|
|
|
lg.WriteLog(14, "车号:" + PbCache.collect.carno + ";对射没对准【" + PbCache.monitorResult.valid_park_status + "】" +
|
|
|
"||重量不是绿色【" + ucWeightT1.isGreenWgt + "】" +
|
|
|
"||重量不稳定 0:重量稳定; 1:重量不稳定; 2:空磅【" + PbCache.collect.weightStatus + "】" +
|
|
|
@@ -1706,15 +1741,61 @@ namespace CarMeterSystem
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ #region 信息提示框
|
|
|
+ //rxh add
|
|
|
+ public void setMsgInfo(Control control, string ResultMessage, string sType)
|
|
|
+ {
|
|
|
+ setMsgMsg(control, ResultMessage, sType);
|
|
|
+ }
|
|
|
+ private void setMsgMsg(Control control, string ResultMessage, string sType)
|
|
|
+ {
|
|
|
+ if (control.InvokeRequired)
|
|
|
+ {
|
|
|
+ Action<Control, string, string> action = new Action<Control, string, string>(setMsgInfo);
|
|
|
+ Invoke(action, new object[] { control, ResultMessage, sType });
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ switch (sType)
|
|
|
+ {
|
|
|
+ case "0":
|
|
|
+ control.Text = ResultMessage;
|
|
|
+ ; break;
|
|
|
+ case "1":
|
|
|
+ control.Enabled = ResultMessage == "true" ? true : false;
|
|
|
+ ; break;
|
|
|
+ case "2":
|
|
|
+ control.Visible = ResultMessage == "true" ? true : false;
|
|
|
+ ; break;
|
|
|
+ case "3":
|
|
|
+ ((RadioButton)control).Checked = ResultMessage == "true" ? true : false;
|
|
|
+ break;
|
|
|
+ case "4":
|
|
|
+ ((ComboBox)control).SelectedValue = ResultMessage;
|
|
|
+ break;
|
|
|
+ case "5":
|
|
|
+ ((RadioButton)control).Visible = ResultMessage == "true" ? true : false;
|
|
|
+ break;
|
|
|
+ case "6":
|
|
|
+ ((CheckBox)control).Checked = ResultMessage == "true" ? true : false;
|
|
|
+ break;
|
|
|
+ case "7":
|
|
|
+ ((Button)control).PerformClick();
|
|
|
+ break;
|
|
|
+ default: break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ #endregion 信息提示框
|
|
|
/// <summary>
|
|
|
/// 是否是联达物料 0否1是
|
|
|
/// </summary>
|
|
|
/// <param name="matterNo"></param>
|
|
|
/// <returns></returns>
|
|
|
- private bool setLianDaMat(string matterNo)
|
|
|
+ private bool setLianDaMat(string matterNo)
|
|
|
{
|
|
|
- if (lianDaQuery == null)
|
|
|
+ if (lianDaQuery == null)
|
|
|
{
|
|
|
RESTfulResult<MeterBaseMatterInfo> result = matterInfoService.doQueryId(matterNo);
|
|
|
if (result.Succeed)
|
|
|
@@ -1868,7 +1949,7 @@ namespace CarMeterSystem
|
|
|
//lg.WriteLog(1, "打印第一个sql:" + sql);
|
|
|
|
|
|
if (rm.Succeed)
|
|
|
- {
|
|
|
+ {
|
|
|
if (rm.Data != null && rm.Data.Count > 0)
|
|
|
{
|
|
|
//2021年6月26日 对一车联运的进行处理;用一次计量编号查二次计量数据,
|
|
|
@@ -2196,7 +2277,7 @@ namespace CarMeterSystem
|
|
|
btnTare.Enabled = true;
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//若存在有效的一次计量数据,则不允许进行期限皮重保存
|
|
|
if (!termTareCar.ValidActualFirst(preTrack))
|
|
|
{
|
|
|
@@ -2240,13 +2321,13 @@ namespace CarMeterSystem
|
|
|
|
|
|
//期限皮重数据保存
|
|
|
RESTfulResult<string> RESTfulResult = termTareDate.doSaveWf(mbttd, monitorNote);
|
|
|
- if (RESTfulResult.Succeed && RESTfulResult.Code !="500")
|
|
|
+ if (RESTfulResult.Succeed && RESTfulResult.Code != "500")
|
|
|
{
|
|
|
PbCache.isLockFrm = true;
|
|
|
PbCache.actualFirstNo = RESTfulResult.Data;
|
|
|
//称重完成后,显示颜色;
|
|
|
_ = BeginInvoke(new Action(() => { ucWeightCarTJXJG1.setWgtBackColor(true); }));
|
|
|
-
|
|
|
+
|
|
|
//称重完成后,显示重量类型为皮重;
|
|
|
_ = BeginInvoke(new Action(() => { ucWeightCarTJXJG1.setWeightType("皮重"); }));
|
|
|
|
|
|
@@ -2373,7 +2454,7 @@ namespace CarMeterSystem
|
|
|
}
|
|
|
if (!string.IsNullOrEmpty(ResultMessage) && PbCache.collect != null)
|
|
|
{
|
|
|
- lg.WriteLog(9, "[" + PbCache.collect.carno + "||"+PbCache.lockCarNo+"]" + ResultMessage);
|
|
|
+ lg.WriteLog(9, "[" + PbCache.collect.carno + "||" + PbCache.lockCarNo + "]" + ResultMessage);
|
|
|
}
|
|
|
|
|
|
#region 记录从上秤到下秤的所有的提示信息
|
|
|
@@ -2439,12 +2520,13 @@ namespace CarMeterSystem
|
|
|
PbCache.monitor.isOverWgt = "";
|
|
|
bRailwayActual = true; //为true时会重新查询一次计量数据
|
|
|
isShowRecover = true;//是否去查询“复磅”按钮的显示与否
|
|
|
- isMeasureSuccess = false;
|
|
|
+
|
|
|
PbCache.Load();
|
|
|
//关闭一些线程及定时任务
|
|
|
- timer1.Stop();
|
|
|
- timer1.Enabled = false;
|
|
|
- //timer1.Dispose();
|
|
|
+ // timer1.Stop();//rxh delete
|
|
|
+ //timer1.Enabled = false;//rxh delete
|
|
|
+
|
|
|
+ //timer1.Dispose();
|
|
|
|
|
|
// 销毁对象
|
|
|
CleanObjectData();
|
|
|
@@ -2538,7 +2620,7 @@ namespace CarMeterSystem
|
|
|
{
|
|
|
meterWorkMonitor.validIsPre = "1";
|
|
|
}
|
|
|
- if(rt.WarnContent == "validWgt")
|
|
|
+ if (rt.WarnContent == "validWgt")
|
|
|
{
|
|
|
meterWorkMonitor.wgtErr = "1";
|
|
|
}
|
|
|
@@ -2658,7 +2740,7 @@ namespace CarMeterSystem
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- if(PbCache.collect.weight > 500 && PbCache.voiceType != 0)
|
|
|
+ if (PbCache.collect.weight > 500 && PbCache.voiceType != 0)
|
|
|
{
|
|
|
vicPlayClass.GetVoicePlay(voiceContent, PbCache.lockCarNo);
|
|
|
}
|
|
|
@@ -2781,7 +2863,7 @@ namespace CarMeterSystem
|
|
|
PbCache.mwPreFirst.theoryAmount = null;
|
|
|
PbCache.mwPreFirst.measureBatchCount = null;
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
private void btnSelPreType_Click(object sender, EventArgs e)
|
|
|
@@ -2796,5 +2878,123 @@ namespace CarMeterSystem
|
|
|
MessageBox.Show("车号为空");
|
|
|
}
|
|
|
}
|
|
|
+ #region 刷新刷新站点状态信息线程
|
|
|
+ //rxh add
|
|
|
+ private Thread thRefreshData;//刷新刷新站点状态信息线程
|
|
|
+ private int refreshDataInterval;
|
|
|
+ private void RefreshDataInTime()
|
|
|
+ {
|
|
|
+ while (InRuning)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ DualWeight();
|
|
|
+ refreshDataInterval = 1000;
|
|
|
+ }
|
|
|
+ catch (Exception ee)
|
|
|
+ {
|
|
|
+ //GlobalInstanceController.Instance.LastCallMessage = ee.Message;
|
|
|
+ refreshDataInterval = 1000;
|
|
|
+ }
|
|
|
+ Thread.Sleep(refreshDataInterval);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private void StopRefreshData()
|
|
|
+ {
|
|
|
+ if (thRefreshData != null)
|
|
|
+ {
|
|
|
+ thRefreshData.Abort();
|
|
|
+ thRefreshData = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private void StartRefreshData(int interval)
|
|
|
+ {
|
|
|
+ refreshDataInterval = (interval == 0 ? 1000 : interval);
|
|
|
+ StopRefreshData();
|
|
|
+ if (thRefreshData == null)
|
|
|
+ {
|
|
|
+ thRefreshData = new Thread(RefreshDataInTime);
|
|
|
+ }
|
|
|
+ InRuning = true;
|
|
|
+ thRefreshData.Start();
|
|
|
+
|
|
|
+ }
|
|
|
+ #endregion 刷新刷新站点状态信息线程
|
|
|
+ #region 消息
|
|
|
+ //rxh add
|
|
|
+ public delegate void HandleMessageDelegate(object sender, object args);
|
|
|
+ public event HandleMessageDelegate NewMessageArrived;
|
|
|
+
|
|
|
+ private bool inRuning;
|
|
|
+ public bool InRuning
|
|
|
+ {
|
|
|
+ get { return this.inRuning; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ this.inRuning = value;
|
|
|
+ this.SafeInvokeMessagedEvent(NewMessageArrived, this.inRuning);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void SafeInvokeMessagedEvent(HandleMessageDelegate eventName, object args)
|
|
|
+ {
|
|
|
+ if (eventName != null)
|
|
|
+ {
|
|
|
+ HandleMessageDelegate mh = null;
|
|
|
+
|
|
|
+ foreach (Delegate del in eventName.GetInvocationList())
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ mh = (HandleMessageDelegate)del;
|
|
|
+ mh(this, args);
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ lg.WriteLog(13,"线程错误");
|
|
|
+ //NewMessageArrived -= mh;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 任务栏显示消息事件
|
|
|
+ /// </summary>
|
|
|
+ private void OnMessageArrived(object sender, object args)
|
|
|
+ {
|
|
|
+ if (this.InvokeRequired)
|
|
|
+ this.Invoke(new HandleMessageDelegate(this.OnMessageArrived), new object[] { sender, args });
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (args.ToString().Equals("False"))
|
|
|
+ {
|
|
|
+ //Thread.Sleep(1000);//不能用,会和close冲突
|
|
|
+ //this.Close();
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ this.hidWindow();
|
|
|
+ this.Hide();
|
|
|
+ //this.StopRefreshData();
|
|
|
+ }
|
|
|
+ catch (Exception ee)
|
|
|
+ {
|
|
|
+ lg.WriteLog(13, "页面关闭事件exp:"+ee.Message.ToString());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion 消息
|
|
|
+
|
|
|
+ private void frmOneYardToEnd_VisibleChanged(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ if (this.Visible == false)
|
|
|
+
|
|
|
+ {
|
|
|
+ //Thread.Sleep(1000);
|
|
|
+ //this.StopRefreshData();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|