private void SaveProductData() { //todo process data try { Product.UpdateStatus(); Product.Save(); Product.ToEntity().Save(); CfgSettings.Production.Update(Product); Log("TransFinish:" + Product, LogLevel.Info); UploadData(); } catch (Exception ex) { Log($"保存数据异常:{ex.Message}", LogLevel.Warning); Station.Machine.Beep(); } finally { if (Product.Status == ProductStatus.ERROR && CfgSettings.BeepOnProductError) { Station.Machine.Beep(); } } TestProcessControl.OnTestFinishEvent(Product); }
private void SaveProductData() { //save production data try { Product.UpdateStatus(); if (Station.Id == 1) { Machine.Ins.Settings.ProductionLeft.Update(Product); Product.Save("LeftData"); Product.ToEntity().Save(); } else if (Station.Id == 2) { Machine.Ins.Settings.ProductionRight.Update(Product); Product.Save("RightData"); Product.ToEntity().Save(); } Log($"Save Product Finish: {Product}"); UploadData(); } catch (Exception ex) { Log($"保存数据失败:{ex.Message}", LogLevel.Warning); Station.Machine.Beep(); } finally { if (Machine.Ins.Settings.Common.BeepOnProductNG && Product.Status != ProductStatus.OK) { Station.Machine.Beep(); } } TestProcessControl.OnTestFinishEvent(Product); }