Commit ac77009b 顾剑亮

debug

1 个父辈 f50be7f3
正在显示 32 个修改的文件 包含 201 行增加37 行删除
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\Asa.CarerayImage.xml</DocumentationFile> <DocumentationFile>bin\Debug\Asa.CarerayImage.xml</DocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
...@@ -32,6 +33,9 @@ ...@@ -32,6 +33,9 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\..\..\DLL\log4net.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
......
...@@ -9,6 +9,11 @@ ...@@ -9,6 +9,11 @@
Careray平板图像 Careray平板图像
</summary> </summary>
</member> </member>
<member name="M:Asa.CarerayImage.#ctor(System.String)">
<summary>
Careray平板图像
</summary>
</member>
<member name="P:Asa.CarerayImage.WindowWidth"> <member name="P:Asa.CarerayImage.WindowWidth">
<summary> <summary>
窗宽 窗宽
...@@ -19,14 +24,42 @@ ...@@ -19,14 +24,42 @@
窗位 窗位
</summary> </summary>
</member> </member>
<member name="M:Asa.CarerayImage.#ctor"> <member name="P:Asa.CarerayImage.ImageWidth">
<summary> <summary>
Careray平板图像 图像宽度
</summary>
</member>
<member name="P:Asa.CarerayImage.ImageHeight">
<summary>
图像高度
</summary>
</member>
<member name="P:Asa.CarerayImage.IP">
<summary>
IP地址
</summary> </summary>
</member> </member>
<member name="M:Asa.CarerayImage.Open">
<summary>
打开设备
</summary>
<returns></returns>
</member>
<member name="M:Asa.CarerayImage.Close">
<summary>
关闭设备
</summary>
<returns></returns>
</member>
<member name="M:Asa.CarerayImage.GetImage">
<summary>
获取图像
</summary>
<returns></returns>
</member>
<member name="M:Asa.CarerayImage.LoadRAW(System.String)"> <member name="M:Asa.CarerayImage.LoadRAW(System.String)">
<summary> <summary>
加载RAW图片 加载RAW图片,64字节头
</summary> </summary>
<param name="filePath"></param> <param name="filePath"></param>
</member> </member>
......
11dc75aa0263ba3fdb386f7d2a0420e585931dd4 f1f9c56bb7e07e8ee867fbe9a762cde9bc21bb47
...@@ -11,4 +11,5 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\C ...@@ -11,4 +11,5 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\C
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\CarerayImage.csproj.CoreCompileInputs.cache D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\CarerayImage.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\Asa.CarerayImage.dll D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\Asa.CarerayImage.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\Asa.CarerayImage.pdb D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\Asa.CarerayImage.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\CarerayImage.csprojAssemblyReference.cache D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\bin\Debug\log4net.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage\obj\Debug\CarerayImage.csproj.CopyComplete
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup> </startup>
<log4net>
<appender name="CarerayImage" type="log4net.Appender.RollingFileAppender">
<file value="logs/CarerayImage.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<root>
<level value="Debug"/>
<appender-ref ref="CarerayImage"/>
</root>
</log4net>
</configuration> </configuration>
\ No newline at end of file \ No newline at end of file
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\..\..\DLL\log4net.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
......
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
...@@ -42,11 +45,11 @@ ...@@ -42,11 +45,11 @@
// //
// button1 // button1
// //
this.button1.Location = new System.Drawing.Point(12, 12); this.button1.Location = new System.Drawing.Point(12, 165);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(97, 35); this.button1.Size = new System.Drawing.Size(97, 26);
this.button1.TabIndex = 0; this.button1.TabIndex = 0;
this.button1.Text = "button1"; this.button1.Text = "打开文件";
this.button1.UseVisualStyleBackColor = true; this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click); this.button1.Click += new System.EventHandler(this.button1_Click);
// //
...@@ -55,9 +58,9 @@ ...@@ -55,9 +58,9 @@
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox1.Location = new System.Drawing.Point(135, 12); this.pictureBox1.Location = new System.Drawing.Point(115, 12);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(653, 426); this.pictureBox1.Size = new System.Drawing.Size(673, 426);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 1; this.pictureBox1.TabIndex = 1;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
...@@ -118,19 +121,52 @@ ...@@ -118,19 +121,52 @@
// //
// button2 // button2
// //
this.button2.Location = new System.Drawing.Point(23, 230); this.button2.Location = new System.Drawing.Point(12, 197);
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23); this.button2.Size = new System.Drawing.Size(97, 26);
this.button2.TabIndex = 6; this.button2.TabIndex = 6;
this.button2.Text = "button2"; this.button2.Text = "打开设备";
this.button2.UseVisualStyleBackColor = true; this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click); this.button2.Click += new System.EventHandler(this.button2_Click);
// //
// button3
//
this.button3.Location = new System.Drawing.Point(12, 229);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(97, 26);
this.button3.TabIndex = 7;
this.button3.Text = "关闭设备";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(12, 261);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(97, 26);
this.button4.TabIndex = 8;
this.button4.Text = "获取图像";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// button5
//
this.button5.Location = new System.Drawing.Point(12, 293);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(97, 26);
this.button5.TabIndex = 9;
this.button5.Text = "保存图像";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450); this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.button5);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2); this.Controls.Add(this.button2);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
...@@ -158,6 +194,9 @@ ...@@ -158,6 +194,9 @@
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
} }
} }
...@@ -12,7 +12,8 @@ namespace CarerayImage_Test ...@@ -12,7 +12,8 @@ namespace CarerayImage_Test
{ {
public partial class Form1 : Form public partial class Form1 : Form
{ {
Asa.CarerayImage careray; private Asa.CarerayImage careray;
private Bitmap bmp;
public Form1() public Form1()
{ {
...@@ -30,19 +31,10 @@ namespace CarerayImage_Test ...@@ -30,19 +31,10 @@ namespace CarerayImage_Test
if (dlg.ShowDialog() == DialogResult.Cancel) return; if (dlg.ShowDialog() == DialogResult.Cancel) return;
careray.LoadRAW(dlg.FileName); careray.LoadRAW(dlg.FileName);
//pictureBox1.Image = careray.Get48bImage(); careray.WindowWidth = Convert.ToInt32(numericUpDown1.Value);
Bitmap bmp = careray.Get48bImage(); careray.WindowLevel = Convert.ToInt32(numericUpDown2.Value);
bmp = careray.Get48bImage();
pictureBox1.Image = bmp; pictureBox1.Image = bmp;
//Bitmap bmp = careray.Get16bImage();
//bmp.Save(@"C:\Users\neotel\Desktop\20200520X-ray\11.png", System.Drawing.Imaging.ImageFormat.Png);
} }
private void numericUpDown1_ValueChanged(object sender, EventArgs e) private void numericUpDown1_ValueChanged(object sender, EventArgs e)
...@@ -59,13 +51,31 @@ namespace CarerayImage_Test ...@@ -59,13 +51,31 @@ namespace CarerayImage_Test
private void button2_Click(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e)
{ {
careray.GetInfo(); bool rtn = careray.Open();
Bitmap bmp = careray.Get48bImage(); MessageBox.Show(rtn.ToString());
pictureBox1.Image = bmp;
bmp.Save(@"C:\Users\neotel\Desktop\20200520X-ray\22.png", System.Drawing.Imaging.ImageFormat.Png);
} }
private void button3_Click(object sender, EventArgs e)
{
bool rtn = careray.Close();
MessageBox.Show(rtn.ToString());
}
private void button4_Click(object sender, EventArgs e)
{
careray.GetImage();
careray.WindowWidth = Convert.ToInt32(numericUpDown1.Value);
careray.WindowLevel = Convert.ToInt32(numericUpDown2.Value);
bmp = careray.Get48bImage();
pictureBox1.Image = bmp;
}
private void button5_Click(object sender, EventArgs e)
{
bmp.Save(Application.StartupPath + string.Format("\\{0:HHmmss}", DateTime.Now) + ".png", System.Drawing.Imaging.ImageFormat.Png);
}
} }
} }
using System; using log4net.Config;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
...@@ -14,6 +15,7 @@ namespace CarerayImage_Test ...@@ -14,6 +15,7 @@ namespace CarerayImage_Test
[STAThread] [STAThread]
static void Main() static void Main()
{ {
XmlConfigurator.Configure();
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); Application.Run(new Form1());
......
...@@ -9,6 +9,11 @@ ...@@ -9,6 +9,11 @@
Careray平板图像 Careray平板图像
</summary> </summary>
</member> </member>
<member name="M:Asa.CarerayImage.#ctor(System.String)">
<summary>
Careray平板图像
</summary>
</member>
<member name="P:Asa.CarerayImage.WindowWidth"> <member name="P:Asa.CarerayImage.WindowWidth">
<summary> <summary>
窗宽 窗宽
...@@ -19,14 +24,42 @@ ...@@ -19,14 +24,42 @@
窗位 窗位
</summary> </summary>
</member> </member>
<member name="M:Asa.CarerayImage.#ctor"> <member name="P:Asa.CarerayImage.ImageWidth">
<summary> <summary>
Careray平板图像 图像宽度
</summary>
</member>
<member name="P:Asa.CarerayImage.ImageHeight">
<summary>
图像高度
</summary>
</member>
<member name="P:Asa.CarerayImage.IP">
<summary>
IP地址
</summary> </summary>
</member> </member>
<member name="M:Asa.CarerayImage.Open">
<summary>
打开设备
</summary>
<returns></returns>
</member>
<member name="M:Asa.CarerayImage.Close">
<summary>
关闭设备
</summary>
<returns></returns>
</member>
<member name="M:Asa.CarerayImage.GetImage">
<summary>
获取图像
</summary>
<returns></returns>
</member>
<member name="M:Asa.CarerayImage.LoadRAW(System.String)"> <member name="M:Asa.CarerayImage.LoadRAW(System.String)">
<summary> <summary>
加载RAW图片 加载RAW图片,64字节头
</summary> </summary>
<param name="filePath"></param> <param name="filePath"></param>
</member> </member>
......
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup> </startup>
<log4net>
<appender name="CarerayImage" type="log4net.Appender.RollingFileAppender">
<file value="logs/CarerayImage.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout>
</appender>
<root>
<level value="Debug"/>
<appender-ref ref="CarerayImage"/>
</root>
</log4net>
</configuration> </configuration>
\ No newline at end of file \ No newline at end of file
# 设置root logger为DEBUG级别,使用了ca和fa两个Appender # 设置root logger为DEBUG级别,使用了ca和fa两个Appender
# log4j.rootLogger=DEBUG, ca, fa # log4j.rootLogger=DEBUG, ca, fa
log4j.rootLogger=DEBUG,fa log4j.rootLogger=WARN,fa
#test version #test version
#对Appender fa进行设置: #对Appender fa进行设置:
# 这是一个文件类型的Appender, # 这是一个文件类型的Appender,
...@@ -24,7 +24,7 @@ log4j.appender.ca=org.apache.log4j.ConsoleAppender ...@@ -24,7 +24,7 @@ log4j.appender.ca=org.apache.log4j.ConsoleAppender
log4j.appender.ca.layout=org.apache.log4j.PatternLayout log4j.appender.ca.layout=org.apache.log4j.PatternLayout
log4j.appender.ca.layout.ConversionPattern=%d | %-5p | [%t] | %m%n log4j.appender.ca.layout.ConversionPattern=%d | %-5p | [%t] | %m%n
log4j.logger.error=DEBUG, fa2 log4j.logger.error=WARN, fa2
log4j.additivity.error=true log4j.additivity.error=true
log4j.appender.fa2=org.apache.log4j.DailyRollingFileAppender log4j.appender.fa2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.fa2.DatePattern='./log/'yyyy-MM-dd'_error.log' log4j.appender.fa2.DatePattern='./log/'yyyy-MM-dd'_error.log'
......
0bdc60cf636ca9d6e9d721d157aa36b80a9e2a56 487d9744c608fc98d0fead4ea4a92cd34a5cf295
...@@ -26,3 +26,4 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\C ...@@ -26,3 +26,4 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\C
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage_Test\obj\Debug\CarerayImage_Test.csproj.CopyComplete D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage_Test\obj\Debug\CarerayImage_Test.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage_Test\obj\Debug\CarerayImage_Test.exe D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage_Test\obj\Debug\CarerayImage_Test.exe
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage_Test\obj\Debug\CarerayImage_Test.pdb D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage_Test\obj\Debug\CarerayImage_Test.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AutoCountMachine\CarerayImage\CarerayImage_Test\bin\Debug\log4net.dll
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!