src/Bro.Common.Model/GlobalVar.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.Common.Model/Helper/SettingHelper.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.Common.Model/Interface/IProcess.cs | 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.Device.HikCamera/HikCameraDriver.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M071.Process/UI/M071_MainForm.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M071.Process/UI/M071_MainForm.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M071.Process/UI/M071_MainForm.resx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.Process/Bro.Process.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.Process/ProcessControl.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.UI.Model.Winform/UI/CanvasImage.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/Bro.Common.Model/GlobalVar.cs
@@ -6,6 +6,8 @@ { public static ContainerBuilder Builder { get; set; } = new ContainerBuilder(); private static object containerLock = new object(); private static IContainer container = null; public static IContainer Container { @@ -13,8 +15,14 @@ { if (container == null) { lock (containerLock) { if (container == null) { container = Builder.Build(); } } } return container; } src/Bro.Common.Model/Helper/SettingHelper.cs
@@ -76,9 +76,15 @@ return codes; } public static List<string> AddNewProductionCode(string code) public static void AddNewProductionCode(string code) { var dataTemp = GetSettingData(); if (!dataTemp.ContainsKey(PROPERTY_PRODUCTIONCODES)) { dataTemp.Add(PROPERTY_PRODUCTIONCODES, new JArray()); } if (dataTemp != null && dataTemp.ContainsKey(PROPERTY_PRODUCTIONCODES)) { List<string> codes = GetProductionCodes(); @@ -96,7 +102,6 @@ writer.Close(); } } return GetProductionCodes(); } public static string GetConfigFilePath() src/Bro.Common.Model/Interface/IProcess.cs
src/Bro.Device.HikCamera/HikCameraDriver.cs
@@ -463,15 +463,14 @@ { if (nMsgType == MyCamera.MV_EXCEPTION_DEV_DISCONNECT) { Thread.Sleep(1000); Stop(); if (CurrentState != EnumHelper.DeviceState.DSClose) { int reTryTimes = 3; do { Thread.Sleep(1000); Stop(); try { Start(); @@ -484,7 +483,7 @@ if (reTryTimes > 0) { //OnLog?.Invoke(DateTime.Now, this, "重新连接相机异常\r\n" + ex.GetExceptionMessage()); LogAsync(DateTime.Now, "重新连接异常", ex.GetExceptionMessage()); LogAsync(DateTime.Now, $"{this.Name}重新连接异常", ex.GetExceptionMessage()); } else { src/Bro.M071.Process/UI/M071_MainForm.Designer.cs
@@ -33,6 +33,7 @@ this.tsmiShowToolBar = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiShowStatusBar = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiShowEditor = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiRefreshLabels = new System.Windows.Forms.ToolStripMenuItem(); this.btnReset = new System.Windows.Forms.Button(); this.btnStartMeasure = new System.Windows.Forms.Button(); this.lblCT = new System.Windows.Forms.Label(); @@ -48,7 +49,7 @@ this.lvMeasures = new System.Windows.Forms.ListView(); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.propGridKeyIndicator = new System.Windows.Forms.PropertyGrid(); this.tsmiRefreshLabels = new System.Windows.Forms.ToolStripMenuItem(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.contextMenuStrip1.SuspendLayout(); this.plImage.SuspendLayout(); this.tscEditLocation.ContentPanel.SuspendLayout(); @@ -68,13 +69,13 @@ this.tsmiShowEditor, this.tsmiRefreshLabels}); this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Size = new System.Drawing.Size(181, 114); this.contextMenuStrip1.Size = new System.Drawing.Size(149, 92); // // tsmiShowToolBar // this.tsmiShowToolBar.CheckOnClick = true; this.tsmiShowToolBar.Name = "tsmiShowToolBar"; this.tsmiShowToolBar.Size = new System.Drawing.Size(180, 22); this.tsmiShowToolBar.Size = new System.Drawing.Size(148, 22); this.tsmiShowToolBar.Text = "显示工具条"; this.tsmiShowToolBar.CheckedChanged += new System.EventHandler(this.tsmiShowToolBar_CheckedChanged); // @@ -82,7 +83,7 @@ // this.tsmiShowStatusBar.CheckOnClick = true; this.tsmiShowStatusBar.Name = "tsmiShowStatusBar"; this.tsmiShowStatusBar.Size = new System.Drawing.Size(180, 22); this.tsmiShowStatusBar.Size = new System.Drawing.Size(148, 22); this.tsmiShowStatusBar.Text = "显示状态栏"; this.tsmiShowStatusBar.CheckedChanged += new System.EventHandler(this.tsmiShowStatusBar_CheckedChanged); // @@ -90,9 +91,16 @@ // this.tsmiShowEditor.CheckOnClick = true; this.tsmiShowEditor.Name = "tsmiShowEditor"; this.tsmiShowEditor.Size = new System.Drawing.Size(180, 22); this.tsmiShowEditor.Size = new System.Drawing.Size(148, 22); this.tsmiShowEditor.Text = "编辑显示点位"; this.tsmiShowEditor.CheckedChanged += new System.EventHandler(this.tsmiShowEditor_CheckedChanged); // // tsmiRefreshLabels // this.tsmiRefreshLabels.Name = "tsmiRefreshLabels"; this.tsmiRefreshLabels.Size = new System.Drawing.Size(148, 22); this.tsmiRefreshLabels.Text = "刷新显示点位"; this.tsmiRefreshLabels.Click += new System.EventHandler(this.tsmiRefreshLabels_Click); // // btnReset // @@ -293,12 +301,10 @@ this.propGridKeyIndicator.TabIndex = 0; this.propGridKeyIndicator.ToolbarVisible = false; // // tsmiRefreshLabels // timer1 // this.tsmiRefreshLabels.Name = "tsmiRefreshLabels"; this.tsmiRefreshLabels.Size = new System.Drawing.Size(180, 22); this.tsmiRefreshLabels.Text = "刷新显示点位"; this.tsmiRefreshLabels.Click += new System.EventHandler(this.tsmiRefreshLabels_Click); this.timer1.Interval = 3000; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // M071_MainForm // @@ -353,5 +359,6 @@ private System.Windows.Forms.Button btnReset; private System.Windows.Forms.ColumnHeader columnHeader1; private System.Windows.Forms.ToolStripMenuItem tsmiRefreshLabels; private System.Windows.Forms.Timer timer1; } } src/Bro.M071.Process/UI/M071_MainForm.cs
@@ -40,6 +40,8 @@ cvImage.SetScreenSize(); cvImage.OnElementChangedHandle -= CvImage_OnElementChangedHandle; cvImage.OnElementChangedHandle += CvImage_OnElementChangedHandle; timer1.Enabled = true; }; } @@ -284,6 +286,10 @@ { _barcode += keyStr.ToUpper(); } else if (keyStr.Length == 2 && keyStr.StartsWith("D")) { _barcode += keyStr.Substring(1).ToUpper(); } if (e.KeyValue == 13) { @@ -475,5 +481,9 @@ } #endregion private void timer1_Tick(object sender, EventArgs e) { cvImage.Refresh(); } } } src/Bro.M071.Process/UI/M071_MainForm.resx
@@ -120,4 +120,7 @@ <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>182, 17</value> </metadata> </root> src/Bro.Process/Bro.Process.csproj
@@ -128,9 +128,7 @@ </ItemGroup> <ItemGroup> <None Include="packages.config" /> <None Include="Setting.json"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Include="Setting.json" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Forms\Calibration\FrmCalibration_9P.resx"> @@ -170,9 +168,5 @@ <Error Condition="!Exists('..\..\packages\PostSharp.6.2.7\build\PostSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\PostSharp.6.2.7\build\PostSharp.targets'))" /> </Target> <Import Project="..\..\packages\PostSharp.6.2.7\build\PostSharp.targets" Condition="Exists('..\..\packages\PostSharp.6.2.7\build\PostSharp.targets')" /> <ProjectExtensions> <VisualStudio> <UserProperties setting_1json__JsonSchema="https://batect.dev/configSchema.json" /> </VisualStudio> </ProjectExtensions> <ProjectExtensions /> </Project> src/Bro.Process/ProcessControl.cs
@@ -348,10 +348,16 @@ { if (config == null) throw new ProcessException("保存的配置信息不能为空"); ProductionCode = newProductionCode; string newConfigPath = Path.Combine(Path.GetDirectoryName(_configPath), $"Config_{newProductionCode}.json"); if (File.Exists(newConfigPath)) { throw new ProcessException($"{newProductionCode}配置文件已经存在"); } //生成config.json string newConfig = JsonConvert.SerializeObject(config, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All }); using (StreamWriter writer = new StreamWriter(_configPath, false, System.Text.Encoding.UTF8)) using (StreamWriter writer = new StreamWriter(newConfigPath, false, System.Text.Encoding.UTF8)) { writer.Write(newConfig); writer.Flush(); @@ -359,7 +365,7 @@ } //添加到Setting.json SettingHelper.AddNewProductionCode(ProductionCode); SettingHelper.AddNewProductionCode(newProductionCode); } catch (Exception ex) { src/Bro.UI.Model.Winform/UI/CanvasImage.cs
@@ -614,6 +614,9 @@ if (map == null) return; MAP?.Dispose(); MAP = null; MAP = map; //MAP = map;