Commit ac16d9ef 刘韬

1

1 个父辈 79219ffa
...@@ -8,73 +8,134 @@ using System.Threading.Tasks; ...@@ -8,73 +8,134 @@ using System.Threading.Tasks;
namespace OnlineStore.Common namespace OnlineStore.Common
{ {
public class Pn_Algo_Match public class Pn_Algo_Match
{ {
static Dictionary<string, string> algopnList; static Dictionary<string, AlgoData> algopnList_v2;
const string algopnFile = "Config\\algopn.txt"; const string algopnFile = "Config\\algopn.txt";
const string algopnFile_v2 = "Config\\algopn_V2.txt";
public static Dictionary<string, AlgoData> List { get => algopnList_v2; }
public static event EventHandler<string[]> OnloadAlgoPN;
static Pn_Algo_Match() static Pn_Algo_Match()
{ {
algopnList = new Dictionary<string, string>(); algopnList_v2 = new Dictionary<string, AlgoData>();
LoadFile(); LoadFile();
} }
public static void LoadFile() public static void LoadFile()
{ {
if (!File.Exists(algopnFile)) if (File.Exists(algopnFile) && !File.Exists(algopnFile_v2))
{
UpgradeV1toV2();
}
if (!File.Exists(algopnFile_v2))
{ {
SaveFile(); SaveFile();
return; return;
} }
var ls = File.ReadAllText(algopnFile); var ls = File.ReadAllText(algopnFile_v2);
algopnList = JsonConvert.DeserializeObject<Dictionary<string, string>>(ls); algopnList_v2 = JsonConvert.DeserializeObject<Dictionary<string, AlgoData>>(ls);
if (algopnList_v2 == null)
algopnList_v2 = new Dictionary<string, AlgoData>();
OnloadAlgoPN?.Invoke(null, algopnList_v2.Keys.ToArray());
} }
static void SaveFile() static void SaveFile()
{ {
Directory.CreateDirectory(Path.GetDirectoryName(algopnFile)); Directory.CreateDirectory(Path.GetDirectoryName(algopnFile_v2));
string s = JsonConvert.SerializeObject(algopnList); File.WriteAllText(algopnFile_v2 + ".ready", JsonConvert.SerializeObject(algopnList_v2));
File.WriteAllText(algopnFile, s); try
File.Copy(algopnFile, algopnFile + "."+DateTime.Now.ToShortDateString(), true); {
File.Delete(algopnFile_v2 + ".bck");
File.Move(algopnFile_v2, algopnFile_v2 + ".bck");
File.Move(algopnFile_v2 + ".ready", algopnFile_v2);
}
catch { }
}
static void UpgradeV1toV2()
{
var ls = File.ReadAllText(algopnFile);
var algopnList = JsonConvert.DeserializeObject<Dictionary<string, string>>(ls);
if (algopnList == null)
{
SaveFile();
return;
}
foreach (var k in algopnList.Keys.ToArray())
{
AlgoData algoData = new AlgoData();
algoData.PN = k;
var d = algopnList[k].Split(',');
algoData.Algo = d[0];
if (d[0] == "IP_Template_PARTS" && d.Length > 1)
{
algoData.TemplateFile = d[1];
if (d.Length > 3)
algoData.fine = double.Parse(d[3]);
}
else if (d.Length > 2)
algoData.fine = double.Parse(d[2]);
if (!algopnList_v2.ContainsKey(k))
algopnList_v2.Add(k, algoData);
}
SaveFile();
} }
public static void Set(string pn, string value, double? finetuning = null) public static void Set(string pn, string value, int? processlevel = null, double? finetuning = null)
{ {
if (string.IsNullOrEmpty(pn)) if (string.IsNullOrEmpty(pn))
return; return;
if (string.IsNullOrEmpty(value)) if (string.IsNullOrEmpty(value))
return; value = "auto";
AlgoData algodata;
//Common.LOG.Info($"set pnalgo pn:{pn}, algo:{value}, finetuning:{finetuning}"); if (algopnList_v2.ContainsKey(pn))
algodata = algopnList_v2[pn];
else
{
algodata = new AlgoData();
algodata.PN = pn;
}
algodata.Algo = value;
if (processlevel.HasValue)
algodata.processlevel = processlevel.Value;
if (finetuning.HasValue)
algodata.fine = finetuning.Value;
if (finetuning != null) LogUtil.info($"set pnalgo pn:{pn}, algo:{value}, processlevel:{processlevel}, finetuning:{finetuning}");
value = value + "," + finetuning.ToString();
if (algopnList.ContainsKey(pn)) if (algopnList_v2.ContainsKey(pn))
algopnList[pn] = value; algopnList_v2[pn] = algodata;
else else
algopnList.Add(pn, value); algopnList_v2.Add(pn, algodata);
SaveFile(); SaveFile();
} }
public static string MatchPN(string pn, out bool hasMatch, out double? finetuning) public static bool MatchPN(string pn, out AlgoData AlgoData)
{ {
hasMatch = false; if (algopnList_v2.ContainsKey(pn))
finetuning = null;
if (algopnList.ContainsKey(pn))
{ {
hasMatch = true; AlgoData = algopnList_v2[pn];
var value = algopnList[pn]; return true;
if (value.IndexOf(",") > 0)
{
var vs = value.Split(',');
if (double.TryParse(vs[1], out double result))
{
value = vs[0];
finetuning = result;
}
}
return value;
} }
else else
return "auto"; {
AlgoData = new AlgoData() { Algo = "auto" };
return false;
}
}
}
[Serializable]
public class AlgoData
{
public string PN { get; set; }
public string Algo { get; set; }
public string TemplateFile { get; set; }
public double fine { get; set; }
public double processlevel { get; set; }
public override string ToString()
{
return $"PN:{PN},{Algo},{TemplateFile},{processlevel},{fine}";
} }
} }
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.Common</RootNamespace> <RootNamespace>OnlineStore.Common</RootNamespace>
<AssemblyName>MyCommon</AssemblyName> <AssemblyName>MyCommon</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
...@@ -39,8 +39,9 @@ ...@@ -39,8 +39,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath> <HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\dll\Newtonsoft.Json.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\1053_CycleLine\TheMachine\bin\Debug\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
......
[{"Name":"Default","inputCounterDataByXRayMachine":"http://10.69.221.80/SCTAEXTERNAL001/api/inputCounterDataByXRayMachine","DetermineReelStorageLocation":"http://10.69.221.80/SCTARLC001/api/RLC/DetermineReelStorageLocation"}]
\ No newline at end of file \ No newline at end of file
{}
\ No newline at end of file \ No newline at end of file
...@@ -87,8 +87,9 @@ namespace DeviceLibrary ...@@ -87,8 +87,9 @@ namespace DeviceLibrary
XRay_03_CloseDoor, XRay_03_CloseDoor,
XRay_04_OpenXray, XRay_04_OpenXray,
XRay_05_GetImage, XRay_05_GetImage,
XRay_06_GetCount, XRay_06_WaitMatchPN,
XRay_07_CloseXray, XRay_06_WaitMatchPN2,
XRay_07_TryAgain,
XRay_08_OpenOutDoor, XRay_08_OpenOutDoor,
XRay_09_SentToLabelStop, XRay_09_SentToLabelStop,
XRay_10_CloseOutDoor, XRay_10_CloseOutDoor,
......
...@@ -22,7 +22,7 @@ namespace DeviceLibrary ...@@ -22,7 +22,7 @@ namespace DeviceLibrary
public static FilterMachine filterMachine; public static FilterMachine filterMachine;
public static T1Machine t1Machine; public static T1Machine t1Machine;
public static XRay XRay=new XRay("XRay"); public static XRay XRay=new XRay("XRay");
public static XrayImage xrayImage = new Asa.XrayImage("XrayImage", XrayImage.DeviceType.HAOBO); public static XrayImage xrayImage = new Asa.XrayImage("XrayImage", XrayImage.DeviceType.HAOBO_V2);
public static Config_XRay Config; public static Config_XRay Config;
public static bool IsLoadOk = true; public static bool IsLoadOk = true;
public static bool IsDebug = false; public static bool IsDebug = false;
...@@ -70,7 +70,7 @@ namespace DeviceLibrary ...@@ -70,7 +70,7 @@ namespace DeviceLibrary
}); });
CodeManager.LoadConfig(); CodeManager.LoadConfig();
PrintBean = new Asa.PrintLabel(Application.StartupPath + "\\Label"); PrintBean = new Asa.PrintLabel(Application.StartupPath + "\\Label",100);
labelMachine.InitPrint(); labelMachine.InitPrint();
if (!XRay.Open(ConfigHelper.Config.Get("XRay_Port"), string.Format("{0:yyyy-MM-dd}", DateTime.Now))) if (!XRay.Open(ConfigHelper.Config.Get("XRay_Port"), string.Format("{0:yyyy-MM-dd}", DateTime.Now)))
{ {
......
...@@ -18,6 +18,12 @@ namespace DeviceLibrary ...@@ -18,6 +18,12 @@ namespace DeviceLibrary
{ {
if (CheckWait(FeedingMoveinfo)) if (CheckWait(FeedingMoveinfo))
return; return;
if (IOValue(IO_XRay_Type.Manual_Confirm_BTN).Equals(IO_VALUE.LOW)) {
Msg.add("The safety grating is blocked", MsgLevel.warning);
return;
}
switch (FeedingMoveinfo.MoveStep) switch (FeedingMoveinfo.MoveStep)
{ {
case MoveStep.Feeding_01_Wait_Detect: case MoveStep.Feeding_01_Wait_Detect:
...@@ -106,7 +112,7 @@ namespace DeviceLibrary ...@@ -106,7 +112,7 @@ namespace DeviceLibrary
} }
else else
{ {
if (true|| IOValue(IO_XRay_Type.Manual_Confirm_BTN).Equals(IO_VALUE.HIGH)) if (IOValue(IO_XRay_Type.Manual_Confirm_BTN).Equals(IO_VALUE.HIGH))
{ {
FeedingMoveinfo.NextMoveStep(MoveStep.Feeding_06_Goto_Xray); FeedingMoveinfo.NextMoveStep(MoveStep.Feeding_06_Goto_Xray);
FeedingMoveinfo.log($"按下入料按钮, 定位气缸下降"); FeedingMoveinfo.log($"按下入料按钮, 定位气缸下降");
......
...@@ -86,6 +86,8 @@ namespace DeviceLibrary ...@@ -86,6 +86,8 @@ namespace DeviceLibrary
{ {
AlarmBuzzer.ON(); AlarmBuzzer.ON();
} }
else if (MoveInfo.MoveStep == MoveStep.XRay_06_WaitMatchPN)
AlarmBuzzer.ON();
else else
{ {
AlarmBuzzer.OFF(); AlarmBuzzer.OFF();
......
...@@ -82,7 +82,29 @@ namespace DeviceLibrary ...@@ -82,7 +82,29 @@ namespace DeviceLibrary
{ {
MoveInfo.NextMoveStep(MoveStep.XRay_08_OpenOutDoor); MoveInfo.NextMoveStep(MoveStep.XRay_08_OpenOutDoor);
MoveInfo.log($"获取图像,开始点料 IsRayOpen:{RobotManage.XRay.IsRayOpen}"); MoveInfo.log($"获取图像,开始点料 IsRayOpen:{RobotManage.XRay.IsRayOpen}");
GetResultTask = Task.Run(()=> { GetCountResult(); }); var ppp = MoveInfo.ReelParam.PN.Split('-');
if (ConfigHelper.Config.Get("NewPnAlert", true) && !databaseProc.Current.HasPn(ppp[0])) {
MoveInfo.NextMoveStep(MoveStep.XRay_06_WaitMatchPN);
MoveInfo.log($"没有匹配到PN需要报警");
}
else
{
Pn_Algo_Match.MatchPN(ppp[0], out AlgoData algoData);
if (algoData.Algo == "NG")
{
GetResultTask = null;
MoveInfo.NextMoveStep(MoveStep.XRay_08_OpenOutDoor);
MoveInfo.ReelParam.IsNg = true;
MoveInfo.ReelParam.NgMsg = "NG算法物料";
MoveInfo.ReelParam.logresult();
MoveInfo.log($"NG算法物料,直接NG,PN:{ppp[0]}");
}
else
GetResultTask = Task.Run(() => {
Thread.CurrentThread.Priority = ThreadPriority.Lowest;
GetCountResult();
});
}
} }
else { else {
MoveInfo.NextMoveStep(MoveStep.XRay_08_OpenOutDoor); MoveInfo.NextMoveStep(MoveStep.XRay_08_OpenOutDoor);
...@@ -94,9 +116,42 @@ namespace DeviceLibrary ...@@ -94,9 +116,42 @@ namespace DeviceLibrary
MoveInfo.log($"关闭X光"); MoveInfo.log($"关闭X光");
RobotManage.XRay.Stop(); RobotManage.XRay.Stop();
IOMove(IO_XRay_Type.Xray_Lock, IO_VALUE.LOW); IOMove(IO_XRay_Type.Xray_Lock, IO_VALUE.LOW);
MoveInfo.StopwatchLog(false, "准备送出"); MoveInfo.StopwatchLog(false, "准备送出");
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); //MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
break; break;
case MoveStep.XRay_06_WaitMatchPN:
case MoveStep.XRay_06_WaitMatchPN2:
Msg.add(crc.GetString("new_reel", "新物料,等待匹配算法!"), MsgLevel.warning);
if (IOValue(IO_Label_Type.Reset_BTN).Equals(IO_VALUE.HIGH))
{
MoveInfo.log("用户确认继续1");
MoveInfo.NextMoveStep(MoveStep.XRay_07_TryAgain);
}
break;
case MoveStep.XRay_07_TryAgain:
MoveInfo.NextMoveStep(MoveStep.XRay_04_OpenXray);
var ppp1 = MoveInfo.ReelParam.PN.Split('-');
Pn_Algo_Match.MatchPN(ppp1[0], out AlgoData algoData1);
if (!databaseProc.Current.HasPn(ppp1[0]))
{
MoveInfo.NextMoveStep(MoveStep.XRay_06_WaitMatchPN);
MoveInfo.log($"没有匹配到PN需要报警");
}
else
if (algoData1.Algo == "NG")
{
//MoveInfo.NextMoveStep(MoveStep.XRay_08_OpenOutDoor);
MoveInfo.ReelParam.IsNg = true;
MoveInfo.ReelParam.NgMsg = "NG算法物料";
MoveInfo.ReelParam.logresult();
MoveInfo.log($"NG算法物料,直接NG,PN:{ppp1[0]}");
}
else
GetResultTask = Task.Run(() => {
Thread.CurrentThread.Priority = ThreadPriority.Lowest;
GetCountResult();
});
break;
case MoveStep.XRay_08_OpenOutDoor: case MoveStep.XRay_08_OpenOutDoor:
MoveInfo.NextMoveStep(MoveStep.XRay_09_SentToLabelStop); MoveInfo.NextMoveStep(MoveStep.XRay_09_SentToLabelStop);
CylinderMove(MoveInfo, IO_XRay_Type.Exit_Close, IO_XRay_Type.Exit_Open, IO_VALUE.HIGH); CylinderMove(MoveInfo, IO_XRay_Type.Exit_Close, IO_XRay_Type.Exit_Open, IO_VALUE.HIGH);
...@@ -263,7 +318,7 @@ namespace DeviceLibrary ...@@ -263,7 +318,7 @@ namespace DeviceLibrary
int xplate_getimage_retry_times = ConfigHelper.Config.Get("xplate_getimage_retry_times",5); int xplate_getimage_retry_times = ConfigHelper.Config.Get("xplate_getimage_retry_times",5);
int xplate_open_retry_times = ConfigHelper.Config.Get("xplate_open_retry_times", 3); int xplate_open_retry_times = ConfigHelper.Config.Get("xplate_open_retry_times", 3);
for (int ii = 1; ii <= xplate_getimage_retry_times; ii++) { for (int ii = 1; ii <= xplate_getimage_retry_times; ii++) {
bool rtn = RobotManage.xrayImage.GetImage(1); bool rtn = RobotManage.xrayImage.GetImage(3);
if (!rtn) if (!rtn)
{ {
if (ii == xplate_getimage_retry_times) if (ii == xplate_getimage_retry_times)
...@@ -337,45 +392,42 @@ namespace DeviceLibrary ...@@ -337,45 +392,42 @@ namespace DeviceLibrary
int result = 0; int result = 0;
int ShrinkOffset = ConfigHelper.Config.Get<int>("ShrinkOffset",100); int ShrinkOffset = ConfigHelper.Config.Get<int>("ShrinkOffset",100);
var pps = MoveInfo.ReelParam.PN.Split('-'); var pps = MoveInfo.ReelParam.PN.Split('-');
var type = Pn_Algo_Match.MatchPN(pps[0],out _,out double? finetuning); Pn_Algo_Match.MatchPN(pps[0], out AlgoData algoData);
MoveInfo.log($"匹配到算法.{pps[0]}={type}, finetuning={finetuning}"); MoveInfo.log($"匹配到算法.{pps}={algoData}");
if (finetuning != null) if (algoData.fine > 0)
{ XrayImage.setFineTuning = algoData.fine;
XrayImage.setFineTuning = finetuning.Value;
}
else else
{
XrayImage.setFineTuning = ConfigHelper.Config.Get("setFineTuningDefault", 0.7); XrayImage.setFineTuning = ConfigHelper.Config.Get("setFineTuningDefault", 0.7);
}
if (type.StartsWith("IP_Template_PARTS")) //if (algoData.processlevel > 0)
// XrayImage.setProcessLevel(algoData.processlevel);
//else
// XrayImage.setProcessLevel(4);
if (algoData.Algo.StartsWith("IP_Template_PARTS"))
{ {
if (!File.Exists(type.Substring(17 + 1))) if (!File.Exists(algoData.TemplateFile))
{ {
MoveInfo.log($"模版文件丢失.{type.Substring(17 + 1)}"); MoveInfo.log($"模版文件丢失.{algoData.TemplateFile}");
type = "auto";
} }
} }
Bitmap dst=null; Bitmap dst = null;
if (type == "auto") if (algoData.Algo == "auto")
{ {
result = XrayImage.GetLocalCount(xrayImagePath, ShrinkOffset, out countStr, out dst); result = XrayImage.GetLocalCount(xrayImagePath, ShrinkOffset, out countStr, out dst);
MoveInfo.log("GetCountResult " + type + " 调用 GetLocalCount 【" + xrayImagePath + "】,返回【" + result + "】,结果【" + string.Join(",",countStr) + "】"); MoveInfo.log("GetCountResult " + algoData.Algo + ", ShrinkOffset=" + ShrinkOffset + ", 调用 GetLocalCount 【" + xrayImagePath + "】,返回【" + result + "】,结果【" + (countStr != null ? string.Join(",", countStr) : "null") + "】");
} }
else if (type.StartsWith("IP_Template_PARTS")) else if (algoData.Algo.StartsWith("IP_Template_PARTS"))
{ {
string template = ""; string template = algoData.TemplateFile;
if (type.Length > 18)
{
template = type.Substring(17 + 1);
}
result = XrayImage.GetLocalCountTemplate(xrayImagePath, ShrinkOffset, template, out countStr, out dst);
MoveInfo.log("GetCountResult " + template + " 调用 GetLocalCountTemplate 【" + xrayImagePath + "】,返回【" + result + "】,结果【" + string.Join(",", countStr) + "】");
result = XrayImage.GetLocalCountTemplate(xrayImagePath, ShrinkOffset, template, out countStr, out dst);
MoveInfo.log("GetCountResult " + template + ", ShrinkOffset=" + ShrinkOffset + ", 调用 GetLocalCountTemplate 【" + xrayImagePath + "】,返回【" + result + "】,结果【" + (countStr != null ? string.Join(",", countStr) : "null") + "】");
} }
else else
{ {
result = XrayImage.GetLocalCountIrregular(xrayImagePath, ShrinkOffset, type.ToString(), out countStr, out dst); result = XrayImage.GetLocalCountIrregular(xrayImagePath, ShrinkOffset, algoData.Algo.ToString(), out countStr, out dst);
MoveInfo.log("GetCountResult " + type + " 调用 GetLocalCountIrregular 【" + xrayImagePath + "】,返回【" + result + "】,结果【" + string.Join(",", countStr) + "】"); MoveInfo.log("GetCountResult " + algoData.Algo + ", ShrinkOffset=" + ShrinkOffset + " 调用 GetLocalCountIrregular 【" + xrayImagePath + "】,返回【" + result + "】,结果【" + (countStr != null ? string.Join(",", countStr) : "null") + "】");
} }
if (dst != null) if (dst != null)
{ {
......
...@@ -9,11 +9,12 @@ ...@@ -9,11 +9,12 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DeviceLibrary</RootNamespace> <RootNamespace>DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName> <AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -58,7 +59,10 @@ ...@@ -58,7 +59,10 @@
<Reference Include="Neotel.Rmaxis"> <Reference Include="Neotel.Rmaxis">
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\Neotel.Rmaxis.dll</HintPath> <HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\Neotel.Rmaxis.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" /> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\1053_CycleLine\TheMachine\bin\Debug\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.114.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> <Reference Include="System.Data.SQLite, Version=1.0.114.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
......
...@@ -8,6 +8,7 @@ using System.IO; ...@@ -8,6 +8,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms;
namespace DeviceLibrary namespace DeviceLibrary
{ {
...@@ -301,8 +302,46 @@ id =@id"; ...@@ -301,8 +302,46 @@ id =@id";
//string sql = "delete FROM MaterialQuantity WHERE datetime < '"+ d + "';delete FROM logs WHERE datetime < '" + d + "';"; //string sql = "delete FROM MaterialQuantity WHERE datetime < '"+ d + "';delete FROM logs WHERE datetime < '" + d + "';";
//sh.ExecuteNonQuery(sql); //sh.ExecuteNonQuery(sql);
} }
HashSet<string> AlgoPnlist = new HashSet<string>();
public void LoadDISTINCTPn()
{
if (!File.Exists("Config\\PnList.txt"))
{
string sql = @"SELECT DISTINCT ReelInfo.PN FROM ReelInfo";
var dt = sh.ExecuteQuery(sql);
for (int i = 0; i < dt.Rows.Count; i++)
{
AlgoPnlist.Add(dt.Rows[i][0].ToString());
}
File.AppendAllLines("Config\\PnList.txt", AlgoPnlist.ToArray());
}
else {
var fls = File.ReadAllLines("Config\\PnList.txt");
for (int i = 0; i < fls.Length; i++)
{
AlgoPnlist.Add(fls[i].ToString());
}
}
Pn_Algo_Match.OnloadAlgoPN += Pn_Algo_Match_OnloadAlgoPN;
}
private void Pn_Algo_Match_OnloadAlgoPN(object sender, string[] e)
{
foreach (var s in e)
AppendPn(s);
}
public void AppendPn(string pn) {
if (!AlgoPnlist.TryGetValue(pn, out _))
{
File.AppendAllText("Config\\PnList.txt", pn + "\r\n");
AlgoPnlist.Add(pn);
}
}
public bool HasPn(string pn) {
return AlgoPnlist.TryGetValue(pn, out _);
}
} }
......
...@@ -12,7 +12,7 @@ namespace DeviceLibrary.Properties { ...@@ -12,7 +12,7 @@ namespace DeviceLibrary.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
internal sealed partial class Settings1 : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings1 : global::System.Configuration.ApplicationSettingsBase {
private static Settings1 defaultInstance = ((Settings1)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings1()))); private static Settings1 defaultInstance = ((Settings1)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings1())));
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="DeviceLibrary.Properties.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="DeviceLibrary.Properties.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" /> <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0" /> <bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0"/>
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
...@@ -26,4 +26,4 @@ ...@@ -26,4 +26,4 @@
</setting> </setting>
</DeviceLibrary.Properties.Settings1> </DeviceLibrary.Properties.Settings1>
</userSettings> </userSettings>
</configuration>
\ No newline at end of file \ No newline at end of file
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace> <RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName> <AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="AutoCountMachine.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <section name="AutoCountMachine.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup> </sectionGroup>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="AutoCountMachine.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="AutoCountMachine.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
<section name="DeviceLibrary.Properties.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="DeviceLibrary.Properties.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<appSettings> <appSettings>
<!--是否开机自动启动料仓--> <!--是否开机自动启动料仓-->
<add key="App_AutoRun" value="1" /> <add key="App_AutoRun" value="1"/>
<add key="Default_Language" value="zh-CN" /> <add key="Default_Language" value="zh-CN"/>
<add key="CodeType" value="QR Code#Data Matrix ECC 200#barcode" /> <add key="CodeType" value="QR Code#Data Matrix ECC 200#barcode"/>
<!--二维码参数文件所在路径,文件名与二维码类型名一样--> <!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="Conifg\" /> <add key="CodeParamPath" value="Conifg\"/>
<add key="CodeCount" value="3" /> <add key="CodeCount" value="3"/>
<add key="Code_Block_Size_List" value="11" /> <add key="Code_Block_Size_List" value="11"/>
<add key="inputCounterDataByXRayMachine" value="http://10.69.221.80/SCTAEXTERNAL001/api/inputCounterDataByXRayMachine" /> <add key="inputCounterDataByXRayMachine" value="http://10.69.221.80/SCTAEXTERNAL001/api/inputCounterDataByXRayMachine"/>
<add key="DetermineReelStorageLocation" value="http://10.69.221.80/SCTARLC001/api/RLC/DetermineReelStorageLocation" /> <add key="DetermineReelStorageLocation" value="http://10.69.221.80/SCTARLC001/api/RLC/DetermineReelStorageLocation"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/AutoScanAndLabel.log" /> <file value="logs/AutoScanAndLabel.log"/>
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8"/>
<appendToFile value="true" /> <appendToFile value="true"/>
<rollingStyle value="Date" /> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd" /> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<appender name="LngResource" type="log4net.Appender.RollingFileAppender"> <appender name="LngResource" type="log4net.Appender.RollingFileAppender">
<file value="logs/LngResource.log" /> <file value="logs/LngResource.log"/>
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8"/>
<appendToFile value="true" /> <appendToFile value="true"/>
<rollingStyle value="Date" /> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd" /> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<logger name="RollingLogFileAppender"> <logger name="RollingLogFileAppender">
<level value="ALL" /> <level value="ALL"/>
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender"/>
</logger> </logger>
<logger name="HCBOARD"> <logger name="HCBOARD">
<level value="ALL" /> <level value="ALL"/>
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender"/>
</logger> </logger>
<logger name="LngResource"> <logger name="LngResource">
<level value="Info" /> <level value="Info"/>
<appender-ref ref="LngResource" /> <appender-ref ref="LngResource"/>
</logger> </logger>
<!--<root> <!--<root>
<level value="Info" /> <level value="Info" />
...@@ -62,14 +62,14 @@ ...@@ -62,14 +62,14 @@
</root>--> </root>-->
</log4net> </log4net>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup> </startup>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" /> <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0" /> <bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0"/>
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
</configuration>
\ No newline at end of file \ No newline at end of file
</configuration>
...@@ -124,7 +124,7 @@ namespace AutoCountMachine ...@@ -124,7 +124,7 @@ namespace AutoCountMachine
//步骤信息展示 //步骤信息展示
this.SuspendLayout(); this.SuspendLayout();
stateView.Items.Clear(); stateView.Items.Clear();
foreach (MoveInfo moveInfo in MoveInfo.List) foreach (MoveInfo moveInfo in MoveInfo.List.ToArray())
{ {
if (moveInfo.Hide) if (moveInfo.Hide)
continue; continue;
...@@ -518,5 +518,26 @@ namespace AutoCountMachine ...@@ -518,5 +518,26 @@ namespace AutoCountMachine
ConfigAppSettings.SaveValue("Default_Language", "en-US"); ConfigAppSettings.SaveValue("Default_Language", "en-US");
crc.LanguageChange(); crc.LanguageChange();
} }
private void 算法匹配最后物料toolStripMenuItem_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(RobotManage.xrayMachine.xrayImagePath))
{
MessageBox.Show("当前尚未点过物料");
return;
}
RobotManage.xrayMachine.MoveInfo.NextMoveStep(MoveStep.XRay_06_WaitMatchPN2);
Task.Run(() => {
Process p = new Process();
p.StartInfo = new ProcessStartInfo("AlgoMatch\\AlgoMatch.exe");
p.StartInfo.WorkingDirectory = Application.StartupPath;
p.StartInfo.Arguments = "singlecount " + RobotManage.xrayMachine.xrayImagePath;
p.Start();
p.WaitForExit();
Pn_Algo_Match.LoadFile();
if (RobotManage.xrayMachine.MoveInfo.MoveStep == MoveStep.XRay_06_WaitMatchPN || RobotManage.xrayMachine.MoveInfo.MoveStep == MoveStep.XRay_06_WaitMatchPN2)
RobotManage.xrayMachine.MoveInfo.NextMoveStep(MoveStep.XRay_07_TryAgain);
});
}
} }
} }
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AutoCountMachine
{
public partial class NGALGOControl : UserControl
{
public NGALGOControl()
{
InitializeComponent();
}
private void NGALGOControl_Load(object sender, EventArgs e)
{
loadlist();
}
void loadlist()
{
listBox1.Items.Clear();
var ngpnlist = Pn_Algo_Match.List.Where(x => x.Value.Algo == "NG").Select(x => x.Key).Distinct().ToList();
var c = 1;
foreach (var ngpn in ngpnlist)
{
listBox1.Items.Add(c+". "+ngpn);
c++;
}
}
private void btn_reload_Click(object sender, EventArgs e)
{
loadlist();
}
private void btn_export_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
string title = "No,PN";
sb.AppendLine(title);
var ngpnlist = Pn_Algo_Match.List.Where(x => x.Value.Algo == "NG").Select(x => x.Key).Distinct().ToList();
var c = 1;
foreach (var ngpn in ngpnlist)
{
sb.AppendLine(c + "," + ngpn);
c++;
}
SaveFileDialog sfd = new SaveFileDialog();
sfd.Title = "Export CSV File";
//sfd.InitialDirectory = @"C:\";
sfd.Filter = "csv files (*.csv)|*.csv";
sfd.DefaultExt = "csv";
sfd.FileName = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss") + ".csv";
sfd.RestoreDirectory = true;
if (sfd.ShowDialog() == DialogResult.OK)
{
string fileName = sfd.FileName;
// 保存CSV文件的逻辑
File.WriteAllText(fileName, sb.ToString());
}
}
}
}
namespace AutoCountMachine
{
partial class NGALGOControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.listBox1 = new System.Windows.Forms.ListBox();
this.btn_reload = new System.Windows.Forms.Button();
this.btn_export = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// listBox1
//
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 12;
this.listBox1.Location = new System.Drawing.Point(3, 3);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(259, 388);
this.listBox1.TabIndex = 0;
//
// btn_reload
//
this.btn_reload.Location = new System.Drawing.Point(333, 3);
this.btn_reload.Name = "btn_reload";
this.btn_reload.Size = new System.Drawing.Size(90, 30);
this.btn_reload.TabIndex = 1;
this.btn_reload.Text = "Reload";
this.btn_reload.UseVisualStyleBackColor = true;
this.btn_reload.Click += new System.EventHandler(this.btn_reload_Click);
//
// btn_export
//
this.btn_export.Location = new System.Drawing.Point(333, 178);
this.btn_export.Name = "btn_export";
this.btn_export.Size = new System.Drawing.Size(90, 30);
this.btn_export.TabIndex = 2;
this.btn_export.Text = "Export";
this.btn_export.UseVisualStyleBackColor = true;
this.btn_export.Click += new System.EventHandler(this.btn_export_Click);
//
// NGALGOControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.btn_export);
this.Controls.Add(this.btn_reload);
this.Controls.Add(this.listBox1);
this.Name = "NGALGOControl";
this.Size = new System.Drawing.Size(661, 482);
this.Load += new System.EventHandler(this.NGALGOControl_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Button btn_reload;
private System.Windows.Forms.Button btn_export;
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -27,8 +27,8 @@ namespace AutoCountMachine ...@@ -27,8 +27,8 @@ namespace AutoCountMachine
//OcrProcess.Run(); //OcrProcess.Run();
//ServerConn.inputCounterDataByXRayMachine("20.K0784.008-615313|1KQ-2111|5000|A2061531315212446|PANASONIC", 9); //ServerConn.inputCounterDataByXRayMachine("20.K0784.008-615313|1KQ-2111|5000|A2061531315212446|PANASONIC", 9);
//return; //return;
databaseProc.Current.InsertOrUpdateRI(1, "123", "234", true, "abc", 345, "asd", "fgh", "try"); //databaseProc.Current.InsertOrUpdateRI(1, "123", "234", true, "abc", 345, "asd", "fgh", "try");
//bool x; //bool x;
//x=IODebounce.Test("123", OnlineStore.LoadCSVLibrary.IO_VALUE.HIGH, OnlineStore.LoadCSVLibrary.IO_VALUE.HIGH,3); //x=IODebounce.Test("123", OnlineStore.LoadCSVLibrary.IO_VALUE.HIGH, OnlineStore.LoadCSVLibrary.IO_VALUE.HIGH,3);
//x = IODebounce.Test("123", OnlineStore.LoadCSVLibrary.IO_VALUE.LOW, OnlineStore.LoadCSVLibrary.IO_VALUE.HIGH, 3); //x = IODebounce.Test("123", OnlineStore.LoadCSVLibrary.IO_VALUE.LOW, OnlineStore.LoadCSVLibrary.IO_VALUE.HIGH, 3);
...@@ -58,7 +58,7 @@ namespace AutoCountMachine ...@@ -58,7 +58,7 @@ namespace AutoCountMachine
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.ThreadException += Application_ThreadException; Application.ThreadException += Application_ThreadException;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
databaseProc.Current.LoadDISTINCTPn();
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); Application.Run(new Form1());
......
...@@ -19,7 +19,7 @@ namespace AutoCountMachine.Properties { ...@@ -19,7 +19,7 @@ namespace AutoCountMachine.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。 // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
......
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>AutoCountMachine</RootNamespace> <RootNamespace>AutoCountMachine</RootNamespace>
<AssemblyName>AutoCountMachine</AssemblyName> <AssemblyName>AutoCountMachine</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
...@@ -60,7 +61,10 @@ ...@@ -60,7 +61,10 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath> <HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" /> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\1053_CycleLine\TheMachine\bin\Debug\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
...@@ -92,6 +96,12 @@ ...@@ -92,6 +96,12 @@
<DependentUpon>AdvanceConfig.cs</DependentUpon> <DependentUpon>AdvanceConfig.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="eyemlib.cs" /> <Compile Include="eyemlib.cs" />
<Compile Include="NGALGOControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="NGALGOControl.designer.cs">
<DependentUpon>NGALGOControl.cs</DependentUpon>
</Compile>
<Compile Include="UCCOMMON\BoxResetControl.cs"> <Compile Include="UCCOMMON\BoxResetControl.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
...@@ -170,6 +180,9 @@ ...@@ -170,6 +180,9 @@
<EmbeddedResource Include="AdvanceConfig.resx"> <EmbeddedResource Include="AdvanceConfig.resx">
<DependentUpon>AdvanceConfig.cs</DependentUpon> <DependentUpon>AdvanceConfig.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="NGALGOControl.resx">
<DependentUpon>NGALGOControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UCCOMMON\BoxResetControl.resx"> <EmbeddedResource Include="UCCOMMON\BoxResetControl.resx">
<DependentUpon>BoxResetControl.cs</DependentUpon> <DependentUpon>BoxResetControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
...@@ -44,19 +44,23 @@ namespace AutoCountMachine ...@@ -44,19 +44,23 @@ namespace AutoCountMachine
this.rb_datafilter_today = new System.Windows.Forms.RadioButton(); this.rb_datafilter_today = new System.Windows.Forms.RadioButton();
this.rb_datafilter_lastMonth = new System.Windows.Forms.RadioButton(); this.rb_datafilter_lastMonth = new System.Windows.Forms.RadioButton();
this.rb_datafilter_thismonth = new System.Windows.Forms.RadioButton(); this.rb_datafilter_thismonth = new System.Windows.Forms.RadioButton();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.nbdtControl1 = new AutoCountMachine.UCCOMMON.NBDTControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.cb_newpnalert = new System.Windows.Forms.CheckBox();
this.linkLabel1 = new System.Windows.Forms.LinkLabel(); this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.btn_setadminpassword = new System.Windows.Forms.Button(); this.btn_setadminpassword = new System.Windows.Forms.Button();
this.cb_autorun = new System.Windows.Forms.CheckBox(); this.cb_autorun = new System.Windows.Forms.CheckBox();
this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox(); this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox();
this.tabPage3 = new System.Windows.Forms.TabPage(); this.tabPage4 = new System.Windows.Forms.TabPage();
this.nbdtControl1 = new AutoCountMachine.UCCOMMON.NBDTControl(); this.ngalgoControl1 = new AutoCountMachine.NGALGOControl();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout(); this.tabPage2.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.tabPage1.SuspendLayout();
this.tabPage3.SuspendLayout(); this.tabPage3.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage4.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// tabControl1 // tabControl1
...@@ -64,6 +68,7 @@ namespace AutoCountMachine ...@@ -64,6 +68,7 @@ namespace AutoCountMachine
this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0); this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1"; this.tabControl1.Name = "tabControl1";
...@@ -241,8 +246,28 @@ namespace AutoCountMachine ...@@ -241,8 +246,28 @@ namespace AutoCountMachine
this.rb_datafilter_thismonth.UseVisualStyleBackColor = true; this.rb_datafilter_thismonth.UseVisualStyleBackColor = true;
this.rb_datafilter_thismonth.CheckedChanged += new System.EventHandler(this.rb_datafilter_thismonth_CheckedChanged); this.rb_datafilter_thismonth.CheckedChanged += new System.EventHandler(this.rb_datafilter_thismonth_CheckedChanged);
// //
// tabPage3
//
this.tabPage3.Controls.Add(this.nbdtControl1);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(764, 535);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "流程配置";
this.tabPage3.UseVisualStyleBackColor = true;
//
// nbdtControl1
//
this.nbdtControl1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.nbdtControl1.Location = new System.Drawing.Point(3, 3);
this.nbdtControl1.Name = "nbdtControl1";
this.nbdtControl1.Size = new System.Drawing.Size(891, 481);
this.nbdtControl1.TabIndex = 0;
//
// tabPage1 // tabPage1
// //
this.tabPage1.Controls.Add(this.cb_newpnalert);
this.tabPage1.Controls.Add(this.linkLabel1); this.tabPage1.Controls.Add(this.linkLabel1);
this.tabPage1.Controls.Add(this.btn_setadminpassword); this.tabPage1.Controls.Add(this.btn_setadminpassword);
this.tabPage1.Controls.Add(this.cb_autorun); this.tabPage1.Controls.Add(this.cb_autorun);
...@@ -256,10 +281,21 @@ namespace AutoCountMachine ...@@ -256,10 +281,21 @@ namespace AutoCountMachine
this.tabPage1.Text = "设置"; this.tabPage1.Text = "设置";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// cb_newpnalert
//
this.cb_newpnalert.AutoSize = true;
this.cb_newpnalert.Location = new System.Drawing.Point(32, 90);
this.cb_newpnalert.Name = "cb_newpnalert";
this.cb_newpnalert.Size = new System.Drawing.Size(138, 18);
this.cb_newpnalert.TabIndex = 13;
this.cb_newpnalert.Text = "新PN物料暂停报警";
this.cb_newpnalert.UseVisualStyleBackColor = true;
this.cb_newpnalert.CheckedChanged += new System.EventHandler(this.cb_newpnalert_CheckedChanged);
//
// linkLabel1 // linkLabel1
// //
this.linkLabel1.AutoSize = true; this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(20, 500); this.linkLabel1.Location = new System.Drawing.Point(19, 464);
this.linkLabel1.Name = "linkLabel1"; this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(14, 14); this.linkLabel1.Size = new System.Drawing.Size(14, 14);
this.linkLabel1.TabIndex = 11; this.linkLabel1.TabIndex = 11;
...@@ -269,7 +305,7 @@ namespace AutoCountMachine ...@@ -269,7 +305,7 @@ namespace AutoCountMachine
// //
// btn_setadminpassword // btn_setadminpassword
// //
this.btn_setadminpassword.Location = new System.Drawing.Point(32, 107); this.btn_setadminpassword.Location = new System.Drawing.Point(32, 148);
this.btn_setadminpassword.Name = "btn_setadminpassword"; this.btn_setadminpassword.Name = "btn_setadminpassword";
this.btn_setadminpassword.Size = new System.Drawing.Size(141, 33); this.btn_setadminpassword.Size = new System.Drawing.Size(141, 33);
this.btn_setadminpassword.TabIndex = 10; this.btn_setadminpassword.TabIndex = 10;
...@@ -298,24 +334,24 @@ namespace AutoCountMachine ...@@ -298,24 +334,24 @@ namespace AutoCountMachine
this.cb_EnableBuzzer.UseVisualStyleBackColor = true; this.cb_EnableBuzzer.UseVisualStyleBackColor = true;
this.cb_EnableBuzzer.CheckedChanged += new System.EventHandler(this.cb_EnableBuzzer_CheckedChanged); this.cb_EnableBuzzer.CheckedChanged += new System.EventHandler(this.cb_EnableBuzzer_CheckedChanged);
// //
// tabPage3 // tabPage4
// //
this.tabPage3.Controls.Add(this.nbdtControl1); this.tabPage4.Controls.Add(this.ngalgoControl1);
this.tabPage3.Location = new System.Drawing.Point(4, 22); this.tabPage4.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3"; this.tabPage4.Name = "tabPage4";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3); this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(764, 535); this.tabPage4.Size = new System.Drawing.Size(764, 535);
this.tabPage3.TabIndex = 2; this.tabPage4.TabIndex = 3;
this.tabPage3.Text = "流程配置"; this.tabPage4.Text = "NG PN";
this.tabPage3.UseVisualStyleBackColor = true; this.tabPage4.UseVisualStyleBackColor = true;
// //
// nbdtControl1 // ngalgoControl1
// //
this.nbdtControl1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.ngalgoControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.nbdtControl1.Location = new System.Drawing.Point(3, 3); this.ngalgoControl1.Location = new System.Drawing.Point(3, 3);
this.nbdtControl1.Name = "nbdtControl1"; this.ngalgoControl1.Name = "ngalgoControl1";
this.nbdtControl1.Size = new System.Drawing.Size(891, 481); this.ngalgoControl1.Size = new System.Drawing.Size(758, 529);
this.nbdtControl1.TabIndex = 0; this.ngalgoControl1.TabIndex = 0;
// //
// SettingControl // SettingControl
// //
...@@ -329,9 +365,10 @@ namespace AutoCountMachine ...@@ -329,9 +365,10 @@ namespace AutoCountMachine
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.panel1.PerformLayout(); this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.tabPage3.ResumeLayout(false);
this.tabPage1.ResumeLayout(false); this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout(); this.tabPage1.PerformLayout();
this.tabPage3.ResumeLayout(false); this.tabPage4.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
...@@ -360,5 +397,8 @@ namespace AutoCountMachine ...@@ -360,5 +397,8 @@ namespace AutoCountMachine
private System.Windows.Forms.TextBox textBox_search; private System.Windows.Forms.TextBox textBox_search;
private System.Windows.Forms.TabPage tabPage3; private System.Windows.Forms.TabPage tabPage3;
private UCCOMMON.NBDTControl nbdtControl1; private UCCOMMON.NBDTControl nbdtControl1;
private System.Windows.Forms.CheckBox cb_newpnalert;
private System.Windows.Forms.TabPage tabPage4;
private NGALGOControl ngalgoControl1;
} }
} }
...@@ -89,7 +89,7 @@ namespace AutoCountMachine ...@@ -89,7 +89,7 @@ namespace AutoCountMachine
cb_autorun.Checked = Config.Get("App_AutoRun", false); cb_autorun.Checked = Config.Get("App_AutoRun", false);
this.cb_autorun.CheckedChanged += new System.EventHandler(this.cb_autorun_CheckedChanged); this.cb_autorun.CheckedChanged += new System.EventHandler(this.cb_autorun_CheckedChanged);
rb_datafilter_today.Checked = true; rb_datafilter_today.Checked = true;
cb_newpnalert.Checked = Config.Get("NewPnAlert", true);
} }
private void RoleManger_RoleChange(object sender, Role e) private void RoleManger_RoleChange(object sender, Role e)
...@@ -196,5 +196,10 @@ namespace AutoCountMachine ...@@ -196,5 +196,10 @@ namespace AutoCountMachine
DataTable dt = databaseProc.Current.GetDatabyWhereString(sql); DataTable dt = databaseProc.Current.GetDatabyWhereString(sql);
showData(dt); showData(dt);
} }
private void cb_newpnalert_CheckedChanged(object sender, EventArgs e)
{
Config.Set("NewPnAlert", cb_newpnalert.Checked);
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!