├── .gitattributes
├── .gitignore
├── QSHP.sln
├── QSHP
├── Bin
│ ├── AxInterop.DRV02CTLLib.dll
│ ├── CMO.DLL
│ ├── Data
│ │ ├── CmdKey.txt
│ │ ├── CmdKey.xls
│ │ ├── Config
│ │ │ ├── LogHelper.config
│ │ │ ├── config61A.sys
│ │ │ ├── config61B.sys
│ │ │ ├── config61C.sys
│ │ │ └── config81.sys
│ │ ├── DevCfg.sys
│ │ ├── FCBladeData
│ │ │ ├── QS2017100001.drs
│ │ │ ├── QS2017100004.drs
│ │ │ └── QS2017110001.drs
│ │ ├── FCCutData
│ │ │ └── 5.12.ctd
│ │ ├── FCLOG.mdb
│ │ ├── MacCfg.sys
│ │ ├── TabCfg.sys
│ │ ├── TabConfiguration.sys
│ │ └── sysConfig.sys
│ ├── Driver
│ │ ├── AxInterop.DRV02CTLLib.dll
│ │ ├── Interop.DRV02CTLLib.dll
│ │ └── Interop.PCOMMSERVERLib.dll
│ ├── Image
│ │ ├── 20170930133850.bmp
│ │ ├── 20170930135123.bmp
│ │ ├── 20171006105542.bmp
│ │ ├── 20171006105730.bmp
│ │ ├── 20171006133753.bmp
│ │ ├── 20171006134227.bmp
│ │ ├── 20171006145735.bmp
│ │ ├── 20171011165811.bmp
│ │ ├── 20171107150519.bmp
│ │ ├── 20171107150520.bmp
│ │ ├── 20171107152051.bmp
│ │ ├── 20171118154922.bmp
│ │ ├── 20171118154923.bmp
│ │ └── 20171120140731.bmp
│ ├── Interop.DRV02CTLLib.dll
│ ├── Interop.PCOMMSERVERLib.dll
│ ├── KeyRegedit.exe
│ ├── MVBayerDec.dll
│ ├── MVC.ini
│ ├── MVCAPI.dll
│ ├── MVParm.dll
│ ├── QSHP.application
│ ├── QSHP.exe
│ ├── QSHP.exe.config
│ ├── QSHP.exe.manifest
│ ├── QSHP.vshost.application
│ ├── QSHP.vshost.exe
│ ├── QSHP.vshost.exe.config
│ ├── QSHP.vshost.exe.manifest
│ ├── Res
│ │ └── QSHP.otf
│ ├── Resources
│ │ └── FCLOG.mdb
│ ├── Screen
│ │ ├── 20170902114333.Png
│ │ ├── 20170908151915.Png
│ │ ├── 20170908155235.Png
│ │ ├── 20171023155417.Png
│ │ ├── 20171107100517.Png
│ │ ├── 20171107100521.Png
│ │ ├── 20171107100540.Png
│ │ ├── 20171109183802.Png
│ │ └── 20171111132221.Png
│ └── Tool
│ │ ├── FreeVK.ini
│ │ ├── QSHP.otf
│ │ └── osk.exe
├── Com
│ ├── BitmapHelper.cs
│ ├── BitmapQuality.cs
│ ├── CheckSum.cs
│ ├── DLLWrapper.cs
│ ├── DataConverter.cs
│ ├── GrayImage.cs
│ ├── LinearMath.cs
│ ├── MachineInfo.cs
│ ├── NativeMethods.cs
│ ├── RotateMath.cs
│ └── readme.txt
├── Common.cs
├── CommonPart.cs
├── Data
│ ├── AppConfig.cs
│ ├── AxisParams.cs
│ ├── BldData.cs
│ ├── CutChannel.cs
│ ├── CutChip.cs
│ ├── CutGroup.cs
│ ├── CutLine.cs
│ ├── CutSegment.cs
│ ├── DataBase.cs
│ ├── DevData.cs
│ ├── IOData.cs
│ ├── MacData.cs
│ ├── PreData.cs
│ ├── Serialize.cs
│ ├── SysConfig.cs
│ └── TabData.cs
├── Globals.cs
├── GlobalsPart.cs
├── HW
│ ├── AmpC
│ │ ├── AmpCProvider.cs
│ │ ├── CopleyAmpC.cs
│ │ ├── CopleyAxisParams.cs
│ │ ├── DeltaAmpC.cs
│ │ ├── G3DrvAmpC.cs
│ │ ├── IAmpCProvider.cs
│ │ ├── PmacAmpC.cs
│ │ └── PmacAxisParams.cs
│ ├── CanOpenConnecter.cs
│ ├── CopleyConnecter.cs
│ ├── G3DrvConnecter.cs
│ ├── HardwareProvider.cs
│ ├── HardwareType.cs
│ ├── IO
│ │ ├── CopleyIOProvider.cs
│ │ ├── DigProvider.cs
│ │ ├── IOParamArgs.cs
│ │ ├── IOProvider.cs
│ │ ├── PmacIOParams.cs
│ │ └── PmacIOProvider.cs
│ ├── IOList.cs
│ ├── PmacConnecter.cs
│ ├── Spindle
│ │ ├── ISpindleProvider.cs
│ │ ├── SMSpindleProvider.cs
│ │ ├── SpindProvider.cs
│ │ ├── SpindleEventArgs.cs
│ │ └── VFSpindleProvider.cs
│ ├── Video
│ │ ├── IVideoProvider.cs
│ │ ├── MVCCaptureProvider.cs
│ │ └── SrceenCaptureProvider.cs
│ └── readme.txt
├── KeyRegedit.exe
├── LockScreenForm.Designer.cs
├── LockScreenForm.cs
├── LockScreenForm.resx
├── LogHelper.cs
├── Logo.Designer.cs
├── Logo.cs
├── Logo.resx
├── MVC.ini
├── MainForm.Designer.cs
├── MainForm.cs
├── MainForm.resx
├── ProcessCmd.cs
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── DataSources
│ │ ├── CmdOles.datasource
│ │ ├── QSHP.Data.BldData.datasource
│ │ ├── QSHP.Data.CutChannel.datasource
│ │ └── QSHP.Data.CutGroup.datasource
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ ├── Settings.settings
│ └── app.manifest
├── QSHP.csproj
├── QSHP2010.sln
├── Resources
│ ├── CollapseImage.png
│ ├── Error.png
│ ├── ExpandImage.png
│ ├── FCLOG.mdb
│ ├── None.png
│ ├── OK.png
│ ├── QSHP.otf
│ ├── Warn.png
│ ├── logo-1.png
│ ├── logo.gif
│ └── logo.ico
├── SIM
│ ├── MotorModel.cs
│ ├── PIDProvider.cs
│ ├── SPDModel.cs
│ └── SimModel.cs
├── SysCmd.cs
├── SystemStatus.cs
├── UI
│ ├── Bld
│ │ ├── BladeAlignmentManger.Designer.cs
│ │ ├── BladeAlignmentManger.cs
│ │ ├── BladeAlignmentManger.resx
│ │ ├── BladeCirTabEditManager.Designer.cs
│ │ ├── BladeCirTabEditManager.cs
│ │ ├── BladeCirTabEditManager.resx
│ │ ├── BladeFileManager.Designer.cs
│ │ ├── BladeFileManager.cs
│ │ ├── BladeFileManager.resx
│ │ ├── BladeMessageForm.Designer.cs
│ │ ├── BladeMessageForm.cs
│ │ ├── BladeMessageForm.resx
│ │ ├── BladeRecTabEditManager.Designer.cs
│ │ ├── BladeRecTabEditManager.cs
│ │ ├── BladeRecTabEditManager.resx
│ │ ├── BladeRepalceManager.Designer.cs
│ │ ├── BladeRepalceManager.cs
│ │ ├── BladeRepalceManager.resx
│ │ ├── BladeTestDataEdit.Designer.cs
│ │ ├── BladeTestDataEdit.cs
│ │ ├── BladeTestDataEdit.resx
│ │ ├── BladeTestDataManager.Designer.cs
│ │ ├── BladeTestDataManager.cs
│ │ ├── BladeTestDataManager.resx
│ │ ├── BladeTestHeightManager.Designer.cs
│ │ ├── BladeTestHeightManager.cs
│ │ ├── BladeTestHeightManager.resx
│ │ ├── TestHeightManager.Designer.cs
│ │ ├── TestHeightManager.cs
│ │ └── TestHeightManager.resx
│ ├── Ctr
│ │ ├── AxisControlEx.cs
│ │ ├── AxisControlEx.designer.cs
│ │ ├── AxisControlEx.resx
│ │ ├── ButtonEx.cs
│ │ ├── ComboBoxEx.cs
│ │ ├── DigitalEx.cs
│ │ ├── GroupBoxEx.cs
│ │ ├── GroupBoxEx.resx
│ │ ├── KeyPad.cs
│ │ ├── KeyPad.designer.cs
│ │ ├── KeyPad.resx
│ │ ├── KeyboardButton.cs
│ │ ├── LedEx.cs
│ │ ├── LedShow.cs
│ │ ├── LedShow.resx
│ │ ├── NumberEdit.cs
│ │ ├── PanelEx.cs
│ │ ├── PictureBoxEx.cs
│ │ ├── ProgressBarEx.cs
│ │ ├── TabControlEx.cs
│ │ ├── TextBox.cs
│ │ ├── TextBoxEx.cs
│ │ ├── TrackBarEx.cs
│ │ ├── TreeViewEx.cs
│ │ ├── UnderAxis.Designer.cs
│ │ ├── UnderAxis.cs
│ │ ├── UnderAxis.resx
│ │ ├── VideoControlEx.cs
│ │ ├── VideoControlEx.designer.cs
│ │ └── VideoControlEx.resx
│ ├── Cut
│ │ ├── CutAlignManager.Designer.cs
│ │ ├── CutAlignManager.cs
│ │ ├── CutAlignManager.resx
│ │ ├── CutPauseManager.Designer.cs
│ │ ├── CutPauseManager.cs
│ │ ├── CutPauseManager.resx
│ │ ├── CutStatusManager.Designer.cs
│ │ ├── CutStatusManager.cs
│ │ └── CutStatusManager.resx
│ ├── Dev
│ │ ├── AlignedCenterManager.Designer.cs
│ │ ├── AlignedCenterManager.cs
│ │ ├── AlignedCenterManager.resx
│ │ ├── DevAlignDataManager.Designer.cs
│ │ ├── DevAlignDataManager.cs
│ │ ├── DevAlignDataManager.resx
│ │ ├── DevAlignedCenterManager.Designer.cs
│ │ ├── DevAlignedCenterManager.cs
│ │ ├── DevAlignedCenterManager.resx
│ │ ├── DevDataManager.Designer.cs
│ │ ├── DevDataManager.cs
│ │ ├── DevDataManager.resx
│ │ ├── DevLedCfgManager.Designer.cs
│ │ ├── DevLedCfgManager.cs
│ │ ├── DevLedCfgManager.resx
│ │ ├── DevPixelFactorManager.Designer.cs
│ │ ├── DevPixelFactorManager.cs
│ │ ├── DevPixelFactorManager.resx
│ │ ├── PixelFactorManager.Designer.cs
│ │ ├── PixelFactorManager.cs
│ │ └── PixelFactorManager.resx
│ ├── File
│ │ ├── AnyChannelManager.Designer.cs
│ │ ├── AnyChannelManager.cs
│ │ ├── AnyChannelManager.resx
│ │ ├── AnySegmentManager.Designer.cs
│ │ ├── AnySegmentManager.cs
│ │ ├── AnySegmentManager.resx
│ │ ├── CutDataManager.Designer.cs
│ │ ├── CutDataManager.cs
│ │ ├── CutDataManager.resx
│ │ ├── DataManager.Designer.cs
│ │ ├── DataManager.cs
│ │ ├── DataManager.resx
│ │ ├── FileManager.Designer.cs
│ │ ├── FileManager.cs
│ │ ├── FileManager.resx
│ │ ├── PreCutDataManager.Designer.cs
│ │ ├── PreCutDataManager.cs
│ │ └── PreCutDataManager.resx
│ ├── HomeScreen.cs
│ ├── HomeScreen.resx
│ ├── LogerViewManager.Designer.cs
│ ├── LogerViewManager.cs
│ ├── LogerViewManager.resx
│ ├── Mac
│ │ ├── AlignedCenterManager.Designer.cs
│ │ ├── AlignedCenterManager.cs
│ │ ├── AlignedCenterManager.resx
│ │ ├── PixelFactorManager.Designer.cs
│ │ ├── PixelFactorManager.cs
│ │ ├── PixelFactorManager.resx
│ │ ├── SystemAnalogManager.Designer.cs
│ │ ├── SystemAnalogManager.cs
│ │ ├── SystemAnalogManager.resx
│ │ ├── SystemAxisCtrManager.Designer.cs
│ │ ├── SystemAxisCtrManager.cs
│ │ ├── SystemAxisCtrManager.resx
│ │ ├── SystemConfigManager.Designer.cs
│ │ ├── SystemConfigManager.cs
│ │ ├── SystemConfigManager.resx
│ │ ├── SystemDataManager.Designer.cs
│ │ ├── SystemDataManager.cs
│ │ ├── SystemDataManager.resx
│ │ ├── SystemDigIOManager.Designer.cs
│ │ ├── SystemDigIOManager.cs
│ │ ├── SystemDigIOManager.resx
│ │ ├── SystemIOControlManager.Designer.cs
│ │ ├── SystemIOControlManager.cs
│ │ ├── SystemIOControlManager.resx
│ │ ├── SystemSpeParamsManager.Designer.cs
│ │ ├── SystemSpeParamsManager.cs
│ │ └── SystemSpeParamsManager.resx
│ ├── Manual
│ │ ├── CutAlignManager.Designer.cs
│ │ ├── CutAlignManager.cs
│ │ ├── CutAlignManager.resx
│ │ ├── CutPauseManager.Designer.cs
│ │ ├── CutPauseManager.cs
│ │ ├── CutPauseManager.resx
│ │ ├── CutStatusManager.Designer.cs
│ │ ├── CutStatusManager.cs
│ │ └── CutStatusManager.resx
│ ├── MidScreen.Designer.cs
│ ├── MidScreen.cs
│ ├── MidScreen.resx
│ ├── Test
│ │ ├── Form1.cs
│ │ ├── Form1.designer.cs
│ │ ├── Form1.resx
│ │ ├── Form3.cs
│ │ ├── Form3.designer.cs
│ │ ├── Form3.resx
│ │ ├── Form5.Designer.cs
│ │ ├── Form5.cs
│ │ └── Form5.resx
│ └── User
│ │ ├── AlignFormBase.Designer.cs
│ │ ├── AlignFormBase.cs
│ │ ├── AlignFormBase.resx
│ │ ├── BaseForm.Designer.cs
│ │ ├── BaseForm.cs
│ │ ├── BaseForm.resx
│ │ ├── CaptureViewEx.cs
│ │ ├── CaptureViewEx.designer.cs
│ │ ├── CaptureViewEx.resx
│ │ ├── ChannelCtr.Designer.cs
│ │ ├── ChannelCtr.cs
│ │ ├── ChannelCtr.resx
│ │ ├── ChannelCtrList.Designer.cs
│ │ ├── ChannelCtrList.cs
│ │ ├── ChannelCtrList.resx
│ │ ├── FormArgs.cs
│ │ ├── MonitorEx.cs
│ │ ├── MonitorEx.designer.cs
│ │ ├── MonitorEx.resx
│ │ ├── SegmentCtr.Designer.cs
│ │ ├── SegmentCtr.cs
│ │ ├── SegmentCtr.resx
│ │ ├── TopBar.Designer.cs
│ │ ├── TopBar.cs
│ │ ├── TopBar.resx
│ │ ├── UnderBar.cs
│ │ ├── UnderBar.designer.cs
│ │ └── UnderBar.resx
├── app.config
└── logo.ico
├── README.md
└── 开源说明文档.docx
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/QSHP.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26730.16
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QSHP", "QSHP\QSHP.csproj", "{04567ABF-0DCA-475F-B0ED-C2A01D25962C}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|x64 = Debug|x64
12 | Debug|x86 = Debug|x86
13 | Release|Any CPU = Release|Any CPU
14 | Release|x64 = Release|x64
15 | Release|x86 = Release|x86
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Debug|Any CPU.ActiveCfg = Release|x86
19 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Debug|Any CPU.Build.0 = Release|x86
20 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Debug|x64.ActiveCfg = Release|x64
21 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Debug|x64.Build.0 = Release|x64
22 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Debug|x86.ActiveCfg = Debug|x86
23 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Debug|x86.Build.0 = Debug|x86
24 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Release|Any CPU.ActiveCfg = Release|x86
25 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Release|Any CPU.Build.0 = Release|x86
26 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Release|x64.ActiveCfg = Release|x64
27 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Release|x64.Build.0 = Release|x64
28 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Release|x86.ActiveCfg = Release|x86
29 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Release|x86.Build.0 = Release|x86
30 | EndGlobalSection
31 | GlobalSection(SolutionProperties) = preSolution
32 | HideSolutionNode = FALSE
33 | EndGlobalSection
34 | GlobalSection(ExtensibilityGlobals) = postSolution
35 | SolutionGuid = {160C42D2-8D31-45AC-9615-FEA2B5072D63}
36 | EndGlobalSection
37 | EndGlobal
38 |
--------------------------------------------------------------------------------
/QSHP/Bin/AxInterop.DRV02CTLLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/AxInterop.DRV02CTLLib.dll
--------------------------------------------------------------------------------
/QSHP/Bin/CMO.DLL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/CMO.DLL
--------------------------------------------------------------------------------
/QSHP/Bin/Data/CmdKey.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Data/CmdKey.txt
--------------------------------------------------------------------------------
/QSHP/Bin/Data/CmdKey.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Data/CmdKey.xls
--------------------------------------------------------------------------------
/QSHP/Bin/Data/Config/LogHelper.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/QSHP/Bin/Data/Config/config81.sys:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 10
8 | 50
9 | 400
10 | 600
11 | 500
12 | 30
13 | 30
14 | 5
15 | 2
16 | 5
17 | 10
18 | 4
19 | 3
20 | 1
21 | 2000
22 | 0
23 | 0
24 | PLimit
25 | false
26 | INPUT_CONFIGURATION_HOME_HIGH
27 | INPUT_CONFIGURATION_NEGATIVE_LIMIT_HIGH
28 | INPUT_CONFIGURATION_POSITIVE_LIMIT_HIGH
29 |
30 |
31 |
32 |
33 |
34 |
35 | 10
36 | 50
37 | 400
38 | 400
39 | 0
40 | 0
41 | 2
42 | 5
43 | 2
44 | 5
45 | 10
46 | 4
47 | 3
48 | 1
49 | 2000
50 | 0
51 | 0
52 | PLimit
53 | false
54 | INPUT_CONFIGURATION_HOME_HIGH
55 | INPUT_CONFIGURATION_NEGATIVE_LIMIT_HIGH
56 | INPUT_CONFIGURATION_POSITIVE_LIMIT_HIGH
57 |
58 |
59 |
60 |
61 |
62 |
63 | 10
64 | 50
65 | 400
66 | 600
67 | 500
68 | 30
69 | 30
70 | 5
71 | 2
72 | 5
73 | 10
74 | 4
75 | 3
76 | 1
77 | 2000
78 | 0
79 | 0
80 | PLimit
81 | false
82 | INPUT_CONFIGURATION_HOME_HIGH
83 | INPUT_CONFIGURATION_NEGATIVE_LIMIT_HIGH
84 | INPUT_CONFIGURATION_POSITIVE_LIMIT_HIGH
85 |
86 |
87 |
88 |
89 |
90 |
91 | 10
92 | 50
93 | 400
94 | 400
95 | 0
96 | 0
97 | 2
98 | 5
99 | 2
100 | 5
101 | 10
102 | 4
103 | 3
104 | 1
105 | 2000
106 | 0
107 | 0
108 | PLimit
109 |
110 | 255
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
--------------------------------------------------------------------------------
/QSHP/Bin/Data/DevCfg.sys:
--------------------------------------------------------------------------------
1 |
2 | 50
3 | 5
4 | 2
5 | 1
6 | 25
7 | 0.5
8 | 0.1
9 | 0.5
10 | 8
11 | 1
12 | 1.5
13 | 0.5
14 | 30
15 | 2
16 | 2
17 | 0.5
18 | 4
19 | 10
20 | 5
21 | 0.1
22 | 0.5
23 | 30
24 | 0.2
25 | 260
26 | 260
27 | 0.00532
28 | 260
29 | 202
30 | 0.00266
31 | 10
32 | 10
33 | 30
34 | -10
35 | false
36 | 300
37 | 270
38 | 30
39 | true
40 | true
41 | false
42 | false
43 | false
44 | true
45 | true
46 | true
47 | true
48 | false
49 | 2017-11-20T16:10:40.5412147+08:00
50 |
51 | 16777216
52 |
53 |
54 | 65536
55 |
56 |
57 | 16843008
58 |
59 |
60 | 65538
61 |
62 |
63 | 65539
64 |
65 |
66 | 256
67 |
68 |
69 | 260
70 |
71 |
72 | 16777219
73 |
74 |
75 | 16777220
76 |
77 |
--------------------------------------------------------------------------------
/QSHP/Bin/Data/FCBladeData/QS2017100001.drs:
--------------------------------------------------------------------------------
1 |
2 | 2017-11-11T13:26:35.0892247+08:00
3 | 2017-11-16T09:41:16.8234842+08:00
4 | 1
5 | 0
6 | HT-RM-08
7 | 17-11-0001
8 | 3
9 | 0
10 | 0
11 | 228
12 | 0
13 | 228
14 | 26.669342
15 | 0
16 | 26.669342
17 | 1
18 | 0
19 | 56
20 | 0.03
21 | 49.4
22 | 100000
23 | 10000
24 | 0
25 | 0
26 | 0
27 | 0
28 | 0
29 | 0
30 | false
31 | 25
32 | 3
33 | 25
34 | 25
35 | 25
36 | false
37 | 0
38 |
--------------------------------------------------------------------------------
/QSHP/Bin/Data/FCBladeData/QS2017100004.drs:
--------------------------------------------------------------------------------
1 |
2 | 2017-10-24T15:48:35.3455845+08:00
3 | 2017-10-24T16:54:29.0378246+08:00
4 | 4
5 | 0
6 | HT-RM-08
7 | 17-10-0004
8 | 1
9 | 1
10 | 1
11 | 152
12 | 152
13 | 152
14 | 17.7233448
15 | 17.7233448
16 | 17.7233448
17 | 1
18 | 0
19 | 56
20 | 0.03
21 | 49.4
22 | 100000
23 | 10000
24 | 0
25 | 0
26 | 0
27 | 0
28 | 0
29 | 0
30 | true
31 | 15.2373323
32 | 1
33 | 15.2373323
34 | 15.2373323
35 | 25
36 | false
37 | 2
38 |
--------------------------------------------------------------------------------
/QSHP/Bin/Data/FCBladeData/QS2017110001.drs:
--------------------------------------------------------------------------------
1 |
2 | 2017-11-11T13:26:35.0892247+08:00
3 | 2017-11-19T17:30:39.8298515+08:00
4 | 1
5 | 0
6 | HT-RM-08
7 | 17-11-0001
8 | 10
9 | 7
10 | 7
11 | 517
12 | 289
13 | 517
14 | 55.5690041
15 | 28.900074
16 | 55.5690041
17 | 1
18 | 0
19 | 56
20 | 0.03
21 | 49.4
22 | 100000
23 | 10000
24 | 0
25 | 0
26 | 0
27 | 0
28 | 0
29 | 0
30 | false
31 | 25
32 | 10
33 | 25
34 | 25
35 | 25
36 | false
37 | 0
38 |
--------------------------------------------------------------------------------
/QSHP/Bin/Data/FCCutData/5.12.ctd:
--------------------------------------------------------------------------------
1 |
2 |
3 | 100
4 | 100
5 |
6 | true
7 | true
8 | true
9 | 200
10 | Positive
11 | Stand
12 | 2
13 | 0
14 | 0.07
15 | 2
16 | 100
17 | 100
18 | 0
19 |
20 |
21 | 50
22 | 5
23 | 0
24 | true
25 | 1
26 | 50
27 |
28 | 250
29 | 200
30 |
31 | 30
32 | 0
33 | 0
34 | 0
35 | 30
36 | 0
37 | 0
38 |
39 |
40 | 0
41 | 30
42 | 0
43 |
44 |
45 | 35
46 | 5
47 | 0
48 | true
49 | 1
50 | 20
51 |
52 | 250
53 | 200
54 |
55 | 30
56 | 0
57 | 0
58 | 0
59 | 30
60 | 0
61 | 0
62 |
63 |
64 | 0
65 | 120
66 | 0
67 |
68 |
69 | 20000
70 | false
71 | false
72 |
73 | 0
74 | 300
75 | 200
76 | 30
77 | false
78 |
79 |
80 | 0
81 | std
82 | true
83 | 5
84 | 50
85 | 5
86 | 5
87 | false
88 |
89 |
--------------------------------------------------------------------------------
/QSHP/Bin/Data/FCLOG.mdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Data/FCLOG.mdb
--------------------------------------------------------------------------------
/QSHP/Bin/Data/TabConfiguration.sys:
--------------------------------------------------------------------------------
1 |
2 | 20000
3 | 3
4 | 0
5 | 0.01
6 | 0.01
7 | 216
8 | 200
9 | 18
10 | 16
11 | 1
12 | 10
13 | 10
14 | 5
15 | 2
16 | 0
17 | 17
18 | 30
19 | 320
20 |
21 |
22 | 0
23 | true
24 | 219.599289
25 | 200
26 | 30
27 | 215.995
28 | 200
29 | 200
30 | 16
31 | 2
32 |
33 |
34 | 1
35 | true
36 | 216
37 | 200
38 | 30
39 | 216
40 | 200
41 | 200
42 | 18
43 | 1
44 |
45 |
46 | 2
47 | true
48 | 216
49 | 200
50 | 30
51 | 216
52 | 150
53 | 200
54 | 14
55 | 0
56 |
57 |
58 | 3
59 | true
60 | 216
61 | 200
62 | 30
63 | 216
64 | 200
65 | 200
66 | 18
67 | 3
68 |
69 |
70 | 4
71 | true
72 | 216
73 | 200
74 | 30
75 | 216
76 | 200
77 | 200
78 | 18
79 | 4
80 |
81 |
82 |
83 |
84 | 0
85 | false
86 | 216
87 | 200
88 | 30
89 | 216
90 | 200
91 | 200
92 | 18
93 | 2
94 |
95 |
96 | 1
97 | false
98 | 216
99 | 200
100 | 30
101 | 216
102 | 200
103 | 200
104 | 18
105 | 2
106 |
107 |
108 | 2
109 | false
110 | 216
111 | 200
112 | 30
113 | 216
114 | 200
115 | 200
116 | 18
117 | 2
118 |
119 |
120 | 3
121 | false
122 | 216
123 | 200
124 | 30
125 | 216
126 | 200
127 | 200
128 | 18
129 | 2
130 |
131 |
132 | 4
133 | false
134 | 216
135 | 200
136 | 30
137 | 216
138 | 200
139 | 200
140 | 18
141 | 2
142 |
143 |
144 | true
145 | true
146 | true
147 |
--------------------------------------------------------------------------------
/QSHP/Bin/Data/sysConfig.sys:
--------------------------------------------------------------------------------
1 |
2 | true
3 | F:\hucya\QSHP\QSHP\Bin
4 | 5.12.ctd
5 | config61B.sys
6 | QS2017110001.drs
7 | 2017-12-08T16:49:06.3140955+08:00
8 | AUTOFOURCE AUTOCUT ANALOG NETCTR SPEECH
9 | 0
10 | true
11 |
--------------------------------------------------------------------------------
/QSHP/Bin/Driver/AxInterop.DRV02CTLLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Driver/AxInterop.DRV02CTLLib.dll
--------------------------------------------------------------------------------
/QSHP/Bin/Driver/Interop.DRV02CTLLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Driver/Interop.DRV02CTLLib.dll
--------------------------------------------------------------------------------
/QSHP/Bin/Driver/Interop.PCOMMSERVERLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Driver/Interop.PCOMMSERVERLib.dll
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20170930133850.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20170930133850.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20170930135123.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20170930135123.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20171006105542.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20171006105542.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20171006105730.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20171006105730.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20171006133753.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20171006133753.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20171006134227.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20171006134227.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20171006145735.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20171006145735.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20171011165811.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20171011165811.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20171107150519.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20171107150519.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20171107150520.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20171107150520.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20171107152051.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20171107152051.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20171118154922.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20171118154922.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20171118154923.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20171118154923.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Image/20171120140731.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Image/20171120140731.bmp
--------------------------------------------------------------------------------
/QSHP/Bin/Interop.DRV02CTLLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Interop.DRV02CTLLib.dll
--------------------------------------------------------------------------------
/QSHP/Bin/Interop.PCOMMSERVERLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Interop.PCOMMSERVERLib.dll
--------------------------------------------------------------------------------
/QSHP/Bin/KeyRegedit.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/KeyRegedit.exe
--------------------------------------------------------------------------------
/QSHP/Bin/MVBayerDec.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/MVBayerDec.dll
--------------------------------------------------------------------------------
/QSHP/Bin/MVC.ini:
--------------------------------------------------------------------------------
1 | [MVC1000MF]
2 | Width=1280
3 | Height=1024
4 | Gain=30
5 | Exposure=300
6 | [MVC1000F]
7 | Width=1280
8 | Height=1024
9 | Gain=30
10 | RGain=31
11 | GGain=23
12 | BGain=39
13 | Exposure=480
14 | [MVC360MF]
15 | Width=752
16 | Height=480
17 | Gain=63
18 | Exposure=480
19 | [MVC360F]
20 | Width=752
21 | Height=480
22 | Gain=30
23 | RGain=31
24 | GGain=23
25 | BGain=39
26 | Exposure=480
27 | [MVC5001MF]
28 | Width=2592
29 | Height=1944
30 | Gain=63
31 | Exposure=480
32 | [MVC5001F]
33 | Width=2592
34 | Height=1944
35 | RGain=31
36 | GGain=23
37 | BGain=39
38 | Exposure=480
39 | [MVC10KF]
40 | Width=3664
41 | Height=2748
42 | RGain=31
43 | GGain=23
44 | BGain=39
45 | Exposure=500
46 |
47 |
--------------------------------------------------------------------------------
/QSHP/Bin/MVCAPI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/MVCAPI.dll
--------------------------------------------------------------------------------
/QSHP/Bin/MVParm.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/MVParm.dll
--------------------------------------------------------------------------------
/QSHP/Bin/QSHP.application:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | wuoRdYXjZ9pOlXUBUwZeSEPRFM0=
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/QSHP/Bin/QSHP.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/QSHP.exe
--------------------------------------------------------------------------------
/QSHP/Bin/QSHP.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/QSHP/Bin/QSHP.vshost.application:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | l14Ej9O4K/XVeawRntygxraYSYQ=
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/QSHP/Bin/QSHP.vshost.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/QSHP.vshost.exe
--------------------------------------------------------------------------------
/QSHP/Bin/QSHP.vshost.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/QSHP/Bin/Res/QSHP.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Res/QSHP.otf
--------------------------------------------------------------------------------
/QSHP/Bin/Resources/FCLOG.mdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Resources/FCLOG.mdb
--------------------------------------------------------------------------------
/QSHP/Bin/Screen/20170902114333.Png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Screen/20170902114333.Png
--------------------------------------------------------------------------------
/QSHP/Bin/Screen/20170908151915.Png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Screen/20170908151915.Png
--------------------------------------------------------------------------------
/QSHP/Bin/Screen/20170908155235.Png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Screen/20170908155235.Png
--------------------------------------------------------------------------------
/QSHP/Bin/Screen/20171023155417.Png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Screen/20171023155417.Png
--------------------------------------------------------------------------------
/QSHP/Bin/Screen/20171107100517.Png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Screen/20171107100517.Png
--------------------------------------------------------------------------------
/QSHP/Bin/Screen/20171107100521.Png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Screen/20171107100521.Png
--------------------------------------------------------------------------------
/QSHP/Bin/Screen/20171107100540.Png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Screen/20171107100540.Png
--------------------------------------------------------------------------------
/QSHP/Bin/Screen/20171109183802.Png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Screen/20171109183802.Png
--------------------------------------------------------------------------------
/QSHP/Bin/Screen/20171111132221.Png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Screen/20171111132221.Png
--------------------------------------------------------------------------------
/QSHP/Bin/Tool/FreeVK.ini:
--------------------------------------------------------------------------------
1 | [Main]
2 | Site=1
3 | AutoClick=1
4 | FitWidth=0
5 | AlphaBlend=255
6 | TMainFormTop=570
7 | TMainFormLeft=0
8 | TMainFormHeight=199
9 | TMainFormWidth=831
10 | TMainFormState=0
11 |
--------------------------------------------------------------------------------
/QSHP/Bin/Tool/QSHP.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Tool/QSHP.otf
--------------------------------------------------------------------------------
/QSHP/Bin/Tool/osk.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Bin/Tool/osk.exe
--------------------------------------------------------------------------------
/QSHP/Com/DLLWrapper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace QSHP.Com
9 | {
10 | public abstract class DLLWrapper : IDisposable
11 | {
12 | private FileVersionInfo mFileVersionInfo;
13 | protected IntPtr mHandle = IntPtr.Zero;
14 | private const string mKernel32DLL = "kernel32.dll";
15 |
16 | public DLLWrapper(string pathToDLL)
17 | {
18 | this.mHandle = NativeMethods.LoadLibrary(pathToDLL);
19 | if (this.mHandle == IntPtr.Zero)
20 | {
21 | throw new ArgumentException(string.Format("加载 {0} 文件失败!", Path.GetFileName(pathToDLL)));
22 | }
23 | try
24 | {
25 | StringBuilder filename = new StringBuilder(0x100);
26 | NativeMethods.GetModuleFileName(this.mHandle, filename, (uint)filename.Capacity);
27 | this.mFileVersionInfo = FileVersionInfo.GetVersionInfo(filename.ToString());
28 | }
29 | catch
30 | {
31 | }
32 | }
33 |
34 | public virtual void Dispose()
35 | {
36 | this.Dispose(true);
37 | GC.SuppressFinalize(this);
38 | }
39 |
40 | public void Dispose(bool dispose)
41 | {
42 | if (this.mHandle != IntPtr.Zero)
43 | {
44 | NativeMethods.FreeLibrary(this.mHandle);
45 | this.mHandle = IntPtr.Zero;
46 | }
47 | }
48 |
49 | ~DLLWrapper()
50 | {
51 | this.Dispose(false);
52 | }
53 |
54 | public string FileVersion
55 | {
56 | get
57 | {
58 | if (this.mFileVersionInfo == null)
59 | {
60 | return string.Empty;
61 | }
62 | return this.mFileVersionInfo.FileVersion;
63 | }
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/QSHP/Com/LinearMath.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace QSHP.Com
7 | {
8 | public static class LinearMath
9 | {
10 |
11 | public static double LinearScaleValue(double[] arrayX, double[] arrayY)
12 | {
13 | double scale = 0;
14 | if (arrayX.Length == arrayY.Length && arrayX.Length > 1)
15 | {
16 | double averX = arrayX.Average();
17 | double averY = arrayY.Average();
18 | double Molecular = 0;
19 | double Denominator = 0;
20 | for (int i = 0; i < arrayX.Length; i++)
21 | {
22 | Molecular += (arrayX[i] - averX) * (arrayY[i] - averY);
23 | Denominator += System.Math.Pow((arrayX[i] - averX), 2);
24 | }
25 | scale = Molecular / Denominator;
26 | }
27 | return scale;
28 | }
29 |
30 | public static double LinearScaleValue(double[] arrayY)
31 | {
32 | double scale = 0;
33 | double t1 = 0, t2 = 0, t3 = 0, t4 = 0;
34 | if (arrayY.Length > 1)
35 | {
36 | for (int i = 0; i < arrayY.Length; i++)
37 | {
38 | t1 += i * i;
39 | t2 += i;
40 | t3 += i * arrayY[i];
41 | t4 += arrayY[i];
42 | }
43 | scale = System.Math.Abs((t3 * arrayY.Length - t2 * t4) / (t1 * arrayY.Length - t2 * t2));
44 | }
45 | return scale;
46 | }
47 |
48 | public unsafe static double LinearScaleValue(byte* arrayY, int num)
49 | {
50 | double scale = 0;
51 | double t1 = 0, t2 = 0, t3 = 0, t4 = 0;
52 | if (num > 1)
53 | {
54 | for (int i = 0; i < num; i++)
55 | {
56 | t1 += i * i;
57 | t2 += i;
58 | t3 += i * arrayY[i];
59 | t4 += arrayY[i];
60 | }
61 | scale = System.Math.Abs((t3 * num - t2 * t4) / (t1 * num - t2 * t2));
62 | }
63 | return scale;
64 | }
65 |
66 | public static double LinearOffsetResult(double scale, double averX, double averY)
67 | {
68 | double offset = 0;
69 | offset = averY - scale * averX;
70 | return offset;
71 | }
72 |
73 | }
74 |
75 | internal class LinearSize
76 | {
77 | int min;
78 |
79 | public int Min
80 | {
81 | get { return min; }
82 | set { min = value; }
83 | }
84 | int max;
85 |
86 | public int Max
87 | {
88 | get { return max; }
89 | set { max = value; }
90 | }
91 |
92 | public int Count
93 | {
94 | get
95 | {
96 | return System.Math.Abs(max - min);
97 | }
98 | }
99 | public void Clear()
100 | {
101 | max = min;
102 | }
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/QSHP/Com/readme.txt:
--------------------------------------------------------------------------------
1 | 该部分主要存放本项目的公共函数库
2 | 本文档主要描述项目结构和修改说明
--------------------------------------------------------------------------------
/QSHP/Data/AxisParams.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Xml.Serialization;
6 | using QSHP.HW.AmpC;
7 |
8 | namespace QSHP.Data
9 | {
10 | [Serializable]
11 | [XmlType(TypeName = "AxisParams", Namespace = "")]
12 | [XmlInclude(typeof(PmacAxisParams)),XmlInclude(typeof(CopleyAxisParams))]
13 | public class AxisParams
14 | {
15 | float maxAcc = 50f; //最大加速度
16 | float maxVel = 400f; //最大速度
17 | float maxPos = 400f; //最大位置
18 | float jogVel = 10f; //JOG速度
19 | float jogAcc = 4f; //Jog加速度
20 | float jogAccSlow = 1f; //JOG低加速度
21 | float jogVelSlow = 3f; //JOG低速度
22 | float workVel = 5f; //工作速度
23 | float workAcc = 2f; //工作加速度
24 | float homeVel = 5f; //回零速度
25 | float homeAcc = 2f; //回零加速度
26 | float homeOffset = 0f; //回零偏移
27 | float startPos = 0f; //回零起始位置
28 | float stepPos = 10; //单次步进距离
29 | float perCTS = 2000f;
30 | float nlimit = 0;
31 | float plimit = 0;
32 | Limit homeMode = Limit.PLimit;
33 | float posAccuracy = 5; //到位精度
34 | float maxError = 10; //最大允许误差
35 | //[XmlElement("MaxAcc")]
36 | public float StepPos
37 | {
38 | get
39 | {
40 | return stepPos;
41 | }
42 | set
43 | {
44 | stepPos = value;
45 | }
46 | }
47 |
48 | public float MaxAcc
49 | {
50 | get { return maxAcc; }
51 | set { maxAcc = value; }
52 | }
53 | //[XmlElement("MaxVel")]
54 | public float MaxVel
55 | {
56 | get { return maxVel; }
57 | set { maxVel = value; }
58 | }
59 | //[XmlElement("MaxPos")]
60 | public float MaxPos
61 | {
62 | get { return maxPos; }
63 | set { maxPos = value; }
64 | }
65 |
66 | //[XmlElement("StartPos")]
67 | public float StartPos
68 | {
69 | get { return startPos; }
70 | set { startPos = value; }
71 | }
72 | //[XmlElement("HomeOffset")]
73 | public float HomeOffset
74 | {
75 | get { return homeOffset; }
76 | set { homeOffset = value; }
77 | }
78 | //[XmlElement("HomeAcc")]
79 | public float HomeAcc
80 | {
81 | get { return homeAcc; }
82 | set { homeAcc = value; }
83 | }
84 | //[XmlElement("HomeVel")]
85 | public float HomeVel
86 | {
87 | get { return homeVel; }
88 | set { homeVel = value; }
89 | }
90 | //[XmlElement("WorkAcc")]
91 | public float WorkAcc
92 | {
93 | get { return workAcc; }
94 | set { workAcc = value; }
95 | }
96 | //[XmlElement("WorkVel")]
97 | public float WorkVel
98 | {
99 | get { return workVel; }
100 | set { workVel = value; }
101 | }
102 | //[XmlElement("JogVel")]
103 | public float JogVel
104 | {
105 | get { return jogVel; }
106 | set { jogVel = value; }
107 | }
108 | //[XmlElement("JogAcc")]
109 | public float JogAcc
110 | {
111 | get { return jogAcc; }
112 | set { jogAcc = value; }
113 | }
114 | //[XmlElement("JogVelSlow")]
115 | public float JogVelSlow
116 | {
117 | get { return jogVelSlow; }
118 | set { jogVelSlow = value; }
119 | }
120 | //[XmlElement("JogAccSlow")]
121 | public float JogAccSlow
122 | {
123 | get { return jogAccSlow; }
124 | set { jogAccSlow = value; }
125 | }
126 | public float PerCTS
127 | {
128 | get { return perCTS; }
129 | set { perCTS = value; }
130 | }
131 | public float SoftNlimit
132 | {
133 | get { return nlimit; }
134 | set { nlimit = value; }
135 | }
136 | public float SoftPlimit
137 | {
138 | get { return plimit; }
139 | set { plimit = value; }
140 | }
141 | public Limit HomeMode
142 | {
143 | get { return homeMode; }
144 | set { homeMode = value; }
145 | }
146 |
147 | public float PosAccuracy
148 | {
149 | get
150 | {
151 | return posAccuracy;
152 | }
153 |
154 | set
155 | {
156 | posAccuracy = value;
157 | }
158 | }
159 |
160 | public float MaxError
161 | {
162 | get
163 | {
164 | return maxError;
165 | }
166 |
167 | set
168 | {
169 | maxError = value;
170 | }
171 | }
172 | }
173 | }
174 |
--------------------------------------------------------------------------------
/QSHP/Data/DataBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace QSHP.Data
7 | {
8 | [Flags]
9 | public enum CutState:ushort
10 | {
11 | Abs = 0x8000, //是否有效 true绝对位置 false 相对位置
12 | ///
13 | /// 单向划切
14 | ///
15 | SigDir = 0x4000, //是否为单向划切 true 单向划切 false双向划切
16 | ///
17 | /// 划切方向
18 | ///
19 | Dir = 0x2000, //划切方向 true 正向划切 false 反向划切
20 | ///
21 | /// 测高
22 | ///
23 | TestHeight = 0x1000, //是否测高 true测高 false不测高
24 | ///
25 | /// 暂停
26 | ///
27 | Pause = 0x800, //是否暂停 true 暂停 false不暂停
28 | ///
29 | /// 固定宽度
30 | ///
31 | Fixed = 0x400, //固定宽度 圆片false 方片 true
32 | ///
33 | /// 划切中
34 | ///
35 | Cutting = 0x200, //是否正在划切是否正在划切
36 | ///
37 | /// 向前切割
38 | ///
39 | Forward=0x100, //向前或向后划切
40 | ///
41 | /// 第一刀划切
42 | ///
43 | FirstCut=0x80, //是否为第一刀划切
44 | ///
45 | /// Z轴是否必须抬刀
46 | ///
47 | Order = 0x40, //Z轴是否抬刀
48 | ///
49 | /// 划切完成
50 | ///
51 | Complate = 0x20, //是否划切完成
52 | ///
53 | /// 使能
54 | ///
55 | Enable=0x10,
56 |
57 | }
58 |
59 | public enum CutStep : byte
60 | {
61 | Ready = 0x00, //准备OK
62 | ST1 = 0x1, //第一步
63 | ST2 = 0x2, //第二步
64 | ST3 = 0x3, //第三步
65 | ST4 = 0x4, //第四步
66 | ST5 = 0x5, //第五步
67 | ST6 = 0x6, //第六步
68 | ST7 = 0x7, //第七步
69 | ST8 = 0x8, //第八步
70 | CutStop = 0x09, //划切动作结束
71 | ST10 = 0x0A, //
72 | KniefCheck = 0x0B, //需要检测刀痕
73 | TestHeigh = 0x0C,//需要划切
74 | Pause = 0x0D, //进入暂停
75 | Continue = 0x0E, //继续进行划切
76 | STEnd = 0xF, //步骤结束
77 | }
78 |
79 | public enum CutDir
80 | {
81 | Positive = 0,//正向
82 | Negative = 1,//反向
83 | TwoWay=2,//双向
84 | }
85 |
86 | public enum CutMode
87 | {
88 | StandOnce, //标准单通道
89 | Stand, //标准双通道
90 | AnyStep, //通道多步距
91 | AnyChannel, //任意通道
92 | Other,
93 | }
94 |
95 | public enum CutStyle
96 | {
97 | FrontToBack = 0,//从前往后
98 | BackToFront,//从后往前
99 | AlignToBack,//从对准点向后
100 | AlignToFront,//从对准点向前
101 | }
102 | public enum CutWorker
103 | {
104 | Circular = 0,
105 | Region = 1,
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/QSHP/Data/Serialize.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Xml;
7 | using System.Xml.Serialization;
8 |
9 | namespace QSHP.Data
10 | {
11 | public static class Serialize
12 | {
13 | public static string XmlSerialize(object obj)
14 | {
15 | if (obj == null)
16 | {
17 | return string.Empty;
18 | }
19 | try
20 | {
21 | XmlWriterSettings setting = new XmlWriterSettings();
22 | setting.OmitXmlDeclaration = true;
23 | //setting.NewLineOnAttributes = true;
24 | setting.CheckCharacters = false;
25 | setting.Encoding = Encoding.Default;
26 | setting.Indent = true;
27 | MemoryStream mem = new MemoryStream();
28 | XmlSerializer xmlser = new XmlSerializer(obj.GetType());
29 | using (XmlWriter writer = XmlWriter.Create(mem,setting))
30 | {
31 | XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
32 | ns.Add(string.Empty, string.Empty);
33 | xmlser.Serialize(writer, obj, ns);
34 | //xmlser.Serialize(writer, obj);
35 | }
36 | return Encoding.Default.GetString(mem.ToArray());
37 | }
38 | catch(Exception ex)
39 | {
40 | LogHelper.WriteDebugException(ex);
41 | return string.Empty;
42 | }
43 | }
44 |
45 | public static void XmlSerialize(object obj,XmlNode node)
46 | {
47 | XmlAttribute attr = node.OwnerDocument.CreateAttribute("Type");
48 | attr.Value = obj.GetType().FullName;
49 | node.Attributes.Append(attr);
50 | string text = Serialize.XmlSerialize(obj);
51 | node.InnerXml = text;
52 | }
53 |
54 | public static object XmlDeSerialize(string str, Type type)
55 | {
56 | if (string.IsNullOrEmpty(str))
57 | {
58 | return Activator.CreateInstance(type);
59 | }
60 | XmlSerializer xmlser = new XmlSerializer(type);
61 | try
62 | {
63 | using (StringReader writer = new StringReader(str))
64 | {
65 | return xmlser.Deserialize(writer);
66 | }
67 | }
68 | catch(Exception ex)
69 | {
70 | LogHelper.WriteDebugException(ex);
71 | return Activator.CreateInstance(type);
72 | }
73 | }
74 |
75 | public static object XmlDeSerialize(XmlNode node)
76 | {
77 | XmlAttribute typeAttr = node.Attributes["Type"];
78 | if (typeAttr != null && !string.IsNullOrWhiteSpace(typeAttr.Value))
79 | {
80 | Type type = Type.GetType(typeAttr.Value, false);//反射获取对象类型
81 | return Serialize.XmlDeSerialize(node.InnerXml, type);
82 | }
83 | else
84 | {
85 | return null;
86 | }
87 |
88 | }
89 |
90 | public static T XmlDeSerialize(string str)
91 | {
92 | if (string.IsNullOrEmpty(str))
93 | {
94 | return (T)Activator.CreateInstance(typeof(T));
95 | }
96 | XmlSerializer xmlser = new XmlSerializer(typeof(T));
97 | try
98 | {
99 | using (StringReader writer = new StringReader(str))
100 | {
101 | return (T)xmlser.Deserialize(writer);
102 | }
103 | }
104 | catch(Exception ex)
105 | {
106 | LogHelper.WriteDebugException(ex);
107 | return (T)Activator.CreateInstance(typeof(T));
108 | }
109 | }
110 |
111 | internal static T XmlDeSerialize(object p)
112 | {
113 | throw new NotImplementedException();
114 | }
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/QSHP/HW/AmpC/CopleyAxisParams.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using QSHP.Data;
6 | using System.Xml.Serialization;
7 | namespace QSHP.HW.AmpC
8 | {
9 | [XmlType(TypeName = "CopleyAxisCArgs", Namespace = "")]
10 | public class CopleyAxisParams : AxisParams
11 | {
12 | int pLimitMode = 4;
13 | int nLimitMode = 6;
14 | int hLimitMode = 14;
15 |
16 | private bool dualEncoder = false;
17 |
18 | public bool DualEncoder
19 | {
20 | get { return dualEncoder; }
21 | set { dualEncoder = value; }
22 | }
23 | public int HLimitMode
24 | {
25 | get { return hLimitMode; }
26 | set { hLimitMode = value; }
27 | }
28 |
29 | public int NLimitMode
30 | {
31 | get { return nLimitMode; }
32 | set { nLimitMode = value; }
33 | }
34 |
35 | public int PLimitMode
36 | {
37 | get { return pLimitMode; }
38 | set { pLimitMode = value; }
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/QSHP/HW/AmpC/G3DrvAmpC.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/HW/AmpC/G3DrvAmpC.cs
--------------------------------------------------------------------------------
/QSHP/HW/AmpC/PmacAxisParams.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using QSHP.Data;
6 | using System.Xml.Serialization;
7 |
8 | namespace QSHP.HW.AmpC
9 | {
10 | [Serializable]
11 | [XmlType(TypeName = "PmacAmpCArgs",Namespace ="")]
12 | public class PmacAxisParams : AxisParams
13 | {
14 | uint modeControl = 0x820001;
15 | byte posLimitCaptureMode = 2;
16 | byte negLimitCaptureMode = 2;
17 | byte homeLimitCaptureMode = 10;
18 | byte userLimitCaptureMode = 10;
19 | public byte PosLimitCaptureMode
20 | {
21 | get { return posLimitCaptureMode; }
22 | set { posLimitCaptureMode = value; }
23 | }
24 |
25 | public byte NegLimitCaptureMode
26 | {
27 | get { return negLimitCaptureMode; }
28 | set { negLimitCaptureMode = value; }
29 | }
30 |
31 | public byte HomeLimitCaptureMode
32 | {
33 | get { return homeLimitCaptureMode; }
34 | set { homeLimitCaptureMode = value; }
35 | }
36 |
37 | public byte UserLimitCaptureMode
38 | {
39 | get { return userLimitCaptureMode; }
40 | set { userLimitCaptureMode = value; }
41 | }
42 |
43 | public uint ModeControl
44 | {
45 | get { return modeControl; }
46 | set { modeControl = value; }
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/QSHP/HW/CanOpenConnecter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CMO;
6 | namespace QSHP.HW
7 | {
8 | internal class CanOpenConnecter: IDisposable
9 | {
10 | private static CanOpenConnecter uniqueInstance = null;
11 |
12 | private static readonly object locker = new object();
13 |
14 | private bool connected = false;
15 |
16 | private int devIndex = 0;
17 |
18 | public CanOpenObj Pcan = null;
19 |
20 | public int DevIndex
21 | {
22 | get
23 | {
24 | return devIndex;
25 | }
26 | set
27 | {
28 | devIndex = value;
29 | }
30 | }
31 |
32 | public bool Connected
33 | {
34 | get
35 | {
36 | return connected;
37 | }
38 | }
39 |
40 | public CanOpenConnecter()
41 | {
42 | Pcan = new CanOpenObj();
43 | }
44 |
45 | public static CanOpenConnecter GetInstance()
46 | {
47 | if (uniqueInstance == null)
48 | {
49 | lock (locker)
50 | {
51 | if (uniqueInstance == null)
52 | {
53 | uniqueInstance = new CanOpenConnecter();
54 | }
55 | }
56 | }
57 | return uniqueInstance;
58 | }
59 |
60 | public bool ConnectDriver()
61 | {
62 | try
63 | {
64 | if (!connected)
65 | {
66 | Pcan.BitRate = CML_BIT_RATES.BITRATE_500_Kbit_per_sec;
67 | Pcan.PortName = string.Format("copley{0}", devIndex);
68 | Pcan.DevIndex = devIndex;
69 | Pcan.Initialize();
70 | }
71 | connected = true;
72 | }
73 | catch
74 | {
75 | connected = false;
76 | }
77 | return connected;
78 | }
79 |
80 | public bool DisConnectDriver()
81 | {
82 | try
83 | {
84 | if (connected)
85 | {
86 | Pcan.Close();
87 | }
88 | connected = false;
89 | return true;
90 | }
91 | catch
92 | {
93 | return false;
94 | }
95 | }
96 |
97 | public void Dispose()
98 | {
99 | if (connected)
100 | {
101 | DisConnectDriver();
102 | }
103 | Pcan.Dispose();
104 | }
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/QSHP/HW/CopleyConnecter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CMO;
6 | namespace QSHP.HW
7 | {
8 | internal class CopleyConnecter : IDisposable
9 | {
10 | private static CopleyConnecter uniqueInstance = null;
11 |
12 | private static readonly object locker = new object();
13 |
14 | private bool connected = false;
15 |
16 | private int devIndex = 0;
17 |
18 | public CanOpenObj Pcan = null;
19 |
20 | public int DevIndex
21 | {
22 | get
23 | {
24 | return devIndex;
25 | }
26 | set
27 | {
28 | devIndex = value;
29 | }
30 | }
31 |
32 | public bool Connected
33 | {
34 | get
35 | {
36 | return connected;
37 | }
38 | }
39 |
40 | public CopleyConnecter()
41 | {
42 | Pcan = new CanOpenObj();
43 | }
44 |
45 | public static CopleyConnecter GetInstance()
46 | {
47 | if (uniqueInstance == null)
48 | {
49 | lock (locker)
50 | {
51 | if (uniqueInstance == null)
52 | {
53 | uniqueInstance = new CopleyConnecter();
54 | }
55 | }
56 | }
57 | return uniqueInstance;
58 | }
59 |
60 | public bool ConnectDriver()
61 | {
62 | try
63 | {
64 | if (!connected)
65 | {
66 | Pcan.BitRate = CML_BIT_RATES.BITRATE_1_Mbit_per_sec;
67 | Pcan.PortName = string.Format( "copley{0}", devIndex);
68 | Pcan.DevIndex = devIndex;
69 | Pcan.Initialize();
70 | }
71 | connected = true;
72 | }
73 | catch
74 | {
75 | connected = false;
76 | }
77 | return connected;
78 | }
79 |
80 | public bool DisConnectDriver()
81 | {
82 | try
83 | {
84 | if (connected)
85 | {
86 | Pcan.Close();
87 | }
88 | connected = false;
89 | return true;
90 | }
91 | catch
92 | {
93 | return false;
94 | }
95 | }
96 |
97 | public void Dispose()
98 | {
99 | if (connected)
100 | {
101 | DisConnectDriver();
102 | }
103 | Pcan.Dispose();
104 | }
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/QSHP/HW/G3DrvConnecter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using DRV02CTLLib;
6 | namespace QSHP.HW
7 | {
8 | internal class G3DrvConnecter : IDisposable
9 | {
10 | private static G3DrvConnecter uniqueInstance = null;
11 | private string answer = string.Empty;
12 | private static readonly object locker = new object();
13 |
14 | private bool connected = false;
15 |
16 | private int devIndex = 3;
17 |
18 | internal DRV02CTLLib.AmpC AmpDriver = null;
19 |
20 | public bool Connected
21 | {
22 | get { return connected; }
23 | set { connected = value; }
24 | }
25 |
26 | public int DevIndex
27 | {
28 | get { return devIndex; }
29 | set { devIndex = value; }
30 | }
31 | public static G3DrvConnecter GetInstance()
32 | {
33 | if (uniqueInstance == null)
34 | {
35 | lock (locker)
36 | {
37 | if (uniqueInstance == null)
38 | {
39 | uniqueInstance = new G3DrvConnecter();
40 | }
41 | }
42 | }
43 | return uniqueInstance;
44 | }
45 | public G3DrvConnecter()
46 | {
47 | AmpDriver = new AmpCClass();
48 | }
49 |
50 | public bool ConnectDriver(int num)
51 | {
52 | devIndex=num;
53 | return ConnectDriver();
54 | }
55 |
56 | public bool ConnectDriver()
57 | {
58 | try
59 | {
60 | if (!connected)
61 | {
62 | RET_CODE code = AmpDriver.OpenPort((PORT)devIndex);
63 | connected = code == RET_CODE.RET_OK;
64 | return connected;
65 | }
66 | }
67 | catch
68 | {
69 | connected = false;
70 | }
71 | return connected;
72 | }
73 |
74 | public bool DisConnectDriver()
75 | {
76 | try
77 | {
78 | if (connected)
79 | {
80 | AmpDriver.ClosePort();
81 | }
82 | connected = false;
83 | return true;
84 | }
85 | catch
86 | {
87 | return false;
88 | }
89 | }
90 |
91 | public void Dispose()
92 | {
93 | if (Connected)
94 | {
95 | DisConnectDriver();
96 | }
97 | }
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/QSHP/HW/HardwareType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace QSHP.HW
7 | {
8 | ///
9 | /// 运动轴分配0x01 -0x1F CCD 0x21-0x3F SPD 0x41-0x4F LH 0x51-0x5F LD 0x61-0x6F
10 | ///
11 | public enum HardwareType : byte
12 | {
13 | ///
14 | /// X轴
15 | ///
16 | X_Axis = 0x01,
17 | ///
18 | /// Y轴
19 | ///
20 | Y_Axis = 0x02,
21 | ///
22 | /// Z轴
23 | ///
24 | Z_Axis = 0x03,
25 | ///
26 | /// T轴
27 | ///
28 | T_Axis = 0x04,
29 | ///
30 | /// CCD1
31 | ///
32 | CCD = 0x21,
33 | ///
34 | /// CCD2
35 | ///
36 | CCD2 = 0x22,
37 | ///
38 | /// SPD1
39 | ///
40 | SPD = 0x41,
41 | ///
42 | /// 环光1
43 | ///
44 | LH = 0x51,
45 | ///
46 | /// 点光1
47 | ///
48 | LD = 0x61,
49 | ///
50 | /// 模拟输入
51 | ///
52 | AI = 0x71,
53 | ///
54 | /// 模拟输出
55 | ///
56 | AO = 0X91,
57 | ///
58 | /// 数字输入
59 | ///
60 | DI = 0xA1,
61 | ///
62 | /// 数字输出
63 | ///
64 | DO = 0xC1,
65 | ///
66 | /// 其他
67 | ///
68 | Other = 0xF1,
69 | };
70 | internal class HW : Dictionary
71 | where T : struct
72 | where U : class,new()
73 | {
74 |
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/QSHP/HW/IO/CopleyIOProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace QSHP.HW.IO
7 | {
8 | public class CopleyIOProvider
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/QSHP/HW/IO/IOParamArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Xml.Serialization;
6 |
7 | namespace QSHP.HW.IO
8 | {
9 | [XmlType("IOParamArgs",Namespace="")]
10 | [XmlInclude(typeof(PmacIOArgs))]
11 | public class IOParamArgs
12 | {
13 |
14 | }
15 |
16 |
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/QSHP/HW/IO/IOProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.Specialized;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Xml.Serialization;
7 |
8 | namespace QSHP.HW.IO
9 | {
10 | [XmlType("IOProvider",Namespace="")]
11 | [XmlInclude(typeof(PmacIOProvider))]
12 | public class IOProvider
13 | {
14 | [XmlAttribute("Index")]
15 | public virtual int DevIndex
16 | {
17 | get;
18 | set;
19 | }
20 | public virtual IOParamArgs Params
21 | {
22 | get;
23 | set;
24 | }
25 | public virtual bool Connected
26 | {
27 | get
28 | {
29 | return true;
30 | }
31 | }
32 | public virtual bool Enabled
33 | {
34 | get
35 | {
36 | return true;
37 | }
38 | }
39 | public virtual bool GetDigIn(int ch,out bool bValue)
40 | {
41 | bValue = false;
42 | if (Connected)
43 | {
44 |
45 | }
46 | return Connected;
47 | }
48 |
49 | public virtual bool GetDigOut(int ch, out bool bValue)
50 | {
51 | bValue = false;
52 | if (Connected)
53 | {
54 |
55 | }
56 | return Connected;
57 | }
58 |
59 | public virtual bool SetDigOut(int ch, bool bValue)
60 | {
61 | if (Connected)
62 | {
63 |
64 | }
65 | return Connected;
66 | }
67 |
68 | public virtual bool GetDigIn(out uint bValue)
69 | {
70 | bValue = 0;
71 | if (Connected)
72 | {
73 |
74 | }
75 | return Connected;
76 | }
77 |
78 | public virtual bool GetDigOut(out uint bValue)
79 | {
80 | bValue = 0;
81 | if (Connected)
82 | {
83 |
84 | }
85 | return Connected;
86 | }
87 |
88 | public virtual bool SetDigOut(uint bValue)
89 | {
90 | bValue = 0;
91 | if (Connected)
92 | {
93 |
94 | }
95 | return Connected;
96 | }
97 |
98 | public virtual bool SetAlgOut(int ch, float bValue)
99 | {
100 | if (Connected)
101 | {
102 |
103 | }
104 | return Connected;
105 | }
106 |
107 | public virtual bool GetAlgOut(int ch, out float bValue)
108 | {
109 | bValue = 0;
110 | if (Connected)
111 | {
112 |
113 | }
114 | return Connected;
115 | }
116 |
117 | public virtual bool GetAlgIn(int ch, out float bValue)
118 | {
119 | bValue = 0;
120 | if (Connected)
121 | {
122 |
123 | }
124 | return Connected;
125 | }
126 |
127 | public virtual bool InitController()
128 | {
129 | return Connected;
130 | }
131 |
132 | }
133 |
134 | public enum IOMode : byte
135 | {
136 | DI=0,
137 | DO=1,
138 | AI=2,
139 | AO=3
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/QSHP/HW/IOList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace QSHP.HW
7 | {
8 | public static class DoDefine
9 | {
10 | public const int TAB_AIR = 0; //吸台气压
11 | public const int WORK_AIR = 1; //吸片气压
12 | public const int CUT_WATER = 2; //切割水
13 |
14 | public const int SPD_HALT = 3; //主轴保护
15 | public const int SPD_SW = 3; //主轴开关
16 | public const int SPD_LOCK = 3; //主轴锁
17 | public const int SPD_RESET = 3; //主轴开关
18 |
19 | public const int BUZZER = 4; //蜂鸣器
20 | public const int LED_GREEN = 5; //绿灯
21 | public const int LED_YELL = 6; //黄灯
22 | public const int LED_RED = 7; //红灯
23 |
24 |
25 | public const int POWER_OFF = 8; //电源锁
26 | public const int LED_BELT = 9; //灯带
27 |
28 | public const int TS_TEST = 10; //碳刷检测
29 | public const int TAB_TEST = 11; //工作台检测
30 |
31 | public const int CUT_DOOR = 12; //切割仓门
32 |
33 | public const int WORK_DOOR = 13; //仓门开关
34 |
35 | public static string[] DOList =
36 | {
37 | "吸台", //0
38 | "吸片", //1
39 | "切割水", //2
40 | "主轴保护", //3
41 | "蜂鸣器", //4
42 | "绿灯", //5
43 | "黄灯", //6
44 | "红灯", //7
45 | "电源锁", //8
46 | "灯带", //9
47 | "碳刷检测", //10
48 | "吸台检测", //11
49 | "仓门一", //12
50 | "仓门二", //13
51 | "保留",
52 | "保留",
53 |
54 | "保留",
55 | "保留",
56 | "保留",
57 | "保留",
58 | "保留",
59 | "保留",
60 | "保留",
61 | "保留",
62 |
63 | "保留",
64 | "保留",
65 | "保留",
66 | "保留",
67 | "保留",
68 | "保留",
69 | "保留",
70 | "保留",
71 | };
72 | }
73 | public static class DiDefine
74 | {
75 | public const int MAIN_AIR = 0; //主气压
76 | public const int MAIN_WATER = 1; //主水压
77 |
78 | public const int TAB_AIR = 2; //吸台压力
79 | public const int WORK_AIR = 3; //吸片压力
80 | public const int CUT_WATER = 4; //切割水
81 |
82 | public const int KEY_LOCK = 5; //钥匙开关
83 | public const int LEAK_WATER = 6; //主轴故障 漏水检测
84 | public const int EMG_SIG = 7; //急停信号
85 |
86 | public const int CUT_DOOR = 8; //切割仓门
87 | public const int CUT_DOOR_AIR_OPEN = 9;//仓门气压开
88 | public const int CUT_DOOR_AIR_CLOSE = 10;//仓门气压关
89 |
90 | public const int POWER_OFF = 11;//电源检测
91 |
92 | public static string[] DIList =
93 | {
94 | "主气压", //0
95 | "主轴水压", //1
96 | "吸台压力", //2
97 | "吸片压力", //3
98 | "切割水", //4
99 | "钥匙开关", //5
100 | "漏水检测", //6
101 | "急停信号", //7
102 |
103 | "仓门关", //8
104 | "门气缸开", //9
105 | "门气缸关", //10
106 | "断电检测", //11
107 | "保留",
108 | "保留",
109 | "保留",
110 | "保留",
111 |
112 | "保留",
113 | "保留",
114 | "保留",
115 | "保留",
116 | "保留",
117 | "保留",
118 | "保留",
119 | "保留",
120 |
121 | "保留",
122 | "保留",
123 | "保留",
124 | "保留",
125 | "保留",
126 | "保留",
127 | "保留",
128 | "保留",
129 | };
130 | }
131 |
132 | public static class AiDefine
133 | {
134 | public static string[] AIList =
135 | {
136 | "BBD",
137 | "NCS",
138 | "保留",
139 | "保留",
140 | "保留",
141 | "保留",
142 | "保留",
143 | "保留"
144 | };
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/QSHP/HW/Spindle/ISpindleProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace QSHP.HW.Spindle
7 | {
8 | public delegate void SamplingEventHandler(object sender, SpindleEventArgs e = null);
9 | public interface ISpindleProvider:IDisposable
10 | {
11 | ///
12 | /// 关闭当前主轴
13 | ///
14 | ///
15 | bool CloseSpd();
16 | ///
17 | /// 获取当前主轴电流
18 | ///
19 | ///
20 | float GetSpdCurrent();
21 | ///
22 | /// 获取当前主轴转速
23 | ///
24 | ///
25 | float GetSpdSpeed();
26 | ///
27 | /// 获取主轴是否开启
28 | ///
29 | ///
30 | bool GetSpdSW();
31 | ///
32 | /// 获取主轴错误
33 | ///
34 | ///
35 | bool GetSpdRrr();
36 | ///
37 | /// 获取主轴错误描述
38 | ///
39 | ///
40 | string GetSpdStatusString();
41 | ///
42 | /// 初始化并连接主轴
43 | ///
44 | ///
45 | bool InitSpd();
46 | ///
47 | /// 复位变频器
48 | ///
49 | ///
50 | bool ResetSpd();
51 | ///
52 | /// 电机按照指定的速度运行
53 | ///
54 | ///
55 | ///
56 | bool RunSpd(int speed);
57 | ///
58 | /// 停止电机运行
59 | ///
60 | ///
61 | bool StopSpd();
62 | ///
63 | /// 实时更新数据事件
64 | ///
65 | event SamplingEventHandler UpdateSamplingHander;
66 | ///
67 | /// 电机运行稳定
68 | ///
69 | bool SpeedStabled { get; }
70 | ///
71 | /// 电机运动速度为零
72 | ///
73 | bool SpeedZore { get; }
74 | ///
75 | /// 设置最小采样周期
76 | ///
77 | int SamplingMs { get; set; }
78 | ///
79 | /// 是否初始化成功
80 | ///
81 | bool IsInit { get; }
82 | ///
83 | /// 错误代码
84 | ///
85 | int ErrCode { get; }
86 | ///
87 | /// 设备索引
88 | ///
89 | int DevIndex { get; set; }
90 | ///
91 | /// 设备索引
92 | ///
93 | int AmpCIndex { get; set; }
94 |
95 | int BaudRate { get; set; }
96 |
97 | float SetSpeed { get; }
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/QSHP/HW/Spindle/SpindleEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace QSHP.HW.Spindle
7 | {
8 | public class SpindleEventArgs : EventArgs
9 | {
10 | private float workCur = 0;
11 |
12 | public float WorkCur
13 | {
14 | get { return workCur; }
15 | set { workCur = value; }
16 | }
17 | private float workSpeed = 0;
18 |
19 | public float WorkSpeed
20 | {
21 | get { return workSpeed; }
22 | set { workSpeed = value; }
23 | }
24 | private bool updateSucessful;
25 |
26 | public bool UpdateSucessful
27 | {
28 | get { return updateSucessful; }
29 | set { updateSucessful = value; }
30 | }
31 | private string status = string.Empty;
32 |
33 | public string Status
34 | {
35 | get { return status; }
36 | set { status = value; }
37 | }
38 | private int errCode = 0;
39 |
40 | public int ErrCode
41 | {
42 | get { return errCode; }
43 | set { errCode = value; }
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/QSHP/HW/Video/IVideoProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Xml.Serialization;
7 |
8 | namespace QSHP.HW.Video
9 | {
10 | [XmlType("AmpCProvider")]
11 | [XmlInclude(typeof(MVCCaptureProvider))]
12 | public interface IVideoProvider
13 | {
14 | [XmlIgnore]
15 | string SourceName
16 | {
17 | get;
18 | }
19 | ///
20 | /// 是否初始化
21 | ///
22 | ///
23 | bool IsInit
24 | {
25 | get;
26 | set;
27 | }
28 | int Index
29 | {
30 | get;
31 | set;
32 | }
33 | ///
34 | /// 是否在运行
35 | ///
36 | bool IsRunning
37 | {
38 | get;
39 | }
40 | ///
41 | /// 采集图形尺寸
42 | ///
43 | Size Size
44 | {
45 | get;
46 | set;
47 | }
48 | int DataSize
49 | {
50 | get;
51 | }
52 | ///
53 | /// 曝光时间
54 | ///
55 | int Exposure
56 | {
57 | get;
58 | set;
59 | }
60 | ///
61 | /// 增益
62 | ///
63 | byte Gain
64 | {
65 | get;
66 | set;
67 | }
68 | byte AdcMode
69 | {
70 | get;
71 | set;
72 | }
73 | ///
74 | /// 物理系数 1像素代表的实际距离 mm
75 | ///
76 | float Scale
77 | {
78 | get;
79 | set;
80 | }
81 |
82 | float FrameRate
83 | {
84 | get;
85 | }
86 | ///
87 | /// 缩小模式
88 | ///
89 | bool BinningMode
90 | {
91 | get;
92 | set;
93 | }
94 | ///
95 | /// 初始化设备
96 | ///
97 | ///
98 | bool InitDriver();
99 | ///
100 | /// 反初始化设备
101 | ///
102 | ///
103 | bool UninitDriver();
104 | ///
105 | /// 开始采集图像
106 | ///
107 | ///
108 | bool StartCapture();
109 | ///
110 | /// 停止采集图像
111 | ///
112 | ///
113 | bool StopCapture();
114 | ///
115 | /// 获取采集数据
116 | ///
117 | /// 目标地址
118 | ///
119 | Bitmap GetCurrentFrame();
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/QSHP/HW/Video/SrceenCaptureProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Drawing.Imaging;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace QSHP.HW.Video
10 | {
11 | public class SrceenCaptureProvider
12 | {
13 | int MaxHeight = 1024;
14 | int MaxWidth = 1280;
15 | Bitmap image;
16 | Rectangle rect;
17 | private static SrceenCaptureProvider uniqueInstance = null;
18 |
19 | private static readonly object locker = new object();
20 |
21 | public Bitmap ScreemImage
22 | {
23 | get
24 | {
25 | return image;
26 | }
27 | set
28 | {
29 | image = value;
30 | }
31 | }
32 |
33 | public Rectangle CaptureRect
34 | {
35 | get
36 | {
37 | return rect;
38 | }
39 | set
40 | {
41 | if (value.Size == rect.Size)
42 | {
43 | return;
44 | }
45 | lock (image)
46 | {
47 | if (image != null)
48 | {
49 | image.Dispose();
50 | }
51 | image = new Bitmap(rect.Width, rect.Height, PixelFormat.Format24bppRgb);
52 | }
53 | rect = value;
54 | }
55 | }
56 | public SrceenCaptureProvider()
57 | {
58 | MaxHeight = SystemInformation.VirtualScreen.Height;
59 | MaxWidth = SystemInformation.VirtualScreen.Width;
60 | rect = new Rectangle(0, 0, MaxWidth, MaxHeight);
61 | image = new Bitmap(MaxWidth, MaxHeight, PixelFormat.Format24bppRgb);
62 | }
63 | void Dispose()
64 | {
65 | if (image != null)
66 | {
67 | image.Dispose();
68 | }
69 | }
70 | public static SrceenCaptureProvider GetInstance()
71 | {
72 | if (uniqueInstance == null)
73 | {
74 | lock (locker)
75 | {
76 | uniqueInstance = new SrceenCaptureProvider();
77 | }
78 | }
79 | return uniqueInstance;
80 | }
81 |
82 | public Bitmap GetCaptureFrame()
83 | {
84 | try
85 | {
86 | lock (image)
87 | {
88 | using (Graphics g = Graphics.FromImage(image))
89 | {
90 | g.CopyFromScreen(new Point(rect.X, rect.Y), new Point(0, 0), rect.Size);
91 | }
92 | }
93 | }
94 | catch
95 | {
96 | return null;
97 | }
98 | return image;
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/QSHP/HW/readme.txt:
--------------------------------------------------------------------------------
1 | 该部分主要存放本项目的硬件交互
2 | 本文档主要描述项目结构和修改说明
3 |
--------------------------------------------------------------------------------
/QSHP/KeyRegedit.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/KeyRegedit.exe
--------------------------------------------------------------------------------
/QSHP/LockScreenForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace QSHP
11 | {
12 | public partial class LockScreenForm : Form
13 | {
14 | public LockScreenForm()
15 | {
16 | InitializeComponent();
17 | }
18 |
19 | private void ExitBt_Click(object sender, EventArgs e)
20 | {
21 | if (string.IsNullOrWhiteSpace(password.Text))
22 | {
23 | label1.Text = "密码不能为空";
24 | }
25 | else
26 | {
27 | string s = Globals.MacData.LockKey;
28 | if (Com.Checksum.EncryptWithMD5(password.Text).Equals(s))
29 | {
30 | label1.Text = "解锁成功";
31 | this.Close();
32 | }
33 | else
34 | {
35 | label1.Text = "密码无效,请重新输入";
36 | password.Text = string.Empty;
37 | }
38 | }
39 |
40 | }
41 |
42 | private void timer1_Tick(object sender, EventArgs e)
43 | {
44 | timeLable.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/QSHP/MVC.ini:
--------------------------------------------------------------------------------
1 | [MVC1000MF]
2 | Width=1280
3 | Height=1024
4 | Gain=30
5 | Exposure=300
6 | [MVC1000F]
7 | Width=1280
8 | Height=1024
9 | Gain=30
10 | RGain=31
11 | GGain=23
12 | BGain=39
13 | Exposure=480
14 | [MVC360MF]
15 | Width=752
16 | Height=480
17 | Gain=63
18 | Exposure=480
19 | [MVC360F]
20 | Width=752
21 | Height=480
22 | Gain=30
23 | RGain=31
24 | GGain=23
25 | BGain=39
26 | Exposure=480
27 | [MVC5001MF]
28 | Width=2592
29 | Height=1944
30 | Gain=63
31 | Exposure=480
32 | [MVC5001F]
33 | Width=2592
34 | Height=1944
35 | RGain=31
36 | GGain=23
37 | BGain=39
38 | Exposure=480
39 | [MVC10KF]
40 | Width=3664
41 | Height=2748
42 | RGain=31
43 | GGain=23
44 | BGain=39
45 | Exposure=500
46 |
47 |
--------------------------------------------------------------------------------
/QSHP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("hucya")]
9 | [assembly: AssemblyDescription("296441439@qq.com版权所有*侵权必究")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("hucya")]
12 | [assembly: AssemblyProduct("QSHP工业控制软件")]
13 | [assembly: AssemblyCopyright("Copyright © hucya 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("fbee03cc-426d-482f-ad7f-e007e9b32501")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/QSHP/Properties/DataSources/CmdOles.datasource:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | QSHP.CmdOles, QSHP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
10 |
--------------------------------------------------------------------------------
/QSHP/Properties/DataSources/QSHP.Data.BldData.datasource:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | QSHP.Data.BldData, QSHP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
10 |
--------------------------------------------------------------------------------
/QSHP/Properties/DataSources/QSHP.Data.CutChannel.datasource:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | QSHP.Data.CutChannel, QSHP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
10 |
--------------------------------------------------------------------------------
/QSHP/Properties/DataSources/QSHP.Data.CutGroup.datasource:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | QSHP.Data.CutGroup, QSHP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
10 |
--------------------------------------------------------------------------------
/QSHP/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace QSHP.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.3.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/QSHP/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/QSHP/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
47 |
54 |
55 |
69 |
--------------------------------------------------------------------------------
/QSHP/QSHP2010.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QSHP", "QSHP.csproj", "{04567ABF-0DCA-475F-B0ED-C2A01D25962C}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|x64 = Debug|x64
9 | Debug|x86 = Debug|x86
10 | Release|x64 = Release|x64
11 | Release|x86 = Release|x86
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Debug|x64.ActiveCfg = Debug|x64
15 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Debug|x64.Build.0 = Debug|x64
16 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Debug|x86.ActiveCfg = Debug|x86
17 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Debug|x86.Build.0 = Debug|x86
18 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Release|x64.ActiveCfg = Release|x64
19 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Release|x64.Build.0 = Release|x64
20 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Release|x86.ActiveCfg = Release|x86
21 | {04567ABF-0DCA-475F-B0ED-C2A01D25962C}.Release|x86.Build.0 = Release|x86
22 | EndGlobalSection
23 | GlobalSection(SolutionProperties) = preSolution
24 | HideSolutionNode = FALSE
25 | EndGlobalSection
26 | EndGlobal
27 |
--------------------------------------------------------------------------------
/QSHP/Resources/CollapseImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Resources/CollapseImage.png
--------------------------------------------------------------------------------
/QSHP/Resources/Error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Resources/Error.png
--------------------------------------------------------------------------------
/QSHP/Resources/ExpandImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Resources/ExpandImage.png
--------------------------------------------------------------------------------
/QSHP/Resources/FCLOG.mdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Resources/FCLOG.mdb
--------------------------------------------------------------------------------
/QSHP/Resources/None.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Resources/None.png
--------------------------------------------------------------------------------
/QSHP/Resources/OK.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Resources/OK.png
--------------------------------------------------------------------------------
/QSHP/Resources/QSHP.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Resources/QSHP.otf
--------------------------------------------------------------------------------
/QSHP/Resources/Warn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Resources/Warn.png
--------------------------------------------------------------------------------
/QSHP/Resources/logo-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Resources/logo-1.png
--------------------------------------------------------------------------------
/QSHP/Resources/logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Resources/logo.gif
--------------------------------------------------------------------------------
/QSHP/Resources/logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/Resources/logo.ico
--------------------------------------------------------------------------------
/QSHP/SIM/SPDModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace QSHP.SIM
7 | {
8 | public class SPDModel
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/QSHP/SIM/SimModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace QSHP.SIM
9 | {
10 | public class SimModel
11 | {
12 | protected bool connected = true;
13 | [Browsable(true),Category("配置")]
14 | public virtual AskMode Mode
15 | {
16 | get;
17 | set;
18 | }
19 |
20 | public bool Connected
21 | {
22 | get
23 | {
24 | return connected;
25 | }
26 | //set { connected = value; }
27 | }
28 |
29 | public virtual bool RunProgram()
30 | {
31 | return connected;
32 | }
33 | }
34 |
35 | public enum AskMode
36 | {
37 | Default=0,//默认为AUTO
38 | Auto=0,//自动模式
39 | Manual=1,//手动模式
40 | Trigger=2,//触发模式
41 | Preset=3,//预设模式
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/QSHP/UI/Bld/BladeAlignmentManger.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace QSHP.UI.Bld
2 | {
3 | partial class BladeAlignmentManger
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.SuspendLayout();
32 | //
33 | // BladeAlignmentManger
34 | //
35 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
36 | this.ClientSize = new System.Drawing.Size(815, 495);
37 | this.Name = "BladeAlignmentManger";
38 | this.Text = "BladeAlignmentManger";
39 | this.ResumeLayout(false);
40 |
41 | }
42 |
43 | #endregion
44 | }
45 | }
--------------------------------------------------------------------------------
/QSHP/UI/Bld/BladeAlignmentManger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace QSHP.UI.Bld
11 | {
12 | public partial class BladeAlignmentManger : BaseForm
13 | {
14 | public BladeAlignmentManger()
15 | {
16 | InitializeComponent();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/QSHP/UI/Bld/BladeMessageForm.cs:
--------------------------------------------------------------------------------
1 | using QSHP.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Windows.Forms;
10 |
11 | namespace QSHP.UI.Bld
12 | {
13 | public partial class BladeMessageForm : BaseForm
14 | {
15 | BldData bldData;
16 | const string format = "0.####";
17 |
18 | public BladeMessageForm()
19 | {
20 | InitializeComponent();
21 | if (!DesignMode)
22 | {
23 | LoadBladeData(Globals.BldData);
24 | Common.ReportCmdKeyProgress(CmdKey.B0001);
25 | if (Globals.Cutting)
26 | {
27 | AutoUpdateEventHander += BladeMessageFrom_AutoUpdataEventHander;
28 | }
29 | }
30 | }
31 |
32 | private void BladeMessageFrom_AutoUpdataEventHander(object sender, EventArgs e)
33 | {
34 | LoadBladeData(Globals.BldData);
35 | }
36 |
37 | private void BladeMessageFrom_BT0Click(object sender, EventArgs e)
38 | {
39 | ClearBldData();
40 | }
41 |
42 | public void LoadBladeData(BldData data)
43 | {
44 | bldData = data;
45 | this.bldDataBindingSource.DataSource = bldData;
46 | panel1.Visible = Globals.NoTouchTest;
47 | if (Globals.NoTouchTest)
48 | {
49 | ncsOffset.Text = Globals.TabData.NcsOffset.ToString(format);
50 | ncsTestHeight.Text = Globals.TabData.NcsTestValue.ToString(format);
51 | }
52 | testingSpdSpeed.Text = Globals.TabData.SpdSpeed.ToString();
53 | if (Globals.DoubleCap)
54 | {
55 | label4.Text = "刀痕偏移Lo/Hi(mm):";
56 | bladeOffsetLo.Text = bldData.KnifeMarksOffsetHi.ToString(format)+"/" + bldData.KnifeMarksOffsetLo.ToString(format);
57 | }
58 | else
59 | {
60 | label4.Text = "刀痕偏移值(mm):";
61 | bladeOffsetLo.Text = bldData.KnifeMarksOffsetHi.ToString(format);
62 | }
63 | bladeDiameter.Text = bldData.BldDiameter.ToString(format)+"/"+bldData.FlangeDiameter.ToString(format);
64 |
65 | }
66 |
67 | public void ClearBldData()
68 | {
69 | if(bldData!=null)
70 | {
71 | bldData.SetCurrentValueClear();
72 | pieceAfterClear.Text = bldData.PieceAfterClear.ToString();
73 | linesAfterClear.Text = bldData.LinesAfterClear.ToString();
74 | bldLossAfterClear.Text = bldData.BldLossAfterClear.ToString(format);
75 | lengthAfterClear.Text = bldData.LenAfterClear.ToString(format);
76 | bldData.SaveBladeDataFile(Globals.AppCfg.BladeFileFullName);//保存当前文档
77 | Common.ReportCmdKeyProgress(CmdKey.B0002);
78 | }
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/QSHP/UI/Bld/BladeTestDataEdit.cs:
--------------------------------------------------------------------------------
1 | using QSHP.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Windows.Forms;
10 |
11 | namespace QSHP.UI.Bld
12 | {
13 | public partial class BladeTestDataEdit : BaseForm
14 | {
15 | TabData tabData;
16 | bool saved = false;
17 | bool applyNCS = true;
18 | public BladeTestDataEdit()
19 | {
20 | InitializeComponent();
21 | }
22 | public BladeTestDataEdit(TabData data)
23 | {
24 | InitializeComponent();
25 | applyNCS = Globals.NoTouchTest;
26 | tabData = data;
27 | }
28 | private void buttonEx1_Click(object sender, EventArgs e)
29 | {
30 | PointF p = Globals.AxisPoint;
31 | xPos.Value = p.X;
32 | yPos.Value = p.Y;
33 |
34 | }
35 |
36 | private void LoadTabDataValue(bool ncs=false)
37 | {
38 | deFaultMode.Enabled = ncs;
39 | if (ncs)
40 | {
41 | label7.Visible = true;
42 | label8.Visible = true;
43 | autoMode.Visible = true;
44 | cycCounter.Visible = true;
45 | ncsAllowMaxErr.Visible = true;
46 | label5.Visible = true;
47 | label6.Visible = true;
48 | groupBox3.Visible = true;
49 | }
50 | else
51 | {
52 | label7.Visible = false;
53 | label8.Visible = false;
54 | autoMode.Visible = false;
55 | cycCounter.Visible = false;
56 | ncsAllowMaxErr.Visible = false;
57 | label5.Visible = false;
58 | label6.Visible = false;
59 | groupBox3.Visible = false;
60 | }
61 | deFaultMode.SelectedIndex = tabData.ToolBarCsMode?0:1;
62 | checkTick.Value = tabData.TestTick;
63 | autoMode.SelectedIndex = tabData.NcsAutoMode;
64 | cycCounter.Value = tabData.NcsRepeatTick;
65 | csAllowMaxErr.Value = tabData.CsMaxErrValue;
66 | ncsAllowMaxErr.Value = tabData.NcsMaxErrValue;
67 | xPos.Value = tabData.NcsXpos;
68 | yPos.Value = tabData.NcsYpos;
69 | zPos.Value = tabData.NcsZlowPos;
70 | blowingWaterTime.Value = tabData.NcsBlowingWaterTime;
71 | waitTime.Value = tabData.NcsWaitTime;
72 | blowingAirTime.Value = tabData.NcsBlowingAirTime;
73 |
74 | }
75 |
76 | private void SaveTabDataValue()
77 | {
78 |
79 | tabData.ToolBarCsMode = deFaultMode.SelectedIndex == 0;
80 | tabData.TestTick = checkTick.Int;
81 | tabData.NcsAutoMode = autoMode.SelectedIndex;
82 | tabData.NcsRepeatTick = cycCounter.Int;
83 | tabData.CsMaxErrValue = csAllowMaxErr.Value;
84 | tabData.NcsMaxErrValue = ncsAllowMaxErr.Value;
85 | tabData.NcsXpos = xPos.Value;
86 | tabData.NcsYpos = yPos.Value;
87 | tabData.NcsZlowPos = zPos.Value;
88 | tabData.NcsBlowingWaterTime = blowingWaterTime.Int;
89 | tabData.NcsWaitTime = waitTime.Int;
90 | tabData.NcsBlowingAirTime = blowingAirTime.Int;
91 |
92 | Globals.TabData = tabData;
93 | Globals.TabData.SaveTabDataFile(Globals.AppCfg.TabFileFullPath);
94 | }
95 | private void BladeTestDataEdit_Load(object sender, EventArgs e)
96 | {
97 | LoadTabDataValue(applyNCS);
98 | }
99 |
100 | private void BladeTestDataEdit_CancelClick(object sender, EventArgs e)
101 | {
102 | if (saved)
103 | {
104 | SaveTabDataValue();
105 | }
106 | if (this.ParentForm != null)
107 | {
108 | this.ParentForm.OnCancelClick();
109 | }
110 | }
111 |
112 | private void BladeTestDataEdit_ConfirmClick(object sender, EventArgs e)
113 | {
114 | saved = CheckBladeTestDataIsValid();
115 | if (saved)
116 | {
117 | Common.ReportCmdKeyProgress(CmdKey.B0009);
118 | }
119 | }
120 |
121 | private bool CheckBladeTestDataIsValid()
122 | {
123 | return true;
124 | }
125 |
126 | private void BladeTestDataEdit_BT0Click(object sender, EventArgs e)
127 | {
128 | if (saved)
129 | {
130 | SaveTabDataValue();
131 | }
132 | this.ParentForm.ReplaceChildForm(new Bld.BladeCirTabEditManager(tabData));
133 | }
134 |
135 | private void BladeTestDataEdit_BT1Click(object sender, EventArgs e)
136 | {
137 | if (saved)
138 | {
139 | SaveTabDataValue();
140 | }
141 | this.ParentForm.ReplaceChildForm(new Bld.BladeRecTabEditManager(tabData));
142 | }
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/QSHP/UI/Bld/BladeTestDataManager.cs:
--------------------------------------------------------------------------------
1 | using QSHP.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Windows.Forms;
10 |
11 | namespace QSHP.UI.Bld
12 | {
13 | public partial class BladeTestDataManager : BaseForm
14 | {
15 | TabData tabData;
16 | TabArgs args;
17 | bool saved = false;
18 | public BladeTestDataManager()
19 | {
20 | InitializeComponent();
21 | }
22 |
23 | private void BladeTestDataManager_Load(object sender, EventArgs e)
24 | {
25 | if(!DesignMode)
26 | {
27 | tabData = Globals.TabData.CreateNewTabData();
28 | if (tabData == null)
29 | {
30 | tabData = new TabData();
31 | }
32 | LoadTabData();
33 | }
34 | }
35 |
36 | private void LoadTabData(bool updata=true)
37 | {
38 | if (updata)
39 | {
40 | tabNum.SelectedIndex = tabData.TabIndex;
41 | spdSpeed.Value = tabData.SpdSpeed;
42 | }
43 | tabType.SelectedIndex = tabData.RotateType ? 0 : 1;
44 | args = tabData.UsedTable;
45 | tabSize.Text = string.Format("{0} * {1}", args.TabSize.Width, args.TabSize.Height);
46 | xPos.Value = args.CurXpos;
47 | yPos.Value = args.CurYpos;
48 | zPos.Value = args.ZLowPos;
49 | tPos.Value = args.CurTpos;
50 | }
51 |
52 | private void SaveTabDataValue()
53 | {
54 | tabData.TabIndex = tabNum.SelectedIndex;
55 | tabData.RotateType = tabType.SelectedIndex == 0;
56 | tabData.SpdSpeed = spdSpeed.Int;
57 | Globals.TabData = tabData;
58 | }
59 |
60 | private bool CheckTabDataIsValid()
61 | {
62 | if (spdSpeed.Value > 60000 || spdSpeed.Value < 5000)
63 | {
64 | spdSpeed.SetError = true;
65 | Common.ReportCmdKeyProgress(CmdKey.B0004);
66 | return false;
67 | }
68 | else
69 | {
70 | return true;
71 | }
72 | }
73 |
74 | private void tabNum_SelectedIndexChanged(object sender, EventArgs e)
75 | {
76 | tabData.TabIndex = tabNum.SelectedIndex;
77 | LoadTabData(false);
78 | }
79 |
80 | private void tabType_SelectedIndexChanged(object sender, EventArgs e)
81 | {
82 | tabData.RotateType = tabType.SelectedIndex == 0;
83 | }
84 |
85 | private void BladeTestDataManager_BT0Click(object sender, EventArgs e)//圆形工作盘
86 | {
87 | if (this.ParentForm != null)
88 | {
89 | this.ParentForm.PushChildForm(new BladeCirTabEditManager(tabData));
90 | }
91 |
92 | }
93 |
94 | private void BladeTestDataManager_BT1Click(object sender, EventArgs e)//方形工作盘
95 | {
96 | if (this.ParentForm != null)
97 | {
98 | this.ParentForm.PushChildForm(new BladeRecTabEditManager(tabData));
99 | }
100 | }
101 |
102 | private void BladeTestDataManager_BT2Click(object sender, EventArgs e)//测高参数调整
103 | {
104 | if (this.ParentForm != null)
105 | {
106 | this.ParentForm.PushChildForm(new BladeTestDataEdit(tabData));
107 | }
108 | }
109 |
110 | private void BladeTestDataManager_CancelClick(object sender, EventArgs e)
111 | {
112 | if (saved)
113 | {
114 | SaveTabDataValue();
115 | }
116 | this.ParentForm.OnCancelClick();
117 | }
118 |
119 | private void BladeTestDataManager_ConfirmClick(object sender, EventArgs e)
120 | {
121 | saved = CheckTabDataIsValid();
122 | Common.ReportCmdKeyProgress(CmdKey.B0003);
123 | }
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/QSHP/UI/Bld/BladeTestHeightManager.cs:
--------------------------------------------------------------------------------
1 | using QSHP.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Windows.Forms;
10 |
11 | namespace QSHP.UI.Bld
12 | {
13 | public partial class BladeTestHeightManager : BaseForm
14 | {
15 | string format = "0.###";
16 | string[] tabNums = { "一号工作台","二号工作台","三号工作台","四号工作台","五号工作台"};
17 | string[] tabTypes = { "圆形", "方形" };
18 | string[] names = { "接触式测高", "非接触测高" , "NCS矫正" };
19 | int mode = 0;
20 | TabData tabData;
21 | public BladeTestHeightManager()
22 | {
23 | InitializeComponent();
24 | }
25 |
26 | public BladeTestHeightManager(int m= 0)
27 | {
28 | InitializeComponent();
29 | if (m > 2)
30 | {
31 | mode = 2;
32 | }
33 | mode = m;
34 | this.Text = names[m];
35 | this.panelEx1.Text = names[m];
36 | }
37 |
38 | public void LoadTestData(bool show=false)
39 | {
40 | panel1.Visible = mode > 0;
41 | panel2.Visible = mode > 0;
42 | if (mode > 0)
43 | {
44 | panel3.Location= new Point(112,19);
45 | panel4.Location = new Point(112, 28);
46 | }
47 | else
48 | {
49 | panel3.Location = new Point(275, 19);
50 | panel4.Location = new Point(275, 28);
51 | }
52 | tabData = Globals.TabData;
53 | bldNum.Text = Globals.BldData.BldNum;
54 | bldMode.Text = Globals.BldData.BldModel;
55 | spdSpeed.Text = tabData.SpdSpeed.ToString();
56 | tabNum.Text = tabNums[tabData.TabIndex];
57 | tabType.Text = tabTypes[tabData.UsedTable.RotateType?0:1];
58 | tabSize.Text = string.Format("{0} * {1}", tabData.UsedTabSize.Width, tabData.UsedTabSize.Height);
59 | csXpos.Text = tabData.UsedTable.CurXpos.ToString(format);
60 | csYpos.Text = tabData.UsedTable.CurYpos.ToString(format);
61 | csZpos.Text = tabData.UsedTable.ZLowPos.ToString(format);
62 | csTpos.Text = tabData.UsedTable.CurTpos.ToString(format);
63 |
64 | ncsXpos.Text = tabData.NcsXpos.ToString(format);
65 | ncsYpos.Text = tabData.NcsYpos.ToString(format);
66 | ncsZpos.Text = tabData.NcsZlowPos.ToString(format);
67 |
68 | csValue.Text = tabData.CsTestValue.ToString(format);
69 | ncsValue.Text = tabData.NcsTestValue.ToString(format);
70 |
71 | }
72 |
73 | private void TestHeightManager_Load(object sender, EventArgs e)
74 | {
75 | Common.ProgressWorkingChanged += new ProgressChangedEventHandler(Common_ProgressWorkingChanged);
76 | LoadTestData();
77 | }
78 |
79 | void Common_ProgressWorkingChanged(object sender, ProgressChangedEventArgs e)
80 | {
81 | switch (e.ProgressPercentage)
82 | {
83 | case ProcessCmd.CsTestingStartCmd:
84 | {
85 | csValue.ForeColor = Color.Blue;
86 | }break;
87 | case ProcessCmd.CsTestingErrCmd:
88 | {
89 | csValue.Text = Globals.TestHeightValue.ToString(format);
90 | csValue.ForeColor = Color.Red;
91 | }break;
92 | case ProcessCmd.CsTestingEndCmd:
93 | {
94 | csValue.Text = Globals.TestHeightValue.ToString(format);
95 | csValue.ForeColor = Color.Green;
96 | }break;
97 | case ProcessCmd.CsTestingTickCmd:
98 | {
99 | csYpos.Text = Common.Y_Axis.RealPos.ToString(format);
100 | csTpos.Text = Common.T_Axis.RealPos.ToString(format);
101 | csValue.Text = e.UserState.ToString();
102 | csValue.ForeColor = Color.Orange;
103 | }break;
104 | default:
105 | {
106 | }break;
107 | }
108 |
109 |
110 | }
111 |
112 | private void TestHeightManager_ConfirmClick(object sender, EventArgs e)
113 | {
114 | Globals.TestCancel = false;
115 | Common.SetSystemWorkMode(SysFunState.TouchTesting);
116 | }
117 |
118 | private void TestHeightManager_CancelClick(object sender, EventArgs e)
119 | {
120 | Globals.TestCancel = true;
121 | Common.ProgressWorkingChanged -=Common_ProgressWorkingChanged;
122 | if (this.ParentForm != null)
123 | {
124 | this.ParentForm.OnCancelClick();
125 | }
126 | }
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/QSHP/UI/Bld/TestHeightManager.cs:
--------------------------------------------------------------------------------
1 | using QSHP.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Windows.Forms;
10 |
11 | namespace QSHP.UI.Bld
12 | {
13 | public partial class TestHeightManager : BaseForm
14 | {
15 | string format = "0.###";
16 | string[] tabNums = { "一号工作台","二号工作台","三号工作台","四号工作台","五号工作台"};
17 | string[] tabTypes = { "圆形", "方形" };
18 | string[] names = { "接触式测高", "非接触测高" , "NCS矫正" };
19 | int mode = 0;
20 | TabData tabData;
21 | public TestHeightManager()
22 | {
23 | InitializeComponent();
24 | }
25 |
26 | public TestHeightManager(int m= 0)
27 | {
28 | InitializeComponent();
29 | if (m > 2)
30 | {
31 | mode = 2;
32 | }
33 | mode = m;
34 | this.Text = names[m];
35 | this.panelEx1.Text = names[m];
36 | }
37 |
38 | public void LoadTestData(bool show=false)
39 | {
40 | panel1.Visible = mode > 0;
41 | panel2.Visible = mode > 0;
42 | if (mode > 0)
43 | {
44 | panel3.Location= new Point(112,19);
45 | panel4.Location = new Point(112, 28);
46 | }
47 | else
48 | {
49 | panel3.Location = new Point(275, 19);
50 | panel4.Location = new Point(275, 28);
51 | }
52 | tabData = Globals.TabData;
53 | bldNum.Text = Globals.BladeData.BldNum;
54 | bldMode.Text = Globals.BladeData.BldModel;
55 | spdSpeed.Text = tabData.SpdSpeed.ToString();
56 | tabNum.Text = tabNums[tabData.TabIndex];
57 | tabType.Text = tabTypes[tabData.UsedTable.RotateType?0:1];
58 | tabSize.Text = string.Format("{0} * {1}", tabData.UsedTabSize.Width, tabData.UsedTabSize.Height);
59 | csXpos.Text = tabData.UsedTable.CurXpos.ToString(format);
60 | csYpos.Text = tabData.UsedTable.CurYpos.ToString(format);
61 | csZpos.Text = tabData.UsedTable.ZLowPos.ToString(format);
62 | csTpos.Text = tabData.UsedTable.CurTpos.ToString(format);
63 |
64 | ncsXpos.Text = tabData.NcsXpos.ToString(format);
65 | ncsYpos.Text = tabData.NcsYpos.ToString(format);
66 | ncsZpos.Text = tabData.NcsZlowPos.ToString(format);
67 |
68 | csValue.Text = tabData.CsTestValue.ToString(format);
69 | ncsValue.Text = tabData.NcsTestValue.ToString(format);
70 |
71 | }
72 |
73 | private void TestHeightManager_Load(object sender, EventArgs e)
74 | {
75 | Common.ProgressWorkingChanged += new ProgressChangedEventHandler(Common_ProgressWorkingChanged);
76 | LoadTestData();
77 | }
78 |
79 | void Common_ProgressWorkingChanged(object sender, ProgressChangedEventArgs e)
80 | {
81 | switch (e.ProgressPercentage)
82 | {
83 | case ProcessCmd.CsTestingStartCmd:
84 | {
85 | csValue.ForeColor = Color.Blue;
86 | }break;
87 | case ProcessCmd.CsTestingErrCmd:
88 | {
89 | csValue.Text = Globals.TestHeightValue.ToString(format);
90 | csValue.ForeColor = Color.Red;
91 | }break;
92 | case ProcessCmd.CsTestingEndCmd:
93 | {
94 | csValue.Text = Globals.TestHeightValue.ToString(format);
95 | csValue.ForeColor = Color.Green;
96 | }break;
97 | case ProcessCmd.CsTestingTickCmd:
98 | {
99 | csYpos.Text = Common.Y_Axis.RealPos.ToString(format);
100 | csTpos.Text = Common.T_Axis.RealPos.ToString(format);
101 | csValue.Text = e.UserState.ToString();
102 | csValue.ForeColor = Color.Orange;
103 | }break;
104 | default:
105 | {
106 | }break;
107 | }
108 |
109 |
110 | }
111 |
112 | private void TestHeightManager_ConfirmClick(object sender, EventArgs e)
113 | {
114 | Globals.TestCancel = false;
115 | Common.SetSystemWorkMode(SysFunState.TouchTesting);
116 | }
117 |
118 | private void TestHeightManager_CancelClick(object sender, EventArgs e)
119 | {
120 | Globals.TestCancel = true;
121 | Common.ProgressWorkingChanged -=Common_ProgressWorkingChanged;
122 | if (this.ParentForm != null)
123 | {
124 | this.ParentForm.OnCancelClick();
125 | }
126 | }
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/QSHP/UI/Ctr/AxisControlEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using System.Security.Permissions;
10 | using QSHP.HW;
11 | using QSHP.HW.AmpC;
12 | namespace QSHP.UI.Ctr
13 | {
14 |
15 | [ToolboxItem(false)]
16 | public partial class AxisControlEx : UserControl
17 | {
18 | int waitTick = 0;
19 | int waitCount = 8;
20 | bool wait = false;
21 | IAmpCProvider provider;
22 | int dir = 0;
23 | public ButtonEx IncButton
24 | {
25 | get
26 | {
27 | return BT3;
28 | }
29 | }
30 | public ButtonEx DecButton
31 | {
32 | get
33 | {
34 | return BT1;
35 | }
36 | }
37 | public AxisControlEx()
38 | {
39 | InitializeComponent();
40 | this.DoubleBuffered = true;
41 | SetCommonAxisObject();
42 | }
43 | protected override CreateParams CreateParams
44 | {
45 | get
46 | {
47 | CreateParams cp = base.CreateParams;
48 | cp.ExStyle |= 0x02000000;
49 | return cp;
50 | }
51 | }
52 | private void BT5_Click(object sender, EventArgs e)
53 | {
54 | SetCommonAxisObject();
55 | if (BT5.Pressed)
56 | {
57 | BT5.Text = "*";
58 | BT2.Text = "O";
59 | BT4.Text = "Q";
60 | BT6.Text = "R";
61 | BT8.Text = "P";
62 | BT7.Text = "Y";
63 | BT9.Text = "Z";
64 | }
65 | else
66 | {
67 | BT5.Text = "+";
68 |
69 | BT2.Text = "I";
70 | BT4.Text = "G";
71 | BT6.Text = "H";
72 | BT8.Text = "J";
73 | BT7.Text = "W";
74 | BT9.Text = "X";
75 | }
76 | }
77 |
78 | private void SetCommonAxisObject()
79 | {
80 | BT1.Flag = 1;
81 | BT2.Flag = -1;
82 | BT3.Flag = -1;
83 | BT4.Flag = -1;
84 | BT6.Flag = 1;
85 | BT7.Flag = 1;
86 | BT8.Flag = 1;
87 | BT9.Flag = -1;
88 | BT7.Tag = Common.T_Axis;
89 | BT9.Tag = Common.T_Axis;
90 | BT2.Tag = Common.Y_Axis;
91 | BT8.Tag = Common.Y_Axis;
92 | BT4.Tag = Common.X_Axis;
93 | BT6.Tag = Common.X_Axis;
94 | }
95 |
96 | private void BT_MouseDown(object sender, MouseEventArgs e)
97 | {
98 | if (e.Button != MouseButtons.Left)
99 | {
100 | return;
101 | }
102 | ButtonEx bt = sender as ButtonEx;
103 | if (bt != null && bt.Tag != null)
104 | {
105 | if (!BT5.Pressed)//低倍步进值
106 | {
107 | provider = bt.Tag as IAmpCProvider;
108 | dir = bt.Flag;
109 | wait = true;
110 | waitTick = 0;
111 | }
112 | }
113 | }
114 |
115 | private void BT_MouseUp(object sender, MouseEventArgs e)
116 | {
117 |
118 | ButtonEx bt = sender as ButtonEx;
119 | if (bt != null && bt.Tag != null)
120 | {
121 | IAmpCProvider provider = bt.Tag as IAmpCProvider;
122 | if (provider != null)
123 | {
124 | if (BT5.Pressed)
125 | {
126 | Common.AxisJogStep(provider, bt.Flag);
127 | }
128 | else
129 | {
130 | if (wait)
131 | {
132 | provider.JogInc(provider.Param.JogVelSlow, provider.Param.JogAccSlow, 0.001f * bt.Flag);
133 | wait = false;
134 | }
135 | else
136 | {
137 | provider.JogStop();//停止移动
138 | }
139 | }
140 | }
141 | }
142 | }
143 | public void AutoUpdata()
144 | {
145 | if (wait)
146 | {
147 | if (waitTick++ > waitCount)
148 | {
149 | if (provider != null)
150 | {
151 | provider.AxisJogDirSlow(dir);
152 | wait = false;
153 | }
154 | }
155 | }
156 | }
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/QSHP/UI/Ctr/ComboBoxEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Windows.Forms;
7 |
8 | namespace QSHP.UI.Ctr
9 | {
10 | public class ComboBoxEx:ComboBox
11 | {
12 | public ComboBoxEx() : base()
13 | {
14 | this.Font = new System.Drawing.Font("微软雅黑", 12F);
15 | this.DropDownStyle = ComboBoxStyle.DropDown;
16 | }
17 | //protected override CreateParams CreateParams
18 | //{
19 | // get
20 | // {
21 | // CreateParams arg = base.CreateParams;
22 | // arg.Style |= 0x03;
23 | // return arg;
24 | // }
25 | //}
26 | [Bindable(true)]
27 | public override int SelectedIndex
28 | {
29 | get
30 | {
31 | return base.SelectedIndex;
32 | }
33 |
34 | set
35 | {
36 | base.SelectedIndex = value;
37 | }
38 | }
39 | private void ComboBoxEx_MouseUp(object sender, MouseEventArgs e)
40 | {
41 | this.SelectionLength = 0;
42 | }
43 | protected override void OnKeyPress(KeyPressEventArgs e)
44 | {
45 | e.Handled = true;
46 | //this.SelectionLength = 0;
47 | //base.OnKeyPress(e);
48 | }
49 | protected override void OnDrawItem(DrawItemEventArgs e)
50 | {
51 | base.OnDrawItem(e);
52 | }
53 |
54 |
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/QSHP/UI/Ctr/GroupBoxEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace QSHP.UI.Ctr
11 | {
12 | public partial class GroupBoxEx : ContainerControl
13 | {
14 | private Label header;
15 |
16 | public string HeaderText
17 | {
18 | get
19 | {
20 | return this.header.Text;
21 | }
22 | set
23 | {
24 | this.header.Text = value;
25 | //this.Invalidate();
26 | }
27 | }
28 | private int boardWidth = 5;
29 |
30 | public int BoardWidth
31 | {
32 | get
33 | {
34 | return boardWidth-4;
35 | }
36 | set
37 | {
38 | boardWidth = 4+value;
39 | this.Invalidate();
40 | }
41 | }
42 |
43 | public Font HeaderFont
44 | {
45 | get
46 | {
47 | return this.header.Font;
48 | }
49 | set
50 | {
51 | this.header.Font = value;
52 | this.header.Height = value.Height;
53 | }
54 | }
55 |
56 | public ContentAlignment HeaderAligment
57 | {
58 | get
59 | {
60 | return this.header.TextAlign;
61 | }
62 | set
63 | {
64 | this.header.TextAlign = value;
65 | }
66 | }
67 |
68 | public Color HeaderBackColor
69 | {
70 | get
71 | {
72 | return this.header.BackColor;
73 | }
74 | set
75 | {
76 | this.header.BackColor=value;
77 | this.Invalidate();
78 | }
79 | }
80 |
81 | public Color HeaderForeColor
82 | {
83 | get
84 | {
85 | return this.header.ForeColor;
86 | }
87 | set
88 | {
89 | this.header.ForeColor = value;
90 | }
91 | }
92 |
93 | public GroupBoxEx()
94 | {
95 | this.DoubleBuffered = true;
96 | InitializeComponent();
97 | this.header.Height = this.header.Font.Height;
98 | }
99 |
100 | private void InitializeComponent()
101 | {
102 | this.SuspendLayout();
103 | //
104 | // label1
105 | //
106 | this.header = new System.Windows.Forms.Label();
107 | this.header.BackColor = System.Drawing.SystemColors.MenuHighlight;
108 | this.header.Dock = System.Windows.Forms.DockStyle.Top;
109 | this.header.TextAlign = ContentAlignment.MiddleLeft;
110 | this.header.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Bold);
111 | this.header.ForeColor = System.Drawing.SystemColors.HighlightText;
112 | this.header.Width = this.Width;
113 | this.header.Location = new System.Drawing.Point(0, 0);
114 | this.header.Margin = new System.Windows.Forms.Padding(1);
115 | this.header.Name = "header";
116 | this.header.AutoSize = false;
117 | this.header.Text = "标题";
118 | //
119 | // GroupEx
120 | //
121 | this.Controls.Add(this.header);
122 | this.Name = "GroupEx";
123 | this.Size = new System.Drawing.Size(177, 123);
124 | this.ResumeLayout(false);
125 | }
126 |
127 | protected override void OnPaintBackground(PaintEventArgs e)
128 | {
129 | base.OnPaintBackground(e);
130 | if (boardWidth > 3)
131 | {
132 | e.Graphics.DrawRectangle(new Pen(this.header.BackColor, boardWidth), ClientRectangle);
133 | }
134 | }
135 |
136 | protected override void OnControlAdded(ControlEventArgs e)
137 | {
138 | base.OnControlAdded(e);
139 | this.header.SendToBack();
140 | }
141 |
142 | }
143 | }
144 |
--------------------------------------------------------------------------------
/QSHP/UI/Ctr/LedShow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using System.Drawing.Drawing2D;
10 |
11 | namespace QSHP.UI.Ctr
12 | {
13 | public partial class LedShow : UserControl
14 | {
15 | public LedShow()
16 | {
17 | this.Size = new Size(40, 40);
18 | this.BackColor = Color.Transparent;
19 | this.BackgroundImageLayout = ImageLayout.Stretch;
20 | this.BackgroundImage = Properties.Resources.None;
21 | using (System.Drawing.Drawing2D.GraphicsPath g = new System.Drawing.Drawing2D.GraphicsPath())
22 | {
23 | g.AddEllipse(0,0,this.Width,this.Height);
24 | this.Region = new Region(g);
25 | }
26 | }
27 | private LedStatus status = LedStatus.None;
28 | [Browsable(false),EditorBrowsable(EditorBrowsableState.Never)]
29 | public override Image BackgroundImage
30 | {
31 | get
32 | {
33 | return base.BackgroundImage;
34 | }
35 | set
36 | {
37 | base.BackgroundImage = value;
38 | }
39 | }
40 | [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
41 | public override ImageLayout BackgroundImageLayout
42 | {
43 | get
44 | {
45 | return base.BackgroundImageLayout;
46 | }
47 | set
48 | {
49 | base.BackgroundImageLayout = value;
50 | }
51 | }
52 | [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
53 | public override Color BackColor
54 | {
55 | get
56 | {
57 | return base.BackColor;
58 | }
59 | set
60 | {
61 | base.BackColor = value;
62 | }
63 | }
64 | [DefaultValue(LedStatus.None)]
65 | public LedStatus Status
66 | {
67 | get
68 | {
69 | return status;
70 | }
71 | set
72 | {
73 | if (status != value)
74 | {
75 | status = value;
76 | switch (value)
77 | {
78 | case LedStatus.None:
79 | {
80 | this.BackgroundImage = Properties.Resources.None;
81 | }break;
82 | case LedStatus.OK:
83 | {
84 | this.BackgroundImage = Properties.Resources.OK;
85 | } break;
86 | case LedStatus.Warn:
87 | {
88 | this.BackgroundImage = Properties.Resources.Warn;
89 | } break;
90 | case LedStatus.Error:
91 | {
92 | this.BackgroundImage = Properties.Resources.Error;
93 | } break;
94 | }
95 | Invalidate();
96 | }
97 | }
98 | }
99 |
100 | protected override void OnSizeChanged(EventArgs e)
101 | {
102 | base.OnSizeChanged(e);
103 | using (System.Drawing.Drawing2D.GraphicsPath g = new System.Drawing.Drawing2D.GraphicsPath())
104 | {
105 | g.AddEllipse(0, 0, this.Width, this.Height);
106 | this.Region = new Region(g);
107 | }
108 | }
109 | }
110 |
111 | public enum LedStatus
112 | {
113 | None=0,
114 | OK=1,
115 | Error=2,
116 | Warn=3
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/QSHP/UI/Ctr/PanelEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Windows.Forms;
8 | using System.Windows.Forms.VisualStyles;
9 |
10 | namespace QSHP.UI.Ctr
11 | {
12 | [DefaultProperty("Text"), Description("Description PanelEx")]
13 | public class PanelEx:Panel
14 | {
15 | private Font headerFont= new System.Drawing.Font("微软雅黑", 18F);
16 |
17 | [Browsable(true), EditorBrowsable(EditorBrowsableState.Always),Bindable(true)]
18 | public override string Text
19 | {
20 | get
21 | {
22 | return base.Text;
23 | }
24 | set
25 | {
26 | base.Text = value;
27 | OnPaintBackground(new PaintEventArgs(this.CreateGraphics(),this.Bounds));
28 | }
29 | }
30 | public PanelEx() : base()
31 | {
32 | this.DoubleBuffered = true;
33 | this.Font= new System.Drawing.Font("微软雅黑", 12F);
34 | }
35 | public bool LeftMode
36 | {
37 | get
38 | {
39 | return leftMode;
40 | }
41 | set
42 | {
43 | leftMode = value;
44 | OnPaintBackground(new PaintEventArgs(this.CreateGraphics(),this.Bounds));
45 | }
46 | }
47 |
48 | public Font HeaderFont
49 | {
50 | get
51 | {
52 | return headerFont;
53 | }
54 |
55 | set
56 | {
57 | headerFont = value;
58 | }
59 | }
60 |
61 | private bool leftMode = false;
62 | protected override void OnPaintBackground(PaintEventArgs e)
63 | {
64 | base.OnPaintBackground(e);
65 | GroupBoxState state = this.Enabled ? GroupBoxState.Normal : GroupBoxState.Disabled;
66 | if (string.IsNullOrWhiteSpace(base.Text))
67 | {
68 | GroupBoxRenderer.DrawGroupBox(e.Graphics, new System.Drawing.Rectangle(1, 1, this.Width - 2, this.Height - 2), state);
69 | }
70 | else
71 | {
72 | if (LeftMode)
73 | {
74 | GroupBoxRenderer.DrawGroupBox(e.Graphics, new System.Drawing.Rectangle(1, 1, this.Width - 2, this.Height - 2), base.Text, this.headerFont, state);
75 | }
76 | else
77 | {
78 | GroupBoxRenderer.DrawGroupBox(e.Graphics, new System.Drawing.Rectangle(1, 1, this.Width - 2, this.Height - 2), base.Text, this.headerFont, TextFormatFlags.Right, state);
79 | }
80 | }
81 | }
82 |
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/QSHP/UI/Ctr/PictureBoxEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Windows.Forms;
7 |
8 | namespace QSHP.UI.Ctr
9 | {
10 | public class PictureBoxEx:Panel
11 | {
12 | public Image Image
13 | {
14 | get;
15 | set;
16 | }
17 | protected override void OnPaint(PaintEventArgs pe)
18 | {
19 | base.OnPaint(pe);
20 |
21 | }
22 | protected override void OnBackgroundImageChanged(EventArgs e)
23 | {
24 | base.OnBackgroundImageChanged(e);
25 | }
26 |
27 | protected override void OnPaintBackground(PaintEventArgs pevent)
28 | {
29 | base.OnPaintBackground(pevent);
30 | //if (this.Image != null)
31 | //{
32 | // pevent.Graphics.DrawImageUnscaled(this.Image, new Point(0, 0));
33 | //}
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/QSHP/UI/Ctr/ProgressBarEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Drawing.Drawing2D;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | namespace QSHP.UI.Ctr
10 | {
11 | public class ProgressBarEx:ProgressBar
12 | {
13 | Pen pen=new Pen(Color.Blue,2);
14 | Color fontColor = Color.Black;
15 | SolidBrush brush= new SolidBrush(Color.Blue);
16 | SolidBrush fontBrush = new SolidBrush(Color.Black);
17 |
18 | string format = "{0}";
19 | public string StringFormat
20 | {
21 | get
22 | {
23 | return format;
24 | }
25 | set
26 | {
27 | if (value.Contains("{0}"))
28 | {
29 | format = value;
30 | }
31 | //this.Invalidate();
32 | }
33 | }
34 | [Browsable(true)]
35 | public override string Text
36 | {
37 | get
38 | {
39 | return String.Format(format,Value);
40 | }
41 | }
42 | [Browsable(true)]
43 | public override Font Font
44 | {
45 | get
46 | {
47 | return base.Font;
48 | }
49 |
50 | set
51 | {
52 | base.Font = value;
53 | this.Invalidate();
54 | }
55 | }
56 | [Browsable(true)]
57 | public override Color ForeColor
58 | {
59 | get
60 | {
61 | return base.ForeColor;
62 | }
63 | set
64 | {
65 | base.ForeColor = value;
66 | pen.Color = value;
67 | brush.Color = value;
68 | this.Invalidate();
69 | }
70 | }
71 |
72 | public Color FontColor
73 | {
74 | get
75 | {
76 | return fontColor;
77 | }
78 |
79 | set
80 | {
81 | fontColor = value;
82 | fontBrush.Color = value;
83 | this.Invalidate();
84 | }
85 | }
86 |
87 | public ProgressBarEx()
88 | {
89 | this.SetStyle(ControlStyles.UserPaint, true);
90 | this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
91 | this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
92 | }
93 |
94 |
95 | protected override void OnPaint(PaintEventArgs e)
96 | {
97 | Rectangle rec = this.ClientRectangle;
98 | Graphics g = e.Graphics;
99 | g.CompositingQuality = CompositingQuality.HighQuality;
100 | g.SmoothingMode = SmoothingMode.HighQuality;
101 | g.FillRectangle(new SolidBrush(this.BackColor), rec);
102 | g.DrawRectangle(pen, rec);
103 | int h = rec.Height -= 4;
104 | int w = (int)(rec.Width * Value / Maximum) - 4;
105 | g.FillRectangle(brush, 2, 2, w, h);
106 | SizeF s = g.MeasureString(Text, this.Font);
107 | PointF p = new PointF((rec.Width-s.Width)/2,(rec.Height-this.FontHeight)/2);
108 | g.DrawString(Text,Font,fontBrush,p);
109 | }
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/QSHP/UI/Ctr/TabControlEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace QSHP.UI.Ctr
10 | {
11 | public class TabControlEx : TabControl
12 | {
13 | [Browsable(true)]
14 | public override Color BackColor
15 | {
16 | get
17 | {
18 | return base.BackColor;
19 | }
20 | set
21 | {
22 | base.BackColor = value;
23 | foreach (TabPage item in this.TabPages)
24 | {
25 | item.BackColor = value;
26 | }
27 | }
28 | }
29 | public TabControlEx()
30 | {
31 | SetStyle(ControlStyles.UserPaint, true);
32 | SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
33 | SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲 // 设置以上值为 true
34 | this.ItemSize = new Size(1, 1);
35 | }
36 | protected override void OnPaint(PaintEventArgs e)
37 | {
38 | base.OnPaint(e);
39 | //this
40 | System.Drawing.Pen pen = new Pen(this.BackColor, 3);
41 | e.Graphics.DrawRectangle(pen, 0, 0, this.Width, this.Height);//填充
42 | }
43 |
44 | protected override void OnControlAdded(ControlEventArgs e)
45 | {
46 | if (e.Control is TabControl)
47 | {
48 | e.Control.Padding = new System.Windows.Forms.Padding(0, 0, 0, 0);
49 | }
50 | base.OnControlAdded(e);
51 |
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/QSHP/UI/Ctr/TextBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace QSHP.UI.CtrLib
10 | {
11 | public class TextBoxEx : TextBox
12 | {
13 | protected Color warnColor = Color.Yellow;
14 | protected Color errorColor = Color.Red;
15 | protected Color defaultColor = Color.Green;
16 | protected bool setError = false;
17 | protected bool setWarn = false;
18 | public TextBoxEx() : base()
19 | {
20 | this.defaultColor = this.BackColor;
21 | this.Font = new Font("微软雅黑", 12F);
22 | }
23 | protected Color WarnColor
24 | {
25 | get { return warnColor; }
26 | set { warnColor = value; }
27 | }
28 |
29 | protected Color ErrorColor
30 | {
31 | get { return errorColor; }
32 | set { errorColor = value; }
33 | }
34 | [Bindable(false), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never)]
35 | public virtual bool IsNum
36 | {
37 | get
38 | {
39 | return false;
40 | }
41 | }
42 |
43 | protected override void OnKeyPress(KeyPressEventArgs e)
44 | {
45 | if (this.ReadOnly)
46 | {
47 | return;
48 | }
49 | if (this.IsInputChar(e.KeyChar))
50 | {
51 | this.BackColor = warnColor;
52 | }
53 | else
54 | {
55 | this.BackColor = errorColor;
56 | }
57 | base.OnKeyPress(e);
58 |
59 | }
60 | [Browsable(false)]
61 | public bool SetError
62 | {
63 | get
64 | {
65 | return setError;
66 | }
67 |
68 | set
69 | {
70 | setError = value;
71 | if (value)
72 | {
73 | this.BackColor = errorColor;
74 | }
75 | else
76 | {
77 | this.BackColor = defaultColor;
78 | }
79 | }
80 | }
81 | [Browsable(false)]
82 | public bool SetWarn
83 | {
84 | get
85 | {
86 | return setWarn;
87 | }
88 |
89 | set
90 | {
91 | setWarn = value;
92 | if (value)
93 | {
94 | this.BackColor = warnColor;
95 | }
96 | else
97 | {
98 | this.BackColor = defaultColor;
99 | }
100 | }
101 | }
102 | protected virtual bool ParseEditText()
103 | {
104 | return true;
105 | }
106 |
107 | //protected override void OnVisibleChanged(EventArgs e)
108 | //{
109 | // base.OnVisibleChanged(e);
110 | // if (this.Visible && !this.DesignMode)
111 | // {
112 | // if (ParseEditText())
113 | // {
114 | // this.BackColor = this.defaultColor;
115 | // }
116 | // else
117 | // {
118 | // this.BackColor = this.errorColor;
119 | // }
120 | // }
121 | //}
122 | protected override void OnLostFocus(EventArgs e)
123 | {
124 | base.OnLostFocus(e);
125 | if (!this.DesignMode)
126 | {
127 | if (ParseEditText())
128 | {
129 | this.BackColor = this.defaultColor;
130 | }
131 | else
132 | {
133 | this.BackColor = this.errorColor;
134 | }
135 | }
136 | }
137 | }
138 |
139 | }
140 |
--------------------------------------------------------------------------------
/QSHP/UI/Ctr/TextBoxEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace QSHP.UI.Ctr
10 | {
11 | public class TextBoxEx : TextBox
12 | {
13 | protected Color warnColor = Color.Yellow;
14 | protected Color errorColor = Color.Red;
15 | protected Color defaultColor = Color.Green;
16 | protected bool setError = false;
17 | protected bool setWarn = false;
18 |
19 | //public new bool Enabled
20 | //{
21 | // get
22 | // {
23 | // return base.Enabled;
24 | // }
25 | // set
26 | // {
27 | // base.Enabled = value;
28 | // if (base.Enabled)
29 | // {
30 | // this.BackColor = SystemColors.Control;
31 | // }
32 | // else
33 | // {
34 | // this.BackColor = SystemColors.Window;
35 | // }
36 | // }
37 | //}
38 |
39 | //public new bool ReadOnly
40 | //{
41 | // get
42 | // {
43 | // return base.ReadOnly;
44 | // }
45 | // set
46 | // {
47 | // base.ReadOnly = value;
48 | // if (base.ReadOnly)
49 | // {
50 | // this.BackColor = SystemColors.Control;
51 | // }
52 | // else
53 | // {
54 | // this.BackColor = SystemColors.Window;
55 | // }
56 | // }
57 | //}
58 | public TextBoxEx() : base()
59 | {
60 | this.defaultColor = this.BackColor;
61 | this.Font = new Font("微软雅黑", 12F);
62 | }
63 | protected Color WarnColor
64 | {
65 | get { return warnColor; }
66 | set { warnColor = value; }
67 | }
68 |
69 | protected Color ErrorColor
70 | {
71 | get { return errorColor; }
72 | set { errorColor = value; }
73 | }
74 | [Bindable(false), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never)]
75 | public virtual bool IsNum
76 | {
77 | get
78 | {
79 | return false;
80 | }
81 | }
82 |
83 | protected override void OnKeyPress(KeyPressEventArgs e)
84 | {
85 | if (this.ReadOnly)
86 | {
87 | return;
88 | }
89 | if (this.IsInputChar(e.KeyChar))
90 | {
91 | this.BackColor = warnColor;
92 | }
93 | else
94 | {
95 | this.BackColor = errorColor;
96 | }
97 | base.OnKeyPress(e);
98 |
99 | }
100 | [Browsable(false)]
101 | public bool SetError
102 | {
103 | get
104 | {
105 | return setError;
106 | }
107 |
108 | set
109 | {
110 | setError = value;
111 | if (value)
112 | {
113 | this.BackColor = errorColor;
114 | }
115 | else
116 | {
117 | this.BackColor = defaultColor;
118 | }
119 | }
120 | }
121 | [Browsable(false)]
122 | public bool SetWarn
123 | {
124 | get
125 | {
126 | return setWarn;
127 | }
128 |
129 | set
130 | {
131 | setWarn = value;
132 | if (value)
133 | {
134 | this.BackColor = warnColor;
135 | }
136 | else
137 | {
138 | this.BackColor = defaultColor;
139 | }
140 | }
141 | }
142 | protected virtual bool ParseEditText()
143 | {
144 | return true;
145 | }
146 |
147 | protected override void OnLostFocus(EventArgs e)
148 | {
149 | base.OnLostFocus(e);
150 | if (!this.DesignMode)
151 | {
152 | if (ParseEditText())
153 | {
154 | this.BackColor = this.defaultColor;
155 | }
156 | else
157 | {
158 | this.BackColor = this.errorColor;
159 | }
160 | }
161 | }
162 |
163 |
164 | }
165 |
166 | }
167 |
--------------------------------------------------------------------------------
/QSHP/UI/Ctr/VideoControlEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using QSHP.HW.Video;
10 | namespace QSHP.UI.Ctr
11 | {
12 | [ToolboxItem(false)]
13 | public partial class VideoControlEx : UserControl
14 | {
15 | IVideoProvider captureProvider;
16 | public override Color ForeColor
17 | {
18 | get
19 | {
20 | return base.ForeColor;
21 | }
22 |
23 | set
24 | {
25 | base.ForeColor = value;
26 | groupBox1.ForeColor = value;
27 | }
28 | }
29 | public IVideoProvider CaptureProvider
30 | {
31 | get
32 | {
33 | return captureProvider;
34 | }
35 | set
36 | {
37 | captureProvider = value;
38 | }
39 | }
40 | protected override CreateParams CreateParams
41 | {
42 | get
43 | {
44 | CreateParams cp = base.CreateParams;
45 | cp.ExStyle |= 0x02000000;
46 | return cp;
47 | }
48 | }
49 | public VideoControlEx()
50 | {
51 | InitializeComponent();
52 | RV.DataBindings.Add("Text", Rbar, "Value",true);
53 | TV.DataBindings.Add("Text", Tbar, "Value", true);
54 | }
55 |
56 | private void Rbar_ValueChanged(object sender, EventArgs e)
57 | {
58 | if (captureProvider != null)
59 | {
60 | if (captureProvider.IsRunning)
61 | {
62 | captureProvider.Gain = (byte)Rbar.Value;
63 | }
64 | }
65 | }
66 |
67 | private void Tbar_ValueChanged(object sender, EventArgs e)
68 | {
69 | if (captureProvider != null)
70 | {
71 | if (captureProvider.IsRunning)
72 | {
73 | captureProvider.Exposure = Tbar.Value;
74 | }
75 | }
76 | }
77 |
78 | private void VideoControlEx_VisibleChanged(object sender, EventArgs e)
79 | {
80 | if (this.Visible && captureProvider != null&&captureProvider.IsRunning)
81 | {
82 | Tbar.Value = captureProvider.Exposure;
83 | Rbar.Value = captureProvider.Gain;
84 | switch (captureProvider.AdcMode)
85 | {
86 | case 2:
87 | {
88 | Lrb.Checked = true;
89 | } break;
90 | case 1:
91 | {
92 | Mrb.Checked = true;
93 | } break;
94 | case 0:
95 | {
96 | Hrb.Checked = true;
97 | } break;
98 | default:
99 | {
100 | Hrb.Checked = true;
101 | } break;
102 | }
103 | this.Enabled = true;
104 | }
105 | else
106 | {
107 | this.Enabled = false;
108 | }
109 | }
110 |
111 | private void Hrb_CheckedChanged(object sender, EventArgs e)
112 | {
113 | if (Hrb.Checked && captureProvider != null)
114 | {
115 | captureProvider.AdcMode = 0;
116 | }
117 | }
118 |
119 | private void Mrb_CheckedChanged(object sender, EventArgs e)
120 | {
121 | if (Mrb.Checked && captureProvider != null)
122 | {
123 | captureProvider.AdcMode = 1;
124 | }
125 | }
126 |
127 | private void Lrb_CheckedChanged(object sender, EventArgs e)
128 | {
129 | if (Lrb.Checked && captureProvider != null)
130 | {
131 | captureProvider.AdcMode = 2;
132 | }
133 | }
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/QSHP/UI/Dev/DevAlignDataManager.cs:
--------------------------------------------------------------------------------
1 | using QSHP.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Windows.Forms;
10 |
11 | namespace QSHP.UI
12 | {
13 | public partial class DevAlignDataManager : BaseForm
14 | {
15 | DevData dev;
16 | bool saved = false;
17 | public DevAlignDataManager(DevData d)
18 | {
19 | InitializeComponent();
20 | if (!DesignMode)
21 | {
22 | dev = d;
23 | LoadDevDataValue(dev);
24 | }
25 | }
26 | private void SaveDevDataValue()
27 | {
28 | DevData d = dev;
29 | d.OnceAlignLineAdj = adjTickValue.Value;
30 | d.MaxAlignLineAdj = adjMaxValue.Value;
31 | d.MaxPosAdj = posMaxValue.Value;
32 | d.MaxHeightAdj = heightMaxValue.Value;
33 | d.OnceHeightAdj = heightTickValue.Value;
34 | d.MaxSpeedAdj = speedMaxValue.Value;
35 | d.MaxStepAdj = stepMaxValue.Value;
36 |
37 | d.ReplaceBldXNoMove = xReplaceBldnNoMove.Checked;
38 | d.ReplaceBldXPos = xRePos.Value;
39 | d.ReplaceBldYPos = yRePos.Value;
40 | d.ReplaceBldZPos = zRePos.Value;
41 | DevDataManager.saved = true;
42 | }
43 | private void LoadDevDataValue(DevData d)
44 | {
45 | adjTickValue.Value = d.OnceAlignLineAdj;
46 | adjMaxValue.Value = d.MaxAlignLineAdj;
47 | posMaxValue.Value = d.MaxPosAdj;
48 | heightMaxValue.Value = d.MaxHeightAdj;
49 | heightTickValue.Value = d.OnceHeightAdj;
50 | speedMaxValue.Value = d.MaxSpeedAdj;
51 | stepMaxValue.Value = d.MaxStepAdj;
52 |
53 | xReplaceBldnNoMove.Checked = d.ReplaceBldXNoMove;
54 | xRePos.Value = d.ReplaceBldXPos;
55 | yRePos.Value = d.ReplaceBldYPos;
56 | zRePos.Value = d.ReplaceBldZPos;
57 |
58 | }
59 |
60 | private void DevAlignDataManager_CancelClick(object sender, EventArgs e)
61 | {
62 | if (saved)
63 | {
64 | SaveDevDataValue();
65 | }
66 | this.ParentForm.OnCancelClick();
67 | }
68 |
69 | private void DevAlignDataManager_ConfirmClick(object sender, EventArgs e)
70 | {
71 | saved = true;
72 | }
73 |
74 | private void xReplaceBldnNoMove_CheckedChanged(object sender, EventArgs e)
75 | {
76 | xRePos.Enabled = !xReplaceBldnNoMove.Checked;
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/QSHP/UI/Dev/DevLedCfgManager.cs:
--------------------------------------------------------------------------------
1 | using QSHP.Data;
2 | using QSHP.UI.Ctr;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.ComponentModel;
6 | using System.Data;
7 | using System.Drawing;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Windows.Forms;
11 |
12 | namespace QSHP.UI
13 | {
14 | public partial class DevLedCfgManager : BaseForm
15 | {
16 | List Bs = new List();
17 | List Gs = new List();
18 | List Ys = new List();
19 | List Rs = new List();
20 | List cmds = new List();
21 | bool saved = false;
22 | DevData dev;
23 | public DevLedCfgManager(DevData d)
24 | {
25 | InitializeComponent();
26 | if (!DesignMode)
27 | {
28 | dev = d;
29 | InitDefaultCtr();
30 | LoadDefaultValue(dev);
31 | }
32 | }
33 |
34 | private void T1_Click(object sender, EventArgs e)
35 | {
36 | ButtonEx b = sender as ButtonEx;
37 | if (b != null)
38 | {
39 | int i = b.Flag;
40 | LedCmd cmd = new LedCmd();
41 | cmd.Buzzer = (byte)Bs[i].SelectedIndex;
42 | cmd.Green = (byte)Gs[i].SelectedIndex;
43 | cmd.Yellow = (byte)Ys[i].SelectedIndex;
44 | cmd.Red = (byte)Rs[i].SelectedIndex;
45 | Globals.LedCmd.Cmd = cmd.Cmd;
46 | }
47 | }
48 |
49 | private void SaveDefaultValue()
50 | {
51 | if (saved)
52 | {
53 | for (int i = 0; i < 9; i++)
54 | {
55 | cmds[i].Buzzer = (byte)Bs[i].SelectedIndex;
56 | cmds[i].Green = (byte)Gs[i].SelectedIndex;
57 | cmds[i].Yellow = (byte)Ys[i].SelectedIndex;
58 | cmds[i].Red = (byte)Rs[i].SelectedIndex;
59 | }
60 | DevDataManager.saved = true;
61 | }
62 | }
63 |
64 | private void LoadDefaultValue(DevData dev)
65 | {
66 | cmds.Clear();
67 | cmds.Add(dev.LoadLedCmd);
68 | cmds.Add(dev.IdleLedCmd);
69 | cmds.Add(dev.InitLedCmd);
70 | cmds.Add(dev.PauseLedCmd);
71 | cmds.Add(dev.StopLedCmd);
72 | cmds.Add(dev.WorkingLedCmd);
73 | cmds.Add(dev.TestingLedCmd);
74 | cmds.Add(dev.ErrAirWaterLedCmd);
75 | cmds.Add(dev.EmgLedCmd);
76 | for (int i = 0; i < 9; i++)
77 | {
78 | Bs[i].SelectedIndex = cmds[i].Buzzer;
79 | Gs[i].SelectedIndex = cmds[i].Green;
80 | Ys[i].SelectedIndex = cmds[i].Yellow;
81 | Rs[i].SelectedIndex = cmds[i].Red;
82 | }
83 | }
84 | private void InitDefaultCtr()
85 | {
86 | Bs.Add(B1);
87 | Bs.Add(B2);
88 | Bs.Add(B3);
89 | Bs.Add(B4);
90 | Bs.Add(B5);
91 | Bs.Add(B6);
92 | Bs.Add(B7);
93 | Bs.Add(B8);
94 | Bs.Add(B9);
95 |
96 | Gs.Add(G1);
97 | Gs.Add(G2);
98 | Gs.Add(G3);
99 | Gs.Add(G4);
100 | Gs.Add(G5);
101 | Gs.Add(G6);
102 | Gs.Add(G7);
103 | Gs.Add(G8);
104 | Gs.Add(G9);
105 |
106 | Ys.Add(Y1);
107 | Ys.Add(Y2);
108 | Ys.Add(Y3);
109 | Ys.Add(Y4);
110 | Ys.Add(Y5);
111 | Ys.Add(Y6);
112 | Ys.Add(Y7);
113 | Ys.Add(Y8);
114 | Ys.Add(Y9);
115 |
116 | Rs.Add(R1);
117 | Rs.Add(R2);
118 | Rs.Add(R3);
119 | Rs.Add(R4);
120 | Rs.Add(R5);
121 | Rs.Add(R6);
122 | Rs.Add(R7);
123 | Rs.Add(R8);
124 | Rs.Add(R9);
125 |
126 | }
127 |
128 | private void DevLedCfgManager_ConfirmClick(object sender, EventArgs e)
129 | {
130 | saved = true;
131 | }
132 |
133 | private void DevLedCfgManager_CancelClick(object sender, EventArgs e)
134 | {
135 | if (saved)
136 | {
137 | SaveDefaultValue();
138 | }
139 | this.ParentForm.OnCancelClick();
140 | }
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/QSHP/UI/Dev/PixelFactorManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace QSHP.UI
11 | {
12 | public partial class PixelFactorManager : AlignFormBase
13 | {
14 | int h = 420;
15 | int h1 = 0;
16 | int tickCount = 0;
17 | float s1, s2,factor;
18 | bool btFlag = false;
19 | Pen linePen = new Pen(Color.Yellow, 1);
20 | public PixelFactorManager()
21 | {
22 | InitializeComponent();
23 | }
24 |
25 | private void PixelFactorManager_Load(object sender, EventArgs e)
26 | {
27 | CaptureView.UserPaint += CaptureView_UserPaint;
28 | CaptureView.MouseFollow = false;//关闭鼠标跟随
29 | CaptureView.ApplyBinning = true;//不支持倍率切换
30 | if (CaptureView.CaptureProvider != null)
31 | {
32 | factor = CaptureView.CaptureProvider.Scale;
33 | pixScale.Value = factor;
34 | CaptureView.CaptureProvider.BinningMode = false;
35 | }
36 | yPix.Value = h;
37 | Common.ReportCmdKeyProgress(CmdKey.P0200);
38 | }
39 |
40 | private void CaptureView_UserPaint(object sender, PaintEventArgs e)
41 | {
42 | Graphics g = e.Graphics;
43 | h1 = e.ClipRectangle.Height - 30;
44 | if (CaptureView.IncHeightPressed | CaptureView.DecHeightPressed)
45 | {
46 | if (tickCount == 0 || tickCount > 5)
47 | {
48 | if (CaptureView.IncHeightPressed)
49 | {
50 | h++;
51 | }
52 | else
53 | {
54 | h--;
55 | }
56 | yPix.Value = h;
57 | }
58 | tickCount++;
59 | }
60 | else
61 | {
62 | tickCount=0;
63 | }
64 | if (h > h1-20)
65 | {
66 | h = h1-20;
67 | yPix.Value = h;
68 | }
69 | else if (h<20)
70 | {
71 | h = 20;
72 | yPix.Value = h;
73 | }
74 | if (btFlag&& Common.Y_Axis != null)
75 | {
76 | yLenth.Value = Common.Y_Axis.RealPos - s1;
77 | }
78 | g.DrawLine(linePen, 0, h1, e.ClipRectangle.Width, h1);
79 | g.DrawLine(linePen, 0, h1-h, e.ClipRectangle.Width, h1-h);
80 | }
81 |
82 | private void PixelFactorManager_BT0Click(object sender, EventArgs e)
83 | {
84 | if (Common.Y_Axis != null)
85 | {
86 | s1 = Common.Y_Axis.RealPos;
87 | y1Pos.Value = s1;
88 | y2Pos.Value = s1;
89 | btFlag = true;
90 | Common.ReportCmdKeyProgress(CmdKey.P0201);
91 | }
92 | else
93 | {
94 | Common.ReportCmdKeyProgress(CmdKey.S0309);
95 | }
96 | }
97 |
98 | private void PixelFactorManager_BT5Click(object sender, EventArgs e)
99 | {
100 | if (Common.Y_Axis != null)
101 | {
102 | s2 = Common.Y_Axis.RealPos;
103 | y2Pos.Value = s2;
104 | if (s1 == s2)
105 | {
106 | Common.ReportCmdKeyProgress(CmdKey.P0202);
107 | }
108 | else
109 | {
110 | factor = Math.Abs(s2 - s1) / h;
111 | pixScale.Value = factor;
112 | btFlag = false;
113 | Common.ReportCmdKeyProgress(CmdKey.P0203);
114 | }
115 | }
116 | else
117 | {
118 | Common.ReportCmdKeyProgress(CmdKey.S0309);
119 | }
120 |
121 | }
122 |
123 | private void PixelFactorManager_ConfirmClick(object sender, EventArgs e)
124 | {
125 | if (CaptureView.CaptureProvider != null)
126 | {
127 | CaptureView.CaptureProvider.Scale=factor;//倍率当前
128 | Globals.DevCfg.LowPixValue = factor;
129 | Globals.DevCfg.SaveDevDataToFile(Globals.AppCfg.DevFullPathName);
130 | Common.ReportCmdKeyProgress(CmdKey.P0204);
131 | }
132 | else
133 | {
134 | Common.ReportCmdKeyProgress(CmdKey.S0309);
135 | }
136 | }
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/QSHP/UI/File/AnyChannelManager.cs:
--------------------------------------------------------------------------------
1 | using QSHP.Data;
2 | using QSHP.UI.User;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.ComponentModel;
6 | using System.Data;
7 | using System.Drawing;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Windows.Forms;
11 |
12 | namespace QSHP.UI
13 | {
14 | public partial class AnyChannelManager : BaseForm
15 | {
16 | List ctrs = new List();
17 | CutChip chip = new CutChip();
18 | bool rePair = true;
19 | bool saved = false;
20 | public AnyChannelManager()
21 | {
22 | InitializeComponent();
23 | }
24 | public AnyChannelManager(CutChip c,bool re=true)
25 | {
26 | InitializeComponent();
27 | this.Enabled = re;
28 | rePair = re;
29 | if (c != null)
30 | {
31 | chip = c;
32 | }
33 | }
34 | private void LoadCutChipData(CutChip c)
35 | {
36 | ctrs.Add(channelCtrList1);
37 | ctrs.Add(channelCtrList2);
38 | ctrs.Add(channelCtrList3);
39 | ctrs.Add(channelCtrList4);
40 | ctrs.Add(channelCtrList5);
41 | ctrs.Add(channelCtrList6);
42 | ctrs.Add(channelCtrList7);
43 | ctrs.Add(channelCtrList8);
44 | ctrs.Add(channelCtrList9);
45 | ctrs.Add(channelCtrList10);
46 | for (int i = c.Count; i < 10; i++)//增加模板
47 | {
48 | CutChannel ch = new CutChannel();
49 | ch.Enable = false;
50 | c.Add(ch);
51 | }
52 | for (int i = 0; i < 10; i++)
53 | {
54 | ctrs[i].CH = c.CHs[i];
55 | }
56 |
57 | }
58 |
59 | private void ChannelCtrList_UserEnabledChanged(object sender, EventArgs e)
60 | {
61 | ChannelCtrList c = sender as ChannelCtrList;
62 | if (c != null)
63 | {
64 | foreach (var item in ctrs)
65 | {
66 | if (c.Enabled)
67 | {
68 | if (item.CHIndex < c.CHIndex)
69 | {
70 | item.Enabled = true;
71 | }
72 | }
73 | else
74 | {
75 | if (item.CHIndex > c.CHIndex)
76 | {
77 | item.Enabled = false;
78 | }
79 | }
80 | }
81 | }
82 | }
83 |
84 | private void AnyChannelManager_Load(object sender, EventArgs e)
85 | {
86 | if (!DesignMode)
87 | {
88 | LoadCutChipData(chip);
89 | }
90 | }
91 |
92 | private void AnyChannelManager_CancelClick(object sender, EventArgs e)
93 | {
94 | if (saved)
95 | {
96 | foreach (var item in ctrs)
97 | {
98 | if (!item.Enabled)
99 | {
100 | chip.CHs.Remove(item.CH);
101 | }
102 | else
103 | {
104 | item.SaveCutChannelData();//保存当前数据
105 | }
106 | }
107 | }
108 | if (this.ParentForm != null)
109 | {
110 | this.ParentForm.OnCancelClick();
111 | }
112 | }
113 |
114 | private void AnyChannelManager_ConfirmClick(object sender, EventArgs e)
115 | {
116 | if (CheckChannelDataIsValid())
117 | {
118 | saved = true;
119 | CutDataManager.saved = true;
120 | Common.ReportCmdKeyProgress(CmdKey.F0036);
121 | }
122 | else
123 | {
124 | if (!channelCtrList1.Enabled)//需要最少使能一个通道
125 | {
126 | Common.ReportCmdKeyProgress(CmdKey.F0043);
127 | }
128 | else
129 | {
130 | Common.ReportCmdKeyProgress(CmdKey.F0044);
131 | }
132 | }
133 | }
134 | private bool CheckChannelDataIsValid()
135 | {
136 | bool flag = true;
137 | foreach (var item in ctrs)
138 | {
139 | flag &= item.CheckChannelDataIsValid();
140 | }
141 | if (!channelCtrList1.Enabled)//需要最少使能一个通道
142 | {
143 | flag = false;
144 | }
145 | return flag;
146 | }
147 | private void AnyChannelManager_BT0Click(object sender, EventArgs e)
148 | {
149 | foreach (var item in ctrs)
150 | {
151 | item.ClearCutChannelData();
152 | }
153 | Common.ReportCmdKeyProgress(CmdKey.F0037);
154 | }
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/QSHP/UI/File/DataManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace QSHP.UI
11 | {
12 | public partial class DataManager : BaseForm
13 | {
14 | private FileStyle style = FileStyle.Stand;
15 | public DataManager()
16 | {
17 | InitializeComponent();
18 | }
19 | public DataManager(string text)
20 | {
21 | InitializeComponent();
22 | this.Text = text;
23 | }
24 |
25 | public DataManager(string text,FileStyle style)
26 | {
27 | InitializeComponent();
28 | this.Text = text;
29 | Style = style;
30 | }
31 | public FileStyle Style
32 | {
33 | get
34 | {
35 | return style;
36 | }
37 | set
38 | {
39 | style = value;
40 | switch (value)
41 | {
42 | case FileStyle.AnyCh:
43 | {
44 | tabControlEx1.SelectedIndex = 2;
45 | }
46 | break;
47 | case FileStyle.MulStep:
48 | {
49 | tabControlEx1.SelectedIndex = 1;
50 | }
51 | break;
52 | case FileStyle.QFN:
53 | {
54 | tabControlEx1.SelectedIndex = 3;
55 | }
56 | break;
57 | case FileStyle.PreCut:
58 | {
59 | tabControlEx1.SelectedIndex = 0;
60 | }
61 | break;
62 | default:
63 | {
64 | tabControlEx1.SelectedIndex = 0;
65 | }
66 | break;
67 | }
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/QSHP/UI/Mac/PixelFactorManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace QSHP.UI.Machine
11 | {
12 | public partial class PixelFactorManager : AlignFormBase
13 | {
14 | int h = 420;
15 | int h1 = 0;
16 | int tickCount = 0;
17 | float s1, s2,factor;
18 | bool btFlag = false;
19 | Pen linePen = new Pen(Color.Yellow, 1);
20 | public PixelFactorManager()
21 | {
22 | InitializeComponent();
23 | }
24 |
25 | private void PixelFactorManager_Load(object sender, EventArgs e)
26 | {
27 | CaptureView.UserPaint += CaptureView_UserPaint;
28 | CaptureView.MouseFollow = false;//关闭鼠标跟随
29 | CaptureView.ApplyBinning = false;//不支持倍率切换
30 | if (CaptureView.CaptureProvider != null)
31 | {
32 | factor = CaptureView.CaptureProvider.Scale;
33 | pixScale.Value = factor;
34 | CaptureView.CaptureProvider.BinningMode = false;
35 | }
36 | yPix.Value = h;
37 | Common.ReportCmdKeyProgress(CmdKey.P0200);
38 | }
39 |
40 | private void CaptureView_UserPaint(object sender, PaintEventArgs e)
41 | {
42 | Graphics g = e.Graphics;
43 | h1 = e.ClipRectangle.Height - 30;
44 | if (CaptureView.IncHeightPressed | CaptureView.DecHeightPressed)
45 | {
46 | if (tickCount == 0 || tickCount > 5)
47 | {
48 | if (CaptureView.IncHeightPressed)
49 | {
50 | h++;
51 | }
52 | else
53 | {
54 | h--;
55 | }
56 | yPix.Value = h;
57 | }
58 | tickCount++;
59 | }
60 | else
61 | {
62 | tickCount=0;
63 | }
64 | if (h > h1-20)
65 | {
66 | h = h1-20;
67 | yPix.Value = h;
68 | }
69 | else if (h<20)
70 | {
71 | h = 20;
72 | yPix.Value = h;
73 | }
74 | if (btFlag&& Common.Y_Axis != null)
75 | {
76 | yLenth.Value = Common.Y_Axis.Position - s1;
77 | }
78 | g.DrawLine(linePen, 0, h1, e.ClipRectangle.Width, h1);
79 | g.DrawLine(linePen, 0, h1-h, e.ClipRectangle.Width, h1-h);
80 | }
81 |
82 | private void PixelFactorManager_BT0Click(object sender, EventArgs e)
83 | {
84 | if (Common.Y_Axis != null)
85 | {
86 | s1 = Common.Y_Axis.Position;
87 | y1Pos.Value = s1;
88 | y2Pos.Value = s1;
89 | btFlag = true;
90 | Common.ReportCmdKeyProgress(CmdKey.P0201);
91 | }
92 | else
93 | {
94 | Common.ReportCmdKeyProgress(CmdKey.S0309);
95 | }
96 | }
97 |
98 | private void PixelFactorManager_BT5Click(object sender, EventArgs e)
99 | {
100 | if (Common.Y_Axis != null)
101 | {
102 | s2 = Common.Y_Axis.Position;
103 | y2Pos.Value = s2;
104 | if (s1 == s2)
105 | {
106 | Common.ReportCmdKeyProgress(CmdKey.P0202);
107 | }
108 | else
109 | {
110 | factor = Math.Abs(s2 - s1) / h;
111 | pixScale.Value = factor;
112 | btFlag = false;
113 | Common.ReportCmdKeyProgress(CmdKey.P0203);
114 | }
115 | }
116 | else
117 | {
118 | Common.ReportCmdKeyProgress(CmdKey.S0309);
119 | }
120 |
121 | }
122 |
123 | private void PixelFactorManager_ConfirmClick(object sender, EventArgs e)
124 | {
125 | if (CaptureView.CaptureProvider != null)
126 | {
127 | CaptureView.CaptureProvider.Scale=factor;//倍率当前
128 | Common.ReportCmdKeyProgress(CmdKey.P0204);
129 | }
130 | else
131 | {
132 | Common.ReportCmdKeyProgress(CmdKey.S0309);
133 | }
134 | }
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/QSHP/UI/MidScreen.cs:
--------------------------------------------------------------------------------
1 | using QSHP.UI.Ctr;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Windows.Forms;
10 |
11 | namespace QSHP.UI
12 | {
13 | public partial class MidScreen : BaseForm
14 | {
15 | public List BtArray = new List();
16 | public MidScreen()
17 | {
18 | InitializeComponent();
19 | LoadButtonList();
20 | }
21 | private void LoadButtonList()
22 | {
23 | BtArray.Clear();
24 | BtArray.Add(BT1);
25 | BtArray.Add(BT2);
26 | BtArray.Add(BT3);
27 | BtArray.Add(BT4);
28 | BtArray.Add(BT5);
29 | BtArray.Add(BT6);
30 | BtArray.Add(BT7);
31 | BtArray.Add(BT8);
32 | }
33 | public MidScreen(string name)
34 | {
35 | InitializeComponent();
36 | LoadButtonList();
37 | this.Text = name;
38 | }
39 | public MidScreen(string name, int couter)
40 | {
41 | InitializeComponent();
42 | LoadButtonList();
43 | this.Text = name;
44 | for (int i = 0; i < BtArray.Count; i++)
45 | {
46 | BtArray[i].Visible = i < couter;
47 | }
48 | }
49 |
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/QSHP/UI/Test/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using System.Threading;
10 | using QSHP.HW;
11 | using QSHP.UI;
12 |
13 | namespace QSHP
14 | {
15 | public partial class Form1 : BaseForm
16 | {
17 | public Form1()
18 | {
19 | InitializeComponent();
20 | }
21 | private void button1_Click(object sender, EventArgs e)
22 | {
23 | if (!backgroundWorker1.IsBusy)
24 | {
25 | Globals.AppFunState = SysFunState.SysInit;
26 | backgroundWorker1.RunWorkerAsync();
27 | }
28 | }
29 | private void button2_Click(object sender, EventArgs e)
30 | {
31 | captureViewEx1.StartCapture();
32 | captureViewEx1.ShowMode = QSHP.UI.VideoMode.RealFollow;
33 | }
34 |
35 | private void Form1_Load(object sender, EventArgs e)
36 | {
37 |
38 | }
39 | public override bool FormLoadReady()
40 | {
41 | captureViewEx1.StartCapture();
42 | captureViewEx1.ShowMode = QSHP.UI.VideoMode.RealFollow;
43 | return base.FormLoadReady();
44 | }
45 | public override bool FormUnloadReady()
46 | {
47 | captureViewEx1.StopCapture();
48 | return base.FormUnloadReady();
49 | }
50 | private void button3_Click(object sender, EventArgs e)
51 | {
52 | captureViewEx1.StopCapture();
53 | }
54 |
55 |
56 | private void Form1_FormClosing(object sender, FormClosingEventArgs e)
57 | {
58 | // Common.HwProvider.UnInitHardwareDriver();
59 | }
60 |
61 |
62 | private void button4_Click_1(object sender, EventArgs e)
63 | {
64 | if (!backgroundWorker1.IsBusy)
65 | {
66 | Globals.AppFunState = SysFunState.TouchTesting;
67 | backgroundWorker1.RunWorkerAsync();
68 | }
69 | }
70 |
71 | private void button5_Click(object sender, EventArgs e)
72 | {
73 | Common.HwProvider.SaveSystemObjectConfig(Application.StartupPath + @"\789.xml");
74 | }
75 | PointF[] p = new PointF[3];
76 | private void button6_Click(object sender, EventArgs e)
77 | {
78 |
79 | }
80 |
81 | private void button7_Click(object sender, EventArgs e)
82 | {
83 | //Common.Z_Axis.AxisJogAbsWork(Common.HeightValue + 0.5f,true);
84 | //Common.Z_Axis.AxisJogAbsWork(Common.HeightValue);
85 | //if (centerFlag == 0)
86 | //{
87 | // p[0] = Common.AxisPoint;
88 | // centerFlag = 1;
89 | // button7.Text = "T调整取第二点";
90 | //}
91 | //else if (centerFlag == 1)
92 | //{
93 | // p[1] = Common.AxisPoint;
94 | // //p[2] = Com.RotateMath.RotateCenterPoint(p[0], p[1], 2f);
95 | // float a= (float)Com.RotateMath.GetPointsAngle(p[0], p[1]);
96 | // Common.T_Axis.AxisJogIncWork(a);
97 | // centerFlag = 0;
98 | // button7.Text = "T调整取第一点";
99 | //}
100 | }
101 |
102 | private void button8_Click(object sender, EventArgs e)
103 | {
104 |
105 | }
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/QSHP/UI/Test/Form5.cs:
--------------------------------------------------------------------------------
1 | using QSHP.SIM;
2 | using QSHP.UI;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.ComponentModel;
6 | using System.Data;
7 | using System.Diagnostics;
8 | using System.Drawing;
9 | using System.Linq;
10 | using System.Text;
11 | using System.Threading;
12 | using System.Windows.Forms;
13 |
14 | namespace QSHP
15 | {
16 | public partial class Form5 : BaseForm
17 | {
18 | Stopwatch wacth = new Stopwatch();
19 | MotorModel motor = new MotorModel();
20 | public Form5()
21 | {
22 | InitializeComponent();
23 | motor.ProgressChanged += motor_ProgressChanged;
24 | }
25 |
26 | void motor_ProgressChanged(object sender, ProgressChangedEventArgs e)
27 | {
28 | try
29 | {
30 | spdPlot.Titles[0].Text = "距离:" + motor.Position.ToString("F4") + " 速度: " + motor.Speed.ToString("f3");
31 | spdPlot.Titles[1].Text = "总计用时:" + wacth.Elapsed.ToString();
32 | spdPlot.Series[0].Points.AddY(motor.Position);
33 | }
34 | catch
35 | {
36 |
37 | }
38 | }
39 |
40 | private void button1_Click(object sender, EventArgs e)
41 | {
42 | wacth.Restart();
43 | motor.SetSpeed((float)SetSpeed.Value);
44 | motor.JogAbs ((float)SetPos.Value);
45 | }
46 |
47 | private void Form4_Load(object sender, EventArgs e)
48 | {
49 | motor.InitAmpC();
50 | }
51 |
52 | private void button2_Click_1(object sender, EventArgs e)
53 | {
54 | motor.JogStop();
55 | }
56 |
57 | private void Form4_FormClosing(object sender, FormClosingEventArgs e)
58 | {
59 |
60 | }
61 |
62 | private void button3_Click(object sender, EventArgs e)
63 | {
64 |
65 | wacth.Restart();
66 | motor.SetSpeed((float)SetSpeed.Value);
67 | motor.JogStop();
68 | }
69 |
70 | private void button4_MouseDown(object sender, MouseEventArgs e)
71 | {
72 | wacth.Restart();
73 | motor.SetSpeed((float)SetSpeed.Value);
74 | motor.JogDir(1);
75 | }
76 |
77 | private void button5_MouseDown(object sender, MouseEventArgs e)
78 | {
79 | wacth.Restart();
80 | motor.SetSpeed((float)SetSpeed.Value);
81 | motor.JogDir(-1);
82 | }
83 |
84 | private void button5_MouseUp(object sender, MouseEventArgs e)
85 | {
86 | motor.JogDir(0);
87 | }
88 |
89 | private void button6_Click(object sender, EventArgs e)
90 | {
91 | wacth.Restart();
92 | motor.SetSpeed((float)SetSpeed.Value);
93 | motor.JogInc((float)incPos.Value);
94 | }
95 |
96 | private void button7_Click(object sender, EventArgs e)
97 | {
98 | wacth.Restart();
99 | motor.SetSpeed((float)SetSpeed.Value);
100 | motor.JogInc((float)-incPos.Value);
101 | }
102 |
103 | private void spdPlot_Click(object sender, EventArgs e)
104 | {
105 |
106 | }
107 |
108 | private void Form5_BT0Click(object sender, EventArgs e)
109 | {
110 | MessageBox.Show("软件开发");
111 | }
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/QSHP/UI/User/AlignFormBase.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace QSHP.UI
2 | {
3 | partial class AlignFormBase
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.cap = new QSHP.UI.CaptureViewEx();
32 | this.SuspendLayout();
33 | //
34 | // cap
35 | //
36 | this.cap.ApplyBinning = true;
37 | this.cap.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
38 | this.cap.CaptureProvider = null;
39 | this.cap.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
40 | this.cap.Location = new System.Drawing.Point(4, 5);
41 | this.cap.MouseFollow = true;
42 | this.cap.Name = "cap";
43 | this.cap.ShowMode = QSHP.UI.VideoMode.Logo;
44 | this.cap.Size = new System.Drawing.Size(584, 488);
45 | this.cap.TabIndex = 2;
46 | this.cap.XGuidesWidth = 30;
47 | this.cap.XStep = 2F;
48 | this.cap.YGuidesWidth = 258;
49 | this.cap.YStep = 2F;
50 | //
51 | // AlignFormBase
52 | //
53 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
54 | this.ClientSize = new System.Drawing.Size(815, 495);
55 | this.Controls.Add(this.cap);
56 | this.Name = "AlignFormBase";
57 | this.Text = "AlignFormBase";
58 | this.Load += new System.EventHandler(this.AlignFormBase_Load);
59 | this.ResumeLayout(false);
60 |
61 | }
62 |
63 | #endregion
64 |
65 | private CaptureViewEx cap;
66 | }
67 | }
--------------------------------------------------------------------------------
/QSHP/UI/User/BaseForm.Designer.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Forms;
2 |
3 | namespace QSHP.UI
4 | {
5 | partial class BaseForm
6 | {
7 | ///
8 | /// Required designer variable.
9 | ///
10 | private System.ComponentModel.IContainer components = null;
11 |
12 | ///
13 | /// Clean up any resources being used.
14 | ///
15 | /// true if managed resources should be disposed; otherwise, false.
16 | protected override void Dispose(bool disposing)
17 | {
18 | if (disposing && (components != null))
19 | {
20 | components.Dispose();
21 | }
22 | base.Dispose(disposing);
23 | }
24 |
25 | #region Windows Form Designer generated code
26 |
27 | ///
28 | /// Required method for Designer support - do not modify
29 | /// the contents of this method with the code editor.
30 | ///
31 | private void InitializeComponent()
32 | {
33 | this.SuspendLayout();
34 | //
35 | // BaseForm
36 | //
37 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
38 | this.ClientSize = new System.Drawing.Size(815, 495);
39 | this.DoubleBuffered = true;
40 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
41 | this.Margin = new System.Windows.Forms.Padding(4);
42 | this.Name = "BaseForm";
43 | this.ShowInTaskbar = false;
44 | this.Text = "BaseForm";
45 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BaseForm_FormClosing);
46 | this.ResumeLayout(false);
47 |
48 | }
49 |
50 | #endregion
51 | }
52 | }
--------------------------------------------------------------------------------
/QSHP/UI/User/ChannelCtrList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using QSHP.Data;
10 |
11 | namespace QSHP.UI.User
12 | {
13 | public partial class ChannelCtrList : UserControl
14 | {
15 | public event EventHandler UserEnabledChanged;
16 | private byte cHIndex = 0;
17 |
18 | private CutChannel ch;
19 | [Bindable(true)]
20 | public CutChannel CH
21 | {
22 | get
23 | {
24 | return ch;
25 | }
26 | set
27 | {
28 | ch = value;
29 | if (ch != null)
30 | {
31 | this.Enabled = ch.Enable;
32 | LoadCutChannelData(ch);
33 | }
34 | }
35 | }
36 |
37 | [Bindable(true)]
38 | public new bool Enabled
39 | {
40 | get
41 | {
42 | return enableBt.Checked;
43 | }
44 | set
45 | {
46 | enableBt.Checked = value;
47 | }
48 | }
49 |
50 | [Browsable(true)]
51 | public override string Text
52 | {
53 | get
54 | {
55 | return enableBt.Text;
56 | }
57 |
58 | set
59 | {
60 | enableBt.Text = value;
61 | }
62 | }
63 | [Browsable(true)]
64 | public byte CHIndex
65 | {
66 | get
67 | {
68 | return cHIndex;
69 | }
70 |
71 | set
72 | {
73 | if (value < 11)
74 | {
75 | cHIndex = value;
76 | Text = string.Format("CH{0}",cHIndex);
77 | }
78 | }
79 | }
80 |
81 | public ChannelCtrList()
82 | {
83 | InitializeComponent();
84 | }
85 |
86 | private void enableBt_CheckedChanged(object sender, EventArgs e)
87 | {
88 | panelEx1.Enabled = enableBt.Checked;
89 | if (UserEnabledChanged != null)
90 | {
91 | UserEnabledChanged(this, null);
92 | }
93 | }
94 |
95 | private void LoadCutChannelData(CutChannel c)
96 | {
97 | this.Enabled = c.Enable;
98 | cutSpeed.Value = c.Speed;
99 | cutLeave.Value = c.ReDepth;
100 | cutLeave2.Value = c.ReDepth2;
101 | cutStep.Value = c.IndexStep;
102 | cutLine.Value = c.TotalLine;
103 | yOffset.Value = c.YPosAdj;
104 | tOffset.Value = c.TPosAdj;
105 | tStartPos.Value = c.TRoatePos;
106 | pauseLine.Value = c.PauseTick;
107 | pauseMode.SelectedIndex = c.PauseMode;
108 | cutDir.SelectedIndex = (int)c.Style;//0 向后 1 向前
109 | }
110 |
111 | public void SaveCutChannelData()
112 | {
113 | if (ch != null)
114 | {
115 | ch.Enable = this.Enabled;
116 | ch.Speed = cutSpeed.Value;
117 | ch.ReDepth = cutLeave.Value;
118 | ch.ReDepth2 = cutLeave2.Value;
119 | ch.IndexStep = cutStep.Value;
120 | ch.TotalLine = cutLine.Int;
121 | ch.YPosAdj = yOffset.Value;
122 | ch.TPosAdj = tOffset.Value;
123 | ch.TRoatePos = tStartPos.Value;
124 | ch.PauseTick = pauseLine.Int;
125 | ch.PauseMode = pauseMode.SelectedIndex;
126 | ch.StandMode = true;
127 | ch.Segs.Clear();
128 | ch.Style = (CutStyle)cutDir.SelectedIndex;
129 | }
130 | }
131 |
132 | public void ClearCutChannelData()
133 | {
134 | this.enableBt.Checked = false;
135 | cutSpeed.Value = 0;
136 | cutLeave.Value = 0;
137 | cutLeave2.Value = 0;
138 | cutStep.Value = 0;
139 | cutLine.Value = 0;
140 | yOffset.Value = 0;
141 | tOffset.Value = 0;
142 | tStartPos.Value = 0;
143 | pauseLine.Value = 0;
144 | pauseMode.SelectedIndex = 0;
145 | cutDir.SelectedIndex = 0;
146 | }
147 |
148 | public bool CheckChannelDataIsValid()
149 | {
150 | bool flag = true;
151 | if (Enabled)
152 | {
153 | if (cutSpeed.Value == 0)
154 | {
155 | cutSpeed.SetError = true;
156 | flag = false;
157 | }
158 | if (cutStep.Value == 0)
159 | {
160 | cutStep.SetError = true;
161 | flag = false;
162 | }
163 | if (cutLine.Value == 0)
164 | {
165 | cutLine.SetError = true;
166 | flag = true;
167 | }
168 | }
169 | return flag;
170 | }
171 | }
172 | }
173 |
--------------------------------------------------------------------------------
/QSHP/UI/User/SegmentCtr.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using QSHP.Data;
10 |
11 | namespace QSHP.UI.User
12 | {
13 | public partial class SegmentCtr : UserControl
14 | {
15 | public event EventHandler UserEnabledChanged;
16 | int segIndex = 0;
17 | CutSegment seg;
18 |
19 | [Bindable(true)]
20 | public new bool Enabled
21 | {
22 | get
23 | {
24 | return enableBt.Checked;
25 | }
26 | set
27 | {
28 | enableBt.Checked = value;
29 | }
30 | }
31 | [Browsable(true)]
32 | public override string Text
33 | {
34 | get
35 | {
36 | return enableBt.Text;
37 | }
38 |
39 | set
40 | {
41 | enableBt.Text = value;
42 | }
43 | }
44 | [Browsable(true)]
45 | public int SegIndex
46 | {
47 | get
48 | {
49 | return segIndex;
50 | }
51 |
52 | set
53 | {
54 | if (value < 11)
55 | {
56 | segIndex = value;
57 | Text = string.Format("Seg{0}", segIndex);
58 | }
59 | }
60 | }
61 | [Browsable(true)]
62 | public CutSegment Seg
63 | {
64 | get
65 | {
66 | return seg;
67 | }
68 |
69 | set
70 | {
71 | seg = value;
72 | if (seg != null)
73 | {
74 | this.Enabled = seg.Enable;
75 | LoadCutSegmentData(seg);
76 | }
77 | }
78 | }
79 |
80 |
81 | public SegmentCtr()
82 | {
83 | InitializeComponent();
84 | }
85 |
86 | private void LoadCutSegmentData(CutSegment s)
87 | {
88 | this.Enabled = s.Enable;
89 | cutSpeed.Value = s.Speed;
90 | cutLeave.Value = s.ReDepth;
91 | cutLeave2.Value = s.ReDepth2;
92 | cutStep.Value = s.IndexStep;
93 | cutLine.Value = s.TotalLine;
94 | }
95 | public void SaveCutSegmentData()
96 | {
97 | if (seg != null)
98 | {
99 | seg.Enable = this.Enabled;
100 | seg.Speed = cutSpeed.Value;
101 | seg.ReDepth = cutLeave.Value;
102 | seg.ReDepth2 = cutLeave2.Value;
103 | seg.IndexStep = cutStep.Value;
104 | seg.TotalLine = cutLine.Int;
105 | }
106 | }
107 | public void ClearCutSegmentData()
108 | {
109 | this.enableBt.Checked = false;
110 | cutSpeed.Value = 0;
111 | cutLeave.Value = 0;
112 | cutLeave2.Value = 0;
113 | cutStep.Value = 0;
114 | cutLine.Value = 0;
115 | }
116 | public bool CheckChannelDataIsValid()
117 | {
118 | if (Enabled)
119 | {
120 | bool flag = true;
121 | if (cutLine.Value == 0)
122 | {
123 | cutLine.SetError = true;
124 | flag = false;
125 | }
126 | if (cutStep.Value == 0)
127 | {
128 | cutStep.SetError =true;
129 | flag = false;
130 | }
131 | if (cutSpeed.Value == 0)
132 | {
133 | cutSpeed.SetError = true;
134 | flag = false;
135 | }
136 | return flag;
137 | }
138 | return true;
139 | }
140 | private void EnableBt_CheckedChanged(object sender, EventArgs e)
141 | {
142 | panelEx1.Enabled = enableBt.Checked;
143 | if (UserEnabledChanged != null)
144 | {
145 | UserEnabledChanged(this, null);
146 | }
147 | }
148 | }
149 | }
150 |
--------------------------------------------------------------------------------
/QSHP/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/QSHP/logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/QSHP/logo.ico
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #QSHP工业控制软件#
2 |
3 | `QSHP运动控制软件`是一款基于C# 开发的集成图像检测、四轴运动、精密切削等工业控制软件,可广泛应用于数控车床、划片机、自动切削设备、精密控制系统,可扩展集成各种硬件驱动器、CCD变频器等常见电机驱动设备和各类工业相机、IO控制卡操作。
4 |
5 | 软件当前已集成实现了(Pmac卡、Copley、台达、鸣志驱动器控制;台达变频器、西伯麦亚变频器; 北京微视、USB2.0相机、实现了CanOpen401、CanOpen402、Modbus总线)等常见工业设备控制;
6 |
7 | 软件当前支持运动轨迹规划、多模式配置、软键盘输入、语音播报、权限管理、网络管理、远程控制、SVN备份、加工报表分析、CAD文件导入(后期支持)等操作,可依据需求实现与MES系统的集成。
8 |
9 |
10 | 软件账户类型分为:操作人员、设备管理员、系统管理员、超级管理员,分权限操作,软件使用所有参数均安全有效,如强制删除参数文件(禁止操作),系统将自动生成建议配置文件。
11 |
12 | 软件支持手动切割、半自动切割、全自动切割;支持单通道、标准双通道、通道多步距、任意通道等模式切割,支持自动调焦、非接触式测高等接口,支持单镜头倍率切换、双镜头,预留双轴划切接口,最多可扩展32路数字输入、数字输出、8路模拟输入,支持独立配置三色灯、蜂鸣器不同状态。
13 | ****
14 | 
15 |
16 | 版权所有。侵权必究
17 |
18 | hucya@qq.com
19 |
20 | QQ:296441439
21 | *****
--------------------------------------------------------------------------------
/开源说明文档.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hucya/QSHP/4ec46c237167cd13eab5f44e9bafc3633f339a70/开源说明文档.docx
--------------------------------------------------------------------------------